mirror of
https://github.com/pret/pmd-sky.git
synced 2026-05-09 04:03:00 -05:00
Decomp IsOnMonsterSpawnList
This commit is contained in:
parent
155ccbb34b
commit
93871d3f8c
|
|
@ -5652,37 +5652,3 @@ ov29_022E7CFC: ; 0x022E7CFC
|
|||
.align 2, 0
|
||||
_022E7D48: .word DUNGEON_PTR
|
||||
arm_func_end ov29_022E7CFC
|
||||
|
||||
arm_func_start IsOnMonsterSpawnList
|
||||
IsOnMonsterSpawnList: ; 0x022E7D4C
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r6, r0
|
||||
mov r5, #0
|
||||
ldr r4, _022E7D9C ; =DUNGEON_PTR
|
||||
b _022E7D8C
|
||||
_022E7D60:
|
||||
ldr r0, [r4]
|
||||
#ifdef JAPAN
|
||||
add r0, r0, #0x8c0
|
||||
add r0, r0, #0x2c000
|
||||
#else
|
||||
add r0, r0, #0x164
|
||||
add r0, r0, #0x2c800
|
||||
#endif
|
||||
add r0, r0, r5, lsl #3
|
||||
bl GetMonsterIdFromSpawnEntry
|
||||
cmp r0, #0
|
||||
beq _022E7D94
|
||||
cmp r0, r6
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r4, r5, r6, pc}
|
||||
add r5, r5, #1
|
||||
_022E7D8C:
|
||||
cmp r5, #0x10
|
||||
blt _022E7D60
|
||||
_022E7D94:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_022E7D9C: .word DUNGEON_PTR
|
||||
arm_func_end IsOnMonsterSpawnList
|
||||
|
|
|
|||
|
|
@ -905,8 +905,8 @@ struct floor_properties {
|
|||
// 255 still means HIDDEN_STAIRS_RANDOM_SECRET_BAZAAR_OR_SECRET_ROOM.
|
||||
u8 hidden_stairs_type;
|
||||
u8 hidden_stairs_spawn_chance; // 0x1B
|
||||
u8 enemy_iq; // 0x1C: IQ stat of enemies
|
||||
u8 iq_booster_value; // 0x1E: IQ increase from the IQ booster item upon entering the floor
|
||||
s16 enemy_iq; // 0x1C: IQ stat of enemies
|
||||
s16 iq_booster_value; // 0x1E: IQ increase from the IQ booster item upon entering the floor
|
||||
};
|
||||
|
||||
// Contains the data required to display a tile on the minimap
|
||||
|
|
|
|||
|
|
@ -5,5 +5,6 @@
|
|||
// Returns a monster ID.
|
||||
s32 GetMonsterIdToSpawn(s32 weight_type_idx);
|
||||
s32 GetMonsterLevelToSpawn(s32 monster_id);
|
||||
s32 IsOnMonsterSpawnList(s32 monster_id);
|
||||
|
||||
#endif //PMDSKY_SPAWN_H
|
||||
|
|
|
|||
16
src/spawn.c
16
src/spawn.c
|
|
@ -6,6 +6,22 @@
|
|||
extern s32 GetMonsterIdFromSpawnEntry(struct monster_spawn_entry *);
|
||||
extern s32 GetMonsterLevelFromSpawnEntry(struct monster_spawn_entry *);
|
||||
|
||||
s32 IsOnMonsterSpawnList(s32 monster_id) {
|
||||
for(s32 i = 0; i < 16; i++) {
|
||||
s32 entity_monster_id = GetMonsterIdFromSpawnEntry(
|
||||
&DUNGEON_PTR[0]->spawn_entries_master[i]);
|
||||
|
||||
if(entity_monster_id == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(entity_monster_id == monster_id) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 GetMonsterIdToSpawn(s32 weight_type_idx)
|
||||
{
|
||||
s32 rand = DungeonRandInt(10000);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user