update spellfilters to staticfilters

This commit is contained in:
igoudt 2017-07-10 15:45:19 +02:00
parent ba5c216146
commit b7159d7d2c
50 changed files with 173 additions and 389 deletions

View file

@ -51,6 +51,10 @@ public final class StaticFilters {
public static final FilterSpell FILTER_SPELL_NON_CREATURE
= (FilterSpell) new FilterSpell("noncreature spell").add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
public static final FilterSpell FILTER_SPELL = new FilterSpell();
public static final FilterSpell FILTER_INSTANT_OR_SORCERY_SPELL = new FilterSpell("instant or sorcery spell");
public static final FilterPermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens");
public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
@ -87,6 +91,11 @@ public final class StaticFilters {
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
));
FILTER_INSTANT_OR_SORCERY_SPELL.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)
));
}
}

View file

@ -30,6 +30,7 @@ package mage.target;
import mage.abilities.Ability;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
@ -49,7 +50,7 @@ public class TargetSpell extends TargetObject {
private final Set<UUID> sourceIds = new HashSet<>();
public TargetSpell() {
this(1, 1, new FilterSpell());
this(1, 1, StaticFilters.FILTER_SPELL);
}
public TargetSpell(FilterSpell filter) {