Adds another unit test to Assurance
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-10-23 19:10:18 +02:00
parent e85460fd22
commit e9658cef1a
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 19 additions and 0 deletions

View File

@ -44,4 +44,23 @@ void Assurance_DamageWithEvent(){
RequireEquals(200, damage);
}
[Test name="Assurance: damage with damage on the other turn"]
void Assurance_DamageWithEventOnDifferentTurn(){
auto battle = CreateSimpleBattle(684, "charizard", "venusaur", 100);
auto mon1 = battle.GetBattleSide(0).GetPokemon(0);
auto mon2 = battle.GetBattleSide(1).GetPokemon(0);
mon2.Damage(10, DamageSource::AttackDamage);
mon1.PassTurn();
mon2.PassTurn();
auto script = cast<Gen7::Assurance>(CreateMoveScript("Assurance"));
Require(script !is null);
uint damage = 100;
auto executingMove = CreateExecutingMove("Assurance", mon1, mon2);
script.OverrideDamage(executingMove, mon2, 0x0, damage);
RequireEquals(100, damage);
}
#endif