Skip to Content
The Alchemy Project

src/field/script_commands_weather.c

The weather on the field: The Broken Seal's rain kept whole, this game's rain, and the storm's lightning. More…

Included by script_commands.c.

Macros

NameDescription
#defineWEATHER_PICTURE_BYTES (SPRITE_TILES(16, 16) * TILE_SIZE_4BPP)The weather's sprites: 16 by 16 pictures of 16 colours, four tiles each, in the last basic sprite palette (syPaletteLoadBasicSpriteColors loads 0 to 13).
#defineWEATHER_PALETTE 13
#defineOAM_SIZE_16X16 1OAM attribute 1's size (GBATEK, "LCD OBJ - OAM Attributes"): an OBJ_SHAPE_SQUARE sprite of size 1 is 16 by 16, an OBJ_SHAPE_HORIZONTAL one of size 2 32 by 16.
#defineOAM_SIZE_32X16 2

Functions

NameDescription
voidfdGroundParticlesUpdate (void)The Broken Seal's rain each tick (fdGroundParticlesStart, which nothing calls), kept whole: each drop falls from up to the right, splashes and plays its RAIN_SPLASH_FRAMES ticks of WeatherRainSplashFrames on a random spot near the leader, held while FLAG_WEATHER_HELD is set.
voidfdWeatherUpdateRain (void)This game's rain each tick (fdWeatherStartRain), outside Mars Lighthouse and on its ledges: each of the 64 streaks falls down and to the right onto a spot on the ground, a pair of WeatherRainStreakOffsets a tick, and then starts again 12 ticks up from a random spot (x within -64 to +192, z within -128 to +128 pixels of the map's focus).
voidfdWeatherUpdateLightning (void)The storm each tick: lightning flashes the BG colours three times, 5 ticks apart, with thunder; while lightning is on, the next burst comes 51 to 549 ticks later.

Description

The weather on the field: The Broken Seal's rain kept whole, this game's rain, and the storm's lightning. Part of script_commands.c.

Macros in detail

WEATHER_PICTURE_BYTES

#define WEATHER_PICTURE_BYTES (SPRITE_TILES(16, 16) * TILE_SIZE_4BPP)

The weather's sprites: 16 by 16 pictures of 16 colours, four tiles each, in the last basic sprite palette (syPaletteLoadBasicSpriteColors loads 0 to 13).

Referenced by fdEffectInitSparkles(), fdGroundParticlesStart(), fdMotesStart(), fdRisingParticlesStart() and fdWeatherStartRain().

Definition at line 8 of file script_commands_weather.c.

WEATHER_PALETTE

#define WEATHER_PALETTE 13

Referenced by fdEffectInitSparkles(), fdGroundParticlesStart(), fdMotesStart(), fdRisingParticlesStart() and fdWeatherStartRain().

Definition at line 9 of file script_commands_weather.c.

OAM_SIZE_16X16

#define OAM_SIZE_16X16 1

OAM attribute 1's size (GBATEK, "LCD OBJ - OAM Attributes"): an OBJ_SHAPE_SQUARE sprite of size 1 is 16 by 16, an OBJ_SHAPE_HORIZONTAL one of size 2 32 by 16.

Referenced by fdActorSetSquareSprite(), fdEffectUpdateSparkles(), fdMotesUpdate() and fdRisingParticlesUpdate().

Definition at line 13 of file script_commands_weather.c.

OAM_SIZE_32X16

#define OAM_SIZE_32X16 2

Referenced by fdWeatherUpdateRain().

Definition at line 14 of file script_commands_weather.c.

Functions in detail

fdGroundParticlesUpdate

void fdGroundParticlesUpdate(void)

The Broken Seal's rain each tick (fdGroundParticlesStart, which nothing calls), kept whole: each drop falls from up to the right, splashes and plays its RAIN_SPLASH_FRAMES ticks of WeatherRainSplashFrames on a random spot near the leader, held while FLAG_WEATHER_HELD is set.

References fdMapGridGetTerrainHeightStub(), fdMapStateView(), Sint32, syGameFlagGet(), syOAMAddSpriteAtDepthClamped(), syRandom() and WeatherRainSplashFrames.

Referenced by fdGroundParticlesStart().

Definition at line 20 of file script_commands_weather.c.

fdWeatherUpdateRain

void fdWeatherUpdateRain(void)

This game's rain each tick (fdWeatherStartRain), outside Mars Lighthouse and on its ledges: each of the 64 streaks falls down and to the right onto a spot on the ground, a pair of WeatherRainStreakOffsets a tick, and then starts again 12 ticks up from a random spot (x within -64 to +192, z within -128 to +128 pixels of the map's focus). FLAG_WEATHER_HELD holds them where they are.

References fdMapGridGetTerrainHeightStub(), fdMapStateView(), Sint32, syGameFlagGet(), syOAMAddSpriteAtDepthClamped(), syRandom() and WeatherRainStreakOffsets.

Referenced by fdWeatherStartRain() and fdWeatherStopRain().

Definition at line 72 of file script_commands_weather.c.

fdWeatherUpdateLightning

void fdWeatherUpdateLightning(void)

The storm each tick: lightning flashes the BG colours three times, 5 ticks apart, with thunder; while lightning is on, the next burst comes 51 to 549 ticks later. While FLAG_WEATHER_HELD is set no burst comes.

References fdPaletteFadeSetTarget(), Sint32, syDMAXCopy(), syGameFlagGet() and sySoundPlayStub().

Referenced by fdWeatherStartLightning() and fdWeatherStartLightningFlash().

Definition at line 129 of file script_commands_weather.c.