Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_element_pillar.c

Included by battle_effect.c.

Macros

NameDescription
#defineELEMENT_PILLAR_TICKS 56The element pillar, the shattering opening and element burst, and the light-streak backdrop with its halved canvas and dimming background.
#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_PILLAR_MOTES 32The pillar spirals the first ELEMENT_PILLAR_MOTES of its ELEMENT_SPIRAL_MOTES up around it, each circling once in ELEMENT_PILLAR_TURN_TICKS.
#defineELEMENT_PILLAR_TURN_TICKS 64
#defineELEMENT_PILLAR_SHEET_BYTES 1550The bytes of BlueGlowSheet, the motes' sheet, which the pillar allocates for itself.
#definePLOT (x, y)Puts colour 2 at (x, y) in the 256x120 8bpp tile sheet (32 tiles wide) in the map cell buffer.
#defineSHATTERING_OPENING_TICKS 128
#defineSHATTERING_OPENING_FLASHES
#defineSHATTERING_OPENING_FLASH_TICKSbroken
#defineSHATTERING_OPENING_PIECES 33pieces the screen breaks into
#defineSHATTERING_OPENING_DISC_X
#defineSHATTERING_OPENING_DISC_Ythe screen
#defineELEMENT_BURST_TICKS 56ticks of the element burst
#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.
#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

Functions

NameDescription
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.
voidbtEffectRunBackgroundFadeIn (BATTLE_EFFECT_PARM *args)Unused: nothing refers to it.
voidbtEffectRunShatteringOpening (BATTLE_EFFECT_PARM *args)As the battle with the Doom Dragon opens over the Serpent's stars, 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.
voidbtEffectTransferHalvedCanvas (void)Tick callback: when a transfer is pending, writes the canvas to BG character block 1 at half brightness.
voidbtEffectDrawStreaks (void)Draws a tick of the element streaks, lines of light closing in on the centre of the canvas, and has the canvas halved into VRAM.
voidbtEffectDimBackgroundStep (void)Each tick while ticks are left, darkens the battle background's 128 colours by one more BACKGROUND_LEVEL_STEP into BG palettes 6 to 13.
voidbtEffectStartElementStreaks (Sint32 kind)Starts the element streaks, which then draw by themselves while the battle runs on.
voidbtEffectEndElementStreaks (void)Ends the element streaks: removes their three events, clears the canvas in VRAM and frees what they took.

Macros in detail

ELEMENT_PILLAR_TICKS

#define ELEMENT_PILLAR_TICKS 56

The element pillar, the shattering opening and element burst, and the light-streak backdrop with its halved canvas and dimming background. Part of battle_effect.c.

Referenced by btEffectRunElementPillar().

Definition at line 4 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 7 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_HALF_HEIGHT

#define ELEMENT_PILLAR_HALF_HEIGHT 64

Referenced by btEffectRunElementPillar().

Definition at line 8 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_GLOW_WIDTH

#define ELEMENT_PILLAR_GLOW_WIDTH 24

Referenced by btEffectRunElementPillar().

Definition at line 9 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_GLOW_HEIGHT

#define ELEMENT_PILLAR_GLOW_HEIGHT 43

Referenced by btEffectRunElementPillar().

Definition at line 10 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 11 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_MOTES

#define ELEMENT_PILLAR_MOTES 32

The pillar spirals the first ELEMENT_PILLAR_MOTES of its ELEMENT_SPIRAL_MOTES up around it, each circling once in ELEMENT_PILLAR_TURN_TICKS.

Referenced by btEffectRunElementPillar().

Definition at line 15 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_TURN_TICKS

#define ELEMENT_PILLAR_TURN_TICKS 64

Referenced by btEffectRunElementPillar().

Definition at line 16 of file battle_effect_element_pillar.c.

ELEMENT_PILLAR_SHEET_BYTES

#define ELEMENT_PILLAR_SHEET_BYTES 1550

The bytes of BlueGlowSheet, the motes' sheet, which the pillar allocates for itself.

Referenced by btEffectRunElementPillar().

Definition at line 20 of file battle_effect_element_pillar.c.

PLOT

#define PLOT(x, y)

Puts colour 2 at (x, y) in the 256x120 8bpp tile sheet (32 tiles wide) in the map cell buffer.

Referenced by btEffectRunShatteringOpening().

Definition at line 293 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_TICKS

#define SHATTERING_OPENING_TICKS 128

Referenced by btEffectRunShatteringOpening().

Definition at line 297 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_FLASHES

#define SHATTERING_OPENING_FLASHES

Referenced by btEffectRunShatteringOpening().

Definition at line 299 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_FLASH_TICKS

#define SHATTERING_OPENING_FLASH_TICKS

broken

Referenced by btEffectRunShatteringOpening().

Definition at line 302 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 305 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_DISC_X

#define SHATTERING_OPENING_DISC_X

Referenced by btEffectRunShatteringOpening().

Definition at line 306 of file battle_effect_element_pillar.c.

SHATTERING_OPENING_DISC_Y

#define SHATTERING_OPENING_DISC_Y

the screen

Referenced by btEffectRunShatteringOpening().

Definition at line 309 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 695 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 698 of file battle_effect_element_pillar.c.

ELEMENT_BURST_SPARK_HEIGHT

#define ELEMENT_BURST_SPARK_HEIGHT 32

Referenced by btEffectRunElementBurst().

Definition at line 699 of file battle_effect_element_pillar.c.

ELEMENT_BURST_BURST_WIDTH

#define ELEMENT_BURST_BURST_WIDTH 48

Referenced by btEffectRunElementBurst().

Definition at line 700 of file battle_effect_element_pillar.c.

ELEMENT_BURST_BURST_HEIGHT

#define ELEMENT_BURST_BURST_HEIGHT 48

Referenced by btEffectRunElementBurst().

Definition at line 701 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 702 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 705 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 885 of file battle_effect_element_pillar.c.

STREAKS

#define STREAKS 64

Referenced by btEffectDrawStreaks().

Definition at line 886 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 889 of file battle_effect_element_pillar.c.

STREAK_LENGTH

#define STREAK_LENGTH 8

Referenced by btEffectDrawStreaks().

Definition at line 890 of file battle_effect_element_pillar.c.

Functions in detail

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. The battle's element glow and the auto battle run it, and it sets up its own heap blocks.

References btEffectEndCanvasLayer(), btEffectPosProjectBattler(), btEffectPosProjectPoint(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btResourceLoadAndDecompress(), Sint32, syCloseEvent(), syCos(), syHeapSlotAllocate(), syHeapSlotRelease(), syInitMatrix(), syLookAtLoad(), syRandom(), syResourceGetTableEntry(), sySin() and sySoundPlayStub().

Definition at line 25 of file battle_effect_element_pillar.c.

btEffectRunBackgroundFadeIn

void btEffectRunBackgroundFadeIn(BATTLE_EFFECT_PARM *args)

Unused: nothing refers to it. Shows the cloud swirl (btEffectRunCloudSwirl), then the battle background fading in, until A.

References BgScrollWork, btBackgroundLoadStub(), btBackgroundSetModeStub(), btCameraSetViewStub(), btEffectClearTintTimers(), btEffectRunCloudSwirl(), btEffectTintBattler(), btEffectTransferCanvas(), btPaletteBrightenSavedBattleBg(), PerWork, Sint32, syCloseEvent(), syHeapSlotAllocate(), syHeapSlotRelease(), sySynch(), syWordsClear(), syWordsCopy() and syWordsFill().

Definition at line 188 of file battle_effect_element_pillar.c.

btEffectRunShatteringOpening

void btEffectRunShatteringOpening(BATTLE_EFFECT_PARM *args)

As the battle with the Doom Dragon opens over the Serpent's stars, 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, syCloseEvent(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), sySetEvent(), sySoundPlayStub(), sySynch(), syWordsClear(), syWordsCopy() and syWordsFill().

Definition at line 316 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. The battle's element glow runs it, and it sets up its own heap blocks.

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

Definition at line 710 of file battle_effect_element_pillar.c.

btEffectTransferHalvedCanvas

void btEffectTransferHalvedCanvas(void)

Tick callback: when a transfer is pending, writes the canvas to BG character block 1 at half brightness.

References syColorBufferHalve().

Referenced by btEffectEndElementStreaks() and btEffectStartElementStreaks().

Definition at line 861 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, and has the canvas halved into VRAM.

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

Referenced by btEffectEndElementStreaks() and btEffectStartElementStreaks().

Definition at line 894 of file battle_effect_element_pillar.c.

btEffectDimBackgroundStep

void btEffectDimBackgroundStep(void)

Each tick while ticks are left, darkens the battle background's 128 colours by one more BACKGROUND_LEVEL_STEP into BG palettes 6 to 13.

References btColorBufferScaleStub().

Referenced by btEffectEndElementStreaks() and btEffectStartElementStreaks().

Definition at line 960 of file battle_effect_element_pillar.c.

btEffectStartElementStreaks

void btEffectStartElementStreaks(Sint32 kind)

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

References BgScrollWork, btBackgroundSetModeStub(), btCameraSetViewStub(), btEffectConfigureEffectDisplay(), btEffectDimBackgroundStep(), btEffectDrawStreaks(), btEffectSetupCanvasWindows(), btEffectTransferHalvedCanvas(), Sint32, syHeapSlotAllocate(), syResourceGetTableEntry(), sySetEvent(), sySynch() and syWordsClear().

Definition at line 979 of file battle_effect_element_pillar.c.

btEffectEndElementStreaks

void btEffectEndElementStreaks(void)

Ends the element streaks: removes their three events, clears the canvas in VRAM and frees what they took.

References btEffectDimBackgroundStep(), btEffectDrawStreaks(), btEffectTransferHalvedCanvas(), syCloseEvent(), syHeapSlotRelease() and syWordsClear().

Definition at line 1070 of file battle_effect_element_pillar.c.