mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-03 01:00:09 -05:00
Decomped IsSleeping()
-Function provided by SethBarberee.
This commit is contained in:
parent
74d89a6fe4
commit
c5cd6e137f
|
|
@ -5,27 +5,6 @@
|
|||
|
||||
.text
|
||||
|
||||
thumb_func_start IsSleeping
|
||||
IsSleeping:
|
||||
push {lr}
|
||||
ldr r0, [r0, 0x70]
|
||||
adds r0, 0xA8
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
beq _08070B40
|
||||
cmp r0, 0x5
|
||||
beq _08070B40
|
||||
cmp r0, 0x3
|
||||
beq _08070B40
|
||||
movs r0, 0
|
||||
b _08070B42
|
||||
_08070B40:
|
||||
movs r0, 0x1
|
||||
_08070B42:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end IsSleeping
|
||||
|
||||
thumb_func_start HasQuarterHPOrLess
|
||||
HasQuarterHPOrLess:
|
||||
push {lr}
|
||||
|
|
@ -5,5 +5,7 @@
|
|||
|
||||
// 0x70A58
|
||||
bool8 HasNegativeStatus(struct DungeonEntity *pokemon);
|
||||
// 0x70B28
|
||||
bool8 IsSleeping(struct DungeonEntity *pokemon);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ SECTIONS {
|
|||
src/status_checks.o(.text);
|
||||
asm/code_80701A4.o(.text);
|
||||
src/status_checks_1.o(.text);
|
||||
asm/code_8070B28.o(.text);
|
||||
asm/code_8070B48.o(.text);
|
||||
src/dungeon_capabilities.o(.text);
|
||||
asm/code_8070BC0.o(.text);
|
||||
src/dungeon_capabilities_1.o(.text);
|
||||
|
|
|
|||
|
|
@ -42,3 +42,14 @@ bool8 HasNegativeStatus(struct DungeonEntity *pokemon)
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 IsSleeping(struct DungeonEntity *pokemon)
|
||||
{
|
||||
if (pokemon->entityData->sleepStatus != SLEEP_STATUS_SLEEP &&
|
||||
pokemon->entityData->sleepStatus != SLEEP_STATUS_NAPPING &&
|
||||
pokemon->entityData->sleepStatus != SLEEP_STATUS_NIGHTMARE)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user