Tests for form change on switch out and fainting

This commit is contained in:
Eduardo Quezada 2023-03-24 11:03:34 -03:00
parent 498f4a2c97
commit fad11981a5
2 changed files with 43 additions and 5 deletions

View File

@ -79,3 +79,41 @@ SINGLE_BATTLE_TEST("Zamazenta's Iron Head becomes Behemoth Bash upon form change
EXPECT_EQ(player->moves[0], MOVE_BEHEMOTH_BASH); EXPECT_EQ(player->moves[0], MOVE_BEHEMOTH_BASH);
} }
} }
SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon switching out")
{
GIVEN {
ASSUME(P_GEN_6_POKEMON == TRUE);
PLAYER(SPECIES_AEGISLASH);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
TURN { SWITCH(player, 1); }
TURN { SWITCH(player, 0); }
} SCENE {
ABILITY_POPUP(player, ABILITY_STANCE_CHANGE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Aegislash used Tackle!");
MESSAGE("Foe Wobbuffet used Celebrate!");
} THEN {
EXPECT_EQ(player->species, SPECIES_AEGISLASH);
}
}
SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon fainting")
{
GIVEN {
ASSUME(P_GEN_6_POKEMON == TRUE);
PLAYER(SPECIES_AEGISLASH) { HP(1); };
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_GUST); SEND_OUT(player, 1);}
} SCENE {
MESSAGE("Foe Wobbuffet used Gust!");
MESSAGE("Aegislash fainted!");
} THEN {
EXPECT_EQ(GetMonData(&PLAYER_PARTY[0], MON_DATA_SPECIES), SPECIES_AEGISLASH);
}
}