diff --git a/Mage.Sets/src/mage/cards/a/AetherBarrier.java b/Mage.Sets/src/mage/cards/a/AetherBarrier.java index 7e9e69c5d04..d3bb1c3d57f 100644 --- a/Mage.Sets/src/mage/cards/a/AetherBarrier.java +++ b/Mage.Sets/src/mage/cards/a/AetherBarrier.java @@ -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) { @@ -105,4 +94,4 @@ class AetherBarrierEffect extends SacrificeEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java index d5fa20e12c7..b93ef3c5acb 100644 --- a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java +++ b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java @@ -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())); diff --git a/Mage.Sets/src/mage/cards/e/EndrekSahrMasterBreeder.java b/Mage.Sets/src/mage/cards/e/EndrekSahrMasterBreeder.java index 0485d62e785..220b63e656e 100644 --- a/Mage.Sets/src/mage/cards/e/EndrekSahrMasterBreeder.java +++ b/Mage.Sets/src/mage/cards/e/EndrekSahrMasterBreeder.java @@ -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, diff --git a/Mage.Sets/src/mage/cards/e/Equilibrium.java b/Mage.Sets/src/mage/cards/e/Equilibrium.java index 2262aa06e85..191fe0ffe5b 100644 --- a/Mage.Sets/src/mage/cards/e/Equilibrium.java +++ b/Mage.Sets/src/mage/cards/e/Equilibrium.java @@ -28,36 +28,28 @@ 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; /** * * @author jeffwadsworth */ 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); } diff --git a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java index 50615d70931..6f8f9e039c6 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java +++ b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java @@ -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); } } diff --git a/Mage.Sets/src/mage/cards/h/HalcyonGlaze.java b/Mage.Sets/src/mage/cards/h/HalcyonGlaze.java index ed64dda0814..a289374348d 100644 --- a/Mage.Sets/src/mage/cards/h/HalcyonGlaze.java +++ b/Mage.Sets/src/mage/cards/h/HalcyonGlaze.java @@ -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); diff --git a/Mage.Sets/src/mage/cards/k/KarametraGodOfHarvests.java b/Mage.Sets/src/mage/cards/k/KarametraGodOfHarvests.java index 80b4b36a92f..d417a9881b2 100644 --- a/Mage.Sets/src/mage/cards/k/KarametraGodOfHarvests.java +++ b/Mage.Sets/src/mage/cards/k/KarametraGodOfHarvests.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/l/LifecraftersBestiary.java b/Mage.Sets/src/mage/cards/l/LifecraftersBestiary.java index 3fb7fe0bf83..c1f165b987d 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftersBestiary.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftersBestiary.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/m/MaskedAdmirers.java b/Mage.Sets/src/mage/cards/m/MaskedAdmirers.java index f2ada824b99..aa795e0970e 100644 --- a/Mage.Sets/src/mage/cards/m/MaskedAdmirers.java +++ b/Mage.Sets/src/mage/cards/m/MaskedAdmirers.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/o/Onslaught.java b/Mage.Sets/src/mage/cards/o/Onslaught.java index db386198556..a236ea081d6 100644 --- a/Mage.Sets/src/mage/cards/o/Onslaught.java +++ b/Mage.Sets/src/mage/cards/o/Onslaught.java @@ -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); } diff --git a/Mage.Sets/src/mage/cards/p/PrimevalBounty.java b/Mage.Sets/src/mage/cards/p/PrimevalBounty.java index d99777cb01f..cb13384062f 100644 --- a/Mage.Sets/src/mage/cards/p/PrimevalBounty.java +++ b/Mage.Sets/src/mage/cards/p/PrimevalBounty.java @@ -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)); @@ -72,7 +71,7 @@ public class PrimevalBounty extends CardImpl { ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); - // Whenever a land enters the battlefield under your control, you gain 3 life. + // Whenever a land enters the battlefield under your control, you gain 3 life. effect = new GainLifeEffect(3); ability = new EntersBattlefieldControlledTriggeredAbility(effect, new FilterLandPermanent("a land")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PrimordialSage.java b/Mage.Sets/src/mage/cards/p/PrimordialSage.java index bf3c06d8f97..bb0a0ca8218 100644 --- a/Mage.Sets/src/mage/cards/p/PrimordialSage.java +++ b/Mage.Sets/src/mage/cards/p/PrimordialSage.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/q/QuestForTheHolyRelic.java b/Mage.Sets/src/mage/cards/q/QuestForTheHolyRelic.java index ee3455cf400..ce3d7dd9a9b 100644 --- a/Mage.Sets/src/mage/cards/q/QuestForTheHolyRelic.java +++ b/Mage.Sets/src/mage/cards/q/QuestForTheHolyRelic.java @@ -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()); diff --git a/Mage.Sets/src/mage/cards/s/SkitteringHorror.java b/Mage.Sets/src/mage/cards/s/SkitteringHorror.java index ba03266ad92..9be8cef8a60 100644 --- a/Mage.Sets/src/mage/cards/s/SkitteringHorror.java +++ b/Mage.Sets/src/mage/cards/s/SkitteringHorror.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/s/SkitteringMonstrosity.java b/Mage.Sets/src/mage/cards/s/SkitteringMonstrosity.java index 82fdb87463b..74e592227e5 100644 --- a/Mage.Sets/src/mage/cards/s/SkitteringMonstrosity.java +++ b/Mage.Sets/src/mage/cards/s/SkitteringMonstrosity.java @@ -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) { diff --git a/Mage.Sets/src/mage/cards/s/SkitteringSkirge.java b/Mage.Sets/src/mage/cards/s/SkitteringSkirge.java index 38a8aed5c81..66f875c606e 100644 --- a/Mage.Sets/src/mage/cards/s/SkitteringSkirge.java +++ b/Mage.Sets/src/mage/cards/s/SkitteringSkirge.java @@ -35,32 +35,25 @@ 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; /** * * @author hanasu */ 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); // Flying 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) { diff --git a/Mage.Sets/src/mage/cards/s/StrawGolem.java b/Mage.Sets/src/mage/cards/s/StrawGolem.java index 8552fa2448c..8e5f720f4f0 100644 --- a/Mage.Sets/src/mage/cards/s/StrawGolem.java +++ b/Mage.Sets/src/mage/cards/s/StrawGolem.java @@ -1,63 +1,63 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.s; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.SpellCastOpponentTriggeredAbility; -import mage.abilities.effects.common.SacrificeSourceEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.filter.common.FilterCreatureSpell; - -/** - * - * @author Derpthemeus - */ -public class StrawGolem extends CardImpl { - - public StrawGolem(UUID ownerId, CardSetInfo setInfo) { - 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)); - } - - public StrawGolem(final StrawGolem card) { - super(card); - } - - @Override - public StrawGolem copy() { - return new StrawGolem(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; + +/** + * + * @author Derpthemeus + */ +public class StrawGolem extends CardImpl { + + public StrawGolem(UUID ownerId, CardSetInfo setInfo) { + 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(), StaticFilters.FILTER_SPELL_A_CREATURE, false)); + } + + public StrawGolem(final StrawGolem card) { + super(card); + } + + @Override + public StrawGolem copy() { + return new StrawGolem(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/Tangleroot.java b/Mage.Sets/src/mage/cards/t/Tangleroot.java index 197f77c918e..659f13ab519 100644 --- a/Mage.Sets/src/mage/cards/t/Tangleroot.java +++ b/Mage.Sets/src/mage/cards/t/Tangleroot.java @@ -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) { @@ -58,5 +59,5 @@ public class Tangleroot extends CardImpl { public Tangleroot copy() { return new Tangleroot(this); } - -} \ No newline at end of file + +} diff --git a/Mage.Sets/src/mage/cards/z/ZendikarResurgent.java b/Mage.Sets/src/mage/cards/z/ZendikarResurgent.java index 302e7ac1193..f6fab6276b4 100644 --- a/Mage.Sets/src/mage/cards/z/ZendikarResurgent.java +++ b/Mage.Sets/src/mage/cards/z/ZendikarResurgent.java @@ -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. (The types of mana are white, blue, black, red, green, and colorless.) 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) { diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index dd902cb3815..082eda39115 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -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),