Decomped GetWeather()

This commit is contained in:
AnonymousRandomPerson
2022-02-20 22:30:05 -05:00
parent e54b3427db
commit 7c714bd14e
6 changed files with 9565 additions and 9556 deletions

File diff suppressed because it is too large Load Diff

9537
asm/code_807E5AC.s Normal file

File diff suppressed because it is too large Load Diff

9
include/weather.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef GUARD_WEATHER_H
#define GUARD_WEATHER_H
#include "dungeon_entity.h"
// 0x7E580
u8 GetWeather(struct DungeonEntity* pokemon);
#endif

View File

@@ -239,6 +239,8 @@ SECTIONS {
asm/code_807CABC.o(.text);
src/targeting_flags.o(.text);
asm/code_807CD9C.o(.text);
src/weather.o(.text);
asm/code_807E5AC.o(.text);
src/dungeon_range.o(.text);
asm/code_808333C.o(.text);
src/dungeon_random.o(.text);

View File

@@ -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*);

16
src/weather.c Normal file
View File

@@ -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;
}