Alchemy

vortices.c

Froth and Whirlwind.

games/tbs/src/effect/parts/vortices.c on GitHub

Froth and Whirlwind. Part of effect.c, the battle effect object, compiled only through it.

Functions

BattleFx_RunFroth

void BattleFx_RunFroth(struct BattleEffectArgument *effect)

Motes fly out of the top of the user, hang, and from 48 frames after each appears home in on the targets in turn; each that reaches the ground strikes in a burst, flashing and knocking back its target, while the camera swings round over frames 17 to 63.

Abilities: Froth, Froth Sphere, Froth Spiral (kind 10).

effect->variant picks the volley from gVortices_Counts (motes and frames) and how hard the screen shakes.

work->particles 0 to 29 are the motes, battle positions in 16.16 until a mote strikes and then its burst's canvas pixels; from 32, one seat for each target. The first 30 bytes of Ram_MapCellBuffer mark the motes that have struck. Loads the vortex palette into the first 64 background colours, sets REG_BLDALPHA and work->shakeFrames, and turns the camera through Camera_ApplyPhasedDelta (work->cameraDelta and cameraPhase), which it removes before it returns.

Used by gBattleFx_EffectHandlers.

Line 36

BattleFx_RunWhirlwind

void BattleFx_RunWhirlwind(struct BattleEffectArgument *effect)

Tornadoes sweep across the targets for 80 frames, sparkling with glints; the canvas flashes and the targets reel seven times, 8 frames apart, from frame 16, and the battle shows the damage on frame 32.

Abilities: Whirlwind, Tornado, Tempest, Gale, Typhoon, Hurricane (kind 20).

effect->variant picks the shape from gVortices_Shapes: how many tornadoes, how far they sway and how hard the screen shakes.

work->particles 0 to 15 are the glints, four for each tornado (so at most four tornadoes), offsets in pixels from its top left. Loads the tornado palette into the first 64 background colours, fades the canvas in and out through REG_BLDALPHA and keeps work->shakeFrames at 1 so the screen shakes every frame.

Used by gBattleFx_EffectHandlers.

Line 189

Macros

FROTH_MOTES

#define FROTH_MOTES 30

The motes set up in work->particles, before the target seats: no row of gVortices_Counts may ask for more.

Used by BattleFx_RunFroth.

Line 11

WHIRLWIND_TORNADO_CELLS

#define WHIRLWIND_TORNADO_CELLS 0xc56

The tornado pictures follow the six glint cells (gBattleFx_GlintCells) in the sheet: 40x32 sections, the top and bottom ones' three frames interleaved, then the middle one's.

Used by BattleFx_RunWhirlwind.

Line 16

Also, macros without a comment: FROTH_MOTE_CELL, FROTH_FIRST_TARGET, WHIRLWIND_SECTION_BYTES.

On this page