planet_diver.c
Planet Diver, Haunt and the orbiting spirals.
games/tbs/src/effect/parts/planet_diver.c on GitHub
Planet Diver, Haunt and the orbiting spirals. Part of effect.c, the battle effect object, compiled only through it.
Functions
BattleFx_RunPlanetDiver
void BattleFx_RunPlanetDiver(struct BattleEffectArgument *effect)
The user flashes and leaps into the air, turns into a ball of fire, falls onto the first target and bursts into chips that bounce on the ground.
Abilities: Planet Diver (kind 60).
88 frames. effect->side says which way the ball falls; actors[0] is where it lands.
Moves the user's object: it leaps on frame 4 and falls from frame 18. The flash's sheet and palette are replaced by the fireball's on frame 16.
Used by gBattleFx_EffectHandlers.
BattleFx_RunHaunt
void BattleFx_RunHaunt(struct BattleEffectArgument *effect)
Skulls close in on each target in turn.
Abilities: Haunt (kind 39).
Around each target, 32 frames apart, eight skulls appear one every 4 frames, scattered up to 64 pixels away, and close in on a point 20 pixels above the target while the group spins; the target flashes 32 frames into its turn, and a skull that reaches the centre is no longer drawn. The effect layer ripples throughout. PARTICLES holds 64 skulls per target, of which the first 8 are used.
Adds BattleFx_ArmBg2AffineHBlankDma, which feeds the ripple in work->bg2xLines to BG2X line by line, and removes it before it returns.
Used by gBattleFx_EffectHandlers.
BattleFx_RunOrbitingSpirals
void BattleFx_RunOrbitingSpirals(struct BattleEffectArgument *effect)
Four spirals circle 40 pixels above each target in turn, 16 frames apart, for 60 frames each, 16 pixels out from the centre; each target takes its damage pose halfway through.
Abilities: none (kind 34).
The effect layer ripples throughout, through BattleFx_ArmBg2AffineHBlankDma, which it adds and removes. It never lets the battle show damage, and leaves the targets' flash timers alone.
Used by gBattleFx_EffectHandlers.
Structures
ImpactChip
struct ImpactChip
One chip of the impact, laid over the same 28-byte records as PARTICLES but with its velocities in other places than struct EffectStep's.
| Field | Declared as | |
|---|---|---|
x | s32 x | canvas position, 16.16 fixed point |
y | s32 y | canvas position, 16.16; the ground is y 112 |
velocityX | s32 velocityX | 16.16 pixels a frame, damped to 56/64 each frame |
unused0c | s32 unused0c | an EffectStep's velocityX; never read |
velocityY | s32 velocityY | 16.16 pixels a frame, with 1/8 pixel of gravity |
unused14 | s32 unused14 | an EffectStep's velocityZ; never read |
life | s32 life | frames left; 0 is free |
Used by BattleFx_RunPlanetDiver.
Macros
PLANET_DIVER_IMPACT_CHIPS
#define PLANET_DIVER_IMPACT_CHIPS ((struct ImpactChip *)Ram_MapCellBuffer)
Ram_MapCellBuffer seen as Planet Diver's chips.
Used by BattleFx_RunPlanetDiver.
Also, macros without a comment: PLANET_DIVER_FRAMES, PLANET_DIVER_CLEARED_CHIPS, PLANET_DIVER_CHIPS, HAUNT_SCATTERED, HAUNT_SKULLS, HAUNT_SLOTS, ORBITING_SPIRALS_LIFE.