Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_casting_impact.c

The casting impacts, the Djinn attacks, weapons' unleashes and enemy abilities that open the same way: sparks close in on the caster, a streak shoots at the target and a ring of light bursts over it in a spray of sparks, and then each impact plays its own effect over the target (enum CASTING_IMPACT). More…

Included by battle_effect.c.

Macros

NameDescription
#defineCASTING_IMPACT_ORB_PICTURES (6 * PICTURE_BYTES(FIRE_STREAK))The impact orb's pictures, packed at half width, after the streak's.
#defineCASTING_IMPACT_DJINNI_WIDTH 20The Djinni's picture, in RamMapGridMetatileBuffer after the impact's own: past room for the six glints and six flash bursts, more than any impact loads (Squall's glints and lightning bolts are the most).
#defineCASTING_IMPACT_DJINNI_HEIGHT 40
#defineCASTING_IMPACT_DJINNI_PICTURE
#defineCASTING_IMPACT_GATHER_TICKS 32Ticks the sparks gather.
#defineCASTING_IMPACT_SPARKS 64Sparks in state->particles.
#defineCASTING_IMPACT_SPARK_DEPTH 60How far either side of the caster the gathering sparks' depth is clamped.
#defineCASTING_IMPACT_SPARK_LIFE 32A spark scattered over the target lives this long at the least, counted down two a tick (the draw visits each spark twice); it is drawn a mote size smaller for every 16 of life lost.
#defineCASTING_IMPACT_PARTICLESThe impact pictures' particles, in RamMapGridMetatileBuffer after the Djinni.
#defineCASTING_IMPACT_PARTICLE_COUNT 64
#defineCASTING_IMPACT_RISING_PICTURES 16The impact particles that carry the rising pictures: flash bursts, skulls or puffs of smoke.
#defineCASTING_IMPACT_RISING_LIFE 24The ticks a rising puff of smoke lives, four to each of its six pictures, and a flash burst, two to each of its six.
#defineCASTING_IMPACT_BURST_LIFE 12
#defineBROIL_STREAKS 12Broil's ember streaks.
#defineASURA_SHEET_LOW_WIDTH 80Asura's sprite sheet: the masked swordsman with his sword low, then swung up, then the red crescent his stroke leaves.
#defineASURA_SHEET_LOW_HEIGHT 96
#defineASURA_SHEET_SWUNG_WIDTH 80
#defineASURA_SHEET_SWUNG_HEIGHT 104
#defineASURA_SHEET_CRESCENT_WIDTH 128
#defineASURA_SHEET_CRESCENT_HEIGHT 91
#defineASURA_LOW_DRAW_HEIGHTHow tall the swordsman with his sword low is drawn.
#defineASURA_CRESCENT_FADE_A_HEIGHT 91RedCrescentSheetB, Asura's crescent fading in four pictures the width of the canvas.
#defineASURA_CRESCENT_FADE_B_HEIGHT 59
#defineASURA_CRESCENT_FADE_C_HEIGHT 29
#defineASURA_CRESCENT_FADE_D_HEIGHT 26
#defineROCK_SPIRE_WIDTH 32Terra Strike's rock spire at its tallest.
#defineROCK_SPIRE_HEIGHT 96
#defineFALLING_FLAME_WIDTH 32The flame Forcible Arm and Truncheon Fist drop.
#defineFALLING_FLAME_HEIGHT 64
#defineBAD_OMEN_SKULL_LIFT_SHIFT 11Bad Omen's skulls rise faster by the tick, the slowest by toFIXED(1) / 32 more a tick, written as a shift of 1, and each of the next three twice as fast as the one before.
#defineCASTING_IMPACT_PICTURE_X (side, picture)Where Mortal Danger draws picture, one of the reaper's seven pictures (REAPER_PICTURE_X), for the casting side.

Enumerations

NameDescription
enumCASTING_IMPACT { CASTING_IMPACT_BANE, CASTING_IMPACT_SMOG, CASTING_IMPACT_MIS … }The casting impacts, by effect kind less EFFECT_RANGE_CASTING_IMPACT: each is named for the first ability whose AbilityBattleEffects entry selects it; the four no ability selects are named UNUSED_ and for the effect they hand off to.
enumASURA_SHEET_PICTURE { ASURA_SHEET_LOW, ASURA_SHEET_SWUNG, ASURA_SHEET_CRESCENT }Where each of Asura's pictures begins in its sheet, in bytes.
enumASURA_CRESCENT_FADE_PICTURE { ASURA_CRESCENT_FADE_A, ASURA_CRESCENT_FADE_B, ASURA_CRESCENT … }

Functions

NameDescription
voidbtEffectStepPaletteToResource (Sint32 resourceId)Steps background colours 0 to 63 one level towards a palette resource.
static inline voidbtCastingImpactEndPrelude (BATTLE_EFFECT_STATE *state, void *canvas)Clears the prelude image, stops its events and releases its blitters before the next effect takes over.
voidbtEffectRunCastingImpact (BATTLE_EFFECT_PARM *args, Sint32 mode)Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.

Description

The casting impacts, the Djinn attacks, weapons' unleashes and enemy abilities that open the same way: sparks close in on the caster, a streak shoots at the target and a ring of light bursts over it in a spray of sparks, and then each impact plays its own effect over the target (enum CASTING_IMPACT). Part of battle_effect.c.

Macros in detail

CASTING_IMPACT_ORB_PICTURES

#define CASTING_IMPACT_ORB_PICTURES (6 * PICTURE_BYTES(FIRE_STREAK))

The impact orb's pictures, packed at half width, after the streak's.

Referenced by btEffectRunCastingImpact().

Definition at line 103 of file battle_effect_casting_impact.c.

CASTING_IMPACT_DJINNI_WIDTH

#define CASTING_IMPACT_DJINNI_WIDTH 20

The Djinni's picture, in RamMapGridMetatileBuffer after the impact's own: past room for the six glints and six flash bursts, more than any impact loads (Squall's glints and lightning bolts are the most).

Referenced by btEffectRunCastingImpact().

Definition at line 107 of file battle_effect_casting_impact.c.

CASTING_IMPACT_DJINNI_HEIGHT

#define CASTING_IMPACT_DJINNI_HEIGHT 40

Referenced by btEffectRunCastingImpact().

Definition at line 108 of file battle_effect_casting_impact.c.

CASTING_IMPACT_DJINNI_PICTURE

#define CASTING_IMPACT_DJINNI_PICTURE

Referenced by btEffectRunCastingImpact().

Definition at line 109 of file battle_effect_casting_impact.c.

CASTING_IMPACT_GATHER_TICKS

#define CASTING_IMPACT_GATHER_TICKS 32

Ticks the sparks gather.

Referenced by btEffectRunCastingImpact().

Definition at line 112 of file battle_effect_casting_impact.c.

CASTING_IMPACT_SPARKS

#define CASTING_IMPACT_SPARKS 64

Sparks in state->particles.

Referenced by btEffectRunCastingImpact().

Definition at line 114 of file battle_effect_casting_impact.c.

CASTING_IMPACT_SPARK_DEPTH

#define CASTING_IMPACT_SPARK_DEPTH 60

How far either side of the caster the gathering sparks' depth is clamped.

Referenced by btEffectRunCastingImpact().

Definition at line 116 of file battle_effect_casting_impact.c.

CASTING_IMPACT_SPARK_LIFE

#define CASTING_IMPACT_SPARK_LIFE 32

A spark scattered over the target lives this long at the least, counted down two a tick (the draw visits each spark twice); it is drawn a mote size smaller for every 16 of life lost.

Referenced by btEffectRunCastingImpact().

Definition at line 120 of file battle_effect_casting_impact.c.

CASTING_IMPACT_PARTICLES

#define CASTING_IMPACT_PARTICLES

The impact pictures' particles, in RamMapGridMetatileBuffer after the Djinni.

Referenced by btEffectRunCastingImpact().

Definition at line 122 of file battle_effect_casting_impact.c.

CASTING_IMPACT_PARTICLE_COUNT

#define CASTING_IMPACT_PARTICLE_COUNT 64

Referenced by btEffectRunCastingImpact().

Definition at line 124 of file battle_effect_casting_impact.c.

CASTING_IMPACT_RISING_PICTURES

#define CASTING_IMPACT_RISING_PICTURES 16

The impact particles that carry the rising pictures: flash bursts, skulls or puffs of smoke.

Referenced by btEffectRunCastingImpact().

Definition at line 127 of file battle_effect_casting_impact.c.

CASTING_IMPACT_RISING_LIFE

#define CASTING_IMPACT_RISING_LIFE 24

The ticks a rising puff of smoke lives, four to each of its six pictures, and a flash burst, two to each of its six.

Referenced by btEffectRunCastingImpact().

Definition at line 130 of file battle_effect_casting_impact.c.

CASTING_IMPACT_BURST_LIFE

#define CASTING_IMPACT_BURST_LIFE 12

Referenced by btEffectRunCastingImpact().

Definition at line 131 of file battle_effect_casting_impact.c.

BROIL_STREAKS

#define BROIL_STREAKS 12

Broil's ember streaks.

Referenced by btEffectRunCastingImpact().

Definition at line 133 of file battle_effect_casting_impact.c.

ASURA_SHEET_LOW_WIDTH

#define ASURA_SHEET_LOW_WIDTH 80

Asura's sprite sheet: the masked swordsman with his sword low, then swung up, then the red crescent his stroke leaves.

Referenced by btEffectRunCastingImpact().

Definition at line 137 of file battle_effect_casting_impact.c.

ASURA_SHEET_LOW_HEIGHT

#define ASURA_SHEET_LOW_HEIGHT 96

Definition at line 138 of file battle_effect_casting_impact.c.

ASURA_SHEET_SWUNG_WIDTH

#define ASURA_SHEET_SWUNG_WIDTH 80

Referenced by btEffectRunCastingImpact().

Definition at line 139 of file battle_effect_casting_impact.c.

ASURA_SHEET_SWUNG_HEIGHT

#define ASURA_SHEET_SWUNG_HEIGHT 104

Referenced by btEffectRunCastingImpact().

Definition at line 140 of file battle_effect_casting_impact.c.

ASURA_SHEET_CRESCENT_WIDTH

#define ASURA_SHEET_CRESCENT_WIDTH 128

Referenced by btEffectRunCastingImpact().

Definition at line 141 of file battle_effect_casting_impact.c.

ASURA_SHEET_CRESCENT_HEIGHT

#define ASURA_SHEET_CRESCENT_HEIGHT 91

Referenced by btEffectRunCastingImpact().

Definition at line 142 of file battle_effect_casting_impact.c.

ASURA_LOW_DRAW_HEIGHT

#define ASURA_LOW_DRAW_HEIGHT

How tall the swordsman with his sword low is drawn. BUG: as tall as the swung picture, 8 rows more than the low one, so the draw reads on into the swung picture's top rows: the tip of the raised sword, a few pixels at the right edge, under the low swordsman's feet.

Referenced by btEffectRunCastingImpact().

Definition at line 147 of file battle_effect_casting_impact.c.

ASURA_CRESCENT_FADE_A_HEIGHT

#define ASURA_CRESCENT_FADE_A_HEIGHT 91

RedCrescentSheetB, Asura's crescent fading in four pictures the width of the canvas.

Referenced by btEffectRunCastingImpact().

Definition at line 162 of file battle_effect_casting_impact.c.

ASURA_CRESCENT_FADE_B_HEIGHT

#define ASURA_CRESCENT_FADE_B_HEIGHT 59

Referenced by btEffectRunCastingImpact().

Definition at line 163 of file battle_effect_casting_impact.c.

ASURA_CRESCENT_FADE_C_HEIGHT

#define ASURA_CRESCENT_FADE_C_HEIGHT 29

Referenced by btEffectRunCastingImpact().

Definition at line 164 of file battle_effect_casting_impact.c.

ASURA_CRESCENT_FADE_D_HEIGHT

#define ASURA_CRESCENT_FADE_D_HEIGHT 26

Referenced by btEffectRunCastingImpact().

Definition at line 165 of file battle_effect_casting_impact.c.

ROCK_SPIRE_WIDTH

#define ROCK_SPIRE_WIDTH 32

Terra Strike's rock spire at its tallest.

Referenced by btEffectRunCastingImpact().

Definition at line 179 of file battle_effect_casting_impact.c.

ROCK_SPIRE_HEIGHT

#define ROCK_SPIRE_HEIGHT 96

Referenced by btEffectRunCastingImpact().

Definition at line 180 of file battle_effect_casting_impact.c.

FALLING_FLAME_WIDTH

#define FALLING_FLAME_WIDTH 32

The flame Forcible Arm and Truncheon Fist drop.

Referenced by btEffectRunCastingImpact().

Definition at line 182 of file battle_effect_casting_impact.c.

FALLING_FLAME_HEIGHT

#define FALLING_FLAME_HEIGHT 64

Referenced by btEffectRunCastingImpact().

Definition at line 183 of file battle_effect_casting_impact.c.

BAD_OMEN_SKULL_LIFT_SHIFT

#define BAD_OMEN_SKULL_LIFT_SHIFT 11

Bad Omen's skulls rise faster by the tick, the slowest by toFIXED(1) / 32 more a tick, written as a shift of 1, and each of the next three twice as fast as the one before.

Referenced by btEffectRunCastingImpact().

Definition at line 187 of file battle_effect_casting_impact.c.

CASTING_IMPACT_PICTURE_X

#define CASTING_IMPACT_PICTURE_X(side, picture)

Where Mortal Danger draws picture, one of the reaper's seven pictures (REAPER_PICTURE_X), for the casting side.

Referenced by btEffectRunCastingImpact().

Definition at line 191 of file battle_effect_casting_impact.c.

Enumerations in detail

CASTING_IMPACT

enum CASTING_IMPACT

The casting impacts, by effect kind less EFFECT_RANGE_CASTING_IMPACT: each is named for the first ability whose AbilityBattleEffects entry selects it; the four no ability selects are named UNUSED_ and for the effect they hand off to.

EnumeratorValueDescription
CASTING_IMPACT_BANE0smoke
CASTING_IMPACT_SMOGsmoke
CASTING_IMPACT_MISTsmoke
CASTING_IMPACT_FEVERsmoke
CASTING_IMPACT_FLINTnothing
CASTING_IMPACT_SCORCHflash bursts rise from the target
CASTING_IMPACT_SQUALLtwo bolts strike among glints
CASTING_IMPACT_SAPmotes fly back to the caster
CASTING_IMPACT_TERRA_STRIKEa rock spire grows and sinks
CASTING_IMPACT_POISON_CLOUDsmoke
CASTING_IMPACT_DEADLY_POISONsmoke
CASTING_IMPACT_MORTAL_DANGERalso Death Size; the reaper swings its scythe
CASTING_IMPACT_BAD_OMENskulls rise from the target
CASTING_IMPACT_LIFE_NOURISHmotes fly back to the caster
CASTING_IMPACT_AQUA_SOCKa blue flame column falls onto the target
CASTING_IMPACT_UNUSED_ICE_CHIPShands off
CASTING_IMPACT_FROST_BITEice chips converge on the target
CASTING_IMPACT_UNUSED_GATHERINGhands off
CASTING_IMPACT_LIFE_LEECHmotes fly back to the caster
CASTING_IMPACT_PSY_LEECHmotes fly back to the caster
CASTING_IMPACT_BROILember streaks spread sideways
CASTING_IMPACT_MELTDOWNnothing; hands to the stat reduction
CASTING_IMPACT_HEAT_MIRAGEalso Heat Flash; smoke
CASTING_IMPACT_BARRAGEflash bursts rise from the target
CASTING_IMPACT_UNUSED_MYSTIC_FLAMEhands off
CASTING_IMPACT_ACID_BATHsmoke
CASTING_IMPACT_UNUSED_COMETShands off
CASTING_IMPACT_STUN_VOLTAGEtwo bolts strike among glints
CASTING_IMPACT_BLINDING_SMOGsmoke
CASTING_IMPACT_MURKsmoke
CASTING_IMPACT_CYCLONE_SLASHa tornado stands over the target
CASTING_IMPACT_PSYPHON_SEALa rune opens over the target
CASTING_IMPACT_ASURAa masked swordsman slashes
CASTING_IMPACT_FORCIBLE_ARMa flame falls diagonally
CASTING_IMPACT_TRUNCHEON_FISTa flame falls diagonally
CASTING_IMPACT_SEVERE_BLOWhands off

Definition at line 60 of file battle_effect_casting_impact.c.

ASURA_SHEET_PICTURE

enum ASURA_SHEET_PICTURE

Where each of Asura's pictures begins in its sheet, in bytes.

EnumeratorValueDescription
ASURA_SHEET_LOW0
ASURA_SHEET_SWUNGASURA_SHEET_LOW + PICTURE_BYTES(ASURA_SHEET_LOW)
ASURA_SHEET_CRESCENTASURA_SHEET_SWUNG + PICTURE_BYTES(ASURA_SHEET_SWUNG)

Definition at line 153 of file battle_effect_casting_impact.c.

ASURA_CRESCENT_FADE_PICTURE

enum ASURA_CRESCENT_FADE_PICTURE

EnumeratorValueDescription
ASURA_CRESCENT_FADE_A0
ASURA_CRESCENT_FADE_BASURA_CRESCENT_FADE_A + CANVAS_SIZE * ASURA_CRESCENT_FADE_A_HEIGHT
ASURA_CRESCENT_FADE_CASURA_CRESCENT_FADE_B + CANVAS_SIZE * ASURA_CRESCENT_FADE_B_HEIGHT
ASURA_CRESCENT_FADE_DASURA_CRESCENT_FADE_C + CANVAS_SIZE * ASURA_CRESCENT_FADE_C_HEIGHT

Definition at line 167 of file battle_effect_casting_impact.c.

Functions in detail

btEffectStepPaletteToResource

void btEffectStepPaletteToResource(Sint32 resourceId)

Steps background colours 0 to 63 one level towards a palette resource.

References Sint32, syResourceGetTableEntry() and syWordsCopy().

Referenced by btEffectRunCastingImpact(), btEffectRunGround(), btEffectRunRagnarok() and btEffectRunTitanBlade().

Definition at line 8 of file battle_effect_casting_impact.c.

btCastingImpactEndPrelude

static inline void btCastingImpactEndPrelude(BATTLE_EFFECT_STATE *state, void *canvas)

Clears the prelude image, stops its events and releases its blitters before the next effect takes over.

References btEffectDarkenBackgroundStep(), btEffectTransferCanvas(), state, syCloseEvent() and syWordsClear().

Referenced by btEffectRunCastingImpact().

Definition at line 45 of file battle_effect_casting_impact.c.

btEffectRunCastingImpact

void btEffectRunCastingImpact(BATTLE_EFFECT_PARM *args, Sint32 mode)

Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.

Abilities: Bane; Smog; Mist; Fever; Flint; Scorch; Squall; Sap; Terra Strike; Poison Cloud; Deadly Poison; Mortal Danger, Death Size; Bad Omen; Life Nourish; Aqua Sock; Frost Bite; Life Leech; Psy Leech; Broil; Meltdown; Heat Mirage, Heat Flash; Barrage; Acid Bath; Stun Voltage; Blinding Smog; Murk; Cyclone Slash; Psyphon Seal; Asura; Forcible Arm; Truncheon Fist; Severe Blow.

Bane
Bane
Mist
Mist
Mist
Mist
Fever
Fever
Flint
Flint
Sap
Sap

References BattleEffectGlintPictureHeights, BattleEffectGlintPictures, BattleEffectGlintPictureWidths, BattleEffectPuffArcPictureBiasY, BattleEffectPuffArcPictureHeights, BattleEffectPuffArcPictures, BattleEffectPuffArcPictureWidths, btCameraShake(), btCastingImpactEndPrelude(), btEffectArmBg2AffineHBlankDMA(), btEffectBuildCanvasBlitters(), btEffectPackYellowOrbs(), btEffectRunImpair(), btEffectRunMysticFlame(), btEffectRunProjectileVolley(), btEffectRunSparkGroups(), btEffectStartCanvasLayer(), btEffectStartTiledCanvas(), btEffectStepPaletteToResource(), btEffectTintBattler(), btEffectTransferCanvas(), btMotionApplyKnockbackStub(), btObjectGetStub(), btParticleAdvanceWithGravity3D(), btProjectionPoint(), btProjectionScaledUnit(), btResourceLoadAndDecompress(), btUnitGetEffectHeightStub(), CastingImpactGlintDrawFlags, CastingImpactIceChipPictures, fdActorSelectAnimationStub(), fdActorSetAnimationSpeedStub(), HeapSlots, ReaperPictureY, Sint32, state, syCloseEvent(), syCos(), syHeapSlotRelease(), syInitMatrix(), syRandom(), syRotX(), syRotY(), syRotZ(), sySetEvent(), sySin(), sySoundPlayStub(), syWordsClear(), syWordsFill() and width.

Referenced by btEffectRunByIdRange().

Definition at line 203 of file battle_effect_casting_impact.c.