Decomped IsMonsterVisuallyImpaired

This commit is contained in:
AnonymousRandomPerson 2025-05-10 22:43:52 -04:00
parent 9009886e13
commit 6935f19aac
7 changed files with 21 additions and 24 deletions

View File

@ -1,2 +0,0 @@
#pragma once
.public IsBlinded

View File

@ -0,0 +1 @@
#pragma once

View File

@ -1,27 +1,8 @@
.include "asm/macros.inc"
.include "overlay_29_023005C0.inc"
.include "overlay_29_023005FC.inc"
.text
arm_func_start IsMonsterVisuallyImpaired
IsMonsterVisuallyImpaired: ; 0x023005C0
stmdb sp!, {r4, lr}
ldr r4, [r0, #0xb4]
bl IsBlinded
cmp r0, #0
movne r0, #1
ldmneia sp!, {r4, pc}
ldrb r0, [r4, #0xf1]
cmp r0, #2
moveq r0, #1
ldmeqia sp!, {r4, pc}
cmp r0, #4
moveq r0, #1
movne r0, #0
and r0, r0, #0xff
ldmia sp!, {r4, pc}
arm_func_end IsMonsterVisuallyImpaired
arm_func_start IsMonsterMuzzled
IsMonsterMuzzled: ; 0x023005FC
ldr r0, [r0, #0xb4]

View File

@ -19,5 +19,7 @@ bool8 MonsterHasSkillInterferingStatus(struct entity *monster);
bool8 MonsterHasLeechSeedStatus(struct entity *monster);
// Checks if a monster has the whiffer status.
bool8 MonsterHasWhifferStatus(struct entity *monster);
// Checks if a monster's vision is impaired somehow. This includes the checks in IsBlinded, as well as STATUS_CROSS_EYED and STATUS_DROPEYE.
bool8 IsMonsterVisuallyImpaired(struct entity *monster, bool8 check_held_item);
#endif //PMDSKY_DUNGEON_LOGIC_0_H

View File

@ -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_023005C0.o
Object asm/overlay_29_023005FC.o
Object src/dungeon_logic.o
Object asm/overlay_29_023007A8.o
Object src/dungeon_capabilities.o

View File

@ -2,7 +2,6 @@
#include "dungeon_logic_0.h"
#include "dungeon_util_static.h"
extern bool8 IsMonsterVisuallyImpaired(struct entity *monster, bool8 check_held_item);
extern bool8 IsMonsterMuzzled(struct entity *monster);
extern bool8 MonsterHasMiracleEyeStatus(struct entity *monster);

View File

@ -1,4 +1,5 @@
#include "dungeon_logic_0.h"
#include "dungeon_statuses.h"
#include "dungeon_util_static.h"
bool8 IsMonsterDrowsy(struct entity *monster)
@ -67,3 +68,18 @@ bool8 MonsterHasWhifferStatus(struct entity *monster)
{
return GetEntInfo(monster)->sure_shot_class_status.sure_shot == STATUS_SURE_SHOT_WHIFFER;
}
bool8 IsMonsterVisuallyImpaired(struct entity *monster, bool8 check_held_item)
{
struct monster *pokemon_info = GetEntInfo(monster);
if (IsBlinded(monster, check_held_item))
return TRUE;
if (pokemon_info->blinker_class_status.blinded == STATUS_BLINKER_CROSS_EYED)
return TRUE;
if (pokemon_info->blinker_class_status.blinded == STATUS_BLINKER_DROPEYE)
return TRUE;
return FALSE;
}