* Added another general static filter class.

This commit is contained in:
LevelX2 2017-01-08 10:35:46 +01:00
parent fa4cf8161d
commit 4dd023716e
20 changed files with 133 additions and 230 deletions

View file

@ -38,8 +38,7 @@ import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
@ -49,22 +48,12 @@ import mage.players.Player;
*/
public class AetherBarrier extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public AetherBarrier(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
// Whenever a player casts a creature spell, that player sacrifices a permanent unless he or she pays {1}.
this.addAbility(new SpellCastAllTriggeredAbility(
Zone.BATTLEFIELD,
new AetherBarrierEffect(),
filter,
false,
SetTargetPointer.PLAYER
));
this.addAbility(new SpellCastAllTriggeredAbility(Zone.BATTLEFIELD, new AetherBarrierEffect(),
StaticFilters.FILTER_SPELL_A_CREATURE, false, SetTargetPointer.PLAYER));
}
public AetherBarrier(final AetherBarrier card) {

View file

@ -47,8 +47,7 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
@ -59,13 +58,8 @@ import mage.util.CardUtil;
*/
public class AnimarSoulOfElements extends CardImpl {
private static final FilterSpell filterSpell = new FilterSpell("a creature spell");
static {
filterSpell.add(new CardTypePredicate(CardType.CREATURE));
}
public AnimarSoulOfElements(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{R}{G}");
this.supertype.add("Legendary");
this.subtype.add("Elemental");
@ -76,7 +70,7 @@ public class AnimarSoulOfElements extends CardImpl {
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE, ObjectColor.BLACK));
// Whenever you cast a creature spell, put a +1/+1 counter on Animar, Soul of Elements.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filterSpell, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), StaticFilters.FILTER_SPELL_A_CREATURE, false));
// Creature spells you cast cost {1} less to cast for each +1/+1 counter on Animar.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnimarCostReductionEffect()));

View file

@ -41,9 +41,8 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.token.ThrullToken;
import mage.game.stack.Spell;
@ -55,14 +54,8 @@ import mage.target.targetpointer.FixedTarget;
*/
public class EndrekSahrMasterBreeder extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public EndrekSahrMasterBreeder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Wizard");
@ -71,7 +64,7 @@ public class EndrekSahrMasterBreeder extends CardImpl {
this.toughness = new MageInt(2);
// Whenever you cast a creature spell, create X 1/1 black Thrull creature tokens, where X is that spell's converted mana cost.
this.addAbility(new SpellCastControllerTriggeredAbility(new EndrekSahrMasterBreederEffect(), filter, false, true));
this.addAbility(new SpellCastControllerTriggeredAbility(new EndrekSahrMasterBreederEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false, true));
// When you control seven or more Thrulls, sacrifice Endrek Sahr, Master Breeder.
this.addAbility(new ControlsPermanentsControllerTriggeredAbility(
new FilterCreaturePermanent("Thrull", "seven or more Thrulls"), Filter.ComparisonType.GreaterThan, 6,

View file

@ -28,17 +28,16 @@
package mage.cards.e;
import java.util.UUID;
import mage.constants.CardType;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
/**
*
@ -46,18 +45,11 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
*/
public class Equilibrium extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public Equilibrium(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}");
// Whenever you cast a creature spell, you may pay {1}. If you do, return target creature to its owner's hand.
Ability ability = new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new GenericManaCost(1)), filter, false);
Ability ability = new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new GenericManaCost(1)), StaticFilters.FILTER_SPELL_A_CREATURE, false);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -43,9 +43,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.command.Emblem;
import mage.target.common.TargetCardInLibrary;
@ -95,16 +94,10 @@ public class GarrukCallerOfBeasts extends CardImpl {
*/
class GarrukCallerOfBeastsEmblem extends Emblem {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public GarrukCallerOfBeastsEmblem() {
this.setName("Emblem Garruk");
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard("creature card")), false, true, Outcome.PutCreatureInPlay);
Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, filter, true, false);
Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, StaticFilters.FILTER_SPELL_A_CREATURE, true, false);
this.getAbilities().add(ability);
}
}

View file

@ -37,8 +37,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.game.permanent.token.Token;
/**
@ -47,20 +46,13 @@ import mage.game.permanent.token.Token;
*/
public class HalcyonGlaze extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public HalcyonGlaze(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}");
// Whenever you cast a creature spell, Halcyon Glaze becomes a 4/4 Illusion creature with flying in addition to its other types until end of turn.
Effect effect = new BecomesCreatureSourceEffect(new HalcyonGlazeToken(), "enchantment", Duration.EndOfTurn);
effect.setText("Whenever you cast a creature spell, {this} becomes a 4/4 Illusion creature with flying in addition to its other types until end of turn");
this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, false));
this.addAbility(new SpellCastControllerTriggeredAbility(effect, StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public HalcyonGlaze(final HalcyonGlaze card) {
@ -74,6 +66,7 @@ public class HalcyonGlaze extends CardImpl {
}
class HalcyonGlazeToken extends Token {
HalcyonGlazeToken() {
super("", "4/4 Illusion creature with flying");
cardType.add(CardType.CREATURE);

View file

@ -42,7 +42,7 @@ import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -54,13 +54,15 @@ import mage.target.common.TargetCardInLibrary;
public class KarametraGodOfHarvests extends CardImpl {
private static final FilterCard filter = new FilterCard("a Forest or Plains card");
static {
filter.add(Predicates.or(
new SubtypePredicate("Forest"),
new SubtypePredicate("Plains")));
}
public KarametraGodOfHarvests(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{3}{G}{W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{W}");
this.supertype.add("Legendary");
this.subtype.add("God");
@ -75,7 +77,7 @@ public class KarametraGodOfHarvests extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// Whenever you cast a creature spell, you may search your library for a Forest or Plains card, put it onto the battlefield tapped, then shuffle your library.
this.addAbility(new SpellCastControllerTriggeredAbility(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), new FilterCreatureSpell("a creature spell"), true));
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), StaticFilters.FILTER_SPELL_A_CREATURE, true));
}
public KarametraGodOfHarvests(final KarametraGodOfHarvests card) {

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.StaticFilters;
/**
*
@ -47,8 +47,6 @@ import mage.filter.common.FilterCreatureSpell;
*/
public class LifecraftersBestiary extends CardImpl {
private static final FilterCreatureSpell filter = new FilterCreatureSpell("a creature spell");
public LifecraftersBestiary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
@ -56,7 +54,7 @@ public class LifecraftersBestiary extends CardImpl {
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ScryEffect(1), TargetController.YOU, false));
// Whenever you cast a creature spell, you may pay {G}. If you do, draw a card.
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{G}")), filter, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{G}")), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public LifecraftersBestiary(final LifecraftersBestiary card) {

View file

@ -40,8 +40,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
/**
*
@ -49,13 +48,8 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class MaskedAdmirers extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public MaskedAdmirers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.subtype.add("Elf");
this.subtype.add("Shaman");
@ -68,7 +62,7 @@ public class MaskedAdmirers extends CardImpl {
OneShotEffect effect = new ReturnToHandSourceEffect();
effect.setText("return {this} from your graveyard to your hand");
this.addAbility(new SpellCastControllerTriggeredAbility(
Zone.GRAVEYARD, new DoIfCostPaid(effect, new ManaCostsImpl("{G}{G}")), filter, false, false));
Zone.GRAVEYARD, new DoIfCostPaid(effect, new ManaCostsImpl("{G}{G}")), StaticFilters.FILTER_SPELL_A_CREATURE, false, false));
}
public MaskedAdmirers(final MaskedAdmirers card) {

View file

@ -34,8 +34,7 @@ import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
/**
@ -44,17 +43,11 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class Onslaught extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public Onslaught(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}");
// Whenever you cast a creature spell, tap target creature.
Ability ability = new SpellCastControllerTriggeredAbility(new TapTargetEffect(), filter, false);
Ability ability = new SpellCastControllerTriggeredAbility(new TapTargetEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -40,6 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -52,19 +53,17 @@ import mage.target.common.TargetControlledCreaturePermanent;
*/
public class PrimevalBounty extends CardImpl {
private static final FilterSpell filterCreature = new FilterSpell("a creature spell");
private static final FilterSpell filterNonCreature = new FilterSpell("a noncreature spell");
static {
filterCreature.add(new CardTypePredicate(CardType.CREATURE));
filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public PrimevalBounty(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{5}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{G}");
// Whenever you cast a creature spell, create a 3/3 green Beast creature token.
this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new BeastToken()), filterCreature, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new BeastToken()), StaticFilters.FILTER_SPELL_A_CREATURE, false));
// Whenever you cast a noncreature spell, put three +1/+1 counters on target creature you control.
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3));

View file

@ -28,14 +28,13 @@
package mage.cards.p;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.constants.CardType;
import mage.filter.StaticFilters;
/**
*
@ -43,21 +42,15 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class PrimordialSage extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public PrimordialSage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.subtype.add("Spirit");
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// Whenever you cast a creature spell, you may draw a card.
this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), filter, true));
this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), StaticFilters.FILTER_SPELL_A_CREATURE, true));
}
public PrimordialSage(final PrimordialSage card) {

View file

@ -43,8 +43,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -59,17 +58,11 @@ import mage.target.common.TargetControlledCreaturePermanent;
*/
public class QuestForTheHolyRelic extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public QuestForTheHolyRelic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
// Whenever you cast a creature spell, you may put a quest counter on Quest for the Holy Relic.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), filter, true));
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), StaticFilters.FILTER_SPELL_A_CREATURE, true));
// Remove five quest counters from Quest for the Holy Relic and sacrifice it: Search your library for an Equipment card, put it onto the battlefield, and attach it to a creature you control. Then shuffle your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new QuestForTheHolyRelicEffect(), new RemoveCountersSourceCost(CounterType.QUEST.createInstance(5)));
ability.addCost(new SacrificeSourceCost());

View file

@ -34,8 +34,7 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
/**
*
@ -43,20 +42,14 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class SkitteringHorror extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public SkitteringHorror(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add("Horror");
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When you cast a creature spell, sacrifice Skittering Horror.
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public SkitteringHorror(final SkitteringHorror card) {

View file

@ -34,8 +34,7 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
/**
*
@ -43,20 +42,14 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class SkitteringMonstrosity extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public SkitteringMonstrosity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add("Horror");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// When you cast a creature spell, sacrifice Skittering Monstrosity.
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public SkitteringMonstrosity(final SkitteringMonstrosity card) {

View file

@ -35,8 +35,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
/**
*
@ -44,14 +43,8 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class SkitteringSkirge extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a creature spell");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public SkitteringSkirge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}");
this.subtype.add("Imp");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
@ -60,7 +53,7 @@ public class SkitteringSkirge extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When you cast a creature spell, sacrifice Skittering Skirge.
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false));
this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public SkitteringSkirge(final SkitteringSkirge card) {

View file

@ -34,7 +34,7 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.StaticFilters;
/**
*
@ -43,13 +43,13 @@ import mage.filter.common.FilterCreatureSpell;
public class StrawGolem extends CardImpl {
public StrawGolem(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{1}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
this.subtype.add("Golem");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When an opponent casts a creature spell, sacrifice Straw Golem.
this.addAbility(new SpellCastOpponentTriggeredAbility(new SacrificeSourceEffect(), new FilterCreatureSpell("a creature spell"), false));
this.addAbility(new SpellCastOpponentTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public StrawGolem(final StrawGolem card) {

View file

@ -35,7 +35,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.StaticFilters;
/**
*
@ -44,10 +44,11 @@ import mage.filter.common.FilterCreatureSpell;
public class Tangleroot extends CardImpl {
public Tangleroot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever a player casts a creature spell, that player adds {G} to his or her mana pool.
this.addAbility(new SpellCastAllTriggeredAbility(new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(1), "his or her"), new FilterCreatureSpell("a creature spell"), false, SetTargetPointer.PLAYER));
this.addAbility(new SpellCastAllTriggeredAbility(
new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(1), "his or her"), StaticFilters.FILTER_SPELL_A_CREATURE, false, SetTargetPointer.PLAYER));
}
public Tangleroot(final Tangleroot card) {

View file

@ -36,9 +36,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -46,14 +45,8 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class ZendikarResurgent extends CardImpl {
private static final FilterSpell FILTER = new FilterSpell("a creature spell");
static {
FILTER.add(new CardTypePredicate(CardType.CREATURE));
}
public ZendikarResurgent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{5}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{G}{G}");
// Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. (<i>The types of mana are white, blue, black, red, green, and colorless.)</i>
AddManaOfAnyTypeProducedEffect effect = new AddManaOfAnyTypeProducedEffect();
@ -64,7 +57,8 @@ public class ZendikarResurgent extends CardImpl {
SetTargetPointer.PERMANENT));
// Whenever you cast a creature spell, draw a card.
this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), FILTER, false));
this.addAbility(new SpellCastControllerTriggeredAbility(
new DrawCardSourceControllerEffect(1), StaticFilters.FILTER_SPELL_A_CREATURE, false));
}
public ZendikarResurgent(final ZendikarResurgent card) {

View file

@ -11,6 +11,7 @@ import mage.filter.common.FilterArtifactCreaturePermanent;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -32,6 +33,8 @@ public class StaticFilters {
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_GOBLINS = new FilterCreaturePermanent("Goblin", "Goblin creatures");
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_SLIVERS = new FilterCreaturePermanent("Sliver", "Sliver creatures");
public static final FilterCreatureSpell FILTER_SPELL_A_CREATURE = new FilterCreatureSpell("a creature spell");
static {
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),