mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-22 16:54:36 -05:00
Decomped GetWeather()
This commit is contained in:
9555
asm/code_807CD9C.s
9555
asm/code_807CD9C.s
File diff suppressed because it is too large
Load Diff
9537
asm/code_807E5AC.s
Normal file
9537
asm/code_807E5AC.s
Normal file
File diff suppressed because it is too large
Load Diff
9
include/weather.h
Normal file
9
include/weather.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef GUARD_WEATHER_H
|
||||
#define GUARD_WEATHER_H
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
// 0x7E580
|
||||
u8 GetWeather(struct DungeonEntity* pokemon);
|
||||
|
||||
#endif
|
||||
@@ -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);
|
||||
|
||||
@@ -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
16
src/weather.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user