Decomped GetEntityWeatherBallType

This commit is contained in:
AnonymousRandomPerson 2025-09-14 00:12:22 -04:00
parent e7f69ec215
commit 24ebfa50b2
9 changed files with 29 additions and 30 deletions

View File

@ -2,7 +2,6 @@
.public BoostSpeedOneStage
.public DUNGEON_PTR
.public EntityIsValid__0231B194
.public GetApparentWeather
.public GetTreasureBoxChances
.public IsMonster__0231A9D4
.public LogMessageByIdWithPopupCheckParticipants
@ -10,7 +9,6 @@
.public PrepareItemForPrinting__02345728
.public SetActionUseMoveAi
.public SubstitutePlaceholderStringTags
.public WEATHER_BALL_TYPE_TABLE
.public ov29_022E4110
.public ov29_022FB9E0
.public ov29_0232145C

View File

@ -1,19 +1,8 @@
.include "asm/macros.inc"
.include "overlay_29_0231AF0C.inc"
.include "overlay_29_0231AF24.inc"
.text
arm_func_start GetEntityWeatherBallType
GetEntityWeatherBallType: ; 0x0231AF0C
stmdb sp!, {r3, lr}
bl GetApparentWeather
ldr r1, _0231AF20 ; =WEATHER_BALL_TYPE_TABLE
ldrb r0, [r1, r0]
ldmia sp!, {r3, pc}
.align 2, 0
_0231AF20: .word WEATHER_BALL_TYPE_TABLE
arm_func_end GetEntityWeatherBallType
arm_func_start ov29_0231AF24
ov29_0231AF24: ; 0x0231AF24
#ifdef JAPAN

View File

@ -1,8 +0,0 @@
#ifndef PMDSKY_NATURAL_GIFT_H
#define PMDSKY_NATURAL_GIFT_H
#include "dungeon_mode.h"
const struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity);
#endif //PMDSKY_NATURAL_GIFT_H

View File

@ -1,8 +1,10 @@
#ifndef PREPROCESS_STRING_H
#define PREPROCESS_STRING_H
#include "enums.h"
struct PPStrValues {
u8* weather_0; // 0x0
u32 weather_0; // 0x0
u32 field_0x4;
u32 field_0x8;
u32 field_0xB;

View File

@ -0,0 +1,11 @@
#ifndef PMDSKY_SPECIAL_MOVE_TYPES_H
#define PMDSKY_SPECIAL_MOVE_TYPES_H
#include "dungeon_mode.h"
// Gets the relevant entry in NATURAL_GIFT_ITEM_TABLE based on the entity's held item, if possible.
const struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity);
// Gets the current Weather Ball type for the given entity, based on the apparent weather.
enum type_id GetEntityWeatherBallType(struct entity* entity);
#endif //PMDSKY_SPECIAL_MOVE_TYPES_H

View File

@ -508,8 +508,8 @@ Overlay OVY_29
Object asm/overlay_29_0231A9F8.o
Object src/overlay_29_0231ACAC.o
Object asm/overlay_29_0231AD38.o
Object src/natural_gift.o
Object asm/overlay_29_0231AF0C.o
Object src/special_move_types.o
Object asm/overlay_29_0231AF24.o
Object src/overlay_29_0231B194.o
Object asm/overlay_29_0231B1B8.o
Object src/overlay_29_0231B318.o

View File

@ -2,11 +2,10 @@
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util_static.h"
#include "main_02014CEC.h"
#include "natural_gift.h"
#include "natural_gift_data.h"
#include "overlay_29_023000E4.h"
#include "special_move_types.h"
extern enum type_id GetEntityWeatherBallType(struct entity* entity);
extern enum type_id GetMoveType(struct move* move);
enum type_id GetMoveTypeForMonster(struct entity *entity, struct move *move)

View File

@ -2,6 +2,7 @@
#include "dungeon_ai_targeting.h"
#include "dungeon_util_static.h"
#include "number_util.h"
#include "weather.h"
extern const u8 DUNGEON_MENU_SWITCH_STR1[];// = "[dungeon:0]";
@ -23,7 +24,6 @@ extern void* MemAlloc(u32 size, u32 nmemb);
extern struct entity* GetLeader(void);
extern u32 GetMoneyCarried(void);
extern void* GetApparentWeather(u32);
extern u32 sub_0204F9E0(void);
extern void ov29_022E2A78(u8*, void*, u32); // The third argument isn't actually used in the
// function (../asm/overlay_29_022E1A40.s#L1378)
@ -99,7 +99,7 @@ void DrawDungeonMenuStatusWindow(struct Window* window)
PreprocessString(str_buff, DRAW_DUNGEON_MENU_STATUS_WINDOW_BUFF_SIZE, str, 0, &str_values);
DrawTextInWindow(window, X_OFFSET, LINE_HEIGHT, str_buff);
str_values.weather_0 = GetApparentWeather(0);
str_values.weather_0 = GetApparentWeather(NULL);
str = StringFromId(DRAW_DUNGEON_MENU_STATUS_WINDOW_STR_ID_3);
PreprocessString(str_buff, DRAW_DUNGEON_MENU_STATUS_WINDOW_BUFF_SIZE, str, 0, &str_values);
DrawTextInWindow(window, X_OFFSET, LINE_HEIGHT * 2, str_buff);

View File

@ -1,7 +1,10 @@
#include "natural_gift.h"
#include "special_move_types.h"
#include "dungeon_util_static.h"
#include "natural_gift_data.h"
#include "overlay_29_0231A9D4.h"
#include "weather.h"
extern enum type_id WEATHER_BALL_TYPE_TABLE[8];
const struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity)
{
@ -31,3 +34,8 @@ const struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* ent
}
return NULL;
}
enum type_id GetEntityWeatherBallType(struct entity* entity)
{
return WEATHER_BALL_TYPE_TABLE[GetApparentWeather(entity)];
}