Rampage moves always confuse on final turn (#4722)

* rampage moves confuse on the final turn

* fix B_RAMPAGE_CANCELLING < GEN_5

* Remove pointless assumes
This commit is contained in:
sneed 2024-06-05 06:38:04 +03:00 committed by GitHub
parent daa6b7898e
commit 7fd0239370
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 6 deletions

View File

@ -1029,11 +1029,20 @@ void MarkBattlerReceivedLinkData(u32 battler)
const u8* CancelMultiTurnMoves(u32 battler)
{
const u8 *result = NULL;
gBattleMons[battler].status2 &= ~(STATUS2_MULTIPLETURNS);
gBattleMons[battler].status2 &= ~(STATUS2_LOCK_CONFUSE);
gBattleMons[battler].status2 &= ~(STATUS2_UPROAR);
gBattleMons[battler].status2 &= ~(STATUS2_BIDE);
if (B_RAMPAGE_CANCELLING < GEN_5)
{
gBattleMons[battler].status2 &= ~(STATUS2_MULTIPLETURNS);
gBattleMons[battler].status2 &= ~(STATUS2_LOCK_CONFUSE);
}
else if (!(gBattleMons[battler].status2 & STATUS2_LOCK_CONFUSE)
|| ((gBattleMons[battler].status2 & STATUS2_LOCK_CONFUSE) > STATUS2_LOCK_CONFUSE_TURN(1)))
{
gBattleMons[battler].status2 &= ~(STATUS2_MULTIPLETURNS);
}
// Clear battler's semi-invulnerable bits if they are not held by Sky Drop.
if (!(gStatuses3[battler] & STATUS3_SKY_DROPPED))
gStatuses3[battler] &= ~(STATUS3_SEMI_INVULNERABLE);

View File

@ -46,7 +46,6 @@ SINGLE_BATTLE_TEST("Thrash confuses the user after it finishes")
SINGLE_BATTLE_TEST("Thrash does not confuse the user if it is canceled on turn 1 of 3")
{
GIVEN {
ASSUME(B_RAMPAGE_CANCELLING >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -61,7 +60,6 @@ SINGLE_BATTLE_TEST("Thrash does not confuse the user if it is canceled on turn 1
SINGLE_BATTLE_TEST("Thrash does not confuse the user if it is canceled on turn 2 of 3")
{
GIVEN {
ASSUME(B_RAMPAGE_CANCELLING >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -73,9 +71,8 @@ SINGLE_BATTLE_TEST("Thrash does not confuse the user if it is canceled on turn 2
}
}
SINGLE_BATTLE_TEST("Thrash confuses the user if it is canceled on turn 3 of 3")
SINGLE_BATTLE_TEST("Thrash confuses the user if it is canceled on turn 3 of 3, Protect")
{
KNOWN_FAILING;
GIVEN {
ASSUME(B_RAMPAGE_CANCELLING >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
@ -89,6 +86,22 @@ SINGLE_BATTLE_TEST("Thrash confuses the user if it is canceled on turn 3 of 3")
}
}
SINGLE_BATTLE_TEST("Thrash confuses the user if it is canceled on turn 3 of 3, Immunity")
{
GIVEN {
ASSUME(B_RAMPAGE_CANCELLING >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_GENGAR);
} WHEN {
TURN { MOVE(player, MOVE_THRASH); }
TURN { SKIP_TURN(player); }
TURN { SWITCH(opponent, 1); SKIP_TURN(player); }
} SCENE {
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, player);
}
}
SINGLE_BATTLE_TEST("Petal Dance does not lock mons that copy the move with Dancer")
{
GIVEN {