From 90965802d0b43014203a1d01b4e13f7112a863c9 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Mon, 29 Jun 2020 15:39:58 +0400 Subject: [PATCH] Cost increasing effects - refactor, removed redundant custom effects (related to #6684 and #6698); --- .../src/mage/cards/a/AlabasterLeech.java | 12 +- .../src/mage/cards/a/AndraditeLeech.java | 18 +-- Mage.Sets/src/mage/cards/a/AuraOfSilence.java | 66 +++------ Mage.Sets/src/mage/cards/c/Chill.java | 13 +- Mage.Sets/src/mage/cards/d/DampingSphere.java | 17 +-- Mage.Sets/src/mage/cards/d/Derelor.java | 16 +- .../src/mage/cards/d/DovinHandOfControl.java | 59 ++------ Mage.Sets/src/mage/cards/f/FerozsBan.java | 18 +-- .../mage/cards/g/GeistFueledScarecrow.java | 15 +- Mage.Sets/src/mage/cards/g/Gloom.java | 22 +-- Mage.Sets/src/mage/cards/g/Glowrider.java | 62 ++------ .../src/mage/cards/g/GodPharaohsStatue.java | 50 +------ .../mage/cards/g/GrandArbiterAugustinIV.java | 45 +----- Mage.Sets/src/mage/cards/h/HighSeas.java | 15 +- Mage.Sets/src/mage/cards/i/IriniSengir.java | 21 ++- Mage.Sets/src/mage/cards/j/JadeLeech.java | 12 +- .../src/mage/cards/l/LodestoneGolem.java | 62 ++------ Mage.Sets/src/mage/cards/r/RubyLeech.java | 12 +- Mage.Sets/src/mage/cards/s/SapphireLeech.java | 12 +- .../src/mage/cards/s/SphereOfResistance.java | 15 +- Mage.Sets/src/mage/cards/s/Squeeze.java | 21 ++- .../mage/cards/t/ThaliaGuardianOfThraben.java | 59 ++------ .../src/mage/cards/t/ThornOfAmethyst.java | 14 +- Mage.Sets/src/mage/cards/v/VrynWingmare.java | 61 ++------ .../ConditionalCostModificationTest.java | 6 +- .../cost/SpellsCostIncreasementAllEffect.java | 66 --------- ...pellsCostIncreasementControllerEffect.java | 90 ------------ .../cost/SpellsCostIncreasingAllEffect.java | 139 ++++++++++++++++++ 28 files changed, 363 insertions(+), 655 deletions(-) delete mode 100644 Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementAllEffect.java delete mode 100644 Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java diff --git a/Mage.Sets/src/mage/cards/a/AlabasterLeech.java b/Mage.Sets/src/mage/cards/a/AlabasterLeech.java index 63e2ad4d6a..cfdf0d916e 100644 --- a/Mage.Sets/src/mage/cards/a/AlabasterLeech.java +++ b/Mage.Sets/src/mage/cards/a/AlabasterLeech.java @@ -1,22 +1,22 @@ - package mage.cards.a; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class AlabasterLeech extends CardImpl { @@ -28,14 +28,14 @@ public final class AlabasterLeech extends CardImpl { } public AlabasterLeech(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); this.subtype.add(SubType.LEECH); this.power = new MageInt(1); this.toughness = new MageInt(3); // White spells you cast cost {W} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{W}")))); + new SpellsCostIncreasingAllEffect(new ManaCostsImpl("{W}"), filter, TargetController.YOU))); } public AlabasterLeech(final AlabasterLeech card) { diff --git a/Mage.Sets/src/mage/cards/a/AndraditeLeech.java b/Mage.Sets/src/mage/cards/a/AndraditeLeech.java index 0102b19379..3d91d654f5 100644 --- a/Mage.Sets/src/mage/cards/a/AndraditeLeech.java +++ b/Mage.Sets/src/mage/cards/a/AndraditeLeech.java @@ -1,25 +1,21 @@ - package mage.cards.a; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class AndraditeLeech extends CardImpl { @@ -31,17 +27,17 @@ public final class AndraditeLeech extends CardImpl { } public AndraditeLeech(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.LEECH); this.power = new MageInt(2); this.toughness = new MageInt(2); // Black spells you cast cost {B} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{B}")))); + new SpellsCostIncreasingAllEffect(new ManaCostsImpl("{B}"), filter, TargetController.YOU))); // {B}: Andradite Leech gets +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); } public AndraditeLeech(final AndraditeLeech card) { diff --git a/Mage.Sets/src/mage/cards/a/AuraOfSilence.java b/Mage.Sets/src/mage/cards/a/AuraOfSilence.java index 78336fd491..23ae3bcc87 100644 --- a/Mage.Sets/src/mage/cards/a/AuraOfSilence.java +++ b/Mage.Sets/src/mage/cards/a/AuraOfSilence.java @@ -1,35 +1,42 @@ - package mage.cards.a; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.cards.Card; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; import mage.filter.StaticFilters; -import mage.game.Game; +import mage.filter.predicate.Predicates; import mage.target.TargetPermanent; -import mage.util.CardUtil; import java.util.UUID; /** - * * @author emerald000 */ public final class AuraOfSilence extends CardImpl { + + private static final FilterCard filter = new FilterCard("Artifact and enchantment spells"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.ENCHANTMENT.getPredicate())); + } + public AuraOfSilence(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); // Artifact and enchantment spells your opponents cast cost {2} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AuraOfSilenceCostModificationEffect())); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(2, filter, TargetController.OPPONENT))); + // Sacrifice Aura of Silence: Destroy target artifact or enchantment. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)); @@ -44,41 +51,4 @@ public final class AuraOfSilence extends CardImpl { public AuraOfSilence copy() { return new AuraOfSilence(this); } -} - -class AuraOfSilenceCostModificationEffect extends CostModificationEffectImpl { - - AuraOfSilenceCostModificationEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Artifact and enchantment spells your opponents cast cost {2} more to cast"; - } - - AuraOfSilenceCostModificationEffect(AuraOfSilenceCostModificationEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, -2); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && (card.isArtifact() || card.isEnchantment())) { - return true; - } - } - } - return false; - } - - @Override - public AuraOfSilenceCostModificationEffect copy() { - return new AuraOfSilenceCostModificationEffect(this); - } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/c/Chill.java b/Mage.Sets/src/mage/cards/c/Chill.java index 557a0a2a47..083999cc7c 100644 --- a/Mage.Sets/src/mage/cards/c/Chill.java +++ b/Mage.Sets/src/mage/cards/c/Chill.java @@ -1,33 +1,34 @@ - package mage.cards.c; -import java.util.UUID; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author Quercitron */ public final class Chill extends CardImpl { private static final FilterCard filter = new FilterCard("Red spells"); + static { filter.add(new ColorPredicate(ObjectColor.RED)); } public Chill(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); // Red spells cost {2} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 2))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(2, filter, TargetController.ANY))); } public Chill(final Chill card) { diff --git a/Mage.Sets/src/mage/cards/d/DampingSphere.java b/Mage.Sets/src/mage/cards/d/DampingSphere.java index b4780d80d7..c2177cc690 100644 --- a/Mage.Sets/src/mage/cards/d/DampingSphere.java +++ b/Mage.Sets/src/mage/cards/d/DampingSphere.java @@ -1,19 +1,15 @@ - package mage.cards.d; -import java.util.UUID; import mage.MageObject; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; +import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -21,8 +17,9 @@ import mage.game.events.ManaEvent; import mage.util.CardUtil; import mage.watchers.common.CastSpellLastTurnWatcher; +import java.util.UUID; + /** - * * @author L_J */ public final class DampingSphere extends CardImpl { @@ -90,10 +87,10 @@ class DampingSphereReplacementEffect extends ReplacementEffectImpl { } } -class DampingSphereIncreasementAllEffect extends SpellsCostIncreasementAllEffect { +class DampingSphereIncreasementAllEffect extends SpellsCostIncreasingAllEffect { DampingSphereIncreasementAllEffect() { - super(0); + super(1, new FilterCard(), TargetController.ANY); this.staticText = "Each spell a player casts costs {1} more to cast for each other spell that player has cast this turn"; } diff --git a/Mage.Sets/src/mage/cards/d/Derelor.java b/Mage.Sets/src/mage/cards/d/Derelor.java index 6d1ddddc00..e6984a51e6 100644 --- a/Mage.Sets/src/mage/cards/d/Derelor.java +++ b/Mage.Sets/src/mage/cards/d/Derelor.java @@ -1,41 +1,41 @@ - package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author Quercitron */ public final class Derelor extends CardImpl { private static final FilterCard filter = new FilterCard("Black spells"); - + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); } - + public Derelor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.THRULL); this.power = new MageInt(4); this.toughness = new MageInt(4); // Black spells you cast cost {B} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl<>("{B}")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(new ManaCostsImpl<>("{B}"), filter, TargetController.YOU))); } public Derelor(final Derelor card) { diff --git a/Mage.Sets/src/mage/cards/d/DovinHandOfControl.java b/Mage.Sets/src/mage/cards/d/DovinHandOfControl.java index 34eaf023bc..dc14c627a5 100644 --- a/Mage.Sets/src/mage/cards/d/DovinHandOfControl.java +++ b/Mage.Sets/src/mage/cards/d/DovinHandOfControl.java @@ -2,30 +2,35 @@ package mage.cards.d; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.SpellAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.PreventDamageByTargetEffect; import mage.abilities.effects.common.PreventDamageToTargetEffect; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.cards.Card; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.FilterCard; import mage.filter.StaticFilters; -import mage.game.Game; +import mage.filter.predicate.Predicates; import mage.target.TargetPermanent; -import mage.util.CardUtil; import java.util.UUID; -import mage.abilities.mana.ManaAbility; -import mage.game.stack.Spell; /** * @author TheElk801 */ public final class DovinHandOfControl extends CardImpl { + private static final FilterCard filter = new FilterCard("Artifact, instant, and sorcery spells"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.INSTANT.getPredicate(), + CardType.SORCERY.getPredicate())); + } + public DovinHandOfControl(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{W/U}"); @@ -34,7 +39,7 @@ public final class DovinHandOfControl extends CardImpl { this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // Artifact, instant, and sorcery spells your opponents cast cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(new DovinHandOfControlEffect())); + this.addAbility(new SimpleStaticAbility(new SpellsCostIncreasingAllEffect(1, filter, TargetController.OPPONENT))); // -1: Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls. Ability ability = new LoyaltyAbility(new PreventDamageToTargetEffect( @@ -55,40 +60,4 @@ public final class DovinHandOfControl extends CardImpl { public DovinHandOfControl copy() { return new DovinHandOfControl(this); } -} - -class DovinHandOfControlEffect extends CostModificationEffectImpl { - - DovinHandOfControlEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Artifact, instant, and sorcery spells your opponents cast cost {1} more to cast"; - } - - private DovinHandOfControlEffect(DovinHandOfControlEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, -1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (!(abilityToModify instanceof SpellAbility)) { - return false; - } - return card != null - && (card.isInstantOrSorcery() - || card.isArtifact()) - && game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId()); - } - - @Override - public DovinHandOfControlEffect copy() { - return new DovinHandOfControlEffect(this); - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/f/FerozsBan.java b/Mage.Sets/src/mage/cards/f/FerozsBan.java index bda78ea60a..52a6ed4995 100644 --- a/Mage.Sets/src/mage/cards/f/FerozsBan.java +++ b/Mage.Sets/src/mage/cards/f/FerozsBan.java @@ -1,29 +1,29 @@ package mage.cards.f; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.StaticFilters; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; + +import java.util.UUID; /** - * * @author LoneFox - * */ public final class FerozsBan extends CardImpl { + private static final FilterCard filter = new FilterCreatureCard("Creature spells"); + public FerozsBan(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); // Creature spells cost {2} more to cast. - Effect effect = new SpellsCostIncreasementAllEffect(StaticFilters.FILTER_CARD_CREATURE, 2); - effect.setText("Creature spells cost {2} more to cast."); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(2, filter, TargetController.ANY))); } public FerozsBan(final FerozsBan card) { diff --git a/Mage.Sets/src/mage/cards/g/GeistFueledScarecrow.java b/Mage.Sets/src/mage/cards/g/GeistFueledScarecrow.java index 2393e2b07b..b64c673afb 100644 --- a/Mage.Sets/src/mage/cards/g/GeistFueledScarecrow.java +++ b/Mage.Sets/src/mage/cards/g/GeistFueledScarecrow.java @@ -1,24 +1,23 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; +import java.util.UUID; + /** - * * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) */ public final class GeistFueledScarecrow extends CardImpl { - + private static final FilterCard filter = new FilterCard("Creature spells"); static { @@ -26,14 +25,14 @@ public final class GeistFueledScarecrow extends CardImpl { } public GeistFueledScarecrow(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); this.subtype.add(SubType.SCARECROW); this.power = new MageInt(4); this.toughness = new MageInt(4); // Creature spells you cast cost {1} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{1}")))); + new SpellsCostIncreasingAllEffect(1, filter, TargetController.YOU))); } public GeistFueledScarecrow(final GeistFueledScarecrow card) { diff --git a/Mage.Sets/src/mage/cards/g/Gloom.java b/Mage.Sets/src/mage/cards/g/Gloom.java index 43a47d98b6..8df36787ea 100644 --- a/Mage.Sets/src/mage/cards/g/Gloom.java +++ b/Mage.Sets/src/mage/cards/g/Gloom.java @@ -1,13 +1,11 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageObject; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -16,23 +14,25 @@ import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.util.CardUtil; +import java.util.UUID; + /** - * * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) */ public final class Gloom extends CardImpl { - + private static final FilterCard filter = new FilterCard("White spells"); + static { filter.add(new ColorPredicate(ObjectColor.WHITE)); } public Gloom(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); // White spells cost {3} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 3))); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(3, filter, TargetController.ANY))); + // Activated abilities of white enchantments cost {3} more to activate. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GloomCostIncreaseEffect())); } @@ -63,12 +63,12 @@ class GloomCostIncreaseEffect extends CostModificationEffectImpl { CardUtil.increaseCost(abilityToModify, 3); return true; } - + @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { + public boolean applies(Ability abilityToModify, Ability source, Game game) { boolean isWhiteEnchantment = false; boolean isActivated = abilityToModify.getAbilityType() == AbilityType.ACTIVATED; - if (isActivated) { + if (isActivated) { MageObject permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null) { isWhiteEnchantment = permanent.isEnchantment() && permanent.getColor(game).isWhite(); diff --git a/Mage.Sets/src/mage/cards/g/Glowrider.java b/Mage.Sets/src/mage/cards/g/Glowrider.java index 3ff7663897..7948e732c9 100644 --- a/Mage.Sets/src/mage/cards/g/Glowrider.java +++ b/Mage.Sets/src/mage/cards/g/Glowrider.java @@ -1,25 +1,30 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.cards.Card; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.*; -import mage.game.Game; -import mage.util.CardUtil; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; + +import java.util.UUID; /** - * * @author fireshoes */ public final class Glowrider extends CardImpl { + private static final FilterCard filter = new FilterCard("Noncreature spells"); + + static { + filter.add(Predicates.not(CardType.CREATURE.getPredicate())); + } + public Glowrider(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.HUMAN); @@ -28,7 +33,7 @@ public final class Glowrider extends CardImpl { this.toughness = new MageInt(1); // Noncreature spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GlowriderCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } public Glowrider(final Glowrider card) { @@ -40,38 +45,3 @@ public final class Glowrider extends CardImpl { return new Glowrider(this); } } - -class GlowriderCostReductionEffect extends CostModificationEffectImpl { - - GlowriderCostReductionEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Noncreature spells cost {1} more to cast"; - } - - GlowriderCostReductionEffect(GlowriderCostReductionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - CardUtil.increaseCost(abilityToModify, 1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && !card.isCreature()) { - return true; - } - } - return false; - } - - @Override - public GlowriderCostReductionEffect copy() { - return new GlowriderCostReductionEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/g/GodPharaohsStatue.java b/Mage.Sets/src/mage/cards/g/GodPharaohsStatue.java index 2e2c67444d..1fbd05ac20 100644 --- a/Mage.Sets/src/mage/cards/g/GodPharaohsStatue.java +++ b/Mage.Sets/src/mage/cards/g/GodPharaohsStatue.java @@ -1,16 +1,15 @@ package mage.cards.g; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.LoseLifeOpponentsEffect; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.*; -import mage.game.Game; -import mage.util.CardUtil; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.constants.TargetController; +import mage.filter.FilterCard; import java.util.UUID; @@ -25,7 +24,7 @@ public final class GodPharaohsStatue extends CardImpl { this.addSuperType(SuperType.LEGENDARY); // Spells your opponents cast cost {2} more to cast. - this.addAbility(new SimpleStaticAbility(new GodPharaohsStatueEffect())); + this.addAbility(new SimpleStaticAbility(new SpellsCostIncreasingAllEffect(2, new FilterCard("Spells"), TargetController.OPPONENT))); // At the beginning of your end step, each opponent loses 1 life. this.addAbility(new BeginningOfEndStepTriggeredAbility( @@ -42,40 +41,3 @@ public final class GodPharaohsStatue extends CardImpl { return new GodPharaohsStatue(this); } } - -class GodPharaohsStatueEffect extends CostModificationEffectImpl { - - private static final String effectText = "Spells your opponents cast cost {2} more to cast"; - - GodPharaohsStatueEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = effectText; - } - - private GodPharaohsStatueEffect(GodPharaohsStatueEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, -2); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { - return true; - } - } - return false; - } - - @Override - public GodPharaohsStatueEffect copy() { - return new GodPharaohsStatueEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/g/GrandArbiterAugustinIV.java b/Mage.Sets/src/mage/cards/g/GrandArbiterAugustinIV.java index 9c247eb3a7..518db6f2ab 100644 --- a/Mage.Sets/src/mage/cards/g/GrandArbiterAugustinIV.java +++ b/Mage.Sets/src/mage/cards/g/GrandArbiterAugustinIV.java @@ -2,18 +2,14 @@ package mage.cards.g; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.util.CardUtil; import java.util.UUID; @@ -46,7 +42,7 @@ public final class GrandArbiterAugustinIV extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filterBlue, 1))); // Spells your opponents cast cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrandArbiterAugustinIVCostIncreaseEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, new FilterCard("Spells"), TargetController.OPPONENT))); } public GrandArbiterAugustinIV(final GrandArbiterAugustinIV card) { @@ -58,40 +54,3 @@ public final class GrandArbiterAugustinIV extends CardImpl { return new GrandArbiterAugustinIV(this); } } - -class GrandArbiterAugustinIVCostIncreaseEffect extends CostModificationEffectImpl { - - private static final String effectText = "Spells your opponents cast cost {1} more to cast"; - - GrandArbiterAugustinIVCostIncreaseEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = effectText; - } - - GrandArbiterAugustinIVCostIncreaseEffect(GrandArbiterAugustinIVCostIncreaseEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, -1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { - return true; - } - } - return false; - } - - @Override - public GrandArbiterAugustinIVCostIncreaseEffect copy() { - return new GrandArbiterAugustinIVCostIncreaseEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/h/HighSeas.java b/Mage.Sets/src/mage/cards/h/HighSeas.java index 412c56ce64..652a5c6f17 100644 --- a/Mage.Sets/src/mage/cards/h/HighSeas.java +++ b/Mage.Sets/src/mage/cards/h/HighSeas.java @@ -1,35 +1,36 @@ - package mage.cards.h; -import java.util.UUID; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author fireshoes */ public final class HighSeas extends CardImpl { - + private static final FilterCreatureCard filter = new FilterCreatureCard("Red creature spells and green creature spells"); + static { filter.add(Predicates.or(new ColorPredicate(ObjectColor.RED), (new ColorPredicate(ObjectColor.GREEN)))); } public HighSeas(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); // Red creature spells and green creature spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } public HighSeas(final HighSeas card) { diff --git a/Mage.Sets/src/mage/cards/i/IriniSengir.java b/Mage.Sets/src/mage/cards/i/IriniSengir.java index 9ba91444fd..8d485f939f 100644 --- a/Mage.Sets/src/mage/cards/i/IriniSengir.java +++ b/Mage.Sets/src/mage/cards/i/IriniSengir.java @@ -1,35 +1,32 @@ - package mage.cards.i; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.SuperType; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterEnchantmentCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author fireshoes */ public final class IriniSengir extends CardImpl { - + private static final FilterEnchantmentCard filter = new FilterEnchantmentCard("Green enchantment spells and white enchantment spells"); + static { filter.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), (new ColorPredicate(ObjectColor.WHITE)))); } public IriniSengir(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.DWARF); @@ -37,7 +34,9 @@ public final class IriniSengir extends CardImpl { this.toughness = new MageInt(2); // Green enchantment spells and white enchantment spells cost {2} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 2))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new SpellsCostIncreasingAllEffect(2, filter, TargetController.ANY)) + ); } public IriniSengir(final IriniSengir card) { diff --git a/Mage.Sets/src/mage/cards/j/JadeLeech.java b/Mage.Sets/src/mage/cards/j/JadeLeech.java index 80bfff6d4c..d5a8a6dab3 100644 --- a/Mage.Sets/src/mage/cards/j/JadeLeech.java +++ b/Mage.Sets/src/mage/cards/j/JadeLeech.java @@ -1,22 +1,22 @@ - package mage.cards.j; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class JadeLeech extends CardImpl { @@ -28,14 +28,14 @@ public final class JadeLeech extends CardImpl { } public JadeLeech(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.subtype.add(SubType.LEECH); this.power = new MageInt(5); this.toughness = new MageInt(5); // Green spells you cast cost {G} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{G}")))); + new SpellsCostIncreasingAllEffect(new ManaCostsImpl("{G}"), filter, TargetController.YOU))); } public JadeLeech(final JadeLeech card) { diff --git a/Mage.Sets/src/mage/cards/l/LodestoneGolem.java b/Mage.Sets/src/mage/cards/l/LodestoneGolem.java index 3121068d07..0a75868ada 100644 --- a/Mage.Sets/src/mage/cards/l/LodestoneGolem.java +++ b/Mage.Sets/src/mage/cards/l/LodestoneGolem.java @@ -1,30 +1,30 @@ - package mage.cards.l; -import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.cards.Card; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.CostModificationType; -import mage.constants.Duration; -import mage.constants.Outcome; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; + +import java.util.UUID; /** - * * @author jeffwadsworth */ public final class LodestoneGolem extends CardImpl { + private static final FilterCard filter = new FilterCard("Nonartifact spells"); + + static { + filter.add(Predicates.not(CardType.ARTIFACT.getPredicate())); + } + public LodestoneGolem(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); this.subtype.add(SubType.GOLEM); @@ -33,7 +33,7 @@ public final class LodestoneGolem extends CardImpl { this.toughness = new MageInt(3); // Nonartifact spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LodestoneGolemCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } public LodestoneGolem(final LodestoneGolem card) { @@ -45,39 +45,3 @@ public final class LodestoneGolem extends CardImpl { return new LodestoneGolem(this); } } - -class LodestoneGolemCostReductionEffect extends CostModificationEffectImpl { - - LodestoneGolemCostReductionEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Nonartifact spells cost {1} more to cast"; - } - - LodestoneGolemCostReductionEffect(LodestoneGolemCostReductionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - spellAbility.getManaCostsToPay().add(new GenericManaCost(1)); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && !card.isArtifact()) { - return true; - } - } - return false; - } - - @Override - public LodestoneGolemCostReductionEffect copy() { - return new LodestoneGolemCostReductionEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/r/RubyLeech.java b/Mage.Sets/src/mage/cards/r/RubyLeech.java index 13638d55da..ba11fe901b 100644 --- a/Mage.Sets/src/mage/cards/r/RubyLeech.java +++ b/Mage.Sets/src/mage/cards/r/RubyLeech.java @@ -1,23 +1,23 @@ - package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class RubyLeech extends CardImpl { @@ -29,7 +29,7 @@ public final class RubyLeech extends CardImpl { } public RubyLeech(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.subtype.add(SubType.LEECH); this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -38,7 +38,7 @@ public final class RubyLeech extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // Red spells you cast cost {R} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{R}")))); + new SpellsCostIncreasingAllEffect(new ManaCostsImpl("{R}"), filter, TargetController.YOU))); } public RubyLeech(final RubyLeech card) { diff --git a/Mage.Sets/src/mage/cards/s/SapphireLeech.java b/Mage.Sets/src/mage/cards/s/SapphireLeech.java index 8b7e1386d7..31d8772e27 100644 --- a/Mage.Sets/src/mage/cards/s/SapphireLeech.java +++ b/Mage.Sets/src/mage/cards/s/SapphireLeech.java @@ -1,23 +1,23 @@ - package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class SapphireLeech extends CardImpl { @@ -29,7 +29,7 @@ public final class SapphireLeech extends CardImpl { } public SapphireLeech(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.LEECH); this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -38,7 +38,7 @@ public final class SapphireLeech extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Blue spells you cast cost {U} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{U}")))); + new SpellsCostIncreasingAllEffect(new ManaCostsImpl("{U}"), filter, TargetController.YOU))); } public SapphireLeech(final SapphireLeech card) { diff --git a/Mage.Sets/src/mage/cards/s/SphereOfResistance.java b/Mage.Sets/src/mage/cards/s/SphereOfResistance.java index 0e5c8303fe..c1326f4da8 100644 --- a/Mage.Sets/src/mage/cards/s/SphereOfResistance.java +++ b/Mage.Sets/src/mage/cards/s/SphereOfResistance.java @@ -1,25 +1,28 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; +import mage.filter.FilterCard; + +import java.util.UUID; /** - * * @author Plopman */ public final class SphereOfResistance extends CardImpl { public SphereOfResistance(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // Spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new SpellsCostIncreasingAllEffect(1, new FilterCard("Spells"), TargetController.ANY)) + ); } public SphereOfResistance(final SphereOfResistance card) { diff --git a/Mage.Sets/src/mage/cards/s/Squeeze.java b/Mage.Sets/src/mage/cards/s/Squeeze.java index 3dabaa83dc..2605970a04 100644 --- a/Mage.Sets/src/mage/cards/s/Squeeze.java +++ b/Mage.Sets/src/mage/cards/s/Squeeze.java @@ -1,35 +1,34 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; +import java.util.UUID; + /** - * * @author fireshoes */ public final class Squeeze extends CardImpl { - + private static final FilterCard filter = new FilterCard("Sorcery spells"); - + static { filter.add(CardType.SORCERY.getPredicate()); } public Squeeze(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); // Sorcery spells cost {3} more to cast. - Effect effect = new SpellsCostIncreasementAllEffect(filter, 3); - effect.setText("Sorcery spells cost {3} more to cast"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new SpellsCostIncreasingAllEffect(3, filter, TargetController.ANY)) + ); } public Squeeze(final Squeeze card) { diff --git a/Mage.Sets/src/mage/cards/t/ThaliaGuardianOfThraben.java b/Mage.Sets/src/mage/cards/t/ThaliaGuardianOfThraben.java index 4176be6c9c..985e87e5de 100644 --- a/Mage.Sets/src/mage/cards/t/ThaliaGuardianOfThraben.java +++ b/Mage.Sets/src/mage/cards/t/ThaliaGuardianOfThraben.java @@ -1,26 +1,28 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.keyword.FirstStrikeAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.game.Game; -import mage.util.CardUtil; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; + +import java.util.UUID; /** - * * @author BetaSteward */ public final class ThaliaGuardianOfThraben extends CardImpl { + private static final FilterCard filter = new FilterCard("Noncreature spells"); + + static { + filter.add(Predicates.not(CardType.CREATURE.getPredicate())); + } + public ThaliaGuardianOfThraben(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); addSuperType(SuperType.LEGENDARY); @@ -33,7 +35,7 @@ public final class ThaliaGuardianOfThraben extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // Noncreature spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ThaliaGuardianOfThrabenCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } @@ -45,39 +47,4 @@ public final class ThaliaGuardianOfThraben extends CardImpl { public ThaliaGuardianOfThraben copy() { return new ThaliaGuardianOfThraben(this); } -} - -class ThaliaGuardianOfThrabenCostReductionEffect extends CostModificationEffectImpl { - - ThaliaGuardianOfThrabenCostReductionEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Noncreature spells cost {1} more to cast"; - } - - ThaliaGuardianOfThrabenCostReductionEffect(ThaliaGuardianOfThrabenCostReductionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - CardUtil.increaseCost(abilityToModify, 1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && !card.isCreature()) { - return true; - } - } - return false; - } - - @Override - public ThaliaGuardianOfThrabenCostReductionEffect copy() { - return new ThaliaGuardianOfThrabenCostReductionEffect(this); - } - -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/t/ThornOfAmethyst.java b/Mage.Sets/src/mage/cards/t/ThornOfAmethyst.java index 3de6135ad2..78eed2b2e1 100644 --- a/Mage.Sets/src/mage/cards/t/ThornOfAmethyst.java +++ b/Mage.Sets/src/mage/cards/t/ThornOfAmethyst.java @@ -1,31 +1,33 @@ - package mage.cards.t; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; +import java.util.UUID; + /** - * * @author Plopman */ public final class ThornOfAmethyst extends CardImpl { private static final FilterCard filter = new FilterCard("Noncreature spells"); + static { filter.add(Predicates.not(CardType.CREATURE.getPredicate())); } + public ThornOfAmethyst(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // Noncreature spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } public ThornOfAmethyst(final ThornOfAmethyst card) { diff --git a/Mage.Sets/src/mage/cards/v/VrynWingmare.java b/Mage.Sets/src/mage/cards/v/VrynWingmare.java index e35cf3c18e..8ecdac26b4 100644 --- a/Mage.Sets/src/mage/cards/v/VrynWingmare.java +++ b/Mage.Sets/src/mage/cards/v/VrynWingmare.java @@ -1,31 +1,31 @@ - package mage.cards.v; -import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.CostModificationType; -import mage.constants.Duration; -import mage.constants.Outcome; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.util.CardUtil; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; + +import java.util.UUID; /** - * * @author fireshoes */ public final class VrynWingmare extends CardImpl { + private static final FilterCard filter = new FilterCard("Noncreature spells"); + + static { + filter.add(Predicates.not(CardType.CREATURE.getPredicate())); + } + public VrynWingmare(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.PEGASUS); @@ -36,7 +36,7 @@ public final class VrynWingmare extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Noncreature spells cost {1} more to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VrynWingmareCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasingAllEffect(1, filter, TargetController.ANY))); } public VrynWingmare(final VrynWingmare card) { @@ -48,38 +48,3 @@ public final class VrynWingmare extends CardImpl { return new VrynWingmare(this); } } - -class VrynWingmareCostReductionEffect extends CostModificationEffectImpl { - - VrynWingmareCostReductionEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Noncreature spells cost {1} more to cast"; - } - - VrynWingmareCostReductionEffect(VrynWingmareCostReductionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - CardUtil.increaseCost(abilityToModify, 1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && !card.isCreature()) { - return true; - } - } - return false; - } - - @Override - public VrynWingmareCostReductionEffect copy() { - return new VrynWingmareCostReductionEffect(this); - } - -} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ConditionalCostModificationTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ConditionalCostModificationTest.java index 8dbe972ea3..71a9242073 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ConditionalCostModificationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ConditionalCostModificationTest.java @@ -5,10 +5,12 @@ import mage.abilities.condition.common.MyTurnCondition; import mage.abilities.condition.common.NotMyTurnCondition; import mage.abilities.decorator.ConditionalCostModificationEffect; import mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect; -import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; import mage.abilities.keyword.EquipAbility; import mage.constants.PhaseStep; +import mage.constants.TargetController; import mage.constants.Zone; +import mage.filter.FilterCard; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -113,7 +115,7 @@ public class ConditionalCostModificationTest extends CardTestPlayerBase { new ConditionalCostModificationEffect( new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip"), NotMyTurnCondition.instance, - new SpellsCostIncreasementAllEffect(1), + new SpellsCostIncreasingAllEffect(1, new FilterCard(), TargetController.ANY), "" ) )); diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementAllEffect.java deleted file mode 100644 index cceda07b55..0000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementAllEffect.java +++ /dev/null @@ -1,66 +0,0 @@ - -package mage.abilities.effects.common.cost; - -import mage.abilities.Ability; -import mage.abilities.SpellAbility; -import mage.cards.Card; -import mage.constants.CostModificationType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.filter.FilterCard; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.util.CardUtil; - -/** - * - * @author Plopman - */ -public class SpellsCostIncreasementAllEffect extends CostModificationEffectImpl { - - private FilterCard filter; - private int amount; - - public SpellsCostIncreasementAllEffect(int amount) { - this(new FilterCard("Spells"), amount); - } - - public SpellsCostIncreasementAllEffect(FilterCard filter, int amount) { - super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); - this.filter = filter; - this.amount = amount; - this.staticText = new StringBuilder(filter.getMessage()).append(" cost {").append(amount).append("} more to cast").toString(); - } - - protected SpellsCostIncreasementAllEffect(SpellsCostIncreasementAllEffect effect) { - super(effect); - this.filter = effect.filter; - this.amount = effect.amount; - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - CardUtil.increaseCost(abilityToModify, this.amount); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); - if (spell != null) { - return this.filter.match(spell, game); - } else { - // used at least for flashback ability because Flashback ability doesn't use stack - Card sourceCard = game.getCard(abilityToModify.getSourceId()); - return sourceCard != null && this.filter.match(sourceCard, game); - } - } - return false; - } - - @Override - public SpellsCostIncreasementAllEffect copy() { - return new SpellsCostIncreasementAllEffect(this); - } -} diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java deleted file mode 100644 index 7023fc7884..0000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java +++ /dev/null @@ -1,90 +0,0 @@ - -package mage.abilities.effects.common.cost; - -import mage.abilities.Ability; -import mage.abilities.SpellAbility; -import mage.abilities.costs.mana.ManaCost; -import mage.abilities.costs.mana.ManaCosts; -import mage.cards.Card; -import mage.constants.CostModificationType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.filter.FilterCard; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.util.CardUtil; - -/** - * - * @author Quercitron - */ -public class SpellsCostIncreasementControllerEffect extends CostModificationEffectImpl { - - private final FilterCard filter; - private final int amount; - private ManaCosts manaCostsToIncrease = null; - - public SpellsCostIncreasementControllerEffect(FilterCard filter, ManaCosts manaCostsToReduce) { - super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.INCREASE_COST); - this.filter = filter; - this.amount = 0; - this.manaCostsToIncrease = manaCostsToReduce; - - StringBuilder sb = new StringBuilder(); - sb.append(filter.getMessage()).append(" you cast cost "); - for (String manaSymbol : manaCostsToReduce.getSymbols()) { - sb.append(manaSymbol); - } - sb.append(" more to cast"); - this.staticText = sb.toString(); - } - - public SpellsCostIncreasementControllerEffect(FilterCard filter, int amount) { - super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.INCREASE_COST); - this.filter = filter; - this.amount = amount; - - StringBuilder sb = new StringBuilder(); - sb.append(filter.getMessage()).append(" you cast cost {").append(amount).append("} more to cast"); - this.staticText = sb.toString(); - } - - protected SpellsCostIncreasementControllerEffect(SpellsCostIncreasementControllerEffect effect) { - super(effect); - this.filter = effect.filter; - this.amount = effect.amount; - this.manaCostsToIncrease = effect.manaCostsToIncrease; - } - - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - if (manaCostsToIncrease != null) { - CardUtil.increaseCost((SpellAbility) abilityToModify, manaCostsToIncrease); - } else { - CardUtil.increaseCost(abilityToModify, this.amount); - } - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.isControlledBy(source.getControllerId())) { - Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); - if (spell != null) { - return this.filter.match(spell, game); - } else { - // used at least for flashback ability because Flashback ability doesn't use stack - Card sourceCard = game.getCard(abilityToModify.getSourceId()); - return sourceCard != null && this.filter.match(sourceCard, game); - } - } - } - return false; - } - - @Override - public SpellsCostIncreasementControllerEffect copy() { - return new SpellsCostIncreasementControllerEffect(this); - } -} diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java new file mode 100644 index 0000000000..9786f8c077 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java @@ -0,0 +1,139 @@ +package mage.abilities.effects.common.cost; + +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCosts; +import mage.cards.Card; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * @author JayDi85 + */ +public class SpellsCostIncreasingAllEffect extends CostModificationEffectImpl { + + private final FilterCard filter; + private final TargetController targetController; + private final int increaseGenericCost; + private ManaCosts increaseManaCosts; + + public SpellsCostIncreasingAllEffect(int increaseGenericCost, FilterCard filter, TargetController targetController) { + super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.INCREASE_COST); + this.filter = filter; + this.targetController = targetController; + this.increaseGenericCost = increaseGenericCost; + this.increaseManaCosts = null; + + setText(); + } + + public SpellsCostIncreasingAllEffect(ManaCosts increaseManaCosts, FilterCard filter, TargetController targetController) { + super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.INCREASE_COST); + this.filter = filter; + this.targetController = targetController; + this.increaseGenericCost = 0; + this.increaseManaCosts = increaseManaCosts; + + setText(); + } + + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append(filter.getMessage()); + switch (this.targetController) { + case YOU: + sb.append(" you cast"); + break; + case OPPONENT: + sb.append(" your opponents cast"); + break; + case ANY: + break; + default: + throw new IllegalArgumentException("Unsupported TargetController " + this.targetController); + } + + sb.append(" cost "); + if (this.increaseManaCosts != null) { + for (String manaSymbol : this.increaseManaCosts.getSymbols()) { + sb.append(manaSymbol); + } + } else { + sb.append("{").append(increaseGenericCost).append("}"); + } + + sb.append(" more to cast"); + this.staticText = sb.toString(); + } + + protected SpellsCostIncreasingAllEffect(SpellsCostIncreasingAllEffect effect) { + super(effect); + this.filter = effect.filter; + this.targetController = effect.targetController; + this.increaseGenericCost = effect.increaseGenericCost; + this.increaseManaCosts = effect.increaseManaCosts; + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + if (increaseManaCosts != null) { + CardUtil.increaseCost((SpellAbility) abilityToModify, increaseManaCosts); + } else { + CardUtil.increaseCost(abilityToModify, this.increaseGenericCost); + } + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + Player abilityController = game.getPlayer(abilityToModify.getControllerId()); + Player sourceController = game.getPlayer(source.getControllerId()); + if (abilityController == null || sourceController == null) { + return false; + } + + switch (this.targetController) { + case YOU: + if (!sourceController.getId().equals(abilityController.getId())) { + return false; + } + break; + case OPPONENT: + if (!sourceController.hasOpponent(abilityController.getId(), game)) { + return false; + } + break; + case ANY: + break; + default: + throw new IllegalArgumentException("Unsupported TargetController " + this.targetController); + } + + Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); + if (spell != null) { + // real cast with put on stack + return this.filter.match(spell, game); + } else { + // get playable and other staff without put on stack + // used at least for flashback ability because Flashback ability doesn't use stack + Card sourceCard = game.getCard(abilityToModify.getSourceId()); + return sourceCard != null && this.filter.match(sourceCard, game); + } + } + return false; + } + + @Override + public SpellsCostIncreasingAllEffect copy() { + return new SpellsCostIncreasingAllEffect(this); + } +}