Replaced several created filters inside card classes with pre-built static filters and simplified 3 cards (#8612)

This commit is contained in:
Alex Vasile 2022-01-29 00:05:12 -05:00 committed by GitHub
parent 140be70fb8
commit d24dc008a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
213 changed files with 604 additions and 1668 deletions

View file

@ -5,6 +5,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.common.*;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AnotherPredicate;
@ -749,6 +750,49 @@ public final class StaticFilters {
FILTER_CREATURE_TOKEN.setLockedFilter(true);
}
public static final FilterControlledCreaturePermanent FILTER_A_CONTROLLED_CREATURE_P1P1 = new FilterControlledCreaturePermanent("a creature you control with a +1/+1 counter on it");
static {
FILTER_A_CONTROLLED_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_A_CONTROLLED_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_CREATURE_P1P1 = new FilterControlledCreaturePermanent("creature you control with a +1/+1 counter on it");
static {
FILTER_CONTROLLED_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_CONTROLLED_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterControlledCreaturePermanent FILTER_EACH_CONTROLLED_CREATURE_P1P1 = new FilterControlledCreaturePermanent("each creature you control with a +1/+1 counter on it");
static {
FILTER_EACH_CONTROLLED_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_EACH_CONTROLLED_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterControlledCreaturePermanent FILTER_OTHER_CONTROLLED_CREATURE_P1P1 = new FilterControlledCreaturePermanent("other creature you control with a +1/+1 counter on it");
static {
FILTER_OTHER_CONTROLLED_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_OTHER_CONTROLLED_CREATURE_P1P1.add(AnotherPredicate.instance);
FILTER_OTHER_CONTROLLED_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_A_CREATURE_P1P1 = new FilterCreaturePermanent("a creature with a +1/+1 counter on it");
static {
FILTER_A_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_A_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_CREATURE_P1P1 = new FilterCreaturePermanent("creature with a +1/+1 counter on it");
static {
FILTER_CREATURE_P1P1.add(CounterType.P1P1.getPredicate());
FILTER_CREATURE_P1P1.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens");
static {

View file

@ -11,7 +11,7 @@ import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.target.targetpointer.FixedTarget;
@ -23,11 +23,9 @@ import mage.target.targetpointer.FixedTarget;
public final class LilianaDefiantNecromancerEmblem extends Emblem {
// You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature");
public LilianaDefiantNecromancerEmblem() {
this.setName("Emblem Liliana");
Ability ability = new DiesCreatureTriggeredAbility(Zone.COMMAND, new LilianaDefiantNecromancerEmblemEffect(), false, filter, true);
Ability ability = new DiesCreatureTriggeredAbility(Zone.COMMAND, new LilianaDefiantNecromancerEmblemEffect(), false, StaticFilters.FILTER_PERMANENT_A_CREATURE, true);
this.getAbilities().add(ability);
}
}

View file

@ -20,7 +20,7 @@ import mage.cards.Card;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
@ -36,7 +36,6 @@ import mage.watchers.common.PlanarRollWatcher;
*/
public class FeedingGroundsPlane extends Plane {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature");
private static final String rule = "put X +1/+1 counters on target creature, where X is that creature's mana value";
public FeedingGroundsPlane() {
@ -49,7 +48,7 @@ public class FeedingGroundsPlane extends Plane {
// Active player can roll the planar die: Whenever you roll {CHAOS}, target red or green creature gets X +1/+1 counters
Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), TargetManaValue.instance);
Target chaosTarget = new TargetCreaturePermanent(1, 1, filter, false);
Target chaosTarget = new TargetCreaturePermanent(1, 1, StaticFilters.FILTER_PERMANENT_A_CREATURE, false);
List<Effect> chaosEffects = new ArrayList<>();
chaosEffects.add(chaosEffect);

View file

@ -3,7 +3,6 @@ package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledCreaturePermanent;
import java.util.Arrays;
@ -12,8 +11,6 @@ import java.util.Arrays;
*/
public final class OviyaPashiriSageLifecrafterToken extends TokenImpl {
static final FilterControlledCreaturePermanent filterCreature = new FilterControlledCreaturePermanent("creatures you control");
public OviyaPashiriSageLifecrafterToken() {
this(1);
}