mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
add verify test for backup ability
This commit is contained in:
parent
7dd4460329
commit
287bcde15c
2 changed files with 9 additions and 0 deletions
|
@ -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");
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue