diff --git a/asm/include/overlay_29_02300588.inc b/asm/include/overlay_29_023005A4.inc similarity index 100% rename from asm/include/overlay_29_02300588.inc rename to asm/include/overlay_29_023005A4.inc diff --git a/asm/overlay_29_02300588.s b/asm/overlay_29_023005A4.s similarity index 80% rename from asm/overlay_29_02300588.s rename to asm/overlay_29_023005A4.s index 6a1a550d..5fd62bb8 100644 --- a/asm/overlay_29_02300588.s +++ b/asm/overlay_29_023005A4.s @@ -1,19 +1,8 @@ .include "asm/macros.inc" - .include "overlay_29_02300588.inc" + .include "overlay_29_023005A4.inc" .text - arm_func_start MonsterHasLeechSeedStatus -MonsterHasLeechSeedStatus: ; 0x02300588 - ldr r0, [r0, #0xb4] - ldrb r0, [r0, #0xe0] - cmp r0, #1 - moveq r0, #1 - movne r0, #0 - and r0, r0, #0xff - bx lr - arm_func_end MonsterHasLeechSeedStatus - arm_func_start MonsterHasWhifferStatus MonsterHasWhifferStatus: ; 0x023005A4 ldr r0, [r0, #0xb4] diff --git a/include/dungeon_logic_0.h b/include/dungeon_logic_0.h index 91e91756..5c972807 100644 --- a/include/dungeon_logic_0.h +++ b/include/dungeon_logic_0.h @@ -15,5 +15,6 @@ bool8 MonsterHasImmobilizingStatus(struct entity *monster); bool8 MonsterHasAttackInterferingStatus(struct entity *monster); // Checks if a monster has one of the non-self-inflicted statuses in the "curse" group, which loosely includes status conditions that interfere with the monster's skills or ability to do things: STATUS_CURSED, STATUS_DECOY, STATUS_GASTRO_ACID, STATUS_HEAL_BLOCK, STATUS_EMBARGO. bool8 MonsterHasSkillInterferingStatus(struct entity *monster); +bool8 MonsterHasLeechSeedStatus(struct entity *monster); #endif //PMDSKY_DUNGEON_LOGIC_0_H diff --git a/include/dungeon_mode.h b/include/dungeon_mode.h index 987e4b6e..873b78cb 100644 --- a/include/dungeon_mode.h +++ b/include/dungeon_mode.h @@ -174,6 +174,20 @@ struct curse_class_status { u8 curse_damage_countdown; }; +struct leech_seed_class_status { + u8 leech_seed; // 0x0: STATUS_LEECH_SEED if 1 + // 0x4: Used to track the statuses::statuses_unique_id of the relevant monster for + // statuses like Leech Seed and Destiny Bond. + u32 statuses_applier_id; + // 0x8: Index into entity_table_hdr::monster_slot_ptrs in the dungeon that the user + // (drainer) is held. + u8 leech_seed_source_monster_index; + u8 leech_seed_turns; // 0x9: Turns left for the status in statuses::leech_seed + // 0xA: Turns left until residual damage for the status in statuses::leech_seed, if applicable. + // Behaves weirdly without an afflictor + u8 leech_seed_damage_countdown; +}; + struct long_toss_class_status { u8 status; // 0x0: STATUS_LONG_TOSS if 1 }; @@ -296,21 +310,7 @@ struct monster { struct bide_class_status bide_class_status; // 0xD2 struct reflect_class_status reflect_class_status; // 0xD5 struct curse_class_status curse_class_status; // 0xD8 - u8 leech_seed; // 0xE0: STATUS_LEECH_SEED if 1 - u8 field_0xe1; - u8 field_0xe2; - u8 field_0xe3; - // 0xE4: Used to track the statuses::statuses_unique_id of the relevant monster for - // statuses like Leech Seed and Destiny Bond. - u32 statuses_applier_id; - // 0xE8: Index into entity_table_hdr::monster_slot_ptrs in the dungeon that the user - // (drainer) is held. - u8 leech_seed_source_monster_index; - u8 leech_seed_turns; // 0xE9: Turns left for the status in statuses::leech_seed - // 0xEA: Turns left until residual damage for the status in statuses::leech_seed, if applicable. - // Behaves weirdly without an afflictor - u8 leech_seed_damage_countdown; - u8 field_0xEB; + struct leech_seed_class_status leech_seed_class_status; // 0xE0 u8 sure_shot; // 0xEC: STATUS_SURE_SHOT if 1 u8 sure_shot_turns; // 0xED: Turns left for the status in statuses::sure_shot struct long_toss_class_status long_toss_class_status; // 0xEE diff --git a/main.lsf b/main.lsf index 3389e36d..beb58e10 100644 --- a/main.lsf +++ b/main.lsf @@ -297,7 +297,7 @@ Overlay OVY_29 Object src/overlay_29_023000E4.o Object asm/overlay_29_02300108.o Object src/dungeon_logic_0.o - Object asm/overlay_29_02300588.o + Object asm/overlay_29_023005A4.o Object src/dungeon_logic.o Object asm/overlay_29_023007A8.o Object src/dungeon_capabilities.o diff --git a/src/dungeon_logic.c b/src/dungeon_logic.c index 0370d67d..0b616347 100644 --- a/src/dungeon_logic.c +++ b/src/dungeon_logic.c @@ -2,7 +2,6 @@ #include "dungeon_logic_0.h" #include "dungeon_util_static.h" -extern bool8 MonsterHasLeechSeedStatus(struct entity *monster); extern bool8 MonsterHasWhifferStatus(struct entity *monster); extern bool8 IsMonsterVisuallyImpaired(struct entity *monster, bool8 check_held_item); extern bool8 IsMonsterMuzzled(struct entity *monster); diff --git a/src/dungeon_logic_0.c b/src/dungeon_logic_0.c index 8e5d5453..3edfb585 100644 --- a/src/dungeon_logic_0.c +++ b/src/dungeon_logic_0.c @@ -57,3 +57,8 @@ bool8 MonsterHasSkillInterferingStatus(struct entity *monster) return FALSE; } + +bool8 MonsterHasLeechSeedStatus(struct entity *monster) +{ + return GetEntInfo(monster)->leech_seed_class_status.leech_seed == STATUS_LEECH_SEED_LEECH_SEED; +}