From d6d2f2033de91545e699e423688a7c79ccf173ef Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Sun, 8 Sep 2024 12:41:23 +0100 Subject: [PATCH] Fixes Pledge move combo timeout if frozen (#5340) Missing `HITMARKER_UNABLE_TO_USE_MOVE` in the frozen canceller --- src/battle_util.c | 2 +- test/battle/move_effect/pledge.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 656607480b92..afb7e474d533 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3296,7 +3296,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) if (!RandomPercentage(RNG_FROZEN, 20)) { gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen; - gHitMarker |= HITMARKER_NO_ATTACKSTRING; + gHitMarker |= (HITMARKER_NO_ATTACKSTRING | HITMARKER_UNABLE_TO_USE_MOVE); } else // unfreeze { diff --git a/test/battle/move_effect/pledge.c b/test/battle/move_effect/pledge.c index 32e9e070b4aa..96fcb941918f 100644 --- a/test/battle/move_effect/pledge.c +++ b/test/battle/move_effect/pledge.c @@ -769,7 +769,7 @@ DOUBLE_BATTLE_TEST("Pledge move combo fails if ally fails to act - Flinch Both R } } -DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move") +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Sleep") { GIVEN { PLAYER(SPECIES_WOBBUFFET) { Speed(4); } @@ -791,3 +791,24 @@ DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move" HP_BAR(opponentRight); } } + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Freeze") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Speed(4); } + PLAYER(SPECIES_WYNAUT) { Speed(3); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } + OPPONENT(SPECIES_WYNAUT) { Speed(5); Status1(STATUS1_FREEZE); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_FIRE_PLEDGE, target: playerLeft); MOVE(opponentRight, MOVE_GRASS_PLEDGE, target: playerLeft, WITH_RNG(RNG_FROZEN, 0)); MOVE(playerLeft, MOVE_GRASS_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +}