diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 74ff203f1e..b22278b73d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -10501,8 +10501,8 @@ BattleScript_EffectMaxMove:: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG - setmaxmoveeffect tryfaintmon BS_TARGET + setmaxmoveeffect moveendall end diff --git a/test/dynamax.c b/test/dynamax.c index 9704c6a07e..c176873b64 100644 --- a/test/dynamax.c +++ b/test/dynamax.c @@ -1429,3 +1429,35 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max One Blow bypasses Max Guard for full damage" EXPECT_EQ(results[0].damage, results[1].damage); } } + +// Bug Testing +DOUBLE_BATTLE_TEST("(DYNAMAX) Max Flare doesn't softlock the game when fainting player partner") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET) { HP(1); }; + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerLeft, MOVE_PROTECT, dynamax: TRUE); + MOVE(opponentLeft, MOVE_V_CREATE, target: playerRight, dynamax: TRUE); + SEND_OUT(playerRight, 2); } + TURN { } + } +} + +SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves don't execute effects on fainted battlers") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); }; + } WHEN { + TURN { MOVE(player, MOVE_TACKLE, dynamax: TRUE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_DYNAMAX_GROWTH, player); + MESSAGE("Wobbuffet used Max Strike!"); + MESSAGE("Foe Wobbuffet fainted!"); + NOT MESSAGE("Foe Wobbuffet's Speed fell!"); + } +}