From 7a0e5046d1d17bd33ae604c2cb136f5617dfc373 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 8 Sep 2025 11:56:31 +0200 Subject: [PATCH] Fixes Rage Fist for gen7 Disguise (#7692) --- data/battle_scripts_1.s | 1 + src/battle_script_commands.c | 6 +++++- test/battle/move_effect/rage_fist.c | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index b97b15d645..43e79b8df3 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6584,6 +6584,7 @@ BattleScript_CudChewActivates:: BattleScript_ApplyDisguiseFormChangeHPLoss:: jumpifgenconfiglowerthan GEN_CONFIG_DISGUISE_HP_LOSS, GEN_8, BattleScript_ApplyDisguiseFormChangeHPLossReturn + orword gHitMarker, HITMARKER_PASSIVE_HP_UPDATE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING BattleScript_ApplyDisguiseFormChangeHPLossReturn: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6f48ce8463..f011a09420 100755 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2321,6 +2321,7 @@ static void Cmd_datahpupdate(void) { CMD_ARGS(u8 battler); bool32 isPassiveHpUpdate = gHitMarker & HITMARKER_PASSIVE_HP_UPDATE; + bool32 disguiseActivates = FALSE; if (gBattleControllerExecFlags) return; @@ -2362,7 +2363,7 @@ static void Cmd_datahpupdate(void) gBattleStruct->moveDamage[battler] = GetNonDynamaxMaxHP(battler) / 8; BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_TargetFormChange; - return; + disguiseActivates = TRUE; } else { @@ -2447,6 +2448,9 @@ static void Cmd_datahpupdate(void) && CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerTarget].item) && !NoAliveMonsForEitherParty()) gBattleStruct->battlerState[gBattlerTarget].itemCanBeKnockedOff = TRUE; + + if (disguiseActivates) + return; } TryRestoreDamageAfterCheekPouch(battler); diff --git a/test/battle/move_effect/rage_fist.c b/test/battle/move_effect/rage_fist.c index 5d92544e53..a750893d11 100644 --- a/test/battle/move_effect/rage_fist.c +++ b/test/battle/move_effect/rage_fist.c @@ -251,7 +251,6 @@ SINGLE_BATTLE_TEST("Rage Fist base power is not increased if move had no affect" SINGLE_BATTLE_TEST("Rage Fist base power is increased if Disguise breaks (Gen7)") { - KNOWN_FAILING; s16 timesGotHit[2]; u16 species = SPECIES_NONE;