diff --git a/Mage.Sets/src/mage/sets/modernmasters/RiftElemental.java b/Mage.Sets/src/mage/sets/modernmasters/RiftElemental.java index 18167c79cb..01e868f1ce 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/RiftElemental.java +++ b/Mage.Sets/src/mage/sets/modernmasters/RiftElemental.java @@ -35,7 +35,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; import mage.abilities.costs.CostImpl; import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.mana.ManaCostsImpl; @@ -55,8 +54,8 @@ import mage.counters.Counter; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.other.CounterCardPredicate; import mage.filter.predicate.other.OwnerPredicate; -import mage.filter.predicate.permanent.CounterPredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -71,7 +70,7 @@ public class RiftElemental extends CardImpl { private static final FilterCard filter = new FilterCard("suspended card you own"); static { - filter.add(new CounterPredicate(CounterType.TIME)); + filter.add(new CounterCardPredicate(CounterType.TIME)); filter.add(new AbilityPredicate(SuspendAbility.class)); filter.add(new OwnerPredicate(TargetController.YOU)); } diff --git a/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java b/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java index b8498c8655..9619ddb513 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java +++ b/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java @@ -49,7 +49,7 @@ import mage.constants.Rarity; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.filter.predicate.permanent.CounterPredicate; +import mage.filter.predicate.other.CounterCardPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; @@ -65,7 +65,7 @@ public class FuryCharm extends CardImpl { private static final FilterCard filter = new FilterCard("suspended card"); static { - filter.add(new CounterPredicate(CounterType.TIME)); + filter.add(new CounterCardPredicate(CounterType.TIME)); filter.add(new AbilityPredicate(SuspendAbility.class)); } diff --git a/Mage/src/mage/filter/predicate/other/CounterCardPredicate.java b/Mage/src/mage/filter/predicate/other/CounterCardPredicate.java new file mode 100644 index 0000000000..d0a7c5dbb2 --- /dev/null +++ b/Mage/src/mage/filter/predicate/other/CounterCardPredicate.java @@ -0,0 +1,34 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.filter.predicate.other; + +import mage.cards.Card; +import mage.counters.CounterType; +import mage.filter.predicate.Predicate; +import mage.game.Game; + +/** + * + * @author jeffwadsworth + */ +public class CounterCardPredicate implements Predicate { + + private final CounterType counter; + + public CounterCardPredicate(CounterType counter) { + this.counter = counter; + } + + @Override + public boolean apply(Card input, Game game) { + return input.getCounters(game).containsKey(counter); + } + + @Override + public String toString() { + return "CounterType(" + counter.getName() + ')'; + } +}