From e2cafe7dee4896c85580cc6faa2c182eed80e50d Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 11 Sep 2025 23:14:29 -0400 Subject: [PATCH] Decomped IsThawingMove --- asm/main_02013AD0.s | 13 ------------- include/moves_3.h | 1 + src/move_checks.c | 2 +- src/moves_3.c | 5 +++++ 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/asm/main_02013AD0.s b/asm/main_02013AD0.s index 484df45a..5079e868 100644 --- a/asm/main_02013AD0.s +++ b/asm/main_02013AD0.s @@ -41,16 +41,3 @@ GetMoveCritChance: ; 0x02013B10 .align 2, 0 _02013B2C: .word DUNGEON_MOVE_TABLES arm_func_end GetMoveCritChance - - arm_func_start IsThawingMove -IsThawingMove: ; 0x02013B30 - ldr r1, _02013B4C ; =DUNGEON_MOVE_TABLES - ldrh r2, [r0, #4] - ldr r1, [r1, #8] - mov r0, #0x1a - mla r0, r2, r0, r1 - ldrb r0, [r0, #0x13] - bx lr - .align 2, 0 -_02013B4C: .word DUNGEON_MOVE_TABLES - arm_func_end IsThawingMove diff --git a/include/moves_3.h b/include/moves_3.h index 0c6b3ecf..fd907cc5 100644 --- a/include/moves_3.h +++ b/include/moves_3.h @@ -4,6 +4,7 @@ #include "move.h" #include "util.h" +bool8 IsThawingMove(struct move *move); // Returns true if the given move can be used while the user is affected by Taunt, or false if the move cannot be used while taunted. bool8 IsUsableWhileTaunted(struct move *move); diff --git a/src/move_checks.c b/src/move_checks.c index f841ee54..ba631fe2 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -9,6 +9,7 @@ #include "dungeon_visibility.h" #include "inflict_status.h" #include "math.h" +#include "moves_3.h" #include "number_util.h" #include "overlay_29_02338390.h" #include "run_dungeon_1.h" @@ -16,7 +17,6 @@ #include "trap.h" #include "weather.h" -extern bool8 IsThawingMove(struct move *move); extern bool8 IsMonsterSleeping(struct entity* monster); extern bool8 HasLastUsedMove(struct move *moves); extern bool8 GendersEqualNotGenderless(s16 monster1, s16 monster2); diff --git a/src/moves_3.c b/src/moves_3.c index 493d79c8..e080f585 100644 --- a/src/moves_3.c +++ b/src/moves_3.c @@ -3,6 +3,11 @@ extern struct move_data_table_outer DUNGEON_MOVE_TABLES; +bool8 IsThawingMove(struct move *move) +{ + return DUNGEON_MOVE_TABLES.moves->moves[move->id].ai_can_use_against_frozen; +} + bool8 IsUsableWhileTaunted(struct move *move) { return DUNGEON_MOVE_TABLES.moves->moves[move->id].usable_while_taunted;