From 8b871b7eb4328dbabb627c354663452f739888a4 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 10 Feb 2024 13:13:46 -0300 Subject: [PATCH] Fixed Disguise not ending the battle in the correct form (#4167) * Fixed Disguise not ending the battle in the correct form * Added TODO comments --- src/battle_script_commands.c | 8 ++++++++ src/battle_util.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index cb33eaa1e8a0..8d4df643c819 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1213,6 +1213,7 @@ static bool32 NoTargetPresent(u8 battler, u32 move) return FALSE; } +// TODO: Convert this to a proper FORM_CHANGE type. static bool32 TryAegiFormChange(void) { // Only Aegislash with Stance Change can transform, transformed mons cannot. @@ -2315,6 +2316,10 @@ static void Cmd_datahpupdate(void) } else if (DoesDisguiseBlockMove(gBattlerAttacker, battler, gCurrentMove)) { + // TODO: Convert this to a proper FORM_CHANGE type. + u32 side = GetBattlerSide(battler); + if (gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] == SPECIES_NONE) + gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED; BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_TargetFormChange; @@ -2491,6 +2496,7 @@ static void Cmd_resultmessage(void) if (gBattleControllerExecFlags) return; + // TODO: Convert this to a proper FORM_CHANGE type. // Do Ice Face form change which was set up in Cmd_adjustdamage. if (gBattleResources->flags->flags[gBattlerTarget] & RESOURCE_FLAG_ICE_FACE) { @@ -10113,6 +10119,7 @@ static void Cmd_various(void) } return; } + // TODO: Convert this to a proper FORM_CHANGE type. case VARIOUS_TRY_ACTIVATE_BATTLE_BOND: { VARIOUS_ARGS(); @@ -16231,6 +16238,7 @@ void BS_SetGlaiveRush(void) gBattlescriptCurrInstr = cmd->nextInstr; } +// TODO: Convert this to a proper FORM_CHANGE type. void BS_TryRelicSong(void) { NATIVE_ARGS(); diff --git a/src/battle_util.c b/src/battle_util.c index cbc5898f911c..683aff1df8af 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5667,6 +5667,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && TARGET_TURN_DAMAGED && IsBattlerAlive(battler)) { + // TODO: Convert this to a proper FORM_CHANGE type. if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING) { gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT; @@ -6109,6 +6110,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) && gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]) { + // TODO: Convert this to a proper FORM_CHANGE type. gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = FALSE; gBattleMons[battler].species = SPECIES_EISCUE_ICE_FACE; BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);