refactored all usages of CardTypePredicate to match the new implementation

This commit is contained in:
Evan Kranzler 2020-01-06 13:18:17 -05:00
parent f685ee3d69
commit 688be783aa
1069 changed files with 1619 additions and 2732 deletions

View file

@ -10,7 +10,6 @@ import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.command.Emblem;
/**
@ -22,10 +21,10 @@ public final class ElspethKnightErrantEmblem extends Emblem {
this.setName("Emblem Elspeth");
FilterControlledPermanent filter = new FilterControlledPermanent("Artifacts, creatures, enchantments, and lands you control");
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.LAND)));
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
CardType.LAND.getPredicate()));
Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect.setText("Artifacts, creatures, enchantments, and lands you control have indestructible");
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, effect));

View file

@ -18,7 +18,6 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.EnchantedPredicate;
import mage.game.command.Plane;
import mage.target.Target;
@ -36,7 +35,7 @@ public class AkoumPlane extends Plane {
static {
filter.add(Predicates.not(EnchantedPredicate.instance));
filterCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
filterCard.add(CardType.ENCHANTMENT.getPredicate());
}
public AkoumPlane() {

View file

@ -26,7 +26,6 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.stack.Spell;
@ -45,7 +44,7 @@ public class TrailOfTheMageRingsPlane extends Plane {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public TrailOfTheMageRingsPlane() {
@ -78,7 +77,7 @@ class TrailOfTheMageRingsReboundEffect extends ContinuousEffectImpl {
protected static final FilterCard filter = new FilterCard("Instant and sorcery spells");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
public TrailOfTheMageRingsReboundEffect() {

View file

@ -13,7 +13,6 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
import mage.abilities.effects.common.RollPlanarDieEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.CostModificationType;
@ -23,7 +22,6 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.stack.Spell;
@ -67,7 +65,7 @@ class TurriIslandEffect extends CostModificationEffectImpl {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
private static final String rule = "Creature spells cost {2} less to cast";

View file

@ -20,7 +20,6 @@ import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.events.DamagedPlayerEvent;
@ -40,7 +39,7 @@ public class UndercityReachesPlane extends Plane {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public UndercityReachesPlane() {