diff --git a/Mage.Sets/src/mage/cards/k/KetramoseTheNewDawn.java b/Mage.Sets/src/mage/cards/k/KetramoseTheNewDawn.java index f87abbbf1db..a319d936d67 100644 --- a/Mage.Sets/src/mage/cards/k/KetramoseTheNewDawn.java +++ b/Mage.Sets/src/mage/cards/k/KetramoseTheNewDawn.java @@ -51,8 +51,7 @@ public final class KetramoseTheNewDawn extends CardImpl { // Ketramose can't attack or block unless there are seven or more cards in exile. this.addAbility(new SimpleStaticAbility( - new CantAttackBlockUnlessConditionSourceEffect(new CardsInExileCondition(ComparisonType.MORE_THAN, 6, CardsInExileCount.ALL)) - .setText("{this} can't attack or block unless there are seven or more cards in exile") + new CantAttackBlockUnlessConditionSourceEffect(new CardsInExileCondition(ComparisonType.OR_GREATER, 7)) ).addHint(CardsInExileCount.ALL.getHint())); // Whenever one or more cards are put into exile from graveyards and/or the battlefield during your turn, you draw a card and lose 1 life. diff --git a/Mage/src/main/java/mage/abilities/condition/common/CardsInExileCondition.java b/Mage/src/main/java/mage/abilities/condition/common/CardsInExileCondition.java index 6fa1ba75005..1f8f4a3b784 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/CardsInExileCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/CardsInExileCondition.java @@ -2,23 +2,30 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInExileCount; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.constants.ComparisonType; import mage.game.Game; +import mage.util.CardUtil; - +/** + * Cards in exile condition + * + * @author Jmlundeen + */ public class CardsInExileCondition implements Condition { private final ComparisonType type; private final int count; - private CardsInExileCount cardsInExileCount; + private final DynamicValue cardsInExileCount; public CardsInExileCondition(ComparisonType type, int count) { - this(type, count, CardsInExileCount.YOU); + this(type, count, CardsInExileCount.ALL); } - public CardsInExileCondition(ComparisonType type, int count, CardsInExileCount cardsInExileCount) + public CardsInExileCondition(ComparisonType type, int count, DynamicValue cardsInExileCount) { this.type = type; this.count = count; @@ -31,4 +38,28 @@ public class CardsInExileCondition implements Condition int exileCards = cardsInExileCount.calculate(game, source, null); return ComparisonType.compare(exileCards, type, count); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("there are "); + String countString = CardUtil.numberToText(count); + switch (type) { + case MORE_THAN: + sb.append("more than ").append(countString).append(" "); + break; + case FEWER_THAN: + sb.append("fewer than ").append(countString).append(" "); + break; + case OR_LESS: + sb.append(countString).append(" or less "); + break; + case OR_GREATER: + sb.append(countString).append(" or more "); + break; + default: + throw new IllegalArgumentException("comparison rules for " + type + " missing"); + } + sb.append("cards in exile"); + return sb.toString(); + } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInExileCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInExileCount.java index 851747f81a8..2a6b6a1bfd7 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInExileCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInExileCount.java @@ -15,7 +15,7 @@ import java.util.UUID; import java.util.stream.Stream; /** - * @author JayDi85 + * @author Jmlundeen */ public enum CardsInExileCount implements DynamicValue { YOU("you"),