Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_light_surge.c

Light Surge, then the handlers that play the twisting column for Whorl, Gale, Lethe Albion, Poison Flow and Raging Flood. More…

Included by battle_effect.c.

Macros

NameDescription
#defineLIGHT_SURGE_TICKS 74
#defineLIGHT_SURGE_DAMAGE_TICK 64The tick the battle shows the damage.
#defineLIGHT_SURGE_RECOLOR_TICK 32From this tick the colours step towards the Mercury Djinn sprite sheet's, one step every fourth tick.
#defineSURGE_FIRST_GLOW 16The state's particles: each bolt's flash from the first, its glow from SURGE_FIRST_GLOW and the bolt itself from SURGE_FIRST_BOLT.
#defineSURGE_FIRST_BOLT 32
#defineSURGE_BOLTS 14
#defineSURGE_BOLT_INTERVAL 4
#defineSURGE_BOLT_FALL 6A bolt's head falls from the sky to the target's feet in SURGE_BOLT_FALL ticks and lands with a flash; its tail leaves the sky at SURGE_BOLT_TAIL and follows it down, leaves a glow where it is at SURGE_BOLT_GLOW, and the bolt is gone after SURGE_BOLT_TICKS.
#defineSURGE_BOLT_TAIL 12
#defineSURGE_BOLT_GLOW 16
#defineSURGE_BOLT_TICKS 18
#defineSURGE_BOLT_HALF_WIDTH 2Half a bolt's width on the canvas.
#defineSURGE_CIRCLES 32The shaded discs the flashes and glows are drawn from: SURGE_CIRCLES quarter discs, 2 to SURGE_CIRCLE_SIZE_MAX pixels, packed in the map cell buffer.
#defineSURGE_CIRCLE_SIZE_MAX (SURGE_CIRCLES * 2)
#defineSURGE_DISCS 28The discs a tick draws: the flashes, and the glows of all but the last two bolts.
#defineSURGE_DISC_TICKS 16
#defineSURGE_SWING_START 20The camera swings around the target SURGE_SWING_TURN a tick from SURGE_SWING_START, slowing over SURGE_SWING_SLOWING ticks to a stop at SURGE_SWING_END, after the effect has ended.
#defineSURGE_SWING_END 80
#defineSURGE_SWING_TURN (TRIG_TURN / 256)
#defineSURGE_SWING_SLOWING 8
#defineSURGE_RINGS 4The four rings of light about the target: they show from SURGE_RINGS_START, swell over a quarter turn of a sine to their full size at SURGE_RINGS_GROWN, brighten until SURGE_RINGS_SHOWN and dim from SURGE_RINGS_DIMMING, 8 shades a tick.
#defineSURGE_RINGS_START 16
#defineSURGE_RINGS_SHOWN 24
#defineSURGE_RINGS_GROWN 48
#defineSURGE_RINGS_DIMMING 64
#defineSURGE_RINGS_END 80
#defineLIGHT_SURGE_GLOW_ORB 4096Where GlowOrbTexture is decoded in the effect's pictures.
#defineLIGHT_SURGE_GLOW_BAND 16384Where GlowBandTextureA is decoded in the effect's pictures.

Functions

NameDescription
voidbtEffectRunLightSurge (BATTLE_EFFECT_PARM *args)The camera swings around the target while SURGE_BOLTS bolts of light rain onto it, SURGE_BOLT_INTERVAL ticks apart; each lands with a flash and leaves a glow, and SURGE_RINGS rings of light swell about the target and sway.
voidbtEffectRunWhorl (BATTLE_EFFECT_PARM *args)Abilities: Whorl.
voidbtEffectRunGale (BATTLE_EFFECT_PARM *args)Abilities: Gale.
voidbtEffectRunLetheAlbion (BATTLE_EFFECT_PARM *args)Abilities: Lethe Albion.
voidbtEffectRunPoisonFlow (BATTLE_EFFECT_PARM *args)Abilities: Poison Flow.
voidbtEffectRunRagingFlood (BATTLE_EFFECT_PARM *args)Abilities: Raging Flood.

Description

Light Surge, then the handlers that play the twisting column for Whorl, Gale, Lethe Albion, Poison Flow and Raging Flood. Part of battle_effect.c.

Macros in detail

LIGHT_SURGE_TICKS

#define LIGHT_SURGE_TICKS 74

Referenced by btEffectRunLightSurge().

Definition at line 4 of file battle_effect_light_surge.c.

LIGHT_SURGE_DAMAGE_TICK

#define LIGHT_SURGE_DAMAGE_TICK 64

The tick the battle shows the damage.

Referenced by btEffectRunLightSurge().

Definition at line 6 of file battle_effect_light_surge.c.

LIGHT_SURGE_RECOLOR_TICK

#define LIGHT_SURGE_RECOLOR_TICK 32

From this tick the colours step towards the Mercury Djinn sprite sheet's, one step every fourth tick.

Referenced by btEffectRunLightSurge().

Definition at line 9 of file battle_effect_light_surge.c.

SURGE_FIRST_GLOW

#define SURGE_FIRST_GLOW 16

The state's particles: each bolt's flash from the first, its glow from SURGE_FIRST_GLOW and the bolt itself from SURGE_FIRST_BOLT. The first tick sets out a bolt in every particle from SURGE_FIRST_BOLT on, each starting SURGE_BOLT_INTERVAL ticks after the last; the first SURGE_BOLTS fall.

Referenced by btEffectRunLightSurge().

Definition at line 15 of file battle_effect_light_surge.c.

SURGE_FIRST_BOLT

#define SURGE_FIRST_BOLT 32

Referenced by btEffectRunLightSurge().

Definition at line 16 of file battle_effect_light_surge.c.

SURGE_BOLTS

#define SURGE_BOLTS 14

Referenced by btEffectRunLightSurge().

Definition at line 17 of file battle_effect_light_surge.c.

SURGE_BOLT_INTERVAL

#define SURGE_BOLT_INTERVAL 4

Referenced by btEffectRunLightSurge().

Definition at line 18 of file battle_effect_light_surge.c.

SURGE_BOLT_FALL

#define SURGE_BOLT_FALL 6

A bolt's head falls from the sky to the target's feet in SURGE_BOLT_FALL ticks and lands with a flash; its tail leaves the sky at SURGE_BOLT_TAIL and follows it down, leaves a glow where it is at SURGE_BOLT_GLOW, and the bolt is gone after SURGE_BOLT_TICKS.

Referenced by btEffectRunLightSurge().

Definition at line 24 of file battle_effect_light_surge.c.

SURGE_BOLT_TAIL

#define SURGE_BOLT_TAIL 12

Referenced by btEffectRunLightSurge().

Definition at line 25 of file battle_effect_light_surge.c.

SURGE_BOLT_GLOW

#define SURGE_BOLT_GLOW 16

Referenced by btEffectRunLightSurge().

Definition at line 26 of file battle_effect_light_surge.c.

SURGE_BOLT_TICKS

#define SURGE_BOLT_TICKS 18

Referenced by btEffectRunLightSurge().

Definition at line 27 of file battle_effect_light_surge.c.

SURGE_BOLT_HALF_WIDTH

#define SURGE_BOLT_HALF_WIDTH 2

Half a bolt's width on the canvas.

Referenced by btEffectRunLightSurge().

Definition at line 29 of file battle_effect_light_surge.c.

SURGE_CIRCLES

#define SURGE_CIRCLES 32

The shaded discs the flashes and glows are drawn from: SURGE_CIRCLES quarter discs, 2 to SURGE_CIRCLE_SIZE_MAX pixels, packed in the map cell buffer.

Referenced by btEffectRunLightSurge().

Definition at line 33 of file battle_effect_light_surge.c.

SURGE_CIRCLE_SIZE_MAX

#define SURGE_CIRCLE_SIZE_MAX (SURGE_CIRCLES * 2)

Referenced by btEffectRunLightSurge().

Definition at line 34 of file battle_effect_light_surge.c.

SURGE_DISCS

#define SURGE_DISCS 28

The discs a tick draws: the flashes, and the glows of all but the last two bolts. Each swells and shrinks over SURGE_DISC_TICKS, half a turn of a sine.

Referenced by btEffectRunLightSurge().

Definition at line 37 of file battle_effect_light_surge.c.

SURGE_DISC_TICKS

#define SURGE_DISC_TICKS 16

Referenced by btEffectRunLightSurge().

Definition at line 38 of file battle_effect_light_surge.c.

SURGE_SWING_START

#define SURGE_SWING_START 20

The camera swings around the target SURGE_SWING_TURN a tick from SURGE_SWING_START, slowing over SURGE_SWING_SLOWING ticks to a stop at SURGE_SWING_END, after the effect has ended.

Referenced by btEffectRunLightSurge().

Definition at line 43 of file battle_effect_light_surge.c.

SURGE_SWING_END

#define SURGE_SWING_END 80

Referenced by btEffectRunLightSurge().

Definition at line 44 of file battle_effect_light_surge.c.

SURGE_SWING_TURN

#define SURGE_SWING_TURN (TRIG_TURN / 256)

Referenced by btEffectRunLightSurge().

Definition at line 45 of file battle_effect_light_surge.c.

SURGE_SWING_SLOWING

#define SURGE_SWING_SLOWING 8

Referenced by btEffectRunLightSurge().

Definition at line 46 of file battle_effect_light_surge.c.

SURGE_RINGS

#define SURGE_RINGS 4

The four rings of light about the target: they show from SURGE_RINGS_START, swell over a quarter turn of a sine to their full size at SURGE_RINGS_GROWN, brighten until SURGE_RINGS_SHOWN and dim from SURGE_RINGS_DIMMING, 8 shades a tick.

Referenced by btEffectRunLightSurge().

Definition at line 52 of file battle_effect_light_surge.c.

SURGE_RINGS_START

#define SURGE_RINGS_START 16

Referenced by btEffectRunLightSurge().

Definition at line 53 of file battle_effect_light_surge.c.

SURGE_RINGS_SHOWN

#define SURGE_RINGS_SHOWN 24

Referenced by btEffectRunLightSurge().

Definition at line 54 of file battle_effect_light_surge.c.

SURGE_RINGS_GROWN

#define SURGE_RINGS_GROWN 48

Referenced by btEffectRunLightSurge().

Definition at line 55 of file battle_effect_light_surge.c.

SURGE_RINGS_DIMMING

#define SURGE_RINGS_DIMMING 64

Referenced by btEffectRunLightSurge().

Definition at line 56 of file battle_effect_light_surge.c.

SURGE_RINGS_END

#define SURGE_RINGS_END 80

Referenced by btEffectRunLightSurge().

Definition at line 57 of file battle_effect_light_surge.c.

LIGHT_SURGE_GLOW_ORB

#define LIGHT_SURGE_GLOW_ORB 4096

Where GlowOrbTexture is decoded in the effect's pictures.

Referenced by btEffectRunLightSurge().

Definition at line 60 of file battle_effect_light_surge.c.

LIGHT_SURGE_GLOW_BAND

#define LIGHT_SURGE_GLOW_BAND 16384

Where GlowBandTextureA is decoded in the effect's pictures.

Referenced by btEffectRunLightSurge().

Definition at line 63 of file battle_effect_light_surge.c.

Functions in detail

btEffectRunLightSurge

void btEffectRunLightSurge(BATTLE_EFFECT_PARM *args)

The camera swings around the target while SURGE_BOLTS bolts of light rain onto it, SURGE_BOLT_INTERVAL ticks apart; each lands with a flash and leaves a glow, and SURGE_RINGS rings of light swell about the target and sway.

Abilities: Light Surge.

References BattleEffectSmallSquareMeshReversed, BattleEffectSquareCorners, btCameraShake(), btEffectDrawShadedDiscQuarter(), btEffectPosProjectBattler(), btEffectPosProjectPoint(), btEffectStartCanvasLayer(), btEffectStepPaletteToResource(), btEffectTintBattler(), btMotionApplyKnockbackStub(), btObjectGetStub(), btRenderAllocateModelList(), btRenderDrawModelList(), btRenderTransformVertices(), btResourceLoadAndDecompress(), LightSurgeRingShades, LightSurgeRingSizes, LightSurgeRingSways, MapGridMetatileBuffer, Sint32, syCos(), syHeapAllocateEWRAM(), syHeapRelease(), syHeapSlotRelease(), syInitMatrix(), syLookAtLoad(), syRandom(), syScale(), sySin(), sySoundPlayStub() and syTranslate().

Referenced by BattleEffectHandlers.

Definition at line 70 of file battle_effect_light_surge.c.

btEffectRunWhorl

void btEffectRunWhorl(BATTLE_EFFECT_PARM *args)

Abilities: Whorl.

References btEffectRunTwistingColumn().

Referenced by BattleEffectHandlers.

Definition at line 445 of file battle_effect_light_surge.c.

btEffectRunGale

void btEffectRunGale(BATTLE_EFFECT_PARM *args)

Abilities: Gale.

References btEffectRunTwistingColumn().

Referenced by BattleEffectHandlers.

Definition at line 451 of file battle_effect_light_surge.c.

btEffectRunLetheAlbion

void btEffectRunLetheAlbion(BATTLE_EFFECT_PARM *args)

Abilities: Lethe Albion.

References btEffectRunTwistingColumn().

Referenced by BattleEffectHandlers.

Definition at line 457 of file battle_effect_light_surge.c.

btEffectRunPoisonFlow

void btEffectRunPoisonFlow(BATTLE_EFFECT_PARM *args)

Abilities: Poison Flow.

References btEffectRunTwistingColumn().

Referenced by BattleEffectHandlers.

Definition at line 463 of file battle_effect_light_surge.c.

btEffectRunRagingFlood

void btEffectRunRagingFlood(BATTLE_EFFECT_PARM *args)

Abilities: Raging Flood.

References btEffectRunTwistingColumn().

Referenced by BattleEffectHandlers.

Definition at line 469 of file battle_effect_light_surge.c.