Alchemy
Loading...
Searching...
No Matches

prism.c File Reference

Prism. More...

Go to the source code of this file.

Macros

#define PRISM_GROUND_Y   0x380000
 y 56, where the crystals shatter
#define PRISM_SHARD_CELLS   (32 * 64)
 the shards, after the 32x64 crystal

Functions

void BattleFx_RunPrism (struct BattleEffectArgument *effect)
 Crystals drop out of the sky onto the targets' side, 8 frames apart, and shatter on the ground into 16 spinning shards each, flashing the targets and shaking the screen; the battle shows the damage 80 frames before the end, and the canvas darkens away over the last 8.
void Graphics_UpdatePhasePalette (s32 frame, s32 redPhase, s32 greenPhase, s32 bluePhase)
 Rebuilds the background palette's first ramp as a grey ramp whose red, green and blue each sway with the frame, out of step by their phases (1/65536ths of a turn), so the effect shimmers through colours.

Detailed Description

Prism.

Part of effect.c, the battle effect object, compiled only through it.

Definition in file prism.c.

Macro Definition Documentation

◆ PRISM_GROUND_Y

#define PRISM_GROUND_Y   0x380000

y 56, where the crystals shatter

Definition at line 7 of file prism.c.

Referenced by BattleFx_RunPrism().

◆ PRISM_SHARD_CELLS

#define PRISM_SHARD_CELLS   (32 * 64)

the shards, after the 32x64 crystal

Definition at line 8 of file prism.c.

Referenced by BattleFx_RunPrism().

Function Documentation

◆ BattleFx_RunPrism()

void BattleFx_RunPrism ( struct BattleEffectArgument * effect)

Crystals drop out of the sky onto the targets' side, 8 frames apart, and shatter on the ground into 16 spinning shards each, flashing the targets and shaking the screen; the battle shows the damage 80 frames before the end, and the canvas darkens away over the last 8.

Abilities: Prism, Hail Prism, Freeze Prism (kind 8).

effect->variant picks the volley from gPrism_Counts (crystals and frames: 1 in 110, 4 in 134, 12 in 166); with variant 2 the camera also swings round for the first 104 frames. The crystals are particles[]: z is 1 once shattered, variant is the frame it starts to fall. The shards are 16 per crystal in PARTICLES: z is how fast it spins.

Positions are canvas pixels in 16.16. Loads the crystal palette into the first 64 background colours and sets REG_BLDALPHA, the camera's yaw (variant 2) and work->shakeFrames, and flashes the targets at each shatter.

Definition at line 27 of file prism.c.

Referenced by BattleFx_RunPrism().

◆ Graphics_UpdatePhasePalette()

void Graphics_UpdatePhasePalette ( s32 frame,
s32 redPhase,
s32 greenPhase,
s32 bluePhase )

Rebuilds the background palette's first ramp as a grey ramp whose red, green and blue each sway with the frame, out of step by their phases (1/65536ths of a turn), so the effect shimmers through colours.

Called each frame by BattleFx_RunBind and BattleFx_RunTriangleStrike (bind.c), BattleFx_RunShiningStar (stars.c) and BattleFx_RunThor (thor.c). Level n's channel is (n + sway) / 2, the sway up to 32 levels either way, clamped to 0 to 31.

XXX: the 64 entries, black first, are copied to colours 1 to 64, so each level shows in the colour one above it and colour 64, the first of palette 4, is overwritten too. Whether the canvas's levels are meant to be one off would show in a capture of Thor or Bind against this palette.

frame : the effect's frame; the sway turns 1/64 of a circle a frame redPhase, greenPhase, bluePhase : each channel's offset in the sway

Definition at line 183 of file prism.c.

Referenced by BattleFx_RunBind(), BattleFx_RunShiningStar(), BattleFx_RunThor(), BattleFx_RunTriangleStrike(), and Graphics_UpdatePhasePalette().