Alchemy
Loading...
Searching...
No Matches

weather.c File Reference

Ground particles, motes, sparkles and lightning on the field. More...

Go to the source code of this file.

Data Structures

union  DustWord
 A particle's first word, seen as a value or a link. More...

Functions

void FieldFx_UpdateGroundParticles (void)
 Scheduler callback: animates the ground particles.
void FieldFx_UpdateLightning (void)
 Scheduler callback for the storm: every 150 to 550 frames lightning flashes the palette three times (5 frames apart) with a thunderclap, louder with loud set.
void FieldFx_StartGroundParticles (void)
 Starts the ground particles (FieldFx_UpdateGroundParticles) with sound 170: loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent.
void FieldMotes_Update (void)
 Scheduler callback: the floating motes.
void FieldMotes_Start (void)
 Starts the floating motes (FieldMotes_Update): loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent.
void FieldEffect_UpdateSparkles (void)
 Scheduler callback: the sparkles.
void FieldEffect_InitSparkles (void)
 Starts the sparkles (FieldEffect_UpdateSparkles): loads their tiles and clears the 32 sparkles.
void FieldFx_StartLightning (void)
 Starts the storm's lightning (FieldFx_UpdateLightning): builds the dark (0x10003) and lit (0x10005) palettes and their 12-step fade, and arms the first flash in 600 frames, repeating.
void FieldFx_StopLightning (void)
 Stops the lightning: no flash for 0x7fff frames, and none after.
void FieldFx_LastLightning (void)
 One last flash of lightning in 12 frames, then no more.
void FieldFx_ResumeLightning (void)
 Restarts the lightning: the next flash in 128 frames, repeating.
void BattleFx_StartBufferBlend (s32 from, s32 to)
 Flashes the palette once, 120 frames from now, from palette from to palette to (BattleFx_BuildBuffer modes), with the storm's flash callback.

Detailed Description

Ground particles, motes, sparkles and lightning on the field.

Part of psynergy_effects.c, compiled only through it.

Definition in file weather.c.

Function Documentation

◆ FieldFx_UpdateGroundParticles()

void FieldFx_UpdateGroundParticles ( void )

Scheduler callback: animates the ground particles.

Each plays a 16-frame animation (gFieldFx_GroundParticleFrames, 5 halfwords a frame: x and y offsets, tile, shape and size) on a random spot of ground within 128 pixels of the leader, then starts again elsewhere. They freeze while flag 0x166 is set.

Definition at line 12 of file weather.c.

Referenced by FieldFx_StartGroundParticles(), and FieldFx_UpdateGroundParticles().

◆ FieldFx_UpdateLightning()

void FieldFx_UpdateLightning ( void )

Scheduler callback for the storm: every 150 to 550 frames lightning flashes the palette three times (5 frames apart) with a thunderclap, louder with loud set.

Flag 0x166 holds the next flash back.

Definition at line 61 of file weather.c.

Referenced by BattleFx_StartBufferBlend(), FieldFx_StartLightning(), and FieldFx_UpdateLightning().

◆ FieldFx_StartGroundParticles()

void FieldFx_StartGroundParticles ( void )

Starts the ground particles (FieldFx_UpdateGroundParticles) with sound 170: loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent.

Definition at line 105 of file weather.c.

Referenced by FieldFx_StartGroundParticles(), and ValeHome_Initialize().

◆ FieldMotes_Update()

void FieldMotes_Update ( void )

Scheduler callback: the floating motes.

Each mote appears on the ground within 128 pixels of the leader (at most 8 new ones a frame), rises a pixel a frame, ever faster for its last 90 frames, jittering sideways and changing tiles as it ages, and lasts 120 frames or until it leaves the screen. They freeze while flag 0x166 is set.

Definition at line 160 of file weather.c.

Referenced by FieldMotes_Start(), and FieldMotes_Update().

◆ FieldMotes_Start()

void FieldMotes_Start ( void )

Starts the floating motes (FieldMotes_Update): loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent.

Definition at line 226 of file weather.c.

Referenced by FieldMotes_Start().

◆ FieldEffect_UpdateSparkles()

void FieldEffect_UpdateSparkles ( void )

Scheduler callback: the sparkles.

Now and then (1 frame in 256) a sparkle appears on the ground within 128 pixels of the leader, and up to three more follow on the same spot, each 4 frames shorter. Each plays gFieldFx_SparkleFrames, flipping every other frame. No new bursts start while the work's stopped is set; flag 0x166 freezes them.

Definition at line 277 of file weather.c.

Referenced by FieldEffect_InitSparkles(), and FieldEffect_UpdateSparkles().

◆ FieldEffect_InitSparkles()

void FieldEffect_InitSparkles ( void )

Starts the sparkles (FieldEffect_UpdateSparkles): loads their tiles and clears the 32 sparkles.

Definition at line 374 of file weather.c.

Referenced by FieldEffect_InitSparkles(), and SolSanctumEruption_Initialize().

◆ FieldFx_StartLightning()

void FieldFx_StartLightning ( void )

Starts the storm's lightning (FieldFx_UpdateLightning): builds the dark (0x10003) and lit (0x10005) palettes and their 12-step fade, and arms the first flash in 600 frames, repeating.

Definition at line 425 of file weather.c.

Referenced by Event_DoraSendsIsaacToThePlaza(), Event_DoraWakesIsaac(), Event_HurryToThePlaza(), FieldFx_StartLightning(), ValeBabi_Initialize(), ValeHome_Initialize(), ValeInteriors_Initialize(), ValeKraden_Initialize(), and ValeStorm_Initialize().

◆ FieldFx_StopLightning()

void FieldFx_StopLightning ( void )

◆ FieldFx_LastLightning()

◆ FieldFx_ResumeLightning()

◆ BattleFx_StartBufferBlend()

void BattleFx_StartBufferBlend ( s32 from,
s32 to )

Flashes the palette once, 120 frames from now, from palette from to palette to (BattleFx_BuildBuffer modes), with the storm's flash callback.

Definition at line 467 of file weather.c.

Referenced by BattleFx_StartBufferBlend(), and Event_ReturnFromMtAleph().