Alchemy

stat_change.c

Stat boosts and reductions (Impact, Guard, Ward, Dull, Weaken ...).

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

Stat boosts and reductions (Impact, Guard, Ward, Dull, Weaken ...). Part of effect.c, the battle effect object, compiled only through it.

Functions

BattleFx_RunImpact

void BattleFx_RunImpact(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a dagger in Mars colours.

Abilities: Impact, High Impact, Demon Spear, Angel Spear (kind 26); Forge (kind 210); kind 46 is used by no ability.

Used by gBattleFx_EffectHandlers.

Line 11

BattleFx_RunGuard

void BattleFx_RunGuard(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a shield in Mars colours.

Abilities: Guard, Protect, Guardian, Protector (kind 28); Corona (kind 211).

Used by gBattleFx_EffectHandlers.

Line 17

BattleFx_RunWard

void BattleFx_RunWard(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a shield in Jupiter colours.

Abilities: Ward, Resist, Magic Shell, Magic Shield (kind 30); Breeze (kind 215).

Used by gBattleFx_EffectHandlers.

Line 24

BattleFx_RunGranite

void BattleFx_RunGranite(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a violet streak in Venus colours.

Abilities: Granite (kind 200).

Used by gBattleFx_EffectHandlers.

Line 30

BattleFx_RunFlash

void BattleFx_RunFlash(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a violet streak in Mars colours.

Abilities: Flash (kind 213).

Used by gBattleFx_EffectHandlers.

Line 36

BattleFx_RunZephyr

void BattleFx_RunZephyr(struct BattleEffectArgument *effect)

Gathers stat-boost light and displays a wisp without replacing its palette.

Abilities: Zephyr (kind 216).

Used by gBattleFx_EffectHandlers.

Line 42

BattleFx_RunStatBoost

void BattleFx_RunStatBoost(struct BattleEffectArgument *effect, u32 mode)

Flares of light swirl in to the centre of each target, one target every 8 frames, burst, and the mode's picture plays. Target n's flares appear from frame 8n + 1; it glows white on 8n + 48, the burst plays from 8n + 52 and the picture, with a sound, from 8n + 80. The canvas is shown at 1.25 times its width (canvas x is 4/5 of screen x). PARTICLES holds the gathering flares, 64 for each target.

Reached through the six wrappers above, Impact to Zephyr. Copies the mode's palette over the first 128 bytes of BG palette RAM (all but Zephyr), writes REG_BG2PA and REG_BG2X, and ends with the transfer callback removed and the canvas layer closed; the blitters are built and freed within each frame.

effect: the targets. With prelude 1, a Djinni appears first, sways and
        rises.
mode: the picture: 0 a dagger, 1 and 2 a shield, 3 and 5 a violet
      streak, 4 a wisp. The palette comes from the Venus djinni in mode
      3, the Jupiter djinni in mode 2, the Mars djinni in modes 0, 1 and
      5; mode 4 keeps the palette. The Djinni is Venus in mode 3,
      Jupiter in modes 2 and 4, Mars otherwise.

Used by BattleFx_RunFlash, BattleFx_RunGranite, BattleFx_RunGuard, BattleFx_RunImpact, BattleFx_RunWard, BattleFx_RunZephyr.

Line 76

BattleFx_RunDull

void BattleFx_RunDull(struct BattleEffectArgument *effect)

Breaks the dagger picture into shards that fade through darker copies.

Abilities: Dull, Blunt (kind 27).

Used by gBattleFx_EffectHandlers.

Line 374

BattleFx_RunImpair

void BattleFx_RunImpair(struct BattleEffectArgument *effect)

A shield appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours (style 1).

Abilities: Impair, Debilitate (kind 29); kind 47 is used by no ability. Casting impact 21 (Meltdown) also ends by calling it.

Used by BattleFx_RunCastingImpact, gBattleFx_EffectHandlers.

Line 382

BattleFx_RunWeaken

void BattleFx_RunWeaken(struct BattleEffectArgument *effect)

A shield appears over each target and breaks into fading shards, in the pink burst's colours (style 2).

Abilities: Weaken, Enfeeble (kind 31).

Used by gBattleFx_EffectHandlers.

Line 389

BattleFx_RunStatReductionMode3

UNUSED void BattleFx_RunStatReductionMode3(struct BattleEffectArgument *effect)

Breaks the shield picture into fading shards with style 3, which plays as style 2 does. No effect table entry reaches it.

Line 394

BattleFx_RunStatReduction

void BattleFx_RunStatReduction(struct BattleEffectArgument *effect, s32 mode)

Stat cuts: a dagger (mode 0) or a shield (other modes) appears over each target, 4 frames apart, and then breaks into 24 shards that fly off and fade out through the darker copies. In each target's own frames the picture plays until about frame 24, then breaks with a sound; the shards darken from frame 29 and are gone after frame 60.

Reached through Dull, Impair, Weaken and the unused mode 3 wrapper above. Copies the mode's palette over the first 128 bytes of BG palette RAM, writes REG_BG2PA and REG_BG2X, and ends with the transfer callback removed, both blitters freed and the canvas layer closed.

effect: the targets.
mode: 0 the dagger and the pink burst palette, 1 the shield and the
      glow orb palette, 2 and 3 the shield and the pink burst palette.

Used by BattleFx_RunDull, BattleFx_RunImpair, BattleFx_RunStatReductionMode3, BattleFx_RunWeaken.

Line 419

Enumerations

StatBoostSheet

enum StatBoostSheet

Where each picture sits in the sheet.

Value=
STAT_BOOST_FLARES0x0000flares (ParticleSpritesD)
STAT_BOOST_BURST0x060esix 40x40 bursts of light (GlowOrb)
STAT_BOOST_PICTURE0x2b8ethe picture the mode picks
STAT_BOOST_DJINNI0x65c0the 40x40 djinni

Line 46

Macros, without a comment: STAT_BOOST_SCATTERED, STAT_BOOST_DRAWN, STAT_BOOST_SLOTS, STAT_REDUCTION_SHARD_CELLS, STAT_REDUCTION_SHARD_BYTES, STAT_REDUCTION_SHARDS, STAT_REDUCTION_SLOTS.

On this page