Decomped Conversion2IsActive

This commit is contained in:
AnonymousRandomPerson
2025-07-18 20:32:35 -04:00
parent 2874fb3c86
commit eb81483604
6 changed files with 23 additions and 38 deletions

View File

@@ -1,3 +0,0 @@
#pragma once
.public EntityIsValid__02318E4C
.public ExclusiveItemEffectIsActive__023197A8

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);