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_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_SHARD_PICTURES 9600The shard picture in the sprite sheet, then its DIMMED_COPIES - 1 dimmed copies.
#defineSTAT_REDUCTION_SHARD_BYTES 696bytes in each copy
#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_REDUCTION_MODE { STAT_REDUCTION_DULL, STAT_REDUCTION_IMPAIR, STAT_REDUCTION_W … }The stat reductions' modes (btEffectRunStatReduction).
enumSTAT_BOOST_SHEET { STAT_BOOST_FLARES, STAT_BOOST_BURST, STAT_BOOST_PICTURE, STA … }Where each picture sits in the sprite sheet.

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.
voidbtEffectRunWard (BATTLE_EFFECT_PARM *args)Light swirls into each target and bursts, then a shield appears in Jupiter 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.
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.
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.
voidbtEffectRunDull (BATTLE_EFFECT_PARM *args)A dagger appears over each target and breaks into shards that fade through darker copies, in the pink burst'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.
voidbtEffectRunUnusedStatReduction (BATTLE_EFFECT_PARM *args)Breaks the shield sprite into fading shards as Weaken does; no effect table entry reaches it.
voidbtEffectRunStatReduction (BATTLE_EFFECT_PARM *args, Sint32 mode)A dagger (Dull) or a shield (the others) 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.

Referenced by btEffectRunStatBoost().

Definition at line 91 of file battle_effect_stat_change.c.

STAT_BOOST_SPRITE_TICK

#define STAT_BOOST_SPRITE_TICK 80

Referenced by btEffectRunStatBoost().

Definition at line 92 of file battle_effect_stat_change.c.

STAT_BOOST_TARGET_DELAY

#define STAT_BOOST_TARGET_DELAY 8

Referenced by btEffectRunStatBoost().

Definition at line 93 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 96 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 99 of file battle_effect_stat_change.c.

STAT_BOOST_TARGET_FLARES

#define STAT_BOOST_TARGET_FLARES 32

Referenced by btEffectRunStatBoost().

Definition at line 100 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 102 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 107 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 108 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 109 of file battle_effect_stat_change.c.

STAT_BOOST_FLARE_DEPTH_FAR

#define STAT_BOOST_FLARE_DEPTH_FAR

Referenced by btEffectRunStatBoost().

Definition at line 110 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 114 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 117 of file battle_effect_stat_change.c.

STAT_REDUCTION_SHARD_PICTURES

#define STAT_REDUCTION_SHARD_PICTURES 9600

The shard picture in the sprite sheet, then its DIMMED_COPIES - 1 dimmed copies.

Referenced by btEffectRunStatReduction().

Definition at line 567 of file battle_effect_stat_change.c.

STAT_REDUCTION_SHARD_BYTES

#define STAT_REDUCTION_SHARD_BYTES 696

bytes in each copy

Referenced by btEffectRunStatReduction().

Definition at line 568 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 572 of file battle_effect_stat_change.c.

STAT_REDUCTION_TARGET_SHARDS

#define STAT_REDUCTION_TARGET_SHARDS 24

Referenced by btEffectRunStatReduction().

Definition at line 573 of file battle_effect_stat_change.c.

STAT_REDUCTION_TARGET_DELAY

#define STAT_REDUCTION_TARGET_DELAY 4

Referenced by btEffectRunStatReduction().

Definition at line 574 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

Definition at line 6 of file battle_effect_stat_change.c.

STAT_REDUCTION_MODE

enum STAT_REDUCTION_MODE

The stat reductions' modes (btEffectRunStatReduction).

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

Definition at line 17 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_BURSTGLOW_SHEET_ROOMsix bursts of light (GlowOrb)
STAT_BOOST_PICTURE11150the picture the mode picks
STAT_BOOST_DJINNI26048the Djinni

Definition at line 81 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.

Impact
Impact
High Impact
High Impact
Demon Spear
Demon Spear
Angel Spear
Angel Spear
Forge
Forge

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 29 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.

Guard
Guard
Protect
Protect
Guardian
Guardian
Protector
Protector
Corona
Corona

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 38 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.

Ward
Ward
Resist
Resist
Magic Shell
Magic Shell
Magic Shield
Magic Shield

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 47 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.

Granite
Granite

References btEffectRunStatBoost().

Referenced by BattleEffectHandlers.

Definition at line 56 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 65 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 75 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 btEffectEndCanvasLayer(), btEffectRunDjinniEntrance(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btObjectGetStub(), btProjectionPoint(), btProjectionScaledUnit(), btResourceLoadAndDecompress(), btUnitGetEffectHeightStub(), Sint32, state, syCloseEvent(), syCos(), syHeapSlotRelease(), syMatrixTranslateVector(), syRandom(), syResourceGetTableEntry(), syRotX(), syRotY(), syRotZ(), sySetEvent(), sySin(), sySoundPlayStub(), sySquartIWRAM() and syWordsCopy().

Referenced by btEffectRunFlash(), btEffectRunGranite(), btEffectRunGuard(), btEffectRunImpact(), btEffectRunWard() and btEffectRunZephyr().

Definition at line 121 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 pink burst's colours.

Abilities: Dull, Blunt.

Dull
Dull
Blunt
Blunt

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers.

Definition at line 535 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.

Impair
Impair
Debilitate
Debilitate

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers and btEffectRunCastingImpact().

Definition at line 544 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.

Weaken
Weaken
Enfeeble
Enfeeble

References btEffectRunStatReduction().

Referenced by BattleEffectHandlers.

Definition at line 553 of file battle_effect_stat_change.c.

btEffectRunUnusedStatReduction

void btEffectRunUnusedStatReduction(BATTLE_EFFECT_PARM *args)

Breaks the shield sprite into fading shards as Weaken does; no effect table entry reaches it.

References btEffectRunStatReduction().

Definition at line 560 of file battle_effect_stat_change.c.

btEffectRunStatReduction

void btEffectRunStatReduction(BATTLE_EFFECT_PARM *args, Sint32 mode)

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

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

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

Definition at line 578 of file battle_effect_stat_change.c.