summaryrefslogtreecommitdiff
path: root/src/field/coord_event_weather.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-12-25 14:56:02 -0600
committerMarcus Huderle <huderlem@gmail.com>2017-12-26 16:08:39 -0600
commit6000e19e94c36b5d4b8c45b829b0506191282b44 (patch)
tree46fd27e466e21ebf4125479e1dad21a6961d1544 /src/field/coord_event_weather.c
parente3078400bbdb3e8416806127290b9a2d68cfb3b8 (diff)
Add coord_weather_event macro, and define COORD_EVENT_WEATHER_* constants
Diffstat (limited to 'src/field/coord_event_weather.c')
-rw-r--r--src/field/coord_event_weather.c87
1 files changed, 44 insertions, 43 deletions
diff --git a/src/field/coord_event_weather.c b/src/field/coord_event_weather.c
index 9c5a1ca4d..db4e9c161 100644
--- a/src/field/coord_event_weather.c
+++ b/src/field/coord_event_weather.c
@@ -1,115 +1,116 @@
#include "global.h"
+#include "constants/weather.h"
#include "coord_event_weather.h"
#include "field_weather.h"
struct CoordEventWeather
{
- u8 weather;
+ u8 coordEventWeather;
void (*func)(void);
};
-static void CoordEventWeather_Indoor(void);
+static void CoordEventWeather_Clouds(void);
static void CoordEventWeather_Sunny(void);
-static void CoordEventWeather_Rain(void);
-static void CoordEventWeather_Snowflakes(void);
+static void CoordEventWeather_LightRain(void);
+static void CoordEventWeather_Snow(void);
static void CoordEventWeather_Thunderstorm(void);
static void CoordEventWeather_Fog(void);
static void CoordEventWeather_DiagonalFog(void);
-static void CoordEventWeather_Snow(void);
+static void CoordEventWeather_Ash(void);
static void CoordEventWeather_Sandstorm(void);
-static void CoordEventWeather_Cloudy(void);
+static void CoordEventWeather_Dark(void);
static void CoordEventWeather_Drought(void);
-static void CoordEventWeather_UnderwaterFog(void);
-static void CoordEventWeather_UnderwaterBubbles(void);
+static void CoordEventWeather_Route119Cycle(void);
+static void CoordEventWeather_Route123Cycle(void);
static const struct CoordEventWeather sCoordEventWeatherFuncs[] =
{
- { 0x1, CoordEventWeather_Indoor },
- { 0x2, CoordEventWeather_Sunny },
- { 0x3, CoordEventWeather_Rain },
- { 0x4, CoordEventWeather_Snowflakes },
- { 0x5, CoordEventWeather_Thunderstorm },
- { 0x6, CoordEventWeather_Fog },
- { 0x7, CoordEventWeather_DiagonalFog },
- { 0x8, CoordEventWeather_Snow },
- { 0x9, CoordEventWeather_Sandstorm },
- { 0xa, CoordEventWeather_Cloudy },
- { 0xb, CoordEventWeather_Drought },
- { 0x14, CoordEventWeather_UnderwaterFog },
- { 0x15, CoordEventWeather_UnderwaterBubbles },
+ { COORD_EVENT_WEATHER_CLOUDS, CoordEventWeather_Clouds },
+ { COORD_EVENT_WEATHER_SUNNY, CoordEventWeather_Sunny },
+ { COORD_EVENT_WEATHER_RAIN_LIGHT, CoordEventWeather_LightRain },
+ { COORD_EVENT_WEATHER_SNOW, CoordEventWeather_Snow },
+ { COORD_EVENT_WEATHER_RAIN_MED, CoordEventWeather_Thunderstorm },
+ { COORD_EVENT_WEATHER_FOG_1, CoordEventWeather_Fog },
+ { COORD_EVENT_WEATHER_FOG_2, CoordEventWeather_DiagonalFog },
+ { COORD_EVENT_WEATHER_ASH, CoordEventWeather_Ash },
+ { COORD_EVENT_WEATHER_SANDSTORM, CoordEventWeather_Sandstorm },
+ { COORD_EVENT_WEATHER_DARK, CoordEventWeather_Dark },
+ { COORD_EVENT_WEATHER_DROUGHT, CoordEventWeather_Drought },
+ { COORD_EVENT_WEATHER_ROUTE119_CYCLE, CoordEventWeather_Route119Cycle },
+ { COORD_EVENT_WEATHER_ROUTE123_CYCLE, CoordEventWeather_Route123Cycle },
};
-static void CoordEventWeather_Indoor(void)
+static void CoordEventWeather_Clouds(void)
{
- SetWeather(1);
+ SetWeather(WEATHER_CLOUDS);
}
static void CoordEventWeather_Sunny(void)
{
- SetWeather(2);
+ SetWeather(WEATHER_SUNNY);
}
-static void CoordEventWeather_Rain(void)
+static void CoordEventWeather_LightRain(void)
{
- SetWeather(3);
+ SetWeather(WEATHER_RAIN_LIGHT);
}
-static void CoordEventWeather_Snowflakes(void)
+static void CoordEventWeather_Snow(void)
{
- SetWeather(4);
+ SetWeather(WEATHER_SNOW);
}
static void CoordEventWeather_Thunderstorm(void)
{
- SetWeather(5);
+ SetWeather(WEATHER_RAIN_MED);
}
static void CoordEventWeather_Fog(void)
{
- SetWeather(6);
+ SetWeather(WEATHER_FOG_1);
}
static void CoordEventWeather_DiagonalFog(void)
{
- SetWeather(9);
+ SetWeather(WEATHER_FOG_2);
}
-static void CoordEventWeather_Snow(void)
+static void CoordEventWeather_Ash(void)
{
- SetWeather(7);
+ SetWeather(WEATHER_ASH);
}
static void CoordEventWeather_Sandstorm(void)
{
- SetWeather(8);
+ SetWeather(WEATHER_SANDSTORM);
}
-static void CoordEventWeather_Cloudy(void)
+static void CoordEventWeather_Dark(void)
{
- SetWeather(11);
+ SetWeather(WEATHER_DARK);
}
static void CoordEventWeather_Drought(void)
{
- SetWeather(12);
+ SetWeather(WEATHER_DROUGHT);
}
-static void CoordEventWeather_UnderwaterFog(void)
+static void CoordEventWeather_Route119Cycle(void)
{
- SetWeather(20);
+ SetWeather(WEATHER_ROUTE119_CYCLE);
}
-static void CoordEventWeather_UnderwaterBubbles(void)
+static void CoordEventWeather_Route123Cycle(void)
{
- SetWeather(21);
+ SetWeather(WEATHER_ROUTE123_CYCLE);
}
-void DoCoordEventWeather(u8 n)
+void DoCoordEventWeather(u8 coordEventWeather)
{
u8 i;
for (i = 0; i < ARRAY_COUNT(sCoordEventWeatherFuncs); i++)
{
- if (sCoordEventWeatherFuncs[i].weather == n)
+ if (sCoordEventWeatherFuncs[i].coordEventWeather == coordEventWeather)
{
sCoordEventWeatherFuncs[i].func();
return;