diff --git a/asm/include/overlay_29_02300D00.inc b/asm/include/overlay_29_02300D50.inc similarity index 100% rename from asm/include/overlay_29_02300D00.inc rename to asm/include/overlay_29_02300D50.inc diff --git a/asm/overlay_29_02300D00.s b/asm/overlay_29_02300D50.s similarity index 63% rename from asm/overlay_29_02300D00.s rename to asm/overlay_29_02300D50.s index 9baa0482..7d0399a2 100644 --- a/asm/overlay_29_02300D00.s +++ b/asm/overlay_29_02300D50.s @@ -1,32 +1,8 @@ .include "asm/macros.inc" - .include "overlay_29_02300D00.inc" + .include "overlay_29_02300D50.inc" .text - arm_func_start CheckVariousStatuses__0230172C -CheckVariousStatuses__0230172C: ; 0x02300D00 - ldr r1, [r0, #0xb4] - ldrb r0, [r1, #0xbd] - cmp r0, #2 - cmpne r0, #4 - cmpne r0, #0 - movne r0, #1 - bxne lr - ldrb r0, [r1, #0xc4] - cmp r0, #1 - moveq r0, #1 - bxeq lr - cmp r0, #6 - moveq r0, #1 - bxeq lr - ldrb r0, [r1, #0xd2] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end CheckVariousStatuses__0230172C - arm_func_start ov29_02300D50 ov29_02300D50: ; 0x02300D50 stmdb sp!, {r3, lr} diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h index af9be15e..5b02a89b 100644 --- a/include/dungeon_capabilities_1.h +++ b/include/dungeon_capabilities_1.h @@ -13,5 +13,7 @@ bool8 CheckVariousConditions__0230156C(struct entity *entity); bool8 CheckVariousConditions__02301624(struct entity *entity); // Returns false if none of these conditions holds for the given entity: asleep, frozen, petrified, biding. bool8 CheckVariousStatuses__023016DC(struct entity *entity); +// Returns false if none of these conditions holds for the given entity: asleep, frozen, petrified, biding. +bool8 CheckVariousStatuses__0230172C(struct entity *entity); #endif //PMDSKY_DUNGEON_CAPABILITIES_H \ No newline at end of file diff --git a/main.lsf b/main.lsf index bbfb7f78..b4d52c83 100644 --- a/main.lsf +++ b/main.lsf @@ -454,7 +454,7 @@ Overlay OVY_29 Object src/dungeon_capabilities.o Object asm/overlay_29_023009A0.o Object src/dungeon_capabilities_1.o - Object asm/overlay_29_02300D00.o + Object asm/overlay_29_02300D50.o Object src/directional_bit_masks.o Object src/dungeon_capabilities_3.o Object asm/overlay_29_02300FCC.o diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index f65693a6..565cb096 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -3,8 +3,6 @@ #include "dungeon_statuses.h" #include "dungeon_util_static.h" -extern bool8 CheckVariousStatuses__0230172C(struct entity *entity); - bool8 IsMonsterSleeping(struct entity *monster) { if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_SLEEP) diff --git a/src/dungeon_capabilities_1.c b/src/dungeon_capabilities_1.c index dfcc341e..96586e12 100644 --- a/src/dungeon_capabilities_1.c +++ b/src/dungeon_capabilities_1.c @@ -5,8 +5,6 @@ #include "dungeon_util_static.h" #include "joined_at_checks.h" -extern bool8 CheckVariousStatuses__0230172C(struct entity *entity); - bool8 CheckVariousConditions__0230156C(struct entity *entity) { struct monster *pokemon_info = GetEntInfo(entity); @@ -86,3 +84,21 @@ bool8 CheckVariousStatuses__023016DC(struct entity *entity) return FALSE; } + +bool8 CheckVariousStatuses__0230172C(struct entity *entity) +{ + struct monster *pokemon_info = GetEntInfo(entity); + + if (pokemon_info->sleep_class_status.sleep != STATUS_SLEEP_SLEEPLESS && + pokemon_info->sleep_class_status.sleep != STATUS_SLEEP_YAWNING && + pokemon_info->sleep_class_status.sleep != STATUS_SLEEP_NONE) + return TRUE; + if (pokemon_info->frozen_class_status.freeze == STATUS_FROZEN_FROZEN) + return TRUE; + if (pokemon_info->frozen_class_status.freeze == STATUS_FROZEN_PETRIFIED) + return TRUE; + if (pokemon_info->bide_class_status.bide == STATUS_TWO_TURN_BIDE) + return TRUE; + + return FALSE; +}