Alchemy

bolt.c

Bolt.

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

Bolt. Part of effect.c, the battle effect object, compiled only through it.

Functions

BattleFx_RunBolt

void BattleFx_RunBolt(struct BattleEffectArgument *effect)

A bolt of lightning strikes each target in turn, 8 frames apart.

Abilities: Bolt, Flash Bolt, Blue Bolt (kind 16).

Target i's turn starts on frame 8i with a flash of the canvas. The bolt drops from the top, 64 pixels a frame down to y 104, and the screen shakes the frame after; on frame 8i + 2 sparks fly up from its foot and glints flicker there for 22 frames; on frame 8i + 4 the target recoils. The battle moves on to the results on frame 24.

PARTICLES holds the sparks, 128 for each target. Sets work->shakeFrames on each strike, and ends with the transfer callback removed, the blitter freed and the canvas layer closed; the glints' blitter is built and freed for each glint.

effect: the targets; variant picks the row of gBolt_Counts
        and the glints' blend.

Used by gBattleFx_EffectHandlers.

Line 40

Macros

BOLT_GLINT_BLITTER

#define BOLT_GLINT_BLITTER

The second blitter, made anew for each glint with its random flip.

Used by BattleFx_RunBolt.

Line 8

BOLT_CELLS

#define BOLT_CELLS 0xc56

The bolt pictures in the sheet, after the tornado.

Used by BattleFx_RunBolt.

Line 21

On this page