Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_element_pillar.c

The blade rain, the element pillar, the shattering opening, the element burst and the element streaks. More…

Included by battle_effect.c.

Structures

NameDescription
structPLUNGE_STREAKOne streak of light of the element streak burst, over a particle's entry.

Macros

NameDescription
#defineCOLOR_PAIR (color) ((color) << 16 | (color))A word of two palette entries, both color.
#defineELEMENT_BURST_TICKS 56ticks of the element burst
#defineBATTLE_BACKGROUND_PALETTE 6The battle background's first BG palette, of the eight its colours take.
#defineBLADE_RAIN_TICKS 120
#defineBLADE_RAIN_SWORDS 16
#defineBLADE_RAIN_STEP_SHIFT 17A sword drifts sideways 0 to 3 steps of two pixels a tick, and its picture is its step's: velocityX is the step << BLADE_RAIN_STEP_SHIFT.
#defineBLADE_RAIN_WAIT_Y 24Where on the canvas the first sword waits for its turn; each four after it wait a pixel higher.
#defineELEMENT_PILLAR_TICKS 56
#defineELEMENT_PILLAR_HALF_WIDTH 17IceTileSheet: the pillar's half in four pictures, then its glow in three.
#defineELEMENT_PILLAR_HALF_HEIGHT 64
#defineELEMENT_PILLAR_GLOW_WIDTH 24
#defineELEMENT_PILLAR_GLOW_HEIGHT 43
#defineELEMENT_PILLAR_GLOW (4 * PICTURE_BYTES(ELEMENT_PILLAR_HALF))
#defineELEMENT_BLEND_LEVEL 12The element pillar's and burst's canvas weight over the battle, in sixteenths.
#defineELEMENT_SPIRAL_MOTES 128The motes both set up in PARTICLES; the pillar spirals the first ELEMENT_PILLAR_MOTES up around it, each circling once in ELEMENT_PILLAR_TURN_TICKS.
#defineELEMENT_PILLAR_MOTES 32
#defineELEMENT_PILLAR_TURN_TICKS 64
#defineSHATTERING_OPENING_PLOT_PIXEL (x, y)Sets one pixel of the disc's mask to colour 2.
#defineSHATTERING_OPENING_PLOT_CORNERS (x1, x2, y1, y2)Plots one point of the disc's circle in four octants.
#defineSHATTERING_OPENING_TICKS 128
#defineSHATTERING_OPENING_FLASHES 32Flashes thrown as the screen breaks.
#defineSHATTERING_OPENING_FLASH_TICKS 40How long a flash floats up, its six pictures four ticks each and the last held.
#defineSHATTERING_OPENING_PIECES 33Pieces the screen breaks into.
#defineSHATTERING_OPENING_DISC_X 96The centre of the opening disc.
#defineSHATTERING_OPENING_DISC_Y 60
#defineSTREAK_SEEDS 256The element streaks seeded at the start, and those drawn.
#defineSTREAKS 64
#defineSTREAK_START_DISTANCE 48A streak's head starts 48 to 63 from the centre, its tail STREAK_LENGTH behind it.
#defineSTREAK_LENGTH 8
#defineELEMENT_BURST_SPARK_WIDTH 32CyanSparkSheet: five small sparks, then the burst's pictures.
#defineELEMENT_BURST_SPARK_HEIGHT 32
#defineELEMENT_BURST_BURST_WIDTH 48
#defineELEMENT_BURST_BURST_HEIGHT 48
#defineELEMENT_BURST_BURST (5 * PICTURE_BYTES(ELEMENT_BURST_SPARK))
#defineELEMENT_BURST_MOTE_LIFE 16A burst mote's shortest life in ticks; by its index a mote lives up to twice as long, less one.

Functions

NameDescription
voidbtEffectRunBladeRain (BATTLE_EFFECT_PARM *args)Swords fall slanting in on the first target, one every 4 ticks, and stick in the ground.
voidbtEffectRunElementPillar (BATTLE_EFFECT_PARM *args)A pillar of light in an element's colours stands at a unit's feet while motes spiral up around it.
voidbtEffectRunShatteringOpening (BATTLE_EFFECT_PARM *args)As a battle opens on the storm at Venus Lighthouse's aerie, the screen turns white and breaks into pieces that fly apart and fall, while a grey disc grows over it and the battle background's colours return.
voidbtEffectRunElementBurst (BATTLE_EFFECT_PARM *args)Sparks in an element's colours flare at four corners around a unit and motes spiral in, then a burst of light plays over it.
voidbtEffectDrawStreaks (void)Draws a tick of the element streaks: lines of light closing in on the centre of the canvas.
voidbtEffectStartElementStreaks (Sint32 element)Starts the element streaks, which then draw by themselves while the battle runs on.
voidbtEffectEndElementStreaks (void)Ends the element streaks and frees what they took.

Description

The blade rain, the element pillar, the shattering opening, the element burst and the element streaks. Part of battle_effect.c.

Macros in detail

COLOR_PAIR

#define COLOR_PAIR(color) ((color) << 16 | (color))

A word of two palette entries, both color.

Referenced by btEffectRunShatteringOpening().

Definition at line 5 of file battle_effect_element_pillar.c.

ELEMENT_BURST_TICKS

#define ELEMENT_BURST_TICKS 56

ticks of the element burst

Referenced by btEffectRunElementBurst().

Definition at line 7 of file battle_effect_element_pillar.c.

BATTLE_BACKGROUND_PALETTE

#define BATTLE_BACKGROUND_PALETTE 6

The battle background's first BG palette, of the eight its colours take.

Referenced by btEffectDarkenBackgroundStep() and btEffectRunShatteringOpening().

Definition at line 9 of file battle_effect_element_pillar.c.

BLADE_RAIN_TICKS

#define BLADE_RAIN_TICKS 120

Referenced by btEffectRunBladeRain().

Definition at line 15 of file battle_effect_element_pillar.c.

BLADE_RAIN_SWORDS

#define BLADE_RAIN_SWORDS 16

Referenced by btEffectRunBladeRain().

Definition at line 16 of file battle_effect_element_pillar.c.

BLADE_RAIN_STEP_SHIFT

#define BLADE_RAIN_STEP_SHIFT 17

A sword drifts sideways 0 to 3 steps of two pixels a tick, and its picture is its step's: velocityX is the step << BLADE_RAIN_STEP_SHIFT.

Referenced by btEffectRunBladeRain().

Definition at line 19 of file battle_effect_element_pillar.c.

BLADE_RAIN_WAIT_Y

#define BLADE_RAIN_WAIT_Y 24

Where on the canvas the first sword waits for its turn; each four after it wait a pixel higher.

Referenced by btEffectRunBladeRain().

Definition at line 22 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_TICKS

#define ELEMENT_PILLAR_TICKS 56

Referenced by btEffectRunElementPillar().

Definition at line 197 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_HALF_WIDTH

#define ELEMENT_PILLAR_HALF_WIDTH 17

IceTileSheet: the pillar's half in four pictures, then its glow in three.

Referenced by btEffectRunElementPillar().

Definition at line 199 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_HALF_HEIGHT

#define ELEMENT_PILLAR_HALF_HEIGHT 64

Referenced by btEffectRunElementPillar().

Definition at line 200 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_GLOW_WIDTH

#define ELEMENT_PILLAR_GLOW_WIDTH 24

Referenced by btEffectRunElementPillar().

Definition at line 201 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_GLOW_HEIGHT

#define ELEMENT_PILLAR_GLOW_HEIGHT 43

Referenced by btEffectRunElementPillar().

Definition at line 202 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_GLOW

#define ELEMENT_PILLAR_GLOW (4 * PICTURE_BYTES(ELEMENT_PILLAR_HALF))

Referenced by btEffectRunElementPillar().

Definition at line 203 of file battle_effect_element_pillar.c.

ELEMENT_BLEND_LEVEL

#define ELEMENT_BLEND_LEVEL 12

The element pillar's and burst's canvas weight over the battle, in sixteenths.

Referenced by btEffectRunElementBurst() and btEffectRunElementPillar().

Definition at line 206 of file battle_effect_element_pillar.c.

ELEMENT_SPIRAL_MOTES

#define ELEMENT_SPIRAL_MOTES 128

The motes both set up in PARTICLES; the pillar spirals the first ELEMENT_PILLAR_MOTES up around it, each circling once in ELEMENT_PILLAR_TURN_TICKS.

Referenced by btEffectRunElementBurst() and btEffectRunElementPillar().

Definition at line 210 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_MOTES

#define ELEMENT_PILLAR_MOTES 32

Referenced by btEffectRunElementPillar().

Definition at line 211 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_TURN_TICKS

#define ELEMENT_PILLAR_TURN_TICKS 64

Referenced by btEffectRunElementPillar().

Definition at line 212 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_PLOT_PIXEL

#define SHATTERING_OPENING_PLOT_PIXEL(x, y)

Sets one pixel of the disc's mask to colour 2.

Definition at line 376 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_PLOT_CORNERS

#define SHATTERING_OPENING_PLOT_CORNERS(x1, x2, y1, y2)

Plots one point of the disc's circle in four octants.

Referenced by btEffectRunShatteringOpening().

Definition at line 381 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_TICKS

#define SHATTERING_OPENING_TICKS 128

Referenced by btEffectRunShatteringOpening().

Definition at line 387 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_FLASHES

#define SHATTERING_OPENING_FLASHES 32

Flashes thrown as the screen breaks.

Referenced by btEffectRunShatteringOpening().

Definition at line 389 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_FLASH_TICKS

#define SHATTERING_OPENING_FLASH_TICKS 40

How long a flash floats up, its six pictures four ticks each and the last held.

Referenced by btEffectRunShatteringOpening().

Definition at line 392 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_PIECES

#define SHATTERING_OPENING_PIECES 33

Pieces the screen breaks into.

Referenced by btEffectRunShatteringOpening().

Definition at line 394 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_DISC_X

#define SHATTERING_OPENING_DISC_X 96

The centre of the opening disc.

Referenced by btEffectRunShatteringOpening().

Definition at line 396 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_DISC_Y

#define SHATTERING_OPENING_DISC_Y 60

Referenced by btEffectRunShatteringOpening().

Definition at line 397 of file battle_effect_element_pillar.c.

STREAK_SEEDS

#define STREAK_SEEDS 256

The element streaks seeded at the start, and those drawn.

Referenced by btEffectDrawStreaks().

Definition at line 757 of file battle_effect_element_pillar.c.

STREAKS

#define STREAKS 64

Referenced by btEffectDrawStreaks().

Definition at line 758 of file battle_effect_element_pillar.c.

STREAK_START_DISTANCE

#define STREAK_START_DISTANCE 48

A streak's head starts 48 to 63 from the centre, its tail STREAK_LENGTH behind it.

Referenced by btEffectDrawStreaks().

Definition at line 761 of file battle_effect_element_pillar.c.

STREAK_LENGTH

#define STREAK_LENGTH 8

Referenced by btEffectDrawStreaks().

Definition at line 762 of file battle_effect_element_pillar.c.

ELEMENT_BURST_SPARK_WIDTH

#define ELEMENT_BURST_SPARK_WIDTH 32

CyanSparkSheet: five small sparks, then the burst's pictures.

Referenced by btEffectRunElementBurst().

Definition at line 778 of file battle_effect_element_pillar.c.

ELEMENT_BURST_SPARK_HEIGHT

#define ELEMENT_BURST_SPARK_HEIGHT 32

Referenced by btEffectRunElementBurst().

Definition at line 779 of file battle_effect_element_pillar.c.

ELEMENT_BURST_BURST_WIDTH

#define ELEMENT_BURST_BURST_WIDTH 48

Referenced by btEffectRunElementBurst().

Definition at line 780 of file battle_effect_element_pillar.c.

ELEMENT_BURST_BURST_HEIGHT

#define ELEMENT_BURST_BURST_HEIGHT 48

Referenced by btEffectRunElementBurst().

Definition at line 781 of file battle_effect_element_pillar.c.

ELEMENT_BURST_BURST

#define ELEMENT_BURST_BURST (5 * PICTURE_BYTES(ELEMENT_BURST_SPARK))

Referenced by btEffectRunElementBurst().

Definition at line 782 of file battle_effect_element_pillar.c.

ELEMENT_BURST_MOTE_LIFE

#define ELEMENT_BURST_MOTE_LIFE 16

A burst mote's shortest life in ticks; by its index a mote lives up to twice as long, less one.

Referenced by btEffectRunElementBurst().

Definition at line 785 of file battle_effect_element_pillar.c.

Functions in detail

btEffectRunBladeRain

void btEffectRunBladeRain(BATTLE_EFFECT_PARM *args)

Swords fall slanting in on the first target, one every 4 ticks, and stick in the ground.

References BladeRainSwordHeights, BladeRainSwordPictures, BladeRainSwordWidths, btCameraShake(), btEffectTintBattler(), btProjectionScaledUnit(), btResourceLoadAndDecompress(), HeapSlots, Sint32, state, syRandom(), sySoundPlayStub() and width.

Definition at line 26 of file battle_effect_element_pillar.c.

btEffectRunElementPillar

void btEffectRunElementPillar(BATTLE_EFFECT_PARM *args)

A pillar of light in an element's colours stands at a unit's feet while motes spiral up around it.

References btEffectEndCanvasLayer(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btObjectGetStub(), btProjectionPoint(), btProjectionUnit(), btResourceLoadAndDecompress(), Sint32, state, syCloseEvent(), syCos(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySin(), sySoundPlayStub() and syWordsCopy().

Definition at line 216 of file battle_effect_element_pillar.c.

btEffectRunShatteringOpening

void btEffectRunShatteringOpening(BATTLE_EFFECT_PARM *args)

As a battle opens on the storm at Venus Lighthouse's aerie, the screen turns white and breaks into pieces that fly apart and fall, while a grey disc grows over it and the battle background's colours return.

References BgScrollWork, btBackgroundLoadStub(), btBackgroundSetModeStub(), btCameraSetViewStub(), btEffectClearTintTimers(), btEffectTintBattler(), btEffectTransferCanvas(), btParticleAdvanceWithGravity2D(), btResourceLoadAndDecompress(), ShatteringOpeningPieceHeights, ShatteringOpeningPiecePictures, ShatteringOpeningPieceStartX, ShatteringOpeningPieceStartY, ShatteringOpeningPieceWidths, Sint32, state, syCloseEvent(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), sySoundPlayStub(), sySynch(), syWordsClear(), syWordsCopy() and syWordsFill().

Definition at line 402 of file battle_effect_element_pillar.c.

btEffectRunElementBurst

void btEffectRunElementBurst(BATTLE_EFFECT_PARM *args)

Sparks in an element's colours flare at four corners around a unit and motes spiral in, then a burst of light plays over it.

References btEffectEndCanvasLayer(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btProjectionScaledUnit(), btResourceLoadAndDecompress(), ElementBurstSparkFlips, ElementBurstSparkX, ElementBurstSparkY, Sint32, state, syCloseEvent(), syCos(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySin(), sySoundPlayStub() and syWordsCopy().

Definition at line 789 of file battle_effect_element_pillar.c.

btEffectDrawStreaks

void btEffectDrawStreaks(void)

Draws a tick of the element streaks: lines of light closing in on the centre of the canvas.

References btEffectDrawClippedCanvasLine(), btProjectionPoint(), Sint32, state, syInitMatrix(), syRandom(), syRotX(), syRotY() and syRotZ().

Referenced by btEffectEndElementStreaks() and btEffectStartElementStreaks().

Definition at line 934 of file battle_effect_element_pillar.c.

btEffectStartElementStreaks

void btEffectStartElementStreaks(Sint32 element)

Starts the element streaks, which then draw by themselves while the battle runs on.

References btEffectDrawStreaks(), btEffectStartCanvasLayer(), btEffectTransferCanvas(), Sint32, state, syHeapSlotAllocate(), syResourceGetTableEntry(), sySetEvent() and syWordsCopy().

Definition at line 1001 of file battle_effect_element_pillar.c.

btEffectEndElementStreaks

void btEffectEndElementStreaks(void)

Ends the element streaks and frees what they took.

References btEffectDarkenBackgroundStep(), btEffectDrawStreaks(), btEffectTransferCanvas(), syCloseEvent(), syHeapSlotRelease() and syWordsClear().

Definition at line 1032 of file battle_effect_element_pillar.c.