Alchemy

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.

Line 52

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.

Line 247

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.

Line 375

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.

FieldDeclared as
xs32 xcanvas position, 16.16 fixed point
ys32 ycanvas position, 16.16; the ground is y 112
velocityXs32 velocityX16.16 pixels a frame, damped to 56/64 each frame
unused0cs32 unused0can EffectStep's velocityX; never read
velocityYs32 velocityY16.16 pixels a frame, with 1/8 pixel of gravity
unused14s32 unused14an EffectStep's velocityZ; never read
lifes32 lifeframes left; 0 is free

Used by BattleFx_RunPlanetDiver.

Line 25

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.

Line 36

Also, macros without a comment: PLANET_DIVER_FRAMES, PLANET_DIVER_CLEARED_CHIPS, PLANET_DIVER_CHIPS, HAUNT_SCATTERED, HAUNT_SKULLS, HAUNT_SLOTS, ORBITING_SPIRALS_LIFE.

On this page