diff --git a/asm/include/overlay_29_02319814.inc b/asm/include/overlay_29_02319814.inc deleted file mode 100644 index 52b8ab90..00000000 --- a/asm/include/overlay_29_02319814.inc +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once -.public EntityIsValid__02318E4C -.public ExclusiveItemEffectIsActive__023197A8 diff --git a/asm/overlay_29_02319814.s b/asm/overlay_29_02319814.s deleted file mode 100644 index 56c2ad23..00000000 --- a/asm/overlay_29_02319814.s +++ /dev/null @@ -1,27 +0,0 @@ - .include "asm/macros.inc" - .include "overlay_29_02319814.inc" - - .text - - arm_func_start Conversion2IsActive -Conversion2IsActive: ; 0x02319814 - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__02318E4C - cmp r0, #0 - beq _02319854 - ldr r0, [r4, #0xb4] - ldrb r0, [r0, #0xd5] - cmp r0, #0xc - moveq r0, #1 - ldmeqia sp!, {r4, pc} - mov r0, r4 - mov r1, #0x27 - bl ExclusiveItemEffectIsActive__023197A8 - cmp r0, #0 - movne r0, #2 - ldmneia sp!, {r4, pc} -_02319854: - mov r0, #0 - ldmia sp!, {r4, pc} - arm_func_end Conversion2IsActive diff --git a/include/overlay_29_023197A8.h b/include/inflict_status.h similarity index 65% rename from include/overlay_29_023197A8.h rename to include/inflict_status.h index 15bfa706..c39b2c66 100644 --- a/include/overlay_29_023197A8.h +++ b/include/inflict_status.h @@ -1,5 +1,5 @@ -#ifndef PMDSKY_OVERLAY_29_023197A8_H -#define PMDSKY_OVERLAY_29_023197A8_H +#ifndef PMDSKY_INFLICT_STATUS_H +#define PMDSKY_INFLICT_STATUS_H #include "dungeon_mode.h" @@ -11,5 +11,8 @@ bool8 ExclusiveItemEffectIsActive__023197A8(struct entity *entity, enum exclusiv // Checks if the monster is under the effect of Mist. // Returns 1 if the effects is a status, 2 if it comes from an exclusive item, 0 otherwise. u8 MistIsActive(struct entity *entity); +// Checks if the monster is under the effect of Conversion 2 (its type was changed). +// Returns 1 if the effects is a status, 2 if it comes from an exclusive item, 0 otherwise. +u8 Conversion2IsActive(struct entity *entity); -#endif //PMDSKY_OVERLAY_29_023197A8_H +#endif //PMDSKY_INFLICT_STATUS_H diff --git a/main.lsf b/main.lsf index 60cbbed3..5b5251cb 100644 --- a/main.lsf +++ b/main.lsf @@ -442,8 +442,7 @@ Overlay OVY_29 Object asm/overlay_29_02318D58.o Object src/overlay_29_02318E4C.o Object asm/overlay_29_02318E70.o - Object src/overlay_29_023197A8.o - Object asm/overlay_29_02319814.o + Object src/inflict_status.o Object src/dungeon_ai_attack_2.o Object asm/overlay_29_02319880.o Object src/dungeon_ai_attack.o diff --git a/src/overlay_29_023197A8.c b/src/inflict_status.c similarity index 75% rename from src/overlay_29_023197A8.c rename to src/inflict_status.c index 86b19152..216b661e 100644 --- a/src/overlay_29_023197A8.c +++ b/src/inflict_status.c @@ -1,4 +1,4 @@ -#include "overlay_29_023197A8.h" +#include "inflict_status.h" #include "dg_random.h" #include "dungeon_parameters_1.h" #include "dungeon_util_static.h" @@ -42,3 +42,17 @@ u8 MistIsActive(struct entity *entity) return EFFECT_INACTIVE; } + +u8 Conversion2IsActive(struct entity *entity) +{ + if (EntityIsValid__02318E4C(entity)) + { + if (GetEntInfo(entity)->reflect_class_status.reflect == STATUS_REFLECT_CONVERSION2) + return EFFECT_ACTIVE_FROM_STATUS; + + if (ExclusiveItemEffectIsActive__023197A8(entity, EXCLUSIVE_EFF_CONVERSION_2_WHEN_HIT)) + return EFFECT_ACTIVE_FROM_EXCLUSIVE_ITEM; + } + + return EFFECT_INACTIVE; +} diff --git a/src/move_checks.c b/src/move_checks.c index 3ab0efb0..761b0602 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -3,14 +3,13 @@ #include "dungeon_logic_3.h" #include "dungeon_util_static.h" #include "dungeon_visibility.h" +#include "inflict_status.h" #include "number_util.h" -#include "overlay_29_023197A8.h" #include "run_dungeon_1.h" #include "tileset.h" #include "trap.h" #include "weather.h" -extern bool8 Conversion2IsActive(struct entity *entity); extern bool8 HasLowHealth(struct entity *entity); extern struct tile* GetTileAtEntity(struct entity *entity); extern bool8 IsTileGround(struct tile *tile);