diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/status_checker.c | 2 | ||||
-rw-r--r-- | src/weather.c | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/status_checker.c b/src/status_checker.c index 612e6cd..6f521f1 100644 --- a/src/status_checker.c +++ b/src/status_checker.c @@ -13,6 +13,7 @@ #include "map.h" #include "number_util.h" #include "status_checks_1.h" +#include "weather.h" // Array indices correspond to the current dungeon tileset. const u8 gDungeonCamouflageTypes[76] = { @@ -94,7 +95,6 @@ const u8 gDungeonCamouflageTypes[76] = { TYPE_ROCK }; -extern u8 GetWeather(struct DungeonEntity*); extern bool8 HasQuarterHPOrLess(struct DungeonEntity*); extern bool8 IsTileGround(struct MapTile*); extern bool8 CanLayTrap(struct Position*); diff --git a/src/weather.c b/src/weather.c new file mode 100644 index 0000000..3989790 --- /dev/null +++ b/src/weather.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "weather.h" + +#include "constants/item.h" +#include "constants/weather.h" +#include "dungeon_global_data.h" +#include "dungeon_items.h" + +u8 GetWeather(struct DungeonEntity* pokemon) +{ + if (pokemon != NULL && HasItem(pokemon, ITEM_ID_WEATHER_BAND)) + { + return WEATHER_CLEAR; + } + return gDungeonGlobalData->weather; +} |