src/field/field_psynergy_burst.c
Burst: its glow and sparks, and its explosions on the target. More…
Included by field_psynergy.c.
Structures
| Name | Description | |
|---|---|---|
struct | BURST_STATE | Burst's state (heap slot HEAP_SLOT_BATTLE_EFFECT): the explosion's eight pictures unpacked into tiles before they are loaded, the glow disc that swells in front of the caster on the canvas sprite, the 32 sparks that fly into it, the 32 explosions round the target, and the stage of the cast. |
Macros
| Name | Description | |
|---|---|---|
#define | BURST_SPARK_COUNT 32 | The sparks that fly into Burst's glow, and its explosions round the target. |
#define | BURST_EXPLOSION_COUNT 32 | |
#define | BURST_EXPLOSION_PICTURE_TILES 4 | The tiles of one of an explosion's eight pictures, which follow each other from BURST_STATE.burstTile. |
#define | BURST_EXPLOSION_PALETTE 15 | The OBJ palette the explosions are drawn in. |
#define | BURST_SHAKE_DECAY (toFIXED(9) / 10) | How much of a screen shake is kept each tick. |
#define | BURST_FINAL_EXPLOSIONS 10 | The explosions the last and largest blast starts, on its first tick and again on its fifth. |
#define | BURST_SPARKS_AT_NOTHING 12 | The sparks drawn when Burst is cast at nothing. |
#define | BURST_NEXT_PHASE (state) ((state)->phase++, (state)->timer = -1) | Moves the state on to its next phase, its timer restarted. |
Enumerations
| Name | Description | |
|---|---|---|
enum | BURST_PALETTE_MODE { BURST_PALETTE_KEPT, BURST_PALETTE_SHINE, BURST_PALETTE_EXPLO … } | BURST_STATE.paletteMode: what fdPsynergyUpdateBurst does to the palettes. |
enum | BURST_PHASE { BURST_PHASE_START, BURST_PHASE_SWELL, BURST_PHASE_GATHER, BU … } | BURST_STATE.phase: the stages of the cast, each lasting the ticks its case counts. |
Functions
| Name | Description | |
|---|---|---|
void | fdPsynergyUpdateBurst (void) | Burst each tick: shines the glow, draws the sparks and the explosions, and moves the cast on through its stages, shaking the screen at each blast. |
void | fdPsynergyBurstOnTarget (void) | Burst cast on a target: runs fdPsynergyBurst. |
Sint32 | fdPsynergyGetCanvasPriority (ACTOR *actor, Sint32 facing) | The OBJ priority a Psynergy's canvas takes: the caster's own when it casts facing away (FACING_NORTH), else 0, in front of everything. |
void | fdPsynergyBurst (void) | Burst: a glow disc swells in front of the caster as sparks fly into it, then explosions burst round the target, shaking the screen, the last and largest at 12 pixels; the target's script runs each tick with the stage (shake). |
Variables
| Name | Description | |
|---|---|---|
extern const Uint16 | BurstExplosionPalette [] | The palette of Burst's explosions, loaded into BURST_EXPLOSION_PALETTE. |
extern const Uint8 | BurstGlowTiles [] | The tile of the sparks that fly into Burst's glow, one 8x8 tile of 256 colours. |
Description
Burst: its glow and sparks, and its explosions on the target. Part of
field_psynergy.c.
Macros in detail
BURST_SPARK_COUNT
#define BURST_SPARK_COUNT 32
The sparks that fly into Burst's glow, and its explosions round the target.
Referenced by fdPsynergyBurst() and fdPsynergyUpdateBurst().
Definition at line 5 of file field_psynergy_burst.c.
BURST_EXPLOSION_COUNT
#define BURST_EXPLOSION_COUNT 32
Referenced by fdPsynergyBurst() and fdPsynergyUpdateBurst().
Definition at line 6 of file field_psynergy_burst.c.
BURST_EXPLOSION_PICTURE_TILES
#define BURST_EXPLOSION_PICTURE_TILES 4
The tiles of one of an explosion's eight pictures, which follow each other
from BURST_STATE.burstTile.
Referenced by fdPsynergyUpdateBurst().
Definition at line 9 of file field_psynergy_burst.c.
BURST_EXPLOSION_PALETTE
#define BURST_EXPLOSION_PALETTE 15
The OBJ palette the explosions are drawn in.
Referenced by fdPsynergyBurst() and fdPsynergyUpdateBurst().
Definition at line 11 of file field_psynergy_burst.c.
BURST_SHAKE_DECAY
#define BURST_SHAKE_DECAY (toFIXED(9) / 10)
How much of a screen shake is kept each tick.
Referenced by fdPsynergyUpdateBurst().
Definition at line 13 of file field_psynergy_burst.c.
BURST_FINAL_EXPLOSIONS
#define BURST_FINAL_EXPLOSIONS 10
The explosions the last and largest blast starts, on its first tick and again on its fifth.
Referenced by fdPsynergyUpdateBurst().
Definition at line 16 of file field_psynergy_burst.c.
BURST_SPARKS_AT_NOTHING
#define BURST_SPARKS_AT_NOTHING 12
The sparks drawn when Burst is cast at nothing.
Referenced by fdPsynergyUpdateBurst().
Definition at line 18 of file field_psynergy_burst.c.
BURST_NEXT_PHASE
#define BURST_NEXT_PHASE(state) ((state)->phase++, (state)->timer = -1)
Moves the state on to its next phase, its timer restarted.
Referenced by fdPsynergyUpdateBurst().
Definition at line 67 of file field_psynergy_burst.c.
Enumerations in detail
BURST_PALETTE_MODE
enum BURST_PALETTE_MODE
BURST_STATE.paletteMode: what fdPsynergyUpdateBurst does to the palettes.
| Enumerator | Value | Description |
|---|---|---|
BURST_PALETTE_KEPT | nothing | |
BURST_PALETTE_SHINE | cycles the glow's greens each tick | |
BURST_PALETTE_EXPLOSIONS | loads the explosions' palette, once |
Definition at line 43 of file field_psynergy_burst.c.
BURST_PHASE
enum BURST_PHASE
BURST_STATE.phase: the stages of the cast, each lasting the ticks its case
counts.
| Enumerator | Value | Description |
|---|---|---|
BURST_PHASE_START | SE_SPIN | |
BURST_PHASE_SWELL | the glow grows | |
BURST_PHASE_GATHER | the sparks fly into it | |
BURST_PHASE_FIRST_BLASTS | explosions start, the screen darkens | |
BURST_PHASE_BLASTS | an explosion every 8 ticks | |
BURST_PHASE_HUSH | a pause | |
BURST_PHASE_GREAT_BLAST | ten explosions, ten more 4 ticks on |
Definition at line 52 of file field_psynergy_burst.c.
Functions in detail
fdPsynergyUpdateBurst
void fdPsynergyUpdateBurst(void)
Burst each tick: shines the glow, draws the sparks and the explosions, and moves the cast on through its stages, shaking the screen at each blast.
References BurstExplosionPalette, fdAdvanceWithGravity2D(), fdBattleEffectSetObjectUpdateMode(), fdCameraWorldToScreen(), fdEffectSpriteDraw(), fdEffectSpriteDrawAtWorldPos(), fdMapGridSetScreenShakeStub(), Sint32, syDMAXCopy(), syRandom(), sySin(), sySoundPlayStub() and syVectorAddPolarOffset().
Referenced by fdPsynergyBurst().
Definition at line 71 of file field_psynergy_burst.c.
fdPsynergyBurstOnTarget
void fdPsynergyBurstOnTarget(void)
Burst cast on a target: runs fdPsynergyBurst.
References fdPsynergyBurst().
Referenced by fdPsynergyDispatch().
Definition at line 393 of file field_psynergy_burst.c.
fdPsynergyBurst
void fdPsynergyBurst(void)
Burst: a glow disc swells in front of the caster as sparks fly into it, then
explosions burst round the target, shaking the screen, the last and largest
at 12 pixels; the target's script runs each tick with the stage (shake). Cast
at nothing (FIELD_EFFECT_STATE.aimAhead still set), it is shorter: 12 sparks
and one small explosion.
References BurstGlowTiles, fdActorGetSpriteDepth(), fdBattleEffectEndCanvasSprite(), fdBattleEffectStartCanvasSprite(), fdCameraWorldToScreen(), fdEffectSpriteInit(), fdFindPsynergyCue(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdPsynergyGetCanvasPriority(), fdPsynergyUpdateBurst(), fdRunPsynergyScript(), fdSelectPsynergyTarget(), Sint32, syCloseEvent(), syCos(), syDecompressTaggedLZ(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySetEvent(), sySin(), sySoundPlayStub(), sySynch(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().
Referenced by fdPsynergyBurstOnTarget() and fdPsynergyRun().
Definition at line 411 of file field_psynergy_burst.c.
Variables in detail
BurstExplosionPalette
extern const Uint16 BurstExplosionPalette[]
The palette of Burst's explosions, loaded into BURST_EXPLOSION_PALETTE.
Referenced by fdPsynergyUpdateBurst().
Definition at line 64 of file field_psynergy_burst.c.
BurstGlowTiles
extern const Uint8 BurstGlowTiles[]
The tile of the sparks that fly into Burst's glow, one 8x8 tile of 256 colours.
Referenced by fdPsynergyBurst().
Definition at line 402 of file field_psynergy_burst.c.