From 1e3313701e95fc1bbc204b90231e494ff9581ec7 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 14 Nov 2025 00:07:50 -0500 Subject: [PATCH] Decomped IsTeamMemberOnFirstTurnInFixedRoom --- ...9_022FBE04.inc => overlay_29_022FBE58.inc} | 10 +++---- ...ay_29_022FBE04.s => overlay_29_022FBE58.s} | 29 +------------------ include/dungeon_logic_7.h | 1 + main.lsf | 2 +- src/dungeon_ai_movement.c | 1 - src/dungeon_logic_7.c | 13 +++++++++ 6 files changed, 20 insertions(+), 36 deletions(-) rename asm/include/{overlay_29_022FBE04.inc => overlay_29_022FBE58.inc} (95%) rename asm/{overlay_29_022FBE04.s => overlay_29_022FBE58.s} (96%) diff --git a/asm/include/overlay_29_022FBE04.inc b/asm/include/overlay_29_022FBE58.inc similarity index 95% rename from asm/include/overlay_29_022FBE04.inc rename to asm/include/overlay_29_022FBE58.inc index 9ed084d6..bcdecba4 100644 --- a/asm/include/overlay_29_022FBE04.inc +++ b/asm/include/overlay_29_022FBE58.inc @@ -1,5 +1,4 @@ #pragma once -.public _s32_div_f .public CopySpawnEntriesMaster .public DUNGEON_PTR .public DungeonRngSetPrimary @@ -18,22 +17,21 @@ .public GetOffensiveStatAtLevel .public GetOutlawSpawnData .public GetTile -.public GetTurnLimit .public GroundToDungeonMoveset +.public IQ_SKILLS .public InitMoveCheckId .public InitTeamMember -.public IQ_SKILLS .public IsCurrentMissionType .public IsDestinationFloorWithFixedRoom .public IsDestinationFloorWithMonster -.public IsFullFloorFixedRoom .public IsInvalidSpawnTile .public JoinedAtRangeCheck2Veneer .public LoadWazaP2 +.public SetMonsterLevelAndId +.public UnloadCurrentWazaP +.public _s32_div_f .public ov29_022FB83C .public ov29_022FCD04 .public ov29_023021F0 .public ov29_02351E28 -.public SetMonsterLevelAndId .public sub_0200F9B4 -.public UnloadCurrentWazaP diff --git a/asm/overlay_29_022FBE04.s b/asm/overlay_29_022FBE58.s similarity index 96% rename from asm/overlay_29_022FBE04.s rename to asm/overlay_29_022FBE58.s index ac680e59..08407f0b 100644 --- a/asm/overlay_29_022FBE04.s +++ b/asm/overlay_29_022FBE58.s @@ -1,35 +1,8 @@ .include "asm/macros.inc" - .include "overlay_29_022FBE04.inc" + .include "overlay_29_022FBE58.inc" .text - arm_func_start IsTeamMemberOnFirstTurnInFixedRoom -IsTeamMemberOnFirstTurnInFixedRoom: ; 0x022FBE04 - stmdb sp!, {r3, lr} - ldrb r0, [r0, #6] - cmp r0, #0 - bne _022FBE4C - ldr r0, _022FBE54 ; =DUNGEON_PTR - ldr r0, [r0] - ldrb r0, [r0, #0x748] - bl GetTurnLimit - ldr r1, _022FBE54 ; =DUNGEON_PTR - ldr r1, [r1] - add r1, r1, #0x700 - ldrsh r1, [r1, #0x84] - cmp r1, r0 - bne _022FBE4C - bl IsFullFloorFixedRoom - cmp r0, #0 - movne r0, #1 - ldmneia sp!, {r3, pc} -_022FBE4C: - mov r0, #0 - ldmia sp!, {r3, pc} - .align 2, 0 -_022FBE54: .word DUNGEON_PTR - arm_func_end IsTeamMemberOnFirstTurnInFixedRoom - arm_func_start InitOtherMonsterData InitOtherMonsterData: ; 0x022FBE58 stmdb sp!, {r3, r4, r5, r6, r7, lr} diff --git a/include/dungeon_logic_7.h b/include/dungeon_logic_7.h index a7415898..eb01cf87 100644 --- a/include/dungeon_logic_7.h +++ b/include/dungeon_logic_7.h @@ -6,5 +6,6 @@ bool8 IsMonsterLoneOutlaw(struct monster* monster_info); bool8 IsSecretBazaarNpc(struct entity *entity); +bool8 IsTeamMemberOnFirstTurnInFixedRoom(struct monster *monster); #endif //PMDSKY_DUNGEON_LOGIC_7_H diff --git a/main.lsf b/main.lsf index 2439b6e6..479681fd 100644 --- a/main.lsf +++ b/main.lsf @@ -449,7 +449,7 @@ Overlay OVY_29 Object src/joined_at_checks.o Object asm/overlay_29_022FBB1C.o Object src/dungeon_logic_7.o - Object asm/overlay_29_022FBE04.o + Object asm/overlay_29_022FBE58.o Object src/overlay_29_022FC99C.o Object asm/overlay_29_022FC9C0.o Object src/overlay_29_022FEEB8_eu.o diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index 34a64591..9559354e 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -49,7 +49,6 @@ struct can_move_in_direction_info const s32 FACING_DIRECTION_INCREMENTS[] = {0, 1, -1, 2, -2, 3, -3, 4}; -extern s32 IsTeamMemberOnFirstTurnInFixedRoom(struct monster*); extern bool8 ShouldAvoidFirstHit(struct entity *monster, bool8 force_avoid); extern bool8 CanSeeTeammate(struct entity *monster); extern struct entity* GetLeaderIfVisible(struct entity *monster); diff --git a/src/dungeon_logic_7.c b/src/dungeon_logic_7.c index 67779147..152f7c8a 100644 --- a/src/dungeon_logic_7.c +++ b/src/dungeon_logic_7.c @@ -2,8 +2,11 @@ #include "dungeon_logic_6.h" #include "dungeon_mode.h" #include "dungeon_util_static.h" +#include "fixed_room_data_1.h" #include "util.h" +extern s32 GetTurnLimit(enum dungeon_id dungeon_id); + bool8 IsMonsterLoneOutlaw(struct monster* monster_info) { return IsBehaviorLoneOutlaw(monster_info->monster_behavior); @@ -13,3 +16,13 @@ bool8 IsSecretBazaarNpc(struct entity *entity) { return IsSecretBazaarNpcBehavior(GetEntInfo(entity)->monster_behavior); } + +bool8 IsTeamMemberOnFirstTurnInFixedRoom(struct monster *monster) +{ + if (!monster->is_not_team_member && + DUNGEON_PTR[0]->wind_turns == GetTurnLimit(DUNGEON_PTR[0]->id) && + IsFullFloorFixedRoom()) + return TRUE; + + return FALSE; +}