Skip to content

Commit

Permalink
Fixes Pledge move combo timeout if frozen (rh-hideout#5340)
Browse files Browse the repository at this point in the history
Missing `HITMARKER_UNABLE_TO_USE_MOVE` in the frozen canceller
  • Loading branch information
PhallenTree authored Sep 8, 2024
1 parent 03e87a7 commit d6d2f20
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
23 changes: 22 additions & 1 deletion test/battle/move_effect/pledge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand All @@ -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);
}
}

0 comments on commit d6d2f20

Please sign in to comment.