Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_bolt.c

Bolt. More…

Included by battle_effect.c.

Macros

NameDescription
#defineBOLT_GLINT_BLITTER EFFECT_BLITTER(HEAP_SLOT_RAM_CODE_PAIRED)The second blitter, made anew for each glint with its random flip.
#defineBOLT_PICTURES GLINT_SET_BYTESWhere the bolt pictures start in the sprite sheet, after the six glints.
#defineBOLT_INTERVAL 8The targets are struck this many ticks apart.
#defineBOLT_SPARKS_PER_TARGET 128Each target's run of PARTICLES for its sparks.
#defineBOLT_GROUND_Y 104The canvas row the bolts reach down to and the sparks bounce off.
#defineBOLT_SPARK_SHRINK_TICKS 16A spark is drawn a size smaller for every this many ticks less it has to live.

Enumerations

NameDescription
enumanonymous enum { BOLT_SPARKS, BOLT_GLINTS, BOLT_GLINT_SPREAD, BOLT_STRIKES }The columns of a BoltCounts row.

Functions

NameDescription
voidbtEffectRunBolt (BATTLE_EFFECT_PARM *args)A bolt of lightning strikes each target in turn, and sparks fly up from where it lands while glints flicker there.

Description

Bolt. Part of battle_effect.c.

Macros in detail

BOLT_GLINT_BLITTER

#define BOLT_GLINT_BLITTER EFFECT_BLITTER(HEAP_SLOT_RAM_CODE_PAIRED)

The second blitter, made anew for each glint with its random flip.

Referenced by btEffectRunBolt().

Definition at line 4 of file battle_effect_bolt.c.

BOLT_PICTURES

#define BOLT_PICTURES GLINT_SET_BYTES

Where the bolt pictures start in the sprite sheet, after the six glints.

Referenced by btEffectRunBolt().

Definition at line 17 of file battle_effect_bolt.c.

BOLT_INTERVAL

#define BOLT_INTERVAL 8

The targets are struck this many ticks apart.

Referenced by btEffectRunBolt().

Definition at line 19 of file battle_effect_bolt.c.

BOLT_SPARKS_PER_TARGET

#define BOLT_SPARKS_PER_TARGET 128

Each target's run of PARTICLES for its sparks.

Referenced by btEffectRunBolt().

Definition at line 21 of file battle_effect_bolt.c.

BOLT_GROUND_Y

#define BOLT_GROUND_Y 104

The canvas row the bolts reach down to and the sparks bounce off.

Referenced by btEffectRunBolt().

Definition at line 23 of file battle_effect_bolt.c.

BOLT_SPARK_SHRINK_TICKS

#define BOLT_SPARK_SHRINK_TICKS 16

A spark is drawn a size smaller for every this many ticks less it has to live.

Referenced by btEffectRunBolt().

Definition at line 26 of file battle_effect_bolt.c.

Enumerations in detail

anonymous enum

enum { BOLT_SPARKS, BOLT_GLINTS, BOLT_GLINT_SPREAD, BOLT_STRIKES }

The columns of a BoltCounts row.

EnumeratorValueDescription
BOLT_SPARKSsparks thrown from each bolt's foot, at most BOLT_SPARKS_PER_TARGET
BOLT_GLINTSglints a tick around each target
BOLT_GLINT_SPREADhow high and wide the glints spread, in pixels
BOLT_STRIKESbolts drawn over each other

Definition at line 7 of file battle_effect_bolt.c.

Functions in detail

btEffectRunBolt

void btEffectRunBolt(BATTLE_EFFECT_PARM *args)

A bolt of lightning strikes each target in turn, and sparks fly up from where it lands while glints flicker there.

Abilities: Bolt, Flash Bolt, Blue Bolt.

Bolt
Bolt
Flash Bolt
Flash Bolt
Blue Bolt
Blue Bolt

References BattleEffectGlintPictureHeights, BattleEffectGlintPictures, BattleEffectGlintPictureWidths, BoltCounts, BoltGlintFlips, BoltGlintModes, btCameraShake(), btEffectStartCanvasLayer(), btEffectTintBattler(), btMotionApplyKnockbackStub(), btParticleAdvanceWithGravity2D(), btProjectionUnit(), btResourceLoadAndDecompress(), Sint32, state, syCos(), syHeapSlotRelease(), syRandom(), sySin(), sySoundPlayStub() and syWordsFill().

Referenced by BattleEffectHandlers.

Definition at line 32 of file battle_effect_bolt.c.