From 353e4ae6191f6fc741ff83d93af8fab1270423f8 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:41:00 +0100 Subject: [PATCH] Fixes Dynamax reversion animation when fainting (#6597) --- data/battle_scripts_1.s | 3 +++ test/battle/gimmick/dynamax.c | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 20010ff1d8..a394ae30db 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9994,9 +9994,12 @@ BattleScript_DynamaxEnds:: BattleScript_DynamaxEnds_Ret:: flushtextbox + spriteignore0hp TRUE updatedynamax playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE waitanimation + spriteignore0hp FALSE + pause B_WAIT_TIME_SHORT return BattleScript_MoveBlockedByDynamax:: diff --git a/test/battle/gimmick/dynamax.c b/test/battle/gimmick/dynamax.c index 988f19581d..abe5ee2814 100644 --- a/test/battle/gimmick/dynamax.c +++ b/test/battle/gimmick/dynamax.c @@ -68,6 +68,29 @@ SINGLE_BATTLE_TEST("Dynamax: Dynamax Level increases HP and max HP multipliers b } } +SINGLE_BATTLE_TEST("Dynamax: Dynamax expires when fainted") +{ + u32 dynamax; + PARAMETRIZE { dynamax = GIMMICK_NONE; } + PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE, gimmick: dynamax); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + if (dynamax) + MESSAGE("Wobbuffet used Max Strike!"); + else + MESSAGE("Wobbuffet used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + if (dynamax) // Expect to have visual reversion when fainting. + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + MESSAGE("Wobbuffet fainted!"); + } +} + SINGLE_BATTLE_TEST("Dynamax: Dynamax expires after three turns", u16 hp) { u32 dynamax;