few more monster funcs

This commit is contained in:
Seth Barberee 2026-01-19 17:38:51 -08:00
parent 751aa84dee
commit f0bd067b72
4 changed files with 16 additions and 29 deletions

View File

@ -3,34 +3,6 @@
.text
arm_func_start GetSpawnThreshold
GetSpawnThreshold: ; 0x02052B44
ldr r2, _02052B5C ; =MONSTER_DATA_TABLE_PTR
mov r1, #0x44
ldr r2, [r2]
smlabb r0, r0, r1, r2
ldrb r0, [r0, #0x31]
bx lr
.align 2, 0
_02052B5C: .word MONSTER_DATA_TABLE_PTR
arm_func_end GetSpawnThreshold
arm_func_start NeedsItemToSpawn
NeedsItemToSpawn: ; 0x02052B60
ldr r2, _02052B88 ; =MONSTER_DATA_TABLE_PTR
mov r1, #0x44
ldr r2, [r2]
smlabb r0, r0, r1, r2
ldrb r0, [r0, #0x1a]
tst r0, #0x80
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
bx lr
.align 2, 0
_02052B88: .word MONSTER_DATA_TABLE_PTR
arm_func_end NeedsItemToSpawn
arm_func_start GetExclusiveItem
GetExclusiveItem: ; 0x02052B8C
ldr r2, _02052BB4 ; =MONSTER_DATA_TABLE_PTR

View File

@ -1,6 +1,11 @@
#ifndef PMDSKY_MAIN_02052B28_H
#define PMDSKY_MAIN_02052B28_H
#include "util.h"
s32 GetIqGroup(s16 monster_id);
u8 GetSpawnThreshold(s16 monster_id);
bool8 NeedsItemToSpawn(s16 monster_id);
#endif //PMDSKY_MAIN_02052B28_H

View File

@ -36,7 +36,7 @@ struct monster_data_table_entry {
u8 shadow_size; // 0x2E: The size of the Pokemon's shadow.
u8 spawn_asleep_chance; // 0x2F: The percent chance that a Pokemon will spawn asleep. Most of the time 0x8.
u8 hp_regeneration; // 0x30: The rate at which a Pokemon regenerates HP. Always 0x64.
s8 unk_0x31; // 0x31: Unknown.
s8 spawn_threshold; // 0x31:
s16 base_form_idx; // 0x32: The base evolutionary stage of the Pokemon. Seems to always be between 0 and 600.
s16 exclusive_item_1; // 0x34: The first 1-star exclusive item for this Pokemon. Null if NA.
s16 exclusive_item_2; // 0x36: The second 1-star exclusive item for this Pokemon. Null if NA.

View File

@ -5,3 +5,13 @@ s32 GetIqGroup(s16 monster_id)
{
return MONSTER_DATA_TABLE_PTR->entries[monster_id].iq_group;
}
u8 GetSpawnThreshold(s16 monster_id)
{
return MONSTER_DATA_TABLE_PTR->entries[monster_id].spawn_threshold;
}
bool8 NeedsItemToSpawn(s16 monster_id)
{
return MONSTER_DATA_TABLE_PTR->entries[monster_id].flags & 0b10000000 ? TRUE : FALSE;
}