From 5c1fe5075fcf6e0def1759a63afe763180439e0d Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 17 Jun 2022 08:20:22 +0400 Subject: [PATCH] [CLB] fixed verify tests --- .../src/mage/cards/g/GutTrueSoulZealot.java | 3 ++- .../src/mage/cards/w/WilsonRefinedGrizzly.java | 2 +- .../java/mage/verify/VerifyCardDataTest.java | 3 ++- .../effects/common/CreateTokenEffect.java | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GutTrueSoulZealot.java b/Mage.Sets/src/mage/cards/g/GutTrueSoulZealot.java index 08f9741d2f..7e0fe2a80b 100644 --- a/Mage.Sets/src/mage/cards/g/GutTrueSoulZealot.java +++ b/Mage.Sets/src/mage/cards/g/GutTrueSoulZealot.java @@ -34,7 +34,8 @@ public final class GutTrueSoulZealot extends CardImpl { this.addAbility(new AttacksWithCreaturesTriggeredAbility(new DoIfCostPaid( new CreateTokenEffect( new SkeletonMenaceToken(), 1, true, true - ), new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE) + ).withAdditionalRules("(It can't be blocked except by two or more creatures.)"), + new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE) ), 1)); // Choose a Background diff --git a/Mage.Sets/src/mage/cards/w/WilsonRefinedGrizzly.java b/Mage.Sets/src/mage/cards/w/WilsonRefinedGrizzly.java index edbefc5653..d2cdaf7dbf 100644 --- a/Mage.Sets/src/mage/cards/w/WilsonRefinedGrizzly.java +++ b/Mage.Sets/src/mage/cards/w/WilsonRefinedGrizzly.java @@ -43,7 +43,7 @@ public final class WilsonRefinedGrizzly extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Ward {2} - this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"), false)); + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"), true)); // Choose a Background this.addAbility(ChooseABackgroundAbility.getInstance()); diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index fae6297120..467cf5f235 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -1403,14 +1403,15 @@ public class VerifyCardDataTest { fail(card, "abilities", "card is a front face werewolf with a back face ability"); } + // special check: transform ability in MDFC should only be on front and vice versa if (card.getSecondCardFace() != null && !card.isNightCard() && !card.getAbilities().containsClass(TransformAbility.class)) { fail(card, "abilities", "double-faced cards should have transform ability on the front"); } - if (card.getSecondCardFace() != null && card.isNightCard() && card.getAbilities().containsClass(TransformAbility.class)) { fail(card, "abilities", "double-faced cards should not have transform ability on the back"); } + // special check: back side in MDFC must be only night card if (card.getSecondCardFace() != null && !card.getSecondCardFace().isNightCard()) { fail(card, "abilities", "the back face of a double-faced card should be nightCard = true"); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java index b496483315..316abc3532 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java @@ -28,6 +28,7 @@ public class CreateTokenEffect extends OneShotEffect { private final DynamicValue amount; private final boolean tapped; private final boolean attacking; + private String additionalRules; private List lastAddedTokenIds = new ArrayList<>(); public CreateTokenEffect(Token token) { @@ -62,6 +63,7 @@ public class CreateTokenEffect extends OneShotEffect { this.tapped = effect.tapped; this.attacking = effect.attacking; this.lastAddedTokenIds.addAll(effect.lastAddedTokenIds); + this.additionalRules = effect.additionalRules; } @Override @@ -104,11 +106,18 @@ public class CreateTokenEffect extends OneShotEffect { } } + public CreateTokenEffect withAdditionalRules(String additionalRules) { + this.additionalRules = additionalRules; + setText(); + return this; + } + private void setText() { if (token.getDescription().contains(", a legendary")) { staticText = "create " + token.getDescription(); return; } + StringBuilder sb = new StringBuilder("create "); if (amount.toString().equals("1")) { if (tapped && !attacking) { @@ -131,6 +140,7 @@ public class CreateTokenEffect extends OneShotEffect { sb.replace(tokenLocation, tokenLocation + 6, "tokens "); } } + if (attacking) { if (amount.toString().equals("1")) { sb.append(" that's"); @@ -142,6 +152,7 @@ public class CreateTokenEffect extends OneShotEffect { } sb.append(" attacking"); } + String message = amount.getMessage(); if (!message.isEmpty()) { if (amount.toString().equals("X")) { @@ -151,6 +162,11 @@ public class CreateTokenEffect extends OneShotEffect { } } sb.append(message); + + if (this.additionalRules != null) { + sb.append(" " + this.additionalRules); + } + staticText = sb.toString(); } }