Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_prism.c

Prism. More…

Included by battle_effect.c.

Macros

NameDescription
#definePRISM_COUNT (variant, column) PrismCounts[(variant) * 3 + (column)]One of PrismCounts' three numbers for a variant.
#definePRISM_CRYSTAL_COUNT 0The crystals that fall.
#definePRISM_TICKS 1The effect's ticks.
#definePRISM_DAMAGE_TICK 2The tick the damage is shown.
#definePRISM_CAMERA_TURN 192The camera's turn a tick in the strongest variant, until it slows from PRISM_CAMERA_SLOWING to a stop at PRISM_CAMERA_STOP.
#definePRISM_CAMERA_SLOWING 96
#definePRISM_CAMERA_STOP 104
#definePRISM_SHARD_MIDDLE_X 40The x in PrismShardStarts under the middle of the crystal.
#definePRISM_GROUND_Y toFIXED(56)y 56, where the crystals shatter.
#definePRISM_SHARD_PICTURES PICTURE_BYTES(CRYSTAL)The shards, after the crystal.
#definePRISM_SHATTERED 1A crystal's z once it has hit the ground.
#definePRISM_SHARD_PICTURE_COUNT 12The shard pictures that PrismShardPictures, PrismShardWidths and PrismShardHeights hold.
#definePHASE_RAMP_COLORS (CANVAS_LEVEL_BRIGHTEST + 1)The ramp's colours, one a canvas level.
#definePHASE_PEAK 16A channel's level at the top of the ramp, about which the sine sways it by up to twice as much either way.

Functions

NameDescription
voidbtEffectRunPrism (BATTLE_EFFECT_PARM *args)Crystals drop out of the sky onto the targets' side and shatter on the ground into spinning shards, flashing the targets and shaking the screen.
voidbtEffectUpdatePhasePalette (Sint32 frame, Sint32 redPhase, Sint32 greenPhase, Sint32 bluePhase)Rebuilds the background palette's first ramp as a grey whose channels sway with the tick, so the effect shimmers through colours.

Description

Prism. Part of battle_effect.c.

Macros in detail

PRISM_COUNT

#define PRISM_COUNT(variant, column) PrismCounts[(variant) * 3 + (column)]

One of PrismCounts' three numbers for a variant.

Referenced by btEffectRunPrism().

Definition at line 4 of file battle_effect_prism.c.

PRISM_CRYSTAL_COUNT

#define PRISM_CRYSTAL_COUNT 0

The crystals that fall.

Referenced by btEffectRunPrism().

Definition at line 6 of file battle_effect_prism.c.

PRISM_TICKS

#define PRISM_TICKS 1

The effect's ticks.

Referenced by btEffectRunPrism().

Definition at line 8 of file battle_effect_prism.c.

PRISM_DAMAGE_TICK

#define PRISM_DAMAGE_TICK 2

The tick the damage is shown.

Referenced by btEffectRunPrism().

Definition at line 10 of file battle_effect_prism.c.

PRISM_CAMERA_TURN

#define PRISM_CAMERA_TURN 192

The camera's turn a tick in the strongest variant, until it slows from PRISM_CAMERA_SLOWING to a stop at PRISM_CAMERA_STOP.

Referenced by btEffectRunPrism().

Definition at line 13 of file battle_effect_prism.c.

PRISM_CAMERA_SLOWING

#define PRISM_CAMERA_SLOWING 96

Referenced by btEffectRunPrism().

Definition at line 14 of file battle_effect_prism.c.

PRISM_CAMERA_STOP

#define PRISM_CAMERA_STOP 104

Referenced by btEffectRunPrism().

Definition at line 15 of file battle_effect_prism.c.

PRISM_SHARD_MIDDLE_X

#define PRISM_SHARD_MIDDLE_X 40

The x in PrismShardStarts under the middle of the crystal.

Referenced by btEffectRunPrism().

Definition at line 17 of file battle_effect_prism.c.

PRISM_GROUND_Y

#define PRISM_GROUND_Y toFIXED(56)

y 56, where the crystals shatter.

Referenced by btEffectRunPrism().

Definition at line 19 of file battle_effect_prism.c.

PRISM_SHARD_PICTURES

#define PRISM_SHARD_PICTURES PICTURE_BYTES(CRYSTAL)

The shards, after the crystal.

Referenced by btEffectRunDiamondBerg() and btEffectRunPrism().

Definition at line 21 of file battle_effect_prism.c.

PRISM_SHATTERED

#define PRISM_SHATTERED 1

A crystal's z once it has hit the ground.

Referenced by btEffectRunPrism().

Definition at line 23 of file battle_effect_prism.c.

PRISM_SHARD_PICTURE_COUNT

#define PRISM_SHARD_PICTURE_COUNT 12

The shard pictures that PrismShardPictures, PrismShardWidths and PrismShardHeights hold.

Referenced by btEffectRunPrism().

Definition at line 26 of file battle_effect_prism.c.

PHASE_RAMP_COLORS

#define PHASE_RAMP_COLORS (CANVAS_LEVEL_BRIGHTEST + 1)

The ramp's colours, one a canvas level.

Referenced by btEffectUpdatePhasePalette().

Definition at line 213 of file battle_effect_prism.c.

PHASE_PEAK

#define PHASE_PEAK 16

A channel's level at the top of the ramp, about which the sine sways it by up to twice as much either way.

Referenced by btEffectUpdatePhasePalette().

Definition at line 216 of file battle_effect_prism.c.

Functions in detail

btEffectRunPrism

void btEffectRunPrism(BATTLE_EFFECT_PARM *args)

Crystals drop out of the sky onto the targets' side and shatter on the ground into spinning shards, flashing the targets and shaking the screen.

Abilities: Prism, Hail Prism, Freeze Prism.

References btCameraShake(), btEffectBuildCanvasBlitters(), btEffectStartCanvasLayer(), btEffectTintBattler(), btParticleAdvanceWithGravity2D(), btResourceLoadAndDecompress(), PrismShardHeights, PrismShardPictures, PrismShardStarts, PrismShardWidths, Sint32, syRandom() and sySoundPlayStub().

Referenced by BattleEffectHandlers.

Definition at line 32 of file battle_effect_prism.c.

btEffectUpdatePhasePalette

void btEffectUpdatePhasePalette(Sint32 frame, Sint32 redPhase, Sint32 greenPhase, Sint32 bluePhase)

Rebuilds the background palette's first ramp as a grey whose channels sway with the tick, so the effect shimmers through colours.

References Sint32, sySin() and syWordsCopy().

Referenced by btEffectRunBind(), btEffectRunGaspFamily(), btEffectRunShiningStar() and btEffectRunUnusedTriangleStrike().

Definition at line 220 of file battle_effect_prism.c.