Fixes Opportunist accumulating stat changes (#4168)
* Fixes Opportunist accumulating stat changes * move memset to TurnValuesCleanUp * Update test/battle/ability/opportunist.c --------- Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
parent
8b871b7eb4
commit
b7d77099b5
2 changed files with 19 additions and 0 deletions
|
@ -4914,6 +4914,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
|||
else
|
||||
{
|
||||
memset(&gProtectStructs[i], 0, sizeof(struct ProtectStruct));
|
||||
memset(&gQueuedStatBoosts[i], 0, sizeof(gQueuedStatBoosts));
|
||||
|
||||
if (gDisableStructs[i].isFirstTurn)
|
||||
gDisableStructs[i].isFirstTurn--;
|
||||
|
|
|
@ -101,6 +101,24 @@ DOUBLE_BATTLE_TEST("Opportunist raises Attack only once when partner has Intimid
|
|||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Opportunist does not accumulate opposing mon's stat changes")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_ESPATHRA) { Ability(ABILITY_OPPORTUNIST); }
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SWORDS_DANCE); }
|
||||
TURN { MOVE(player, MOVE_SWORDS_DANCE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWORDS_DANCE, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_OPPORTUNIST);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWORDS_DANCE, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_OPPORTUNIST);
|
||||
} THEN {
|
||||
EXPECT_EQ(opponent->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 4);
|
||||
}
|
||||
}
|
||||
|
||||
TO_DO_BATTLE_TEST("Opportunist doesn't copy ally stat increases");
|
||||
TO_DO_BATTLE_TEST("Opportunist doesn't copy foe stat increases gained via Opportunist");
|
||||
TO_DO_BATTLE_TEST("Opportunist copies foe stat increased gained via Swagger and Flatter");
|
||||
|
|
Loading…
Reference in a new issue