thrash.c
Thrash, Quick Strike and Vorpal Slash.
games/tbs/src/effect/parts/thrash.c on GitHub
Thrash, Quick Strike and Vorpal Slash. Part of effect.c, the battle effect object, compiled only through it.
Functions
BattleFx_RunThrash
void BattleFx_RunThrash(struct BattleEffectArgument *effect)
The user leaps high at the first target, then a burst of 32 sparks rises beneath it.
Abilities: Thrash (kind 388).
The leap takes the user three quarters of the way in 24 steps, starting up at 12.2 pixels a frame (16.16); after 29 frames the spark group plays with effect->variant set to 4, overriding the ability's own.
Used by gBattleFx_EffectHandlers.
BattleFx_RunSparkApproachVariant3
void BattleFx_RunSparkApproachVariant3(struct BattleEffectArgument *effect)
The user leaps at the first target, then a burst of 340 sparks rises beneath it and the canvas flashes.
Abilities: none (kind 387).
A lower leap than Thrash's (7.2 pixels a frame up), and the spark group after 12 frames with effect->variant set to 3, overriding the ability's own.
Used by gBattleFx_EffectHandlers.
BattleFx_RunQuickStrike
void BattleFx_RunQuickStrike(struct BattleEffectArgument *effect)
The user leaps at the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.
Abilities: Quick Strike (kind 52).
Used by gBattleFx_EffectHandlers.
BattleFx_RunVorpalSlash
void BattleFx_RunVorpalSlash(struct BattleEffectArgument *effect)
The user steps up to the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.
Abilities: Vorpal Slash (kind 65).
Used by gBattleFx_EffectHandlers.
BattleFx_RunFlashingStrike
void BattleFx_RunFlashingStrike(struct BattleEffectArgument *effect, s32 mode)
Plays a flashing strike, the runner of BattleFx_RunQuickStrike (mode 1) and BattleFx_RunVorpalSlash (mode 2); nothing passes mode 0.
The user steps up to the first target over 16 frames. Then four 120x120 pictures show for four frames each (mirrored when effect->side is 1), the canvas fills with colour 0x3f on frames 16 to 19, the battle shows the damage on frame 18, and on frame 20 the target reels and the screen shakes. 21 frames.
Opens and closes the canvas layer; the pictures take work->imageStorage and the start of Ram_MapCellBuffer.
mode: picks the pictures (RevealMaskE and F for 0, C and D for 1, A and B for 2); mode 1 also makes the step a hop.
Used by BattleFx_RunQuickStrike, BattleFx_RunVorpalSlash.
Macros
FLASHING_STRIKE_PICTURE_BYTES
#define FLASHING_STRIKE_PICTURE_BYTES (120 * 120)
One 120x120 picture of a flashing strike; two fill work->imageStorage and two more Ram_MapCellBuffer.
Used by BattleFx_RunFlashingStrike.