Alchemy

plasma.c

Plasma, and the spark groups of Blast and Dynamite.

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

Plasma, and the spark groups of Blast and Dynamite. Part of effect.c, the battle effect object, compiled only through it.

Functions

BattleFx_RunPlasma

void BattleFx_RunPlasma(struct BattleEffectArgument *effect)

Pillars of lightning strike one every 8 frames, each with a white flash, throwing sparks up from the ground and knocking the targets back; the battle shows the damage on frame 32.

Abilities: Plasma, Shine Plasma, Spark Plasma, Thunderclap, Thunderbolt, Thunderstorm (kind 18).

effect->variant picks how many pillars (gPlasma_Counts), how many sparks each throws and how long the screen shakes (gPlasma_Sparks); with variant 2 the camera also swings round for the first 64 frames. effect->side picks the row of pillar positions.

Sparks are PARTICLES 0 to 1023, canvas pixels in 16.16. Sets REG_BLDALPHA, loads the violet palette into the first 64 background colours (variant 2 keeps the lightning pillar sheet's), scrolls the camera (variant 2) and sets work->shakeFrames at each strike.

Used by gBattleFx_EffectHandlers.

Line 38

BattleFx_RunNova

void BattleFx_RunNova(struct BattleEffectArgument *effect)

Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).

Abilities: Blast, Nova, Supernova, Fire Bomb, Cluster Bomb, Carpet Bomb (kind 15).

Used by gBattleFx_EffectHandlers.

Line 198

BattleFx_RunDynamite

void BattleFx_RunDynamite(struct BattleEffectArgument *effect)

Orange bursts at (60, 64), the canvas in front (priority 0).

Abilities: Dynamite (kind 338).

Used by gBattleFx_EffectHandlers.

Line 204

BattleFx_RunSparkGroups

void BattleFx_RunSparkGroups(struct BattleEffectArgument *effect, s32 mode)

One to three bursts, 8 frames apart: each flashes, rings itself with
twelve smaller flashes that fade, and throws out sparks that bounce on
the ground; every burst knocks the targets back.
effect->variant picks the shape from gPlasma_Shapes: sparks per
burst, how many bursts, and each burst's offset across. Variant 2 also
scrolls the camera, and variant 3 flashes the whole canvas on frame 4.
mode : 0 at (60, 48), the battle shows the damage on frame 24;
       1 at (60, 64), orange; the damage shows on frame 2;
       2 below the user, in the LightningBolt colours, with the sparks
         rising instead of falling; the damage shows on frame 2.

Called by BattleFx_RunNova (mode 0) and BattleFx_RunDynamite (mode 1), and in mode 2 by BattleFx_RunCastingImpact for Severe Blow (variant 3) and by BattleFx_RunThrash (variant 4) and BattleFx_RunSparkApproachVariant3 (variant 3) in thrash.c, which set effect->variant first.

work->particles hold the ring flashes, 16 for each burst; PARTICLES the sparks, one run of gPlasma_Shapes' count for each burst. Sets REG_BLDALPHA, loads the flash burst palette into the first 64 background colours, then the orange (mode 1) or lightning (mode 2) one over it, scrolls the camera (variant 2) and sets work->shakeFrames at each burst.

Used by BattleFx_RunCastingImpact, BattleFx_RunDynamite, BattleFx_RunNova, BattleFx_RunSparkApproachVariant3, BattleFx_RunThrash.

Line 234

Macros

PLASMA_COLUMN_X

#define PLASMA_COLUMN_X(side, pillar) gPlasma_Columns[(side)][(pillar)]

gPlasma_Columns has seven pillars for each side.

Used by BattleFx_RunPlasma.

Line 20

Also, macros without a comment: PLASMA_SPARK_COUNT, PLASMA_SPACING, PLASMA_SECOND_IMAGE, SPARK_GROUPS_FLASHES, SPARK_GROUPS_SPACING, SPARK_GROUPS_RING, SPARK_GROUPS_FLASH_DRAWN.

On this page