refactor: fixed dies events support in single cards (part 7, related to #13089, continue from #13088);

This commit is contained in:
Oleg Agafonov 2024-12-07 14:39:52 +04:00
parent b571080260
commit 8af7a492c8
7 changed files with 162 additions and 1 deletions

View file

@ -2021,10 +2021,12 @@ public class VerifyCardDataTest {
boolean isPutToGraveAbility = rules.contains("put into")
&& rules.contains("graveyard")
&& rules.contains("from the battlefield");
boolean isLeavesBattlefield = rules.contains("leaves the battlefield");
isLeavesBattlefield = false; // TODO: remove and fix all bad cards
if (triggeredAbility.isLeavesTheBattlefieldTrigger()) {
// TODO: add check for wrongly enabled settings too?
} else {
if (isDiesAbility || isPutToGraveAbility) {
if (isDiesAbility || isPutToGraveAbility || isLeavesBattlefield) {
fail(card, "abilities", "dies related trigger must use setLeavesTheBattlefieldTrigger(true) and possibly override isInUseableZone - "
+ triggeredAbility.getClass().getSimpleName());
}