Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_stat_change.c

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

Included by battle_effect.c.

Macros

NameDescription
#defineSTAT_BOOST_BURST_TICK 52When the first target's flares burst and its sprite appears, with the damage; each later target follows STAT_BOOST_TARGET_DELAY ticks behind.
#defineSTAT_BOOST_SPRITE_TICK 80
#defineSTAT_BOOST_TARGET_DELAY 8
#defineSTAT_BOOST_CRUCIBLE_FIRE_TICK (STAT_BOOST_BURST_TICK + 1)
#defineSTAT_CHANGE_PARTICLES (PARTICLE_POOL_COUNT / 2)The particles both kinds of stat change set out: the first half of the pool.
#defineSTAT_BOOST_TARGET_PARTICLES 64Each target swirls in STAT_BOOST_TARGET_FLARES flares from its own run of STAT_BOOST_TARGET_PARTICLES particles.
#defineSTAT_BOOST_TARGET_FLARES 32
#defineSTAT_BOOST_FLARE_SPIN (TRIG_TURN / 64)How far the flares turn about the target each tick.
#defineSTAT_BOOST_FLARE_SIZE_MAX 6A flare is drawn at size STAT_BOOST_FLARE_SIZE_MAX at depth STAT_BOOST_FLARE_DEPTH_NEAR or nearer, one size smaller every STAT_BOOST_FLARE_DEPTH_STEP farther, and at size 1 from STAT_BOOST_FLARE_DEPTH_FAR on.
#defineSTAT_BOOST_FLARE_DEPTH_NEAR 314
#defineSTAT_BOOST_FLARE_DEPTH_STEP 64
#defineSTAT_BOOST_FLARE_DEPTH_FAR
#defineSTAT_BOOST_DJINNI_SWAY 20How far the prelude's Djinni sways to either side, in pixels.
#defineSTAT_BOOST_PARTY_CANVAS_X (DISPLAY_WIDTH * 4 / 5 - CANVAS_SIZE)The shift that sets the canvas, shown 1.25 times as wide, against the screen's right edge over the party.
#defineSTAT_REDUCTION_TARGET_PARTICLES 32Each target throws STAT_REDUCTION_TARGET_SHARDS shards from its own run of STAT_REDUCTION_TARGET_PARTICLES particles, STAT_REDUCTION_TARGET_DELAY ticks after the target before it.
#defineSTAT_REDUCTION_TARGET_SHARDS 24
#defineSTAT_REDUCTION_TARGET_DELAY 4

Enumerations

NameDescription
enumSTAT_BOOST_MODE { STAT_BOOST_IMPACT, STAT_BOOST_GUARD, STAT_BOOST_WARD, STAT_B … }The stat boosts' modes (btEffectRunStatBoost), each named for the effect that plays it.
enumSTAT_BOOST_SHEET { STAT_BOOST_FLARES, STAT_BOOST_BURST, STAT_BOOST_PICTURE, STA … }Where each picture sits in the sprite sheet.
enumSTAT_REDUCTION_MODE { STAT_REDUCTION_UNUSED, STAT_REDUCTION_IMPAIR, STAT_REDUCTION … }The stat reductions' modes (btEffectRunStatReduction).

Functions

NameDescription
voidbtEffectRunImpact (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a dagger appears in Mars colours.
voidbtEffectRunGuard (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a shield appears in Mars colours.
voidbtEffectRunIron (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a shield appears in Venus colours as the backdrop turns grey.
voidbtEffectRunUnusedStatBoost (BATTLE_EFFECT_PARM *args)Plays the stat boost's unused mode; no ability's effect names this one.
voidbtEffectRunWard (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a shield appears in Jupiter colours.
voidbtEffectRunSteam (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a shield appears in Mercury colours as the backdrop turns to Jupiter's colours.
voidbtEffectRunGranite (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a pane of light appears in Venus colours.
voidbtEffectRunFlash (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a pane of light appears in Mars colours.
voidbtEffectRunShade (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a pane of light appears in Mercury colours.
voidbtEffectRunGuardAura (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a pane of light appears in grey.
voidbtEffectRunZephyr (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a gust of wind sweeps across it in the colours already loaded, as this is the one boost that keeps the palette.
voidbtEffectRunCoal (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a gust of wind sweeps across it in Mars colours.
voidbtEffectRunCrucibleFire (BATTLE_EFFECT_PARM *args)The stat boost's burst with no swirling flares (STAT_BOOST_FLARES), with no prelude Djinni and the fade step cleared.
voidbtEffectRunStatBoost (BATTLE_EFFECT_PARM *args, Uint32 mode)Flares of light swirl in to the centre of each target in turn and burst, and the mode's picture plays over it.
voidbtEffectRunUnusedStatReduction (void *action)Breaks the dagger sprite into fading shards as Dull does, in the pink burst's colours; no effect table entry reaches it.
voidbtEffectRunDull (BATTLE_EFFECT_PARM *args)A dagger appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours.
voidbtEffectRunImpair (BATTLE_EFFECT_PARM *args)A shield appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours.
voidbtEffectRunWeaken (BATTLE_EFFECT_PARM *args)A shield appears over each target and breaks into fading shards, in the pink burst's colours.
voidbtEffectRunStatReduction (BATTLE_EFFECT_PARM *args, Sint32 mode)A dagger (Dull) or a shield (Impair and Weaken) appears over each target and breaks into shards that fly off and fade.

Description

Stat boosts and reductions (Impact, Guard, Ward, Dull, Weaken ...). Part of battle_effect.c.

Macros in detail

STAT_BOOST_BURST_TICK

#define STAT_BOOST_BURST_TICK 52

When the first target's flares burst and its sprite appears, with the damage; each later target follows STAT_BOOST_TARGET_DELAY ticks behind. Crucible Fire starts at STAT_BOOST_CRUCIBLE_FIRE_TICK, after the flares.

Referenced by btEffectRunStatBoost().

Definition at line 157 of file battle_effect_stat_change.c.

STAT_BOOST_SPRITE_TICK

#define STAT_BOOST_SPRITE_TICK 80

Referenced by btEffectRunStatBoost().

Definition at line 158 of file battle_effect_stat_change.c.

STAT_BOOST_TARGET_DELAY

#define STAT_BOOST_TARGET_DELAY 8

Referenced by btEffectRunStatBoost().

Definition at line 159 of file battle_effect_stat_change.c.

STAT_BOOST_CRUCIBLE_FIRE_TICK

#define STAT_BOOST_CRUCIBLE_FIRE_TICK (STAT_BOOST_BURST_TICK + 1)

Referenced by btEffectRunStatBoost().

Definition at line 160 of file battle_effect_stat_change.c.

STAT_CHANGE_PARTICLES

#define STAT_CHANGE_PARTICLES (PARTICLE_POOL_COUNT / 2)

The particles both kinds of stat change set out: the first half of the pool.

Referenced by btEffectRunStatBoost() and btEffectRunStatReduction().

Definition at line 163 of file battle_effect_stat_change.c.

STAT_BOOST_TARGET_PARTICLES

#define STAT_BOOST_TARGET_PARTICLES 64

Each target swirls in STAT_BOOST_TARGET_FLARES flares from its own run of STAT_BOOST_TARGET_PARTICLES particles.

Referenced by btEffectRunStatBoost().

Definition at line 166 of file battle_effect_stat_change.c.

STAT_BOOST_TARGET_FLARES

#define STAT_BOOST_TARGET_FLARES 32

Referenced by btEffectRunStatBoost().

Definition at line 167 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_SPIN

#define STAT_BOOST_FLARE_SPIN (TRIG_TURN / 64)

How far the flares turn about the target each tick.

Referenced by btEffectRunStatBoost().

Definition at line 169 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_SIZE_MAX

#define STAT_BOOST_FLARE_SIZE_MAX 6

A flare is drawn at size STAT_BOOST_FLARE_SIZE_MAX at depth STAT_BOOST_FLARE_DEPTH_NEAR or nearer, one size smaller every STAT_BOOST_FLARE_DEPTH_STEP farther, and at size 1 from STAT_BOOST_FLARE_DEPTH_FAR on.

Referenced by btEffectRunStatBoost().

Definition at line 174 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_DEPTH_NEAR

#define STAT_BOOST_FLARE_DEPTH_NEAR 314

Referenced by btEffectRunStatBoost().

Definition at line 175 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_DEPTH_STEP

#define STAT_BOOST_FLARE_DEPTH_STEP 64

Referenced by btEffectRunStatBoost().

Definition at line 176 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_DEPTH_FAR

#define STAT_BOOST_FLARE_DEPTH_FAR

Referenced by btEffectRunStatBoost().

Definition at line 177 of file battle_effect_stat_change.c.

STAT_BOOST_DJINNI_SWAY

#define STAT_BOOST_DJINNI_SWAY 20

How far the prelude's Djinni sways to either side, in pixels.

Referenced by btEffectRunStatBoost().

Definition at line 181 of file battle_effect_stat_change.c.

STAT_BOOST_PARTY_CANVAS_X

#define STAT_BOOST_PARTY_CANVAS_X (DISPLAY_WIDTH * 4 / 5 - CANVAS_SIZE)

The shift that sets the canvas, shown 1.25 times as wide, against the screen's right edge over the party.

Referenced by btEffectRunStatBoost().

Definition at line 184 of file battle_effect_stat_change.c.

STAT_REDUCTION_TARGET_PARTICLES

#define STAT_REDUCTION_TARGET_PARTICLES 32

Each target throws STAT_REDUCTION_TARGET_SHARDS shards from its own run of STAT_REDUCTION_TARGET_PARTICLES particles, STAT_REDUCTION_TARGET_DELAY ticks after the target before it.

Referenced by btEffectRunStatReduction().

Definition at line 742 of file battle_effect_stat_change.c.

STAT_REDUCTION_TARGET_SHARDS

#define STAT_REDUCTION_TARGET_SHARDS 24

Referenced by btEffectRunStatReduction().

Definition at line 743 of file battle_effect_stat_change.c.

STAT_REDUCTION_TARGET_DELAY

#define STAT_REDUCTION_TARGET_DELAY 4

Referenced by btEffectRunStatReduction().

Definition at line 744 of file battle_effect_stat_change.c.

Enumerations in detail

STAT_BOOST_MODE

enum STAT_BOOST_MODE

The stat boosts' modes (btEffectRunStatBoost), each named for the effect that plays it.

EnumeratorValueDescription
STAT_BOOST_IMPACTa dagger, in Mars colours
STAT_BOOST_GUARDa shield, in Mars colours
STAT_BOOST_WARDa shield, in Jupiter colours
STAT_BOOST_GRANITEa pane of light, in Venus colours
STAT_BOOST_ZEPHYRa gust of wind, keeping the palette
STAT_BOOST_FLASHa pane of light, in Mars colours
STAT_BOOST_IRONa shield, in Venus colours, the backdrop turning grey
STAT_BOOST_UNUSEDa shield, in Mercury colours; no ability's effect plays it
STAT_BOOST_SHADEa pane of light, in Mercury colours
STAT_BOOST_COALa gust of wind, in Mars colours
STAT_BOOST_CRUCIBLE_FIREImpact's burst without the swirling flares
STAT_BOOST_STEAMa shield, in Mercury colours, the backdrop turning to Jupiter's
STAT_BOOST_GUARD_AURAa pane of light, in grey

Definition at line 6 of file battle_effect_stat_change.c.

STAT_BOOST_SHEET

enum STAT_BOOST_SHEET

Where each picture sits in the sprite sheet.

EnumeratorValueDescription
STAT_BOOST_FLARES0flares (BlueGlowSheet)
STAT_BOOST_BURST1550six bursts of light (GlowOrb)
STAT_BOOST_PICTURE11150the picture the mode picks
STAT_BOOST_DJINNI26048the Djinni

Definition at line 146 of file battle_effect_stat_change.c.

STAT_REDUCTION_MODE

enum STAT_REDUCTION_MODE

The stat reductions' modes (btEffectRunStatReduction).

EnumeratorValueDescription
STAT_REDUCTION_UNUSEDa dagger, in the pink burst's colours; unused
STAT_REDUCTION_IMPAIRa shield, in the glow orb's colours
STAT_REDUCTION_WEAKENa shield, in the pink burst's colours
STAT_REDUCTION_DULLa dagger, in the glow orb's colours

Definition at line 697 of file battle_effect_stat_change.c.

Functions in detail

btEffectRunImpact

void btEffectRunImpact(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a dagger appears in Mars colours.

Abilities: Impact, High Impact, Demon Spear, Angel Spear; Forge; Kindle.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 30 of file battle_effect_stat_change.c.

btEffectRunGuard

void btEffectRunGuard(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a shield appears in Mars colours.

Abilities: Guard, Protect, Guardian, Protector; Corona.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 39 of file battle_effect_stat_change.c.

btEffectRunIron

void btEffectRunIron(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a shield appears in Venus colours as the backdrop turns grey.

Abilities: Iron.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 48 of file battle_effect_stat_change.c.

btEffectRunUnusedStatBoost

void btEffectRunUnusedStatBoost(BATTLE_EFFECT_PARM *args)

Plays the stat boost's unused mode; no ability's effect names this one.

References btEffectRunStatBoost().

Definition at line 54 of file battle_effect_stat_change.c.

btEffectRunWard

void btEffectRunWard(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a shield appears in Jupiter colours.

Abilities: Ward, Resist, Magic Shell, Magic Shield; Breeze.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 63 of file battle_effect_stat_change.c.

btEffectRunSteam

void btEffectRunSteam(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a shield appears in Mercury colours as the backdrop turns to Jupiter's colours.

Abilities: Steam.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 72 of file battle_effect_stat_change.c.

btEffectRunGranite

void btEffectRunGranite(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a pane of light appears in Venus colours.

Abilities: Granite.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 81 of file battle_effect_stat_change.c.

btEffectRunFlash

void btEffectRunFlash(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a pane of light appears in Mars colours.

Abilities: Flash.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 90 of file battle_effect_stat_change.c.

btEffectRunShade

void btEffectRunShade(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a pane of light appears in Mercury colours.

Abilities: Shade.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 99 of file battle_effect_stat_change.c.

btEffectRunGuardAura

void btEffectRunGuardAura(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a pane of light appears in grey.

Abilities: Guard Aura.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 108 of file battle_effect_stat_change.c.

btEffectRunZephyr

void btEffectRunZephyr(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a gust of wind sweeps across it in the colours already loaded, as this is the one boost that keeps the palette.

Abilities: Zephyr.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 118 of file battle_effect_stat_change.c.

btEffectRunCoal

void btEffectRunCoal(BATTLE_EFFECT_PARM *args)

Light swirls into each target and bursts, then a gust of wind sweeps across it in Mars colours.

Abilities: Coal.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 127 of file battle_effect_stat_change.c.

btEffectRunCrucibleFire

void btEffectRunCrucibleFire(BATTLE_EFFECT_PARM *args)

The stat boost's burst with no swirling flares (STAT_BOOST_FLARES), with no prelude Djinni and the fade step cleared.

Abilities: Crucible Fire.

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 136 of file battle_effect_stat_change.c.

btEffectRunStatBoost

void btEffectRunStatBoost(BATTLE_EFFECT_PARM *args, Uint32 mode)

Flares of light swirl in to the centre of each target in turn and burst, and the mode's picture plays over it.

References btEffectBuildBlitter(), btEffectEndCanvasLayer(), btEffectPosProjectPoint(), btEffectPosProjectScaledBattler(), btEffectRunDjinniEntrance(), btEffectStartCanvasLayer(), btEffectStepPaletteToResource(), btEffectTintBattler(), btEffectTransferCanvas(), btGraphicsLoadGreyRamp(), btObjectGetStub(), btResourceLoadAndDecompress(), btUnitGetEffectHeightStub(), Sint32, syCloseEvent(), syCos(), syHeapSlotRelease(), syMatrixTranslateVector(), syRandom(), syResourceGetTableEntry(), syRotX(), syRotY(), syRotZ(), sySetEvent(), sySin(), sySoundPlayStub(), sySquartIWRAM() and syWordsCopy().

Referenced by btEffectRunCoal(), btEffectRunCrucibleFire(), btEffectRunFlash(), btEffectRunGranite(), btEffectRunGuard(), btEffectRunGuardAura(), btEffectRunImpact(), btEffectRunIron(), btEffectRunShade(), btEffectRunSteam(), btEffectRunUnusedStatBoost(), btEffectRunWard() and btEffectRunZephyr().

Definition at line 188 of file battle_effect_stat_change.c.

btEffectRunUnusedStatReduction

void btEffectRunUnusedStatReduction(void *action)

Breaks the dagger sprite into fading shards as Dull does, in the pink burst's colours; no effect table entry reaches it.

References btEffectRunStatReduction().

Definition at line 707 of file battle_effect_stat_change.c.

btEffectRunDull

void btEffectRunDull(BATTLE_EFFECT_PARM *args)

A dagger appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours.

Abilities: Dull, Blunt.

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers, btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunHurricane() and btEffectRunLobbedShells().

Definition at line 716 of file battle_effect_stat_change.c.

btEffectRunImpair

void btEffectRunImpair(BATTLE_EFFECT_PARM *args)

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

Abilities: Impair, Debilitate.

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers, btEffectRunBurstShower(), btEffectRunCanvasBurst(), btEffectRunCastingImpact(), btEffectRunLobbedShells(), btEffectRunMoteFountain() and btEffectRunSpiderWeb().

Definition at line 725 of file battle_effect_stat_change.c.

btEffectRunWeaken

void btEffectRunWeaken(BATTLE_EFFECT_PARM *args)

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

Abilities: Weaken, Enfeeble.

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers, btEffectRunCastingImpact() and btEffectRunFlashingStrike().

Definition at line 734 of file battle_effect_stat_change.c.

btEffectRunStatReduction

void btEffectRunStatReduction(BATTLE_EFFECT_PARM *args, Sint32 mode)

A dagger (Dull) or a shield (Impair and Weaken) appears over each target and breaks into shards that fly off and fade.

References btEffectBuildCanvasBlitters(), btEffectPosProjectPoint(), btObjectGetStub(), btParticleAdvanceWithGravity3D(), btResourceLoadAndDecompress(), Sint32, StatChangeShardHeights, StatChangeShardPictures, StatChangeShardWidths, syCos(), syMatrixTranslateVector(), syRandom(), syResourceGetTableEntry(), sySin() and sySoundPlayStub().

Referenced by btEffectRunDull(), btEffectRunImpair(), btEffectRunUnusedStatReduction() and btEffectRunWeaken().

Definition at line 748 of file battle_effect_stat_change.c.