Changed several cards to use new Static non-token creatures filter (#9564)

This commit is contained in:
Alex Vasile 2022-09-24 17:17:59 -04:00 committed by GitHub
parent 419bab07ce
commit ce4cbe2f5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 56 additions and 205 deletions

View file

@ -21,13 +21,6 @@ import java.util.UUID;
*/
public final class AbzanAscendancy extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public AbzanAscendancy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{B}{G}");
@ -35,7 +28,7 @@ public final class AbzanAscendancy extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), StaticFilters.FILTER_CONTROLLED_CREATURE), false));
// Whenever a nontoken creature you control dies, create a 1/1 white Spirit creature token with flying.
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN));
}

View file

@ -16,6 +16,7 @@ import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -69,12 +70,6 @@ public final class BasriKet extends CardImpl {
class BasriKetTriggeredAbility extends DelayedTriggeredAbility {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public BasriKetTriggeredAbility() {
super(null, Duration.EndOfTurn, false);
}
@ -98,7 +93,7 @@ class BasriKetTriggeredAbility extends DelayedTriggeredAbility {
int attackingNonTokens = 0;
for (UUID attacker : game.getCombat().getAttackers()) {
Permanent permanent = game.getPermanent(attacker);
if (filter.match(permanent, game)) {
if (StaticFilters.FILTER_CREATURE_NON_TOKEN.match(permanent, game)) {
attackingNonTokens++;
}
}

View file

@ -10,6 +10,7 @@ import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -47,12 +48,6 @@ public final class BellowingMauler extends CardImpl {
class BellowingMaulerEffect extends OneShotEffect {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public BellowingMaulerEffect() {
super(Outcome.Sacrifice);
this.staticText = "each player loses 4 life unless they sacrifice a nontoken creature";
@ -73,7 +68,7 @@ class BellowingMaulerEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
boolean sacrificed = false;
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
TargetPermanent target = new TargetPermanent(1, 1, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, true);
if (target.canChoose(playerId, source, game)
&& player.chooseUse(Outcome.Sacrifice, "Sacrifice a nontoken creature or lose 4 life?", null, "Sacrifice", "Lose 4 life", source, game)) {
player.chooseTarget(Outcome.Sacrifice, target, source, game);

View file

@ -25,7 +25,7 @@ import java.util.UUID;
* @author ciaccona007
*/
public final class Bifurcate extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creatures");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creatures");
static {
filter.add(TokenPredicate.FALSE);

View file

@ -13,6 +13,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AttackingPredicate;
@ -28,12 +29,9 @@ public final class BlightMound extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent(SubType.PEST, "attacking Pests");
private static final FilterPermanent filter2
= new FilterControlledCreaturePermanent("a nontoken creature you control");
static {
filter.add(AttackingPredicate.instance);
filter2.add(TokenPredicate.FALSE);
}
public BlightMound(UUID ownerId, CardSetInfo setInfo) {
@ -50,7 +48,7 @@ public final class BlightMound extends CardImpl {
// Whenever a nontoken creature you control dies, create a 1/1 black and green Pest creature token with "When this creature dies, you gain 1 life."
this.addAbility(new DiesCreatureTriggeredAbility(
new CreateTokenEffect(new Pest11GainLifeToken()), false, filter2
new CreateTokenEffect(new Pest11GainLifeToken()), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN
));
}

View file

@ -11,6 +11,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardIdPredicate;
@ -50,13 +51,6 @@ public final class DanseMacabre extends CardImpl {
class DanseMacabreEffect extends OneShotEffect {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("nontoken creature you control");
static {
filter.add(TokenPredicate.FALSE);
}
DanseMacabreEffect() {
super(Outcome.Benefit);
staticText = "each player sacrifices a nontoken creature. Roll a d20 " +
@ -87,11 +81,11 @@ class DanseMacabreEffect extends OneShotEffect {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null || game.getBattlefield().count(
filter, source.getControllerId(), source, game
StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, source.getControllerId(), source, game
) < 1) {
continue;
}
TargetPermanent target = new TargetPermanent(filter);
TargetPermanent target = new TargetPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN);
target.setNotTarget(true);
player.choose(Outcome.Sacrifice, target, source, game);
Permanent permanent = game.getPermanent(target.getFirstTarget());

View file

@ -18,6 +18,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
@ -65,14 +66,8 @@ public final class DeathsOasis extends CardImpl {
class DeathsOasisTriggeredAbility extends DiesCreatureTriggeredAbility {
private static final FilterPermanent defaultFilter = new FilterControlledCreaturePermanent();
static {
defaultFilter.add(TokenPredicate.FALSE);
}
DeathsOasisTriggeredAbility() {
super(Zone.BATTLEFIELD, null, false, defaultFilter, false);
super(Zone.BATTLEFIELD, null, false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, false);
}
private DeathsOasisTriggeredAbility(final DeathsOasisTriggeredAbility ability) {

View file

@ -17,6 +17,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -29,19 +30,13 @@ import mage.target.targetpointer.FixedTarget;
*/
public final class FlameshadowConjuring extends CardImpl {
private static final FilterControlledCreaturePermanent filterNontoken = new FilterControlledCreaturePermanent("nontoken creature");
static {
filterNontoken.add(TokenPredicate.FALSE);
}
public FlameshadowConjuring(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
// Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, create a token that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step.
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid(
new FlameshadowConjuringEffect(), new ManaCostsImpl<>("{R}"), "Pay {R} to create a token that's a copy of that creature that entered the battlefield?"),
filterNontoken, false, SetTargetPointer.PERMANENT,
StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, false, SetTargetPointer.PERMANENT,
"Whenever a nontoken creature enters the battlefield under your control, "
+ "you may pay {R}. If you do, create a token that's a copy of that creature. "
+ "That token gains haste. Exile it at the beginning of the next end step");

View file

@ -35,18 +35,11 @@ import mage.target.common.TargetCardInYourGraveyard;
*/
public final class GateToTheAfterlife extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public GateToTheAfterlife(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever a nontoken creature you control dies, you gain 1 life. Then you may draw a card. If you do, discard a card.
Ability ability = new DiesCreatureTriggeredAbility(new GainLifeEffect(1), false, filter, false);
Ability ability = new DiesCreatureTriggeredAbility(new GainLifeEffect(1), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, false);
Effect effect = new DrawDiscardControllerEffect(1, 1, true);
effect.setText("Then you may draw a card. If you do, discard a card");
ability.addEffect(effect);

View file

@ -12,6 +12,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -25,17 +26,11 @@ import java.util.UUID;
*/
public final class GenesisChamber extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public GenesisChamber(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// Whenever a nontoken creature enters the battlefield, if Genesis Chamber is untapped, that creature's controller creates a 1/1 colorless Myr artifact creature token.
TriggeredAbility ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GenesisChamberEffect(), filter, false, SetTargetPointer.PERMANENT, "");
TriggeredAbility ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GenesisChamberEffect(), StaticFilters.FILTER_CREATURE_NON_TOKEN, false, SetTargetPointer.PERMANENT, "");
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability,
SourceUntappedCondition.instance,
"Whenever a nontoken creature enters the battlefield, "

View file

@ -8,6 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.SaprolingToken;
@ -18,18 +19,11 @@ import mage.game.permanent.token.SaprolingToken;
*/
public final class GolgariGermination extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public GolgariGermination(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{G}");
// Whenever a nontoken creature you control dies, create a 1/1 green Saproling creature token.
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN));
}
private GolgariGermination(final GolgariGermination card) {

View file

@ -10,6 +10,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -50,14 +51,8 @@ public final class GuardianProject extends CardImpl {
class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbility {
public static final FilterPermanent filterNonTokenControlledCreature = new FilterControlledCreaturePermanent();
static {
filterNonTokenControlledCreature.add(TokenPredicate.FALSE);
}
GuardianProjectTriggeredAbility() {
super(new GuardianProjectEffect(null), filterNonTokenControlledCreature);
super(new GuardianProjectEffect(null), StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN);
}
private GuardianProjectTriggeredAbility(final GuardianProjectTriggeredAbility ability) {

View file

@ -71,13 +71,10 @@ class GutterGrimeTriggeredAbility extends TriggeredAbilityImpl {
if (card instanceof Permanent && !(card instanceof PermanentToken)) {
Permanent permanent = (Permanent) card;
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()
return zEvent.isDiesEvent()
&& permanent.isControlledBy(this.controllerId)
&& (targetId.equals(this.getSourceId())
|| (permanent.isCreature(game)
&& !(permanent instanceof PermanentToken)))) {
return true;
}
|| (permanent.isCreature(game)));
}
return false;
}

View file

@ -5,6 +5,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
@ -15,17 +16,11 @@ import java.util.UUID;
*/
public final class IncandescentAria extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public IncandescentAria(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}{G}{W}");
// Incandescent Aria deals 3 damage to each nontoken creature.
this.getSpellAbility().addEffect(new DamageAllEffect(3, filter));
this.getSpellAbility().addEffect(new DamageAllEffect(3, StaticFilters.FILTER_CREATURE_NON_TOKEN));
}
private IncandescentAria(final IncandescentAria card) {

View file

@ -9,6 +9,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.target.common.TargetAnyTarget;
@ -20,14 +21,6 @@ import java.util.UUID;
*/
public final class JudithTheScourgeDiva extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public JudithTheScourgeDiva(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}");
@ -44,7 +37,7 @@ public final class JudithTheScourgeDiva extends CardImpl {
));
// Whenever a nontoken creature you control dies, Judith, the Scourge Diva deals 1 damage to any target.
Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(1), false, filter);
Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(1), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN);
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}

View file

@ -19,6 +19,7 @@ import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
@ -33,13 +34,6 @@ import mage.game.permanent.token.SoldierToken;
*/
public final class LenaSelflessChampion extends CardImpl {
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("nontoken creature you control");
static {
filter.add(TokenPredicate.FALSE);
}
public LenaSelflessChampion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}");
@ -53,7 +47,7 @@ public final class LenaSelflessChampion extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(
new CreateTokenEffect(
new SoldierToken(),
new PermanentsOnBattlefieldCount(filter)
new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN)
).setText("create a 1/1 white Soldier creature token "
+ "for each nontoken creature you control")
));

View file

@ -9,6 +9,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.TreasureToken;
@ -20,12 +21,6 @@ import java.util.UUID;
*/
public final class LifeInsurance extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("a nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public LifeInsurance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{B}");
@ -34,7 +29,7 @@ public final class LifeInsurance extends CardImpl {
// Whenever a nontoken creature dies, you lose 1 life and create a Treasure token.
Ability ability = new DiesCreatureTriggeredAbility(
new LoseLifeSourceControllerEffect(1), false, filter
new LoseLifeSourceControllerEffect(1), false, StaticFilters.FILTER_CREATURE_NON_TOKEN
);
ability.addEffect(new CreateTokenEffect(new TreasureToken()).concatBy("and"));
this.addAbility(ability);

View file

@ -12,6 +12,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -26,13 +27,6 @@ import java.util.UUID;
*/
public final class LightningCoils extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public LightningCoils(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
@ -40,7 +34,7 @@ public final class LightningCoils extends CardImpl {
this.addAbility(
new DiesCreatureTriggeredAbility(
new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), true),
false, filter));
false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN));
// At the beginning of your upkeep, if Lightning Coils has five or more charge counters on it, remove all of them from it
// and put that many 3/1 red Elemental creature tokens with haste onto the battlefield.

View file

@ -11,6 +11,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -26,12 +27,6 @@ import mage.players.Player;
*/
public final class MagusOfTheBridge extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public MagusOfTheBridge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{B}");
@ -42,7 +37,7 @@ public final class MagusOfTheBridge extends CardImpl {
// Whenever a nontoken creature is put into your graveyard from the battlefield, create a 2/2 black Zombie creature token.
this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(
new CreateTokenEffect(new ZombieToken()), false, filter, false, true
new CreateTokenEffect(new ZombieToken()), false, StaticFilters.FILTER_CREATURE_NON_TOKEN, false, true
));
// When a creature is put into an opponent's graveyard from the battlefield, exile Magus of the Bridge.

View file

@ -11,6 +11,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
@ -20,14 +21,6 @@ import mage.filter.predicate.permanent.TokenPredicate;
*/
public final class MidnightReaper extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public MidnightReaper(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
@ -38,7 +31,7 @@ public final class MidnightReaper extends CardImpl {
// Whenever a nontoken creature you control dies, Midnight Reaper deals 1 damage to you and you draw a card.
Ability ability = new DiesCreatureTriggeredAbility(
new DamageControllerEffect(1), false, filter
new DamageControllerEffect(1), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN
);
ability.addEffect(
new DrawCardSourceControllerEffect(1)

View file

@ -13,6 +13,7 @@ import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -26,12 +27,6 @@ import java.util.UUID;
*/
public final class MinionReflector extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public MinionReflector(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
@ -42,7 +37,7 @@ public final class MinionReflector extends CardImpl {
new MinionReflectorEffect(), new ManaCostsImpl<>("{2}"), "Pay {2} " +
"to create a token that's a copy of that creature that entered the battlefield?"
),
filter, false, SetTargetPointer.PERMANENT, null
StaticFilters.FILTER_CREATURE_NON_TOKEN, false, SetTargetPointer.PERMANENT, null
));
}

View file

@ -87,12 +87,6 @@ class MirrorBoxLegendEffect extends ContinuousRuleModifyingEffectImpl {
class MirrorBoxBoostEffect extends ContinuousEffectImpl {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent();
static {
filter.add(TokenPredicate.FALSE);
}
public MirrorBoxBoostEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.staticText = "each nontoken creature you control gets +1/+1 for " +
@ -115,7 +109,7 @@ class MirrorBoxBoostEffect extends ContinuousEffectImpl {
source.getControllerId(), source, game
);
for (Permanent permanent : game.getBattlefield().getActivePermanents(
filter, source.getControllerId(), source, game
StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, source.getControllerId(), source, game
)) {
int amount = getAmount(permanents, permanent, game);
permanent.addPower(amount);

View file

@ -11,6 +11,7 @@ import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
@ -23,18 +24,12 @@ import java.util.UUID;
*/
public final class MirrorMarch extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("nontoken creature");
static {
filter.add(TokenPredicate.FALSE);
}
public MirrorMarch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}");
// Whenever a nontoken creature enters the battlefield under your control, flip a coin until you lose a flip. For each flip you won, create a token that's a copy of that creature. Those tokens gain haste. Exile them at the beginning of the next end step.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
Zone.BATTLEFIELD, new MirrorMarchEffect(), filter, false, SetTargetPointer.PERMANENT,
Zone.BATTLEFIELD, new MirrorMarchEffect(), StaticFilters.FILTER_CREATURE_NON_TOKEN, false, SetTargetPointer.PERMANENT,
"Whenever a nontoken creature enters the battlefield under your control, " +
"flip a coin until you lose a flip. For each flip you won, " +
"create a token that's a copy of that creature. Those tokens gain haste. " +

View file

@ -7,6 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.ZombieToken;
@ -17,20 +18,13 @@ import mage.game.permanent.token.ZombieToken;
*/
public final class OpenTheGraves extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
}
public OpenTheGraves(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
// Whenever a nontoken creature you control dies, create a 2/2 black Zombie creature token.
this.addAbility(new DiesCreatureTriggeredAbility(
new CreateTokenEffect(new ZombieToken()),
false, filter
false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN
));
}

View file

@ -9,6 +9,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
@ -19,14 +20,8 @@ import mage.filter.predicate.permanent.TokenPredicate;
*/
public final class Overburden extends CardImpl {
private static final FilterCreaturePermanent ENTERS_BATTLEFIELD_FILTER = new FilterCreaturePermanent("a nontoken creature");
private static final FilterControlledLandPermanent RETURN_FILTER = new FilterControlledLandPermanent("a land");
static {
ENTERS_BATTLEFIELD_FILTER.add(TokenPredicate.FALSE);
}
public Overburden(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
@ -34,7 +29,7 @@ public final class Overburden extends CardImpl {
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
Zone.BATTLEFIELD,
new ReturnToHandChosenPermanentEffect(RETURN_FILTER),
ENTERS_BATTLEFIELD_FILTER,
StaticFilters.FILTER_CREATURE_NON_TOKEN,
false,
SetTargetPointer.PLAYER,
"Whenever a player puts a nontoken creature onto the battlefield,"

View file

@ -15,6 +15,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
@ -32,12 +33,10 @@ public final class SpiritBonds extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Spirit creature you control");
private static final FilterControlledPermanent filterSpirit = new FilterControlledPermanent("Spirit");
private static final FilterControlledCreaturePermanent filterNontoken = new FilterControlledCreaturePermanent("nontoken creature");
static {
filter.add(Predicates.not(SubType.SPIRIT.getPredicate()));
filterSpirit.add(SubType.SPIRIT.getPredicate());
filterNontoken.add(TokenPredicate.FALSE);
}
public SpiritBonds(UUID ownerId, CardSetInfo setInfo) {
@ -45,7 +44,7 @@ public final class SpiritBonds extends CardImpl {
// Whenever a nontoken creature enters the battlefield under your control, you may pay {W}. If you do, but a 1/1 white Spirit creature token with flying into play.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid(new CreateTokenEffect(new SpiritWhiteToken()), new ManaCostsImpl<>("{W}")), filterNontoken, false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid(new CreateTokenEffect(new SpiritWhiteToken()), new ManaCostsImpl<>("{W}")), StaticFilters.FILTER_CREATURE_NON_TOKEN, false));
// {1}{W}, Sacrifice a Spirit: Target non-Spirit creature you control gains indestructible until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,

View file

@ -10,6 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.SquirrelToken;
@ -21,13 +22,6 @@ import java.util.UUID;
*/
public final class SquirrelSanctuary extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("a nontoken creature you control");
static {
filter.add(TokenPredicate.FALSE);
}
public SquirrelSanctuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
@ -37,7 +31,7 @@ public final class SquirrelSanctuary extends CardImpl {
// Whenever a nontoken creature you control dies, you may pay {1}. If you do, return Squirrel Sanctuary to its owner's hand.
this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(
new ReturnToHandSourceEffect(true), new GenericManaCost(1)
), false, filter));
), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN));
}
private SquirrelSanctuary(final SquirrelSanctuary card) {

View file

@ -31,12 +31,6 @@ import java.util.UUID;
*/
public final class TheGreatHenge extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent();
static {
filter.add(TokenPredicate.FALSE);
}
public TheGreatHenge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}{G}{G}");
@ -53,7 +47,7 @@ public final class TheGreatHenge extends CardImpl {
// Whenever a nontoken creature enters the battlefield under your control, put a +1/+1 counter on it and draw a card.
ability = new EntersBattlefieldControlledTriggeredAbility(
Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
filter, false, SetTargetPointer.PERMANENT, "Whenever a nontoken creature " +
StaticFilters.FILTER_CREATURE_NON_TOKEN, false, SetTargetPointer.PERMANENT, "Whenever a nontoken creature " +
"enters the battlefield under your control, put a +1/+1 counter on it and draw a card."
);
ability.addEffect(new DrawCardSourceControllerEffect(1));

View file

@ -12,6 +12,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
@ -25,12 +26,9 @@ import mage.game.permanent.token.HumanSoldierToken;
*/
public final class UlvenwaldMysteries extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature you control");
private static final FilterControlledPermanent filterClue = new FilterControlledPermanent("a Clue");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(TokenPredicate.FALSE);
filterClue.add(SubType.CLUE.getPredicate());
}
@ -38,7 +36,7 @@ public final class UlvenwaldMysteries extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}");
// Whenever a nontoken creature you control dies, investigate. <i>(Create a colorless Clue artifact token with "{2}, Sacrifice this artifact: Draw a card.")</i>
this.addAbility(new DiesCreatureTriggeredAbility(new InvestigateEffect(), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new InvestigateEffect(), false, StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN));
// Whenever you sacrifice a Clue, create a 1/1 white Human Soldier creature token.
this.addAbility(new UlvenwaldMysteriesTriggeredAbility());

View file

@ -4,6 +4,7 @@ package mage.game.command.emblems;
import mage.abilities.common.LeavesBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.command.Emblem;
@ -14,15 +15,9 @@ import mage.game.command.Emblem;
*/
public final class AurraSingBaneOfJediEmblem extends Emblem {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a nontoken creature you control");
static {
filter.add(TokenPredicate.FALSE);
}
// Whenever a nontoken creature you control leaves the battlefied, discard a card.
public AurraSingBaneOfJediEmblem() {
this.setName("Emblem Aurra Sing, Bane of Jedi");
getAbilities().add(new LeavesBattlefieldAllTriggeredAbility(Zone.COMMAND, new DiscardControllerEffect(1), filter, false));
getAbilities().add(new LeavesBattlefieldAllTriggeredAbility(Zone.COMMAND, new DiscardControllerEffect(1), StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN, false));
}
}