diff --git a/Mage.Sets/src/mage/cards/b/BINGO.java b/Mage.Sets/src/mage/cards/b/BINGO.java index 0bac07222a..c02556c190 100644 --- a/Mage.Sets/src/mage/cards/b/BINGO.java +++ b/Mage.Sets/src/mage/cards/b/BINGO.java @@ -26,6 +26,7 @@ import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -47,7 +48,7 @@ public final class BINGO extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Whenever a player casts a spell, put a chip counter on its converted mana cost. - this.addAbility(new SpellCastAllTriggeredAbility(new BingoEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(new BingoEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL)); // B-I-N-G-O gets +9/+9 for each set of three numbers in a row with chip counters on them. BingoCount count = new BingoCount(); diff --git a/Mage.Sets/src/mage/cards/c/ChecksAndBalances.java b/Mage.Sets/src/mage/cards/c/ChecksAndBalances.java index 0407872b7c..f6fb669a3a 100644 --- a/Mage.Sets/src/mage/cards/c/ChecksAndBalances.java +++ b/Mage.Sets/src/mage/cards/c/ChecksAndBalances.java @@ -12,6 +12,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.players.Player; @@ -31,7 +32,7 @@ public final class ChecksAndBalances extends CardImpl { this.addAbility(new CastOnlyIfConditionIsTrueAbility(ChecksAndBalancesCondition.instance, "Cast this spell only if there are three or more players in the game")); // Whenever a player casts a spell, each of that player’s opponents may discard a card. If they do, counter that spell. - this.addAbility(new SpellCastAllTriggeredAbility(new ChecksAndBalancesEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(new ChecksAndBalancesEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL)); } private ChecksAndBalances(final ChecksAndBalances card) { diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java b/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java index 6d4d05bf44..01d06dc957 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java @@ -20,6 +20,7 @@ import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.target.TargetSpell; /** @@ -34,7 +35,7 @@ public final class DecreeOfSilence extends CardImpl { // Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it. Effect effect = new CounterTargetEffect(); effect.setText("counter that spell"); - Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, effect, new FilterSpell("a spell"), + Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, effect, StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL); effect = new AddCountersSourceEffect(CounterType.DEPLETION.createInstance()); effect.setText("and put a depletion counter on {this}."); diff --git a/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java b/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java index 375c891959..5b2becc29b 100644 --- a/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java +++ b/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java @@ -13,6 +13,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import java.util.UUID; @@ -33,7 +34,7 @@ public final class HermitOfTheNatterknolls extends CardImpl { // Whenever an opponent casts a spell during your turn, draw a card. this.addAbility(new ConditionalTriggeredAbility( - new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), new FilterSpell("a spell"), true), + new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), StaticFilters.FILTER_SPELL_A, true), MyTurnCondition.instance, "Whenever an opponent casts a spell during your turn, draw a card." ).addHint(MyTurnHint.instance)); diff --git a/Mage.Sets/src/mage/cards/h/Hesitation.java b/Mage.Sets/src/mage/cards/h/Hesitation.java index d4d91bf264..8bda0f7131 100644 --- a/Mage.Sets/src/mage/cards/h/Hesitation.java +++ b/Mage.Sets/src/mage/cards/h/Hesitation.java @@ -12,6 +12,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; /** * @@ -23,7 +24,7 @@ public final class Hesitation extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); // When a player casts a spell, sacrifice Hesitation and counter that spell. - Ability ability = new SpellCastAllTriggeredAbility(new SacrificeSourceEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL); + Ability ability = new SpellCastAllTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL); Effect effect = new CounterTargetEffect(); effect.setText("and counter that spell"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/h/HornOfPlenty.java b/Mage.Sets/src/mage/cards/h/HornOfPlenty.java index c5fba150a6..a3c76253bf 100644 --- a/Mage.Sets/src/mage/cards/h/HornOfPlenty.java +++ b/Mage.Sets/src/mage/cards/h/HornOfPlenty.java @@ -16,6 +16,7 @@ import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.TargetController; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -30,7 +31,7 @@ public final class HornOfPlenty extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); // Whenever a player casts a spell, they may pay {1}. If that player does, they draw a card at the beginning of the next end step. - this.addAbility(new SpellCastAllTriggeredAbility(new HornOfPlentyEffect(), new FilterSpell("a spell"), false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastAllTriggeredAbility(new HornOfPlentyEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.PLAYER)); } private HornOfPlenty(final HornOfPlenty card) { diff --git a/Mage.Sets/src/mage/cards/j/JackalopeHerd.java b/Mage.Sets/src/mage/cards/j/JackalopeHerd.java index 113eed3fa4..aca52e91b8 100644 --- a/Mage.Sets/src/mage/cards/j/JackalopeHerd.java +++ b/Mage.Sets/src/mage/cards/j/JackalopeHerd.java @@ -10,6 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; /** * @@ -25,7 +26,7 @@ public final class JackalopeHerd extends CardImpl { this.toughness = new MageInt(5); // When you cast a spell, return Jackalope Herd to its owner's hand. - this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), new FilterSpell("a spell"), false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), StaticFilters.FILTER_SPELL_A, false)); } private JackalopeHerd(final JackalopeHerd card) { diff --git a/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java b/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java index cb102ed19b..1f6020f6f6 100644 --- a/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java +++ b/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java @@ -12,6 +12,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import java.util.UUID; @@ -32,7 +33,7 @@ public final class LoneWolfOfTheNatterknolls extends CardImpl { // Whenever an opponent cast a spell during your turn, draw two cards. this.addAbility(new ConditionalTriggeredAbility( - new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(2), new FilterSpell("a spell"), true), + new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(2), StaticFilters.FILTER_SPELL_A, true), MyTurnCondition.instance, "Whenever an opponent casts a spell during your turn, draw two cards." ).addHint(MyTurnHint.instance)); diff --git a/Mage.Sets/src/mage/cards/l/LunarForce.java b/Mage.Sets/src/mage/cards/l/LunarForce.java index 42815c489f..58c71fea93 100644 --- a/Mage.Sets/src/mage/cards/l/LunarForce.java +++ b/Mage.Sets/src/mage/cards/l/LunarForce.java @@ -13,6 +13,7 @@ import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; /** * @@ -25,7 +26,7 @@ public final class LunarForce extends CardImpl { // Whenever an opponent casts a spell, sacrifice Lunar Force and counter that spell. Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), - new FilterSpell("a spell"), false, SetTargetPointer.SPELL); + StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL); Effect effect = new CounterTargetEffect(); effect.setText("and counter that spell"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/n/NetherVoid.java b/Mage.Sets/src/mage/cards/n/NetherVoid.java index 97c14619d2..06ac88f560 100644 --- a/Mage.Sets/src/mage/cards/n/NetherVoid.java +++ b/Mage.Sets/src/mage/cards/n/NetherVoid.java @@ -11,6 +11,7 @@ import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.SuperType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; /** * @@ -23,7 +24,7 @@ public final class NetherVoid extends CardImpl { addSuperType(SuperType.WORLD); // Whenever a player casts a spell, counter it unless that player pays {3}. - this.addAbility(new SpellCastAllTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(3)), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(3)), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL)); } private NetherVoid(final NetherVoid card) { diff --git a/Mage.Sets/src/mage/cards/o/OpalineSliver.java b/Mage.Sets/src/mage/cards/o/OpalineSliver.java index fc776c9c24..ae353054e0 100644 --- a/Mage.Sets/src/mage/cards/o/OpalineSliver.java +++ b/Mage.Sets/src/mage/cards/o/OpalineSliver.java @@ -15,6 +15,7 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -56,8 +57,6 @@ public final class OpalineSliver extends CardImpl { class OpalineSliverTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterSpell spellCard = new FilterSpell("a spell"); - public OpalineSliverTriggeredAbility() { super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false); } @@ -85,7 +84,7 @@ class OpalineSliverTriggeredAbility extends TriggeredAbilityImpl { } else { return event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId()) - && spellCard.match(spell, getSourceId(), getControllerId(), game); + && StaticFilters.FILTER_SPELL_A.match(spell, getSourceId(), getControllerId(), game); } } diff --git a/Mage.Sets/src/mage/cards/p/PlanarChaos.java b/Mage.Sets/src/mage/cards/p/PlanarChaos.java index 9b549738f0..993b9c2c45 100644 --- a/Mage.Sets/src/mage/cards/p/PlanarChaos.java +++ b/Mage.Sets/src/mage/cards/p/PlanarChaos.java @@ -15,6 +15,7 @@ import mage.constants.SetTargetPointer; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -33,7 +34,7 @@ public final class PlanarChaos extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PlanarChaosUpkeepEffect(), TargetController.YOU, false)); // Whenever a player casts a spell, that player flips a coin. If they lose the flip, counter that spell. - this.addAbility(new SpellCastAllTriggeredAbility(new PlanarChaosCastAllEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(new PlanarChaosCastAllEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL)); } private PlanarChaos(final PlanarChaos card) { diff --git a/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java b/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java index e5e8bdcb76..e2d1afc360 100644 --- a/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java +++ b/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java @@ -20,6 +20,7 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -42,7 +43,7 @@ public final class RamosDragonEngine extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors. - this.addAbility(new SpellCastControllerTriggeredAbility(new RamosDragonEngineAddCountersEffect(), new FilterSpell("a spell"), false, true)); + this.addAbility(new SpellCastControllerTriggeredAbility(new RamosDragonEngineAddCountersEffect(), StaticFilters.FILTER_SPELL_A, false, true)); // Remove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G}. Activate this ability only once each turn. Ability ability = new ActivateOncePerTurnManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(2, 2, 2, 2, 2, 0, 0, 0)), new RemoveCountersSourceCost(CounterType.P1P1.createInstance(5))); diff --git a/Mage.Sets/src/mage/cards/s/StaffOfTheLetterMagus.java b/Mage.Sets/src/mage/cards/s/StaffOfTheLetterMagus.java index 8b2120bd93..806541bd5b 100644 --- a/Mage.Sets/src/mage/cards/s/StaffOfTheLetterMagus.java +++ b/Mage.Sets/src/mage/cards/s/StaffOfTheLetterMagus.java @@ -12,6 +12,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -35,7 +36,7 @@ public final class StaffOfTheLetterMagus extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new StaffOfTheLetterMagusChooseLetterEffect())); // Whenever a player casts a spell, you gain 1 life for each time the chosen letter appears in that spell’s name. - this.addAbility(new SpellCastAllTriggeredAbility(new StaffOfTheLetterMagusEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(new StaffOfTheLetterMagusEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL)); } private StaffOfTheLetterMagus(final StaffOfTheLetterMagus card) { diff --git a/Mage.Sets/src/mage/cards/t/TabletOfTheGuilds.java b/Mage.Sets/src/mage/cards/t/TabletOfTheGuilds.java index 31e67afdd4..2173e20e45 100644 --- a/Mage.Sets/src/mage/cards/t/TabletOfTheGuilds.java +++ b/Mage.Sets/src/mage/cards/t/TabletOfTheGuilds.java @@ -14,6 +14,7 @@ import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Outcome; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -32,7 +33,7 @@ public final class TabletOfTheGuilds extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new TabletOfTheGuildsEntersBattlefieldEffect())); // Whenever you cast a spell, if it's at least one of the chosen colors, you gain 1 life for each of the chosen colors it is. - this.addAbility(new SpellCastControllerTriggeredAbility(new TabletOfTheGuildsGainLifeEffect(), new FilterSpell("a spell"), false, true)); + this.addAbility(new SpellCastControllerTriggeredAbility(new TabletOfTheGuildsGainLifeEffect(), StaticFilters.FILTER_SPELL_A, false, true)); } private TabletOfTheGuilds(final TabletOfTheGuilds card) { diff --git a/Mage.Sets/src/mage/cards/u/UnifyingTheory.java b/Mage.Sets/src/mage/cards/u/UnifyingTheory.java index f498d5ca26..6b417c9430 100644 --- a/Mage.Sets/src/mage/cards/u/UnifyingTheory.java +++ b/Mage.Sets/src/mage/cards/u/UnifyingTheory.java @@ -13,6 +13,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -28,7 +29,7 @@ public final class UnifyingTheory extends CardImpl { // Whenever a player casts a spell, that player may pay {2}. If the player does, they draw a card. - this.addAbility(new SpellCastAllTriggeredAbility(new UnifyingTheoryEffect() , new FilterSpell("a spell"), false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastAllTriggeredAbility(new UnifyingTheoryEffect() , StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.PLAYER)); } private UnifyingTheory(final UnifyingTheory card) { diff --git a/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java b/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java index 83089e5d6e..d7a4fb0e35 100644 --- a/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java +++ b/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java @@ -11,6 +11,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -25,7 +26,7 @@ public final class VeilstoneAmulet extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // Whenever you cast a spell, creatures you control can't be the targets of spells or abilities your opponents control this turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new VeilstoneAmuletEffect(), new FilterSpell("a spell"), false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new VeilstoneAmuletEffect(), StaticFilters.FILTER_SPELL_A, false)); } private VeilstoneAmulet(final VeilstoneAmulet card) { diff --git a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java index 00396361e0..1097c4d4be 100644 --- a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java +++ b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java @@ -15,6 +15,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.permanent.token.VoiceOfResurgenceToken; import java.util.UUID; @@ -34,7 +35,7 @@ public final class VoiceOfResurgence extends CardImpl { // Whenever an opponent casts a spell during your turn or when Voice of Resurgence dies, create a green and white Elemental creature token with "This creature's power and toughness are each equal to the number of creatures you control." OrTriggeredAbility ability = new OrTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VoiceOfResurgenceToken()), new ConditionalTriggeredAbility( - new SpellCastOpponentTriggeredAbility(null, new FilterSpell("a spell"), false), + new SpellCastOpponentTriggeredAbility(null, StaticFilters.FILTER_SPELL_A, false), MyTurnCondition.instance, "Whenever an opponent casts a spell during your turn, "), new DiesSourceTriggeredAbility(null, false)); diff --git a/Mage/src/main/java/mage/abilities/common/SpellCastOpponentTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SpellCastOpponentTriggeredAbility.java index f31025f50b..aa7e6f4b2b 100644 --- a/Mage/src/main/java/mage/abilities/common/SpellCastOpponentTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SpellCastOpponentTriggeredAbility.java @@ -5,6 +5,7 @@ import mage.abilities.effects.Effect; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -15,12 +16,11 @@ import mage.target.targetpointer.FixedTarget; */ public class SpellCastOpponentTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterSpell spellCard = new FilterSpell("a spell"); protected FilterSpell filter; protected SetTargetPointer setTargetPointer; public SpellCastOpponentTriggeredAbility(Effect effect, boolean optional) { - this(effect, spellCard, optional); + this(effect, StaticFilters.FILTER_SPELL_A, optional); } public SpellCastOpponentTriggeredAbility(Effect effect, FilterSpell filter, boolean optional) { diff --git a/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java index 33a9673b99..99be9a56d4 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java @@ -7,6 +7,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.command.Emblem; import mage.target.common.TargetAnyTarget; @@ -21,7 +22,7 @@ public final class ChandraTorchOfDefianceEmblem extends Emblem { this.setName("Emblem Chandra"); Effect effect = new DamageTargetEffect(5); effect.setText("this emblem deals 5 damage to any target"); - Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, new FilterSpell("a spell"), false, false); + Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, StaticFilters.FILTER_SPELL_A, false, false); ability.addTarget(new TargetAnyTarget()); getAbilities().add(ability); } diff --git a/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java b/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java index 34ab1500f1..4e343d6898 100644 --- a/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java @@ -6,6 +6,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.MillCardsTargetEffect; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.command.Emblem; import mage.target.common.TargetOpponent; @@ -19,7 +20,7 @@ public final class JaceTelepathUnboundEmblem extends Emblem { this.setName("Emblem Jace"); Effect effect = new MillCardsTargetEffect(5); effect.setText("target opponent mills five cards"); - Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, new FilterSpell("a spell"), false, false); + Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, StaticFilters.FILTER_SPELL_A, false, false); ability.addTarget(new TargetOpponent()); getAbilities().add(ability); } diff --git a/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java index c3c570a4d5..9a5f0b82bd 100644 --- a/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java @@ -7,6 +7,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetEffect; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; @@ -36,8 +37,6 @@ public final class VenserTheSojournerEmblem extends Emblem { class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterSpell spellCard = new FilterSpell("a spell"); - protected FilterSpell filter; /** * If true, the source that triggered the ability will be set as target to @@ -46,12 +45,10 @@ class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl { public VenserTheSojournerSpellCastTriggeredAbility(Effect effect, boolean optional) { super(Zone.COMMAND, effect, optional); - this.filter = spellCard; } public VenserTheSojournerSpellCastTriggeredAbility(final VenserTheSojournerSpellCastTriggeredAbility ability) { super(ability); - filter = ability.filter; } @Override @@ -63,7 +60,7 @@ class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && filter.match(spell, game); + return spell != null && StaticFilters.FILTER_SPELL_A.match(spell, game); } return false; } diff --git a/Mage/src/main/java/mage/game/command/planes/FieldsOfSummerPlane.java b/Mage/src/main/java/mage/game/command/planes/FieldsOfSummerPlane.java index ae561f6dca..e4e07bf442 100644 --- a/Mage/src/main/java/mage/game/command/planes/FieldsOfSummerPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/FieldsOfSummerPlane.java @@ -14,6 +14,7 @@ import mage.abilities.effects.common.RollPlanarDieEffect; import mage.abilities.effects.common.cost.PlanarDieRollCostIncreasingEffect; import mage.constants.*; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.command.Plane; import mage.players.Player; @@ -29,14 +30,13 @@ import java.util.List; */ public class FieldsOfSummerPlane extends Plane { - private static final FilterSpell filter = new FilterSpell("a spell"); public FieldsOfSummerPlane() { this.setPlaneType(Planes.PLANE_FIELDS_OF_SUMMER); this.setExpansionSetCodeForImage("PCA"); // Whenever a player casts a spell, that player may gain 2 life - SpellCastAllTriggeredAbility ability = new SpellCastAllTriggeredAbility(Zone.COMMAND, new FieldsOfSummerEffect(), filter, false, SetTargetPointer.PLAYER); + SpellCastAllTriggeredAbility ability = new SpellCastAllTriggeredAbility(Zone.COMMAND, new FieldsOfSummerEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.PLAYER); this.getAbilities().add(ability); // Active player can roll the planar die: Whenever you roll {CHAOS}, you may gain 10 life