thor.c
The Thor summon.
games/tbs/src/effect/parts/thor.c on GitHub
The Thor summon. Part of effect.c, the battle effect object, compiled only through it.
Functions
BattleFx_RunThor
void BattleFx_RunThor(struct BattleEffectArgument *effect)
The scene plays in two parts on the effect canvas.
Abilities: Thor (scene kind 12).
In the dusk part (THOR_DUSK_FRAMES, which A or B cuts short) a circle of 128 dots and three lines across it form over scrolling dusk clouds; the circle turns, sinks into the sky and a beam of light falls from it. In the lightning part (THOR_LIGHTNING_FRAMES) a pillar of lightning strikes the formation and throws sparks, THOR_BOLTS violet bolts follow while a violet mote sways above, and the formation is pushed back in smoke until an impact burst ends the effect. The sparks live in THOR_PARTICLES; a spark whose variant is 0 is free, and a positive variant counts the frames it has left.
Used by BattleFx_RunSceneEffect.
Macros
THOR_PARTICLES
#define THOR_PARTICLES ((struct EffectStep *)(Ram_MapCellBuffer + 0xc58))
910 sparks from Ram_MapCellBuffer + 0xc58; the smoke pictures come before them.
Used by BattleFx_RunThor.
THOR_SPRITES_CELLS
#define THOR_SPRITES_CELLS 0x1800
The particle sprites, after the light fan pictures.
Used by BattleFx_RunThor.
THOR_MOTE_CELLS
#define THOR_MOTE_CELLS 0x6000
The violet mote in the second part's sheet.
Used by BattleFx_RunThor.
THOR_LAUNCH_SPARKS
#define THOR_LAUNCH_SPARKS(spark, index, px, py, angleExpr, max)
Launches up to max sparks from (px, py), 16.16, into the free slots (variant 0) of THOR_PARTICLES, walking them with spark and counting with index. Each flies at angle at a random speed of 32 to 1054 (128ths of a pixel a frame) and lives 32 to 39 frames. Used for the pillar's 512 sparks and each bolt's 16; the mote's sparks are launched inline.
Used by BattleFx_RunThor.
Also, macros without a comment: THOR_PARTICLE_COUNT, THOR_DIMMED_DOTS, THOR_DIMMED_DOT_BYTES, THOR_DUSK_FRAMES, THOR_LIGHTNING_FRAMES, THOR_BOLTS, THOR_BOLT_SIZE, THOR_BOLT_BYTES.