mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-26 16:37:17 -05:00
Decomped CheckVariousStatuses2__02301308
This commit is contained in:
parent
1c9b745e32
commit
a504858334
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
.public CheckVariousStatuses2__02301244
|
.public CheckVariousStatuses2__02301244
|
||||||
.public CheckVariousStatuses__0230172C
|
|
||||||
.public IsBlinded
|
.public IsBlinded
|
||||||
.public IsChargingAnyTwoTurnMove
|
.public IsChargingAnyTwoTurnMove
|
||||||
.public ShouldMonsterRunAway
|
.public ShouldMonsterRunAway
|
||||||
|
|
@ -1,66 +1,8 @@
|
||||||
.include "asm/macros.inc"
|
.include "asm/macros.inc"
|
||||||
.include "overlay_29_023008DC.inc"
|
.include "overlay_29_023009A0.inc"
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
arm_func_start CheckVariousStatuses2__02301308
|
|
||||||
CheckVariousStatuses2__02301308: ; 0x023008DC
|
|
||||||
stmdb sp!, {r3, r4, r5, lr}
|
|
||||||
mov r5, r0
|
|
||||||
cmp r1, #0
|
|
||||||
ldr r4, [r5, #0xb4]
|
|
||||||
beq _02300904
|
|
||||||
mov r1, #1
|
|
||||||
bl IsBlinded
|
|
||||||
cmp r0, #0
|
|
||||||
movne r0, #1
|
|
||||||
ldmneia sp!, {r3, r4, r5, pc}
|
|
||||||
_02300904:
|
|
||||||
ldrb r0, [r4, #0xbd]
|
|
||||||
cmp r0, #1
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
cmp r0, #5
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
cmp r0, #3
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
ldrb r0, [r4, #0xd0]
|
|
||||||
cmp r0, #3
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
cmp r0, #7
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
ldrb r0, [r4, #0xc4]
|
|
||||||
cmp r0, #3
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
cmp r0, #4
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
mov r0, r5
|
|
||||||
bl CheckVariousStatuses__0230172C
|
|
||||||
cmp r0, #0
|
|
||||||
movne r0, #1
|
|
||||||
ldmneia sp!, {r3, r4, r5, pc}
|
|
||||||
ldrb r0, [r4, #0xc4]
|
|
||||||
cmp r0, #6
|
|
||||||
moveq r0, #1
|
|
||||||
ldmeqia sp!, {r3, r4, r5, pc}
|
|
||||||
#ifdef JAPAN
|
|
||||||
ldrb r0, [r4, #0x104]
|
|
||||||
#else
|
|
||||||
ldrb r0, [r4, #0x105]
|
|
||||||
#endif
|
|
||||||
cmp r0, #0
|
|
||||||
movne r0, #1
|
|
||||||
moveq r0, #0
|
|
||||||
and r0, r0, #0xff
|
|
||||||
ldmia sp!, {r3, r4, r5, pc}
|
|
||||||
arm_func_end CheckVariousStatuses2__02301308
|
|
||||||
|
|
||||||
arm_func_start ov29_023009A0
|
arm_func_start ov29_023009A0
|
||||||
ov29_023009A0: ; 0x023009A0
|
ov29_023009A0: ; 0x023009A0
|
||||||
stmdb sp!, {r4, lr}
|
stmdb sp!, {r4, lr}
|
||||||
|
|
@ -13,5 +13,11 @@ bool8 MonsterHasQuarterHp(struct entity *monster);
|
||||||
// entity: Entity pointer
|
// entity: Entity pointer
|
||||||
// blind_check: If true, return true if entity is blinded
|
// blind_check: If true, return true if entity is blinded
|
||||||
bool8 CheckVariousStatuses2__02301244(struct entity *entity, bool8 blind_check);
|
bool8 CheckVariousStatuses2__02301244(struct entity *entity, bool8 blind_check);
|
||||||
|
// Returns false if none of these conditions holds for the given entity:
|
||||||
|
// blinded (checked only if blind_check == true),
|
||||||
|
// asleep, frozen, paused, infatuated, wrapping, wrapped, biding, petrified, or terrified.
|
||||||
|
// entity: Entity pointer
|
||||||
|
// blind_check: If true, return true if entity is blinded
|
||||||
|
bool8 CheckVariousStatuses2__02301308(struct entity *entity, bool8 blind_check);
|
||||||
|
|
||||||
#endif //PMDSKY_DUNGEON_CAPABILITIES_H
|
#endif //PMDSKY_DUNGEON_CAPABILITIES_H
|
||||||
|
|
|
||||||
2
main.lsf
2
main.lsf
|
|
@ -452,7 +452,7 @@ Overlay OVY_29
|
||||||
Object src/dungeon_logic.o
|
Object src/dungeon_logic.o
|
||||||
Object src/dungeon_logic_1.o
|
Object src/dungeon_logic_1.o
|
||||||
Object src/dungeon_capabilities.o
|
Object src/dungeon_capabilities.o
|
||||||
Object asm/overlay_29_023008DC.o
|
Object asm/overlay_29_023009A0.o
|
||||||
Object src/dungeon_capabilities_1.o
|
Object src/dungeon_capabilities_1.o
|
||||||
Object asm/overlay_29_02300D00.o
|
Object asm/overlay_29_02300D00.o
|
||||||
Object src/directional_bit_masks.o
|
Object src/directional_bit_masks.o
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#include "dungeon_statuses.h"
|
#include "dungeon_statuses.h"
|
||||||
#include "dungeon_util_static.h"
|
#include "dungeon_util_static.h"
|
||||||
|
|
||||||
|
extern bool8 CheckVariousStatuses__0230172C(struct entity *entity);
|
||||||
|
|
||||||
bool8 IsMonsterSleeping(struct entity *monster)
|
bool8 IsMonsterSleeping(struct entity *monster)
|
||||||
{
|
{
|
||||||
if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_SLEEP)
|
if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_SLEEP)
|
||||||
|
|
@ -58,3 +60,33 @@ bool8 CheckVariousStatuses2__02301244(struct entity *entity, bool8 blind_check)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool8 CheckVariousStatuses2__02301308(struct entity *entity, bool8 blind_check)
|
||||||
|
{
|
||||||
|
struct monster *pokemon_info = GetEntInfo(entity);
|
||||||
|
|
||||||
|
if ((blind_check && IsBlinded(entity, TRUE)))
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->sleep_class_status.sleep == STATUS_SLEEP_SLEEP)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->sleep_class_status.sleep == STATUS_SLEEP_NAPPING)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->sleep_class_status.sleep == STATUS_SLEEP_NIGHTMARE)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_PAUSED)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_INFATUATED)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->frozen_class_status.freeze == STATUS_FROZEN_WRAP)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->frozen_class_status.freeze == STATUS_FROZEN_WRAPPED)
|
||||||
|
return TRUE;
|
||||||
|
if (CheckVariousStatuses__0230172C(entity))
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->frozen_class_status.freeze == STATUS_FROZEN_PETRIFIED)
|
||||||
|
return TRUE;
|
||||||
|
if (pokemon_info->terrified_turns != 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include "dungeon_util_static.h"
|
#include "dungeon_util_static.h"
|
||||||
#include "joined_at_checks.h"
|
#include "joined_at_checks.h"
|
||||||
|
|
||||||
extern bool8 CheckVariousStatuses2__02301308(struct entity *entity, bool8 blind_check);
|
|
||||||
extern bool8 CheckVariousStatuses__0230172C(struct entity *entity);
|
extern bool8 CheckVariousStatuses__0230172C(struct entity *entity);
|
||||||
|
|
||||||
bool8 CheckVariousConditions__0230156C(struct entity *entity)
|
bool8 CheckVariousConditions__0230156C(struct entity *entity)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user