diff --git a/Mage.Sets/src/mage/cards/b/Biotransference.java b/Mage.Sets/src/mage/cards/b/Biotransference.java index 6c4b7a3d2ac..5f13df83656 100644 --- a/Mage.Sets/src/mage/cards/b/Biotransference.java +++ b/Mage.Sets/src/mage/cards/b/Biotransference.java @@ -10,7 +10,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.command.CommandObject; @@ -26,12 +26,6 @@ import java.util.UUID; public final class Biotransference extends CardImpl { - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - - static { - filter.add(CardType.ARTIFACT.getPredicate()); - } - public Biotransference(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); @@ -39,7 +33,7 @@ public final class Biotransference extends CardImpl { this.addAbility(new SimpleStaticAbility(new BiotransferenceEffect())); // Whenever you cast an artifact spell, you lose 1 life and create a 2/2 black Necron Warrior artifact creature token. - Ability ability = new SpellCastControllerTriggeredAbility(new LoseLifeSourceControllerEffect(1), filter, false); + Ability ability = new SpellCastControllerTriggeredAbility(new LoseLifeSourceControllerEffect(1), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false); ability.addEffect(new CreateTokenEffect(new NecronWarriorToken(), 1).concatBy("and")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CitanulDruid.java b/Mage.Sets/src/mage/cards/c/CitanulDruid.java index 6b298731d6e..ff018da3fee 100644 --- a/Mage.Sets/src/mage/cards/c/CitanulDruid.java +++ b/Mage.Sets/src/mage/cards/c/CitanulDruid.java @@ -9,21 +9,14 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetController; import mage.counters.CounterType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; /** * * @author ilcartographer */ public final class CitanulDruid extends CardImpl { - private static final FilterArtifactSpell filter = new FilterArtifactSpell(); - - static { - filter.add(TargetController.OPPONENT.getControllerPredicate()); - } - public CitanulDruid(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); @@ -33,7 +26,7 @@ public final class CitanulDruid extends CardImpl { this.toughness = new MageInt(1); // Whenever an opponent casts an artifact spell, put a +1/+1 counter on Citanul Druid. - this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false)); + this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private CitanulDruid(final CitanulDruid card) { diff --git a/Mage.Sets/src/mage/cards/d/DigsiteEngineer.java b/Mage.Sets/src/mage/cards/d/DigsiteEngineer.java index a8e3a0e1c0a..ab18e9898d0 100644 --- a/Mage.Sets/src/mage/cards/d/DigsiteEngineer.java +++ b/Mage.Sets/src/mage/cards/d/DigsiteEngineer.java @@ -9,8 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.FilterSpell; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.permanent.token.KarnConstructToken; import java.util.UUID; @@ -20,8 +19,6 @@ import java.util.UUID; */ public final class DigsiteEngineer extends CardImpl { - private static final FilterSpell filter = new FilterArtifactSpell("an artifact spell"); - public DigsiteEngineer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); @@ -33,7 +30,7 @@ public final class DigsiteEngineer extends CardImpl { // Whenever you cast an artifact spell, you may pay {2}. If you do, create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid( new CreateTokenEffect(new KarnConstructToken()), new GenericManaCost(2) - ), filter, false)); + ), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private DigsiteEngineer(final DigsiteEngineer card) { diff --git a/Mage.Sets/src/mage/cards/e/EfficientConstruction.java b/Mage.Sets/src/mage/cards/e/EfficientConstruction.java index 2d691d823cc..721ba0d24e9 100644 --- a/Mage.Sets/src/mage/cards/e/EfficientConstruction.java +++ b/Mage.Sets/src/mage/cards/e/EfficientConstruction.java @@ -7,7 +7,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.permanent.token.ThopterColorlessToken; /** @@ -20,7 +20,7 @@ public final class EfficientConstruction extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); // Whenever you cast an artifact spell, create a 1/1 colorless Thopter artifact creature token with flying. - this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken()), new FilterArtifactSpell("an artifact spell"), false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private EfficientConstruction(final EfficientConstruction card) { diff --git a/Mage.Sets/src/mage/cards/e/Embersmith.java b/Mage.Sets/src/mage/cards/e/Embersmith.java index e5507b91560..82213ae34ed 100644 --- a/Mage.Sets/src/mage/cards/e/Embersmith.java +++ b/Mage.Sets/src/mage/cards/e/Embersmith.java @@ -10,7 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -31,8 +31,7 @@ public final class Embersmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new EmbersmithEffect(), filter, false); + SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new EmbersmithEffect(), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } @@ -80,4 +79,4 @@ class EmbersmithEffect extends OneShotEffect { public EmbersmithEffect copy() { return new EmbersmithEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/g/GolemFoundry.java b/Mage.Sets/src/mage/cards/g/GolemFoundry.java index 7ed037c35bd..aeeab21a436 100644 --- a/Mage.Sets/src/mage/cards/g/GolemFoundry.java +++ b/Mage.Sets/src/mage/cards/g/GolemFoundry.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.permanent.token.GolemToken; /** @@ -23,10 +22,9 @@ public final class GolemFoundry extends CardImpl { public GolemFoundry (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); - // Whenever you cast an artifact spell, - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, true)); - // you may put a charge counter on Golem Foundry. + // Whenever you cast an artifact spell, you may put a charge counter on Golem Foundry. + this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true)); + // Remove three charge counters from Golem Foundry: Create a 3/3 colorless Golem artifact creature token. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GolemToken()), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3)))); } @@ -38,4 +36,4 @@ public final class GolemFoundry extends CardImpl { public GolemFoundry copy() { return new GolemFoundry(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/i/InfestedRoothold.java b/Mage.Sets/src/mage/cards/i/InfestedRoothold.java index 587e8c30ecf..2dd16e47418 100644 --- a/Mage.Sets/src/mage/cards/i/InfestedRoothold.java +++ b/Mage.Sets/src/mage/cards/i/InfestedRoothold.java @@ -11,9 +11,8 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterCard; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterArtifactCard; -import mage.filter.common.FilterArtifactSpell; import mage.game.permanent.token.InsectToken; import java.util.UUID; @@ -24,7 +23,6 @@ import java.util.UUID; public final class InfestedRoothold extends CardImpl { private static final FilterCard filter = new FilterArtifactCard("artifacts"); - private static final FilterSpell filter2 = new FilterArtifactSpell("an artifact spell"); public InfestedRoothold(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); @@ -41,7 +39,7 @@ public final class InfestedRoothold extends CardImpl { // Whenever an opponent casts an artifact spell, you may create a 1/1 green Insect creature token. this.addAbility(new SpellCastOpponentTriggeredAbility( - new CreateTokenEffect(new InsectToken()), filter2, true) + new CreateTokenEffect(new InsectToken()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true) ); } diff --git a/Mage.Sets/src/mage/cards/l/Lifesmith.java b/Mage.Sets/src/mage/cards/l/Lifesmith.java index d36371b79e6..6d02d8a32a7 100644 --- a/Mage.Sets/src/mage/cards/l/Lifesmith.java +++ b/Mage.Sets/src/mage/cards/l/Lifesmith.java @@ -10,7 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.util.ManaUtil; @@ -29,8 +29,7 @@ public final class Lifesmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - this.addAbility(new SpellCastControllerTriggeredAbility(new LifesmithEffect(), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new LifesmithEffect(), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private Lifesmith(final Lifesmith card) { @@ -70,4 +69,4 @@ class LifesmithEffect extends OneShotEffect { public LifesmithEffect copy() { return new LifesmithEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/m/MirranSpy.java b/Mage.Sets/src/mage/cards/m/MirranSpy.java index 981e51f5172..8cfb308776e 100644 --- a/Mage.Sets/src/mage/cards/m/MirranSpy.java +++ b/Mage.Sets/src/mage/cards/m/MirranSpy.java @@ -10,7 +10,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; /** @@ -30,8 +30,7 @@ public final class MirranSpy extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever you cast an artifact spell, you may untap target creature. - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new UntapTargetEffect(), filter, true); + SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new UntapTargetEffect(), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/Myrsmith.java b/Mage.Sets/src/mage/cards/m/Myrsmith.java index cce5b91bc37..0c282e95bea 100644 --- a/Mage.Sets/src/mage/cards/m/Myrsmith.java +++ b/Mage.Sets/src/mage/cards/m/Myrsmith.java @@ -9,7 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.MyrToken; import mage.util.ManaUtil; @@ -30,8 +30,7 @@ public final class Myrsmith extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast an artifact spell, you may pay {1}. If you do, put a 1/1 colorless Myr artifact creature token onto the battlefield. - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - this.addAbility(new SpellCastControllerTriggeredAbility(new MyrsmithEffect(), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new MyrsmithEffect(), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private Myrsmith(final Myrsmith card) { diff --git a/Mage.Sets/src/mage/cards/p/Painsmith.java b/Mage.Sets/src/mage/cards/p/Painsmith.java index 8929a47fdc9..e229557253c 100644 --- a/Mage.Sets/src/mage/cards/p/Painsmith.java +++ b/Mage.Sets/src/mage/cards/p/Painsmith.java @@ -13,7 +13,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; /** @@ -29,8 +29,7 @@ public final class Painsmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), filter, true); + SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true); ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PatchworkAutomaton.java b/Mage.Sets/src/mage/cards/p/PatchworkAutomaton.java index cdec5818298..9404c546695 100644 --- a/Mage.Sets/src/mage/cards/p/PatchworkAutomaton.java +++ b/Mage.Sets/src/mage/cards/p/PatchworkAutomaton.java @@ -10,8 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; -import mage.filter.FilterSpell; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import java.util.UUID; @@ -20,8 +19,6 @@ import java.util.UUID; */ public final class PatchworkAutomaton extends CardImpl { - private static final FilterSpell filter = new FilterArtifactSpell("an artifact spell"); - public PatchworkAutomaton(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); @@ -34,7 +31,7 @@ public final class PatchworkAutomaton extends CardImpl { // Whenever you cast an artifact spell, put a +1/+1 counter on Patchwork Automaton. this.addAbility(new SpellCastControllerTriggeredAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false )); } diff --git a/Mage.Sets/src/mage/cards/r/Riddlesmith.java b/Mage.Sets/src/mage/cards/r/Riddlesmith.java index e5eb409d956..03012c945d3 100644 --- a/Mage.Sets/src/mage/cards/r/Riddlesmith.java +++ b/Mage.Sets/src/mage/cards/r/Riddlesmith.java @@ -7,8 +7,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.FilterSpell; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; import java.util.UUID; @@ -17,8 +16,6 @@ import java.util.UUID; */ public final class Riddlesmith extends CardImpl { - private static final FilterSpell filter = new FilterArtifactSpell("an artifact spell"); - public Riddlesmith(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.HUMAN); @@ -29,7 +26,7 @@ public final class Riddlesmith extends CardImpl { // Whenever you cast an artifact spell, you may draw a card. If you do, discard a card. this.addAbility(new SpellCastControllerTriggeredAbility( - new DrawDiscardControllerEffect(true), filter, false + new DrawDiscardControllerEffect(true), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false )); } diff --git a/Mage.Sets/src/mage/cards/s/SaiMasterThopterist.java b/Mage.Sets/src/mage/cards/s/SaiMasterThopterist.java index 4bb33a4c8e8..197e1c72aee 100644 --- a/Mage.Sets/src/mage/cards/s/SaiMasterThopterist.java +++ b/Mage.Sets/src/mage/cards/s/SaiMasterThopterist.java @@ -15,7 +15,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledArtifactPermanent; import mage.game.permanent.token.ThopterColorlessToken; import mage.target.common.TargetControlledPermanent; @@ -26,13 +26,8 @@ import mage.target.common.TargetControlledPermanent; */ public final class SaiMasterThopterist extends CardImpl { - private static final FilterSpell filter = new FilterSpell("an artifact spell"); private static final FilterControlledArtifactPermanent filter2 = new FilterControlledArtifactPermanent("artifacts"); - static { - filter.add(CardType.ARTIFACT.getPredicate()); - } - public SaiMasterThopterist(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); @@ -43,7 +38,7 @@ public final class SaiMasterThopterist extends CardImpl { this.toughness = new MageInt(4); // Whenever you cast an artifact spell, create a 1/1 colorless Thopter artifact creature token with flying. - this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken()), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken()), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); // {1}{U}, Sacrifice two artifacts: Draw a card. Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/cards/v/VedalkenArchmage.java b/Mage.Sets/src/mage/cards/v/VedalkenArchmage.java index a814b29ed30..180477ac246 100644 --- a/Mage.Sets/src/mage/cards/v/VedalkenArchmage.java +++ b/Mage.Sets/src/mage/cards/v/VedalkenArchmage.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -9,7 +8,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.common.FilterArtifactSpell; +import mage.filter.StaticFilters; /** * @@ -25,8 +24,7 @@ public final class VedalkenArchmage extends CardImpl { this.toughness = new MageInt(2); // Whenever you cast an artifact spell, draw a card. - FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); - this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), StaticFilters.FILTER_SPELL_AN_ARTIFACT, false)); } private VedalkenArchmage(final VedalkenArchmage card) { diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index 4bd90354d27..eb90e4a7d12 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -953,6 +953,12 @@ public final class StaticFilters { FILTER_SPELL_AN_ENCHANTMENT.setLockedFilter(true); } + public static final FilterSpell FILTER_SPELL_AN_ARTIFACT = new FilterArtifactSpell("an artifact spell"); + + static { + FILTER_SPELL_AN_ARTIFACT.setLockedFilter(true); + } + public static final FilterSpell FILTER_SPELL_KICKED_A = new FilterSpell("a kicked spell"); static {