Pledge fail into opponent pledge loop fix (#5339)

* Pledge fail into opponent pledge loop fix

* Fixed excessively aggressive canceller

* Move the Pledge bit clear to its proper place

---------

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2024-09-08 10:38:52 +02:00 committed by GitHub
parent 68701a9e2d
commit 03e87a7d62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View file

@ -6438,6 +6438,8 @@ static void Cmd_moveend(void)
gBattleStruct->poisonPuppeteerConfusion = FALSE;
gBattleStruct->fickleBeamBoosted = FALSE;
gBattleStruct->distortedTypeMatchups = 0;
if (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
gBattleStruct->pledgeMove = FALSE;
if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE)
SetActiveGimmick(gBattlerAttacker, GIMMICK_NONE);
if (B_CHARGE <= GEN_8 || moveType == TYPE_ELECTRIC)

View file

@ -768,3 +768,26 @@ 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")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(4); }
PLAYER(SPECIES_WYNAUT) { Speed(3); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(8); }
OPPONENT(SPECIES_WYNAUT) { Speed(5); Status1(STATUS1_SLEEP_TURN(2)); }
} WHEN {
TURN { MOVE(opponentLeft, MOVE_FIRE_PLEDGE, target: playerLeft);
MOVE(opponentRight, MOVE_GRASS_PLEDGE, target: playerLeft);
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);
}
}