mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-24 14:59:13 -05:00
Decomped IsMonsterSleeping
This commit is contained in:
parent
e2cafe7dee
commit
9dfaf725cd
|
|
@ -1 +0,0 @@
|
|||
#pragma once
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_023007A8.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start IsMonsterSleeping
|
||||
IsMonsterSleeping: ; 0x023007A8
|
||||
ldr r0, [r0, #0xb4]
|
||||
ldrb r0, [r0, #0xbd]
|
||||
cmp r0, #1
|
||||
moveq r0, #1
|
||||
bxeq lr
|
||||
cmp r0, #5
|
||||
moveq r0, #1
|
||||
bxeq lr
|
||||
cmp r0, #3
|
||||
moveq r0, #1
|
||||
movne r0, #0
|
||||
and r0, r0, #0xff
|
||||
bx lr
|
||||
arm_func_end IsMonsterSleeping
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Checks if a monster has the sleep, nightmare, or napping status.
|
||||
bool8 IsMonsterSleeping(struct entity *monster);
|
||||
// Checks if a monster has a quarter or less HP remaining.
|
||||
bool8 MonsterHasQuarterHp(struct entity *monster);
|
||||
// Returns false if none of these conditions holds for the given entity:
|
||||
|
|
|
|||
1
main.lsf
1
main.lsf
|
|
@ -409,7 +409,6 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_0230027C.o
|
||||
Object src/dungeon_logic.o
|
||||
Object src/dungeon_logic_1.o
|
||||
Object asm/overlay_29_023007A8.o
|
||||
Object src/dungeon_capabilities.o
|
||||
Object asm/overlay_29_023008DC.o
|
||||
Object src/dungeon_capabilities_1.o
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ extern struct entity *AI_POTENTIAL_ATTACK_TARGETS[NUM_DIRECTIONS];
|
|||
|
||||
extern enum type_id GetMoveTypeForMonster(struct entity *entity, struct move *move);
|
||||
extern s32 WeightMoveWithIqSkills(struct entity *user, s32 move_ai_range, struct entity *target, enum type_id move_type);
|
||||
extern bool8 IsMonsterSleeping(struct entity *monster);
|
||||
extern u8 GetMoveAccuracyOrAiChance(struct move *move, u32 which);
|
||||
|
||||
void ResetAiCanAttackInDirection()
|
||||
|
|
|
|||
|
|
@ -3,6 +3,20 @@
|
|||
#include "dungeon_statuses.h"
|
||||
#include "dungeon_util_static.h"
|
||||
|
||||
bool8 IsMonsterSleeping(struct entity *monster)
|
||||
{
|
||||
if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_SLEEP)
|
||||
return TRUE;
|
||||
|
||||
if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_NAPPING)
|
||||
return TRUE;
|
||||
|
||||
if (GetEntInfo(monster)->sleep_class_status.sleep == STATUS_SLEEP_NIGHTMARE)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MonsterHasQuarterHp(struct entity *monster)
|
||||
{
|
||||
struct monster *entity_data = GetEntInfo(monster);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include "trap.h"
|
||||
#include "weather.h"
|
||||
|
||||
extern bool8 IsMonsterSleeping(struct entity* monster);
|
||||
extern bool8 HasLastUsedMove(struct move *moves);
|
||||
extern bool8 GendersEqualNotGenderless(s16 monster1, s16 monster2);
|
||||
|
||||
|
|
|
|||
|
|
@ -215,15 +215,16 @@ asm {function_header}
|
|||
# Otherwise, make a new set of files.
|
||||
if merge_prev_file:
|
||||
header_file_path = os.path.join(HEADER_FOLDER, f'{merge_prev_file}.h')
|
||||
with open(header_file_path, 'r') as header_file:
|
||||
header_lines = header_file.readlines()
|
||||
for i, line in reversed(list(enumerate(header_lines))):
|
||||
if line != '\n' and not line.startswith('#'):
|
||||
header_lines[i] += f'{function_header};\n'
|
||||
break
|
||||
print('Updating', header_file_path)
|
||||
with open(header_file_path, 'w') as header_file:
|
||||
header_file.writelines(header_lines)
|
||||
if os.path.exists(header_file_path):
|
||||
with open(header_file_path, 'r') as header_file:
|
||||
header_lines = header_file.readlines()
|
||||
for i, line in reversed(list(enumerate(header_lines))):
|
||||
if line != '\n' and not line.startswith('#'):
|
||||
header_lines[i] += f'{function_header};\n'
|
||||
break
|
||||
print('Updating', header_file_path)
|
||||
with open(header_file_path, 'w') as header_file:
|
||||
header_file.writelines(header_lines)
|
||||
|
||||
src_file_path = os.path.join(SRC_FOLDER, f'{merge_prev_file}.c')
|
||||
print('Updating', src_file_path)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user