add verify test for backup ability

This commit is contained in:
theelk801 2023-04-04 22:19:11 -04:00
parent 7dd4460329
commit 287bcde15c
2 changed files with 9 additions and 0 deletions

View file

@ -1465,6 +1465,11 @@ public class VerifyCardDataTest {
fail(card, "abilities", "card is a Saga but is missing this.addAbility(SagaAbility)");
}
// special check: backup ability should be set up correctly
if (card.getAbilities().containsClass(BackupAbility.class) && CardUtil.castStream(card.getAbilities().stream(), BackupAbility.class).noneMatch(BackupAbility::hasAbilities)) {
fail(card, "abilities", "card has backup but is missing this.addAbility(backupAbility)");
}
// special check: Werewolves front ability should only be on front and vice versa
if (card.getAbilities().containsClass(WerewolfFrontTriggeredAbility.class) && card.isNightCard()) {
fail(card, "abilities", "card is a back face werewolf with a front face ability");

View file

@ -63,6 +63,10 @@ public class BackupAbility extends EntersBattlefieldTriggeredAbility {
card.addAbility(ability);
abilitiesToAdd.add(ability);
}
public boolean hasAbilities() {
return !abilitiesToAdd.isEmpty();
}
}
class BackupEffect extends OneShotEffect {