Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_prism.c

Prism. More…

Included by battle_effect.c.

Macros

NameDescription
#definePRISM_SHARDS_PER_CRYSTAL 16
#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_START_MIDDLE 40The x in PrismShardStarts over the crystal's middle.
#definePRISM_SHARD_KINDS 5The shard kinds a crystal breaks into, and the pictures of each as it spins: a shard turns to its next picture each PRISM_SHARD_SPIN_STEP of spin.
#definePRISM_SHARD_SPIN_PICTURES 3
#definePRISM_SHARD_SPIN_STEP 96
#definePRISM_TURN_TICKS 104The strongest Prism turns the camera over its first ticks, at a steady speed and then slowing to a stop over the last eight.
#definePRISM_TURN_SPEED 192
#definePRISM_TURN_SLOWING_TICKS 8
#definePRISM_TURN_SLOWDOWN (PRISM_TURN_SPEED / PRISM_TURN_SLOWING_TICKS)How much the turn slows each of those ticks.
#definePHASE_SWAY_LEVELS 16How far each channel of the phase palette sways either way, in colour levels.

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_SHARDS_PER_CRYSTAL

#define PRISM_SHARDS_PER_CRYSTAL 16

Referenced by btEffectRunPrism().

Definition at line 3 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 5 of file battle_effect_prism.c.

PRISM_SHARD_PICTURES

#define PRISM_SHARD_PICTURES PICTURE_BYTES(CRYSTAL)

The shards, after the crystal.

Referenced by btEffectRunPrism().

Definition at line 7 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 9 of file battle_effect_prism.c.

PRISM_SHARD_START_MIDDLE

#define PRISM_SHARD_START_MIDDLE 40

The x in PrismShardStarts over the crystal's middle.

Referenced by btEffectRunPrism().

Definition at line 11 of file battle_effect_prism.c.

PRISM_SHARD_KINDS

#define PRISM_SHARD_KINDS 5

The shard kinds a crystal breaks into, and the pictures of each as it spins: a shard turns to its next picture each PRISM_SHARD_SPIN_STEP of spin.

Referenced by btEffectRunPrism().

Definition at line 14 of file battle_effect_prism.c.

PRISM_SHARD_SPIN_PICTURES

#define PRISM_SHARD_SPIN_PICTURES 3

Referenced by btEffectRunPrism().

Definition at line 15 of file battle_effect_prism.c.

PRISM_SHARD_SPIN_STEP

#define PRISM_SHARD_SPIN_STEP 96

Referenced by btEffectRunPrism().

Definition at line 16 of file battle_effect_prism.c.

PRISM_TURN_TICKS

#define PRISM_TURN_TICKS 104

The strongest Prism turns the camera over its first ticks, at a steady speed and then slowing to a stop over the last eight.

Referenced by btEffectRunPrism().

Definition at line 20 of file battle_effect_prism.c.

PRISM_TURN_SPEED

#define PRISM_TURN_SPEED 192

Referenced by btEffectRunPrism().

Definition at line 21 of file battle_effect_prism.c.

PRISM_TURN_SLOWING_TICKS

#define PRISM_TURN_SLOWING_TICKS 8

Referenced by btEffectRunPrism().

Definition at line 22 of file battle_effect_prism.c.

PRISM_TURN_SLOWDOWN

#define PRISM_TURN_SLOWDOWN (PRISM_TURN_SPEED / PRISM_TURN_SLOWING_TICKS)

How much the turn slows each of those ticks.

Referenced by btEffectRunPrism().

Definition at line 24 of file battle_effect_prism.c.

PHASE_SWAY_LEVELS

#define PHASE_SWAY_LEVELS 16

How far each channel of the phase palette sways either way, in colour levels.

Referenced by btEffectUpdatePhasePalette().

Definition at line 27 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.

Prism
Prism
Hail Prism
Hail Prism
Freeze Prism
Freeze Prism

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

Referenced by BattleEffectHandlers.

Definition at line 33 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(), btEffectRunShiningStar(), btEffectRunThor() and btEffectRunUnusedTriangleStrike().

Definition at line 207 of file battle_effect_prism.c.