[CLB] fixed verify tests

This commit is contained in:
Oleg Agafonov 2022-06-17 08:20:22 +04:00
parent 4546623fb6
commit 5c1fe5075f
4 changed files with 21 additions and 3 deletions

View file

@ -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("<i>(It can't be blocked except by two or more creatures.)</i>"),
new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE)
), 1));
// Choose a Background

View file

@ -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());

View file

@ -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");
}

View file

@ -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<UUID> 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();
}
}