From b7159d7d2c3e0b9ef49ea128cc2e36d0b78628ec Mon Sep 17 00:00:00 2001 From: igoudt Date: Mon, 10 Jul 2017 15:45:19 +0200 Subject: [PATCH 01/29] update spellfilters to staticfilters --- .../mage/cards/b/BattlefieldThaumaturge.java | 11 ++-------- .../src/mage/cards/b/BlistercoilWeird.java | 14 ++----------- .../mage/cards/c/ChancellorOfTheAnnex.java | 4 ++-- .../src/mage/cards/c/Counterbalance.java | 5 ++--- Mage.Sets/src/mage/cards/c/Countermand.java | 4 ++-- Mage.Sets/src/mage/cards/c/Cursecatcher.java | 14 ++----------- .../src/mage/cards/d/DecreeOfSilence.java | 4 ++-- Mage.Sets/src/mage/cards/d/Disrupt.java | 14 ++----------- .../src/mage/cards/d/DoubleNegative.java | 4 ++-- .../src/mage/cards/d/DualcasterMage.java | 14 ++----------- Mage.Sets/src/mage/cards/e/EchoMage.java | 16 +++------------ .../mage/cards/f/FerocityOfTheUnderworld.java | 10 +++------- Mage.Sets/src/mage/cards/f/Flusterstorm.java | 12 ++--------- Mage.Sets/src/mage/cards/f/Fluxcharger.java | 13 ++---------- .../src/mage/cards/f/ForcedFruition.java | 4 ++-- .../src/mage/cards/g/GlimpseOfNature.java | 10 ++-------- Mage.Sets/src/mage/cards/i/IceCave.java | 8 ++++---- Mage.Sets/src/mage/cards/i/InsidiousWill.java | 17 ++++------------ .../src/mage/cards/j/JudgesFamiliar.java | 20 +++++-------------- .../src/mage/cards/k/KaervekTheMerciless.java | 4 ++-- Mage.Sets/src/mage/cards/m/ManaBreach.java | 7 ++++--- .../src/mage/cards/m/MeletisCharlatan.java | 17 ++++------------ .../src/mage/cards/m/MercurialGeists.java | 17 ++++------------ .../src/mage/cards/m/MinamosMeddling.java | 10 +++------- Mage.Sets/src/mage/cards/m/MindsDilation.java | 9 +++++---- .../src/mage/cards/m/MischievousQuanar.java | 17 ++++------------ .../src/mage/cards/m/MoltenInfluence.java | 17 ++++------------ Mage.Sets/src/mage/cards/n/NiblisOfFrost.java | 14 ++++--------- Mage.Sets/src/mage/cards/o/OddsEnds.java | 17 ++++------------ Mage.Sets/src/mage/cards/o/Outwit.java | 3 ++- .../src/mage/cards/p/PainfulQuandary.java | 7 ++++--- Mage.Sets/src/mage/cards/p/PardicDragon.java | 4 ++-- .../src/mage/cards/p/PrescientChimera.java | 16 ++++----------- Mage.Sets/src/mage/cards/p/PsychicStrike.java | 13 ++++++------ .../src/mage/cards/p/PunishIgnorance.java | 9 +++++---- Mage.Sets/src/mage/cards/q/Quash.java | 19 +++++------------- Mage.Sets/src/mage/cards/r/RhysticStudy.java | 7 ++++--- Mage.Sets/src/mage/cards/s/SigilTracer.java | 12 ++++------- Mage.Sets/src/mage/cards/s/SoulBarrier.java | 10 +++++----- .../src/mage/cards/s/SpelltitheEnforcer.java | 7 ++++--- Mage.Sets/src/mage/cards/s/SplitDecision.java | 17 ++++------------ Mage.Sets/src/mage/cards/s/StratusDancer.java | 16 ++++----------- Mage.Sets/src/mage/cards/t/Tephraderm.java | 9 ++++----- Mage.Sets/src/mage/cards/t/Twincast.java | 19 +++++------------- Mage.Sets/src/mage/cards/u/Undermine.java | 7 ++++--- .../src/mage/cards/u/UyoSilentProphet.java | 14 ++----------- .../src/mage/cards/v/VodalianMystic.java | 17 ++++------------ .../src/mage/cards/y/YoungPyromancer.java | 17 ++++------------ .../main/java/mage/filter/StaticFilters.java | 9 +++++++++ .../main/java/mage/target/TargetSpell.java | 3 ++- 50 files changed, 173 insertions(+), 389 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java index a635efd686f..34db5229735 100644 --- a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java +++ b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java @@ -38,9 +38,7 @@ import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -83,11 +81,6 @@ public class BattlefieldThaumaturge extends CardImpl { class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEffectImpl { - private static final FilterSpell filter = new FilterSpell("instant and sorcery spell"); - - static { - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); - } public BattlefieldThaumaturgeSpellsCostReductionEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); @@ -118,7 +111,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf if ((abilityToModify instanceof SpellAbility) && abilityToModify.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); - return spell != null && BattlefieldThaumaturgeSpellsCostReductionEffect.filter.match(spell, game); + return spell != null && StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL.match(spell, game); } return false; } diff --git a/Mage.Sets/src/mage/cards/b/BlistercoilWeird.java b/Mage.Sets/src/mage/cards/b/BlistercoilWeird.java index 93ec6c1ad16..782100a79e5 100644 --- a/Mage.Sets/src/mage/cards/b/BlistercoilWeird.java +++ b/Mage.Sets/src/mage/cards/b/BlistercoilWeird.java @@ -36,9 +36,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.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import java.util.UUID; @@ -47,14 +45,6 @@ import java.util.UUID; */ public class BlistercoilWeird extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public BlistercoilWeird(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U/R}"); this.subtype.add("Weird"); @@ -65,7 +55,7 @@ public class BlistercoilWeird extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast an instant or sorcery spell, Blistercoil Weird gets +1/+1 until end of turn. Untap it. - Ability ability = new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), filter, false); + Ability ability = new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, false); ability.addEffect(new UntapSourceEffect()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/ChancellorOfTheAnnex.java b/Mage.Sets/src/mage/cards/c/ChancellorOfTheAnnex.java index e8706998b94..4b08d66a0c9 100644 --- a/Mage.Sets/src/mage/cards/c/ChancellorOfTheAnnex.java +++ b/Mage.Sets/src/mage/cards/c/ChancellorOfTheAnnex.java @@ -42,7 +42,7 @@ import mage.constants.CardType; import mage.constants.Outcome; 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.events.GameEvent.EventType; @@ -69,7 +69,7 @@ public class ChancellorOfTheAnnex extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever an opponent casts a spell, counter it unless that player pays {1}. - this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(1)), new FilterSpell(), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(1)), StaticFilters.FILTER_SPELL, false, SetTargetPointer.SPELL)); } public ChancellorOfTheAnnex(final ChancellorOfTheAnnex card) { diff --git a/Mage.Sets/src/mage/cards/c/Counterbalance.java b/Mage.Sets/src/mage/cards/c/Counterbalance.java index 7149248f742..9fb3fc60a8c 100644 --- a/Mage.Sets/src/mage/cards/c/Counterbalance.java +++ b/Mage.Sets/src/mage/cards/c/Counterbalance.java @@ -38,12 +38,11 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; 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; import mage.players.Player; -import mage.util.CardUtil; import java.util.UUID; @@ -58,7 +57,7 @@ public class Counterbalance extends CardImpl { // Whenever an opponent casts a spell, you may reveal the top card of your library. If you do, counter that spell if it has the same converted mana cost as the revealed card. - this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterbalanceEffect(), new FilterSpell(), true, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterbalanceEffect(), StaticFilters.FILTER_SPELL, true, SetTargetPointer.SPELL)); } public Counterbalance(final Counterbalance card) { diff --git a/Mage.Sets/src/mage/cards/c/Countermand.java b/Mage.Sets/src/mage/cards/c/Countermand.java index c87687b8ed2..1a239cfa7d7 100644 --- a/Mage.Sets/src/mage/cards/c/Countermand.java +++ b/Mage.Sets/src/mage/cards/c/Countermand.java @@ -34,7 +34,7 @@ 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.game.Game; import mage.game.stack.StackObject; import mage.players.Player; @@ -53,7 +53,7 @@ public class Countermand extends CardImpl { // Counter target spell. Its controller puts the top four cards of his or her library into his or her graveyard. - this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL)); this.getSpellAbility().addEffect(new CountermandEffect()); } diff --git a/Mage.Sets/src/mage/cards/c/Cursecatcher.java b/Mage.Sets/src/mage/cards/c/Cursecatcher.java index 78352a704d0..5aebc0c8c2c 100644 --- a/Mage.Sets/src/mage/cards/c/Cursecatcher.java +++ b/Mage.Sets/src/mage/cards/c/Cursecatcher.java @@ -36,9 +36,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.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -49,14 +47,6 @@ import java.util.UUID; */ public class Cursecatcher extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public Cursecatcher(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}"); this.subtype.add("Merfolk"); @@ -69,7 +59,7 @@ public class Cursecatcher extends CardImpl { SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(1)), new SacrificeSourceCost()); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java b/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java index 15b7c6c5e7b..8c4627e3401 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfSilence.java @@ -44,7 +44,7 @@ import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -61,7 +61,7 @@ public 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(), + Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, effect, StaticFilters.FILTER_SPELL, 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/d/Disrupt.java b/Mage.Sets/src/mage/cards/d/Disrupt.java index 9b571fcfac6..348fc635c3f 100644 --- a/Mage.Sets/src/mage/cards/d/Disrupt.java +++ b/Mage.Sets/src/mage/cards/d/Disrupt.java @@ -33,9 +33,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -47,19 +45,11 @@ import java.util.UUID; */ public class Disrupt extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public Disrupt(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Counter target instant or sorcery spell unless its controller pays {1}. - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1))); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); diff --git a/Mage.Sets/src/mage/cards/d/DoubleNegative.java b/Mage.Sets/src/mage/cards/d/DoubleNegative.java index d31cc9aaa8b..8032e12df6c 100644 --- a/Mage.Sets/src/mage/cards/d/DoubleNegative.java +++ b/Mage.Sets/src/mage/cards/d/DoubleNegative.java @@ -32,7 +32,7 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -53,7 +53,7 @@ public class DoubleNegative extends CardImpl { Effect effect = new CounterTargetEffect(); effect.setText("Counter up to two target spells"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetSpell(0, 2, new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(0, 2, StaticFilters.FILTER_SPELL)); } public DoubleNegative(final DoubleNegative card) { diff --git a/Mage.Sets/src/mage/cards/d/DualcasterMage.java b/Mage.Sets/src/mage/cards/d/DualcasterMage.java index af01feff424..3d88c72193c 100644 --- a/Mage.Sets/src/mage/cards/d/DualcasterMage.java +++ b/Mage.Sets/src/mage/cards/d/DualcasterMage.java @@ -35,9 +35,7 @@ import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -48,14 +46,6 @@ import java.util.UUID; */ public class DualcasterMage extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public DualcasterMage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}"); this.subtype.add("Human"); @@ -69,7 +59,7 @@ public class DualcasterMage extends CardImpl { // When Dualcaster Mage enters the battlefield, copy target instant or sorcery spell. You may choose new targets for the copy. Ability ability = new EntersBattlefieldTriggeredAbility(new CopyTargetSpellEffect(), false); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/EchoMage.java b/Mage.Sets/src/mage/cards/e/EchoMage.java index 1edc7da3ad8..1253ba42847 100644 --- a/Mage.Sets/src/mage/cards/e/EchoMage.java +++ b/Mage.Sets/src/mage/cards/e/EchoMage.java @@ -43,9 +43,7 @@ import mage.cards.LevelerCard; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.target.TargetSpell; @@ -58,14 +56,6 @@ import java.util.UUID; */ public class EchoMage extends LevelerCard { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public EchoMage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}"); this.subtype.add("Human"); @@ -82,7 +72,7 @@ public class EchoMage extends LevelerCard { // {U}{U}, {tap}: Copy target instant or sorcery spell. You may choose new targets for the copy. Abilities abilities1 = new AbilitiesImpl<>(); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new ManaCostsImpl("{U}{U}")); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); ability.addCost(new TapSourceCost()); abilities1.add(ability); // LEVEL 4+ @@ -90,7 +80,7 @@ public class EchoMage extends LevelerCard { // {U}{U}, {tap}: Copy target instant or sorcery spell twice. You may choose new targets for the copies. Abilities abilities2 = new AbilitiesImpl<>(); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EchoMageEffect(), new ManaCostsImpl("{U}{U}")); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); ability.addCost(new TapSourceCost()); abilities2.add(ability); diff --git a/Mage.Sets/src/mage/cards/f/FerocityOfTheUnderworld.java b/Mage.Sets/src/mage/cards/f/FerocityOfTheUnderworld.java index c24504a8618..a871e01b1e2 100644 --- a/Mage.Sets/src/mage/cards/f/FerocityOfTheUnderworld.java +++ b/Mage.Sets/src/mage/cards/f/FerocityOfTheUnderworld.java @@ -27,7 +27,6 @@ */ package mage.cards.f; -import mage.constants.ComparisonType; import mage.abilities.Mode; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -35,10 +34,9 @@ import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; import mage.filter.common.FilterNonlandPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.target.TargetSpell; import mage.target.common.TargetCardInYourGraveyard; @@ -53,11 +51,9 @@ import java.util.UUID; public class FerocityOfTheUnderworld extends CardImpl { private static final FilterNonlandPermanent filterMode1 = new FilterNonlandPermanent("nonland permanent with converted mana cost 3 or less"); - private static final FilterSpell filterMode2 = new FilterSpell("instant or sorcery spell"); static { filterMode1.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4)); - filterMode2.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); } public FerocityOfTheUnderworld(UUID ownerId, CardSetInfo setInfo) { @@ -70,7 +66,7 @@ public class FerocityOfTheUnderworld extends CardImpl { // Copy target instant or sorcery spell. You may choose new targets for the copy. Mode mode = new Mode(); mode.getEffects().add(new CopyTargetSpellEffect()); - mode.getTargets().add(new TargetSpell(filterMode2)); + mode.getTargets().add(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.getSpellAbility().addMode(mode); // Return target card from your graveyard to your hand. diff --git a/Mage.Sets/src/mage/cards/f/Flusterstorm.java b/Mage.Sets/src/mage/cards/f/Flusterstorm.java index 6e79c2bae10..dee404d226a 100644 --- a/Mage.Sets/src/mage/cards/f/Flusterstorm.java +++ b/Mage.Sets/src/mage/cards/f/Flusterstorm.java @@ -33,9 +33,7 @@ import mage.abilities.keyword.StormAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; import java.util.UUID; @@ -46,18 +44,12 @@ import java.util.UUID; */ public class Flusterstorm extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); - } - public Flusterstorm(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Counter target instant or sorcery spell unless its controller pays {1}. this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManaCostsImpl("{1}"))); - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); // Storm this.addAbility(new StormAbility()); } diff --git a/Mage.Sets/src/mage/cards/f/Fluxcharger.java b/Mage.Sets/src/mage/cards/f/Fluxcharger.java index 6fae10adb52..749116f8301 100644 --- a/Mage.Sets/src/mage/cards/f/Fluxcharger.java +++ b/Mage.Sets/src/mage/cards/f/Fluxcharger.java @@ -35,9 +35,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.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import java.util.UUID; @@ -47,13 +45,6 @@ import java.util.UUID; */ public class Fluxcharger extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public Fluxcharger(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{R}"); this.subtype.add("Weird"); @@ -64,7 +55,7 @@ public class Fluxcharger extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever you cast an instant or sorcery spell, you may switch Fluxcharger's power and toughness until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), filter, true)); + this.addAbility(new SpellCastControllerTriggeredAbility(new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, true)); } diff --git a/Mage.Sets/src/mage/cards/f/ForcedFruition.java b/Mage.Sets/src/mage/cards/f/ForcedFruition.java index 0e7ca4589cf..7d27a9c7710 100644 --- a/Mage.Sets/src/mage/cards/f/ForcedFruition.java +++ b/Mage.Sets/src/mage/cards/f/ForcedFruition.java @@ -34,7 +34,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import java.util.UUID; @@ -50,7 +50,7 @@ public class ForcedFruition extends CardImpl { // Whenever an opponent casts a spell, that player draws seven cards. this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new DrawCardTargetEffect(7), - new FilterSpell(), false, SetTargetPointer.PLAYER)); + StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER)); } public ForcedFruition(final ForcedFruition card) { diff --git a/Mage.Sets/src/mage/cards/g/GlimpseOfNature.java b/Mage.Sets/src/mage/cards/g/GlimpseOfNature.java index 22d51adfcea..b95b15662b3 100644 --- a/Mage.Sets/src/mage/cards/g/GlimpseOfNature.java +++ b/Mage.Sets/src/mage/cards/g/GlimpseOfNature.java @@ -34,8 +34,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.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -66,11 +65,6 @@ public class GlimpseOfNature extends CardImpl { class GlimpseOfNatureTriggeredAbility extends DelayedTriggeredAbility { - private static final FilterSpell filter = new FilterSpell(); - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public GlimpseOfNatureTriggeredAbility() { super(new DrawCardSourceControllerEffect(1), Duration.EndOfTurn, false); } @@ -88,7 +82,7 @@ class GlimpseOfNatureTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, game)) { + if (spell != null && StaticFilters.FILTER_SPELL_A_CREATURE.match(spell, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/i/IceCave.java b/Mage.Sets/src/mage/cards/i/IceCave.java index 228e2d6d4d0..009dc048e89 100644 --- a/Mage.Sets/src/mage/cards/i/IceCave.java +++ b/Mage.Sets/src/mage/cards/i/IceCave.java @@ -29,6 +29,8 @@ package mage.cards.i; import mage.abilities.Ability; import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,13 +38,11 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; 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; import mage.players.Player; -import mage.abilities.costs.Cost; -import mage.abilities.costs.mana.ManaCostsImpl; import java.util.UUID; @@ -57,7 +57,7 @@ public class IceCave extends CardImpl { // Whenever a player casts a spell, any other player may pay that spell's mana cost. If a player does, counter the spell. (Mana cost includes color.) - this.addAbility(new SpellCastAllTriggeredAbility(Zone.BATTLEFIELD, new IceCaveEffect(), new FilterSpell(), false, SetTargetPointer.SPELL)); + this.addAbility(new SpellCastAllTriggeredAbility(Zone.BATTLEFIELD, new IceCaveEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.SPELL)); } public IceCave(final IceCave card) { diff --git a/Mage.Sets/src/mage/cards/i/InsidiousWill.java b/Mage.Sets/src/mage/cards/i/InsidiousWill.java index d7e7d0fa903..63838c28118 100644 --- a/Mage.Sets/src/mage/cards/i/InsidiousWill.java +++ b/Mage.Sets/src/mage/cards/i/InsidiousWill.java @@ -27,7 +27,6 @@ */ package mage.cards.i; -import java.util.UUID; import mage.abilities.Mode; import mage.abilities.effects.common.ChooseNewTargetsTargetEffect; import mage.abilities.effects.common.CopyTargetSpellEffect; @@ -35,25 +34,17 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author fireshoes */ public class InsidiousWill extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public InsidiousWill(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); @@ -74,7 +65,7 @@ public class InsidiousWill extends CardImpl { // Copy target instant or sorcery spell. You may choose new targets for the copy. mode = new Mode(); mode.getEffects().add(new CopyTargetSpellEffect()); - mode.getTargets().add(new TargetSpell(filter)); + mode.getTargets().add(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.getSpellAbility().getModes().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/j/JudgesFamiliar.java b/Mage.Sets/src/mage/cards/j/JudgesFamiliar.java index d69e52b9c1d..faa3ac8d003 100644 --- a/Mage.Sets/src/mage/cards/j/JudgesFamiliar.java +++ b/Mage.Sets/src/mage/cards/j/JudgesFamiliar.java @@ -27,9 +27,6 @@ */ package mage.cards.j; -import java.util.UUID; - -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; @@ -38,26 +35,19 @@ import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LevelX2 */ public class JudgesFamiliar extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public JudgesFamiliar(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W/U}"); this.subtype.add("Bird"); @@ -73,7 +63,7 @@ public class JudgesFamiliar extends CardImpl { SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(1)), new SacrificeSourceCost()); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KaervekTheMerciless.java b/Mage.Sets/src/mage/cards/k/KaervekTheMerciless.java index e711a881bf1..c01971b28bf 100644 --- a/Mage.Sets/src/mage/cards/k/KaervekTheMerciless.java +++ b/Mage.Sets/src/mage/cards/k/KaervekTheMerciless.java @@ -35,7 +35,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -61,7 +61,7 @@ public class KaervekTheMerciless extends CardImpl { this.toughness = new MageInt(4); // Whenever an opponent casts a spell, Kaervek the Merciless deals damage to target creature or player equal to that spell's converted mana cost. - Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new KaervekTheMercilessEffect(), new FilterSpell(), false, SetTargetPointer.SPELL); + Ability ability = new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new KaervekTheMercilessEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.SPELL); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/ManaBreach.java b/Mage.Sets/src/mage/cards/m/ManaBreach.java index 7ce760a31b7..9318ff04875 100644 --- a/Mage.Sets/src/mage/cards/m/ManaBreach.java +++ b/Mage.Sets/src/mage/cards/m/ManaBreach.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -37,7 +36,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -45,6 +44,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author LoneFox @@ -56,7 +57,7 @@ public class ManaBreach extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); // Whenever a player casts a spell, that player returns a land he or she controls to its owner's hand. - this.addAbility(new SpellCastAllTriggeredAbility(new ManaBreachEffect(), new FilterSpell(), false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastAllTriggeredAbility(new ManaBreachEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER)); } public ManaBreach(final ManaBreach card) { diff --git a/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java b/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java index d500fa27a5a..079bd0d6923 100644 --- a/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java +++ b/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,9 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.game.stack.StackObject; @@ -49,20 +46,14 @@ import mage.players.Player; import mage.target.Target; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LevelX2 */ public class MeletisCharlatan extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public MeletisCharlatan(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); this.subtype.add("Human"); @@ -74,7 +65,7 @@ public class MeletisCharlatan extends CardImpl { // {2}{U}, {T}: The controller of target instant or sorcery spell copies it. That player may choose new targets for the copy. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MeletisCharlatanCopyTargetSpellEffect(), new ManaCostsImpl("{2}{U}")); ability.addCost(new TapSourceCost()); - Target target = new TargetSpell(filter); + Target target = new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL); ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MercurialGeists.java b/Mage.Sets/src/mage/cards/m/MercurialGeists.java index afff551fbbd..4c3c3410eea 100644 --- a/Mage.Sets/src/mage/cards/m/MercurialGeists.java +++ b/Mage.Sets/src/mage/cards/m/MercurialGeists.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; @@ -36,9 +35,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -46,14 +45,6 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class MercurialGeists extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public MercurialGeists(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{R}"); this.subtype.add("Spirit"); @@ -64,7 +55,7 @@ public class MercurialGeists extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever you cast an instant or sorcery spell, Mercurial Geists gets +3/+0 until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 0, Duration.EndOfTurn), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 0, Duration.EndOfTurn), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, false)); } public MercurialGeists(final MercurialGeists card) { diff --git a/Mage.Sets/src/mage/cards/m/MinamosMeddling.java b/Mage.Sets/src/mage/cards/m/MinamosMeddling.java index 5aed0d2d4b3..609b657ce45 100644 --- a/Mage.Sets/src/mage/cards/m/MinamosMeddling.java +++ b/Mage.Sets/src/mage/cards/m/MinamosMeddling.java @@ -31,15 +31,11 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SpellAbilityType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.players.Player; @@ -59,7 +55,7 @@ public class MinamosMeddling extends CardImpl { // Counter target spell. That spell's controller reveals his or her hand, then discards each card with the same name as a card spliced onto that spell. - this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL)); this.getSpellAbility().addEffect(new MinamosMeddlingCounterTargetEffect()); } diff --git a/Mage.Sets/src/mage/cards/m/MindsDilation.java b/Mage.Sets/src/mage/cards/m/MindsDilation.java index 3d5ad7e4b2e..aad9499b1d6 100644 --- a/Mage.Sets/src/mage/cards/m/MindsDilation.java +++ b/Mage.Sets/src/mage/cards/m/MindsDilation.java @@ -27,8 +27,6 @@ */ package mage.cards.m; -import java.util.List; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; @@ -40,7 +38,7 @@ 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.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -48,6 +46,9 @@ import mage.players.Player; import mage.target.targetpointer.FixedTarget; import mage.watchers.common.SpellsCastWatcher; +import java.util.List; +import java.util.UUID; + /** * * @author fireshoes @@ -75,7 +76,7 @@ public class MindsDilation extends CardImpl { class MindsDilationTriggeredAbility extends SpellCastOpponentTriggeredAbility { public MindsDilationTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, new FilterSpell(), optional); + super(Zone.BATTLEFIELD, effect, StaticFilters.FILTER_SPELL, optional); } public MindsDilationTriggeredAbility(SpellCastOpponentTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/cards/m/MischievousQuanar.java b/Mage.Sets/src/mage/cards/m/MischievousQuanar.java index 3d20a6cc9cd..936d6f739c4 100644 --- a/Mage.Sets/src/mage/cards/m/MischievousQuanar.java +++ b/Mage.Sets/src/mage/cards/m/MischievousQuanar.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -42,24 +41,16 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author fireshoes */ public class MischievousQuanar extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } public MischievousQuanar(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}"); @@ -79,7 +70,7 @@ public class MischievousQuanar extends CardImpl { Effect effect2 = new CopyTargetSpellEffect(); effect2.setText("copy target instant or sorcery spell. You may choose new targets for that copy"); Ability ability = new TurnedFaceUpSourceTriggeredAbility(effect2); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MoltenInfluence.java b/Mage.Sets/src/mage/cards/m/MoltenInfluence.java index f1e02c3fb74..ae998627326 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenInfluence.java +++ b/Mage.Sets/src/mage/cards/m/MoltenInfluence.java @@ -27,40 +27,31 @@ */ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.players.Player; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author cbt33, LevelX2 (Quash) */ public class MoltenInfluence extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY)); - } - public MoltenInfluence(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); // Counter target instant or sorcery spell unless its controller has Molten Influence deal 4 damage to him or her. - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.getSpellAbility().addEffect(new MoltenInfluenceEffect()); } diff --git a/Mage.Sets/src/mage/cards/n/NiblisOfFrost.java b/Mage.Sets/src/mage/cards/n/NiblisOfFrost.java index 120870dedd1..3e22f958494 100644 --- a/Mage.Sets/src/mage/cards/n/NiblisOfFrost.java +++ b/Mage.Sets/src/mage/cards/n/NiblisOfFrost.java @@ -27,7 +27,6 @@ */ package mage.cards.n; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; @@ -39,27 +38,22 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** * * @author fireshoes */ public class NiblisOfFrost extends CardImpl { - - private static final FilterSpell filterSpell = new FilterSpell("instant or sorcery spell"); private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature an opponent controls"); static { filterCreature.add(new ControllerPredicate(TargetController.OPPONENT)); - filterSpell.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); } public NiblisOfFrost(UUID ownerId, CardSetInfo setInfo) { @@ -75,7 +69,7 @@ public class NiblisOfFrost extends CardImpl { this.addAbility(new ProwessAbility()); // Whenever you cast an instant or sorcery spell, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step. - Ability ability = new SpellCastControllerTriggeredAbility(new TapTargetEffect(), filterSpell, false); + Ability ability = new SpellCastControllerTriggeredAbility(new TapTargetEffect(), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, false); ability.addTarget(new TargetCreaturePermanent(filterCreature)); ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect("That creature")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/o/OddsEnds.java b/Mage.Sets/src/mage/cards/o/OddsEnds.java index e7e0fd23916..3445100988d 100644 --- a/Mage.Sets/src/mage/cards/o/OddsEnds.java +++ b/Mage.Sets/src/mage/cards/o/OddsEnds.java @@ -27,7 +27,6 @@ */ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyTargetSpellEffect; @@ -37,32 +36,24 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SpellAbilityType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterAttackingCreature; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.TargetSpell; +import java.util.UUID; + public class OddsEnds extends SplitCard { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public OddsEnds(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{R}", "{3}{R}{W}", SpellAbilityType.SPLIT); // Odds // Flip a coin. If it comes up heads, counter target instant or sorcery spell. If it comes up tails, copy that spell and you may choose new targets for the copy. getLeftHalfCard().getSpellAbility().addEffect(new OddsEffect()); - getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filter)); + getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); // Ends // Target player sacrifices two attacking creatures. diff --git a/Mage.Sets/src/mage/cards/o/Outwit.java b/Mage.Sets/src/mage/cards/o/Outwit.java index 0d0d0156dbd..5722bfad1ed 100644 --- a/Mage.Sets/src/mage/cards/o/Outwit.java +++ b/Mage.Sets/src/mage/cards/o/Outwit.java @@ -35,6 +35,7 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.game.stack.StackObject; @@ -79,7 +80,7 @@ public class Outwit extends CardImpl { protected FilterSpell filter; public CustomTargetSpell() { - this(1, 1, new FilterSpell()); + this(1, 1, StaticFilters.FILTER_SPELL); } public CustomTargetSpell(FilterSpell filter) { diff --git a/Mage.Sets/src/mage/cards/p/PainfulQuandary.java b/Mage.Sets/src/mage/cards/p/PainfulQuandary.java index 2dfae425b46..b48b1210e36 100644 --- a/Mage.Sets/src/mage/cards/p/PainfulQuandary.java +++ b/Mage.Sets/src/mage/cards/p/PainfulQuandary.java @@ -27,7 +27,6 @@ */ package mage.cards.p; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; import mage.abilities.costs.Cost; @@ -39,11 +38,13 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInHand; +import java.util.UUID; + /** * * @author BetaSteward_at_googlemail.com @@ -54,7 +55,7 @@ public class PainfulQuandary extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}"); // Whenever an opponent casts a spell, that player loses 5 life unless he or she discards a card. - this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new PainfulQuandryEffect(), new FilterSpell(), false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new PainfulQuandryEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER)); } public PainfulQuandary(final PainfulQuandary card) { diff --git a/Mage.Sets/src/mage/cards/p/PardicDragon.java b/Mage.Sets/src/mage/cards/p/PardicDragon.java index 159adf9793d..74f85021159 100644 --- a/Mage.Sets/src/mage/cards/p/PardicDragon.java +++ b/Mage.Sets/src/mage/cards/p/PardicDragon.java @@ -44,7 +44,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.counters.CounterType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -71,7 +71,7 @@ public class PardicDragon extends CardImpl { this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{R}{R}"), this, true)); // Whenever an opponent casts a spell, if Pardic Dragon is suspended, that player may put a time counter on Pardic Dragon. this.addAbility(new ConditionalTriggeredAbility( - new SpellCastOpponentTriggeredAbility(Zone.EXILED, new PardicDragonEffect(), new FilterSpell(), false, SetTargetPointer.PLAYER), + new SpellCastOpponentTriggeredAbility(Zone.EXILED, new PardicDragonEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER), SuspendedCondition.instance, "Whenever an opponent casts a spell, if {this} is suspended, that player may put a time counter on {this}." )); diff --git a/Mage.Sets/src/mage/cards/p/PrescientChimera.java b/Mage.Sets/src/mage/cards/p/PrescientChimera.java index 926310998b2..ed7939845e0 100644 --- a/Mage.Sets/src/mage/cards/p/PrescientChimera.java +++ b/Mage.Sets/src/mage/cards/p/PrescientChimera.java @@ -27,7 +27,6 @@ */ package mage.cards.p; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.keyword.ScryEffect; @@ -35,9 +34,9 @@ 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.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -45,13 +44,6 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class PrescientChimera extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public PrescientChimera(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}"); this.subtype.add("Chimera"); @@ -62,7 +54,7 @@ public class PrescientChimera extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever you cast an instant or sorcery spell, scry 1. - this.addAbility(new SpellCastControllerTriggeredAbility(new ScryEffect(1), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new ScryEffect(1), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, false)); } public PrescientChimera(final PrescientChimera card) { diff --git a/Mage.Sets/src/mage/cards/p/PsychicStrike.java b/Mage.Sets/src/mage/cards/p/PsychicStrike.java index d4df7478e78..694897aee70 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicStrike.java +++ b/Mage.Sets/src/mage/cards/p/PsychicStrike.java @@ -27,20 +27,21 @@ */ package mage.cards.p; -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.FilterSpell; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.StackObject; import mage.players.Player; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LevelX2 @@ -52,7 +53,7 @@ public class PsychicStrike extends CardImpl { // Counter target spell. Its controller puts the top two cards of his or her library into his or her graveyard. - this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL)); this.getSpellAbility().addEffect(new PsychicStrikeEffect()); } diff --git a/Mage.Sets/src/mage/cards/p/PunishIgnorance.java b/Mage.Sets/src/mage/cards/p/PunishIgnorance.java index 6cecac6dfd3..b740fa6d505 100644 --- a/Mage.Sets/src/mage/cards/p/PunishIgnorance.java +++ b/Mage.Sets/src/mage/cards/p/PunishIgnorance.java @@ -27,17 +27,18 @@ */ package mage.cards.p; -import java.util.UUID; import mage.abilities.effects.Effect; -import mage.constants.CardType; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.FilterSpell; +import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author North @@ -49,7 +50,7 @@ public class PunishIgnorance extends CardImpl { // Counter target spell. Its controller loses 3 life and you gain 3 life. - this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL)); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new LoseLifeTargetControllerEffect(3)); Effect effect = new GainLifeEffect(3); diff --git a/Mage.Sets/src/mage/cards/q/Quash.java b/Mage.Sets/src/mage/cards/q/Quash.java index 4d1340e534f..f377c144e62 100644 --- a/Mage.Sets/src/mage/cards/q/Quash.java +++ b/Mage.Sets/src/mage/cards/q/Quash.java @@ -27,37 +27,28 @@ */ package mage.cards.q; -import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.CounterTargetAndSearchGraveyardHandLibraryEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LevelX2 */ public class Quash extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY)); - } - public Quash(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); // Counter target instant or sorcery spell. // Search its controller's graveyard, hand, and library for all cards with the same name as that spell and exile them. Then that player shuffles his or her library. - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.getSpellAbility().addEffect(new CounterTargetAndSearchGraveyardHandLibraryEffect()); } diff --git a/Mage.Sets/src/mage/cards/r/RhysticStudy.java b/Mage.Sets/src/mage/cards/r/RhysticStudy.java index 41e2e18fda5..c1a45897116 100644 --- a/Mage.Sets/src/mage/cards/r/RhysticStudy.java +++ b/Mage.Sets/src/mage/cards/r/RhysticStudy.java @@ -27,7 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; @@ -40,10 +39,12 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author Quercitron @@ -54,7 +55,7 @@ public class RhysticStudy extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); // Whenever an opponent casts a spell, you may draw a card unless that player pays {1}. - this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new RhysticStudyDrawEffect(), new FilterSpell(), false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new RhysticStudyDrawEffect(), StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER)); } public RhysticStudy(final RhysticStudy card) { diff --git a/Mage.Sets/src/mage/cards/s/SigilTracer.java b/Mage.Sets/src/mage/cards/s/SigilTracer.java index 4db7443ecef..694f562c3fe 100644 --- a/Mage.Sets/src/mage/cards/s/SigilTracer.java +++ b/Mage.Sets/src/mage/cards/s/SigilTracer.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,29 +38,26 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** * @author Loki */ public class SigilTracer extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Wizards you control"); - private static final FilterSpell filterInstorSorc = new FilterSpell("instant or sorcery spell"); static { filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate(SubType.WIZARD)); - filterInstorSorc.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); } public SigilTracer(UUID ownerId, CardSetInfo setInfo) { @@ -74,7 +70,7 @@ public class SigilTracer extends CardImpl { // {1}{U}, Tap two untapped Wizards you control: Copy target instant or sorcery spell. You may choose new targets for the copy. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new ManaCostsImpl("{1}{U}")); - ability.addTarget(new TargetSpell(filterInstorSorc)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SoulBarrier.java b/Mage.Sets/src/mage/cards/s/SoulBarrier.java index 050153f01ab..b93b14dafe9 100644 --- a/Mage.Sets/src/mage/cards/s/SoulBarrier.java +++ b/Mage.Sets/src/mage/cards/s/SoulBarrier.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -39,10 +37,12 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author Galatolol @@ -53,8 +53,8 @@ public class SoulBarrier extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); // Whenever an opponent casts a creature spell, Soul Barrier deals 2 damage to that player unless he or she pays {2}. - this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new SoulBarrierEffect(), - new FilterSpell(),false, SetTargetPointer.PLAYER)); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new SoulBarrierEffect(), + StaticFilters.FILTER_SPELL,false, SetTargetPointer.PLAYER)); } public SoulBarrier(final SoulBarrier card) { diff --git a/Mage.Sets/src/mage/cards/s/SpelltitheEnforcer.java b/Mage.Sets/src/mage/cards/s/SpelltitheEnforcer.java index d2c05e3b0f2..f8ffdb87296 100644 --- a/Mage.Sets/src/mage/cards/s/SpelltitheEnforcer.java +++ b/Mage.Sets/src/mage/cards/s/SpelltitheEnforcer.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; @@ -39,10 +38,12 @@ import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author LevelX2 @@ -60,7 +61,7 @@ public class SpelltitheEnforcer extends CardImpl { this.addAbility(new SpellCastOpponentTriggeredAbility( Zone.BATTLEFIELD, new SpelltitheEnforcerEffect(), - new FilterSpell(), + StaticFilters.FILTER_SPELL, false, SetTargetPointer.PLAYER )); diff --git a/Mage.Sets/src/mage/cards/s/SplitDecision.java b/Mage.Sets/src/mage/cards/s/SplitDecision.java index cb123a7ef93..1fa440fc0c8 100644 --- a/Mage.Sets/src/mage/cards/s/SplitDecision.java +++ b/Mage.Sets/src/mage/cards/s/SplitDecision.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyTargetSpellEffect; @@ -35,33 +34,25 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author fireshoes */ public class SplitDecision extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public SplitDecision(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); // Will of the council - Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy. this.getSpellAbility().addEffect(new SplitDecisionEffect()); - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); } public SplitDecision(final SplitDecision card) { diff --git a/Mage.Sets/src/mage/cards/s/StratusDancer.java b/Mage.Sets/src/mage/cards/s/StratusDancer.java index dd3b1c2df50..0018b7cf585 100644 --- a/Mage.Sets/src/mage/cards/s/StratusDancer.java +++ b/Mage.Sets/src/mage/cards/s/StratusDancer.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; @@ -39,23 +38,16 @@ import mage.abilities.keyword.MorphAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author jeffwadsworth */ public class StratusDancer extends CardImpl { - - private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } public StratusDancer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); @@ -74,7 +66,7 @@ public class StratusDancer extends CardImpl { Effect effect = new CounterTargetEffect(); effect.setText("counter target instant or sorcery spell"); Ability ability = new TurnedFaceUpSourceTriggeredAbility(effect, false); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/Tephraderm.java b/Mage.Sets/src/mage/cards/t/Tephraderm.java index 8b08f37e3c7..3191fc5d81d 100644 --- a/Mage.Sets/src/mage/cards/t/Tephraderm.java +++ b/Mage.Sets/src/mage/cards/t/Tephraderm.java @@ -27,7 +27,6 @@ */ package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; @@ -38,7 +37,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.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -46,6 +45,8 @@ import mage.game.permanent.Permanent; import mage.game.stack.StackObject; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author Quercitron @@ -125,8 +126,6 @@ class TephradermCreatureDamageTriggeredAbility extends TriggeredAbilityImpl { class TephradermSpellDamageTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterSpell FILTER_SPELL = new FilterSpell(); - public TephradermSpellDamageTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(0)); } @@ -147,7 +146,7 @@ class TephradermSpellDamageTriggeredAbility extends TriggeredAbilityImpl { } StackObject sourceSpell = game.getStack().getStackObject(event.getSourceId()); - if (sourceSpell != null && FILTER_SPELL.match(sourceSpell, getSourceId(), getControllerId(), game)) { + if (sourceSpell != null && StaticFilters.FILTER_SPELL.match(sourceSpell, getSourceId(), getControllerId(), game)) { for (Effect effect : getEffects()) { if (effect instanceof DamageTargetEffect) { effect.setTargetPointer(new FixedTarget(sourceSpell.getControllerId())); diff --git a/Mage.Sets/src/mage/cards/t/Twincast.java b/Mage.Sets/src/mage/cards/t/Twincast.java index f7748ec571d..3af0001537a 100644 --- a/Mage.Sets/src/mage/cards/t/Twincast.java +++ b/Mage.Sets/src/mage/cards/t/Twincast.java @@ -27,36 +27,27 @@ */ package mage.cards.t; -import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author Loki */ public class Twincast extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public Twincast(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{U}"); // Copy target instant or sorcery spell. You may choose new targets for the copy. this.getSpellAbility().addEffect(new CopyTargetSpellEffect()); - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); } public Twincast(final Twincast card) { diff --git a/Mage.Sets/src/mage/cards/u/Undermine.java b/Mage.Sets/src/mage/cards/u/Undermine.java index 13965dc7135..9f6910dc9e7 100644 --- a/Mage.Sets/src/mage/cards/u/Undermine.java +++ b/Mage.Sets/src/mage/cards/u/Undermine.java @@ -27,15 +27,16 @@ */ package mage.cards.u; -import java.util.UUID; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.LoseLifeTargetControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LevelX2 @@ -47,7 +48,7 @@ public class Undermine extends CardImpl { // Counter target spell. Its controller loses 3 life. - this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL)); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new LoseLifeTargetControllerEffect(3)); diff --git a/Mage.Sets/src/mage/cards/u/UyoSilentProphet.java b/Mage.Sets/src/mage/cards/u/UyoSilentProphet.java index 62b3693d690..ecb14a3d781 100644 --- a/Mage.Sets/src/mage/cards/u/UyoSilentProphet.java +++ b/Mage.Sets/src/mage/cards/u/UyoSilentProphet.java @@ -39,10 +39,8 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -54,14 +52,6 @@ import java.util.UUID; */ public class UyoSilentProphet extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public UyoSilentProphet(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}{U}"); addSuperType(SuperType.LEGENDARY); @@ -76,7 +66,7 @@ public class UyoSilentProphet extends CardImpl { // {2}, Return two lands you control to their owner's hand: Copy target instant or sorcery spell. You may choose new targets for the copy. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new GenericManaCost(2)); ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false))); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/v/VodalianMystic.java b/Mage.Sets/src/mage/cards/v/VodalianMystic.java index f9418d1ebe1..937160a3d35 100644 --- a/Mage.Sets/src/mage/cards/v/VodalianMystic.java +++ b/Mage.Sets/src/mage/cards/v/VodalianMystic.java @@ -27,7 +27,6 @@ */ package mage.cards.v; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -38,25 +37,17 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetSpell; +import java.util.UUID; + /** * * @author LoneFox */ public class VodalianMystic extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public VodalianMystic(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); this.subtype.add("Merfolk"); @@ -66,7 +57,7 @@ public class VodalianMystic extends CardImpl { // {T}: Target instant or sorcery spell becomes the color of your choice. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.WhileOnStack), new TapSourceCost()); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/y/YoungPyromancer.java b/Mage.Sets/src/mage/cards/y/YoungPyromancer.java index 84f2f5867f2..5e14f37823f 100644 --- a/Mage.Sets/src/mage/cards/y/YoungPyromancer.java +++ b/Mage.Sets/src/mage/cards/y/YoungPyromancer.java @@ -27,32 +27,23 @@ */ package mage.cards.y; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.permanent.token.YoungPyromancerElementalToken; +import java.util.UUID; + /** * * @author jeffwadsworth */ public class YoungPyromancer extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public YoungPyromancer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.subtype.add("Human"); @@ -62,7 +53,7 @@ public class YoungPyromancer extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast an instant or sorcery spell, create a 1/1 red Elemental creature token. - this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new YoungPyromancerElementalToken()), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new YoungPyromancerElementalToken()), StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL, false)); } diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index 29845d96e5b..c1e483585b9 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -51,6 +51,10 @@ public final class StaticFilters { public static final FilterSpell FILTER_SPELL_NON_CREATURE = (FilterSpell) new FilterSpell("noncreature spell").add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + public static final FilterSpell FILTER_SPELL = new FilterSpell(); + + public static final FilterSpell FILTER_INSTANT_OR_SORCERY_SPELL = new FilterSpell("instant or sorcery spell"); + public static final FilterPermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens"); public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures"); @@ -87,6 +91,11 @@ public final class StaticFilters { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE) )); + + FILTER_INSTANT_OR_SORCERY_SPELL.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY) + )); } } diff --git a/Mage/src/main/java/mage/target/TargetSpell.java b/Mage/src/main/java/mage/target/TargetSpell.java index 9495b4dbec4..bc11f5e28c4 100644 --- a/Mage/src/main/java/mage/target/TargetSpell.java +++ b/Mage/src/main/java/mage/target/TargetSpell.java @@ -30,6 +30,7 @@ package mage.target; import mage.abilities.Ability; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.Spell; import mage.game.stack.StackObject; @@ -49,7 +50,7 @@ public class TargetSpell extends TargetObject { private final Set sourceIds = new HashSet<>(); public TargetSpell() { - this(1, 1, new FilterSpell()); + this(1, 1, StaticFilters.FILTER_SPELL); } public TargetSpell(FilterSpell filter) { From f2aa948c74dd44119a8935db043349ddac1c44c7 Mon Sep 17 00:00:00 2001 From: igoudt Date: Tue, 11 Jul 2017 00:18:24 +0200 Subject: [PATCH 02/29] refactor filters to staticfilters --- Mage.Sets/src/mage/cards/a/AcidicSoil.java | 4 +- Mage.Sets/src/mage/cards/a/Armageddon.java | 4 +- .../src/mage/cards/b/BlanketOfNight.java | 3 +- Mage.Sets/src/mage/cards/b/BoomBust.java | 6 ++- Mage.Sets/src/mage/cards/b/BurningSands.java | 5 +-- .../src/mage/cards/c/ChromaticLantern.java | 4 +- .../src/mage/cards/c/ConcealedCourtyard.java | 6 +-- .../src/mage/cards/c/CopperlineGorge.java | 9 ++--- .../mage/cards/d/DecreeOfAnnihilation.java | 38 +++++++++---------- .../src/mage/cards/d/DesolationAngel.java | 4 +- Mage.Sets/src/mage/cards/f/FoulSpirit.java | 4 +- Mage.Sets/src/mage/cards/g/GiftOfEstates.java | 4 +- .../src/mage/cards/g/GiltLeafArchdruid.java | 4 +- Mage.Sets/src/mage/cards/g/GlobalRuin.java | 4 +- Mage.Sets/src/mage/cards/g/GoblinFirebug.java | 4 +- Mage.Sets/src/mage/cards/g/GulfSquid.java | 4 +- .../src/mage/cards/h/HokoriDustDrinker.java | 3 +- .../src/mage/cards/i/InspiringVantage.java | 13 +++---- Mage.Sets/src/mage/cards/j/JoinerAdept.java | 10 ++--- .../mage/cards/k/KnightOfTheWhiteOrchid.java | 9 +++-- .../src/mage/cards/l/LandEquilibrium.java | 13 +++---- Mage.Sets/src/mage/cards/l/LandTax.java | 7 ++-- Mage.Sets/src/mage/cards/l/LavaballTrap.java | 9 +++-- .../src/mage/cards/l/LiegeOfTheTangle.java | 4 +- Mage.Sets/src/mage/cards/l/LivingPlane.java | 7 ++-- .../mage/cards/m/MagusOfTheCandelabra.java | 7 ++-- Mage.Sets/src/mage/cards/m/ManaShort.java | 7 ++-- Mage.Sets/src/mage/cards/m/ManaVortex.java | 11 +++--- Mage.Sets/src/mage/cards/m/MishrasHelix.java | 7 ++-- .../src/mage/cards/m/MistbindClique.java | 7 ++-- .../mage/cards/m/MyojinOfInfiniteRage.java | 6 +-- Mage.Sets/src/mage/cards/n/NaturesWill.java | 5 +-- .../src/mage/cards/n/NissaSageAnimist.java | 7 ++-- .../src/mage/cards/n/NumotTheDevastator.java | 4 +- Mage.Sets/src/mage/cards/p/PlowUnder.java | 7 ++-- Mage.Sets/src/mage/cards/r/RavagesOfWar.java | 7 ++-- .../src/mage/cards/r/RazorvergeThicket.java | 12 +++--- Mage.Sets/src/mage/cards/r/RisingWaters.java | 12 +++--- Mage.Sets/src/mage/cards/r/Rivalry.java | 14 +++---- .../src/mage/cards/r/RuinousMinotaur.java | 9 +++-- .../src/mage/cards/s/SeachromeCoast.java | 13 +++---- Mage.Sets/src/mage/cards/s/SeedTheLand.java | 7 ++-- Mage.Sets/src/mage/cards/s/SerendibDjinn.java | 6 +-- .../src/mage/cards/s/ShelteredValley.java | 12 +++--- .../src/mage/cards/s/SpirebluffCanal.java | 10 ++--- Mage.Sets/src/mage/cards/s/StoneRain.java | 9 +++-- .../src/mage/cards/s/StructuralCollapse.java | 9 +++-- Mage.Sets/src/mage/cards/s/Sunder.java | 7 ++-- Mage.Sets/src/mage/cards/t/TectonicEdge.java | 9 +++-- .../src/mage/cards/t/TectonicInstability.java | 6 ++- .../src/mage/cards/t/TreacherousTerrain.java | 9 +++-- .../src/mage/cards/w/WeatheredWayfarer.java | 11 +++--- .../src/mage/cards/w/WoodbornBehemoth.java | 9 +++-- .../main/java/mage/filter/StaticFilters.java | 5 +++ 54 files changed, 218 insertions(+), 208 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AcidicSoil.java b/Mage.Sets/src/mage/cards/a/AcidicSoil.java index 28587b2cad8..149821c7fbc 100644 --- a/Mage.Sets/src/mage/cards/a/AcidicSoil.java +++ b/Mage.Sets/src/mage/cards/a/AcidicSoil.java @@ -33,7 +33,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -78,7 +78,7 @@ class AcidicSoilEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game); for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/a/Armageddon.java b/Mage.Sets/src/mage/cards/a/Armageddon.java index 01783d32168..8eda2a39add 100644 --- a/Mage.Sets/src/mage/cards/a/Armageddon.java +++ b/Mage.Sets/src/mage/cards/a/Armageddon.java @@ -31,7 +31,7 @@ import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import java.util.UUID; @@ -46,7 +46,7 @@ public class Armageddon extends CardImpl { // Destroy all lands. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands"))); + this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS)); } public Armageddon(final Armageddon card) { diff --git a/Mage.Sets/src/mage/cards/b/BlanketOfNight.java b/Mage.Sets/src/mage/cards/b/BlanketOfNight.java index 3daf758aab0..8532cec6a8b 100644 --- a/Mage.Sets/src/mage/cards/b/BlanketOfNight.java +++ b/Mage.Sets/src/mage/cards/b/BlanketOfNight.java @@ -38,6 +38,7 @@ import mage.constants.CardType; import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import java.util.UUID; @@ -55,7 +56,7 @@ public class BlanketOfNight extends CardImpl { // Each land is a Swamp in addition to its other land types. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new BlackManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(), "Each land is a Swamp in addition to its other land types")); - ability.addEffect(new AddCardSubtypeAllEffect(new FilterLandPermanent(), "Swamp", DependencyType.BecomeSwamp)); + ability.addEffect(new AddCardSubtypeAllEffect(StaticFilters.FILTER_LAND, "Swamp", DependencyType.BecomeSwamp)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BoomBust.java b/Mage.Sets/src/mage/cards/b/BoomBust.java index 7edf763ed8d..01272520d1e 100644 --- a/Mage.Sets/src/mage/cards/b/BoomBust.java +++ b/Mage.Sets/src/mage/cards/b/BoomBust.java @@ -27,7 +27,6 @@ */ package mage.cards.b; -import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -36,10 +35,13 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.SpellAbilityType; import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; +import java.util.UUID; + public class BoomBust extends SplitCard { private static final FilterLandPermanent filter1 = new FilterLandPermanent("land you control"); @@ -63,7 +65,7 @@ public class BoomBust extends SplitCard { // Bust // Destroy all lands. - getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent())); + getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS)); } diff --git a/Mage.Sets/src/mage/cards/b/BurningSands.java b/Mage.Sets/src/mage/cards/b/BurningSands.java index a6bec6f2c9c..f001bcfe42e 100644 --- a/Mage.Sets/src/mage/cards/b/BurningSands.java +++ b/Mage.Sets/src/mage/cards/b/BurningSands.java @@ -34,7 +34,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -48,13 +48,12 @@ import java.util.UUID; public class BurningSands extends CardImpl { private final UUID originalId; - private static final FilterLandPermanent filter = new FilterLandPermanent(); public BurningSands(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}"); // Whenever a creature dies, that creature's controller sacrifices a land. - Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true); + Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that creature's controller"), false, false, true); originalId = ability.getOriginalId(); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/ChromaticLantern.java b/Mage.Sets/src/mage/cards/c/ChromaticLantern.java index d1d4965a3dd..0cfd3398974 100644 --- a/Mage.Sets/src/mage/cards/c/ChromaticLantern.java +++ b/Mage.Sets/src/mage/cards/c/ChromaticLantern.java @@ -35,7 +35,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import java.util.UUID; @@ -48,7 +48,7 @@ public class ChromaticLantern extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // Lands you control have "{T}: Add one mana of any color to your mana pool." - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent("Lands"), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_LANDS, false))); // {T}: Add one mana of any color to your mana pool. this.addAbility(new AnyColorManaAbility()); diff --git a/Mage.Sets/src/mage/cards/c/ConcealedCourtyard.java b/Mage.Sets/src/mage/cards/c/ConcealedCourtyard.java index 5a43f451a4c..2fa58106b70 100644 --- a/Mage.Sets/src/mage/cards/c/ConcealedCourtyard.java +++ b/Mage.Sets/src/mage/cards/c/ConcealedCourtyard.java @@ -27,7 +27,6 @@ */ package mage.cards.c; -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -39,7 +38,8 @@ import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; import java.util.UUID; @@ -53,7 +53,7 @@ public class ConcealedCourtyard extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // Concealed Courtyard enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tapped unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); diff --git a/Mage.Sets/src/mage/cards/c/CopperlineGorge.java b/Mage.Sets/src/mage/cards/c/CopperlineGorge.java index e8009154d02..35bce7dc386 100644 --- a/Mage.Sets/src/mage/cards/c/CopperlineGorge.java +++ b/Mage.Sets/src/mage/cards/c/CopperlineGorge.java @@ -27,7 +27,6 @@ */ package mage.cards.c; -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -39,7 +38,8 @@ import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; import java.util.UUID; @@ -48,14 +48,11 @@ import java.util.UUID; * @author maurer.it_at_gmail.com */ public class CopperlineGorge extends CardImpl { - - private static FilterLandPermanent filter = new FilterLandPermanent(); - public CopperlineGorge(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},null); // Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tapped unless you control two or fewer other lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new RedManaAbility()); diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfAnnihilation.java b/Mage.Sets/src/mage/cards/d/DecreeOfAnnihilation.java index 8d2998961b1..b4df27f0344 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfAnnihilation.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfAnnihilation.java @@ -28,25 +28,25 @@ package mage.cards.d; import mage.abilities.Ability; - import mage.abilities.common.CycleTriggeredAbility; - import mage.abilities.costs.mana.ManaCostsImpl; - import mage.abilities.effects.OneShotEffect; - import mage.abilities.effects.common.DestroyAllEffect; - import mage.abilities.keyword.CyclingAbility; - import mage.cards.Card; - import mage.cards.CardImpl; - import mage.cards.CardSetInfo; - import mage.constants.CardType; - import mage.constants.Outcome; - import mage.filter.FilterPermanent; - import mage.filter.common.FilterLandPermanent; - import mage.filter.predicate.Predicates; - import mage.filter.predicate.mageobject.CardTypePredicate; - import mage.game.Game; - import mage.game.permanent.Permanent; - import mage.players.Player; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; - import java.util.UUID; +import java.util.UUID; /** * @@ -64,7 +64,7 @@ public class DecreeOfAnnihilation extends CardImpl { this.addAbility(new CyclingAbility(new ManaCostsImpl("{5}{R}{R}"))); // When you cycle Decree of Annihilation, destroy all lands. - Ability ability = new CycleTriggeredAbility(new DestroyAllEffect(new FilterLandPermanent("lands")), false); + Ability ability = new CycleTriggeredAbility(new DestroyAllEffect(StaticFilters.FILTER_LANDS), false); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DesolationAngel.java b/Mage.Sets/src/mage/cards/d/DesolationAngel.java index 6de8b95a9f6..2e8c6307cb4 100644 --- a/Mage.Sets/src/mage/cards/d/DesolationAngel.java +++ b/Mage.Sets/src/mage/cards/d/DesolationAngel.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; @@ -48,7 +49,6 @@ import java.util.UUID; */ public class DesolationAngel extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("lands"); private static final FilterLandPermanent filter2 = new FilterLandPermanent("lands you control"); static { @@ -69,7 +69,7 @@ public class DesolationAngel extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Desolation Angel enters the battlefield, destroy all lands you control. If it was kicked, destroy all lands instead. - this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(filter), + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS), new DestroyAllEffect(filter2), KickedCondition.instance, "destroy all lands you control. If it was kicked, destroy all lands instead."))); } diff --git a/Mage.Sets/src/mage/cards/f/FoulSpirit.java b/Mage.Sets/src/mage/cards/f/FoulSpirit.java index cf8a297cb27..5deb57ba9b1 100644 --- a/Mage.Sets/src/mage/cards/f/FoulSpirit.java +++ b/Mage.Sets/src/mage/cards/f/FoulSpirit.java @@ -34,7 +34,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import java.util.UUID; @@ -54,7 +54,7 @@ public class FoulSpirit extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Foul Spirit enters the battlefield, sacrifice a land. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false)); } public FoulSpirit(final FoulSpirit card) { diff --git a/Mage.Sets/src/mage/cards/g/GiftOfEstates.java b/Mage.Sets/src/mage/cards/g/GiftOfEstates.java index 1d29a6303be..ac340a1789f 100644 --- a/Mage.Sets/src/mage/cards/g/GiftOfEstates.java +++ b/Mage.Sets/src/mage/cards/g/GiftOfEstates.java @@ -35,7 +35,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterCard; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -61,7 +61,7 @@ public class GiftOfEstates extends CardImpl { // If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, filter), true), - new OpponentControlsMoreCondition(new FilterLandPermanent("lands")))); + new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS))); } public GiftOfEstates(final GiftOfEstates card) { diff --git a/Mage.Sets/src/mage/cards/g/GiltLeafArchdruid.java b/Mage.Sets/src/mage/cards/g/GiltLeafArchdruid.java index 43e8951c60e..95173b41145 100644 --- a/Mage.Sets/src/mage/cards/g/GiltLeafArchdruid.java +++ b/Mage.Sets/src/mage/cards/g/GiltLeafArchdruid.java @@ -39,8 +39,8 @@ 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.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -108,7 +108,7 @@ class GainControlAllLandsEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (targetPlayer != null && targetPlayer.isInGame()) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), targetPointer.getFirst(game, source), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LANDS, targetPointer.getFirst(game, source), game)) { if (permanent != null) { permanent.changeControllerId(source.getControllerId(), game); } diff --git a/Mage.Sets/src/mage/cards/g/GlobalRuin.java b/Mage.Sets/src/mage/cards/g/GlobalRuin.java index 0bc382a9152..94b8942ddb8 100644 --- a/Mage.Sets/src/mage/cards/g/GlobalRuin.java +++ b/Mage.Sets/src/mage/cards/g/GlobalRuin.java @@ -35,8 +35,8 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.SubTypeSet; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -104,7 +104,7 @@ class GlobalRuinDestroyLandEffect extends OneShotEffect { } } } - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, game)) { if (!lands.contains(permanent.getId())) { permanent.sacrifice(permanent.getId(), game); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinFirebug.java b/Mage.Sets/src/mage/cards/g/GoblinFirebug.java index 752cc5e2da2..5139a3bb5a3 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinFirebug.java +++ b/Mage.Sets/src/mage/cards/g/GoblinFirebug.java @@ -33,7 +33,7 @@ import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import java.util.UUID; @@ -50,7 +50,7 @@ public class GoblinFirebug extends CardImpl { this.toughness = new MageInt(2); // When Goblin Firebug leaves the battlefield, sacrifice a land. - this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false)); } public GoblinFirebug(final GoblinFirebug card) { diff --git a/Mage.Sets/src/mage/cards/g/GulfSquid.java b/Mage.Sets/src/mage/cards/g/GulfSquid.java index 6561bfe9311..16a46aeac43 100644 --- a/Mage.Sets/src/mage/cards/g/GulfSquid.java +++ b/Mage.Sets/src/mage/cards/g/GulfSquid.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.target.TargetPlayer; import java.util.UUID; @@ -53,7 +53,7 @@ public class GulfSquid extends CardImpl { this.toughness = new MageInt(2); // When Gulf Squid enters the battlefield, tap all lands target player controls. - Ability ability = new EntersBattlefieldTriggeredAbility(new TapAllTargetPlayerControlsEffect(new FilterLandPermanent("lands"))); + Ability ability = new EntersBattlefieldTriggeredAbility(new TapAllTargetPlayerControlsEffect(StaticFilters.FILTER_LANDS)); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HokoriDustDrinker.java b/Mage.Sets/src/mage/cards/h/HokoriDustDrinker.java index b817e76543e..89c7204d2f2 100644 --- a/Mage.Sets/src/mage/cards/h/HokoriDustDrinker.java +++ b/Mage.Sets/src/mage/cards/h/HokoriDustDrinker.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -60,7 +61,7 @@ public class HokoriDustDrinker extends CardImpl { this.toughness = new MageInt(2); // Lands don't untap during their controllers' untap steps. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, StaticFilters.FILTER_LANDS))); // At the beginning of each player's upkeep, that player untaps a land he or she controls. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new HokoriDustDrinkerUntapEffect(), TargetController.ANY, false)); diff --git a/Mage.Sets/src/mage/cards/i/InspiringVantage.java b/Mage.Sets/src/mage/cards/i/InspiringVantage.java index 32353b18e90..be17134f612 100644 --- a/Mage.Sets/src/mage/cards/i/InspiringVantage.java +++ b/Mage.Sets/src/mage/cards/i/InspiringVantage.java @@ -27,9 +27,6 @@ */ package mage.cards.i; -import java.util.UUID; - -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -41,19 +38,21 @@ import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author fireshoes */ public class InspiringVantage extends CardImpl { public InspiringVantage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // Inspiring Vantage enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tapped unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); diff --git a/Mage.Sets/src/mage/cards/j/JoinerAdept.java b/Mage.Sets/src/mage/cards/j/JoinerAdept.java index d5751527d0c..0d91b0d6861 100644 --- a/Mage.Sets/src/mage/cards/j/JoinerAdept.java +++ b/Mage.Sets/src/mage/cards/j/JoinerAdept.java @@ -27,18 +27,18 @@ */ package mage.cards.j; -import java.util.UUID; - -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -53,7 +53,7 @@ public class JoinerAdept extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_LANDS, false))); } public JoinerAdept(final JoinerAdept card) { diff --git a/Mage.Sets/src/mage/cards/k/KnightOfTheWhiteOrchid.java b/Mage.Sets/src/mage/cards/k/KnightOfTheWhiteOrchid.java index 54ecc742404..369137b4ed0 100644 --- a/Mage.Sets/src/mage/cards/k/KnightOfTheWhiteOrchid.java +++ b/Mage.Sets/src/mage/cards/k/KnightOfTheWhiteOrchid.java @@ -28,8 +28,6 @@ package mage.cards.k; -import java.util.UUID; -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.OpponentControlsMoreCondition; @@ -38,11 +36,14 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.SubType; +import mage.filter.StaticFilters; import mage.filter.common.FilterBySubtypeCard; -import mage.filter.common.FilterLandPermanent; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** * * @author BetaSteward_at_googlemail.com @@ -63,7 +64,7 @@ public class KnightOfTheWhiteOrchid extends CardImpl { // When Knight of the White Orchid enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library. this.addAbility(new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard(SubType.PLAINS)), false), true), - new OpponentControlsMoreCondition(new FilterLandPermanent("lands")), + new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS), "When {this} enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library")); } diff --git a/Mage.Sets/src/mage/cards/l/LandEquilibrium.java b/Mage.Sets/src/mage/cards/l/LandEquilibrium.java index 33027bb7815..a7cecfd3bd3 100644 --- a/Mage.Sets/src/mage/cards/l/LandEquilibrium.java +++ b/Mage.Sets/src/mage/cards/l/LandEquilibrium.java @@ -27,19 +27,20 @@ */ package mage.cards.l; -import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author spjspj @@ -65,10 +66,8 @@ public class LandEquilibrium extends CardImpl { class LandEquilibriumAbility extends TriggeredAbilityImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("land"); - public LandEquilibriumAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterLandPermanent(), 1, ""), false); + super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_LAND, 1, ""), false); } public LandEquilibriumAbility(final LandEquilibriumAbility ability) { @@ -87,8 +86,8 @@ class LandEquilibriumAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - int numMyLands = game.getBattlefield().countAll(filter, this.getControllerId(), game); - int theirLands = game.getBattlefield().countAll(filter, event.getPlayerId(), game); + int numMyLands = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, this.getControllerId(), game); + int theirLands = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, event.getPlayerId(), game); if (numMyLands < theirLands) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; diff --git a/Mage.Sets/src/mage/cards/l/LandTax.java b/Mage.Sets/src/mage/cards/l/LandTax.java index 2045ad46103..30b0fe99b28 100644 --- a/Mage.Sets/src/mage/cards/l/LandTax.java +++ b/Mage.Sets/src/mage/cards/l/LandTax.java @@ -27,7 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.OpponentControlsMoreCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; @@ -36,10 +35,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterBasicLandCard; -import mage.filter.common.FilterLandPermanent; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** * * @author LevelX2 @@ -52,7 +53,7 @@ public class LandTax extends CardImpl { // At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true), TargetController.YOU, true), - new OpponentControlsMoreCondition(new FilterLandPermanent("lands")), + new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS), "At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library" )); diff --git a/Mage.Sets/src/mage/cards/l/LavaballTrap.java b/Mage.Sets/src/mage/cards/l/LavaballTrap.java index b51e94de928..e803d6a55b1 100644 --- a/Mage.Sets/src/mage/cards/l/LavaballTrap.java +++ b/Mage.Sets/src/mage/cards/l/LavaballTrap.java @@ -27,8 +27,6 @@ */ package mage.cards.l; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.abilities.costs.AlternativeCostSourceAbility; @@ -38,13 +36,16 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetLandPermanent; import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; +import java.util.List; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -61,7 +62,7 @@ public class LavaballTrap extends CardImpl { // Destroy two target lands. Lavaball Trap deals 4 damage to each creature. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new DamageAllEffect(4, new FilterCreaturePermanent())); - this.getSpellAbility().addTarget(new TargetLandPermanent(2, 2, new FilterLandPermanent("lands"), false)); + this.getSpellAbility().addTarget(new TargetLandPermanent(2, 2, StaticFilters.FILTER_LANDS, false)); } diff --git a/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java b/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java index f3063ea85bc..2d6414ab23a 100644 --- a/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java +++ b/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.counters.CounterType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -82,7 +82,7 @@ class LiegeOfTheTangleTriggeredAbility extends TriggeredAbilityImpl { LiegeOfTheTangleTriggeredAbility() { super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.AWAKENING.createInstance())); this.addEffect(new LiegeOfTheTangleEffect()); - Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, new FilterLandPermanent(), true); + Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_LANDS, true); this.addTarget(target); } diff --git a/Mage.Sets/src/mage/cards/l/LivingPlane.java b/Mage.Sets/src/mage/cards/l/LivingPlane.java index f1f0d84a0cc..323b413da2a 100644 --- a/Mage.Sets/src/mage/cards/l/LivingPlane.java +++ b/Mage.Sets/src/mage/cards/l/LivingPlane.java @@ -27,7 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; @@ -37,9 +36,11 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.permanent.token.Token; +import java.util.UUID; + /** * * @author fireshoes @@ -51,7 +52,7 @@ public class LivingPlane extends CardImpl { this.addSuperType(SuperType.WORLD); // All lands are 1/1 creatures that are still lands. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingPlaneToken(), "lands", new FilterLandPermanent("lands"), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingPlaneToken(), "lands", StaticFilters.FILTER_LANDS, Duration.WhileOnBattlefield))); } public LivingPlane(final LivingPlane card) { diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java b/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java index 02375789276..b221dac8290 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,10 +38,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * @author duncant */ @@ -72,7 +73,7 @@ public class MagusOfTheCandelabra extends CardImpl { if (ability.getOriginalId().equals(originalId)){ int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); - ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false)); + ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false)); } } diff --git a/Mage.Sets/src/mage/cards/m/ManaShort.java b/Mage.Sets/src/mage/cards/m/ManaShort.java index 423679897a6..79a2aa5b4a2 100644 --- a/Mage.Sets/src/mage/cards/m/ManaShort.java +++ b/Mage.Sets/src/mage/cards/m/ManaShort.java @@ -27,17 +27,18 @@ */ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; +import java.util.UUID; + /** * * @author Quercitron @@ -65,7 +66,7 @@ public class ManaShort extends CardImpl { class ManaShortEffect extends TapAllTargetPlayerControlsEffect { public ManaShortEffect() { - super(new FilterLandPermanent("lands")); + super(StaticFilters.FILTER_LANDS); staticText = "Tap all lands target player controls and empty his or her mana pool"; } diff --git a/Mage.Sets/src/mage/cards/m/ManaVortex.java b/Mage.Sets/src/mage/cards/m/ManaVortex.java index 9ad92bfc4c1..d7ec8b27568 100644 --- a/Mage.Sets/src/mage/cards/m/ManaVortex.java +++ b/Mage.Sets/src/mage/cards/m/ManaVortex.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.StateTriggeredAbility; @@ -43,8 +42,8 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -52,13 +51,13 @@ import mage.game.stack.StackObject; import mage.players.Player; import mage.target.common.TargetControlledPermanent; +import java.util.UUID; + /** * * @author fireshoes */ public class ManaVortex extends CardImpl { - - static final FilterLandPermanent filter = new FilterLandPermanent(); public ManaVortex(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}{U}"); @@ -67,7 +66,7 @@ public class ManaVortex extends CardImpl { this.addAbility(new CastSourceTriggeredAbility(new CounterSourceEffect())); // At the beginning of each player's upkeep, that player sacrifices a land. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterLandPermanent(), 1, "that player"), + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that player"), TargetController.ANY, false)); // When there are no lands on the battlefield, sacrifice Mana Vortex. @@ -151,7 +150,7 @@ class ManaVortexStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getBattlefield().count(ManaVortex.filter, this.getSourceId(), this.getControllerId(), game) == 0; + return game.getBattlefield().count(StaticFilters.FILTER_LANDS, this.getSourceId(), this.getControllerId(), game) == 0; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MishrasHelix.java b/Mage.Sets/src/mage/cards/m/MishrasHelix.java index a05e4e11d11..d8447abb581 100644 --- a/Mage.Sets/src/mage/cards/m/MishrasHelix.java +++ b/Mage.Sets/src/mage/cards/m/MishrasHelix.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; @@ -38,10 +37,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author fireshoes @@ -66,7 +67,7 @@ public class MishrasHelix extends CardImpl { if (ability.getOriginalId().equals(originalId)){ int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); - ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false)); + ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false)); } } diff --git a/Mage.Sets/src/mage/cards/m/MistbindClique.java b/Mage.Sets/src/mage/cards/m/MistbindClique.java index 2b7fc6b56c1..76f3901fb7d 100644 --- a/Mage.Sets/src/mage/cards/m/MistbindClique.java +++ b/Mage.Sets/src/mage/cards/m/MistbindClique.java @@ -27,7 +27,6 @@ */ package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.ZoneChangeTriggeredAbility; import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect; @@ -39,12 +38,14 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.TargetPlayer; +import java.util.UUID; + /** * * @author LevelX2 @@ -84,7 +85,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { public MistbindCliqueAbility() { // ability has to trigger independant where the source object is now - super(Zone.ALL, Zone.BATTLEFIELD, Zone.EXILED, new TapAllTargetPlayerControlsEffect(new FilterLandPermanent("lands")), "When a Faerie is championed with {this}, ", false); + super(Zone.ALL, Zone.BATTLEFIELD, Zone.EXILED, new TapAllTargetPlayerControlsEffect(StaticFilters.FILTER_LANDS), "When a Faerie is championed with {this}, ", false); this.addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/m/MyojinOfInfiniteRage.java b/Mage.Sets/src/mage/cards/m/MyojinOfInfiniteRage.java index 3f39280b9f1..bc3a467830b 100644 --- a/Mage.Sets/src/mage/cards/m/MyojinOfInfiniteRage.java +++ b/Mage.Sets/src/mage/cards/m/MyojinOfInfiniteRage.java @@ -47,7 +47,7 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.watchers.common.CastFromHandWatcher; import java.util.UUID; @@ -57,8 +57,6 @@ import java.util.UUID; */ public class MyojinOfInfiniteRage extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("lands"); - public MyojinOfInfiniteRage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{R}{R}{R}"); addSuperType(SuperType.LEGENDARY); @@ -75,7 +73,7 @@ public class MyojinOfInfiniteRage extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), new SourceHasCounterCondition(CounterType.DIVINITY), "{this} is indestructible as long as it has a divinity counter on it"))); // Remove a divinity counter from Myojin of Infinite Rage: Destroy all lands. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(filter), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(StaticFilters.FILTER_LANDS), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance()))); } public MyojinOfInfiniteRage(final MyojinOfInfiniteRage card) { diff --git a/Mage.Sets/src/mage/cards/n/NaturesWill.java b/Mage.Sets/src/mage/cards/n/NaturesWill.java index 4ba7e84e89b..c717da3575c 100644 --- a/Mage.Sets/src/mage/cards/n/NaturesWill.java +++ b/Mage.Sets/src/mage/cards/n/NaturesWill.java @@ -36,7 +36,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -152,8 +152,7 @@ class NaturesWillEffect extends OneShotEffect { return false; } - FilterLandPermanent filter = new FilterLandPermanent(); - List lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); + List lands = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game); for (Permanent land : lands) { if (damagedPlayers.contains(land.getControllerId())) { land.tap(game); diff --git a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java index 6f5d6854612..0473a381b8b 100644 --- a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java +++ b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java @@ -27,7 +27,6 @@ */ package mage.cards.n; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -41,13 +40,15 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; import mage.constants.*; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.NissaSageAnimistToken; import mage.players.Player; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author emerald000 @@ -71,7 +72,7 @@ public class NissaSageAnimist extends CardImpl { // -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands. Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7); - ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false)); + ability.addTarget(new TargetLandPermanent(0, 6, StaticFilters.FILTER_LANDS, false)); ability.addEffect(new NissaSageAnimistMinusSevenEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/n/NumotTheDevastator.java b/Mage.Sets/src/mage/cards/n/NumotTheDevastator.java index f8e74fb52bf..9a1f1e6425c 100644 --- a/Mage.Sets/src/mage/cards/n/NumotTheDevastator.java +++ b/Mage.Sets/src/mage/cards/n/NumotTheDevastator.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SuperType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.target.common.TargetLandPermanent; import java.util.UUID; @@ -65,7 +65,7 @@ public class NumotTheDevastator extends CardImpl { effect.setText("destroy up to two target lands"); Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility( new DoIfCostPaid(effect, new ManaCostsImpl("{2}{R}")), false); - ability.addTarget(new TargetLandPermanent(0,2, new FilterLandPermanent("lands"), false)); + ability.addTarget(new TargetLandPermanent(0,2, StaticFilters.FILTER_LANDS, false)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PlowUnder.java b/Mage.Sets/src/mage/cards/p/PlowUnder.java index f771fe4a7ac..d5395b91462 100644 --- a/Mage.Sets/src/mage/cards/p/PlowUnder.java +++ b/Mage.Sets/src/mage/cards/p/PlowUnder.java @@ -27,14 +27,15 @@ */ package mage.cards.p; -import java.util.UUID; import mage.abilities.effects.common.PutOnLibraryTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author Plopman @@ -47,7 +48,7 @@ public class PlowUnder extends CardImpl { // Put two target lands on top of their owners' libraries. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); - this.getSpellAbility().addTarget(new TargetLandPermanent(2,2, new FilterLandPermanent("lands"), false)); + this.getSpellAbility().addTarget(new TargetLandPermanent(2,2, StaticFilters.FILTER_LANDS, false)); } public PlowUnder(final PlowUnder card) { diff --git a/Mage.Sets/src/mage/cards/r/RavagesOfWar.java b/Mage.Sets/src/mage/cards/r/RavagesOfWar.java index a154fdacf86..c3789ef99d3 100644 --- a/Mage.Sets/src/mage/cards/r/RavagesOfWar.java +++ b/Mage.Sets/src/mage/cards/r/RavagesOfWar.java @@ -27,12 +27,13 @@ */ package mage.cards.r; -import java.util.UUID; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -45,7 +46,7 @@ public class RavagesOfWar extends CardImpl { // Destroy all lands. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands"))); + this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS)); } public RavagesOfWar(final RavagesOfWar card) { diff --git a/Mage.Sets/src/mage/cards/r/RazorvergeThicket.java b/Mage.Sets/src/mage/cards/r/RazorvergeThicket.java index 810858a04cf..f670b51acfb 100644 --- a/Mage.Sets/src/mage/cards/r/RazorvergeThicket.java +++ b/Mage.Sets/src/mage/cards/r/RazorvergeThicket.java @@ -27,9 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; - -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -41,7 +38,10 @@ import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -49,12 +49,10 @@ import mage.filter.common.FilterLandPermanent; */ public class RazorvergeThicket extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); - public RazorvergeThicket(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},null); - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); diff --git a/Mage.Sets/src/mage/cards/r/RisingWaters.java b/Mage.Sets/src/mage/cards/r/RisingWaters.java index 133a14497df..b596aa735bd 100644 --- a/Mage.Sets/src/mage/cards/r/RisingWaters.java +++ b/Mage.Sets/src/mage/cards/r/RisingWaters.java @@ -27,7 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -35,11 +34,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -48,6 +44,8 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author fireshoes @@ -59,7 +57,7 @@ public class RisingWaters extends CardImpl { // Lands don't untap during their controllers' untap steps. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands")))); + new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, StaticFilters.FILTER_LANDS))); // At the beginning of each player's upkeep, that player untaps a land he or she controls. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new RisingWatersUntapEffect(), TargetController.ANY, false)); diff --git a/Mage.Sets/src/mage/cards/r/Rivalry.java b/Mage.Sets/src/mage/cards/r/Rivalry.java index 900fb4f1ad6..1756bfa7e2e 100644 --- a/Mage.Sets/src/mage/cards/r/Rivalry.java +++ b/Mage.Sets/src/mage/cards/r/Rivalry.java @@ -27,7 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -35,13 +34,14 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author Plopman @@ -69,10 +69,6 @@ public class Rivalry extends CardImpl { class RivalryTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterPermanent filter = new FilterLandPermanent(); - - - public RivalryTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(2), false); } @@ -104,10 +100,10 @@ class RivalryTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkInterveningIfClause(Game game) { UUID player = game.getActivePlayerId(); - int land = game.getBattlefield().countAll(filter, player, game); + int land = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, player, game); if(player != null){ for(UUID opponent : game.getOpponents(player)){ - if(land <= game.getBattlefield().countAll(filter, opponent, game)){ + if(land <= game.getBattlefield().countAll(StaticFilters.FILTER_LAND, opponent, game)){ return false; } } diff --git a/Mage.Sets/src/mage/cards/r/RuinousMinotaur.java b/Mage.Sets/src/mage/cards/r/RuinousMinotaur.java index fef8cdbb8f8..7a65ae01bb9 100644 --- a/Mage.Sets/src/mage/cards/r/RuinousMinotaur.java +++ b/Mage.Sets/src/mage/cards/r/RuinousMinotaur.java @@ -27,14 +27,15 @@ */ package mage.cards.r; -import java.util.UUID; -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterLandPermanent; +import mage.constants.CardType; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -51,7 +52,7 @@ public class RuinousMinotaur extends CardImpl { this.toughness = new MageInt(2); // Whenever Ruinous Minotaur deals damage to an opponent, sacrifice a land. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false, false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false, false)); } diff --git a/Mage.Sets/src/mage/cards/s/SeachromeCoast.java b/Mage.Sets/src/mage/cards/s/SeachromeCoast.java index 6402dd3aa77..07685bd2358 100644 --- a/Mage.Sets/src/mage/cards/s/SeachromeCoast.java +++ b/Mage.Sets/src/mage/cards/s/SeachromeCoast.java @@ -27,9 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; - -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -41,21 +38,21 @@ import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * * @author maurer.it_at_gmail.com */ public class SeachromeCoast extends CardImpl { - - private static FilterLandPermanent filter = new FilterLandPermanent(); - public SeachromeCoast(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},null); // Seachrome Coast enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); diff --git a/Mage.Sets/src/mage/cards/s/SeedTheLand.java b/Mage.Sets/src/mage/cards/s/SeedTheLand.java index c1d4b76abc3..a7fa9c555a3 100644 --- a/Mage.Sets/src/mage/cards/s/SeedTheLand.java +++ b/Mage.Sets/src/mage/cards/s/SeedTheLand.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.cards.CardImpl; @@ -35,9 +34,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.permanent.token.SnakeToken; +import java.util.UUID; + /** * * @author LevelX2 @@ -49,7 +50,7 @@ public class SeedTheLand extends CardImpl { // Whenever a land enters the battlefield, its controller creates a 1/1 green Snake creature token. this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, - new CreateTokenTargetEffect(new SnakeToken()), new FilterLandPermanent(), false, SetTargetPointer.PLAYER, + new CreateTokenTargetEffect(new SnakeToken()), StaticFilters.FILTER_LAND, false, SetTargetPointer.PLAYER, "Whenever a land enters the battlefield, its controller creates a 1/1 green Snake creature token.")); } diff --git a/Mage.Sets/src/mage/cards/s/SerendibDjinn.java b/Mage.Sets/src/mage/cards/s/SerendibDjinn.java index 2def83ab79b..33da13199ab 100644 --- a/Mage.Sets/src/mage/cards/s/SerendibDjinn.java +++ b/Mage.Sets/src/mage/cards/s/SerendibDjinn.java @@ -29,7 +29,6 @@ package mage.cards.s; import mage.MageInt; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -38,10 +37,11 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Outcome; import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -68,7 +68,7 @@ public class SerendibDjinn extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SerendibDjinnEffect(), TargetController.YOU, false)); // When you control no lands, sacrifice Serendib Djinn. this.addAbility(new ControlsPermanentsControllerTriggeredAbility( - new FilterLandPermanent(), ComparisonType.EQUAL_TO, 0, + StaticFilters.FILTER_LANDS, ComparisonType.EQUAL_TO, 0, new SacrificeSourceEffect())); } diff --git a/Mage.Sets/src/mage/cards/s/ShelteredValley.java b/Mage.Sets/src/mage/cards/s/ShelteredValley.java index 36826c540a7..172a4794345 100644 --- a/Mage.Sets/src/mage/cards/s/ShelteredValley.java +++ b/Mage.Sets/src/mage/cards/s/ShelteredValley.java @@ -27,9 +27,7 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; @@ -43,19 +41,21 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.filter.predicate.mageobject.NamePredicate; +import java.util.UUID; + /** * * @author anonymous */ public class ShelteredValley extends CardImpl { - - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterPermanent filterShelteredValley = new FilterPermanent("permanent named Sheltered Valley"); static { @@ -72,7 +72,7 @@ public class ShelteredValley extends CardImpl { this.addAbility(ability); // At the beginning of your upkeep, if you control three or fewer lands, you gain 1 life. - Condition controls = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 4); + Condition controls = new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 4); effect = new ConditionalOneShotEffect(new GainLifeEffect(1), controls); effect.setText("if you control three or fewer lands, you gain 1 life"); ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false); diff --git a/Mage.Sets/src/mage/cards/s/SpirebluffCanal.java b/Mage.Sets/src/mage/cards/s/SpirebluffCanal.java index 68877a6da48..8ed01680673 100644 --- a/Mage.Sets/src/mage/cards/s/SpirebluffCanal.java +++ b/Mage.Sets/src/mage/cards/s/SpirebluffCanal.java @@ -27,9 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; - -import mage.constants.ComparisonType; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; @@ -41,7 +38,10 @@ import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.constants.ComparisonType; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -53,7 +53,7 @@ public class SpirebluffCanal extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // Spirebluff Canal enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3)); String abilityText = "tapped unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); diff --git a/Mage.Sets/src/mage/cards/s/StoneRain.java b/Mage.Sets/src/mage/cards/s/StoneRain.java index 220d2d4086e..2ed26d90acd 100644 --- a/Mage.Sets/src/mage/cards/s/StoneRain.java +++ b/Mage.Sets/src/mage/cards/s/StoneRain.java @@ -28,14 +28,15 @@ package mage.cards.s; -import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterLandPermanent; +import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.target.TargetPermanent; +import java.util.UUID; + /** * * @author Loki @@ -45,7 +46,7 @@ public class StoneRain extends CardImpl { public StoneRain (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}"); - this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent())); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_LAND)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); } diff --git a/Mage.Sets/src/mage/cards/s/StructuralCollapse.java b/Mage.Sets/src/mage/cards/s/StructuralCollapse.java index 8d5e3367b1b..abe0965dadb 100644 --- a/Mage.Sets/src/mage/cards/s/StructuralCollapse.java +++ b/Mage.Sets/src/mage/cards/s/StructuralCollapse.java @@ -27,16 +27,17 @@ */ package mage.cards.s; -import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.filter.common.FilterArtifactPermanent; -import mage.filter.common.FilterLandPermanent; import mage.target.TargetPlayer; +import java.util.UUID; + /** * * @author Plopman @@ -49,7 +50,7 @@ public class StructuralCollapse extends CardImpl { // Target player sacrifices an artifact and a land. Structural Collapse deals 2 damage to that player. this.getSpellAbility().addEffect(new SacrificeEffect(new FilterArtifactPermanent(), 1, "Target player")); - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterLandPermanent(), 1, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_LANDS, 1, "Target player")); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/s/Sunder.java b/Mage.Sets/src/mage/cards/s/Sunder.java index c759c0578bf..f05bfe5a0e2 100644 --- a/Mage.Sets/src/mage/cards/s/Sunder.java +++ b/Mage.Sets/src/mage/cards/s/Sunder.java @@ -27,12 +27,13 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -44,7 +45,7 @@ public class Sunder extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{U}"); // Return all lands to their owners' hands. - this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterLandPermanent("lands"))); + this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(StaticFilters.FILTER_LANDS)); } public Sunder(final Sunder card) { diff --git a/Mage.Sets/src/mage/cards/t/TectonicEdge.java b/Mage.Sets/src/mage/cards/t/TectonicEdge.java index 91b7589d698..37c96cb87b9 100644 --- a/Mage.Sets/src/mage/cards/t/TectonicEdge.java +++ b/Mage.Sets/src/mage/cards/t/TectonicEdge.java @@ -28,9 +28,7 @@ package mage.cards.t; -import java.util.UUID; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.condition.common.OpponentControlsPermanentCondition; import mage.abilities.costs.Cost; @@ -43,11 +41,15 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.target.common.TargetNonBasicLandPermanent; +import java.util.UUID; + /** * * @author BetaSteward_at_googlemail.com @@ -87,7 +89,6 @@ public class TectonicEdge extends CardImpl { class TectonicEdgeCost extends CostImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); public TectonicEdgeCost() { this.text = "Activate this ability only if an opponent controls four or more lands"; @@ -105,7 +106,7 @@ class TectonicEdgeCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { for (UUID opponentId: game.getOpponents(controllerId)) { - if (game.getBattlefield().countAll(filter, opponentId, game) > 3) { + if (game.getBattlefield().countAll(StaticFilters.FILTER_LANDS, opponentId, game) > 3) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TectonicInstability.java b/Mage.Sets/src/mage/cards/t/TectonicInstability.java index 0a392663295..414ad63984c 100644 --- a/Mage.Sets/src/mage/cards/t/TectonicInstability.java +++ b/Mage.Sets/src/mage/cards/t/TectonicInstability.java @@ -27,7 +27,6 @@ */ package mage.cards.t; -import java.util.UUID; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect; import mage.cards.CardImpl; @@ -35,8 +34,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandPermanent; +import java.util.UUID; + /** * * @author LoneFox @@ -49,7 +51,7 @@ public class TectonicInstability extends CardImpl { // Whenever a land enters the battlefield, tap all lands its controller controls. this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, - new TapAllTargetPlayerControlsEffect(new FilterLandPermanent()), new FilterLandPermanent(), + new TapAllTargetPlayerControlsEffect(new FilterLandPermanent()), StaticFilters.FILTER_LANDS, false, SetTargetPointer.PLAYER, "Whenever a land enters the battlefield, tap all lands its controller controls.")); } diff --git a/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java b/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java index 244d06ebdbb..684b1950776 100644 --- a/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java +++ b/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; @@ -37,11 +35,14 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -81,7 +82,7 @@ class TreacherousTerrainEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game); for (UUID playerId : game.getOpponents(source.getControllerId())) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/w/WeatheredWayfarer.java b/Mage.Sets/src/mage/cards/w/WeatheredWayfarer.java index be81960a1e6..a4241504150 100644 --- a/Mage.Sets/src/mage/cards/w/WeatheredWayfarer.java +++ b/Mage.Sets/src/mage/cards/w/WeatheredWayfarer.java @@ -27,9 +27,6 @@ */ package mage.cards.w; -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; @@ -39,10 +36,14 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterLandCard; -import mage.filter.common.FilterLandPermanent; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** * * @author LevelX2 @@ -63,7 +64,7 @@ public class WeatheredWayfarer extends CardImpl { Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true), new ManaCostsImpl("{W}"), - new OpponentControlsMoreCondition(new FilterLandPermanent("lands"))); + new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/w/WoodbornBehemoth.java b/Mage.Sets/src/mage/cards/w/WoodbornBehemoth.java index ef34e9cb648..cff1a964210 100644 --- a/Mage.Sets/src/mage/cards/w/WoodbornBehemoth.java +++ b/Mage.Sets/src/mage/cards/w/WoodbornBehemoth.java @@ -27,10 +27,8 @@ */ package mage.cards.w; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalContinuousEffect; @@ -40,9 +38,12 @@ import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** * @@ -58,7 +59,7 @@ public class WoodbornBehemoth extends CardImpl { this.toughness = new MageInt(4); // As long as you control eight or more lands, Woodborn Behemoth gets +4/+4 and has trample. - PermanentsOnTheBattlefieldCondition eightOrMoreLandCondition = new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.MORE_THAN,7); + PermanentsOnTheBattlefieldCondition eightOrMoreLandCondition = new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.MORE_THAN,7); ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect( new BoostSourceEffect(4,4, Duration.WhileOnBattlefield), eightOrMoreLandCondition, "As long as you control eight or more lands, {this} gets +4/+4"); diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index c1e483585b9..ff16f24eca8 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -38,6 +38,9 @@ public final class StaticFilters { public static final FilterControlledPermanent FILTER_CONTROLLED_A_CREATURE = new FilterControlledCreaturePermanent("a creature you control"); public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_ANOTHER_CREATURE = new FilterControlledCreaturePermanent("another creature"); public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_NON_LAND = new FilterControlledPermanent("nonland permanent"); + public static final FilterLandPermanent FILTER_LAND = new FilterLandPermanent(); + public static final FilterLandPermanent FILTER_LANDS = new FilterLandPermanent("lands"); + public static final FilterLandPermanent FILTER_BASIC_LAND = new FilterLandPermanent(); public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE = new FilterCreaturePermanent(); public static final FilterCreaturePermanent FILTER_PERMANENT_A_CREATURE = new FilterCreaturePermanent("a creature"); @@ -62,6 +65,8 @@ public final class StaticFilters { static { FILTER_CONTROLLED_PERMANENT_NON_LAND.add( Predicates.not(new CardTypePredicate(CardType.LAND))); + + FILTER_CREATURE_TOKENS.add(new TokenPredicate()); FILTER_ATTACKING_CREATURES.add(new AttackingPredicate()); From 11bbb6209f714445c1eacc334c7b75b3ee0e9a82 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Mon, 10 Jul 2017 20:15:45 -0500 Subject: [PATCH 03/29] Added SDCC 2017 planeswalkers. --- Mage.Sets/src/mage/sets/MediaInserts.java | 9 +++++++-- Utils/mtg-cards-data.txt | 9 ++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/MediaInserts.java b/Mage.Sets/src/mage/sets/MediaInserts.java index 12ee1a34af1..4987a4ba754 100644 --- a/Mage.Sets/src/mage/sets/MediaInserts.java +++ b/Mage.Sets/src/mage/sets/MediaInserts.java @@ -77,6 +77,7 @@ public class MediaInserts extends ExpansionSet { cards.add(new SetCardInfo("Chandra, Pyromaster", 75, Rarity.MYTHIC, mage.cards.c.ChandraPyromaster.class)); cards.add(new SetCardInfo("Chandra, Pyromaster", 102, Rarity.MYTHIC, mage.cards.c.ChandraPyromaster.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Chandra, Roaring Flame", 997, Rarity.SPECIAL, mage.cards.c.ChandraRoaringFlame.class)); + cards.add(new SetCardInfo("Chandra, Torch of Defiance", 180, Rarity.MYTHIC, mage.cards.c.ChandraTorchOfDefiance.class)); cards.add(new SetCardInfo("Chandra's Fury", 65, Rarity.COMMON, mage.cards.c.ChandrasFury.class)); cards.add(new SetCardInfo("Chandra's Phoenix", 37, Rarity.RARE, mage.cards.c.ChandrasPhoenix.class)); cards.add(new SetCardInfo("Cinder Glade", 168, Rarity.RARE, mage.cards.c.CinderGlade.class)); @@ -115,6 +116,7 @@ public class MediaInserts extends ExpansionSet { cards.add(new SetCardInfo("Gaze of Granite", 81, Rarity.RARE, mage.cards.g.GazeOfGranite.class)); cards.add(new SetCardInfo("Genesis Hydra", 142, Rarity.SPECIAL, mage.cards.g.GenesisHydra.class)); cards.add(new SetCardInfo("Giant Badger", 8, Rarity.SPECIAL, mage.cards.g.GiantBadger.class)); + cards.add(new SetCardInfo("Gideon of the Trials", 177, Rarity.MYTHIC, mage.cards.g.GideonOfTheTrials.class)); cards.add(new SetCardInfo("Gideon, Ally of Zendikar", 172, Rarity.MYTHIC, mage.cards.g.GideonAllyOfZendikar.class)); cards.add(new SetCardInfo("Gideon, Battle-Forged", 994, Rarity.SPECIAL, mage.cards.g.GideonBattleForged.class)); cards.add(new SetCardInfo("Gladehart Cavalry", 147, Rarity.RARE, mage.cards.g.GladehartCavalry.class)); @@ -138,6 +140,7 @@ public class MediaInserts extends ExpansionSet { cards.add(new SetCardInfo("Jace, Telepath Unbound", 995, Rarity.SPECIAL, mage.cards.j.JaceTelepathUnbound.class)); cards.add(new SetCardInfo("Jace, the Living Guildpact", 100, Rarity.MYTHIC, mage.cards.j.JaceTheLivingGuildpact.class)); cards.add(new SetCardInfo("Jace, Unraveler of Secrets", 173, Rarity.MYTHIC, mage.cards.j.JaceUnravelerOfSecrets.class)); + cards.add(new SetCardInfo("Jace, Unraveler of Secrets", 178, Rarity.MYTHIC, mage.cards.j.JaceUnravelerOfSecrets.class)); cards.add(new SetCardInfo("Jace, Vryn's Prodigy", 995, Rarity.SPECIAL, mage.cards.j.JaceVrynsProdigy.class)); cards.add(new SetCardInfo("Jaya Ballard, Task Mage", 18, Rarity.RARE, mage.cards.j.JayaBallardTaskMage.class)); cards.add(new SetCardInfo("Karametra's Acolyte", 78, Rarity.UNCOMMON, mage.cards.k.KarametrasAcolyte.class)); @@ -146,9 +149,9 @@ public class MediaInserts extends ExpansionSet { cards.add(new SetCardInfo("Kothophed, Soul Hoarder", 127, Rarity.SPECIAL, mage.cards.k.KothophedSoulHoarder.class)); cards.add(new SetCardInfo("Kytheon, Hero of Akros", 994, Rarity.SPECIAL, mage.cards.k.KytheonHeroOfAkros.class)); cards.add(new SetCardInfo("Lightning Hounds", 10, Rarity.SPECIAL, mage.cards.l.LightningHounds.class)); - cards.add(new SetCardInfo("Liliana, Defiant Necromancer", 996, Rarity.SPECIAL, mage.cards.l.LilianaDefiantNecromancer.class)); - cards.add(new SetCardInfo("Liliana, Heretical Healer", 996, Rarity.SPECIAL, mage.cards.l.LilianaHereticalHealer.class)); cards.add(new SetCardInfo("Liliana of the Dark Realms", 74, Rarity.MYTHIC, mage.cards.l.LilianaOfTheDarkRealms.class)); + cards.add(new SetCardInfo("Liliana, Death's Majesty", 179, Rarity.MYTHIC, mage.cards.l.LilianaDeathsMajesty.class)); + cards.add(new SetCardInfo("Liliana, Defiant Necromancer", 996, Rarity.SPECIAL, mage.cards.l.LilianaDefiantNecromancer.class)); cards.add(new SetCardInfo("Liliana, the Last Hope", 174, Rarity.MYTHIC, mage.cards.l.LilianaTheLastHope.class)); cards.add(new SetCardInfo("Liliana Vess", 30, Rarity.RARE, mage.cards.l.LilianaVess.class)); cards.add(new SetCardInfo("Liliana Vess", 101, Rarity.MYTHIC, mage.cards.l.LilianaVess.class, new CardGraphicInfo(null, true))); @@ -162,9 +165,11 @@ public class MediaInserts extends ExpansionSet { cards.add(new SetCardInfo("Necromaster Dragon", 114, Rarity.SPECIAL, mage.cards.n.NecromasterDragon.class)); cards.add(new SetCardInfo("Nephalia Moondrakes", 150, Rarity.RARE, mage.cards.n.NephaliaMoondrakes.class)); cards.add(new SetCardInfo("Niblis of Frost", 158, Rarity.RARE, mage.cards.n.NiblisOfFrost.class)); + cards.add(new SetCardInfo("Nicol Bolas, God-Pharaoh", 181, Rarity.MYTHIC, mage.cards.n.NicolBolasGodPharaoh.class)); cards.add(new SetCardInfo("Nightveil Specter", 61, Rarity.RARE, mage.cards.n.NightveilSpecter.class)); cards.add(new SetCardInfo("Nissa Revane", 27, Rarity.MYTHIC, mage.cards.n.NissaRevane.class)); cards.add(new SetCardInfo("Nissa, Sage Animist", 998, Rarity.SPECIAL, mage.cards.n.NissaSageAnimist.class)); + cards.add(new SetCardInfo("Nissa, Steward of Elements", 182, Rarity.MYTHIC, mage.cards.n.NissaStewardOfElements.class)); cards.add(new SetCardInfo("Nissa, Vastwood Seer", 998, Rarity.SPECIAL, mage.cards.n.NissaVastwoodSeer.class)); cards.add(new SetCardInfo("Nissa, Voice of Zendikar", 176, Rarity.MYTHIC, mage.cards.n.NissaVoiceOfZendikar.class)); cards.add(new SetCardInfo("Nissa, Worldwaker", 103, Rarity.MYTHIC, mage.cards.n.NissaWorldwaker.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 9b1e29cf6e1..6008fc0f6a4 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -28871,6 +28871,12 @@ Jace, Unraveler of Secrets|Media Inserts|173|M|{3}{U}{U}|Planeswalker - Jace|||+ Liliana, the Last Hope|Media Inserts|174|M|{1}{B}{B}|Planeswalker - Liliana|||+1: Up to one target creature gets -2/-1 until your next turn.$-2: Put the top two cards of your library into your graveyard, then you may return a creature card from your graveyard to your hand.$-7: You get an emblem with "At the beginning of your end step, create X 2/2 black Zombie creature tokens, where X is two plus the number of Zombies you control."| Chandra, Flamecaller|Media Inserts|175|M|{4}{R}{R}|Planeswalker - Chandra|||+1: Create two 3/1 red Elemental creature tokens with haste. Exile them at the beginning of the next end step.$0: Discard all the cards in your hand, then draw that many cards plus one.$-X: Chandra, Flamecaller deals X damage to each creature.| Nissa, Voice of Zendikar|Media Inserts|176|M|{1}{G}{G}|Planeswalker - Nissa|||+1: Create a 0/1 green Plant creature token.$-2: Put a +1/+1 counter on each creature you control.$-7: You gain X life and draw X cards, where X is the number of lands you control.| +Gideon of the Trials|Media Inserts|177|M|{1}{W}{W}|Planeswalker - Gideon|||+1: Until your next turn, prevent all damage target permanent would deal.$0: Until end of turn, Gideon of the Trials becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: You get an emblem with "As long as you control a Gideon planeswalker, you can't lose the game and your opponents can't win the game."| +Jace, Unraveler of Secrets|Media Inserts|178|M|{3}{U}{U}|Planeswalker - Jace|||+1: Scry 1, then draw a card.$-2: Return target creature to its owner's hand.$-8: You get an emblem with "Whenever an opponent casts his or her first spell each turn, counter that spell."| +Liliana, Death's Majesty|Media Inserts|179|M|{3}{B}{B}|Planeswalker - Liliana|||+1: Create a 2/2 black Zombie creature token. Put the top two cards of your library into your graveyard.$-3: Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its others colors and types.$-7: Destroy all non-Zombie creatures.| +Chandra, Torch of Defiance|Media Inserts|180|M|{2}{R}{R}|Planeswalker - Chandra|||+1: Exile the top card of your library. You may cast that card. If you don't, Chandra, Torch of Defiance deals 2 damage to each opponent.$+1: Add {R}{R} to your mana pool.$-3: Chandra, Torch of Defiance deals 4 damage to target creature.$-7: You get an emblem with "Whenever you cast a spell, this emblem deals 5 damage to target creature or player."| +Nicol Bolas, God-Pharaoh|Media Inserts|181|M|{4}{U}{B}{R}|Planeswalker - Bolas|||+2: Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.$+1: Each opponent exiles two cards from his or her hand.$-4: Nicol Bolas, God-Pharaoh deals 7 damage to target opponent or creature an opponent controls.$-12: Exile each nonland permanent your opponents control.| +Nissa, Steward of Elements|Media Inserts|182|M|{X}{G}{U}|Planeswalker - Nissa|||+2: Scry 2.$0: Look at the top card of your library. If it's a land card or a creature card with converted mana cost less than or equal to the number of loyalty counters on Nissa, Steward of Elements, you may put that card onto the battlefield.$-6: Untap up to two target lands you control. They become 5/5 Elemental creatures with flying and haste until end of turn. They're still lands.| Kytheon, Hero of Akros|Media Inserts|994|Special|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.| Gideon, Battle-Forged|Media Inserts|994|Special||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| Jace, Vryn's Prodigy|Media Inserts|995|Special|{1}{U}|Legendary Creature - Human Wizard|0|2|{T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. | @@ -31680,9 +31686,10 @@ Forest|Planechase Anthology|155|L||Basic Land - Forest|||| Forest|Planechase Anthology|156|L||Basic Land - Forest|||| The Ur-Dragon|Commander 2017|2|M|{4}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Avatar|10|10|Eminence - As long as The Ur-Dragon is in the command zone or on the battlefield, other Dragon spells you cast cost {1} less to cast.$Flying$Whenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield| O-Kagachi, Vengeful Kami|Commander 2017|3|M|{1}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Spirit|6|6|Flying, Trample$Whenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls| +Arahbo, Roar of the World|Commander 2017|???|M|{3}{G}{W}|Legendary Creature - Cat Avatar|5|5|Eminence — At the beginning of combat on your turn, if Arahbo, Roar of the World is in the command zone or on the battlefield, another target Cat you control gets +3/+3 until end of turn.$Whenever another Cat you control attacks, you may pay {1}{G}{W}. If you do, it gains trample and gets +X/+X until end of turn, where X is its power.| +Taigam, Ojutai Master|Commander 2017|46|R|{2}{W}{U}|Legendary Creature - Human Monk|3|4|Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.$Whenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)| Wasitora, Nekoru Queen|Commander 2017|48|M|{2}{B}{R}{G}|Legendary Creature - Cat Dragon|5|4|Flying, trample$Whenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying| Ramos, Dragon Engine|Commander 2017|55|M|{6}|Legendary Artifact Creature - Dragon|4|4|Flying$Whenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors. Remove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn.| -Taigam, Ojutai Master|Commander 2017|46|R|{2}{W}{U}|Legendary Creature - Human Monk|3|4|Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.$Whenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)| Aegis Angel|Archenemy: Nicol Bolas|1|R|{4}{W}{W}|Creature - Angel|5|5|Flying$When Aegis Angel enters the battlefield, another target creature gains indestructible for as long as you control Aegis Angel.| Aerial Responder|Archenemy: Nicol Bolas|2|U|{1}{W}{W}|Creature - Dwarf Soldier|2|3|Flying, vigilance, lifelink| Anointer of Champions|Archenemy: Nicol Bolas|3|U|{W}|Creature - Human Cleric|1|1|{T}: Target attacking creature gets +1/+1 until end of turn.| From fb7b3aa7b6badbeb83294e5da3879ea9101b2fb9 Mon Sep 17 00:00:00 2001 From: igoudt Date: Tue, 11 Jul 2017 08:12:31 +0200 Subject: [PATCH 04/29] added kaya subtype --- Mage/src/main/java/mage/constants/SubType.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index f0aecdc2ead..37e548dea35 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -322,6 +322,7 @@ public enum SubType { GIDEON("Gideon", SubTypeSet.PlaneswalkerType, false), JACE("Jace", SubTypeSet.PlaneswalkerType, false), KARN("Karn", SubTypeSet.PlaneswalkerType, false), + KAYA("Kaya", SubTypeSet.PlaneswalkerType, false), KIORA("Kiora", SubTypeSet.PlaneswalkerType, false), KOTH("Koth", SubTypeSet.PlaneswalkerType, false), LILIANA("Liliana", SubTypeSet.PlaneswalkerType, false), From e4d92cde4822bf9231db1612d0881badd0dd17c6 Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 11 Jul 2017 17:06:27 +1000 Subject: [PATCH 05/29] Fix for Kynaios And Tiro of Meletis --- Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java b/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java index 1754da6a4d6..9c1ca4c6ebd 100644 --- a/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java +++ b/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java @@ -141,9 +141,7 @@ class KynaiosAndTirosEffect extends OneShotEffect { for (UUID playerId : noLandPlayers) { Player player = game.getPlayer(playerId); if (player != null) { - if (player.chooseUse(outcome.DrawCard, "Draw a card?", source, game)) { - player.drawCards(1, game); - } + player.drawCards(1, game); } } return true; From e9a43758a8eb19f7eccd24e76a02bb1943bd7a9e Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 11 Jul 2017 22:30:35 +1000 Subject: [PATCH 06/29] Implement Memory Crystal (EXO) --- Mage.Sets/src/mage/cards/m/MemoryCrystal.java | 104 ++++++++++++++++++ Mage.Sets/src/mage/sets/Exodus.java | 1 + .../condition/common/BuybackCondition.java | 53 +++++++++ 3 files changed, 158 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MemoryCrystal.java create mode 100644 Mage/src/main/java/mage/abilities/condition/common/BuybackCondition.java diff --git a/Mage.Sets/src/mage/cards/m/MemoryCrystal.java b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java new file mode 100644 index 00000000000..38022dbc388 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java @@ -0,0 +1,104 @@ +/* + * 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.m; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.BuybackCondition; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.util.CardUtil; + +/** + * + * @author spjspj + */ +public class MemoryCrystal extends CardImpl { + + public MemoryCrystal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // Buyback costs cost {2} less. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MemoryCrystalSpellsCostReductionEffect())); + } + + public MemoryCrystal(final MemoryCrystal card) { + super(card); + } + + @Override + public MemoryCrystal copy() { + return new MemoryCrystal(this); + } +} + +class MemoryCrystalSpellsCostReductionEffect extends CostModificationEffectImpl { + + public MemoryCrystalSpellsCostReductionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); + this.staticText = "Buyback costs cost {2} less."; + } + + protected MemoryCrystalSpellsCostReductionEffect(final MemoryCrystalSpellsCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + CardUtil.reduceCost(abilityToModify, 2); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + if (abilityToModify.getControllerId().equals(source.getControllerId())) { + Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); + if (spell != null) { + return BuybackCondition.instance.apply(game, abilityToModify); + } + } + } + return false; + } + + @Override + public MemoryCrystalSpellsCostReductionEffect copy() { + return new MemoryCrystalSpellsCostReductionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Exodus.java b/Mage.Sets/src/mage/sets/Exodus.java index b651b60bfcc..c084a0b82e0 100644 --- a/Mage.Sets/src/mage/sets/Exodus.java +++ b/Mage.Sets/src/mage/sets/Exodus.java @@ -98,6 +98,7 @@ public class Exodus extends ExpansionSet { cards.add(new SetCardInfo("Mana Breach", 38, Rarity.UNCOMMON, mage.cards.m.ManaBreach.class)); cards.add(new SetCardInfo("Maniacal Rage", 87, Rarity.COMMON, mage.cards.m.ManiacalRage.class)); cards.add(new SetCardInfo("Medicine Bag", 133, Rarity.UNCOMMON, mage.cards.m.MedicineBag.class)); + cards.add(new SetCardInfo("Memory Crystal", 134, Rarity.RARE, mage.cards.m.MemoryCrystal.class)); cards.add(new SetCardInfo("Merfolk Looter", 39, Rarity.COMMON, mage.cards.m.MerfolkLooter.class)); cards.add(new SetCardInfo("Mindless Automaton", 135, Rarity.RARE, mage.cards.m.MindlessAutomaton.class)); cards.add(new SetCardInfo("Mind Over Matter", 40, Rarity.RARE, mage.cards.m.MindOverMatter.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/BuybackCondition.java b/Mage/src/main/java/mage/abilities/condition/common/BuybackCondition.java new file mode 100644 index 00000000000..6cc4f4aebea --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/BuybackCondition.java @@ -0,0 +1,53 @@ +/* + * 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.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.Card; +import mage.game.Game; + +/** + * @author spjspj + */ +public enum BuybackCondition implements Condition { + + instance; + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getSourceId()); + if (card != null) { + return card.getAbilities().stream() + .filter(a -> a instanceof BuybackAbility) + .anyMatch(b -> ((BuybackAbility) b).isActivated()); + } + return false; + } +} From ee07a6ebc500475e80e94be64589c6f555b2d85e Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 11 Jul 2017 08:26:33 -0500 Subject: [PATCH 07/29] - Fixed issue #3519 --- .../abilities/mana/ActivateAsSorceryManaAbility.java | 5 +++++ .../mage/abilities/mana/ActivatedManaAbilityImpl.java | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/abilities/mana/ActivateAsSorceryManaAbility.java b/Mage/src/main/java/mage/abilities/mana/ActivateAsSorceryManaAbility.java index 0d24913af28..2694eabcde5 100644 --- a/Mage/src/main/java/mage/abilities/mana/ActivateAsSorceryManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/ActivateAsSorceryManaAbility.java @@ -53,4 +53,9 @@ public class ActivateAsSorceryManaAbility extends SimpleManaAbility { public ActivateAsSorceryManaAbility copy() { return new ActivateAsSorceryManaAbility(this); } + + @Override + public String getRule() { + return super.getRule() + " Activate this ability only any time you could cast a sorcery."; + } } diff --git a/Mage/src/main/java/mage/abilities/mana/ActivatedManaAbilityImpl.java b/Mage/src/main/java/mage/abilities/mana/ActivatedManaAbilityImpl.java index 2ba7a9293f8..fef2dd0eb6e 100644 --- a/Mage/src/main/java/mage/abilities/mana/ActivatedManaAbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/mana/ActivatedManaAbilityImpl.java @@ -35,6 +35,8 @@ import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.Cost; import mage.abilities.effects.common.ManaEffect; import mage.constants.AbilityType; +import mage.constants.AsThoughEffectType; +import mage.constants.TimingRule; import mage.constants.Zone; import mage.game.Game; @@ -70,7 +72,12 @@ public abstract class ActivatedManaAbilityImpl extends ActivatedAbilityImpl impl if (!controlsAbility(playerId, game)) { return false; } - // check if player is in the process of playing spell costs and he is no longer allowed to use activated mana abilities (e.g. becaus he started to use improvise) + if (timing == TimingRule.SORCERY + && !game.canPlaySorcery(playerId) + && !game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.ACTIVATE_AS_INSTANT, this, controllerId, game)) { + return false; + } + // check if player is in the process of playing spell costs and he is no longer allowed to use activated mana abilities (e.g. because he started to use improvise) //20091005 - 605.3a return costs.canPay(this, sourceId, controllerId, game); From 95246e4da664ab4bf1ff030ef3acb923a3cb70ba Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 11 Jul 2017 12:12:55 -0500 Subject: [PATCH 08/29] - Added Nettlevine Blight [Lorwyn] --- .../src/mage/cards/n/NettlevineBlight.java | 147 ++++++++++++++++++ .../BeginningOfEndStepTriggeredAbility.java | 2 +- 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/n/NettlevineBlight.java diff --git a/Mage.Sets/src/mage/cards/n/NettlevineBlight.java b/Mage.Sets/src/mage/cards/n/NettlevineBlight.java new file mode 100644 index 00000000000..097bece2bd3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NettlevineBlight.java @@ -0,0 +1,147 @@ +/* + * 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.n; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.CanBeEnchantedByPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; + +/** + * + * @author jeffwadsworth + */ +public class NettlevineBlight extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("creature or land permanent"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public NettlevineBlight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); + + this.subtype.add("Aura"); + + // Enchant creature or land + TargetPermanent auraTarget = new TargetPermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted permanent has "At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control." + this.addAbility(new BeginningOfEndStepTriggeredAbility(new NettlevineBlightEffect(), TargetController.CONTROLLER_ATTACHED_TO, false)); + + } + + public NettlevineBlight(final NettlevineBlight card) { + super(card); + } + + @Override + public NettlevineBlight copy() { + return new NettlevineBlight(this); + } +} + +class NettlevineBlightEffect extends OneShotEffect { + + public NettlevineBlightEffect() { + super(Outcome.Detriment); + this.staticText = "sacrifice this permanent and attach {this} to a creature or land you control"; + } + + public NettlevineBlightEffect(final NettlevineBlightEffect effect) { + super(effect); + } + + @Override + public NettlevineBlightEffect copy() { + return new NettlevineBlightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent nettlevineBlight = game.getPermanent(source.getSourceId()); + Player newController = null; + if (controller != null + && nettlevineBlight != null) { + Permanent enchantedPermanent = game.getPermanent(nettlevineBlight.getAttachedTo()); + if (enchantedPermanent != null) { + newController = game.getPlayer(enchantedPermanent.getControllerId()); + enchantedPermanent.sacrifice(source.getSourceId(), game); + } + if (newController != null) { + FilterPermanent filter = new FilterPermanent("creature or land permanent you control"); + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + filter.add(new ControllerIdPredicate(newController.getId())); + filter.add(new CanBeEnchantedByPredicate(nettlevineBlight)); + Target target = new TargetPermanent(filter); + target.setNotTarget(true); + if (target.canChoose(source.getSourceId(), newController.getId(), game) + && newController.choose(outcome, target, source.getSourceId(), game)) { + Permanent chosenPermanent = game.getPermanent(target.getFirstTarget()); + if (chosenPermanent != null) { + Card nettlevineBlightCard = game.getCard(source.getSourceId()); + if (nettlevineBlightCard != null) { + nettlevineBlightCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), newController.getId()); + game.getState().setValue("attachTo:" + nettlevineBlight.getId(), chosenPermanent); + chosenPermanent.addAttachment(nettlevineBlight.getId(), game); + return true; + } + } + } + } + } + return false; + } +} diff --git a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java index d43d5717fc5..748ac55fd5f 100644 --- a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java @@ -149,7 +149,7 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { case ANY: return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of each end step, ").toString(); case CONTROLLER_ATTACHED_TO: - return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of the end step of enchanted creature's controller, ").toString(); + return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of the end step of enchanted permanent's controller, ").toString(); } return ""; } From 7e3661895498e6347e383e82745b7329e61bf01e Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 11 Jul 2017 13:02:43 -0500 Subject: [PATCH 09/29] - LKI zone for Nettlevine Blight. --- Mage.Sets/src/mage/cards/n/NettlevineBlight.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/n/NettlevineBlight.java b/Mage.Sets/src/mage/cards/n/NettlevineBlight.java index 097bece2bd3..654baf0582c 100644 --- a/Mage.Sets/src/mage/cards/n/NettlevineBlight.java +++ b/Mage.Sets/src/mage/cards/n/NettlevineBlight.java @@ -133,7 +133,8 @@ class NettlevineBlightEffect extends OneShotEffect { if (chosenPermanent != null) { Card nettlevineBlightCard = game.getCard(source.getSourceId()); if (nettlevineBlightCard != null) { - nettlevineBlightCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), newController.getId()); + Zone zone = game.getState().getZone(nettlevineBlightCard.getId()); + nettlevineBlightCard.putOntoBattlefield(game, zone, source.getSourceId(), newController.getId()); game.getState().setValue("attachTo:" + nettlevineBlight.getId(), chosenPermanent); chosenPermanent.addAttachment(nettlevineBlight.getId(), game); return true; From e26633983fb227a27896c92c94ed7967e19b15a6 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 11 Jul 2017 16:53:01 -0500 Subject: [PATCH 10/29] - Added Twinning Glass, Hunt Down, and Captivating Glance. [Lorwyn] Lorwyn set is 100%. --- .../src/mage/cards/c/CaptivatingGlance.java | 127 +++++++++++++++++ Mage.Sets/src/mage/cards/h/HuntDown.java | 134 ++++++++++++++++++ Mage.Sets/src/mage/cards/t/TwinningGlass.java | 128 +++++++++++++++++ 3 files changed, 389 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CaptivatingGlance.java create mode 100644 Mage.Sets/src/mage/cards/h/HuntDown.java create mode 100644 Mage.Sets/src/mage/cards/t/TwinningGlass.java diff --git a/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java b/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java new file mode 100644 index 00000000000..2d082f974a2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java @@ -0,0 +1,127 @@ +/* + * 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.c; + +import java.util.UUID; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ClashEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class CaptivatingGlance extends CardImpl { + + public CaptivatingGlance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // At the beginning of your end step, clash with an opponent. If you win, gain control of enchanted creature. Otherwise, that player gains control of enchanted creature. + this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new CaptivatingGlanceEffect(), false)); + + } + + public CaptivatingGlance(final CaptivatingGlance card) { + super(card); + } + + @Override + public CaptivatingGlance copy() { + return new CaptivatingGlance(this); + } +} + +class CaptivatingGlanceEffect extends OneShotEffect { + + public CaptivatingGlanceEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "clash with an opponent. If you win, gain control of enchanted creature. Otherwise, that player gains control of enchanted creature"; + } + + public CaptivatingGlanceEffect(final CaptivatingGlanceEffect effect) { + super(effect); + } + + @Override + public CaptivatingGlanceEffect copy() { + return new CaptivatingGlanceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + final boolean clashResult; + Player controller = game.getPlayer(source.getControllerId()); + Permanent captivatingGlance = game.getPermanent(source.getSourceId()); + if (controller != null + && captivatingGlance != null) { + Permanent enchantedCreature = game.getPermanent(captivatingGlance.getAttachedTo()); + clashResult = ClashEffect.getInstance().apply(game, source); + if (enchantedCreature != null) { + if (clashResult) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, controller.getId()); + effect.setTargetPointer(new FixedTarget(enchantedCreature.getId())); + game.addEffect(effect, source); + } else { + Player opponentWhomControllerClashedWith = game.getPlayer(targetPointer.getFirst(game, source)); + if (opponentWhomControllerClashedWith != null) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, opponentWhomControllerClashedWith.getId()); + effect.setTargetPointer(new FixedTarget(enchantedCreature.getId())); + game.addEffect(effect, source); + } + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/h/HuntDown.java b/Mage.Sets/src/mage/cards/h/HuntDown.java new file mode 100644 index 00000000000..a4a35c20ed1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HuntDown.java @@ -0,0 +1,134 @@ +/* + * 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.h; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.RequirementEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.common.BlockedAttackerWatcher; + +/** + * + * @author jeffwadsworth + */ +public class HuntDown extends CardImpl { + + private static final FilterCreaturePermanent filterMustBlock = new FilterCreaturePermanent("Creature that must block"); + private static final FilterCreaturePermanent filterToBeBlocked = new FilterCreaturePermanent("Creature that is to be blocked"); + + + + public HuntDown(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + + // Target creature blocks target creature this turn if able. + this.getSpellAbility().addEffect(new HuntDownEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterMustBlock)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterToBeBlocked)); + this.getSpellAbility().addWatcher(new BlockedAttackerWatcher()); + + } + + public HuntDown(final HuntDown card) { + super(card); + } + + @Override + public HuntDown copy() { + return new HuntDown(this); + } +} + +class HuntDownEffect extends RequirementEffect { + + public HuntDownEffect() { + this(Duration.EndOfTurn); + } + + public HuntDownEffect(Duration duration) { + super(duration); + staticText = "Target creature blocks target creature this turn if able"; + } + + public HuntDownEffect(final HuntDownEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getTargets().get(0).getFirstTarget())) { + Permanent blocker = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + if (blocker != null + && blocker.canBlock(source.getTargets().get(1).getFirstTarget(), game)) { + Permanent attacker = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (attacker != null) { + BlockedAttackerWatcher blockedAttackerWatcher = (BlockedAttackerWatcher) game.getState().getWatchers().get(BlockedAttackerWatcher.class.getSimpleName()); + if (blockedAttackerWatcher != null + && blockedAttackerWatcher.creatureHasBlockedAttacker(attacker, blocker, game)) { + // has already blocked this turn, so no need to do again + return false; + } + return true; + } else { + discard(); + } + } + } + return false; + } + + @Override + public boolean mustAttack(Game game) { + return false; + } + + @Override + public boolean mustBlock(Game game) { + return true; + } + + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return source.getTargets().get(1).getFirstTarget(); + } + + @Override + public HuntDownEffect copy() { + return new HuntDownEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/t/TwinningGlass.java b/Mage.Sets/src/mage/cards/t/TwinningGlass.java new file mode 100644 index 00000000000..2b47c754213 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TwinningGlass.java @@ -0,0 +1,128 @@ +/* + * 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.t; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author jeffwadsworth + */ +public class TwinningGlass extends CardImpl { + + public TwinningGlass(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // {1}, {tap}: You may cast a nonland card from your hand without paying its mana cost if it has the same name as a spell that was cast this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TwinningGlassEffect(), new ManaCostsImpl("{1}")); + ability.addWatcher(new SpellsCastWatcher()); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public TwinningGlass(final TwinningGlass card) { + super(card); + } + + @Override + public TwinningGlass copy() { + return new TwinningGlass(this); + } +} + +class TwinningGlassEffect extends OneShotEffect { + + public TwinningGlassEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "You may cast a nonland card from your hand without paying its mana cost if it has the same name as a spell that was cast this turn"; + } + + public TwinningGlassEffect(final TwinningGlassEffect effect) { + super(effect); + } + + @Override + public TwinningGlassEffect copy() { + return new TwinningGlassEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterCard filterCard = new FilterCard(); + Permanent twinningGlass = game.getPermanent(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getSimpleName()); + if (twinningGlass == null) { + twinningGlass = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + } + if (twinningGlass != null + && controller != null + && watcher != null) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + List spells = watcher.getSpellsCastThisTurn(playerId); + if (spells != null + && !spells.isEmpty()) { + for (Spell spell : spells) { + filterCard.add(new NamePredicate(spell.getName())); + } + } + } + TargetCardInHand target = new TargetCardInHand(0, 1, filterCard); + if (controller.choose(Outcome.Benefit, controller.getHand(), target, game)) { + Card chosenCard = game.getCard(target.getFirstTarget()); + if (chosenCard != null) { + if (controller.chooseUse(outcome, "Cast the card without paying mana cost?", source, game)) { + return controller.cast(chosenCard.getSpellAbility(), game, true); + } + } + } + } + return false; + } +} From 4a6b2e8db3a8fa318f71cc2486abe503c81f6ce5 Mon Sep 17 00:00:00 2001 From: spjspj Date: Wed, 12 Jul 2017 12:16:15 +1000 Subject: [PATCH 11/29] Implement Memory Crystal (EXO) --- Mage.Sets/src/mage/cards/m/MemoryCrystal.java | 19 +++++++++-- .../abilities/keyword/BuybackAbility.java | 33 +++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/MemoryCrystal.java b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java index 38022dbc388..a1a0c9975ce 100644 --- a/Mage.Sets/src/mage/cards/m/MemoryCrystal.java +++ b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java @@ -33,6 +33,8 @@ import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.BuybackCondition; import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -80,7 +82,18 @@ class MemoryCrystalSpellsCostReductionEffect extends CostModificationEffectImpl @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { - CardUtil.reduceCost(abilityToModify, 2); + + Card card = game.getCard(abilityToModify.getSourceId()); + if (card != null) { + for (Ability ability : card.getAbilities()) { + if (ability instanceof BuybackAbility) { + if (((BuybackAbility) ability).isActivated()) { + int amountToReduce = ((BuybackAbility) ability).reduceCost(2); + CardUtil.reduceCost(abilityToModify, amountToReduce); + } + } + } + } return true; } @@ -90,7 +103,9 @@ class MemoryCrystalSpellsCostReductionEffect extends CostModificationEffectImpl if (abilityToModify.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { - return BuybackCondition.instance.apply(game, abilityToModify); + if (BuybackCondition.instance.apply(game, abilityToModify)) { + return true; + } } } } diff --git a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java index 8bd67d03487..4f3550804e2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java @@ -28,6 +28,7 @@ package mage.abilities.keyword; import java.util.Iterator; +import java.util.List; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.StaticAbility; @@ -36,6 +37,8 @@ import mage.abilities.costs.Costs; import mage.abilities.costs.OptionalAdditionalCost; import mage.abilities.costs.OptionalAdditionalCostImpl; import mage.abilities.costs.OptionalAdditionalSourceCosts; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; @@ -66,6 +69,7 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS private static final String reminderTextCost = "You may {cost} in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves."; private static final String reminderTextMana = "You may pay an additional {cost} as you cast this spell. If you do, put this card into your hand as it resolves."; protected OptionalAdditionalCost buybackCost; + private int amountToReduceBy = 0; public BuybackAbility(String manaString) { super(Zone.STACK, new BuybackEffect()); @@ -94,6 +98,33 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS if (buybackCost != null) { ((Costs) buybackCost).add(cost); } + } + + public void resetReduceCost() { + amountToReduceBy = 0; + } + + // Called by Memory Crystal to reduce mana costs. + public int reduceCost(int genericManaToReduce) { + int amountToReduce = genericManaToReduce; + if (buybackCost != null) { + for (Object cost : ((Costs) buybackCost)) { + if (cost instanceof ManaCostsImpl) { + for (Object c : (ManaCostsImpl) cost) { + if (c instanceof GenericManaCost) { + int newCostCMC = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy - genericManaToReduce; + if (newCostCMC > 0) { + amountToReduceBy += genericManaToReduce; + } else { + amountToReduce = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy; + amountToReduceBy = ((GenericManaCost) c).convertedManaCost(); + } + } + } + } + } + } + return amountToReduce; } @Override @@ -101,12 +132,14 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS if (buybackCost != null) { return buybackCost.isActivated(); } + resetReduceCost(); return false; } public void resetBuyback() { if (buybackCost != null) { buybackCost.reset(); + resetReduceCost(); } } From ed512d3a1dbd52b53a34c9402a85054540c9e4ea Mon Sep 17 00:00:00 2001 From: spjspj Date: Wed, 12 Jul 2017 12:40:14 +1000 Subject: [PATCH 12/29] Implement Memory Crystal (EXO) --- .../abilities/keyword/BuybackAbility.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java index 4f3550804e2..4acdd64bbf7 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java @@ -28,7 +28,6 @@ package mage.abilities.keyword; import java.util.Iterator; -import java.util.List; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.StaticAbility; @@ -38,7 +37,6 @@ import mage.abilities.costs.OptionalAdditionalCost; import mage.abilities.costs.OptionalAdditionalCostImpl; import mage.abilities.costs.OptionalAdditionalSourceCosts; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; @@ -98,8 +96,8 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS if (buybackCost != null) { ((Costs) buybackCost).add(cost); } - } - + } + public void resetReduceCost() { amountToReduceBy = 0; } @@ -107,24 +105,29 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS // Called by Memory Crystal to reduce mana costs. public int reduceCost(int genericManaToReduce) { int amountToReduce = genericManaToReduce; + boolean foundCostToReduce = false; if (buybackCost != null) { for (Object cost : ((Costs) buybackCost)) { - if (cost instanceof ManaCostsImpl) { + if (cost instanceof ManaCostsImpl) { for (Object c : (ManaCostsImpl) cost) { - if (c instanceof GenericManaCost) { + if (c instanceof GenericManaCost) { int newCostCMC = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy - genericManaToReduce; + foundCostToReduce = true; if (newCostCMC > 0) { amountToReduceBy += genericManaToReduce; } else { amountToReduce = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy; amountToReduceBy = ((GenericManaCost) c).convertedManaCost(); - } + } } } } } } - return amountToReduce; + if (foundCostToReduce) { + return amountToReduce; + } + return 0; } @Override From 02b0fa3d5404da1c717b0feffc5b4b5be1510181 Mon Sep 17 00:00:00 2001 From: spjspj Date: Wed, 12 Jul 2017 13:51:06 +1000 Subject: [PATCH 13/29] Minor fix --- Mage.Sets/src/mage/cards/m/MindGames.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/m/MindGames.java b/Mage.Sets/src/mage/cards/m/MindGames.java index 7b62736f882..3f816185e84 100644 --- a/Mage.Sets/src/mage/cards/m/MindGames.java +++ b/Mage.Sets/src/mage/cards/m/MindGames.java @@ -57,7 +57,7 @@ public class MindGames extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Buyback {2}{U} - this.addAbility(new BuybackAbility("{3}")); + this.addAbility(new BuybackAbility("{2}{U}")); // Tap target artifact, creature, or land. this.getSpellAbility().addEffect(new TapTargetEffect()); From eb9a18c07af5b36f153b3d1ba4a2cb299fe773c1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 12 Jul 2017 17:05:44 +0200 Subject: [PATCH 14/29] * Fixed a problem that you can see the second card from top of libraray while able to cancel the cast of the top card (fixes #3196). --- .../common/continuous/PlayTheTopCardEffect.java | 1 - .../PlayWithTheTopCardRevealedEffect.java | 17 +++++++++++++++-- Mage/src/main/java/mage/game/stack/Spell.java | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java index 0f7ed647904..d33def78493 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java @@ -32,7 +32,6 @@ import mage.abilities.Ability; import mage.abilities.effects.AsThoughEffectImpl; import mage.cards.Card; import mage.constants.AsThoughEffectType; -import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.filter.FilterCard; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java index 9cfd1c4ddcf..07243eb3c21 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java @@ -34,7 +34,10 @@ import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; +import mage.constants.Zone; import mage.game.Game; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; import mage.players.Player; /** @@ -70,11 +73,11 @@ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { if (allPlayers) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); - if (player != null) { + if (player != null && !isCastFromPlayersLibrary(game, playerId)) { player.setTopCardRevealed(true); } } - } else { + } else if (!isCastFromPlayersLibrary(game, controller.getId())) { controller.setTopCardRevealed(true); } return true; @@ -82,6 +85,16 @@ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { return false; } + boolean isCastFromPlayersLibrary(Game game, UUID playerId) { + if (!game.getStack().isEmpty()) { + StackObject stackObject = game.getStack().getLast(); + return stackObject instanceof Spell + && !((Spell) stackObject).isDoneActivatingManaAbilities() + && Zone.LIBRARY.equals(((Spell) stackObject).getFromZone()); + } + return false; + } + @Override public PlayWithTheTopCardRevealedEffect copy() { return new PlayWithTheTopCardRevealedEffect(this); diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index 863302c53fa..1a46a0d9093 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -138,6 +138,7 @@ public class Spell extends StackObjImpl implements Card { } public boolean activate(Game game, boolean noMana) { + setDoneActivatingManaAbilities(false); // Used for e.g. improvise if (!spellAbilities.get(0).activate(game, noMana)) { return false; } @@ -157,7 +158,7 @@ public class Spell extends StackObjImpl implements Card { } } } - setDoneActivatingManaAbilities(false); // can be activated again maybe during the resolution of the spell (e.g. Metallic Rebuke) + setDoneActivatingManaAbilities(true); // can be activated again maybe during the resolution of the spell (e.g. Metallic Rebuke) return true; } From 37c6d3e3f6a9357e47e38b7839251f82a6369142 Mon Sep 17 00:00:00 2001 From: Lazar Date: Wed, 12 Jul 2017 21:18:36 +0200 Subject: [PATCH 15/29] removed trample (#3671) It doesn't have trample --- .../java/mage/game/permanent/token/RhonassLastStandToken.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java b/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java index 0fd73334c90..204344b824b 100644 --- a/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java @@ -44,6 +44,5 @@ public class RhonassLastStandToken extends Token { subtype.add("Snake"); power = new MageInt(5); toughness = new MageInt(4); - addAbility(TrampleAbility.getInstance()); } } From 7bb5721880beb46ebbbc4c72f055207750add0c5 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 12 Jul 2017 15:41:39 -0500 Subject: [PATCH 16/29] - Added requested card Breathstealer's Crypt. --- .../src/mage/cards/b/BreathstealersCrypt.java | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java diff --git a/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java new file mode 100644 index 00000000000..ec74c249f6d --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java @@ -0,0 +1,128 @@ +/* + * 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.b; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class BreathstealersCrypt extends CardImpl { + + public BreathstealersCrypt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}"); + + // If a player would draw a card, instead he or she draws a card and reveals it. If it's a creature card, that player discards it unless he or she pays 3 life. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BreathstealersCryptEffect())); + + } + + public BreathstealersCrypt(final BreathstealersCrypt card) { + super(card); + } + + @Override + public BreathstealersCrypt copy() { + return new BreathstealersCrypt(this); + } +} + +class BreathstealersCryptEffect extends ReplacementEffectImpl { + + public BreathstealersCryptEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseLife); + staticText = "If a player would draw a card, instead he or she draws a card and reveals it. If it's a creature card, that player discards it unless he or she pays 3 life"; + } + + public BreathstealersCryptEffect(final BreathstealersCryptEffect effect) { + super(effect); + } + + @Override + public BreathstealersCryptEffect copy() { + return new BreathstealersCryptEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player player = game.getPlayer(event.getPlayerId()); + PayLifeCost cost = new PayLifeCost(3); + if (player != null) { + Card cardDrawn = player.getLibrary().removeFromTop(game); + if (cardDrawn != null) { + player.moveCardToHandWithInfo(cardDrawn, source.getSourceId(), game); + Cards cards = new CardsImpl(); + cards.add(cardDrawn); + player.revealCards("The card drawn from " + player.getName() + "'s library", cards, game); + if (cardDrawn.isCreature()) { + game.informPlayers("The card drawn by " + player.getName() + " is a creature card. He/she must pay 3 life or that card gets discarded."); + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && player.chooseUse(outcome, "Do you wish to pay 3 life to keep the drawn creature card? If not, you discard it.", source, game)) { + return cost.pay(source, game, source.getSourceId(), player.getId(), true, cost); + } else { + game.informPlayers("The cost of 3 life was not paid by " + player.getName() + ", so the creature card will be discarded."); + return player.discard(cardDrawn, source, game); + } + } + } + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DRAW_CARD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return true; + } +} From 3efb5c3e2a0dbcf1dcd19a210dfbd9a1acd5624e Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 12 Jul 2017 15:48:00 -0500 Subject: [PATCH 17/29] - Commit changes to Sets files. --- Mage.Sets/src/mage/sets/Lorwyn.java | 4 + Mage.Sets/src/mage/sets/Visions.java | 365 ++++++++++++++------------- 2 files changed, 187 insertions(+), 182 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Lorwyn.java b/Mage.Sets/src/mage/sets/Lorwyn.java index 666c5772dbc..b409b5f3f9a 100644 --- a/Mage.Sets/src/mage/sets/Lorwyn.java +++ b/Mage.Sets/src/mage/sets/Lorwyn.java @@ -87,6 +87,7 @@ public class Lorwyn extends ExpansionSet { cards.add(new SetCardInfo("Broken Ambitions", 54, Rarity.COMMON, mage.cards.b.BrokenAmbitions.class)); cards.add(new SetCardInfo("Burrenton Forge-Tender", 7, Rarity.UNCOMMON, mage.cards.b.BurrentonForgeTender.class)); cards.add(new SetCardInfo("Cairn Wanderer", 105, Rarity.RARE, mage.cards.c.CairnWanderer.class)); + cards.add(new SetCardInfo("Captivating Glance", 55, Rarity.UNCOMMON, mage.cards.c.CaptivatingGlance.class)); cards.add(new SetCardInfo("Caterwauling Boggart", 157, Rarity.COMMON, mage.cards.c.CaterwaulingBoggart.class)); cards.add(new SetCardInfo("Ceaseless Searblades", 158, Rarity.UNCOMMON, mage.cards.c.CeaselessSearblades.class)); cards.add(new SetCardInfo("Cenn's Heir", 8, Rarity.COMMON, mage.cards.c.CennsHeir.class)); @@ -179,6 +180,7 @@ public class Lorwyn extends ExpansionSet { cards.add(new SetCardInfo("Hornet Harasser", 118, Rarity.COMMON, mage.cards.h.HornetHarasser.class)); cards.add(new SetCardInfo("Hostility", 176, Rarity.RARE, mage.cards.h.Hostility.class)); cards.add(new SetCardInfo("Howltooth Hollow", 269, Rarity.RARE, mage.cards.h.HowltoothHollow.class)); + cards.add(new SetCardInfo("Hunt Down", 218, Rarity.COMMON, mage.cards.h.HuntDown.class)); cards.add(new SetCardInfo("Hunter of Eyeblights", 119, Rarity.UNCOMMON, mage.cards.h.HunterOfEyeblights.class)); cards.add(new SetCardInfo("Hurly-Burly", 177, Rarity.COMMON, mage.cards.h.HurlyBurly.class)); cards.add(new SetCardInfo("Immaculate Magistrate", 219, Rarity.RARE, mage.cards.i.ImmaculateMagistrate.class)); @@ -243,6 +245,7 @@ public class Lorwyn extends ExpansionSet { cards.add(new SetCardInfo("Neck Snap", 32, Rarity.COMMON, mage.cards.n.NeckSnap.class)); cards.add(new SetCardInfo("Nectar Faerie", 130, Rarity.UNCOMMON, mage.cards.n.NectarFaerie.class)); cards.add(new SetCardInfo("Needle Drop", 186, Rarity.COMMON, mage.cards.n.NeedleDrop.class)); + cards.add(new SetCardInfo("Nettlevine Blight", 131, Rarity.RARE, mage.cards.n.NettlevineBlight.class)); cards.add(new SetCardInfo("Nightshade Stinger", 132, Rarity.COMMON, mage.cards.n.NightshadeStinger.class)); cards.add(new SetCardInfo("Nova Chaser", 187, Rarity.RARE, mage.cards.n.NovaChaser.class)); cards.add(new SetCardInfo("Oaken Brawler", 33, Rarity.COMMON, mage.cards.o.OakenBrawler.class)); @@ -323,6 +326,7 @@ public class Lorwyn extends ExpansionSet { cards.add(new SetCardInfo("Treefolk Harbinger", 239, Rarity.UNCOMMON, mage.cards.t.TreefolkHarbinger.class)); cards.add(new SetCardInfo("Triclopean Sight", 45, Rarity.COMMON, mage.cards.t.TriclopeanSight.class)); cards.add(new SetCardInfo("Turtleshell Changeling", 94, Rarity.UNCOMMON, mage.cards.t.TurtleshellChangeling.class)); + cards.add(new SetCardInfo("Twinning Glass", 264, Rarity.RARE, mage.cards.t.TwinningGlass.class)); cards.add(new SetCardInfo("Veteran of the Depths", 46, Rarity.UNCOMMON, mage.cards.v.VeteranOfTheDepths.class)); cards.add(new SetCardInfo("Vigor", 240, Rarity.RARE, mage.cards.v.Vigor.class)); cards.add(new SetCardInfo("Vivid Crag", 275, Rarity.UNCOMMON, mage.cards.v.VividCrag.class)); diff --git a/Mage.Sets/src/mage/sets/Visions.java b/Mage.Sets/src/mage/sets/Visions.java index acbd7a675fa..a4d48e5e98b 100644 --- a/Mage.Sets/src/mage/sets/Visions.java +++ b/Mage.Sets/src/mage/sets/Visions.java @@ -1,182 +1,183 @@ -/* - * 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.sets; - -import mage.cards.ExpansionSet; -import mage.constants.Rarity; -import mage.constants.SetType; - -/** - * - * @author North - */ -public class Visions extends ExpansionSet { - - private static final Visions instance = new Visions(); - - public static Visions getInstance() { - return instance; - } - - private Visions() { - super("Visions", "VIS", ExpansionSet.buildDate(1997, 1, 11), SetType.EXPANSION); - this.blockName = "Mirage"; - this.parentSet = Mirage.getInstance(); - this.hasBasicLands = false; - this.hasBoosters = true; - this.numBoosterLands = 0; - this.numBoosterCommon = 11; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - cards.add(new SetCardInfo("Anvil of Bogardan", 141, Rarity.RARE, mage.cards.a.AnvilOfBogardan.class)); - cards.add(new SetCardInfo("Archangel", 101, Rarity.RARE, mage.cards.a.Archangel.class)); - cards.add(new SetCardInfo("Army Ants", 126, Rarity.UNCOMMON, mage.cards.a.ArmyAnts.class)); - cards.add(new SetCardInfo("Betrayal", 26, Rarity.COMMON, mage.cards.b.Betrayal.class)); - cards.add(new SetCardInfo("Blanket of Night", 2, Rarity.UNCOMMON, mage.cards.b.BlanketOfNight.class)); - cards.add(new SetCardInfo("Breezekeeper", 27, Rarity.COMMON, mage.cards.b.Breezekeeper.class)); - cards.add(new SetCardInfo("Bull Elephant", 51, Rarity.COMMON, mage.cards.b.BullElephant.class)); - cards.add(new SetCardInfo("Chronatog", 28, Rarity.RARE, mage.cards.c.Chronatog.class)); - cards.add(new SetCardInfo("City of Solitude", 52, Rarity.RARE, mage.cards.c.CityOfSolitude.class)); - cards.add(new SetCardInfo("Cloud Elemental", 29, Rarity.COMMON, mage.cards.c.CloudElemental.class)); - cards.add(new SetCardInfo("Coercion", 4, Rarity.COMMON, mage.cards.c.Coercion.class)); - cards.add(new SetCardInfo("Coral Atoll", 160, Rarity.UNCOMMON, mage.cards.c.CoralAtoll.class)); - cards.add(new SetCardInfo("Creeping Mold", 53, Rarity.UNCOMMON, mage.cards.c.CreepingMold.class)); - cards.add(new SetCardInfo("Crypt Rats", 5, Rarity.COMMON, mage.cards.c.CryptRats.class)); - cards.add(new SetCardInfo("Daraja Griffin", 102, Rarity.UNCOMMON, mage.cards.d.DarajaGriffin.class)); - cards.add(new SetCardInfo("Death Watch", 7, Rarity.COMMON, mage.cards.d.DeathWatch.class)); - cards.add(new SetCardInfo("Desertion", 30, Rarity.RARE, mage.cards.d.Desertion.class)); - cards.add(new SetCardInfo("Diamond Kaleidoscope", 143, Rarity.RARE, mage.cards.d.DiamondKaleidoscope.class)); - cards.add(new SetCardInfo("Dormant Volcano", 161, Rarity.UNCOMMON, mage.cards.d.DormantVolcano.class)); - cards.add(new SetCardInfo("Dragon Mask", 144, Rarity.UNCOMMON, mage.cards.d.DragonMask.class)); - cards.add(new SetCardInfo("Dwarven Vigilantes", 77, Rarity.COMMON, mage.cards.d.DwarvenVigilantes.class)); - cards.add(new SetCardInfo("Elephant Grass", 54, Rarity.UNCOMMON, mage.cards.e.ElephantGrass.class)); - cards.add(new SetCardInfo("Elven Cache", 55, Rarity.COMMON, mage.cards.e.ElvenCache.class)); - cards.add(new SetCardInfo("Emerald Charm", 56, Rarity.COMMON, mage.cards.e.EmeraldCharm.class)); - cards.add(new SetCardInfo("Equipoise", 103, Rarity.RARE, mage.cards.e.Equipoise.class)); - cards.add(new SetCardInfo("Everglades", 162, Rarity.UNCOMMON, mage.cards.e.Everglades.class)); - cards.add(new SetCardInfo("Eye of Singularity", 104, Rarity.RARE, mage.cards.e.EyeOfSingularity.class)); - cards.add(new SetCardInfo("Fallen Askari", 9, Rarity.COMMON, mage.cards.f.FallenAskari.class)); - cards.add(new SetCardInfo("Femeref Enchantress", 129, Rarity.RARE, mage.cards.f.FemerefEnchantress.class)); - cards.add(new SetCardInfo("Feral Instinct", 57, Rarity.COMMON, mage.cards.f.FeralInstinct.class)); - cards.add(new SetCardInfo("Fireblast", 79, Rarity.COMMON, mage.cards.f.Fireblast.class)); - cards.add(new SetCardInfo("Firestorm Hellkite", 130, Rarity.RARE, mage.cards.f.FirestormHellkite.class)); - cards.add(new SetCardInfo("Flooded Shoreline", 32, Rarity.RARE, mage.cards.f.FloodedShoreline.class)); - cards.add(new SetCardInfo("Freewind Falcon", 105, Rarity.COMMON, mage.cards.f.FreewindFalcon.class)); - cards.add(new SetCardInfo("Funeral Charm", 11, Rarity.COMMON, mage.cards.f.FuneralCharm.class)); - cards.add(new SetCardInfo("Giant Caterpillar", 58, Rarity.COMMON, mage.cards.g.GiantCaterpillar.class)); - cards.add(new SetCardInfo("Goblin Recruiter", 80, Rarity.UNCOMMON, mage.cards.g.GoblinRecruiter.class)); - cards.add(new SetCardInfo("Goblin Swine-Rider", 81, Rarity.COMMON, mage.cards.g.GoblinSwineRider.class)); - cards.add(new SetCardInfo("Gossamer Chains", 106, Rarity.COMMON, mage.cards.g.GossamerChains.class)); - cards.add(new SetCardInfo("Griffin Canyon", 163, Rarity.RARE, mage.cards.g.GriffinCanyon.class)); - cards.add(new SetCardInfo("Hearth Charm", 82, Rarity.COMMON, mage.cards.h.HearthCharm.class)); - cards.add(new SetCardInfo("Helm of Awakening", 145, Rarity.UNCOMMON, mage.cards.h.HelmOfAwakening.class)); - cards.add(new SetCardInfo("Hope Charm", 108, Rarity.COMMON, mage.cards.h.HopeCharm.class)); - cards.add(new SetCardInfo("Hulking Cyclops", 84, Rarity.UNCOMMON, mage.cards.h.HulkingCyclops.class)); - cards.add(new SetCardInfo("Impulse", 34, Rarity.COMMON, mage.cards.i.Impulse.class)); - cards.add(new SetCardInfo("Infantry Veteran", 109, Rarity.COMMON, mage.cards.i.InfantryVeteran.class)); - cards.add(new SetCardInfo("Inspiration", 35, Rarity.COMMON, mage.cards.i.Inspiration.class)); - cards.add(new SetCardInfo("Jamuraan Lion", 110, Rarity.COMMON, mage.cards.j.JamuraanLion.class)); - cards.add(new SetCardInfo("Jungle Basin", 164, Rarity.UNCOMMON, mage.cards.j.JungleBasin.class)); - cards.add(new SetCardInfo("Kaervek's Spite", 13, Rarity.RARE, mage.cards.k.KaerveksSpite.class)); - cards.add(new SetCardInfo("Karoo", 165, Rarity.UNCOMMON, mage.cards.k.Karoo.class)); - cards.add(new SetCardInfo("Keeper of Kookus", 85, Rarity.COMMON, mage.cards.k.KeeperOfKookus.class)); - cards.add(new SetCardInfo("King Cheetah", 60, Rarity.COMMON, mage.cards.k.KingCheetah.class)); - cards.add(new SetCardInfo("Knight of Valor", 111, Rarity.COMMON, mage.cards.k.KnightOfValor.class)); - cards.add(new SetCardInfo("Lightning Cloud", 87, Rarity.RARE, mage.cards.l.LightningCloud.class)); - cards.add(new SetCardInfo("Longbow Archer", 112, Rarity.UNCOMMON, mage.cards.l.LongbowArcher.class)); - cards.add(new SetCardInfo("Magma Mine", 149, Rarity.UNCOMMON, mage.cards.m.MagmaMine.class)); - cards.add(new SetCardInfo("Man-o'-War", 37, Rarity.COMMON, mage.cards.m.ManOWar.class)); - cards.add(new SetCardInfo("Miraculous Recovery", 113, Rarity.UNCOMMON, mage.cards.m.MiraculousRecovery.class)); - cards.add(new SetCardInfo("Mortal Wound", 63, Rarity.COMMON, mage.cards.m.MortalWound.class)); - cards.add(new SetCardInfo("Mundungu", 132, Rarity.UNCOMMON, mage.cards.m.Mundungu.class)); - cards.add(new SetCardInfo("Mystic Veil", 38, Rarity.COMMON, mage.cards.m.MysticVeil.class)); - cards.add(new SetCardInfo("Natural Order", 64, Rarity.RARE, mage.cards.n.NaturalOrder.class)); - cards.add(new SetCardInfo("Necromancy", 14, Rarity.UNCOMMON, mage.cards.n.Necromancy.class)); - cards.add(new SetCardInfo("Necrosavant", 15, Rarity.RARE, mage.cards.n.Necrosavant.class)); - cards.add(new SetCardInfo("Nekrataal", 16, Rarity.UNCOMMON, mage.cards.n.Nekrataal.class)); - cards.add(new SetCardInfo("Panther Warriors", 65, Rarity.COMMON, mage.cards.p.PantherWarriors.class)); - cards.add(new SetCardInfo("Parapet", 114, Rarity.COMMON, mage.cards.p.Parapet.class)); - cards.add(new SetCardInfo("Phyrexian Marauder", 151, Rarity.RARE, mage.cards.p.PhyrexianMarauder.class)); - cards.add(new SetCardInfo("Phyrexian Walker", 152, Rarity.COMMON, mage.cards.p.PhyrexianWalker.class)); - cards.add(new SetCardInfo("Prosperity", 40, Rarity.UNCOMMON, mage.cards.p.Prosperity.class)); - cards.add(new SetCardInfo("Python", 18, Rarity.COMMON, mage.cards.p.Python.class)); - cards.add(new SetCardInfo("Quicksand", 166, Rarity.UNCOMMON, mage.cards.q.Quicksand.class)); - cards.add(new SetCardInfo("Quirion Ranger", 67, Rarity.COMMON, mage.cards.q.QuirionRanger.class)); - cards.add(new SetCardInfo("Raging Gorilla", 90, Rarity.COMMON, mage.cards.r.RagingGorilla.class)); - cards.add(new SetCardInfo("Rainbow Efreet", 41, Rarity.RARE, mage.cards.r.RainbowEfreet.class)); - cards.add(new SetCardInfo("Relentless Assault", 91, Rarity.RARE, mage.cards.r.RelentlessAssault.class)); - cards.add(new SetCardInfo("Relic Ward", 116, Rarity.UNCOMMON, mage.cards.r.RelicWard.class)); - cards.add(new SetCardInfo("Remedy", 117, Rarity.COMMON, mage.cards.r.Remedy.class)); - cards.add(new SetCardInfo("Resistance Fighter", 118, Rarity.COMMON, mage.cards.r.ResistanceFighter.class)); - cards.add(new SetCardInfo("Retribution of the Meek", 119, Rarity.RARE, mage.cards.r.RetributionOfTheMeek.class)); - cards.add(new SetCardInfo("Righteous Aura", 120, Rarity.COMMON, mage.cards.r.RighteousAura.class)); - cards.add(new SetCardInfo("River Boa", 68, Rarity.COMMON, mage.cards.r.RiverBoa.class)); - cards.add(new SetCardInfo("Rowen", 69, Rarity.RARE, mage.cards.r.Rowen.class)); - cards.add(new SetCardInfo("Scalebane's Elite", 135, Rarity.UNCOMMON, mage.cards.s.ScalebanesElite.class)); - cards.add(new SetCardInfo("Shrieking Drake", 43, Rarity.COMMON, mage.cards.s.ShriekingDrake.class)); - cards.add(new SetCardInfo("Simoon", 136, Rarity.UNCOMMON, mage.cards.s.Simoon.class)); - cards.add(new SetCardInfo("Sisay's Ring", 154, Rarity.COMMON, mage.cards.s.SisaysRing.class)); - cards.add(new SetCardInfo("Snake Basket", 155, Rarity.RARE, mage.cards.s.SnakeBasket.class)); - cards.add(new SetCardInfo("Solfatara", 93, Rarity.COMMON, mage.cards.s.Solfatara.class)); - cards.add(new SetCardInfo("Spider Climb", 70, Rarity.COMMON, mage.cards.s.SpiderClimb.class)); - cards.add(new SetCardInfo("Spitting Drake", 95, Rarity.UNCOMMON, mage.cards.s.SpittingDrake.class)); - cards.add(new SetCardInfo("Squandered Resources", 137, Rarity.RARE, mage.cards.s.SquanderedResources.class)); - cards.add(new SetCardInfo("Stampeding Wildebeests", 71, Rarity.UNCOMMON, mage.cards.s.StampedingWildebeests.class)); - cards.add(new SetCardInfo("Summer Bloom", 72, Rarity.UNCOMMON, mage.cards.s.SummerBloom.class)); - cards.add(new SetCardInfo("Sun Clasp", 121, Rarity.COMMON, mage.cards.s.SunClasp.class)); - cards.add(new SetCardInfo("Suq'Ata Assassin", 19, Rarity.UNCOMMON, mage.cards.s.SuqAtaAssassin.class)); - cards.add(new SetCardInfo("Suq'Ata Lancer", 96, Rarity.COMMON, mage.cards.s.SuqAtaLancer.class)); - cards.add(new SetCardInfo("Talruum Champion", 97, Rarity.COMMON, mage.cards.t.TalruumChampion.class)); - cards.add(new SetCardInfo("Talruum Piper", 98, Rarity.UNCOMMON, mage.cards.t.TalruumPiper.class)); - cards.add(new SetCardInfo("Tar Pit Warrior", 20, Rarity.COMMON, mage.cards.t.TarPitWarrior.class)); - cards.add(new SetCardInfo("Teferi's Honor Guard", 122, Rarity.UNCOMMON, mage.cards.t.TeferisHonorGuard.class)); - cards.add(new SetCardInfo("Teferi's Puzzle Box", 156, Rarity.RARE, mage.cards.t.TeferisPuzzleBox.class)); - cards.add(new SetCardInfo("Teferi's Realm", 44, Rarity.RARE, mage.cards.t.TeferisRealm.class)); - cards.add(new SetCardInfo("Tempest Drake", 139, Rarity.UNCOMMON, mage.cards.t.TempestDrake.class)); - cards.add(new SetCardInfo("Tithe", 123, Rarity.RARE, mage.cards.t.Tithe.class)); - cards.add(new SetCardInfo("Tremor", 99, Rarity.COMMON, mage.cards.t.Tremor.class)); - cards.add(new SetCardInfo("Triangle of War", 158, Rarity.RARE, mage.cards.t.TriangleOfWar.class)); - cards.add(new SetCardInfo("Uktabi Orangutan", 73, Rarity.UNCOMMON, mage.cards.u.UktabiOrangutan.class)); - cards.add(new SetCardInfo("Undiscovered Paradise", 167, Rarity.RARE, mage.cards.u.UndiscoveredParadise.class)); - cards.add(new SetCardInfo("Undo", 47, Rarity.COMMON, mage.cards.u.Undo.class)); - cards.add(new SetCardInfo("Urborg Mindsucker", 21, Rarity.COMMON, mage.cards.u.UrborgMindsucker.class)); - cards.add(new SetCardInfo("Vampiric Tutor", 22, Rarity.RARE, mage.cards.v.VampiricTutor.class)); - cards.add(new SetCardInfo("Vanishing", 48, Rarity.COMMON, mage.cards.v.Vanishing.class)); - cards.add(new SetCardInfo("Viashino Sandstalker", 100, Rarity.UNCOMMON, mage.cards.v.ViashinoSandstalker.class)); - cards.add(new SetCardInfo("Viashivan Dragon", 140, Rarity.RARE, mage.cards.v.ViashivanDragon.class)); - cards.add(new SetCardInfo("Vision Charm", 49, Rarity.COMMON, mage.cards.v.VisionCharm.class)); - cards.add(new SetCardInfo("Wake of Vultures", 24, Rarity.COMMON, mage.cards.w.WakeOfVultures.class)); - cards.add(new SetCardInfo("Wand of Denial", 159, Rarity.RARE, mage.cards.w.WandOfDenial.class)); - cards.add(new SetCardInfo("Warrior's Honor", 124, Rarity.COMMON, mage.cards.w.WarriorsHonor.class)); - cards.add(new SetCardInfo("Warthog", 74, Rarity.COMMON, mage.cards.w.Warthog.class)); - cards.add(new SetCardInfo("Waterspout Djinn", 50, Rarity.UNCOMMON, mage.cards.w.WaterspoutDjinn.class)); - cards.add(new SetCardInfo("Wicked Reward", 25, Rarity.COMMON, mage.cards.w.WickedReward.class)); - cards.add(new SetCardInfo("Zhalfirin Crusader", 125, Rarity.RARE, mage.cards.z.ZhalfirinCrusader.class)); - } -} +/* + * 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.sets; + +import mage.cards.ExpansionSet; +import mage.constants.Rarity; +import mage.constants.SetType; + +/** + * + * @author North + */ +public class Visions extends ExpansionSet { + + private static final Visions instance = new Visions(); + + public static Visions getInstance() { + return instance; + } + + private Visions() { + super("Visions", "VIS", ExpansionSet.buildDate(1997, 1, 11), SetType.EXPANSION); + this.blockName = "Mirage"; + this.parentSet = Mirage.getInstance(); + this.hasBasicLands = false; + this.hasBoosters = true; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + cards.add(new SetCardInfo("Anvil of Bogardan", 141, Rarity.RARE, mage.cards.a.AnvilOfBogardan.class)); + cards.add(new SetCardInfo("Archangel", 101, Rarity.RARE, mage.cards.a.Archangel.class)); + cards.add(new SetCardInfo("Army Ants", 126, Rarity.UNCOMMON, mage.cards.a.ArmyAnts.class)); + cards.add(new SetCardInfo("Betrayal", 26, Rarity.COMMON, mage.cards.b.Betrayal.class)); + cards.add(new SetCardInfo("Blanket of Night", 2, Rarity.UNCOMMON, mage.cards.b.BlanketOfNight.class)); + cards.add(new SetCardInfo("Breathstealer's Crypt", 127, Rarity.RARE, mage.cards.b.BreathstealersCrypt.class)); + cards.add(new SetCardInfo("Breezekeeper", 27, Rarity.COMMON, mage.cards.b.Breezekeeper.class)); + cards.add(new SetCardInfo("Bull Elephant", 51, Rarity.COMMON, mage.cards.b.BullElephant.class)); + cards.add(new SetCardInfo("Chronatog", 28, Rarity.RARE, mage.cards.c.Chronatog.class)); + cards.add(new SetCardInfo("City of Solitude", 52, Rarity.RARE, mage.cards.c.CityOfSolitude.class)); + cards.add(new SetCardInfo("Cloud Elemental", 29, Rarity.COMMON, mage.cards.c.CloudElemental.class)); + cards.add(new SetCardInfo("Coercion", 4, Rarity.COMMON, mage.cards.c.Coercion.class)); + cards.add(new SetCardInfo("Coral Atoll", 160, Rarity.UNCOMMON, mage.cards.c.CoralAtoll.class)); + cards.add(new SetCardInfo("Creeping Mold", 53, Rarity.UNCOMMON, mage.cards.c.CreepingMold.class)); + cards.add(new SetCardInfo("Crypt Rats", 5, Rarity.COMMON, mage.cards.c.CryptRats.class)); + cards.add(new SetCardInfo("Daraja Griffin", 102, Rarity.UNCOMMON, mage.cards.d.DarajaGriffin.class)); + cards.add(new SetCardInfo("Death Watch", 7, Rarity.COMMON, mage.cards.d.DeathWatch.class)); + cards.add(new SetCardInfo("Desertion", 30, Rarity.RARE, mage.cards.d.Desertion.class)); + cards.add(new SetCardInfo("Diamond Kaleidoscope", 143, Rarity.RARE, mage.cards.d.DiamondKaleidoscope.class)); + cards.add(new SetCardInfo("Dormant Volcano", 161, Rarity.UNCOMMON, mage.cards.d.DormantVolcano.class)); + cards.add(new SetCardInfo("Dragon Mask", 144, Rarity.UNCOMMON, mage.cards.d.DragonMask.class)); + cards.add(new SetCardInfo("Dwarven Vigilantes", 77, Rarity.COMMON, mage.cards.d.DwarvenVigilantes.class)); + cards.add(new SetCardInfo("Elephant Grass", 54, Rarity.UNCOMMON, mage.cards.e.ElephantGrass.class)); + cards.add(new SetCardInfo("Elven Cache", 55, Rarity.COMMON, mage.cards.e.ElvenCache.class)); + cards.add(new SetCardInfo("Emerald Charm", 56, Rarity.COMMON, mage.cards.e.EmeraldCharm.class)); + cards.add(new SetCardInfo("Equipoise", 103, Rarity.RARE, mage.cards.e.Equipoise.class)); + cards.add(new SetCardInfo("Everglades", 162, Rarity.UNCOMMON, mage.cards.e.Everglades.class)); + cards.add(new SetCardInfo("Eye of Singularity", 104, Rarity.RARE, mage.cards.e.EyeOfSingularity.class)); + cards.add(new SetCardInfo("Fallen Askari", 9, Rarity.COMMON, mage.cards.f.FallenAskari.class)); + cards.add(new SetCardInfo("Femeref Enchantress", 129, Rarity.RARE, mage.cards.f.FemerefEnchantress.class)); + cards.add(new SetCardInfo("Feral Instinct", 57, Rarity.COMMON, mage.cards.f.FeralInstinct.class)); + cards.add(new SetCardInfo("Fireblast", 79, Rarity.COMMON, mage.cards.f.Fireblast.class)); + cards.add(new SetCardInfo("Firestorm Hellkite", 130, Rarity.RARE, mage.cards.f.FirestormHellkite.class)); + cards.add(new SetCardInfo("Flooded Shoreline", 32, Rarity.RARE, mage.cards.f.FloodedShoreline.class)); + cards.add(new SetCardInfo("Freewind Falcon", 105, Rarity.COMMON, mage.cards.f.FreewindFalcon.class)); + cards.add(new SetCardInfo("Funeral Charm", 11, Rarity.COMMON, mage.cards.f.FuneralCharm.class)); + cards.add(new SetCardInfo("Giant Caterpillar", 58, Rarity.COMMON, mage.cards.g.GiantCaterpillar.class)); + cards.add(new SetCardInfo("Goblin Recruiter", 80, Rarity.UNCOMMON, mage.cards.g.GoblinRecruiter.class)); + cards.add(new SetCardInfo("Goblin Swine-Rider", 81, Rarity.COMMON, mage.cards.g.GoblinSwineRider.class)); + cards.add(new SetCardInfo("Gossamer Chains", 106, Rarity.COMMON, mage.cards.g.GossamerChains.class)); + cards.add(new SetCardInfo("Griffin Canyon", 163, Rarity.RARE, mage.cards.g.GriffinCanyon.class)); + cards.add(new SetCardInfo("Hearth Charm", 82, Rarity.COMMON, mage.cards.h.HearthCharm.class)); + cards.add(new SetCardInfo("Helm of Awakening", 145, Rarity.UNCOMMON, mage.cards.h.HelmOfAwakening.class)); + cards.add(new SetCardInfo("Hope Charm", 108, Rarity.COMMON, mage.cards.h.HopeCharm.class)); + cards.add(new SetCardInfo("Hulking Cyclops", 84, Rarity.UNCOMMON, mage.cards.h.HulkingCyclops.class)); + cards.add(new SetCardInfo("Impulse", 34, Rarity.COMMON, mage.cards.i.Impulse.class)); + cards.add(new SetCardInfo("Infantry Veteran", 109, Rarity.COMMON, mage.cards.i.InfantryVeteran.class)); + cards.add(new SetCardInfo("Inspiration", 35, Rarity.COMMON, mage.cards.i.Inspiration.class)); + cards.add(new SetCardInfo("Jamuraan Lion", 110, Rarity.COMMON, mage.cards.j.JamuraanLion.class)); + cards.add(new SetCardInfo("Jungle Basin", 164, Rarity.UNCOMMON, mage.cards.j.JungleBasin.class)); + cards.add(new SetCardInfo("Kaervek's Spite", 13, Rarity.RARE, mage.cards.k.KaerveksSpite.class)); + cards.add(new SetCardInfo("Karoo", 165, Rarity.UNCOMMON, mage.cards.k.Karoo.class)); + cards.add(new SetCardInfo("Keeper of Kookus", 85, Rarity.COMMON, mage.cards.k.KeeperOfKookus.class)); + cards.add(new SetCardInfo("King Cheetah", 60, Rarity.COMMON, mage.cards.k.KingCheetah.class)); + cards.add(new SetCardInfo("Knight of Valor", 111, Rarity.COMMON, mage.cards.k.KnightOfValor.class)); + cards.add(new SetCardInfo("Lightning Cloud", 87, Rarity.RARE, mage.cards.l.LightningCloud.class)); + cards.add(new SetCardInfo("Longbow Archer", 112, Rarity.UNCOMMON, mage.cards.l.LongbowArcher.class)); + cards.add(new SetCardInfo("Magma Mine", 149, Rarity.UNCOMMON, mage.cards.m.MagmaMine.class)); + cards.add(new SetCardInfo("Man-o'-War", 37, Rarity.COMMON, mage.cards.m.ManOWar.class)); + cards.add(new SetCardInfo("Miraculous Recovery", 113, Rarity.UNCOMMON, mage.cards.m.MiraculousRecovery.class)); + cards.add(new SetCardInfo("Mortal Wound", 63, Rarity.COMMON, mage.cards.m.MortalWound.class)); + cards.add(new SetCardInfo("Mundungu", 132, Rarity.UNCOMMON, mage.cards.m.Mundungu.class)); + cards.add(new SetCardInfo("Mystic Veil", 38, Rarity.COMMON, mage.cards.m.MysticVeil.class)); + cards.add(new SetCardInfo("Natural Order", 64, Rarity.RARE, mage.cards.n.NaturalOrder.class)); + cards.add(new SetCardInfo("Necromancy", 14, Rarity.UNCOMMON, mage.cards.n.Necromancy.class)); + cards.add(new SetCardInfo("Necrosavant", 15, Rarity.RARE, mage.cards.n.Necrosavant.class)); + cards.add(new SetCardInfo("Nekrataal", 16, Rarity.UNCOMMON, mage.cards.n.Nekrataal.class)); + cards.add(new SetCardInfo("Panther Warriors", 65, Rarity.COMMON, mage.cards.p.PantherWarriors.class)); + cards.add(new SetCardInfo("Parapet", 114, Rarity.COMMON, mage.cards.p.Parapet.class)); + cards.add(new SetCardInfo("Phyrexian Marauder", 151, Rarity.RARE, mage.cards.p.PhyrexianMarauder.class)); + cards.add(new SetCardInfo("Phyrexian Walker", 152, Rarity.COMMON, mage.cards.p.PhyrexianWalker.class)); + cards.add(new SetCardInfo("Prosperity", 40, Rarity.UNCOMMON, mage.cards.p.Prosperity.class)); + cards.add(new SetCardInfo("Python", 18, Rarity.COMMON, mage.cards.p.Python.class)); + cards.add(new SetCardInfo("Quicksand", 166, Rarity.UNCOMMON, mage.cards.q.Quicksand.class)); + cards.add(new SetCardInfo("Quirion Ranger", 67, Rarity.COMMON, mage.cards.q.QuirionRanger.class)); + cards.add(new SetCardInfo("Raging Gorilla", 90, Rarity.COMMON, mage.cards.r.RagingGorilla.class)); + cards.add(new SetCardInfo("Rainbow Efreet", 41, Rarity.RARE, mage.cards.r.RainbowEfreet.class)); + cards.add(new SetCardInfo("Relentless Assault", 91, Rarity.RARE, mage.cards.r.RelentlessAssault.class)); + cards.add(new SetCardInfo("Relic Ward", 116, Rarity.UNCOMMON, mage.cards.r.RelicWard.class)); + cards.add(new SetCardInfo("Remedy", 117, Rarity.COMMON, mage.cards.r.Remedy.class)); + cards.add(new SetCardInfo("Resistance Fighter", 118, Rarity.COMMON, mage.cards.r.ResistanceFighter.class)); + cards.add(new SetCardInfo("Retribution of the Meek", 119, Rarity.RARE, mage.cards.r.RetributionOfTheMeek.class)); + cards.add(new SetCardInfo("Righteous Aura", 120, Rarity.COMMON, mage.cards.r.RighteousAura.class)); + cards.add(new SetCardInfo("River Boa", 68, Rarity.COMMON, mage.cards.r.RiverBoa.class)); + cards.add(new SetCardInfo("Rowen", 69, Rarity.RARE, mage.cards.r.Rowen.class)); + cards.add(new SetCardInfo("Scalebane's Elite", 135, Rarity.UNCOMMON, mage.cards.s.ScalebanesElite.class)); + cards.add(new SetCardInfo("Shrieking Drake", 43, Rarity.COMMON, mage.cards.s.ShriekingDrake.class)); + cards.add(new SetCardInfo("Simoon", 136, Rarity.UNCOMMON, mage.cards.s.Simoon.class)); + cards.add(new SetCardInfo("Sisay's Ring", 154, Rarity.COMMON, mage.cards.s.SisaysRing.class)); + cards.add(new SetCardInfo("Snake Basket", 155, Rarity.RARE, mage.cards.s.SnakeBasket.class)); + cards.add(new SetCardInfo("Solfatara", 93, Rarity.COMMON, mage.cards.s.Solfatara.class)); + cards.add(new SetCardInfo("Spider Climb", 70, Rarity.COMMON, mage.cards.s.SpiderClimb.class)); + cards.add(new SetCardInfo("Spitting Drake", 95, Rarity.UNCOMMON, mage.cards.s.SpittingDrake.class)); + cards.add(new SetCardInfo("Squandered Resources", 137, Rarity.RARE, mage.cards.s.SquanderedResources.class)); + cards.add(new SetCardInfo("Stampeding Wildebeests", 71, Rarity.UNCOMMON, mage.cards.s.StampedingWildebeests.class)); + cards.add(new SetCardInfo("Summer Bloom", 72, Rarity.UNCOMMON, mage.cards.s.SummerBloom.class)); + cards.add(new SetCardInfo("Sun Clasp", 121, Rarity.COMMON, mage.cards.s.SunClasp.class)); + cards.add(new SetCardInfo("Suq'Ata Assassin", 19, Rarity.UNCOMMON, mage.cards.s.SuqAtaAssassin.class)); + cards.add(new SetCardInfo("Suq'Ata Lancer", 96, Rarity.COMMON, mage.cards.s.SuqAtaLancer.class)); + cards.add(new SetCardInfo("Talruum Champion", 97, Rarity.COMMON, mage.cards.t.TalruumChampion.class)); + cards.add(new SetCardInfo("Talruum Piper", 98, Rarity.UNCOMMON, mage.cards.t.TalruumPiper.class)); + cards.add(new SetCardInfo("Tar Pit Warrior", 20, Rarity.COMMON, mage.cards.t.TarPitWarrior.class)); + cards.add(new SetCardInfo("Teferi's Honor Guard", 122, Rarity.UNCOMMON, mage.cards.t.TeferisHonorGuard.class)); + cards.add(new SetCardInfo("Teferi's Puzzle Box", 156, Rarity.RARE, mage.cards.t.TeferisPuzzleBox.class)); + cards.add(new SetCardInfo("Teferi's Realm", 44, Rarity.RARE, mage.cards.t.TeferisRealm.class)); + cards.add(new SetCardInfo("Tempest Drake", 139, Rarity.UNCOMMON, mage.cards.t.TempestDrake.class)); + cards.add(new SetCardInfo("Tithe", 123, Rarity.RARE, mage.cards.t.Tithe.class)); + cards.add(new SetCardInfo("Tremor", 99, Rarity.COMMON, mage.cards.t.Tremor.class)); + cards.add(new SetCardInfo("Triangle of War", 158, Rarity.RARE, mage.cards.t.TriangleOfWar.class)); + cards.add(new SetCardInfo("Uktabi Orangutan", 73, Rarity.UNCOMMON, mage.cards.u.UktabiOrangutan.class)); + cards.add(new SetCardInfo("Undiscovered Paradise", 167, Rarity.RARE, mage.cards.u.UndiscoveredParadise.class)); + cards.add(new SetCardInfo("Undo", 47, Rarity.COMMON, mage.cards.u.Undo.class)); + cards.add(new SetCardInfo("Urborg Mindsucker", 21, Rarity.COMMON, mage.cards.u.UrborgMindsucker.class)); + cards.add(new SetCardInfo("Vampiric Tutor", 22, Rarity.RARE, mage.cards.v.VampiricTutor.class)); + cards.add(new SetCardInfo("Vanishing", 48, Rarity.COMMON, mage.cards.v.Vanishing.class)); + cards.add(new SetCardInfo("Viashino Sandstalker", 100, Rarity.UNCOMMON, mage.cards.v.ViashinoSandstalker.class)); + cards.add(new SetCardInfo("Viashivan Dragon", 140, Rarity.RARE, mage.cards.v.ViashivanDragon.class)); + cards.add(new SetCardInfo("Vision Charm", 49, Rarity.COMMON, mage.cards.v.VisionCharm.class)); + cards.add(new SetCardInfo("Wake of Vultures", 24, Rarity.COMMON, mage.cards.w.WakeOfVultures.class)); + cards.add(new SetCardInfo("Wand of Denial", 159, Rarity.RARE, mage.cards.w.WandOfDenial.class)); + cards.add(new SetCardInfo("Warrior's Honor", 124, Rarity.COMMON, mage.cards.w.WarriorsHonor.class)); + cards.add(new SetCardInfo("Warthog", 74, Rarity.COMMON, mage.cards.w.Warthog.class)); + cards.add(new SetCardInfo("Waterspout Djinn", 50, Rarity.UNCOMMON, mage.cards.w.WaterspoutDjinn.class)); + cards.add(new SetCardInfo("Wicked Reward", 25, Rarity.COMMON, mage.cards.w.WickedReward.class)); + cards.add(new SetCardInfo("Zhalfirin Crusader", 125, Rarity.RARE, mage.cards.z.ZhalfirinCrusader.class)); + } +} From d46919563f015401a42827e38e76c46748fda361 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 12 Jul 2017 15:54:42 -0500 Subject: [PATCH 18/29] - Little fix to Twinning Glass. --- Mage.Sets/src/mage/cards/t/TwinningGlass.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mage.Sets/src/mage/cards/t/TwinningGlass.java b/Mage.Sets/src/mage/cards/t/TwinningGlass.java index 2b47c754213..a0645cd652c 100644 --- a/Mage.Sets/src/mage/cards/t/TwinningGlass.java +++ b/Mage.Sets/src/mage/cards/t/TwinningGlass.java @@ -41,6 +41,8 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -95,6 +97,7 @@ class TwinningGlassEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterCard filterCard = new FilterCard(); + filterCard.add(Predicates.not(new CardTypePredicate(CardType.LAND))); Permanent twinningGlass = game.getPermanent(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getSimpleName()); From 391e0bac89ba8209a9d9a741ed59c0d78673f67f Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 12 Jul 2017 17:13:19 -0500 Subject: [PATCH 19/29] - Fixed cost of Breathstealer's Crypt --- Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java index ec74c249f6d..9ed3297ab05 100644 --- a/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java +++ b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java @@ -52,7 +52,7 @@ import mage.players.Player; public class BreathstealersCrypt extends CardImpl { public BreathstealersCrypt(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{B}"); // If a player would draw a card, instead he or she draws a card and reveals it. If it's a creature card, that player discards it unless he or she pays 3 life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BreathstealersCryptEffect())); From 2bc077677cf6dea26fde2f5a90d154e23a4a5720 Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 14 Jul 2017 17:03:54 +1000 Subject: [PATCH 20/29] Fix for Soul Barrier --- Mage.Sets/src/mage/cards/s/SoulBarrier.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SoulBarrier.java b/Mage.Sets/src/mage/cards/s/SoulBarrier.java index b93b14dafe9..d8d1f602a0c 100644 --- a/Mage.Sets/src/mage/cards/s/SoulBarrier.java +++ b/Mage.Sets/src/mage/cards/s/SoulBarrier.java @@ -27,6 +27,8 @@ */ package mage.cards.s; +import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -39,10 +41,9 @@ import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; -import java.util.UUID; - /** * * @author Galatolol @@ -51,10 +52,10 @@ public class SoulBarrier extends CardImpl { public SoulBarrier(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); - + // Whenever an opponent casts a creature spell, Soul Barrier deals 2 damage to that player unless he or she pays {2}. this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new SoulBarrierEffect(), - StaticFilters.FILTER_SPELL,false, SetTargetPointer.PLAYER)); + StaticFilters.FILTER_SPELL_A_CREATURE, false, SetTargetPointer.PLAYER)); } public SoulBarrier(final SoulBarrier card) { @@ -86,9 +87,13 @@ class SoulBarrierEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); - if (player != null) { + Permanent permanent = game.getPermanent(source.getSourceId()); + + if (player != null && permanent != null) { GenericManaCost cost = new GenericManaCost(2); - if (!cost.pay(source, game, player.getId(), player.getId(), false)) { + String message = "Would you like to pay {2} to prevent taking 2 damage from " + permanent.getLogName() + "?"; + if (!(player.chooseUse(Outcome.Benefit, message, source, game) + && cost.pay(source, game, source.getSourceId(), player.getId(), false, null))) { player.damage(2, source.getSourceId(), game, false, true); } return true; From b7e44f0cced5dfb141f3954f39f809a787cb02e9 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 14 Jul 2017 09:34:46 -0500 Subject: [PATCH 21/29] - Added requested card Temporal Aperture. --- .../src/mage/cards/t/TemporalAperture.java | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TemporalAperture.java diff --git a/Mage.Sets/src/mage/cards/t/TemporalAperture.java b/Mage.Sets/src/mage/cards/t/TemporalAperture.java new file mode 100644 index 00000000000..c2fac9203a4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TemporalAperture.java @@ -0,0 +1,158 @@ +/* + * 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.t; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class TemporalAperture extends CardImpl { + + public TemporalAperture(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // {5}, {tap}: Shuffle your library, then reveal the top card. Until end of turn, for as long as that card remains on top of your library, play with the top card of your library revealed and you may play that card without paying its mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TemporalApertureEffect(), new ManaCostsImpl("{5}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public TemporalAperture(final TemporalAperture card) { + super(card); + } + + @Override + public TemporalAperture copy() { + return new TemporalAperture(this); + } +} + +class TemporalApertureEffect extends OneShotEffect { + + public TemporalApertureEffect() { + super(Outcome.Neutral); + staticText = "Shuffle your library, then reveal the top card. Until end of turn, for as long as that card remains on top of your library, play with the top card of your library revealed and you may play that card without paying its mana cost"; + } + + public TemporalApertureEffect(final TemporalApertureEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.shuffleLibrary(source, game); + Card topCard = controller.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + if (topCard != null) { + cards.add(topCard); + controller.revealCards("Top card of " + controller.getName() + "'s library revealed", cards, game); + ContinuousEffect effect = new TemporalApertureTopCardCastEffect(topCard); + game.addEffect(effect, source); + return true; + } + } + return false; + } + + @Override + public TemporalApertureEffect copy() { + return new TemporalApertureEffect(this); + } +} + +class TemporalApertureTopCardCastEffect extends AsThoughEffectImpl { + + private final Card card; + + public TemporalApertureTopCardCastEffect(Card card) { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + this.card = card; + staticText = "Until end of turn, for as long as that card is on top of your library, you may cast it without paying its mana costs"; + } + + public TemporalApertureTopCardCastEffect(final TemporalApertureTopCardCastEffect effect) { + super(effect); + this.card = effect.card; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public TemporalApertureTopCardCastEffect copy() { + return new TemporalApertureTopCardCastEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId())) { + Card objectCard = game.getCard(objectId); + if (objectCard != null) { + Player controller = game.getPlayer(affectedControllerId); + if (controller != null + && game.getState().getZone(objectId) == Zone.LIBRARY) { + if (controller.getLibrary().getFromTop(game).equals(card)) { + if (objectCard == card + && objectCard.getSpellAbility() != null + && objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(controller.getId(), game)) { + controller.setCastSourceIdWithAlternateMana(objectId, null, null); + return true; + } + } + } + } + } + return false; + } +} From 383841cdfbfa6f4ead2a69158323a052b6aef563 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 14 Jul 2017 11:27:44 -0500 Subject: [PATCH 22/29] - Fixed bug #3665 --- Mage.Sets/src/mage/cards/d/DoublingSeason.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DoublingSeason.java b/Mage.Sets/src/mage/cards/d/DoublingSeason.java index 6d051176af1..15e0343f06d 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingSeason.java +++ b/Mage.Sets/src/mage/cards/d/DoublingSeason.java @@ -53,7 +53,7 @@ public class DoublingSeason extends CardImpl { // If an effect would create one or more tokens under your control, it creates twice that many of those tokens instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreateTwiceThatManyTokensEffect())); - + // If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DoublingSeasonCounterEffect())); @@ -71,6 +71,8 @@ public class DoublingSeason extends CardImpl { class DoublingSeasonCounterEffect extends ReplacementEffectImpl { + boolean landPlayed = false; // a played land is not an effect + DoublingSeasonCounterEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false); staticText = "If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead"; @@ -96,8 +98,12 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); + landPlayed = (permanent != null + && permanent.isLand()); // a played land is not an effect } - return permanent != null && permanent.getControllerId().equals(source.getControllerId()); + return permanent != null + && permanent.getControllerId().equals(source.getControllerId()) + && !landPlayed; // example: gemstone mine being played as a land drop } @Override From f0d9988e9b0d63a501199cf8d19c40d010165b40 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 14 Jul 2017 11:39:11 -0500 Subject: [PATCH 23/29] - Fixed bug #3656 --- .../mage/watchers/common/LandfallWatcher.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java index f006cef8a85..e5b141f2c64 100644 --- a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java @@ -3,7 +3,6 @@ package mage.watchers.common; import java.util.HashSet; import java.util.Set; import java.util.UUID; -import mage.constants.CardType; import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; @@ -16,7 +15,8 @@ import mage.watchers.Watcher; */ public class LandfallWatcher extends Watcher { - final Set playerPlayedLand = new HashSet<>(); + final Set playerPlayedLand = new HashSet<>(); // player that played land + final Set landPlayed = new HashSet<>(); // land played public LandfallWatcher() { super(LandfallWatcher.class.getSimpleName(), WatcherScope.GAME); @@ -25,6 +25,7 @@ public class LandfallWatcher extends Watcher { public LandfallWatcher(final LandfallWatcher watcher) { super(watcher); playerPlayedLand.addAll(watcher.playerPlayedLand); + landPlayed.addAll(watcher.landPlayed); } @Override @@ -34,10 +35,13 @@ public class LandfallWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { + if (event.getType() == GameEvent.EventType.LAND_PLAYED) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && permanent.isLand() && !playerPlayedLand.contains(event.getPlayerId())) { + if (permanent != null + && permanent.isLand() + && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); + landPlayed.add(event.getTargetId()); } } } @@ -45,10 +49,15 @@ public class LandfallWatcher extends Watcher { @Override public void reset() { playerPlayedLand.clear(); + landPlayed.clear(); super.reset(); } public boolean landPlayed(UUID playerId) { return playerPlayedLand.contains(playerId); } + + public boolean wasLandPlayed(UUID landId) { + return landPlayed.contains(landId); + } } From e0a61b9918d335cb7fc6c8b21279e9e87afbf93b Mon Sep 17 00:00:00 2001 From: tamaroth Date: Fri, 14 Jul 2017 22:44:07 +0200 Subject: [PATCH 24/29] Create token for a commander that instead of being exiled by (#3675) Curse of the Swine was put into the command zone. #3669 --- .../src/mage/cards/c/CurseOfTheSwine.java | 3 +- .../commander/duel/CurseOfTheSwineTest.java | 43 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/commander/duel/CurseOfTheSwineTest.java diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java index adf64195b90..fb4253deb67 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java @@ -35,6 +35,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.CurseOfTheSwineBoarToken; @@ -94,7 +95,7 @@ class CurseOfTheSwineEffect extends OneShotEffect { for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent creature = game.getPermanent(targetId); if (creature != null) { - if (creature.moveToExile(null, null, source.getSourceId(), game)) { + if (creature.moveToExile(null, null, source.getSourceId(), game) || creature.moveToZone(Zone.COMMAND, source.getSourceId(), game, false)) { CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken(); swineToken.putOntoBattlefield(1, game, source.getSourceId(), creature.getControllerId()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CurseOfTheSwineTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CurseOfTheSwineTest.java new file mode 100644 index 00000000000..1645b5e3129 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CurseOfTheSwineTest.java @@ -0,0 +1,43 @@ +package org.mage.test.commander.duel; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.GameException; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommanderDuelBase; +import java.io.FileNotFoundException; + +/** + * @author tamaroth on 14.07.2017. + */ +public class CurseOfTheSwineTest extends CardTestCommanderDuelBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + setDecknamePlayerA("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis + return super.createNewGameAndPlayers(); + } + /* + In a Commander game, if a commander is put into the command zone + instead of being exiled by Curse of the Swine, its controller will + still get a Boar token. + */ + @Test + public void TestCurseOfTheSwine() + { + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.HAND, playerA, "Curse of the Swine"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of the Swine"); + setChoice(playerA, "X=1"); + addTarget(playerA, "Daxos of Meletis"); + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertCommandZoneCount(playerA, "Daxos of Meletis", 1); + assertExileCount("Daxos of Meletis", 0); + assertPermanentCount(playerA, "Boar", 1); + } +} From 11e3c9f729bc39f94b8fd64b213745a92d0ebef2 Mon Sep 17 00:00:00 2001 From: Achilles Date: Sat, 15 Jul 2017 09:20:00 -0500 Subject: [PATCH 25/29] - Fixed bug #3677 --- .../src/mage/cards/n/NewPerspectives.java | 4 +- .../costs/common/CyclingDiscardCost.java | 84 +++++++++++++++++++ .../abilities/keyword/CyclingAbility.java | 49 +---------- 3 files changed, 87 insertions(+), 50 deletions(-) create mode 100644 Mage/src/main/java/mage/abilities/costs/common/CyclingDiscardCost.java diff --git a/Mage.Sets/src/mage/cards/n/NewPerspectives.java b/Mage.Sets/src/mage/cards/n/NewPerspectives.java index e20f12f555b..14769954e01 100644 --- a/Mage.Sets/src/mage/cards/n/NewPerspectives.java +++ b/Mage.Sets/src/mage/cards/n/NewPerspectives.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.common.DiscardSourceCost; +import mage.abilities.costs.common.CyclingDiscardCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.keyword.CyclingAbility; @@ -99,7 +99,7 @@ class NewPerspectivesCostModificationEffect extends CostModificationEffectImpl { if ((abilityToModify instanceof ActivatedAbility && ((ActivatedAbility) abilityToModify).isCheckPlayableMode()) || controller.chooseUse(Outcome.PlayForFree, "Pay {0} to cycle?", source, game)) { abilityToModify.getCosts().clear(); abilityToModify.getManaCostsToPay().clear(); - abilityToModify.getCosts().add(new DiscardSourceCost()); + abilityToModify.getCosts().add(new CyclingDiscardCost()); } return true; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/CyclingDiscardCost.java b/Mage/src/main/java/mage/abilities/costs/common/CyclingDiscardCost.java new file mode 100644 index 00000000000..1937b1e5e72 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/costs/common/CyclingDiscardCost.java @@ -0,0 +1,84 @@ +/* + * 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. + */ + +/** + * + * @author jeffwadsworth + */ + +package mage.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostImpl; +import mage.cards.Card; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +public class CyclingDiscardCost extends CostImpl { + + public CyclingDiscardCost() { + } + + public CyclingDiscardCost(CyclingDiscardCost cost) { + super(cost); + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return game.getPlayer(controllerId).getHand().contains(sourceId); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { + Player player = game.getPlayer(controllerId); + if (player != null) { + Card card = player.getHand().get(sourceId, game); + if (card != null) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLE_CARD, card.getId(), card.getId(), card.getOwnerId())); + paid = player.discard(card, null, game); + if (paid) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLED_CARD, card.getId(), card.getId(), card.getOwnerId())); + } + } + } + return paid; + } + + @Override + public String getText() { + return "Discard this card"; + } + + @Override + public CyclingDiscardCost copy() { + return new CyclingDiscardCost(this); + } +} diff --git a/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java b/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java index 0cfcc91fb0b..5186c48bcfe 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java @@ -27,20 +27,14 @@ */ package mage.abilities.keyword; -import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.Cost; -import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.CyclingDiscardCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; -import mage.cards.Card; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -90,44 +84,3 @@ public class CyclingAbility extends ActivatedAbilityImpl { } } - -class CyclingDiscardCost extends CostImpl { - - public CyclingDiscardCost() { - } - - public CyclingDiscardCost(CyclingDiscardCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getPlayer(controllerId).getHand().contains(sourceId); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { - Player player = game.getPlayer(controllerId); - if (player != null) { - Card card = player.getHand().get(sourceId, game); - if (card != null) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLE_CARD, card.getId(), card.getId(), card.getOwnerId())); - paid = player.discard(card, null, game); - if (paid) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLED_CARD, card.getId(), card.getId(), card.getOwnerId())); - } - } - } - return paid; - } - - @Override - public String getText() { - return "Discard this card"; - } - - @Override - public CyclingDiscardCost copy() { - return new CyclingDiscardCost(this); - } -} From 2d4b044bde42b82bf4464d2fd649e10ec75730c1 Mon Sep 17 00:00:00 2001 From: Achilles Date: Sat, 15 Jul 2017 09:24:53 -0500 Subject: [PATCH 26/29] - Fixed bug #3680 --- Mage.Sets/src/mage/cards/c/Chronozoa.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/Chronozoa.java b/Mage.Sets/src/mage/cards/c/Chronozoa.java index 55b4809b30c..b48b9be6e61 100644 --- a/Mage.Sets/src/mage/cards/c/Chronozoa.java +++ b/Mage.Sets/src/mage/cards/c/Chronozoa.java @@ -29,7 +29,6 @@ package mage.cards.c; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.LastTimeCounterRemovedCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; @@ -45,6 +44,7 @@ import mage.constants.CardType; import mage.counters.CounterType; import java.util.UUID; +import mage.abilities.common.DiesTriggeredAbility; /** * @@ -61,16 +61,18 @@ public class Chronozoa extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // Vanishing 3 Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3))); ability.setRuleVisible(false); this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(3)); this.addAbility(new VanishingSacrificeAbility()); + // When Chronozoa is put into a graveyard from play, if it had no time counters on it, create two tokens that are copies of it. Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(2); effect.setText("create two tokens that are copies of it"); - this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(effect, false), + this.addAbility(new ConditionalTriggeredAbility(new DiesTriggeredAbility(effect, false), LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create two tokens that are copies of it.")); } From 9e797a7593491194767f06da495d114ce004da55 Mon Sep 17 00:00:00 2001 From: Jonathan Skeate Date: Sat, 15 Jul 2017 15:46:04 -0400 Subject: [PATCH 27/29] Update WrensRunPackmaster.java Wolves get deathtouch, not walls --- Mage.Sets/src/mage/cards/w/WrensRunPackmaster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/w/WrensRunPackmaster.java b/Mage.Sets/src/mage/cards/w/WrensRunPackmaster.java index cb3b6ae4c2c..15a9747e4d4 100644 --- a/Mage.Sets/src/mage/cards/w/WrensRunPackmaster.java +++ b/Mage.Sets/src/mage/cards/w/WrensRunPackmaster.java @@ -54,7 +54,7 @@ public class WrensRunPackmaster extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Wolf"); static { filter.add(new ControllerPredicate(TargetController.YOU)); - filter.add(new SubtypePredicate(SubType.WALL)); + filter.add(new SubtypePredicate(SubType.WOLF)); } public WrensRunPackmaster(UUID ownerId, CardSetInfo setInfo) { From 525a98e78ae9afc0f4c4bc1b2f5e3d0b2e54a3da Mon Sep 17 00:00:00 2001 From: Achilles Date: Sat, 15 Jul 2017 15:03:13 -0500 Subject: [PATCH 28/29] - Fixed bug #3682 --- .../token/KalonianTwingroveTreefolkWarriorToken.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java b/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java index c285e7dbee0..559dadd5848 100644 --- a/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java @@ -33,14 +33,22 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import static mage.game.permanent.token.DokaiWeaverofLifeToken.filterLands; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * * @author spjspj */ public class KalonianTwingroveTreefolkWarriorToken extends Token { + + final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control"); + + static { + filterLands.add(new SubtypePredicate(SubType.FOREST)); + } public KalonianTwingroveTreefolkWarriorToken() { super("Treefolk Warrior", "green Treefolk Warrior creature token with \"This creature's power and toughness are each equal to the number of Forests you control.\""); From d10f547879b2e51fdab44b2e208c112f26ac9ff2 Mon Sep 17 00:00:00 2001 From: Achilles Date: Sat, 15 Jul 2017 15:38:06 -0500 Subject: [PATCH 29/29] - Fixed bug #3678 --- Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java index 16aeef28fde..f1d40a44686 100644 --- a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java +++ b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java @@ -73,7 +73,7 @@ public class MogisGodOfSlaughter extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. - effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, false, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, true, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), "Sacrifice a creature? (otherwise you get 2 damage)"); effect.setText("Mogis deals 2 damage to that player unless he or she sacrifices a creature"); Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.OPPONENT, false, true);