src/field/script_commands_motes.c
Weather drawn in sprites on the field, and the storm's lightning: floating motes, rising sparkles, and the flashes of the palettes. More…
Included by script_commands.c.
Structures
| Name | Description | |
|---|---|---|
union | PARTICLE_LINK_WORD | A particle's first word, seen as a value or a link. |
Functions
| Name | Description | |
|---|---|---|
void | fdMotesStart (void) | Starts the floating motes (fdMotesUpdate): loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent. |
void | fdEffectUpdateSparkles (void) | Event of the sparkles: now and then a burst of up to four twinkles on one spot within 128 pixels of the leader. |
void | fdEffectInitSparkles (void) | Starts the sparkles (fdEffectUpdateSparkles): loads their tiles and clears the 32 sparkles. |
void | fdWeatherStartLightning (void) | Starts the storm's lightning (fdWeatherUpdateLightning): builds the dark (PALETTE_TINT_DIM) and lit (PALETTE_TINT_PALE) BG colours and their 12-step fade, and arms the first burst to end in 600 ticks, repeating. |
void | fdWeatherStopLightning (void) | Stops the lightning: no flash for 32767 ticks, and none after. |
void | fdWeatherLastLightning (void) | One last burst of lightning, its first flash two ticks from now (timer 12; fdWeatherUpdateLightning flashes at 11), then no more. |
void | fdWeatherResumeLightning (void) | Restarts the lightning: the next burst ends in 128 ticks, its first flash 118 ticks from now, and bursts repeat. |
void | fdWeatherStartLightningFlash (Sint32 from, Sint32 to) | Flashes the palette with the storm's event: one burst of three flashes of palette to, each fading back to palette from (fdPaletteFadeBuild modes) on the BG colours, ending 120 ticks from now, and no more after. |
Description
Weather drawn in sprites on the field, and the storm's lightning: floating
motes, rising sparkles, and the flashes of the palettes. Part of
script_commands.c.
Functions in detail
fdMotesStart
void fdMotesStart(void)
Starts the floating motes (fdMotesUpdate): loads their tiles and puts 32 of
them under the leader with staggered timers, drawn semi-transparent.
References fdMapGridGetTerrainHeightStub(), fdMotesUpdate(), FieldEffectMoteTiles, Sint32, state, syDecompressByteLZ(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), sySetEvent(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().
Definition at line 16 of file script_commands_motes.c.
fdEffectUpdateSparkles
void fdEffectUpdateSparkles(void)
Event of the sparkles: now and then a burst of up to four twinkles on one spot within 128 pixels of the leader.
References fdMapGridGetTerrainHeightStub(), FieldEffectSparklePictures, gmFlagGetStub(), Sint32, state, syOAMAddSpriteAtDepth(), syRandom() and TickCount.
Referenced by fdEffectInitSparkles().
Definition at line 65 of file script_commands_motes.c.
fdEffectInitSparkles
void fdEffectInitSparkles(void)
Starts the sparkles (fdEffectUpdateSparkles): loads their tiles and clears
the 32 sparkles.
References fdEffectUpdateSparkles(), fdMapGridGetTerrainHeightStub(), FieldEffectSparkleTiles, Sint32, state, syDecompressByteLZ(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), sySetEvent(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().
Referenced by scInit(), scSolSanctumEntranceRestoreInteriorState() and scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue().
Definition at line 173 of file script_commands_motes.c.
fdWeatherStartLightning
void fdWeatherStartLightning(void)
Starts the storm's lightning (fdWeatherUpdateLightning): builds the dark
(PALETTE_TINT_DIM) and lit (PALETTE_TINT_PALE) BG colours and their 12-step
fade, and arms the first burst to end in 600 ticks, repeating.
References fdPaletteFadeBuild(), fdPaletteFadeCalculateSteps(), fdWeatherUpdateLightning(), Sint32, state, syHeapSlotAllocateEWRAM() and sySetEvent().
Referenced by scCottageRoomsBDoraWakesIsaac(), scCottageRoomsBHurryToThePlaza(), scInit() and scValePrologueDoraSendsIsaacToThePlaza().
Definition at line 223 of file script_commands_motes.c.
fdWeatherStopLightning
void fdWeatherStopLightning(void)
Stops the lightning: no flash for 32767 ticks, and none after.
References state and syHeapSlotAllocateEWRAM().
Referenced by scCottageRoomsALeaveThroughDoor(), scCottageRoomsBCloseScreenAndExit(), scValePlazaTravelersLeaveAfterBattle(), scValePrologueShowBoulderSweepingDownriver() and scValeRequestBackdropExit().
Definition at line 242 of file script_commands_motes.c.
fdWeatherLastLightning
void fdWeatherLastLightning(void)
One last burst of lightning, its first flash two ticks from now (timer 12;
fdWeatherUpdateLightning flashes at 11), then no more.
References state and syHeapSlotAllocateEWRAM().
Referenced by scCottageRoomsBDoraWakesIsaac(), scCottageRoomsBHurryToThePlaza(), scInit(), scValeEruptionReturnFromMtAleph(), scValePlazaTravelersLeaveAfterBattle(), scValePrologueDoraSendsIsaacToThePlaza() and scValePrologueShowBoulderSweepingDownriver().
Definition at line 252 of file script_commands_motes.c.
fdWeatherResumeLightning
void fdWeatherResumeLightning(void)
Restarts the lightning: the next burst ends in 128 ticks, its first flash 118 ticks from now, and bursts repeat.
References state and syHeapSlotAllocateEWRAM().
Referenced by scCottageRoomsBDoraWakesIsaac(), scInit(), scValePlazaMeetSurvivingTravelers(), scValePlazaTravelersLeaveAfterBattle(), scValePrologueDoraSendsIsaacToThePlaza() and scValePrologueShowBoulderSweepingDownriver().
Definition at line 262 of file script_commands_motes.c.
fdWeatherStartLightningFlash
void fdWeatherStartLightningFlash(Sint32 from, Sint32 to)
Flashes the palette with the storm's event: one burst of three flashes of
palette to, each fading back to palette from (fdPaletteFadeBuild modes) on
the BG colours, ending 120 ticks from now, and no more after.
References fdPaletteFadeBuild(), fdPaletteFadeCalculateSteps(), fdWeatherUpdateLightning(), Sint32, state, syHeapSlotAllocateEWRAM() and sySetEvent().
Referenced by scValeEruptionReturnFromMtAleph().
Definition at line 273 of file script_commands_motes.c.