diff --git a/Mage.Sets/src/mage/cards/a/AbandonHope.java b/Mage.Sets/src/mage/cards/a/AbandonHope.java index a1adea968a..635917a898 100644 --- a/Mage.Sets/src/mage/cards/a/AbandonHope.java +++ b/Mage.Sets/src/mage/cards/a/AbandonHope.java @@ -34,7 +34,7 @@ public final class AbandonHope extends CardImpl { this.addAbility(ability); // Look at target opponent's hand and choose X cards from it. That player discards those cards. - ManacostVariableValue manaX = new ManacostVariableValue(); + ManacostVariableValue manaX = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(manaX, TargetController.ANY)); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().setCostAdjuster(AbandonHopeAdjuster.instance); diff --git a/Mage.Sets/src/mage/cards/a/AeonChronicler.java b/Mage.Sets/src/mage/cards/a/AeonChronicler.java index 4a6d8d4b4a..8b3f42378d 100644 --- a/Mage.Sets/src/mage/cards/a/AeonChronicler.java +++ b/Mage.Sets/src/mage/cards/a/AeonChronicler.java @@ -36,7 +36,7 @@ public final class AeonChronicler extends CardImpl { this.toughness = new MageInt(0); // Aeon Chronicler's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); // Suspend X-{X}{3}{U}. X can't be 0. this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl("{3}{U}"), this, true)); diff --git a/Mage.Sets/src/mage/cards/a/AetherMutation.java b/Mage.Sets/src/mage/cards/a/AetherMutation.java index 4f0fad54ba..c5b9b39587 100644 --- a/Mage.Sets/src/mage/cards/a/AetherMutation.java +++ b/Mage.Sets/src/mage/cards/a/AetherMutation.java @@ -25,7 +25,7 @@ public final class AetherMutation extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // create X 1/1 green Saproling creature tokens, where X is that creature's converted mana cost. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new TargetConvertedManaCost())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), TargetConvertedManaCost.instance)); } public AetherMutation(final AetherMutation card) { diff --git a/Mage.Sets/src/mage/cards/a/AgonizingDemise.java b/Mage.Sets/src/mage/cards/a/AgonizingDemise.java index a183e73f73..dcaab97043 100644 --- a/Mage.Sets/src/mage/cards/a/AgonizingDemise.java +++ b/Mage.Sets/src/mage/cards/a/AgonizingDemise.java @@ -40,7 +40,7 @@ public final class AgonizingDemise extends CardImpl { //If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DamageTargetControllerEffect(new TargetPermanentPowerCount()), + new DamageTargetControllerEffect(TargetPermanentPowerCount.instance), KickedCondition.instance, "if this spell was kicked, it deals damage equal to that creature's power to the creature's controller.")); diff --git a/Mage.Sets/src/mage/cards/a/AirdropCondor.java b/Mage.Sets/src/mage/cards/a/AirdropCondor.java index 447fbfae6c..824ef1f572 100644 --- a/Mage.Sets/src/mage/cards/a/AirdropCondor.java +++ b/Mage.Sets/src/mage/cards/a/AirdropCondor.java @@ -42,7 +42,7 @@ public final class AirdropCondor extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{1}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(SacrificeCostCreaturesPower.instance), new ManaCostsImpl("{1}{R}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java b/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java index 0dfdd6a8bf..a3b0b04fc4 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java +++ b/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java @@ -49,7 +49,7 @@ public final class AjaniCallerOfThePride extends CardImpl { ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // -8: create X 2/2 white Cat creature tokens, where X is your life total. - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new CatToken(), new ControllerLifeCount()), -8)); + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new CatToken(), ControllerLifeCount.instance), -8)); } public AjaniCallerOfThePride(final AjaniCallerOfThePride card) { diff --git a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java index 00f6ca6c98..7bec5ea3f3 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java +++ b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java @@ -44,7 +44,7 @@ public final class AjaniValiantProtector extends CardImpl { this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.LIBRARY), 1)); // -11: Put X +1/+1 counters on target creature, where X is your life total. That creature gains trample until end of turn. - Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), new ControllerLifeCount()); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), ControllerLifeCount.instance); effect.setText("Put X +1/+1 counters on target creature, where X is your life total."); ability = new LoyaltyAbility(effect, -11); effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java index 8a28d2545e..02198d974d 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java +++ b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java @@ -44,7 +44,7 @@ public final class AjaniWiseCounselor extends CardImpl { // −9: Put X +1/+1 counters on target creature, where X is your life total. Ability ability = new LoyaltyAbility(new AddCountersTargetEffect( CounterType.P1P1.createInstance(), - new ControllerLifeCount() + ControllerLifeCount.instance ).setText("put X +1/+1 counters on target creature, where X is your life total"), -9); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/AlabasterPotion.java b/Mage.Sets/src/mage/cards/a/AlabasterPotion.java index 2e918e1fe1..9a69608a6f 100644 --- a/Mage.Sets/src/mage/cards/a/AlabasterPotion.java +++ b/Mage.Sets/src/mage/cards/a/AlabasterPotion.java @@ -23,10 +23,10 @@ public final class AlabasterPotion extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{W}"); // Choose one - Target player gains X life; or prevent the next X damage that would be dealt to any target this turn. - this.getSpellAbility().addEffect(new GainLifeTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new GainLifeTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); Mode mode = new Mode(); - mode.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue())); + mode.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, ManacostVariableValue.instance)); mode.addTarget(new TargetAnyTarget()); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/a/AncientExcavation.java b/Mage.Sets/src/mage/cards/a/AncientExcavation.java index 4965f68132..c339ac270d 100644 --- a/Mage.Sets/src/mage/cards/a/AncientExcavation.java +++ b/Mage.Sets/src/mage/cards/a/AncientExcavation.java @@ -61,7 +61,7 @@ class AncientExcavationEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - DynamicValue numCards = new CardsInControllerHandCount(); + DynamicValue numCards = CardsInControllerHandCount.instance; int amount = numCards.calculate(game, source, this); player.drawCards(amount, game); player.discard(amount, false, source, game); diff --git a/Mage.Sets/src/mage/cards/a/ApexHawks.java b/Mage.Sets/src/mage/cards/a/ApexHawks.java index 796decca43..12d41455eb 100644 --- a/Mage.Sets/src/mage/cards/a/ApexHawks.java +++ b/Mage.Sets/src/mage/cards/a/ApexHawks.java @@ -35,7 +35,7 @@ public final class ApexHawks extends CardImpl { // Apex Hawks enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true) + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true) ,"with a +1/+1 counter on it for each time it was kicked")); } diff --git a/Mage.Sets/src/mage/cards/a/ArashiTheSkyAsunder.java b/Mage.Sets/src/mage/cards/a/ArashiTheSkyAsunder.java index 7a91c68a67..e474a02af8 100644 --- a/Mage.Sets/src/mage/cards/a/ArashiTheSkyAsunder.java +++ b/Mage.Sets/src/mage/cards/a/ArashiTheSkyAsunder.java @@ -43,13 +43,13 @@ public final class ArashiTheSkyAsunder extends CardImpl { this.toughness = new MageInt(5); // {X}{G}, {tap}: Arashi, the Sky Asunder deals X damage to target creature with flying. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{G}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); // Channel - {X}{G}{G}, Discard Arashi: Arashi deals X damage to each creature with flying. - this.addAbility(new ChannelAbility("{X}{G}{G}", new DamageAllEffect(new ManacostVariableValue(), filter))); + this.addAbility(new ChannelAbility("{X}{G}{G}", new DamageAllEffect(ManacostVariableValue.instance, filter))); } public ArashiTheSkyAsunder(final ArashiTheSkyAsunder card) { diff --git a/Mage.Sets/src/mage/cards/a/ArtifactMutation.java b/Mage.Sets/src/mage/cards/a/ArtifactMutation.java index 2aaa2ef027..43c0240f8e 100644 --- a/Mage.Sets/src/mage/cards/a/ArtifactMutation.java +++ b/Mage.Sets/src/mage/cards/a/ArtifactMutation.java @@ -25,7 +25,7 @@ public final class ArtifactMutation extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); // create X 1/1 green Saproling creature tokens, where X is that artifact's converted mana cost. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new TargetConvertedManaCost())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), TargetConvertedManaCost.instance)); } public ArtifactMutation(final ArtifactMutation card) { diff --git a/Mage.Sets/src/mage/cards/a/AshenSkinZubera.java b/Mage.Sets/src/mage/cards/a/AshenSkinZubera.java index 55f6c44791..050b2493a3 100644 --- a/Mage.Sets/src/mage/cards/a/AshenSkinZubera.java +++ b/Mage.Sets/src/mage/cards/a/AshenSkinZubera.java @@ -27,7 +27,7 @@ public final class AshenSkinZubera extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(new ZuberasDiedDynamicValue())); + Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(ZuberasDiedDynamicValue.instance)); ability.addTarget(new TargetOpponent()); this.addAbility(ability, new ZuberasDiedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/a/AtalyaSamiteMaster.java b/Mage.Sets/src/mage/cards/a/AtalyaSamiteMaster.java index 386cb7f67d..38c00a82ce 100644 --- a/Mage.Sets/src/mage/cards/a/AtalyaSamiteMaster.java +++ b/Mage.Sets/src/mage/cards/a/AtalyaSamiteMaster.java @@ -41,7 +41,7 @@ public final class AtalyaSamiteMaster extends CardImpl { this.toughness = new MageInt(3); // {X}, {tap}: Choose one - Prevent the next X damage that would be dealt to target creature this turn; or you gain X life. Spend only white mana on X. - PreventDamageToTargetEffect effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue()); + PreventDamageToTargetEffect effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, ManacostVariableValue.instance); effect.setText("Prevent the next X damage that would be dealt to target creature this turn. Spend only white mana on X."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); @@ -55,7 +55,7 @@ public final class AtalyaSamiteMaster extends CardImpl { // or you gain X life Mode mode = new Mode(); - mode.addEffect(new GainLifeEffect(new ManacostVariableValue()).setText("You gain X life. Spend only white mana on X.")); + mode.addEffect(new GainLifeEffect(ManacostVariableValue.instance).setText("You gain X life. Spend only white mana on X.")); ability.addMode(mode); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/Atogatog.java b/Mage.Sets/src/mage/cards/a/Atogatog.java index 107f7ccbbe..0f17b1a8a0 100644 --- a/Mage.Sets/src/mage/cards/a/Atogatog.java +++ b/Mage.Sets/src/mage/cards/a/Atogatog.java @@ -37,7 +37,7 @@ public final class Atogatog extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); - DynamicValue xValue = new SacrificeCostCreaturesPower(); + DynamicValue xValue = SacrificeCostCreaturesPower.instance; // Sacrifice an Atog creature: Atogatog gets +X/+X until end of turn, where X is the sacrificed creature's power. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(xValue, xValue,Duration.EndOfTurn), diff --git a/Mage.Sets/src/mage/cards/a/AuraMutation.java b/Mage.Sets/src/mage/cards/a/AuraMutation.java index 6586f22e63..7eaad0d970 100644 --- a/Mage.Sets/src/mage/cards/a/AuraMutation.java +++ b/Mage.Sets/src/mage/cards/a/AuraMutation.java @@ -25,7 +25,7 @@ public final class AuraMutation extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); // create X 1/1 green Saproling creature tokens, where X is that enchantment's converted mana cost. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new TargetConvertedManaCost())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), TargetConvertedManaCost.instance)); } public AuraMutation(final AuraMutation card) { diff --git a/Mage.Sets/src/mage/cards/a/AureliasFury.java b/Mage.Sets/src/mage/cards/a/AureliasFury.java index 0f42f5d652..01d4800511 100644 --- a/Mage.Sets/src/mage/cards/a/AureliasFury.java +++ b/Mage.Sets/src/mage/cards/a/AureliasFury.java @@ -62,7 +62,7 @@ public final class AureliasFury extends CardImpl { // Aurelia's Fury deals X damage divided as you choose among any number of target creatures and/or players. // Tap each creature dealt damage this way. Players dealt damage this way can't cast noncreature spells this turn. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); this.getSpellAbility().addEffect(new AureliasFuryEffect()); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue)); diff --git a/Mage.Sets/src/mage/cards/a/AyliEternalPilgrim.java b/Mage.Sets/src/mage/cards/a/AyliEternalPilgrim.java index d552596e34..4e6c3c3282 100644 --- a/Mage.Sets/src/mage/cards/a/AyliEternalPilgrim.java +++ b/Mage.Sets/src/mage/cards/a/AyliEternalPilgrim.java @@ -45,7 +45,7 @@ public final class AyliEternalPilgrim extends CardImpl { this.addAbility(DeathtouchAbility.getInstance()); // {1}, Sacrifice another creature: You gain life equal to the sacrificed creature's toughness. - Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); + Effect effect = new GainLifeEffect(SacrificeCostCreaturesToughness.instance); effect.setText("You gain life equal to the sacrificed creature's toughness"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE))); diff --git a/Mage.Sets/src/mage/cards/b/BalduvianRage.java b/Mage.Sets/src/mage/cards/b/BalduvianRage.java index 832c748b7c..9f3e910722 100644 --- a/Mage.Sets/src/mage/cards/b/BalduvianRage.java +++ b/Mage.Sets/src/mage/cards/b/BalduvianRage.java @@ -25,7 +25,7 @@ public final class BalduvianRage extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{R}"); // Target attacking creature gets +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterAttackingCreature())); // Draw a card at the beginning of the next turn's upkeep. diff --git a/Mage.Sets/src/mage/cards/b/BallistaSquad.java b/Mage.Sets/src/mage/cards/b/BallistaSquad.java index 232a7b75f1..b52ad56e1d 100644 --- a/Mage.Sets/src/mage/cards/b/BallistaSquad.java +++ b/Mage.Sets/src/mage/cards/b/BallistaSquad.java @@ -30,7 +30,7 @@ public final class BallistaSquad extends CardImpl { this.toughness = new MageInt(2); // {X}{W}, {T}: Ballista Squad deals X damage to target attacking or blocking creature. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{W}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{W}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAttackingOrBlockingCreature()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BaneOfTheLiving.java b/Mage.Sets/src/mage/cards/b/BaneOfTheLiving.java index e37a695bc9..a68033931f 100644 --- a/Mage.Sets/src/mage/cards/b/BaneOfTheLiving.java +++ b/Mage.Sets/src/mage/cards/b/BaneOfTheLiving.java @@ -32,7 +32,7 @@ public final class BaneOfTheLiving extends CardImpl { // Morph {X}{B}{B} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{X}{B}{B}"))); // When Bane of the Living is turned face up, all creatures get -X/-X until end of turn. - DynamicValue morphX = new SignInversionDynamicValue(new MorphManacostVariableValue()); + DynamicValue morphX = new SignInversionDynamicValue(MorphManacostVariableValue.instance); this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostAllEffect(morphX, morphX, Duration.EndOfTurn, new FilterCreaturePermanent("all creatures"), false, "", true))); } diff --git a/Mage.Sets/src/mage/cards/b/Banefire.java b/Mage.Sets/src/mage/cards/b/Banefire.java index 29d3a6a2fc..b74cddb4a9 100644 --- a/Mage.Sets/src/mage/cards/b/Banefire.java +++ b/Mage.Sets/src/mage/cards/b/Banefire.java @@ -106,7 +106,7 @@ class BaneFireEffect extends OneShotEffect { class BanefireCantCounterEffect extends ContinuousRuleModifyingEffectImpl { - Condition condition = new testCondition(new ManacostVariableValue(), 5); + Condition condition = new testCondition(ManacostVariableValue.instance, 5); public BanefireCantCounterEffect() { super(Duration.WhileOnStack, Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/b/Banshee.java b/Mage.Sets/src/mage/cards/b/Banshee.java index b2392191ad..3d0b460a5d 100644 --- a/Mage.Sets/src/mage/cards/b/Banshee.java +++ b/Mage.Sets/src/mage/cards/b/Banshee.java @@ -32,9 +32,9 @@ public final class Banshee extends CardImpl { this.toughness = new MageInt(1); // {X}, {T}: Banshee deals half X damage, rounded down, to any target, and half X damage, rounded up, to you. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new HalfValue(new ManacostVariableValue(), false)).setText("Banshee deals half X damage, rounded down, to any target,"), new ManaCostsImpl("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new HalfValue(ManacostVariableValue.instance, false)).setText("Banshee deals half X damage, rounded down, to any target,"), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); - ability.addEffect(new DamageControllerEffect(new HalfValue(new ManacostVariableValue(), true)).setText(" and half X damage, rounded up, to you")); + ability.addEffect(new DamageControllerEffect(new HalfValue(ManacostVariableValue.instance, true)).setText(" and half X damage, rounded up, to you")); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BarrageTyrant.java b/Mage.Sets/src/mage/cards/b/BarrageTyrant.java index 350f221c34..8f4b20d127 100644 --- a/Mage.Sets/src/mage/cards/b/BarrageTyrant.java +++ b/Mage.Sets/src/mage/cards/b/BarrageTyrant.java @@ -45,7 +45,7 @@ public final class BarrageTyrant extends CardImpl { this.addAbility(new DevoidAbility(this.color)); // {2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to any target. - Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); + Effect effect = new DamageTargetEffect(SacrificeCostCreaturesPower.instance); effect.setText("{this} deals damage equal to the sacrificed creature's power to any target"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); diff --git a/Mage.Sets/src/mage/cards/b/BattleAtTheBridge.java b/Mage.Sets/src/mage/cards/b/BattleAtTheBridge.java index b7d906149e..6aced560b8 100644 --- a/Mage.Sets/src/mage/cards/b/BattleAtTheBridge.java +++ b/Mage.Sets/src/mage/cards/b/BattleAtTheBridge.java @@ -27,10 +27,10 @@ public final class BattleAtTheBridge extends CardImpl { addAbility(new ImproviseAbility()); // Target creature gets -X/-X until end of turn. You gain X life. - DynamicValue x = new SignInversionDynamicValue(new ManacostVariableValue()); + DynamicValue x = new SignInversionDynamicValue(ManacostVariableValue.instance); this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance)); } public BattleAtTheBridge(final BattleAtTheBridge card) { diff --git a/Mage.Sets/src/mage/cards/b/BelbesArmor.java b/Mage.Sets/src/mage/cards/b/BelbesArmor.java index e1e54a3e32..d9cc57f6a2 100644 --- a/Mage.Sets/src/mage/cards/b/BelbesArmor.java +++ b/Mage.Sets/src/mage/cards/b/BelbesArmor.java @@ -29,8 +29,8 @@ public final class BelbesArmor extends CardImpl { Ability ability = new SimpleActivatedAbility( Zone.BATTLEFIELD, new BoostTargetEffect( - new MultipliedValue(new ManacostVariableValue(), -1), - new ManacostVariableValue(), + new MultipliedValue(ManacostVariableValue.instance, -1), + ManacostVariableValue.instance, Duration.EndOfTurn ), new ManaCostsImpl("{X}")); diff --git a/Mage.Sets/src/mage/cards/b/Berserk.java b/Mage.Sets/src/mage/cards/b/Berserk.java index dc4065a0c8..d1f990e57e 100644 --- a/Mage.Sets/src/mage/cards/b/Berserk.java +++ b/Mage.Sets/src/mage/cards/b/Berserk.java @@ -43,7 +43,7 @@ public final class Berserk extends CardImpl { Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("Target creature gains trample"); this.getSpellAbility().addEffect(effect); - effect = new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true); + effect = new BoostTargetEffect(TargetPermanentPowerCount.instance, new StaticValue(0), Duration.EndOfTurn, true); effect.setText("and gets +X/+0 until end of turn, where X is its power"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new BerserkDestroyEffect()); diff --git a/Mage.Sets/src/mage/cards/b/BiomassMutation.java b/Mage.Sets/src/mage/cards/b/BiomassMutation.java index eaf5268466..cbd6af3407 100644 --- a/Mage.Sets/src/mage/cards/b/BiomassMutation.java +++ b/Mage.Sets/src/mage/cards/b/BiomassMutation.java @@ -22,7 +22,7 @@ public final class BiomassMutation extends CardImpl { // Creatures you control have base power and toughness X/X until end of turn. - DynamicValue variableMana = new ManacostVariableValue(); + DynamicValue variableMana = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures you control"), true)); } diff --git a/Mage.Sets/src/mage/cards/b/BlackManaBattery.java b/Mage.Sets/src/mage/cards/b/BlackManaBattery.java index 2423fc449b..0aa099282e 100644 --- a/Mage.Sets/src/mage/cards/b/BlackManaBattery.java +++ b/Mage.Sets/src/mage/cards/b/BlackManaBattery.java @@ -36,7 +36,7 @@ public final class BlackManaBattery extends CardImpl { // {tap}, Remove any number of charge counters from Black Mana Battery: Add {B}, then add an additional {B} for each charge counter removed this way. ability = new DynamicManaAbility( Mana.BlackMana(1), - new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance), new TapSourceCost(), "Add {B}, then add {B} for each charge counter removed this way", true, new CountersSourceCount(CounterType.CHARGE)); diff --git a/Mage.Sets/src/mage/cards/b/Blaze.java b/Mage.Sets/src/mage/cards/b/Blaze.java index bbeead8481..d2b4c01921 100644 --- a/Mage.Sets/src/mage/cards/b/Blaze.java +++ b/Mage.Sets/src/mage/cards/b/Blaze.java @@ -20,7 +20,7 @@ public final class Blaze extends CardImpl { // Blaze deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/b/BlazingShoal.java b/Mage.Sets/src/mage/cards/b/BlazingShoal.java index 79e19d154d..9f6238b97e 100644 --- a/Mage.Sets/src/mage/cards/b/BlazingShoal.java +++ b/Mage.Sets/src/mage/cards/b/BlazingShoal.java @@ -38,7 +38,7 @@ public final class BlazingShoal extends CardImpl { this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter),true))); // Target creature gets +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(new ExileFromHandCostCardConvertedMana(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ExileFromHandCostCardConvertedMana.instance, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/b/BloodChinFanatic.java b/Mage.Sets/src/mage/cards/b/BloodChinFanatic.java index 2c5135dbeb..a05a7f2857 100644 --- a/Mage.Sets/src/mage/cards/b/BloodChinFanatic.java +++ b/Mage.Sets/src/mage/cards/b/BloodChinFanatic.java @@ -42,9 +42,9 @@ public final class BloodChinFanatic extends CardImpl { this.toughness = new MageInt(3); // {1}{B}, Sacrifice another Warrior creature: Target player loses X life and you gain X life, where X is the sacrificed creature's power. - Effect effect = new LoseLifeTargetEffect(new SacrificeCostCreaturesPower()); + Effect effect = new LoseLifeTargetEffect(SacrificeCostCreaturesPower.instance); effect.setText("Target player loses X life"); - Effect effect2 = new GainLifeEffect(new SacrificeCostCreaturesPower()); + Effect effect2 = new GainLifeEffect(SacrificeCostCreaturesPower.instance); effect2.setText("and you gain X life, where X is the sacrificed creature's power"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); ability.addEffect(effect2); diff --git a/Mage.Sets/src/mage/cards/b/BloodcrazedPaladin.java b/Mage.Sets/src/mage/cards/b/BloodcrazedPaladin.java index 979494a69d..85cfe792f6 100644 --- a/Mage.Sets/src/mage/cards/b/BloodcrazedPaladin.java +++ b/Mage.Sets/src/mage/cards/b/BloodcrazedPaladin.java @@ -34,7 +34,7 @@ public final class BloodcrazedPaladin extends CardImpl { // Bloodcrazed Paladin enters the battlefield with a +1/+1 counter on it for each creature that died this turn. Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), - new CreaturesDiedThisTurnCount(), true); + CreaturesDiedThisTurnCount.instance, true); effect.setText("with a +1/+1 counter on it for each creature that died this turn."); this.addAbility(new EntersBattlefieldAbility(effect), new CreaturesDiedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/b/BloodcurdlingScream.java b/Mage.Sets/src/mage/cards/b/BloodcurdlingScream.java index 405349caa7..50d803fc36 100644 --- a/Mage.Sets/src/mage/cards/b/BloodcurdlingScream.java +++ b/Mage.Sets/src/mage/cards/b/BloodcurdlingScream.java @@ -21,7 +21,7 @@ public final class BloodcurdlingScream extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}"); // Target creature gets +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(new ExileFromHandCostCardConvertedMana(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ExileFromHandCostCardConvertedMana.instance, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/b/BloodhuskRitualist.java b/Mage.Sets/src/mage/cards/b/BloodhuskRitualist.java index 4fb929dd9f..d3cc620816 100644 --- a/Mage.Sets/src/mage/cards/b/BloodhuskRitualist.java +++ b/Mage.Sets/src/mage/cards/b/BloodhuskRitualist.java @@ -32,7 +32,7 @@ public final class BloodhuskRitualist extends CardImpl { this.addAbility(new MultikickerAbility("{B}")); // When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked. - Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(new MultikickerCount())); + Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(MultikickerCount.instance)); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java b/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java index 80aa19dbbb..7cbe947de4 100644 --- a/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java +++ b/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java @@ -33,7 +33,7 @@ public final class BloodshotCyclops extends CardImpl { // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed // creature's power to any target. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new DamageTargetEffect(new SacrificeCostCreaturesPower()), + new DamageTargetEffect(SacrificeCostCreaturesPower.instance), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/b/BlueManaBattery.java b/Mage.Sets/src/mage/cards/b/BlueManaBattery.java index 9283e18893..05ad3bfc87 100644 --- a/Mage.Sets/src/mage/cards/b/BlueManaBattery.java +++ b/Mage.Sets/src/mage/cards/b/BlueManaBattery.java @@ -36,7 +36,7 @@ public final class BlueManaBattery extends CardImpl { // {tap}, Remove any number of charge counters from Blue Mana Battery: Add {U}, then add an additional {U} for each charge counter removed this way. ability = new DynamicManaAbility( Mana.BlueMana(1), - new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance), new TapSourceCost(), "Add {U}, then add {U} for each charge counter removed this way", true, new CountersSourceCount(CounterType.CHARGE)); diff --git a/Mage.Sets/src/mage/cards/b/BlueSunsZenith.java b/Mage.Sets/src/mage/cards/b/BlueSunsZenith.java index 72d74af31f..2e94941db5 100644 --- a/Mage.Sets/src/mage/cards/b/BlueSunsZenith.java +++ b/Mage.Sets/src/mage/cards/b/BlueSunsZenith.java @@ -21,7 +21,7 @@ public final class BlueSunsZenith extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}{U}{U}"); // Target player draws X cards. Shuffle Blue Sun's Zenith into its owner's library. - this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/b/BondOfAgony.java b/Mage.Sets/src/mage/cards/b/BondOfAgony.java index 761c1ad988..a6da60f30e 100644 --- a/Mage.Sets/src/mage/cards/b/BondOfAgony.java +++ b/Mage.Sets/src/mage/cards/b/BondOfAgony.java @@ -18,7 +18,7 @@ public final class BondOfAgony extends CardImpl { public BondOfAgony(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}"); - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; // As an additional cost to cast Bond of Agony, pay X life. // magenoxx: here we don't use PayVariableLifeCost as {X} shouldn't actually be announced diff --git a/Mage.Sets/src/mage/cards/b/BorrowingTheEastWind.java b/Mage.Sets/src/mage/cards/b/BorrowingTheEastWind.java index 9d5ab407c5..53f13e39be 100644 --- a/Mage.Sets/src/mage/cards/b/BorrowingTheEastWind.java +++ b/Mage.Sets/src/mage/cards/b/BorrowingTheEastWind.java @@ -27,7 +27,7 @@ public final class BorrowingTheEastWind extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G}{G}"); // Borrowing the East Wind deals X damage to each creature with horsemanship and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } + this.getSpellAbility().addEffect(new DamageEverythingEffect(ManacostVariableValue.instance, filter)); } public BorrowingTheEastWind(final BorrowingTheEastWind card) { super(card); diff --git a/Mage.Sets/src/mage/cards/b/BottomlessVault.java b/Mage.Sets/src/mage/cards/b/BottomlessVault.java index 8bd5f7fa13..caad3bf15c 100644 --- a/Mage.Sets/src/mage/cards/b/BottomlessVault.java +++ b/Mage.Sets/src/mage/cards/b/BottomlessVault.java @@ -44,7 +44,7 @@ public final class BottomlessVault extends CardImpl { // {tap}, Remove any number of storage counters from Bottomless Vault: Add {B} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.BlackMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {B} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/b/BrainInAJar.java b/Mage.Sets/src/mage/cards/b/BrainInAJar.java index 161a5c9fcc..7896994188 100644 --- a/Mage.Sets/src/mage/cards/b/BrainInAJar.java +++ b/Mage.Sets/src/mage/cards/b/BrainInAJar.java @@ -118,7 +118,7 @@ class BrainInAJarScryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int x = new RemovedCountersForCostValue().calculate(game, source, this); + int x = RemovedCountersForCostValue.instance.calculate(game, source, this); if (x > 0) { return controller.scry(x, source, game); } diff --git a/Mage.Sets/src/mage/cards/b/Braingeyser.java b/Mage.Sets/src/mage/cards/b/Braingeyser.java index f3bd4083b0..75dad9a4f6 100644 --- a/Mage.Sets/src/mage/cards/b/Braingeyser.java +++ b/Mage.Sets/src/mage/cards/b/Braingeyser.java @@ -21,7 +21,7 @@ public final class Braingeyser extends CardImpl { // Target player draws X cards. - this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/b/Brightflame.java b/Mage.Sets/src/mage/cards/b/Brightflame.java index 8e70b4a364..54f8ab2edf 100644 --- a/Mage.Sets/src/mage/cards/b/Brightflame.java +++ b/Mage.Sets/src/mage/cards/b/Brightflame.java @@ -29,7 +29,7 @@ public final class Brightflame extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}{R}{W}{W}"); // Radiance - Brightflame deals X damage to target creature and each other creature that shares a color with it. You gain life equal to the damage dealt this way. - this.getSpellAbility().addEffect(new BrightflameEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new BrightflameEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().setAbilityWord(AbilityWord.RADIANCE); } diff --git a/Mage.Sets/src/mage/cards/b/BrokenAmbitions.java b/Mage.Sets/src/mage/cards/b/BrokenAmbitions.java index 484e49a210..b9d4be4d1a 100644 --- a/Mage.Sets/src/mage/cards/b/BrokenAmbitions.java +++ b/Mage.Sets/src/mage/cards/b/BrokenAmbitions.java @@ -30,7 +30,7 @@ public final class BrokenAmbitions extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}"); // Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller puts the top four cards of their library into their graveyard. - this.getSpellAbility().addEffect(new BrokenAmbitionsEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new BrokenAmbitionsEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetSpell()); } diff --git a/Mage.Sets/src/mage/cards/b/BurnAtTheStake.java b/Mage.Sets/src/mage/cards/b/BurnAtTheStake.java index 7931708785..7707490f2d 100644 --- a/Mage.Sets/src/mage/cards/b/BurnAtTheStake.java +++ b/Mage.Sets/src/mage/cards/b/BurnAtTheStake.java @@ -69,7 +69,7 @@ class BurnAtTheStakeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = (new GetXValue()).calculate(game, source, this) * 3; + int amount = (GetXValue.instance).calculate(game, source, this) * 3; Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { diff --git a/Mage.Sets/src/mage/cards/c/CabalInterrogator.java b/Mage.Sets/src/mage/cards/c/CabalInterrogator.java index 7e8862fdb9..4fd7e496e3 100644 --- a/Mage.Sets/src/mage/cards/c/CabalInterrogator.java +++ b/Mage.Sets/src/mage/cards/c/CabalInterrogator.java @@ -78,7 +78,7 @@ class CabalInterrogatorEffect extends OneShotEffect { return false; } - int amountToReveal = (new ManacostVariableValue()).calculate(game, source, this); + int amountToReveal = (ManacostVariableValue.instance).calculate(game, source, this); Cards revealedCards = new CardsImpl(); if (amountToReveal > 0 && targetPlayer.getHand().size() > amountToReveal) { diff --git a/Mage.Sets/src/mage/cards/c/CacklingWitch.java b/Mage.Sets/src/mage/cards/c/CacklingWitch.java index ec76eecd38..37f93e1542 100644 --- a/Mage.Sets/src/mage/cards/c/CacklingWitch.java +++ b/Mage.Sets/src/mage/cards/c/CacklingWitch.java @@ -33,7 +33,7 @@ public final class CacklingWitch extends CardImpl { this.toughness = new MageInt(1); // {X}{B}, {tap}, Discard a card: Target creature gets +X/+0 until end of turn. - ManacostVariableValue manaX = new ManacostVariableValue(); + ManacostVariableValue manaX = ManacostVariableValue.instance; Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(manaX, new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{X}{B}")); diff --git a/Mage.Sets/src/mage/cards/c/CalciformPools.java b/Mage.Sets/src/mage/cards/c/CalciformPools.java index 72702e77fd..9d12369191 100644 --- a/Mage.Sets/src/mage/cards/c/CalciformPools.java +++ b/Mage.Sets/src/mage/cards/c/CalciformPools.java @@ -36,7 +36,7 @@ public final class CalciformPools extends CardImpl { this.addAbility(ability); // {1}, Remove X storage counters from Calciform Pools: Add X mana in any combination of {W} and/or {U}. ability = new SimpleManaAbility(Zone.BATTLEFIELD, - new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.W, ColoredManaSymbol.U), + new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.W, ColoredManaSymbol.U), new GenericManaCost(1)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/Carrion.java b/Mage.Sets/src/mage/cards/c/Carrion.java index 335d1c595a..befed330ea 100644 --- a/Mage.Sets/src/mage/cards/c/Carrion.java +++ b/Mage.Sets/src/mage/cards/c/Carrion.java @@ -25,7 +25,7 @@ public final class Carrion extends CardImpl { this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Put X 0/1 black Insect creature tokens onto the battlefield, where X is the sacrificed creature's power. - this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionBlackInsectToken(), new SacrificeCostCreaturesPower())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionBlackInsectToken(), SacrificeCostCreaturesPower.instance)); } public Carrion(final Carrion card) { diff --git a/Mage.Sets/src/mage/cards/c/ChamberSentry.java b/Mage.Sets/src/mage/cards/c/ChamberSentry.java index 60c1182502..7e8969db2a 100644 --- a/Mage.Sets/src/mage/cards/c/ChamberSentry.java +++ b/Mage.Sets/src/mage/cards/c/ChamberSentry.java @@ -44,7 +44,7 @@ public final class ChamberSentry extends CardImpl { "with a +1/+1 counter on it for each color of mana spent to cast it")); // {X}, {T}, Remove X +1/+1 counters from Chamber Sentry: It deals X damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()) + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance) .setText("It deals X damage to any target"), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/c/ChampionOfStraySouls.java b/Mage.Sets/src/mage/cards/c/ChampionOfStraySouls.java index 53634931b2..f8e2745365 100644 --- a/Mage.Sets/src/mage/cards/c/ChampionOfStraySouls.java +++ b/Mage.Sets/src/mage/cards/c/ChampionOfStraySouls.java @@ -82,7 +82,7 @@ enum ChampionOfStraySoulsAdjuster implements TargetAdjuster { public void adjustTargets(Ability ability, Game game) { for (Effect effect : ability.getEffects()) { if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) { - int xValue = new GetXValue().calculate(game, ability, null); + int xValue = GetXValue.instance.calculate(game, ability, null); ability.getTargets().clear(); ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard"))); } diff --git a/Mage.Sets/src/mage/cards/c/ChillHaunting.java b/Mage.Sets/src/mage/cards/c/ChillHaunting.java index 2730c08155..d13c2420f2 100644 --- a/Mage.Sets/src/mage/cards/c/ChillHaunting.java +++ b/Mage.Sets/src/mage/cards/c/ChillHaunting.java @@ -28,7 +28,7 @@ public final class ChillHaunting extends CardImpl { // Target creature gets -X/-X until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - DynamicValue xval = new SignInversionDynamicValue(new GetXValue()); + DynamicValue xval = new SignInversionDynamicValue(GetXValue.instance); this.getSpellAbility().addEffect(new BoostTargetEffect(xval, xval, Duration.EndOfTurn)); } diff --git a/Mage.Sets/src/mage/cards/c/CinderElemental.java b/Mage.Sets/src/mage/cards/c/CinderElemental.java index 8adeae708e..16a0dfcae5 100644 --- a/Mage.Sets/src/mage/cards/c/CinderElemental.java +++ b/Mage.Sets/src/mage/cards/c/CinderElemental.java @@ -31,7 +31,7 @@ public final class CinderElemental extends CardImpl { this.toughness = new MageInt(2); // {X}{R}, {tap}, Sacrifice Cinder Elemental: Cinder Elemental deals X damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{R}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/c/ClanDefiance.java b/Mage.Sets/src/mage/cards/c/ClanDefiance.java index 49d307e93e..7400b1fb4f 100644 --- a/Mage.Sets/src/mage/cards/c/ClanDefiance.java +++ b/Mage.Sets/src/mage/cards/c/ClanDefiance.java @@ -36,16 +36,16 @@ public final class ClanDefiance extends CardImpl { this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(3); // Clan Defiance deals X damage to target creature with flying; - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // Clan Defiance deals X damage to target creature without flying; Mode mode1 = new Mode(); - mode1.addEffect(new DamageTargetEffect(new ManacostVariableValue())); + mode1.addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); mode1.addTarget(new TargetCreaturePermanent(filter2)); this.getSpellAbility().addMode(mode1); // and/or Clan Defiance deals X damage to target player. Mode mode2 = new Mode(); - mode2.addEffect(new DamageTargetEffect(new ManacostVariableValue())); + mode2.addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); mode2.addTarget(new TargetPlayerOrPlaneswalker()); this.getSpellAbility().addMode(mode2); diff --git a/Mage.Sets/src/mage/cards/c/ClashOfWills.java b/Mage.Sets/src/mage/cards/c/ClashOfWills.java index 0108bc2691..a16fe93da3 100644 --- a/Mage.Sets/src/mage/cards/c/ClashOfWills.java +++ b/Mage.Sets/src/mage/cards/c/ClashOfWills.java @@ -19,7 +19,7 @@ public final class ClashOfWills extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}"); // Counter target spell unless its controller pays {X}. - this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetSpell()); } diff --git a/Mage.Sets/src/mage/cards/c/ClockworkAvian.java b/Mage.Sets/src/mage/cards/c/ClockworkAvian.java index 7eabddb97f..696fca568a 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkAvian.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkAvian.java @@ -63,7 +63,7 @@ public final class ClockworkAvian extends CardImpl { Zone.BATTLEFIELD, new AvianAddCountersSourceEffect( CounterType.P1P0.createInstance(), - new ManacostVariableValue(), + ManacostVariableValue.instance, true, true ), new ManaCostsImpl("{X}"), diff --git a/Mage.Sets/src/mage/cards/c/ClockworkBeast.java b/Mage.Sets/src/mage/cards/c/ClockworkBeast.java index e02f4434b4..9fa1356e13 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkBeast.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkBeast.java @@ -59,7 +59,7 @@ public final class ClockworkBeast extends CardImpl { Zone.BATTLEFIELD, new BeastAddCountersSourceEffect( CounterType.P1P0.createInstance(), - new ManacostVariableValue(), + ManacostVariableValue.instance, true, true ), new ManaCostsImpl("{X}"), diff --git a/Mage.Sets/src/mage/cards/c/ClockworkSteed.java b/Mage.Sets/src/mage/cards/c/ClockworkSteed.java index fe4557ef8d..c2975f53d2 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkSteed.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkSteed.java @@ -70,7 +70,7 @@ public final class ClockworkSteed extends CardImpl { Zone.BATTLEFIELD, new ClockworkSteedAddCountersSourceEffect( CounterType.P1P0.createInstance(), - new ManacostVariableValue(), + ManacostVariableValue.instance, true, true ), new ManaCostsImpl("{X}"), diff --git a/Mage.Sets/src/mage/cards/c/ClockworkSwarm.java b/Mage.Sets/src/mage/cards/c/ClockworkSwarm.java index 4480d844ce..0cd0288d2e 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkSwarm.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkSwarm.java @@ -73,7 +73,7 @@ public final class ClockworkSwarm extends CardImpl { Zone.BATTLEFIELD, new SwarmAddCountersSourceEffect( CounterType.P1P0.createInstance(), - new ManacostVariableValue(), + ManacostVariableValue.instance, true, true ), new ManaCostsImpl("{X}"), diff --git a/Mage.Sets/src/mage/cards/c/CometStorm.java b/Mage.Sets/src/mage/cards/c/CometStorm.java index 0c331d3d7b..41c3de1510 100644 --- a/Mage.Sets/src/mage/cards/c/CometStorm.java +++ b/Mage.Sets/src/mage/cards/c/CometStorm.java @@ -49,7 +49,7 @@ enum CometStormAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); - int numbTargets = new MultikickerCount().calculate(game, ability, null) + 1; + int numbTargets = MultikickerCount.instance.calculate(game, ability, null) + 1; ability.addTarget(new TargetAnyTarget(numbTargets)); } } diff --git a/Mage.Sets/src/mage/cards/c/Condescend.java b/Mage.Sets/src/mage/cards/c/Condescend.java index 05ce5af84c..26c8ceb6f9 100644 --- a/Mage.Sets/src/mage/cards/c/Condescend.java +++ b/Mage.Sets/src/mage/cards/c/Condescend.java @@ -21,7 +21,7 @@ public final class Condescend extends CardImpl { // Counter target spell unless its controller pays {X}. - this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetSpell()); // Scry 2. this.getSpellAbility().addEffect(new ScryEffect(2)); diff --git a/Mage.Sets/src/mage/cards/c/CopperLeafAngel.java b/Mage.Sets/src/mage/cards/c/CopperLeafAngel.java index 8fe61fdfd9..a894eec248 100644 --- a/Mage.Sets/src/mage/cards/c/CopperLeafAngel.java +++ b/Mage.Sets/src/mage/cards/c/CopperLeafAngel.java @@ -35,7 +35,7 @@ public final class CopperLeafAngel extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {tap}, Sacrifice X lands: Put X +1/+1 counters on Copper-Leaf Angel. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(),new GetXValue(), false), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(),GetXValue.instance, false), new TapSourceCost()); ability.addCost(new SacrificeXTargetCost(new FilterControlledLandPermanent("lands"), false)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveGale.java b/Mage.Sets/src/mage/cards/c/CorrosiveGale.java index 3a4ca7d234..e5a5ccb8e4 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveGale.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveGale.java @@ -27,7 +27,7 @@ public final class CorrosiveGale extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G/P}"); - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filter)); } public CorrosiveGale(final CorrosiveGale card) { diff --git a/Mage.Sets/src/mage/cards/c/CratersClaws.java b/Mage.Sets/src/mage/cards/c/CratersClaws.java index 7d212220f1..acdea1c74a 100644 --- a/Mage.Sets/src/mage/cards/c/CratersClaws.java +++ b/Mage.Sets/src/mage/cards/c/CratersClaws.java @@ -24,8 +24,8 @@ public final class CratersClaws extends CardImpl { // Crater's Claws deals X damage to any target. // Ferocious — Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DamageTargetEffect(new IntPlusDynamicValue(2, new ManacostVariableValue())), - new DamageTargetEffect(new ManacostVariableValue()), + new DamageTargetEffect(new IntPlusDynamicValue(2, ManacostVariableValue.instance)), + new DamageTargetEffect(ManacostVariableValue.instance), FerociousCondition.instance, "{this} deals X damage to any target." + "
Ferocious — {this} deals X plus 2 damage to that permanent or player instead if you control a creature with power 4 or greater")); diff --git a/Mage.Sets/src/mage/cards/c/CreatureBond.java b/Mage.Sets/src/mage/cards/c/CreatureBond.java index a1a8463073..7a6fff4437 100644 --- a/Mage.Sets/src/mage/cards/c/CreatureBond.java +++ b/Mage.Sets/src/mage/cards/c/CreatureBond.java @@ -35,7 +35,7 @@ public final class CreatureBond extends CardImpl { this.addAbility(ability); // When enchanted creature dies, Creature Bond deals damage equal to that creature's toughness to the creature's controller. - this.addAbility( new DiesAttachedTriggeredAbility(new DamageAttachedControllerEffect(new AttachedPermanentToughnessValue()), "enchanted creature")); + this.addAbility( new DiesAttachedTriggeredAbility(new DamageAttachedControllerEffect(AttachedPermanentToughnessValue.instance), "enchanted creature")); } public CreatureBond(final CreatureBond card) { diff --git a/Mage.Sets/src/mage/cards/c/CrimsonHellkite.java b/Mage.Sets/src/mage/cards/c/CrimsonHellkite.java index a929af7dfd..f9f867142d 100644 --- a/Mage.Sets/src/mage/cards/c/CrimsonHellkite.java +++ b/Mage.Sets/src/mage/cards/c/CrimsonHellkite.java @@ -43,7 +43,7 @@ public final class CrimsonHellkite extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // {X}, {tap}: Crimson Hellkite deals X damage to target creature. Spend only red mana on X. - Effect effect = new DamageTargetEffect(new ManacostVariableValue()); + Effect effect = new DamageTargetEffect(ManacostVariableValue.instance); effect.setText("{this} deals X damage to target creature. Spend only red mana on X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/c/CrucibleOfTheSpiritDragon.java b/Mage.Sets/src/mage/cards/c/CrucibleOfTheSpiritDragon.java index 1eb974792d..0b8fe29b22 100644 --- a/Mage.Sets/src/mage/cards/c/CrucibleOfTheSpiritDragon.java +++ b/Mage.Sets/src/mage/cards/c/CrucibleOfTheSpiritDragon.java @@ -44,7 +44,7 @@ public final class CrucibleOfTheSpiritDragon extends CardImpl { // {T}, Remove X storage counters from Crucible of the Spirit Dragon: Add X mana in any combination of colors. Spend this mana only to cast Dragon spells or activate abilities of Dragons. ability = new ConditionalAnyColorManaAbility( new TapSourceCost(), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new CrucibleOfTheSpiritDragonManaBuilder(), false ); diff --git a/Mage.Sets/src/mage/cards/c/CruelSadist.java b/Mage.Sets/src/mage/cards/c/CruelSadist.java index 3be03cd96e..63e7c85fac 100644 --- a/Mage.Sets/src/mage/cards/c/CruelSadist.java +++ b/Mage.Sets/src/mage/cards/c/CruelSadist.java @@ -44,7 +44,7 @@ public final class CruelSadist extends CardImpl { this.addAbility(ability); // {2}{B}, {T}, Remove X +1/+1 counters from Cruel Sadist: Cruel Sadist deals X damage to target creature. - Effect effect = new DamageTargetEffect(new RemovedCountersForCostValue()); + Effect effect = new DamageTargetEffect(RemovedCountersForCostValue.instance); effect.setText("{this} deals X damage to target creature"); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/c/CryptRats.java b/Mage.Sets/src/mage/cards/c/CryptRats.java index f19332295b..d5dfc11893 100644 --- a/Mage.Sets/src/mage/cards/c/CryptRats.java +++ b/Mage.Sets/src/mage/cards/c/CryptRats.java @@ -38,7 +38,7 @@ public final class CryptRats extends CardImpl { this.toughness = new MageInt(1); // {X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana on X. - Effect effect = new DamageEverythingEffect(new ManacostVariableValue()); + Effect effect = new DamageEverythingEffect(ManacostVariableValue.instance); effect.setText("{this} deals X damage to each creature and each player. Spend only black mana on X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect,new ManaCostsImpl("{X}")); VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0); diff --git a/Mage.Sets/src/mage/cards/c/CutRibbons.java b/Mage.Sets/src/mage/cards/c/CutRibbons.java index 3d373dd9fb..b29a27ae09 100644 --- a/Mage.Sets/src/mage/cards/c/CutRibbons.java +++ b/Mage.Sets/src/mage/cards/c/CutRibbons.java @@ -29,7 +29,7 @@ public final class CutRibbons extends SplitCard { // Ribbons // Each opponent loses X life. getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true)); - getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(new ManacostVariableValue())); + getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(ManacostVariableValue.instance)); } diff --git a/Mage.Sets/src/mage/cards/d/DamiaSageOfStone.java b/Mage.Sets/src/mage/cards/d/DamiaSageOfStone.java index 2ca4be3381..4b75082585 100644 --- a/Mage.Sets/src/mage/cards/d/DamiaSageOfStone.java +++ b/Mage.Sets/src/mage/cards/d/DamiaSageOfStone.java @@ -59,7 +59,7 @@ public final class DamiaSageOfStone extends CardImpl { class DamiaSageOfStoneTriggeredAbility extends BeginningOfUpkeepTriggeredAbility { DamiaSageOfStoneTriggeredAbility() { - super(new DrawCardSourceControllerEffect(new IntPlusDynamicValue(7, new MultipliedValue(new CardsInControllerHandCount(), -1))), TargetController.YOU, false); + super(new DrawCardSourceControllerEffect(new IntPlusDynamicValue(7, new MultipliedValue(CardsInControllerHandCount.instance, -1))), TargetController.YOU, false); } DamiaSageOfStoneTriggeredAbility(final DamiaSageOfStoneTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/cards/d/DarkSalvation.java b/Mage.Sets/src/mage/cards/d/DarkSalvation.java index 30100994ac..9c0b24555c 100644 --- a/Mage.Sets/src/mage/cards/d/DarkSalvation.java +++ b/Mage.Sets/src/mage/cards/d/DarkSalvation.java @@ -34,7 +34,7 @@ public final class DarkSalvation extends CardImpl { // Target player creates X 2/2 black Zombie creature tokens, then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls. this.getSpellAbility().addTarget(new TargetPlayer()); - Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new ManacostVariableValue()); + Effect effect = new CreateTokenTargetEffect(new ZombieToken(), ManacostVariableValue.instance); effect.setText("Target player creates X 2/2 black Zombie creature tokens"); this.getSpellAbility().addEffect(effect); DynamicValue value = new ZombiesControlledByTargetPlayerCount(); diff --git a/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java b/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java index a6527a52fe..7faec30b05 100644 --- a/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java +++ b/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java @@ -25,7 +25,7 @@ public final class DawnglowInfusion extends CardImpl { // You gain X life if {G} was spent to cast Dawnglow Infusion and X life if {W} was spent to cast it. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new GainLifeEffect(xValue), new ManaWasSpentCondition(ColoredManaSymbol.G), "You gain X life if {G} was spent to cast {this}")); diff --git a/Mage.Sets/src/mage/cards/d/DeathCloud.java b/Mage.Sets/src/mage/cards/d/DeathCloud.java index c239907ad6..1ce4f41120 100644 --- a/Mage.Sets/src/mage/cards/d/DeathCloud.java +++ b/Mage.Sets/src/mage/cards/d/DeathCloud.java @@ -25,7 +25,7 @@ public final class DeathCloud extends CardImpl { // Each player loses X life, discards X cards, sacrifices X creatures, then sacrifices X lands. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new LoseLifeAllPlayersEffect(xValue)); Effect effect = new DiscardEachPlayerEffect(xValue, false); effect.setText(", discards X cards"); diff --git a/Mage.Sets/src/mage/cards/d/DeathGrasp.java b/Mage.Sets/src/mage/cards/d/DeathGrasp.java index e0e3426b6e..114635e43c 100644 --- a/Mage.Sets/src/mage/cards/d/DeathGrasp.java +++ b/Mage.Sets/src/mage/cards/d/DeathGrasp.java @@ -21,8 +21,8 @@ public final class DeathGrasp extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{W}{B}"); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); - this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); + this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/d/DeathMutation.java b/Mage.Sets/src/mage/cards/d/DeathMutation.java index d24bec85c2..879b21f6d8 100644 --- a/Mage.Sets/src/mage/cards/d/DeathMutation.java +++ b/Mage.Sets/src/mage/cards/d/DeathMutation.java @@ -35,7 +35,7 @@ public final class DeathMutation extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); this.getSpellAbility().addTarget(new TargetPermanent(filter)); // create X 1/1 green Saproling creature tokens, where X is that creature's converted mana cost. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new TargetConvertedManaCost())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), TargetConvertedManaCost.instance)); } public DeathMutation(final DeathMutation card) { diff --git a/Mage.Sets/src/mage/cards/d/DeathWind.java b/Mage.Sets/src/mage/cards/d/DeathWind.java index 69fbaadadf..663ba2f604 100644 --- a/Mage.Sets/src/mage/cards/d/DeathWind.java +++ b/Mage.Sets/src/mage/cards/d/DeathWind.java @@ -22,7 +22,7 @@ public final class DeathWind extends CardImpl { // Target creature gets -X/-X until end of turn. - DynamicValue x = new SignInversionDynamicValue(new ManacostVariableValue()); + DynamicValue x = new SignInversionDynamicValue(ManacostVariableValue.instance); this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java b/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java index a9c707fd5a..7ebbe2c241 100644 --- a/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java +++ b/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java @@ -69,7 +69,7 @@ class DeathforgeShamanEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - DynamicValue value = new MultikickerCount(); + DynamicValue value = MultikickerCount.instance; int damage = value.calculate(game, source, this) * 2; return new DamageTargetEffect(damage).apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/d/DeathsShadow.java b/Mage.Sets/src/mage/cards/d/DeathsShadow.java index 2591c2d11f..5fa0ee15d9 100644 --- a/Mage.Sets/src/mage/cards/d/DeathsShadow.java +++ b/Mage.Sets/src/mage/cards/d/DeathsShadow.java @@ -28,7 +28,7 @@ public final class DeathsShadow extends CardImpl { this.toughness = new MageInt(13); // Death's Shadow gets -X/-X, where X is your life total. - SignInversionDynamicValue x = new SignInversionDynamicValue(new ControllerLifeCount(), false); + SignInversionDynamicValue x = new SignInversionDynamicValue(ControllerLifeCount.instance, false); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfJustice.java b/Mage.Sets/src/mage/cards/d/DecreeOfJustice.java index 27aa099dcd..2da79ce805 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfJustice.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfJustice.java @@ -32,7 +32,7 @@ public final class DecreeOfJustice extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{2}{W}{W}"); // Create X 4/4 white Angel creature tokens with flying. - this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), ManacostVariableValue.instance)); // Cycling {2}{W} this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}"))); diff --git a/Mage.Sets/src/mage/cards/d/Demonfire.java b/Mage.Sets/src/mage/cards/d/Demonfire.java index 71711b70c1..b8dfbc7148 100644 --- a/Mage.Sets/src/mage/cards/d/Demonfire.java +++ b/Mage.Sets/src/mage/cards/d/Demonfire.java @@ -31,7 +31,7 @@ public final class Demonfire extends CardImpl { // Demonfire deals X damage to any target. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DamageTargetEffect(new ManacostVariableValue()), + new DamageTargetEffect(ManacostVariableValue.instance), new InvertCondition(HellbentCondition.instance), "{this} deals X damage to any target")); @@ -41,7 +41,7 @@ public final class Demonfire extends CardImpl { // Hellbent - If you have no cards in hand, Demonfire can't be countered and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DamageTargetEffect(new ManacostVariableValue(), false), + new DamageTargetEffect(ManacostVariableValue.instance, false), HellbentCondition.instance, "
Hellbent — If you have no cards in hand, this spell can't be countered and the damage can't be prevented.")); // can't be countered diff --git a/Mage.Sets/src/mage/cards/d/DescendantOfSoramaro.java b/Mage.Sets/src/mage/cards/d/DescendantOfSoramaro.java index aad9696a80..ce8cde5bd0 100644 --- a/Mage.Sets/src/mage/cards/d/DescendantOfSoramaro.java +++ b/Mage.Sets/src/mage/cards/d/DescendantOfSoramaro.java @@ -28,7 +28,7 @@ public final class DescendantOfSoramaro extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(3); // {1}{U}: Look at the top X cards of your library, where X is the number of cards in your hand, then put them back in any order. - Effect effect = new LookLibraryControllerEffect(new CardsInControllerHandCount()); + Effect effect = new LookLibraryControllerEffect(CardsInControllerHandCount.instance); effect.setText("Look at the top X cards of your library, where X is the number of cards in your hand, then put them back in any order"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{U}"))); diff --git a/Mage.Sets/src/mage/cards/d/Detonate.java b/Mage.Sets/src/mage/cards/d/Detonate.java index de1a4096ed..782f5af864 100644 --- a/Mage.Sets/src/mage/cards/d/Detonate.java +++ b/Mage.Sets/src/mage/cards/d/Detonate.java @@ -29,7 +29,7 @@ public final class Detonate extends CardImpl { // Destroy target artifact with converted mana cost X. It can't be regenerated. Detonate deals X damage to that artifact's controller. this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); this.getSpellAbility().addTarget(new TargetArtifactPermanent(new FilterArtifactPermanent("artifact with converted mana cost X"))); - Effect effect = new DamageTargetControllerEffect(new ManacostVariableValue()); + Effect effect = new DamageTargetControllerEffect(ManacostVariableValue.instance); effect.setText("{this} deals X damage to that artifact's controller"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().setTargetAdjuster(DetonateAdjuster.instance); diff --git a/Mage.Sets/src/mage/cards/d/DevastatingDreams.java b/Mage.Sets/src/mage/cards/d/DevastatingDreams.java index cebed2d85a..ee0d2b5b27 100644 --- a/Mage.Sets/src/mage/cards/d/DevastatingDreams.java +++ b/Mage.Sets/src/mage/cards/d/DevastatingDreams.java @@ -32,10 +32,10 @@ public final class DevastatingDreams extends CardImpl { this.getSpellAbility().addCost(new DevastatingDreamsAdditionalCost()); // Each player sacrifices X lands. - this.getSpellAbility().addEffect(new SacrificeAllEffect(new GetXValue(), new FilterControlledLandPermanent("lands"))); + this.getSpellAbility().addEffect(new SacrificeAllEffect(GetXValue.instance, new FilterControlledLandPermanent("lands"))); // Devastating Dreams deals X damage to each creature. - this.getSpellAbility().addEffect(new DamageAllEffect(new GetXValue(), new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DamageAllEffect(GetXValue.instance, new FilterCreaturePermanent())); } public DevastatingDreams(final DevastatingDreams card) { diff --git a/Mage.Sets/src/mage/cards/d/DevastatingSummons.java b/Mage.Sets/src/mage/cards/d/DevastatingSummons.java index e15ae2af9f..c5521add77 100644 --- a/Mage.Sets/src/mage/cards/d/DevastatingSummons.java +++ b/Mage.Sets/src/mage/cards/d/DevastatingSummons.java @@ -55,8 +55,8 @@ class DevastatingSummonsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { DevastatingSummonsElementalToken token = new DevastatingSummonsElementalToken(); - token.getPower().modifyBaseValue(new GetXValue().calculate(game, source, this)); - token.getToughness().modifyBaseValue(new GetXValue().calculate(game, source, this)); + token.getPower().modifyBaseValue(GetXValue.instance.calculate(game, source, this)); + token.getToughness().modifyBaseValue(GetXValue.instance.calculate(game, source, this)); token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/d/DevilsPlay.java b/Mage.Sets/src/mage/cards/d/DevilsPlay.java index 111f906c86..fad1267f4c 100644 --- a/Mage.Sets/src/mage/cards/d/DevilsPlay.java +++ b/Mage.Sets/src/mage/cards/d/DevilsPlay.java @@ -23,7 +23,7 @@ public final class DevilsPlay extends CardImpl { // Devil's Play deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {X}{R}{R}{R} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{R}{R}{R}"), TimingRule.SORCERY)); diff --git a/Mage.Sets/src/mage/cards/d/DiabolicRevelation.java b/Mage.Sets/src/mage/cards/d/DiabolicRevelation.java index cd93dc22aa..bdac351e7b 100644 --- a/Mage.Sets/src/mage/cards/d/DiabolicRevelation.java +++ b/Mage.Sets/src/mage/cards/d/DiabolicRevelation.java @@ -58,7 +58,7 @@ class DiabolicRevelationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = new ManacostVariableValue().calculate(game, source, this); + int amount = ManacostVariableValue.instance.calculate(game, source, this); TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard()); Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/d/DiamondValley.java b/Mage.Sets/src/mage/cards/d/DiamondValley.java index a1a75bb948..530bbee905 100644 --- a/Mage.Sets/src/mage/cards/d/DiamondValley.java +++ b/Mage.Sets/src/mage/cards/d/DiamondValley.java @@ -25,7 +25,7 @@ public final class DiamondValley extends CardImpl { public DiamondValley(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); - Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); + Effect effect = new GainLifeEffect(SacrificeCostCreaturesToughness.instance); effect.setText("You gain life equal to the sacrificed creature's toughness"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); diff --git a/Mage.Sets/src/mage/cards/d/Disintegrate.java b/Mage.Sets/src/mage/cards/d/Disintegrate.java index bcd6813763..8b0f12edb5 100644 --- a/Mage.Sets/src/mage/cards/d/Disintegrate.java +++ b/Mage.Sets/src/mage/cards/d/Disintegrate.java @@ -23,7 +23,7 @@ public final class Disintegrate extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}"); // Disintegrate deals X damage to any target. That creature can't be regenerated this turn. If the creature would die this turn, exile it instead. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addEffect(new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature")); Effect effect = new ExileTargetIfDiesEffect(); effect.setText("If the creature would die this turn, exile it instead"); diff --git a/Mage.Sets/src/mage/cards/d/DivineOffering.java b/Mage.Sets/src/mage/cards/d/DivineOffering.java index 8682ffefdd..02ddd7a87e 100644 --- a/Mage.Sets/src/mage/cards/d/DivineOffering.java +++ b/Mage.Sets/src/mage/cards/d/DivineOffering.java @@ -23,7 +23,7 @@ public final class DivineOffering extends CardImpl { // Destroy target artifact. You gain life equal to its converted mana cost. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - Effect effect = new GainLifeEffect(new TargetConvertedManaCost()); + Effect effect = new GainLifeEffect(TargetConvertedManaCost.instance); effect.setText("You gain life equal to its converted mana cost"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/cards/d/DranaKalastriaBloodchief.java b/Mage.Sets/src/mage/cards/d/DranaKalastriaBloodchief.java index 025eb35774..404fafb5f7 100644 --- a/Mage.Sets/src/mage/cards/d/DranaKalastriaBloodchief.java +++ b/Mage.Sets/src/mage/cards/d/DranaKalastriaBloodchief.java @@ -37,8 +37,8 @@ public final class DranaKalastriaBloodchief extends CardImpl { this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new StaticValue(0), new SignInversionDynamicValue(new ManacostVariableValue()), Duration.EndOfTurn), new ManaCostsImpl("{X}{B}{B}")); - ability.addEffect(new BoostSourceEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new StaticValue(0), new SignInversionDynamicValue(ManacostVariableValue.instance), Duration.EndOfTurn), new ManaCostsImpl("{X}{B}{B}")); + ability.addEffect(new BoostSourceEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DreadSlag.java b/Mage.Sets/src/mage/cards/d/DreadSlag.java index dd7548175b..bebbcd720d 100644 --- a/Mage.Sets/src/mage/cards/d/DreadSlag.java +++ b/Mage.Sets/src/mage/cards/d/DreadSlag.java @@ -32,7 +32,7 @@ public final class DreadSlag extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Dread Slag gets -4/-4 for each card in your hand. - DynamicValue amount = new MultipliedValue(new CardsInControllerHandCount(), -4); + DynamicValue amount = new MultipliedValue(CardsInControllerHandCount.instance, -4); Effect effect = new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield); effect.setText("{this} gets -4/-4 for each card in your hand"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/d/DreadshipReef.java b/Mage.Sets/src/mage/cards/d/DreadshipReef.java index 7073e04f11..53a75729b9 100644 --- a/Mage.Sets/src/mage/cards/d/DreadshipReef.java +++ b/Mage.Sets/src/mage/cards/d/DreadshipReef.java @@ -36,7 +36,7 @@ public final class DreadshipReef extends CardImpl { this.addAbility(ability); // {1}, Remove X storage counters from Dreadship Reef: Add X mana in any combination of {U} and/or {B}. ability = new SimpleManaAbility(Zone.BATTLEFIELD, - new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.U, ColoredManaSymbol.B), + new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.U, ColoredManaSymbol.B), new GenericManaCost(1)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DreambornMuse.java b/Mage.Sets/src/mage/cards/d/DreambornMuse.java index 66cc27162b..169107a55c 100644 --- a/Mage.Sets/src/mage/cards/d/DreambornMuse.java +++ b/Mage.Sets/src/mage/cards/d/DreambornMuse.java @@ -25,7 +25,7 @@ public final class DreambornMuse extends CardImpl { this.toughness = new MageInt(2); // At the beginning of each player's upkeep, that player puts the top X cards of their library into their graveyard, where X is the number of cards in their hand. - PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount()); + PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(CardsInTargetPlayerHandCount.instance); effect.setText("that player puts the top X cards of their library into their graveyard, where X is the number of cards in their hand."); this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false)); diff --git a/Mage.Sets/src/mage/cards/d/DregsOfSorrow.java b/Mage.Sets/src/mage/cards/d/DregsOfSorrow.java index 082731e051..06412ef6bf 100644 --- a/Mage.Sets/src/mage/cards/d/DregsOfSorrow.java +++ b/Mage.Sets/src/mage/cards/d/DregsOfSorrow.java @@ -28,7 +28,7 @@ public final class DregsOfSorrow extends CardImpl { // Destroy X target nonblack creatures. Draw X cards. this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target nonblack creatures")); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.instance)); this.getSpellAbility().setTargetAdjuster(DregsOfSorrowAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/d/DrippingTongueZubera.java b/Mage.Sets/src/mage/cards/d/DrippingTongueZubera.java index a5d6b4d3f3..ed36a32932 100644 --- a/Mage.Sets/src/mage/cards/d/DrippingTongueZubera.java +++ b/Mage.Sets/src/mage/cards/d/DrippingTongueZubera.java @@ -27,7 +27,7 @@ public final class DrippingTongueZubera extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false), new ZuberasDiedWatcher()); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), ZuberasDiedDynamicValue.instance), false), new ZuberasDiedWatcher()); } public DrippingTongueZubera (final DrippingTongueZubera card) { diff --git a/Mage.Sets/src/mage/cards/d/DwarvenHold.java b/Mage.Sets/src/mage/cards/d/DwarvenHold.java index bfc1a8c95c..5c8e97d9e2 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenHold.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenHold.java @@ -44,7 +44,7 @@ public final class DwarvenHold extends CardImpl { // {tap}, Remove any number of storage counters from Dwarven Hold: Add {R} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.RedMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {R} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/e/Earthquake.java b/Mage.Sets/src/mage/cards/e/Earthquake.java index d653f3182d..da844b150d 100644 --- a/Mage.Sets/src/mage/cards/e/Earthquake.java +++ b/Mage.Sets/src/mage/cards/e/Earthquake.java @@ -29,7 +29,7 @@ public final class Earthquake extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}"); // Hurricane deals X damage to each creature with flying and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageEverythingEffect(ManacostVariableValue.instance, filter)); } public Earthquake(final Earthquake card) { diff --git a/Mage.Sets/src/mage/cards/e/Electrodominance.java b/Mage.Sets/src/mage/cards/e/Electrodominance.java index 2d87841a40..4b9342fcaa 100644 --- a/Mage.Sets/src/mage/cards/e/Electrodominance.java +++ b/Mage.Sets/src/mage/cards/e/Electrodominance.java @@ -19,9 +19,9 @@ public final class Electrodominance extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}{R}"); // Electrodominance deals X damage to any target. You may cast a card with converted mana cost X or less from your hand without paying its mana cost. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); - this.getSpellAbility().addEffect(new CastWithoutPayingManaCostEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CastWithoutPayingManaCostEffect(ManacostVariableValue.instance)); } private Electrodominance(final Electrodominance card) { diff --git a/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java b/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java index 03ad3ea31b..34910dc22e 100644 --- a/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java +++ b/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java @@ -50,7 +50,7 @@ enum EliminateTheCompetitionAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); - int sac = new GetXValue().calculate(game, ability, null); + int sac = GetXValue.instance.calculate(game, ability, null); ability.addTarget(new TargetCreaturePermanent(sac, sac)); } } diff --git a/Mage.Sets/src/mage/cards/e/EmberFistZubera.java b/Mage.Sets/src/mage/cards/e/EmberFistZubera.java index 0a79c71c41..acfe8a486c 100644 --- a/Mage.Sets/src/mage/cards/e/EmberFistZubera.java +++ b/Mage.Sets/src/mage/cards/e/EmberFistZubera.java @@ -28,7 +28,7 @@ public final class EmberFistZubera extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(new ZuberasDiedDynamicValue())); + Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(ZuberasDiedDynamicValue.instance)); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability, new ZuberasDiedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/e/EmptyThePits.java b/Mage.Sets/src/mage/cards/e/EmptyThePits.java index f2bfbd27fb..fb2337fd5e 100644 --- a/Mage.Sets/src/mage/cards/e/EmptyThePits.java +++ b/Mage.Sets/src/mage/cards/e/EmptyThePits.java @@ -24,7 +24,7 @@ public final class EmptyThePits extends CardImpl { this.addAbility(new DelveAbility()); // create X 2/2 black Zombie creature tokens tapped. - this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), new ManacostVariableValue(), true, false)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), ManacostVariableValue.instance, true, false)); } public EmptyThePits(final EmptyThePits card) { diff --git a/Mage.Sets/src/mage/cards/e/EmpyrialArmor.java b/Mage.Sets/src/mage/cards/e/EmpyrialArmor.java index 9ae1b61d02..de4b1ffa23 100644 --- a/Mage.Sets/src/mage/cards/e/EmpyrialArmor.java +++ b/Mage.Sets/src/mage/cards/e/EmpyrialArmor.java @@ -38,7 +38,7 @@ public final class EmpyrialArmor extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 for each card in your hand. - DynamicValue xValue = new CardsInControllerHandCount(); + DynamicValue xValue = CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(xValue, xValue, Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/cards/e/EmpyrialPlate.java b/Mage.Sets/src/mage/cards/e/EmpyrialPlate.java index d43fe32b16..4116555856 100644 --- a/Mage.Sets/src/mage/cards/e/EmpyrialPlate.java +++ b/Mage.Sets/src/mage/cards/e/EmpyrialPlate.java @@ -25,7 +25,7 @@ public final class EmpyrialPlate extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +1/+1 for each card in your hand. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(new CardsInControllerHandCount(), new CardsInControllerHandCount()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(CardsInControllerHandCount.instance, CardsInControllerHandCount.instance))); // Equip {2} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); diff --git a/Mage.Sets/src/mage/cards/e/EnclaveElite.java b/Mage.Sets/src/mage/cards/e/EnclaveElite.java index 58f5df9c83..de61d1239d 100644 --- a/Mage.Sets/src/mage/cards/e/EnclaveElite.java +++ b/Mage.Sets/src/mage/cards/e/EnclaveElite.java @@ -36,7 +36,7 @@ public final class EnclaveElite extends CardImpl { // Enclave Elite enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true), "with a +1/+1 counter on it for each time it was kicked")); } diff --git a/Mage.Sets/src/mage/cards/e/EndlessSwarm.java b/Mage.Sets/src/mage/cards/e/EndlessSwarm.java index f3eac93fad..a33c408463 100644 --- a/Mage.Sets/src/mage/cards/e/EndlessSwarm.java +++ b/Mage.Sets/src/mage/cards/e/EndlessSwarm.java @@ -22,7 +22,7 @@ public final class EndlessSwarm extends CardImpl { // Create a 1/1 green Snake creature token for each card in your hand. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken(), new CardsInControllerHandCount())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken(), CardsInControllerHandCount.instance)); // Epic this.getSpellAbility().addEffect(new EpicEffect()); diff --git a/Mage.Sets/src/mage/cards/e/EnergyBolt.java b/Mage.Sets/src/mage/cards/e/EnergyBolt.java index ef5fe784bb..216c983a53 100644 --- a/Mage.Sets/src/mage/cards/e/EnergyBolt.java +++ b/Mage.Sets/src/mage/cards/e/EnergyBolt.java @@ -22,10 +22,10 @@ public final class EnergyBolt extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{W}"); // Choose one - Energy Bolt deals X damage to target player; or target player gains X life. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); Mode mode = new Mode(); - mode.addEffect(new GainLifeTargetEffect(new ManacostVariableValue())); + mode.addEffect(new GainLifeTargetEffect(ManacostVariableValue.instance)); mode.addTarget(new TargetPlayer()); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/e/Enrage.java b/Mage.Sets/src/mage/cards/e/Enrage.java index 83c2876c0c..9d83d33659 100644 --- a/Mage.Sets/src/mage/cards/e/Enrage.java +++ b/Mage.Sets/src/mage/cards/e/Enrage.java @@ -22,7 +22,7 @@ public final class Enrage extends CardImpl { // Target creature gets +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java b/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java index 224dcc1d44..9dbaf7728b 100644 --- a/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java +++ b/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java @@ -20,7 +20,7 @@ public final class EnshrinedMemories extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}"); // Reveal the top X cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(new ManacostVariableValue(), new FilterCreatureCard(), Zone.LIBRARY, true)); + this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(ManacostVariableValue.instance, new FilterCreatureCard(), Zone.LIBRARY, true)); } public EnshrinedMemories(final EnshrinedMemories card) { diff --git a/Mage.Sets/src/mage/cards/e/EntreatTheAngels.java b/Mage.Sets/src/mage/cards/e/EntreatTheAngels.java index e398ee5b5b..234618f351 100644 --- a/Mage.Sets/src/mage/cards/e/EntreatTheAngels.java +++ b/Mage.Sets/src/mage/cards/e/EntreatTheAngels.java @@ -22,7 +22,7 @@ public final class EntreatTheAngels extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{W}{W}{W}"); // Create X 4/4 white Angel creature tokens with flying. - this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), ManacostVariableValue.instance)); // Miracle {X}{W}{W} this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{W}{W}"))); diff --git a/Mage.Sets/src/mage/cards/e/EntropicSpecter.java b/Mage.Sets/src/mage/cards/e/EntropicSpecter.java index 1102b8e1ba..0a85100eca 100644 --- a/Mage.Sets/src/mage/cards/e/EntropicSpecter.java +++ b/Mage.Sets/src/mage/cards/e/EntropicSpecter.java @@ -42,7 +42,7 @@ public final class EntropicSpecter extends CardImpl { // Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. this.addAbility(new SimpleStaticAbility(Zone.ALL, // back to the graveyard or if the choosen player left the gane it's again a 0/0 - new SetPowerToughnessSourceEffect(new CardsInTargetPlayerHandCount(), Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a))); + new SetPowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a))); // Whenever Entropic Specter deals damage to a player, that player discards a card. this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true)); diff --git a/Mage.Sets/src/mage/cards/e/EverflowingChalice.java b/Mage.Sets/src/mage/cards/e/EverflowingChalice.java index 98755ba197..256f062d98 100644 --- a/Mage.Sets/src/mage/cards/e/EverflowingChalice.java +++ b/Mage.Sets/src/mage/cards/e/EverflowingChalice.java @@ -33,7 +33,7 @@ public final class EverflowingChalice extends CardImpl { // Everflowing Chalice enters the battlefield with a charge counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.CHARGE.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.CHARGE.createInstance(0), MultikickerCount.instance, true), "with a charge counter on it for each time it was kicked")); // {T}: Add {C} for each charge counter on Everflowing Chalice. diff --git a/Mage.Sets/src/mage/cards/e/Excise.java b/Mage.Sets/src/mage/cards/e/Excise.java index a390e62e30..a232c41085 100644 --- a/Mage.Sets/src/mage/cards/e/Excise.java +++ b/Mage.Sets/src/mage/cards/e/Excise.java @@ -28,7 +28,7 @@ public final class Excise extends CardImpl { // Excise target nonwhite attacking creature unless its controller pays {X}. this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DoUnlessTargetPlayerOrTargetsControllerPaysEffect(new ExileTargetEffect(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DoUnlessTargetPlayerOrTargetsControllerPaysEffect(new ExileTargetEffect(), ManacostVariableValue.instance)); } public Excise(final Excise card) { diff --git a/Mage.Sets/src/mage/cards/f/FallOfTheTitans.java b/Mage.Sets/src/mage/cards/f/FallOfTheTitans.java index 71a44fc473..1b45b0e00f 100644 --- a/Mage.Sets/src/mage/cards/f/FallOfTheTitans.java +++ b/Mage.Sets/src/mage/cards/f/FallOfTheTitans.java @@ -21,7 +21,7 @@ public final class FallOfTheTitans extends CardImpl { // Fall of the Titans deals X damage to each of up to two target creatures and/or players. this.getSpellAbility().addTarget(new TargetAnyTarget(0, 2)); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); // Surge {X}{R} addAbility(new SurgeAbility(this, "{X}{R}")); diff --git a/Mage.Sets/src/mage/cards/f/FanningTheFlames.java b/Mage.Sets/src/mage/cards/f/FanningTheFlames.java index 4fe03dc2da..e7d224f7e5 100644 --- a/Mage.Sets/src/mage/cards/f/FanningTheFlames.java +++ b/Mage.Sets/src/mage/cards/f/FanningTheFlames.java @@ -23,7 +23,7 @@ public final class FanningTheFlames extends CardImpl { this.addAbility(new BuybackAbility("{3}")); // Fanning the Flames deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/f/Fascination.java b/Mage.Sets/src/mage/cards/f/Fascination.java index d53a921984..e3aa3f389d 100644 --- a/Mage.Sets/src/mage/cards/f/Fascination.java +++ b/Mage.Sets/src/mage/cards/f/Fascination.java @@ -22,11 +22,11 @@ public final class Fascination extends CardImpl { // Choose one - // * Each player draws X cards. - this.getSpellAbility().addEffect(new DrawCardAllEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardAllEffect(ManacostVariableValue.instance)); // * Each player puts the top X cards of their library into their graveyard. Mode mode = new Mode(); - mode.addEffect(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(new ManacostVariableValue(), TargetController.ANY)); + mode.addEffect(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(ManacostVariableValue.instance, TargetController.ANY)); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/f/FatalFrenzy.java b/Mage.Sets/src/mage/cards/f/FatalFrenzy.java index a3e9ebd5d3..6b07415820 100644 --- a/Mage.Sets/src/mage/cards/f/FatalFrenzy.java +++ b/Mage.Sets/src/mage/cards/f/FatalFrenzy.java @@ -35,7 +35,7 @@ public final class FatalFrenzy extends CardImpl { this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn) .setText("Until end of turn, target creature you control gains trample") ); - this.getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true) + this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, new StaticValue(0), Duration.EndOfTurn, true) .setText("and gets +X/+0, where X is its power.") ); this.getSpellAbility().addEffect(new FatalFrenzyEffect()); diff --git a/Mage.Sets/src/mage/cards/f/FatefulShowdown.java b/Mage.Sets/src/mage/cards/f/FatefulShowdown.java index 02b4db6762..11f60f0501 100644 --- a/Mage.Sets/src/mage/cards/f/FatefulShowdown.java +++ b/Mage.Sets/src/mage/cards/f/FatefulShowdown.java @@ -21,7 +21,7 @@ public final class FatefulShowdown extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}{R}"); // Fateful Showdown deals damage to any target equal to the number of cards in your hand. Discard all the cards in your hand, then draw that many cards. - Effect effect = new DamageTargetEffect(new CardsInControllerHandCount()); + Effect effect = new DamageTargetEffect(CardsInControllerHandCount.instance); effect.setText("{this} deals damage to any target equal to the number of cards in your hand"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/f/FestivalOfTheGuildpact.java b/Mage.Sets/src/mage/cards/f/FestivalOfTheGuildpact.java index 414368c1ab..be5027f518 100644 --- a/Mage.Sets/src/mage/cards/f/FestivalOfTheGuildpact.java +++ b/Mage.Sets/src/mage/cards/f/FestivalOfTheGuildpact.java @@ -20,7 +20,7 @@ public final class FestivalOfTheGuildpact extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}"); // Prevent the next X damage that would be dealt to you this turn. - this.getSpellAbility().addEffect(new PreventDamageToControllerEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue())); + this.getSpellAbility().addEffect(new PreventDamageToControllerEffect(Duration.EndOfTurn, false, true, ManacostVariableValue.instance)); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); diff --git a/Mage.Sets/src/mage/cards/f/FinalStrike.java b/Mage.Sets/src/mage/cards/f/FinalStrike.java index 4cd4c7f167..6881b64020 100644 --- a/Mage.Sets/src/mage/cards/f/FinalStrike.java +++ b/Mage.Sets/src/mage/cards/f/FinalStrike.java @@ -26,7 +26,7 @@ public final class FinalStrike extends CardImpl { this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Final Strike deals damage to target opponent equal to the sacrificed creature's power. - Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); + Effect effect = new DamageTargetEffect(SacrificeCostCreaturesPower.instance); effect.setText("{this} deals damage to target opponent or planeswalker equal to the sacrificed creature's power"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetOpponentOrPlaneswalker()); diff --git a/Mage.Sets/src/mage/cards/f/FireCovenant.java b/Mage.Sets/src/mage/cards/f/FireCovenant.java index ae9870a467..80f8f72909 100644 --- a/Mage.Sets/src/mage/cards/f/FireCovenant.java +++ b/Mage.Sets/src/mage/cards/f/FireCovenant.java @@ -25,7 +25,7 @@ public final class FireCovenant extends CardImpl { this.getSpellAbility().addCost(new PayVariableLifeCost(true)); // Fire Covenant deals X damage divided as you choose among any number of target creatures. - DynamicValue xValue = new GetXValue(); + DynamicValue xValue = GetXValue.instance; this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue)); } diff --git a/Mage.Sets/src/mage/cards/f/Firestorm.java b/Mage.Sets/src/mage/cards/f/Firestorm.java index ba503d3790..b489ee21b6 100644 --- a/Mage.Sets/src/mage/cards/f/Firestorm.java +++ b/Mage.Sets/src/mage/cards/f/Firestorm.java @@ -48,7 +48,7 @@ enum FirestormAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { - int xValue = new GetXValue().calculate(game, ability, null); + int xValue = GetXValue.instance.calculate(game, ability, null); if (xValue > 0) { Target target = new TargetAnyTarget(xValue); ability.addTarget(target); @@ -70,7 +70,7 @@ class FirestormEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); - int amount = (new GetXValue()).calculate(game, source, this); + int amount = (GetXValue.instance).calculate(game, source, this); if (you != null) { if (!source.getTargets().isEmpty()) { for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { diff --git a/Mage.Sets/src/mage/cards/f/Fling.java b/Mage.Sets/src/mage/cards/f/Fling.java index 422ec3263e..67de60eca9 100644 --- a/Mage.Sets/src/mage/cards/f/Fling.java +++ b/Mage.Sets/src/mage/cards/f/Fling.java @@ -22,7 +22,7 @@ public final class Fling extends CardImpl { public Fling(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); - Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); + Effect effect = new DamageTargetEffect(SacrificeCostCreaturesPower.instance); effect.setText("{this} deals damage equal to the sacrificed creature's power to any target"); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/f/FloatingDreamZubera.java b/Mage.Sets/src/mage/cards/f/FloatingDreamZubera.java index a5aa32a32a..f2e77e0b50 100644 --- a/Mage.Sets/src/mage/cards/f/FloatingDreamZubera.java +++ b/Mage.Sets/src/mage/cards/f/FloatingDreamZubera.java @@ -25,7 +25,7 @@ public final class FloatingDreamZubera extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new ZuberasDiedDynamicValue())), new ZuberasDiedWatcher()); + this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(ZuberasDiedDynamicValue.instance)), new ZuberasDiedWatcher()); } public FloatingDreamZubera(final FloatingDreamZubera card) { diff --git a/Mage.Sets/src/mage/cards/f/FlowstoneSlide.java b/Mage.Sets/src/mage/cards/f/FlowstoneSlide.java index 479d9f124b..fe68ae63e8 100644 --- a/Mage.Sets/src/mage/cards/f/FlowstoneSlide.java +++ b/Mage.Sets/src/mage/cards/f/FlowstoneSlide.java @@ -20,8 +20,8 @@ public final class FlowstoneSlide extends CardImpl { public FlowstoneSlide(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{2}{R}{R}"); - DynamicValue xPos = new ManacostVariableValue(); - DynamicValue xNeg = new SignInversionDynamicValue(new ManacostVariableValue()); + DynamicValue xPos = ManacostVariableValue.instance; + DynamicValue xNeg = new SignInversionDynamicValue(ManacostVariableValue.instance); // All creatures get +X/-X until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(xPos, xNeg, Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/cards/f/ForceLightning.java b/Mage.Sets/src/mage/cards/f/ForceLightning.java index 64b07aa29d..46793dcd5d 100644 --- a/Mage.Sets/src/mage/cards/f/ForceLightning.java +++ b/Mage.Sets/src/mage/cards/f/ForceLightning.java @@ -24,7 +24,7 @@ public final class ForceLightning extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}"); // Force Lightning deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); // Scry X. diff --git a/Mage.Sets/src/mage/cards/f/FountainOfCho.java b/Mage.Sets/src/mage/cards/f/FountainOfCho.java index 566c64e58f..1686099ab5 100644 --- a/Mage.Sets/src/mage/cards/f/FountainOfCho.java +++ b/Mage.Sets/src/mage/cards/f/FountainOfCho.java @@ -34,7 +34,7 @@ public final class FountainOfCho extends CardImpl { // {T}, Remove any number of storage counters from Fountain of Cho: Add {W} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.WhiteMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {W} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/f/FreyaliseSupplicant.java b/Mage.Sets/src/mage/cards/f/FreyaliseSupplicant.java index 3343f039e4..92a0ce7e20 100644 --- a/Mage.Sets/src/mage/cards/f/FreyaliseSupplicant.java +++ b/Mage.Sets/src/mage/cards/f/FreyaliseSupplicant.java @@ -43,7 +43,7 @@ public final class FreyaliseSupplicant extends CardImpl { this.toughness = new MageInt(1); // {tap}, Sacrifice a red or white creature: Freyalise Supplicant deals damage to any target equal to half the sacrificed creature's power, rounded down. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new HalfValue(new SacrificeCostCreaturesPower(), false)), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new HalfValue(SacrificeCostCreaturesPower.instance, false)), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FungalReaches.java b/Mage.Sets/src/mage/cards/f/FungalReaches.java index 92598fdd61..69f0a3cbe6 100644 --- a/Mage.Sets/src/mage/cards/f/FungalReaches.java +++ b/Mage.Sets/src/mage/cards/f/FungalReaches.java @@ -38,7 +38,7 @@ public final class FungalReaches extends CardImpl { // {1}, Remove X storage counters from Fungal Reaches: Add X mana in any combination of {R} and/or {G}. ability = new SimpleManaAbility(Zone.BATTLEFIELD, - new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.R, ColoredManaSymbol.G), + new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.R, ColoredManaSymbol.G), new GenericManaCost(1)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FungalSprouting.java b/Mage.Sets/src/mage/cards/f/FungalSprouting.java index d363b9a9ed..6692362537 100644 --- a/Mage.Sets/src/mage/cards/f/FungalSprouting.java +++ b/Mage.Sets/src/mage/cards/f/FungalSprouting.java @@ -19,7 +19,7 @@ public final class FungalSprouting extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // create X 1/1 green Saproling creature tokens, where X is the greatest power among creatures you control. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new GreatestPowerAmongControlledCreaturesValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), GreatestPowerAmongControlledCreaturesValue.instance)); } public FungalSprouting(final FungalSprouting card) { diff --git a/Mage.Sets/src/mage/cards/g/GeralfsMasterpiece.java b/Mage.Sets/src/mage/cards/g/GeralfsMasterpiece.java index 629686108c..f5137eb43b 100644 --- a/Mage.Sets/src/mage/cards/g/GeralfsMasterpiece.java +++ b/Mage.Sets/src/mage/cards/g/GeralfsMasterpiece.java @@ -41,7 +41,7 @@ public final class GeralfsMasterpiece extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Geralf's Masterpiece gets -1/-1 for each card in your hand. - DynamicValue count = new SignInversionDynamicValue(new CardsInControllerHandCount()); + DynamicValue count = new SignInversionDynamicValue(CardsInControllerHandCount.instance); Effect effect = new BoostSourceEffect(count, count, Duration.WhileOnBattlefield); effect.setText("{this} gets -1/-1 for each card in your hand"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/g/GerrardsWisdom.java b/Mage.Sets/src/mage/cards/g/GerrardsWisdom.java index 23e378f90a..27694f04d2 100644 --- a/Mage.Sets/src/mage/cards/g/GerrardsWisdom.java +++ b/Mage.Sets/src/mage/cards/g/GerrardsWisdom.java @@ -20,7 +20,7 @@ public final class GerrardsWisdom extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{W}{W}"); // You gain 2 life for each card in your hand. - this.getSpellAbility().addEffect(new GainLifeEffect(new MultipliedValue(new CardsInControllerHandCount(), 2), + this.getSpellAbility().addEffect(new GainLifeEffect(new MultipliedValue(CardsInControllerHandCount.instance, 2), "You gain 2 life for each card in your hand")); } diff --git a/Mage.Sets/src/mage/cards/g/GhituFire.java b/Mage.Sets/src/mage/cards/g/GhituFire.java index 4da3bde52b..02c5fb90c3 100644 --- a/Mage.Sets/src/mage/cards/g/GhituFire.java +++ b/Mage.Sets/src/mage/cards/g/GhituFire.java @@ -23,7 +23,7 @@ public final class GhituFire extends CardImpl { public GhituFire(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}"); - Effect effect = new DamageTargetEffect(new ManacostVariableValue()); + Effect effect = new DamageTargetEffect(ManacostVariableValue.instance); // You may cast Ghitu Fire as though it had flash if you pay {2} more to cast it. Ability ability = new PayMoreToCastAsThoughtItHadFlashAbility(this, new ManaCostsImpl("{2}")); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/g/GhoulcallerGisa.java b/Mage.Sets/src/mage/cards/g/GhoulcallerGisa.java index 273ee19760..89b9458fc4 100644 --- a/Mage.Sets/src/mage/cards/g/GhoulcallerGisa.java +++ b/Mage.Sets/src/mage/cards/g/GhoulcallerGisa.java @@ -40,7 +40,7 @@ public final class GhoulcallerGisa extends CardImpl { this.toughness = new MageInt(4); // {B}, {tap}, Sacrifice another creature: create X 2/2 black Zombie creature tokens, where X is the sacrificed creature's power. - DynamicValue xValue = new SacrificeCostCreaturesPower(); + DynamicValue xValue = SacrificeCostCreaturesPower.instance; Token zombie = new ZombieToken(); zombie.setTokenType(2); Effect effect = new CreateTokenEffect(zombie, xValue); diff --git a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java index 2b0eab220b..df6f0f4eae 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java +++ b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java @@ -57,7 +57,7 @@ class GigantoplasmApplyToPermanent extends ApplyToPermanent { @Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { - DynamicValue variableMana = new ManacostVariableValue(); + DynamicValue variableMana = ManacostVariableValue.instance; Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); effect.setText("This creature has base power and toughness X/X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); @@ -67,7 +67,7 @@ class GigantoplasmApplyToPermanent extends ApplyToPermanent { @Override public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) { - DynamicValue variableMana = new ManacostVariableValue(); + DynamicValue variableMana = ManacostVariableValue.instance; Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); effect.setText("This creature has base power and toughness X/X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); diff --git a/Mage.Sets/src/mage/cards/g/GnarlidPack.java b/Mage.Sets/src/mage/cards/g/GnarlidPack.java index 24ce6b741a..63e7c60edb 100644 --- a/Mage.Sets/src/mage/cards/g/GnarlidPack.java +++ b/Mage.Sets/src/mage/cards/g/GnarlidPack.java @@ -31,7 +31,7 @@ public final class GnarlidPack extends CardImpl { // Gnarlid Pack enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true), "with a +1/+1 counter on it for each time it was kicked")); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinDynamo.java b/Mage.Sets/src/mage/cards/g/GoblinDynamo.java index 557ca2341d..207bfd0dfb 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinDynamo.java +++ b/Mage.Sets/src/mage/cards/g/GoblinDynamo.java @@ -35,7 +35,7 @@ public final class GoblinDynamo extends CardImpl { this.addAbility(ability); //{X}{R}, {T}, Sacrifice Goblin Dynamo: Goblin Dynamo deals X damage to any target. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GoblinGoliath.java b/Mage.Sets/src/mage/cards/g/GoblinGoliath.java index b8ac5dc92c..a6a7c02f60 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinGoliath.java +++ b/Mage.Sets/src/mage/cards/g/GoblinGoliath.java @@ -34,7 +34,7 @@ public final class GoblinGoliath extends CardImpl { this.toughness = new MageInt(4); // When Goblin Goliath enters the battlefield, create a number of 1/1 red Goblin creature tokens equal to the number of opponents you have. - Effect effect = new CreateTokenEffect(new GoblinToken(), new OpponentsCount()); + Effect effect = new CreateTokenEffect(new GoblinToken(), OpponentsCount.instance); effect.setText("create a number of 1/1 red Goblin creature tokens equal to the number of opponents you have"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); diff --git a/Mage.Sets/src/mage/cards/g/GoblinOffensive.java b/Mage.Sets/src/mage/cards/g/GoblinOffensive.java index 58cb3f35e5..326309a34a 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinOffensive.java +++ b/Mage.Sets/src/mage/cards/g/GoblinOffensive.java @@ -19,7 +19,7 @@ public final class GoblinOffensive extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{1}{R}{R}"); // create X 1/1 red Goblin creature tokens. - this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), ManacostVariableValue.instance)); } public GoblinOffensive(final GoblinOffensive card) { diff --git a/Mage.Sets/src/mage/cards/g/GreatDefender.java b/Mage.Sets/src/mage/cards/g/GreatDefender.java index 44d18590fe..369c3eafd6 100644 --- a/Mage.Sets/src/mage/cards/g/GreatDefender.java +++ b/Mage.Sets/src/mage/cards/g/GreatDefender.java @@ -22,7 +22,7 @@ public final class GreatDefender extends CardImpl { // Target creature gets +0/+X until end of turn, where X is its converted mana cost. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(new StaticValue(0), new TargetConvertedManaCost(), Duration.EndOfTurn, true) + this.getSpellAbility().addEffect(new BoostTargetEffect(new StaticValue(0), TargetConvertedManaCost.instance, Duration.EndOfTurn, true) .setText("Target creature gets +0/+X until end of turn, where X is its converted mana cost.") ); } diff --git a/Mage.Sets/src/mage/cards/g/GreaterGood.java b/Mage.Sets/src/mage/cards/g/GreaterGood.java index 7aa69e4d2b..7fc94447bc 100644 --- a/Mage.Sets/src/mage/cards/g/GreaterGood.java +++ b/Mage.Sets/src/mage/cards/g/GreaterGood.java @@ -26,7 +26,7 @@ public final class GreaterGood extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); // Sacrifice a creature: Draw cards equal to the sacrificed creature's power, then discard three cards. - Effect effect = new DrawCardSourceControllerEffect(new SacrificeCostCreaturesPower()); + Effect effect = new DrawCardSourceControllerEffect(SacrificeCostCreaturesPower.instance); effect.setText("Draw cards equal to the sacrificed creature's power"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); diff --git a/Mage.Sets/src/mage/cards/g/GreelMindRaker.java b/Mage.Sets/src/mage/cards/g/GreelMindRaker.java index f3543a1950..bc79a60e01 100644 --- a/Mage.Sets/src/mage/cards/g/GreelMindRaker.java +++ b/Mage.Sets/src/mage/cards/g/GreelMindRaker.java @@ -36,7 +36,7 @@ public final class GreelMindRaker extends CardImpl { this.toughness = new MageInt(3); // {X}{B}, {tap}, Discard two cards: Target player discards X cards at random. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(new ManacostVariableValue(), true), new ManaCostsImpl("{X}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(ManacostVariableValue.instance, true), new ManaCostsImpl("{X}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard()))); ability.addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/g/GreenManaBattery.java b/Mage.Sets/src/mage/cards/g/GreenManaBattery.java index d0bf8cdfc0..9669605db2 100644 --- a/Mage.Sets/src/mage/cards/g/GreenManaBattery.java +++ b/Mage.Sets/src/mage/cards/g/GreenManaBattery.java @@ -36,7 +36,7 @@ public final class GreenManaBattery extends CardImpl { // {tap}, Remove any number of charge counters from Green Mana Battery: Add {G}, then add an additional {G} for each charge counter removed this way. ability = new DynamicManaAbility( Mana.GreenMana(1), - new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance), new TapSourceCost(), "Add {G}, then add {G} for each charge counter removed this way", true, new CountersSourceCount(CounterType.CHARGE)); diff --git a/Mage.Sets/src/mage/cards/g/GrimStrider.java b/Mage.Sets/src/mage/cards/g/GrimStrider.java index 5202715167..816259aad6 100644 --- a/Mage.Sets/src/mage/cards/g/GrimStrider.java +++ b/Mage.Sets/src/mage/cards/g/GrimStrider.java @@ -29,7 +29,7 @@ public final class GrimStrider extends CardImpl { this.toughness = new MageInt(6); // Grim Strider gets -1/-1 for each card in your hand. - DynamicValue count = new SignInversionDynamicValue(new CardsInControllerHandCount()); + DynamicValue count = new SignInversionDynamicValue(CardsInControllerHandCount.instance); Effect effect = new BoostSourceEffect(count, count, Duration.WhileOnBattlefield); effect.setText("{this} gets -1/-1 for each card in your hand"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java b/Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java index b7224b4424..298ef39c25 100644 --- a/Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java +++ b/Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java @@ -57,7 +57,7 @@ public final class GyrusWakerOfCorpses extends CardImpl { this.toughness = new MageInt(0); // Gyrus, Walker of Corpses enters the battlefield with a number of +1/+1 counters on it equal to the amount of mana spent to cast it. - Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new ManaSpentToCastCount(), true); + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ManaSpentToCastCount.instance, true); effect.setText("with a number of +1/+1 counters on it equal to the amount of mana spent to cast it"); this.addAbility(new EntersBattlefieldAbility(effect)); diff --git a/Mage.Sets/src/mage/cards/h/HailOfArrows.java b/Mage.Sets/src/mage/cards/h/HailOfArrows.java index 6fadd26e16..90020cd2c2 100644 --- a/Mage.Sets/src/mage/cards/h/HailOfArrows.java +++ b/Mage.Sets/src/mage/cards/h/HailOfArrows.java @@ -20,8 +20,8 @@ public final class HailOfArrows extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}"); // Hail of Arrows deals X damage divided as you choose among any number of target attacking creatures. - this.getSpellAbility().addEffect(new DamageMultiEffect(new ManacostVariableValue())); - this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(new ManacostVariableValue(), new FilterAttackingCreature())); + this.getSpellAbility().addEffect(new DamageMultiEffect(ManacostVariableValue.instance)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(ManacostVariableValue.instance, new FilterAttackingCreature())); } public HailOfArrows(final HailOfArrows card) { diff --git a/Mage.Sets/src/mage/cards/h/HarvestPyre.java b/Mage.Sets/src/mage/cards/h/HarvestPyre.java index 859ec2c132..1c4f36caec 100644 --- a/Mage.Sets/src/mage/cards/h/HarvestPyre.java +++ b/Mage.Sets/src/mage/cards/h/HarvestPyre.java @@ -26,7 +26,7 @@ public final class HarvestPyre extends CardImpl { // Harvest Pyre deals X damage to target creature. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DamageTargetEffect(new GetXValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(GetXValue.instance)); } public HarvestPyre(final HarvestPyre card) { diff --git a/Mage.Sets/src/mage/cards/h/Hatred.java b/Mage.Sets/src/mage/cards/h/Hatred.java index fd01727fbd..1d096e1cb6 100644 --- a/Mage.Sets/src/mage/cards/h/Hatred.java +++ b/Mage.Sets/src/mage/cards/h/Hatred.java @@ -26,7 +26,7 @@ public final class Hatred extends CardImpl { this.getSpellAbility().addCost(new PayVariableLifeCost(true)); // Target creature gets +X/+0 until end of turn. - DynamicValue xValue = new GetXValue(); + DynamicValue xValue = GetXValue.instance; this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/h/HauntingMisery.java b/Mage.Sets/src/mage/cards/h/HauntingMisery.java index aa4f0f4de2..a6a2d25197 100644 --- a/Mage.Sets/src/mage/cards/h/HauntingMisery.java +++ b/Mage.Sets/src/mage/cards/h/HauntingMisery.java @@ -24,7 +24,7 @@ public final class HauntingMisery extends CardImpl { this.getSpellAbility().addCost(new ExileXFromYourGraveCost(new FilterCreatureCard())); // Haunting Misery deals X damage to target player. this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); - this.getSpellAbility().addEffect(new DamageTargetEffect(new GetXValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(GetXValue.instance)); } public HauntingMisery(final HauntingMisery card) { diff --git a/Mage.Sets/src/mage/cards/h/HeatRay.java b/Mage.Sets/src/mage/cards/h/HeatRay.java index d05f13cf84..571dcae460 100644 --- a/Mage.Sets/src/mage/cards/h/HeatRay.java +++ b/Mage.Sets/src/mage/cards/h/HeatRay.java @@ -19,7 +19,7 @@ public final class HeatRay extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{R}"); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/h/HeavenEarth.java b/Mage.Sets/src/mage/cards/h/HeavenEarth.java index d823619d35..51dad694db 100644 --- a/Mage.Sets/src/mage/cards/h/HeavenEarth.java +++ b/Mage.Sets/src/mage/cards/h/HeavenEarth.java @@ -33,13 +33,13 @@ public final class HeavenEarth extends SplitCard { // Falling // Falling deals X damage to each creature with flying. - getLeftHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterFlying)); + getLeftHalfCard().getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filterFlying)); // to // Earth // Earth deals X damage to each creature without flying. getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true)); - getRightHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterWithouFlying)); + getRightHalfCard().getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filterWithouFlying)); } public HeavenEarth(final HeavenEarth card) { diff --git a/Mage.Sets/src/mage/cards/h/HelixPinnacle.java b/Mage.Sets/src/mage/cards/h/HelixPinnacle.java index dc62fe1377..268d7f125b 100644 --- a/Mage.Sets/src/mage/cards/h/HelixPinnacle.java +++ b/Mage.Sets/src/mage/cards/h/HelixPinnacle.java @@ -34,7 +34,7 @@ public final class HelixPinnacle extends CardImpl { // {X}: Put X tower counters on Helix Pinnacle. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new AddCountersSourceEffect(CounterType.TOWER.createInstance(), new ManacostVariableValue(), true), + new AddCountersSourceEffect(CounterType.TOWER.createInstance(), ManacostVariableValue.instance, true), new ManaCostsImpl("{X}"))); // At the beginning of your upkeep, if there are 100 or more tower counters on Helix Pinnacle, you win the game. diff --git a/Mage.Sets/src/mage/cards/h/HelmOfObedience.java b/Mage.Sets/src/mage/cards/h/HelmOfObedience.java index 4221686f3a..bad8be2592 100644 --- a/Mage.Sets/src/mage/cards/h/HelmOfObedience.java +++ b/Mage.Sets/src/mage/cards/h/HelmOfObedience.java @@ -49,7 +49,7 @@ public final class HelmOfObedience extends CardImpl { class HelmOfObedienceEffect extends OneShotEffect { - private static final ManacostVariableValue amount = new ManacostVariableValue(); + private static final ManacostVariableValue amount = ManacostVariableValue.instance; public HelmOfObedienceEffect() { super(Outcome.Detriment); diff --git a/Mage.Sets/src/mage/cards/h/HollowTrees.java b/Mage.Sets/src/mage/cards/h/HollowTrees.java index 8213814aa0..9922ba6e36 100644 --- a/Mage.Sets/src/mage/cards/h/HollowTrees.java +++ b/Mage.Sets/src/mage/cards/h/HollowTrees.java @@ -44,7 +44,7 @@ public final class HollowTrees extends CardImpl { // {tap}, Remove any number of storage counters from Hollow Trees: Add {G} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.GreenMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {G} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/h/HowlFromBeyond.java b/Mage.Sets/src/mage/cards/h/HowlFromBeyond.java index b580479cfb..ec2c6e9dd4 100644 --- a/Mage.Sets/src/mage/cards/h/HowlFromBeyond.java +++ b/Mage.Sets/src/mage/cards/h/HowlFromBeyond.java @@ -23,7 +23,7 @@ public final class HowlFromBeyond extends CardImpl { // Target creature gets +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java b/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java index 2cc5bf6d79..2cf27ec200 100644 --- a/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java +++ b/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java @@ -45,7 +45,7 @@ public final class HuatliWarriorPoet extends CardImpl { this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: You gain life equal to the greatest power among creatures you control. - this.addAbility(new LoyaltyAbility(new GainLifeEffect(new GreatestPowerAmongControlledCreaturesValue(), "You gain life equal to the greatest power among creatures you control"), 2)); + this.addAbility(new LoyaltyAbility(new GainLifeEffect(GreatestPowerAmongControlledCreaturesValue.instance, "You gain life equal to the greatest power among creatures you control"), 2)); // 0: Create a 3/3 green Dinosaur creature token with trample. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new DinosaurToken()), 0)); diff --git a/Mage.Sets/src/mage/cards/h/HuntToExtinction.java b/Mage.Sets/src/mage/cards/h/HuntToExtinction.java index 33ba56f400..772bd5dce9 100644 --- a/Mage.Sets/src/mage/cards/h/HuntToExtinction.java +++ b/Mage.Sets/src/mage/cards/h/HuntToExtinction.java @@ -34,10 +34,10 @@ public final class HuntToExtinction extends CardImpl { this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent(0, 1)); // Hunt to Extinction deals X damage to each creature. - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, new FilterCreaturePermanent())); // Hunt to Exctinction deals an additional X damage to each creature with a bounty counter on it. - Effect effect = new DamageAllEffect(new ManacostVariableValue(), new FilterCreaturePermanent(filter)); + Effect effect = new DamageAllEffect(ManacostVariableValue.instance, new FilterCreaturePermanent(filter)); effect.setText("Hunt to Exctinction deals an additional X damage to each creature with a bounty counter on it"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/h/Hurricane.java b/Mage.Sets/src/mage/cards/h/Hurricane.java index cc1418ce23..b6630989b2 100644 --- a/Mage.Sets/src/mage/cards/h/Hurricane.java +++ b/Mage.Sets/src/mage/cards/h/Hurricane.java @@ -28,7 +28,7 @@ public final class Hurricane extends CardImpl { // Hurricane deals X damage to each creature with flying and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageEverythingEffect(ManacostVariableValue.instance, filter)); } public Hurricane(final Hurricane card) { diff --git a/Mage.Sets/src/mage/cards/i/IcatianStore.java b/Mage.Sets/src/mage/cards/i/IcatianStore.java index 6e9aa33546..91a3dfecb2 100644 --- a/Mage.Sets/src/mage/cards/i/IcatianStore.java +++ b/Mage.Sets/src/mage/cards/i/IcatianStore.java @@ -44,7 +44,7 @@ public final class IcatianStore extends CardImpl { // {tap}, Remove any number of storage counters from Icatian Store: Add {W} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.WhiteMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {W} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/i/Illuminate.java b/Mage.Sets/src/mage/cards/i/Illuminate.java index 642379fd37..558226bcf1 100644 --- a/Mage.Sets/src/mage/cards/i/Illuminate.java +++ b/Mage.Sets/src/mage/cards/i/Illuminate.java @@ -28,14 +28,14 @@ public final class Illuminate extends CardImpl { kickerAbility.addKickerCost("{3}{U}"); this.addAbility(kickerAbility); // Illuminate deals X damage to target creature. If Illuminate was kicked with its {2}{R} kicker, it deals X damage to that creature's controller. If Illuminate was kicked with its {3}{U} kicker, you draw X cards. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DamageTargetControllerEffect(new ManacostVariableValue()), + new DamageTargetControllerEffect(ManacostVariableValue.instance), new KickedCostCondition("{2}{R}"), "if this spell was kicked with its {2}{R} kicker, it deals X damage to that creature's controller.")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new DrawCardSourceControllerEffect(new ManacostVariableValue()), + new DrawCardSourceControllerEffect(ManacostVariableValue.instance), new KickedCostCondition("{3}{U}"), " if this spell was kicked with its {3}{U} kicker, you draw X cards.")); diff --git a/Mage.Sets/src/mage/cards/i/InfusedArrows.java b/Mage.Sets/src/mage/cards/i/InfusedArrows.java index 5975fdc4fa..904cde8954 100644 --- a/Mage.Sets/src/mage/cards/i/InfusedArrows.java +++ b/Mage.Sets/src/mage/cards/i/InfusedArrows.java @@ -32,7 +32,7 @@ public final class InfusedArrows extends CardImpl { // Sunburst this.addAbility(new SunburstAbility(this)); // {tap}, Remove X charge counters from Infused Arrows: Target creature gets -X/-X until end of turn. - DynamicValue value = new SignInversionDynamicValue(new RemovedCountersForCostValue()); + DynamicValue value = new SignInversionDynamicValue(RemovedCountersForCostValue.instance); Effect effect = new BoostTargetEffect(value, value, Duration.EndOfTurn); effect.setText("Target creature gets -X/-X until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/i/InnerCalmOuterStrength.java b/Mage.Sets/src/mage/cards/i/InnerCalmOuterStrength.java index 90e6f848e8..7dbf40bb73 100644 --- a/Mage.Sets/src/mage/cards/i/InnerCalmOuterStrength.java +++ b/Mage.Sets/src/mage/cards/i/InnerCalmOuterStrength.java @@ -25,7 +25,7 @@ public final class InnerCalmOuterStrength extends CardImpl { this.subtype.add(SubType.ARCANE); // Target creature gets +X/+X until end of turn, where X is the number of cards in your hand. - DynamicValue xValue= new CardsInControllerHandCount(); + DynamicValue xValue= CardsInControllerHandCount.instance; Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true); effect.setText("Target creature gets +X/+X until end of turn, where X is the number of cards in your hand"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/i/InnerFire.java b/Mage.Sets/src/mage/cards/i/InnerFire.java index d7f2671f73..42a4da2dd4 100644 --- a/Mage.Sets/src/mage/cards/i/InnerFire.java +++ b/Mage.Sets/src/mage/cards/i/InnerFire.java @@ -20,7 +20,7 @@ public final class InnerFire extends CardImpl { // Add {R} for each card in your hand. - this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new CardsInControllerHandCount())); + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), CardsInControllerHandCount.instance)); } public InnerFire(final InnerFire card) { diff --git a/Mage.Sets/src/mage/cards/i/InsidiousDreams.java b/Mage.Sets/src/mage/cards/i/InsidiousDreams.java index 5342973374..b163be9b12 100644 --- a/Mage.Sets/src/mage/cards/i/InsidiousDreams.java +++ b/Mage.Sets/src/mage/cards/i/InsidiousDreams.java @@ -74,7 +74,7 @@ class InsidiousDreamsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - int amount = new GetXValue().calculate(game, source, this); + int amount = GetXValue.instance.calculate(game, source, this); if (controller != null && sourceObject != null) { TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard()); diff --git a/Mage.Sets/src/mage/cards/i/InspiredSphinx.java b/Mage.Sets/src/mage/cards/i/InspiredSphinx.java index f3e793d77e..22e2f94442 100644 --- a/Mage.Sets/src/mage/cards/i/InspiredSphinx.java +++ b/Mage.Sets/src/mage/cards/i/InspiredSphinx.java @@ -33,7 +33,7 @@ public final class InspiredSphinx extends CardImpl { // When Inspired Sphinx enters the battlefield, draw cards equal to the number of opponents you have. this.addAbility(new EntersBattlefieldTriggeredAbility( - new DrawCardSourceControllerEffect(new OpponentsCount()).setText("draw cards equal to the number of opponents you have") + new DrawCardSourceControllerEffect(OpponentsCount.instance).setText("draw cards equal to the number of opponents you have") )); // {3}{U}: Create a colorless 1/1 Thopter artifact creature token with flying. diff --git a/Mage.Sets/src/mage/cards/i/InvokeTheFiremind.java b/Mage.Sets/src/mage/cards/i/InvokeTheFiremind.java index 9e74d88bb5..a61d8a4d1f 100644 --- a/Mage.Sets/src/mage/cards/i/InvokeTheFiremind.java +++ b/Mage.Sets/src/mage/cards/i/InvokeTheFiremind.java @@ -21,9 +21,9 @@ public final class InvokeTheFiremind extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}{R}"); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.instance)); Mode mode = new Mode(); - mode.addEffect(new DamageTargetEffect(new ManacostVariableValue())); + mode.addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); mode.addTarget(new TargetAnyTarget()); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java b/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java index f3226b5564..e895731ea5 100644 --- a/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java +++ b/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java @@ -53,7 +53,7 @@ public final class JaradGolgariLichLord extends CardImpl { this.addAbility(ability); // {1}{B}{G}, Sacrifice another creature: Each opponent loses life equal to the sacrificed creature's power. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeOpponentsEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{1}{B}{G}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeOpponentsEffect(SacrificeCostCreaturesPower.instance), new ManaCostsImpl("{1}{B}{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, false))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/j/JayasImmolatingInferno.java b/Mage.Sets/src/mage/cards/j/JayasImmolatingInferno.java index b1e6320f94..7f04db0559 100644 --- a/Mage.Sets/src/mage/cards/j/JayasImmolatingInferno.java +++ b/Mage.Sets/src/mage/cards/j/JayasImmolatingInferno.java @@ -25,7 +25,7 @@ public final class JayasImmolatingInferno extends CardImpl { this.addAbility(new LegendarySpellAbility()); // Jaya's Immolating Inferno deals X damage to each of up to three targets. - Effect effect = new DamageTargetEffect(new ManacostVariableValue()); + Effect effect = new DamageTargetEffect(ManacostVariableValue.instance); effect.setText("{this} deals X damage to each of up to three targets"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetAnyTarget(1, 3)); diff --git a/Mage.Sets/src/mage/cards/j/JiwariTheEarthAflame.java b/Mage.Sets/src/mage/cards/j/JiwariTheEarthAflame.java index fb3d834a8e..e72e7debbf 100644 --- a/Mage.Sets/src/mage/cards/j/JiwariTheEarthAflame.java +++ b/Mage.Sets/src/mage/cards/j/JiwariTheEarthAflame.java @@ -44,13 +44,13 @@ public final class JiwariTheEarthAflame extends CardImpl { this.toughness = new MageInt(3); // {X}{R}, {tap}: Jiwari, the Earth Aflame deals X damage to target creature without flying. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); // Channel - {X}{R}{R}{R}, Discard Jiwari: Jiwari deals X damage to each creature without flying. - this.addAbility(new ChannelAbility("{X}{R}{R}{R}", new DamageAllEffect(new ManacostVariableValue(), filter))); + this.addAbility(new ChannelAbility("{X}{R}{R}{R}", new DamageAllEffect(ManacostVariableValue.instance, filter))); } public JiwariTheEarthAflame(final JiwariTheEarthAflame card) { diff --git a/Mage.Sets/src/mage/cards/j/JoragaWarcaller.java b/Mage.Sets/src/mage/cards/j/JoragaWarcaller.java index c7751476a8..ca2464b658 100644 --- a/Mage.Sets/src/mage/cards/j/JoragaWarcaller.java +++ b/Mage.Sets/src/mage/cards/j/JoragaWarcaller.java @@ -48,7 +48,7 @@ public final class JoragaWarcaller extends CardImpl { // Joraga Warcaller enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true), "with a +1/+1 counter on it for each time it was kicked")); diff --git a/Mage.Sets/src/mage/cards/j/JushiApprentice.java b/Mage.Sets/src/mage/cards/j/JushiApprentice.java index 88ac5754ba..c6f19a2652 100644 --- a/Mage.Sets/src/mage/cards/j/JushiApprentice.java +++ b/Mage.Sets/src/mage/cards/j/JushiApprentice.java @@ -71,7 +71,7 @@ class TomoyaTheRevealer extends TokenImpl { toughness = new MageInt(3); // {3}{U}{U},{T} : Target player draws X cards, where X is the number of cards in your hand. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardTargetEffect(new CardsInControllerHandCount()), new ManaCostsImpl("{3}{U}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardTargetEffect(CardsInControllerHandCount.instance), new ManaCostsImpl("{3}{U}{U}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KaerveksTorch.java b/Mage.Sets/src/mage/cards/k/KaerveksTorch.java index 9c299f3f2d..f003c59625 100644 --- a/Mage.Sets/src/mage/cards/k/KaerveksTorch.java +++ b/Mage.Sets/src/mage/cards/k/KaerveksTorch.java @@ -34,7 +34,7 @@ public final class KaerveksTorch extends CardImpl { // As long as Kaervek's Torch is on the stack, spells that target it cost {2} more to cast. this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaerveksTorchCostIncreaseEffect())); // Kaervek's Torch deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java index a8249cef2d..06e5e8d550 100644 --- a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java +++ b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java @@ -37,7 +37,7 @@ public final class KagemaroFirstToSuffer extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - DynamicValue xValue = new CardsInControllerHandCount(); + DynamicValue xValue = CardsInControllerHandCount.instance; // Kagemaro, First to Suffer's power and toughness are each equal to the number of cards in your hand. this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // {B}, Sacrifice Kagemaro: All creatures get -X/-X until end of turn, where X is the number of cards in your hand. diff --git a/Mage.Sets/src/mage/cards/k/KagemarosClutch.java b/Mage.Sets/src/mage/cards/k/KagemarosClutch.java index 1736f8cd3e..679f3bfc1a 100644 --- a/Mage.Sets/src/mage/cards/k/KagemarosClutch.java +++ b/Mage.Sets/src/mage/cards/k/KagemarosClutch.java @@ -40,7 +40,7 @@ public final class KagemarosClutch extends CardImpl { this.addAbility(ability); // Enchanted creature gets -X/-X, where X is the number of cards in your hand. - DynamicValue xMinusValue = new SignInversionDynamicValue(new CardsInControllerHandCount()); + DynamicValue xMinusValue = new SignInversionDynamicValue(CardsInControllerHandCount.instance); Effect effect = new BoostEnchantedEffect(xMinusValue, xMinusValue, Duration.WhileOnBattlefield); effect.setText("Enchanted creature gets -X/-X, where X is the number of cards in your hand"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/k/KessigWolfRun.java b/Mage.Sets/src/mage/cards/k/KessigWolfRun.java index 87a7e9e7dd..3dfb9a59d9 100644 --- a/Mage.Sets/src/mage/cards/k/KessigWolfRun.java +++ b/Mage.Sets/src/mage/cards/k/KessigWolfRun.java @@ -33,7 +33,7 @@ public final class KessigWolfRun extends CardImpl { // {X}{R}{G}, {T}: Target creature gets +X/+0 and gains trample until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{X}{R}{G}")); ability.addCost(new TapSourceCost()); - ability.addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + ability.addEffect(new BoostTargetEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KhabalGhoul.java b/Mage.Sets/src/mage/cards/k/KhabalGhoul.java index 28fc328823..06a0fe4e25 100644 --- a/Mage.Sets/src/mage/cards/k/KhabalGhoul.java +++ b/Mage.Sets/src/mage/cards/k/KhabalGhoul.java @@ -28,7 +28,7 @@ public final class KhabalGhoul extends CardImpl { // At the beginning of each end step, put a +1/+1 counter on Khabal Ghoul for each creature that died this turn. this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), - new CreaturesDiedThisTurnCount(), true), TargetController.ANY, false), new CreaturesDiedWatcher()); + CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false), new CreaturesDiedWatcher()); } public KhabalGhoul(final KhabalGhoul card) { diff --git a/Mage.Sets/src/mage/cards/k/KheruDreadmaw.java b/Mage.Sets/src/mage/cards/k/KheruDreadmaw.java index 270eaeacf4..2c5328e31a 100644 --- a/Mage.Sets/src/mage/cards/k/KheruDreadmaw.java +++ b/Mage.Sets/src/mage/cards/k/KheruDreadmaw.java @@ -37,7 +37,7 @@ public final class KheruDreadmaw extends CardImpl { this.addAbility(DefenderAbility.getInstance()); // {1}{G}, Sacrifice another creature: You gain life equal to the sacrificed creature's toughness. - Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); + Effect effect = new GainLifeEffect(SacrificeCostCreaturesToughness.instance); effect.setText("You gain life equal to the sacrificed creature's toughness"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE))); diff --git a/Mage.Sets/src/mage/cards/k/KillingWave.java b/Mage.Sets/src/mage/cards/k/KillingWave.java index 9027d41357..0f146aac56 100644 --- a/Mage.Sets/src/mage/cards/k/KillingWave.java +++ b/Mage.Sets/src/mage/cards/k/KillingWave.java @@ -61,7 +61,7 @@ class KillingWaveEffect extends OneShotEffect { return false; } - int amount = (new ManacostVariableValue()).calculate(game, source, this); + int amount = (ManacostVariableValue.instance).calculate(game, source, this); if (amount > 0) { List sacrifices = new LinkedList<>(); Map lifePaidAmounts = new HashMap<>(); diff --git a/Mage.Sets/src/mage/cards/k/KitsuneLoreweaver.java b/Mage.Sets/src/mage/cards/k/KitsuneLoreweaver.java index 8724a8582e..0b71aea401 100644 --- a/Mage.Sets/src/mage/cards/k/KitsuneLoreweaver.java +++ b/Mage.Sets/src/mage/cards/k/KitsuneLoreweaver.java @@ -30,7 +30,7 @@ public final class KitsuneLoreweaver extends CardImpl { this.toughness = new MageInt(1); // {1}{W}: Kitsune Loreweaver gets +0/+X until end of turn, where X is the number of cards in your hand. - Effect effect = new BoostSourceEffect(new StaticValue(0), new CardsInControllerHandCount(), Duration.EndOfTurn, true); + Effect effect = new BoostSourceEffect(new StaticValue(0), CardsInControllerHandCount.instance, Duration.EndOfTurn, true); effect.setText("{this} gets +0/+X until end of turn, where X is the number of cards in your hand"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java b/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java index f352b99623..0349e3bd19 100644 --- a/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java +++ b/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java @@ -43,7 +43,7 @@ public final class KiyomaroFirstToStand extends CardImpl { this.toughness = new MageInt(0); // Kiyomaro, First to Stand's power and toughness are each equal to the number of cards in your hand. - DynamicValue xValue= new CardsInControllerHandCount(); + DynamicValue xValue= CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // As long as you have four or more cards in hand, Kiyomaro has vigilance. diff --git a/Mage.Sets/src/mage/cards/k/KnollspineInvocation.java b/Mage.Sets/src/mage/cards/k/KnollspineInvocation.java index 7da7179e69..8b2a45c4c3 100644 --- a/Mage.Sets/src/mage/cards/k/KnollspineInvocation.java +++ b/Mage.Sets/src/mage/cards/k/KnollspineInvocation.java @@ -32,7 +32,7 @@ public final class KnollspineInvocation extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}{R}"); // {X}, Discard a card with converted mana cost X: Knollspine Invocation deals X damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue(), true), new ManaCostsImpl<>("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance, true), new ManaCostsImpl<>("{X}")); ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter))); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KorozdaGuildmage.java b/Mage.Sets/src/mage/cards/k/KorozdaGuildmage.java index 726ead90ab..872488a84d 100644 --- a/Mage.Sets/src/mage/cards/k/KorozdaGuildmage.java +++ b/Mage.Sets/src/mage/cards/k/KorozdaGuildmage.java @@ -53,7 +53,7 @@ public final class KorozdaGuildmage extends CardImpl { this.addAbility(ability); // {2}{B}{G}, Sacrifice a nontoken creature: create X 1/1 green Saproling creature tokens, where X is the sacrificed creature's toughness. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken(),new SacrificeCostCreaturesToughness()),new ManaCostsImpl("{2}{B}{G}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken(),SacrificeCostCreaturesToughness.instance),new ManaCostsImpl("{2}{B}{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,filter, true))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KravTheUnredeemed.java b/Mage.Sets/src/mage/cards/k/KravTheUnredeemed.java index 8a08d9630d..136033ed40 100644 --- a/Mage.Sets/src/mage/cards/k/KravTheUnredeemed.java +++ b/Mage.Sets/src/mage/cards/k/KravTheUnredeemed.java @@ -76,7 +76,7 @@ class KravTheUnredeemedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int xValue = new GetXValue().calculate(game, source, this); + int xValue = GetXValue.instance.calculate(game, source, this); new DrawCardTargetEffect(xValue).apply(game, source); new GainLifeTargetEffect(xValue).apply(game, source); new AddCountersSourceEffect(CounterType.P1P1.createInstance(xValue)).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/k/KryShield.java b/Mage.Sets/src/mage/cards/k/KryShield.java index 8fc55fc5dc..eb321f215e 100644 --- a/Mage.Sets/src/mage/cards/k/KryShield.java +++ b/Mage.Sets/src/mage/cards/k/KryShield.java @@ -31,7 +31,7 @@ public final class KryShield extends CardImpl { Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn); effect.setText("Prevent all damage that would be dealt this turn by target creature you control"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); - ability.addEffect(new BoostTargetEffect(new StaticValue(0), new TargetConvertedManaCost(), Duration.EndOfTurn, true) + ability.addEffect(new BoostTargetEffect(new StaticValue(0), TargetConvertedManaCost.instance, Duration.EndOfTurn, true) .setText("That creature gets +0/+X until end of turn, where X is its converted mana cost")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetControlledCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/l/LatullaKeldonOverseer.java b/Mage.Sets/src/mage/cards/l/LatullaKeldonOverseer.java index 7c86ccbe4f..30171595ff 100644 --- a/Mage.Sets/src/mage/cards/l/LatullaKeldonOverseer.java +++ b/Mage.Sets/src/mage/cards/l/LatullaKeldonOverseer.java @@ -35,7 +35,7 @@ public final class LatullaKeldonOverseer extends CardImpl { this.toughness = new MageInt(3); // {X}{R}, {tap}, Discard two cards: Latulla, Keldon Overseer deals X damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{R}")); ability.addCost(new TapSourceCost()); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, 2, new FilterCard("two cards")))); ability.addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/l/LavaclawReaches.java b/Mage.Sets/src/mage/cards/l/LavaclawReaches.java index e1c3f7b6fd..9988c05f7d 100644 --- a/Mage.Sets/src/mage/cards/l/LavaclawReaches.java +++ b/Mage.Sets/src/mage/cards/l/LavaclawReaches.java @@ -60,7 +60,7 @@ class LavaclawReachesToken extends TokenImpl { color.setBlack(true); power = new MageInt(2); toughness = new MageInt(2); - addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{X}"))); + addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{X}"))); } public LavaclawReachesToken(final LavaclawReachesToken token) { super(token); diff --git a/Mage.Sets/src/mage/cards/l/Lavalanche.java b/Mage.Sets/src/mage/cards/l/Lavalanche.java index bbb74ff71d..231134ea21 100644 --- a/Mage.Sets/src/mage/cards/l/Lavalanche.java +++ b/Mage.Sets/src/mage/cards/l/Lavalanche.java @@ -29,7 +29,7 @@ public final class Lavalanche extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{R}{G}"); // Lavalanche deals X damage to target player and each creature he or she controls. - this.getSpellAbility().addEffect(new LavalancheEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new LavalancheEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); } diff --git a/Mage.Sets/src/mage/cards/l/Lich.java b/Mage.Sets/src/mage/cards/l/Lich.java index a04b2c81a1..e77d1031f5 100644 --- a/Mage.Sets/src/mage/cards/l/Lich.java +++ b/Mage.Sets/src/mage/cards/l/Lich.java @@ -41,7 +41,7 @@ public final class Lich extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}{B}{B}"); // As Lich enters the battlefield, you lose life equal to your life total. - this.addAbility(new EntersBattlefieldAbility(new LoseLifeSourceControllerEffect(new ControllerLifeCount()), null, "As Lich enters the battlefield, you lose life equal to your life total.", null)); + this.addAbility(new EntersBattlefieldAbility(new LoseLifeSourceControllerEffect(ControllerLifeCount.instance), null, "As Lich enters the battlefield, you lose life equal to your life total.", null)); // You don't lose the game for having 0 or less life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontLoseByZeroOrLessLifeEffect(Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java index 7aabdf3f90..a6ff60b501 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java @@ -39,7 +39,7 @@ public final class LifecraftAwakening extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}"); // Put X +1/+1 counters on target artifact you control. If it isn't a creature or Vehicle, it becomes a 0/0 Construct artifact creature. - ManacostVariableValue manaX = new ManacostVariableValue(); + ManacostVariableValue manaX = ManacostVariableValue.instance; getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(), manaX)); getSpellAbility().addTarget(new TargetArtifactPermanent(filter)); getSpellAbility().addEffect(new LifecraftAwakeningEffect()); diff --git a/Mage.Sets/src/mage/cards/l/LightkeeperOfEmeria.java b/Mage.Sets/src/mage/cards/l/LightkeeperOfEmeria.java index 05cad39bf7..2b3be08030 100644 --- a/Mage.Sets/src/mage/cards/l/LightkeeperOfEmeria.java +++ b/Mage.Sets/src/mage/cards/l/LightkeeperOfEmeria.java @@ -35,7 +35,7 @@ public final class LightkeeperOfEmeria extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Lightkeeper of Emeria enters the battlefield, you gain 2 life for each time it was kicked. - Effect effect = new GainLifeEffect(new MultipliedValue(new MultikickerCount(), 2)); + Effect effect = new GainLifeEffect(new MultipliedValue(MultikickerCount.instance, 2)); effect.setText("you gain 2 life for each time it was kicked"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); } diff --git a/Mage.Sets/src/mage/cards/l/LiquidFire.java b/Mage.Sets/src/mage/cards/l/LiquidFire.java index 04b40d1413..32737ce082 100644 --- a/Mage.Sets/src/mage/cards/l/LiquidFire.java +++ b/Mage.Sets/src/mage/cards/l/LiquidFire.java @@ -30,7 +30,7 @@ public final class LiquidFire extends CardImpl { // As an additional cost to cast Liquid Fire, choose a number between 0 and 5. this.getSpellAbility().addCost(new LiquidFireCost()); // Liquid Fire deals X damage to target creature and 5 minus X damage to that creature's controller, where X is the chosen number. - DynamicValue choiceValue = new GetXValue(); + DynamicValue choiceValue = GetXValue.instance; this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new LiquidFireEffect(choiceValue)); diff --git a/Mage.Sets/src/mage/cards/l/LogicKnot.java b/Mage.Sets/src/mage/cards/l/LogicKnot.java index 49b6eaff91..daa6d03ee1 100644 --- a/Mage.Sets/src/mage/cards/l/LogicKnot.java +++ b/Mage.Sets/src/mage/cards/l/LogicKnot.java @@ -24,7 +24,7 @@ public final class LogicKnot extends CardImpl { this.addAbility(new DelveAbility()); // Counter target spell unless its controller pays {X}. - this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetSpell()); } diff --git a/Mage.Sets/src/mage/cards/m/MageRingNetwork.java b/Mage.Sets/src/mage/cards/m/MageRingNetwork.java index 3edaf7279c..21506a8bec 100644 --- a/Mage.Sets/src/mage/cards/m/MageRingNetwork.java +++ b/Mage.Sets/src/mage/cards/m/MageRingNetwork.java @@ -39,7 +39,7 @@ public final class MageRingNetwork extends CardImpl { // {T}, Remove any number of storage counters from Mage-Ring Network: Add {C} for each storage counter removed this way. ability = new DynamicManaAbility( Mana.ColorlessMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {C} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/m/Magmaquake.java b/Mage.Sets/src/mage/cards/m/Magmaquake.java index 98e00ba168..4522a2d70b 100644 --- a/Mage.Sets/src/mage/cards/m/Magmaquake.java +++ b/Mage.Sets/src/mage/cards/m/Magmaquake.java @@ -34,7 +34,7 @@ public final class Magmaquake extends CardImpl { // Magmaquake deals X damage to each creature without flying and each planeswalker. - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filter)); } public Magmaquake(final Magmaquake card) { diff --git a/Mage.Sets/src/mage/cards/m/MaliciousAdvice.java b/Mage.Sets/src/mage/cards/m/MaliciousAdvice.java index 9f05a441e6..b75bb70a68 100644 --- a/Mage.Sets/src/mage/cards/m/MaliciousAdvice.java +++ b/Mage.Sets/src/mage/cards/m/MaliciousAdvice.java @@ -30,7 +30,7 @@ public final class MaliciousAdvice extends CardImpl { Effect effect = new TapTargetEffect(); effect.setText("X target artifacts, creatures, and/or lands."); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(ManacostVariableValue.instance)); this.getSpellAbility().setTargetAdjuster(MaliciousAdviceAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/m/Malignus.java b/Mage.Sets/src/mage/cards/m/Malignus.java index 7db5312754..156ede533c 100644 --- a/Mage.Sets/src/mage/cards/m/Malignus.java +++ b/Mage.Sets/src/mage/cards/m/Malignus.java @@ -74,7 +74,7 @@ class HighestLifeTotalAmongOpponentsCount implements DynamicValue { @Override public DynamicValue copy() { - return new CardsInControllerHandCount(); + return CardsInControllerHandCount.instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java b/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java index 7d5a219f10..866ab25de7 100644 --- a/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java +++ b/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java @@ -52,12 +52,12 @@ public final class MarathWillOfTheWild extends CardImpl { this.toughness = new MageInt(0); // Marath, Will of the Wild enters the battlefield with a number of +1/+1 counters on it equal to the amount of mana spent to cast it. - Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new ManaSpentToCastCount(), true); + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ManaSpentToCastCount.instance, true); effect.setText("with a number of +1/+1 counters on it equal to the amount of mana spent to cast it"); this.addAbility(new EntersBattlefieldAbility(effect)); // {X}, Remove X +1/+1 counters from Marath: Choose one - Put X +1/+1 counters on target creature; - effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), new ManacostVariableValue()); + effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), ManacostVariableValue.instance); effect.setText("Put X +1/+1 counters on target creature"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new MarathWillOfTheWildRemoveCountersCost()); @@ -65,7 +65,7 @@ public final class MarathWillOfTheWild extends CardImpl { // or Marath deals X damage to any target; Mode mode = new Mode(); - mode.addEffect(new DamageTargetEffect(new ManacostVariableValue())); + mode.addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); mode.addTarget(new TargetAnyTarget()); ability.addMode(mode); @@ -132,7 +132,7 @@ class MarathWillOfTheWildCreateTokenEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - int amount = new ManacostVariableValue().calculate(game, source, this); + int amount = ManacostVariableValue.instance.calculate(game, source, this); Token token = new MarathWillOfTheWildElementalToken(); token.getPower().modifyBaseValue(amount); token.getToughness().modifyBaseValue(amount); @@ -165,7 +165,7 @@ class MarathWillOfTheWildRemoveCountersCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { - int amount = new ManacostVariableValue().calculate(game, ability, null); + int amount = ManacostVariableValue.instance.calculate(game, ability, null); Permanent permanent = game.getPermanent(sourceId); if (permanent != null && permanent.getCounters(game).getCount(CounterType.P1P1) >= amount) { permanent.removeCounters(CounterType.P1P1.getName(), amount, game); diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java b/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java index b15c38640f..1f6f9fe5a4 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java @@ -24,7 +24,7 @@ public final class MarchOfTheMultitudes extends CardImpl { // Create X 1/1 white Soldier creature tokens with lifelink. this.getSpellAbility().addEffect(new CreateTokenEffect( new SoldierLifelinkToken(), - new ManacostVariableValue() + ManacostVariableValue.instance )); } diff --git a/Mage.Sets/src/mage/cards/m/Maro.java b/Mage.Sets/src/mage/cards/m/Maro.java index e611397388..68bd5c1faf 100644 --- a/Mage.Sets/src/mage/cards/m/Maro.java +++ b/Mage.Sets/src/mage/cards/m/Maro.java @@ -27,7 +27,7 @@ public final class Maro extends CardImpl { this.toughness = new MageInt(0); // Maro's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); } public Maro(final Maro card) { diff --git a/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java b/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java index 7ed4417d51..9fc03f6d55 100644 --- a/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java +++ b/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java @@ -65,7 +65,7 @@ enum MarshalsAnthemAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); - int numbTargets = new MultikickerCount().calculate(game, ability, null); + int numbTargets = MultikickerCount.instance.calculate(game, ability, null); if (numbTargets > 0) { ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, filter)); } diff --git a/Mage.Sets/src/mage/cards/m/MartyrOfAshes.java b/Mage.Sets/src/mage/cards/m/MartyrOfAshes.java index 9a99586b08..c43c8a45e2 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrOfAshes.java +++ b/Mage.Sets/src/mage/cards/m/MartyrOfAshes.java @@ -48,7 +48,7 @@ public final class MartyrOfAshes extends CardImpl { this.toughness = new MageInt(1); // {2}, Reveal X red cards from your hand, Sacrifice Martyr of Ashes: Martyr of Ashes deals X damage to each creature without flying. - Effect effect = new DamageAllEffect(new RevealTargetFromHandCostCount(), filterCreature); + Effect effect = new DamageAllEffect(RevealTargetFromHandCostCount.instance, filterCreature); effect.setText("Martyr of Ashes deals X damage to each creature without flying."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filterHand))); diff --git a/Mage.Sets/src/mage/cards/m/MartyrOfFrost.java b/Mage.Sets/src/mage/cards/m/MartyrOfFrost.java index 44e48efe62..5ec56acb5a 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrOfFrost.java +++ b/Mage.Sets/src/mage/cards/m/MartyrOfFrost.java @@ -42,7 +42,7 @@ public final class MartyrOfFrost extends CardImpl { this.toughness = new MageInt(1); // {2}, Reveal X blue cards from your hand, Sacrifice Martyr of Frost: Counter target spell unless its controller pays {X}. - Effect effect = new CounterUnlessPaysEffect(new RevealTargetFromHandCostCount()); + Effect effect = new CounterUnlessPaysEffect(RevealTargetFromHandCostCount.instance); effect.setText("Counter target spell unless its controller pays {X}."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter))); diff --git a/Mage.Sets/src/mage/cards/m/MartyrOfSands.java b/Mage.Sets/src/mage/cards/m/MartyrOfSands.java index 5076f87b2f..d6c7baa463 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrOfSands.java +++ b/Mage.Sets/src/mage/cards/m/MartyrOfSands.java @@ -43,7 +43,7 @@ public final class MartyrOfSands extends CardImpl { this.toughness = new MageInt(1); // {1}, Reveal X white cards from your hand, Sacrifice Martyr of Sands: You gain three times X life. - Effect effect = new GainLifeEffect(new MultipliedValue(new RevealTargetFromHandCostCount(), 3)); + Effect effect = new GainLifeEffect(new MultipliedValue(RevealTargetFromHandCostCount.instance, 3)); effect.setText("You gain three times X life."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}")); ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter))); diff --git a/Mage.Sets/src/mage/cards/m/MartyrOfSpores.java b/Mage.Sets/src/mage/cards/m/MartyrOfSpores.java index 160441a376..4bb1335d44 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrOfSpores.java +++ b/Mage.Sets/src/mage/cards/m/MartyrOfSpores.java @@ -43,7 +43,7 @@ public final class MartyrOfSpores extends CardImpl { this.toughness = new MageInt(1); // {1}, Reveal X green cards from your hand, Sacrifice Martyr of Spores: Target creature gets +X/+X until end of turn. - Effect effect = new BoostTargetEffect(new RevealTargetFromHandCostCount(), new RevealTargetFromHandCostCount(), Duration.EndOfTurn, true); + Effect effect = new BoostTargetEffect(RevealTargetFromHandCostCount.instance, RevealTargetFromHandCostCount.instance, Duration.EndOfTurn, true); effect.setText("Target creature gets +X/+X until end of turn."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter))); diff --git a/Mage.Sets/src/mage/cards/m/MasterTheWay.java b/Mage.Sets/src/mage/cards/m/MasterTheWay.java index 9325793aa8..e3fc9243cf 100644 --- a/Mage.Sets/src/mage/cards/m/MasterTheWay.java +++ b/Mage.Sets/src/mage/cards/m/MasterTheWay.java @@ -23,7 +23,7 @@ public final class MasterTheWay extends CardImpl { // Draw a card. Master the Way deals damage to any target equal to the number of cards in your hand. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - Effect effect = new DamageTargetEffect(new CardsInControllerHandCount()); + Effect effect = new DamageTargetEffect(CardsInControllerHandCount.instance); effect.setText("{this} deals damage to any target equal to the number of cards in your hand"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java b/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java index e7721a06a8..3e67265849 100644 --- a/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java +++ b/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java @@ -32,7 +32,7 @@ public final class MasumaroFirstToLive extends CardImpl { this.toughness = new MageInt(0); // Masumaro, First to Live's power and toughness are each equal to twice the number of cards in your hand. - DynamicValue xValue= new MultipliedValue(new CardsInControllerHandCount(), 2); + DynamicValue xValue= new MultipliedValue(CardsInControllerHandCount.instance, 2); Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame); effect.setText("{this}'s power and toughness are each equal to twice the number of cards in your hand"); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); diff --git a/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java b/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java index 2d29f4215a..a88e657705 100644 --- a/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java +++ b/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java @@ -26,7 +26,7 @@ public final class MeishinTheMindCage extends CardImpl { addSuperType(SuperType.LEGENDARY); // All creatures get -X/-0, where X is the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(0), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false, "All creatures get -X/-0, where X is the number of cards in your hand"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new SignInversionDynamicValue(CardsInControllerHandCount.instance), new StaticValue(0), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false, "All creatures get -X/-0, where X is the number of cards in your hand"))); } public MeishinTheMindCage(final MeishinTheMindCage card) { diff --git a/Mage.Sets/src/mage/cards/m/MercadianBazaar.java b/Mage.Sets/src/mage/cards/m/MercadianBazaar.java index dc03c83a53..aadd3bbe45 100644 --- a/Mage.Sets/src/mage/cards/m/MercadianBazaar.java +++ b/Mage.Sets/src/mage/cards/m/MercadianBazaar.java @@ -34,7 +34,7 @@ public final class MercadianBazaar extends CardImpl { // {tap}, Remove any number of storage counters from Mercadian Bazaar: Add {R} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.RedMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {R} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/m/MercurialChemister.java b/Mage.Sets/src/mage/cards/m/MercurialChemister.java index 9365da620d..b3390f455e 100644 --- a/Mage.Sets/src/mage/cards/m/MercurialChemister.java +++ b/Mage.Sets/src/mage/cards/m/MercurialChemister.java @@ -39,7 +39,7 @@ public final class MercurialChemister extends CardImpl { this.addAbility(ability); // {R}, {T}, Discard a card: Mercurial Chemister deals damage to target creature equal to the discarded card's converted mana cost. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new DiscardCostCardConvertedMana()), new ManaCostsImpl("{R}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(DiscardCostCardConvertedMana.instance), new ManaCostsImpl("{R}")); ability.addTarget(new TargetCreaturePermanent()); ability.addCost(new TapSourceCost()); ability.addCost(new DiscardCardCost()); diff --git a/Mage.Sets/src/mage/cards/m/MeteorShower.java b/Mage.Sets/src/mage/cards/m/MeteorShower.java index 9c8031c50d..2fa2390c04 100644 --- a/Mage.Sets/src/mage/cards/m/MeteorShower.java +++ b/Mage.Sets/src/mage/cards/m/MeteorShower.java @@ -21,7 +21,7 @@ public final class MeteorShower extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{R}"); // Meteor Shower deals X plus 1 damage divided as you choose among any number of target creatures and/or players. - DynamicValue xValue = new IntPlusDynamicValue(1, new ManacostVariableValue()); + DynamicValue xValue = new IntPlusDynamicValue(1, ManacostVariableValue.instance); this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue)); } diff --git a/Mage.Sets/src/mage/cards/m/MilitantAngel.java b/Mage.Sets/src/mage/cards/m/MilitantAngel.java index 790f1e62c1..c1ff666a0d 100644 --- a/Mage.Sets/src/mage/cards/m/MilitantAngel.java +++ b/Mage.Sets/src/mage/cards/m/MilitantAngel.java @@ -33,7 +33,7 @@ public final class MilitantAngel extends CardImpl { this.addAbility(LifelinkAbility.getInstance()); // When Militant Angel enters the battlefield, create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you attacked this turn. - Effect effect = new CreateTokenEffect(new KnightToken(), new AttackedThisTurnOpponentsCount()); + Effect effect = new CreateTokenEffect(new KnightToken(), AttackedThisTurnOpponentsCount.instance); effect.setText("create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you attacked this turn"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); } diff --git a/Mage.Sets/src/mage/cards/m/MindShatter.java b/Mage.Sets/src/mage/cards/m/MindShatter.java index 244b241f93..8e048a27ab 100644 --- a/Mage.Sets/src/mage/cards/m/MindShatter.java +++ b/Mage.Sets/src/mage/cards/m/MindShatter.java @@ -19,7 +19,7 @@ public final class MindShatter extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}{B}"); // Target player discards X cards at random. - this.getSpellAbility().addEffect(new DiscardTargetEffect(new ManacostVariableValue(), true)); + this.getSpellAbility().addEffect(new DiscardTargetEffect(ManacostVariableValue.instance, true)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/m/MindSpring.java b/Mage.Sets/src/mage/cards/m/MindSpring.java index f327dde9c9..58b5994632 100644 --- a/Mage.Sets/src/mage/cards/m/MindSpring.java +++ b/Mage.Sets/src/mage/cards/m/MindSpring.java @@ -18,7 +18,7 @@ public final class MindSpring extends CardImpl { public MindSpring(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}"); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.instance)); } public MindSpring(final MindSpring card) { diff --git a/Mage.Sets/src/mage/cards/m/MindTwist.java b/Mage.Sets/src/mage/cards/m/MindTwist.java index 1b1b377ffc..bddc25745a 100644 --- a/Mage.Sets/src/mage/cards/m/MindTwist.java +++ b/Mage.Sets/src/mage/cards/m/MindTwist.java @@ -20,7 +20,7 @@ public final class MindTwist extends CardImpl { // Target player discards X cards at random. - this.getSpellAbility().addEffect(new DiscardTargetEffect(new ManacostVariableValue(), true)); + this.getSpellAbility().addEffect(new DiscardTargetEffect(ManacostVariableValue.instance, true)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/m/MindWarp.java b/Mage.Sets/src/mage/cards/m/MindWarp.java index c82cf55fb6..3db8935245 100644 --- a/Mage.Sets/src/mage/cards/m/MindWarp.java +++ b/Mage.Sets/src/mage/cards/m/MindWarp.java @@ -28,7 +28,7 @@ public final class MindWarp extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{3}{B}"); // Look at target player's hand and choose X cards from it. That player discards those cards. - this.getSpellAbility().addEffect(new MindWarpEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new MindWarpEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/m/Mindswipe.java b/Mage.Sets/src/mage/cards/m/Mindswipe.java index fbfa217fd3..1650b14967 100644 --- a/Mage.Sets/src/mage/cards/m/Mindswipe.java +++ b/Mage.Sets/src/mage/cards/m/Mindswipe.java @@ -29,7 +29,7 @@ public final class Mindswipe extends CardImpl { // Counter target spell unless its controller pays {X}. Mindswipe deals X damage to that spell's controller. - Effect effect = new CounterUnlessPaysEffect(new ManacostVariableValue()); + Effect effect = new CounterUnlessPaysEffect(ManacostVariableValue.instance); effect.setText("Counter target spell unless its controller pays {X}."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetSpell()); @@ -74,7 +74,7 @@ class MindswipeEffect extends OneShotEffect { Spell spell = (Spell) object; Player spellController = game.getPlayer(spell.getControllerId()); if (spellController != null) { - int damage = new ManacostVariableValue().calculate(game, source, this); + int damage = ManacostVariableValue.instance.calculate(game, source, this); spellController.damage(damage, source.getSourceId(), game, false, true); } return true; diff --git a/Mage.Sets/src/mage/cards/m/MirrorEntity.java b/Mage.Sets/src/mage/cards/m/MirrorEntity.java index b5246cc7e3..9174db87c9 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorEntity.java +++ b/Mage.Sets/src/mage/cards/m/MirrorEntity.java @@ -40,7 +40,7 @@ public final class MirrorEntity extends CardImpl { // Changeling this.addAbility(ChangelingAbility.getInstance()); // {X}: Until end of turn, creatures you control have base power and toughness X/X and gain all creature types. - DynamicValue variableMana = new ManacostVariableValue(); + DynamicValue variableMana = ManacostVariableValue.instance; Effect effect = new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, filter, true); effect.setText("Until end of turn, creatures you control have base power and toughness X/X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new VariableManaCost()); diff --git a/Mage.Sets/src/mage/cards/m/Molder.java b/Mage.Sets/src/mage/cards/m/Molder.java index ca23233ac7..cffc75b81a 100644 --- a/Mage.Sets/src/mage/cards/m/Molder.java +++ b/Mage.Sets/src/mage/cards/m/Molder.java @@ -28,7 +28,7 @@ public final class Molder extends CardImpl { // Destroy target artifact or enchantment with converted mana cost X. It can't be regenerated. You gain X life. this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target artifact or enchantment with converted mana cost X.", true)); - this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance)); this.getSpellAbility().setTargetAdjuster(MolderAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/m/MoltenSlagheap.java b/Mage.Sets/src/mage/cards/m/MoltenSlagheap.java index a6e3ef4dea..5d339c274a 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenSlagheap.java +++ b/Mage.Sets/src/mage/cards/m/MoltenSlagheap.java @@ -36,7 +36,7 @@ public final class MoltenSlagheap extends CardImpl { this.addAbility(ability); // {1}, Remove X storage counters from Molten Slagheap: Add X mana in any combination of {B} and/or {R}. ability = new SimpleManaAbility(Zone.BATTLEFIELD, - new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.B, ColoredManaSymbol.R), + new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.B, ColoredManaSymbol.R), new GenericManaCost(1)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java index 77087fd624..28f7226af5 100644 --- a/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java +++ b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java @@ -21,7 +21,7 @@ public final class MonstrousOnslaught extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); // Monstrous Onslaught deals X damage divided as you choose among any number of target creatures, where X is the greatest power among creatures you control as you cast Monstrous Onslaught. - DynamicValue xValue = new GreatestPowerAmongControlledCreaturesValue(); + DynamicValue xValue = GreatestPowerAmongControlledCreaturesValue.instance; Effect effect = new DamageMultiEffect(xValue); effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest power among creatures you control as you cast {this}"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java b/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java index 63949d9ba9..d2e45d955e 100644 --- a/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java +++ b/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java @@ -33,7 +33,7 @@ public final class MultaniMaroSorcerer extends CardImpl { this.addAbility(ShroudAbility.getInstance()); // Multani, Maro-Sorcerer's power and toughness are each equal to the total number of cards in all players' hands. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllHandsCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame))); } public MultaniMaroSorcerer(final MultaniMaroSorcerer card) { diff --git a/Mage.Sets/src/mage/cards/m/MycosynthFiend.java b/Mage.Sets/src/mage/cards/m/MycosynthFiend.java index ddeaa5a478..99d1ecdfb5 100644 --- a/Mage.Sets/src/mage/cards/m/MycosynthFiend.java +++ b/Mage.Sets/src/mage/cards/m/MycosynthFiend.java @@ -27,7 +27,7 @@ public final class MycosynthFiend extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - DynamicValue value = new OpponentsPoisonCountersCount(); + DynamicValue value = OpponentsPoisonCountersCount.instance; this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(value, value, Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/cards/n/NahirisWrath.java b/Mage.Sets/src/mage/cards/n/NahirisWrath.java index 0d4a764c73..3777758cfe 100644 --- a/Mage.Sets/src/mage/cards/n/NahirisWrath.java +++ b/Mage.Sets/src/mage/cards/n/NahirisWrath.java @@ -34,7 +34,7 @@ public final class NahirisWrath extends CardImpl { this.getSpellAbility().addCost(new NahirisWrathAdditionalCost()); // Nahiri's Wrath deals damage equal to the total converted mana cost of the discarded cards to each of up to X target creatures and/or planeswalkers. - Effect effect = new DamageTargetEffect(new DiscardCostCardConvertedMana()); + Effect effect = new DamageTargetEffect(DiscardCostCardConvertedMana.instance); effect.setText("{this} deals damage equal to the total converted mana cost of the discarded cards to each of up to X target creatures and/or planeswalkers"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().setTargetAdjuster(NahirisWrathAdjuster.instance); diff --git a/Mage.Sets/src/mage/cards/n/Necrologia.java b/Mage.Sets/src/mage/cards/n/Necrologia.java index 1d35c3beba..d1c3dc8a26 100644 --- a/Mage.Sets/src/mage/cards/n/Necrologia.java +++ b/Mage.Sets/src/mage/cards/n/Necrologia.java @@ -29,7 +29,7 @@ public final class Necrologia extends CardImpl { this.getSpellAbility().addCost(new PayVariableLifeCost(true)); // Draw X cards. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new GetXValue())); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(GetXValue.instance)); } public Necrologia(final Necrologia card) { diff --git a/Mage.Sets/src/mage/cards/n/NecropolisFiend.java b/Mage.Sets/src/mage/cards/n/NecropolisFiend.java index db6e9c26c8..e1b5a829d9 100644 --- a/Mage.Sets/src/mage/cards/n/NecropolisFiend.java +++ b/Mage.Sets/src/mage/cards/n/NecropolisFiend.java @@ -53,7 +53,7 @@ public final class NecropolisFiend extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {X}, {T}, Exile X cards from your graveyard: Target creature gets -X/-X until end of turn. - DynamicValue xValue = new SignInversionDynamicValue(new ManacostVariableValue()); + DynamicValue xValue = new SignInversionDynamicValue(ManacostVariableValue.instance); Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn); effect.setText("Target creature gets -X/-X until end of turn"); Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/cards/n/NightmarishEnd.java b/Mage.Sets/src/mage/cards/n/NightmarishEnd.java index ccf1c13d35..c597bc8f7a 100644 --- a/Mage.Sets/src/mage/cards/n/NightmarishEnd.java +++ b/Mage.Sets/src/mage/cards/n/NightmarishEnd.java @@ -24,7 +24,7 @@ public final class NightmarishEnd extends CardImpl { // Target creature gets -X/-X until end of turn, where X is the number of cards in your hand. - DynamicValue xValue = new SignInversionDynamicValue(new CardsInControllerHandCount()); + DynamicValue xValue = new SignInversionDynamicValue(CardsInControllerHandCount.instance); Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true); effect.setText("Target creature gets -X/-X until end of turn, where X is the number of cards in your hand"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/n/NostalgicDreams.java b/Mage.Sets/src/mage/cards/n/NostalgicDreams.java index 5570440c6d..a9d8eec1ae 100644 --- a/Mage.Sets/src/mage/cards/n/NostalgicDreams.java +++ b/Mage.Sets/src/mage/cards/n/NostalgicDreams.java @@ -55,7 +55,7 @@ enum NostalgicDreamsAdjuster implements TargetAdjuster { public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); ability.addTarget(new TargetCardInYourGraveyard( - new GetXValue().calculate(game, ability, null), + GetXValue.instance.calculate(game, ability, null), StaticFilters.FILTER_CARD_FROM_YOUR_GRAVEYARD )); } diff --git a/Mage.Sets/src/mage/cards/n/NourishingShoal.java b/Mage.Sets/src/mage/cards/n/NourishingShoal.java index f6459c1085..aa39d1d90f 100644 --- a/Mage.Sets/src/mage/cards/n/NourishingShoal.java +++ b/Mage.Sets/src/mage/cards/n/NourishingShoal.java @@ -36,7 +36,7 @@ public final class NourishingShoal extends CardImpl { this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true))); // You gain X life. - this.getSpellAbility().addEffect(new GainLifeEffect(new ExileFromHandCostCardConvertedMana())); + this.getSpellAbility().addEffect(new GainLifeEffect(ExileFromHandCostCardConvertedMana.instance)); } diff --git a/Mage.Sets/src/mage/cards/o/OboroEnvoy.java b/Mage.Sets/src/mage/cards/o/OboroEnvoy.java index c4990fe881..fa6d5891b0 100644 --- a/Mage.Sets/src/mage/cards/o/OboroEnvoy.java +++ b/Mage.Sets/src/mage/cards/o/OboroEnvoy.java @@ -39,7 +39,7 @@ public final class OboroEnvoy extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // {2}, Return a land you control to its owner's hand: Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand. - Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(-0), Duration.EndOfTurn, true); + Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(CardsInControllerHandCount.instance), new StaticValue(-0), Duration.EndOfTurn, true); effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); diff --git a/Mage.Sets/src/mage/cards/o/OnwardVictory.java b/Mage.Sets/src/mage/cards/o/OnwardVictory.java index 5d04b761f9..e5d5aa698d 100644 --- a/Mage.Sets/src/mage/cards/o/OnwardVictory.java +++ b/Mage.Sets/src/mage/cards/o/OnwardVictory.java @@ -25,7 +25,7 @@ public final class OnwardVictory extends SplitCard { // Onward // Target creature gets +X/+0 until end of turn where X is its power. getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); - getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true)); + getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, new StaticValue(0), Duration.EndOfTurn, true)); // to // Victory diff --git a/Mage.Sets/src/mage/cards/o/OracleOfNectars.java b/Mage.Sets/src/mage/cards/o/OracleOfNectars.java index 0c8bd66cd1..94f72f3ee7 100644 --- a/Mage.Sets/src/mage/cards/o/OracleOfNectars.java +++ b/Mage.Sets/src/mage/cards/o/OracleOfNectars.java @@ -30,7 +30,7 @@ public final class OracleOfNectars extends CardImpl { this.toughness = new MageInt(2); // {X}, {tap}: You gain X life. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java b/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java index c2b78462c6..6484e92303 100644 --- a/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java +++ b/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java @@ -33,7 +33,7 @@ public final class OverbeingOfMyth extends CardImpl { this.toughness = new MageInt(0); // Overbeing of Myth's power and toughness are each equal to the number of cards in your hand. - DynamicValue number = new CardsInControllerHandCount(); + DynamicValue number = CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(number, Duration.EndOfGame))); // At the beginning of your draw step, draw an additional card. diff --git a/Mage.Sets/src/mage/cards/o/Overrule.java b/Mage.Sets/src/mage/cards/o/Overrule.java index 19b922b846..5f92d8fd35 100644 --- a/Mage.Sets/src/mage/cards/o/Overrule.java +++ b/Mage.Sets/src/mage/cards/o/Overrule.java @@ -20,11 +20,11 @@ public final class Overrule extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}{U}"); // Counter target spell unless its controller pays {X}. - this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetSpell()); // You gain X life. - this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance)); } public Overrule(final Overrule card) { diff --git a/Mage.Sets/src/mage/cards/p/PainKami.java b/Mage.Sets/src/mage/cards/p/PainKami.java index f682910a9b..68c11d1153 100644 --- a/Mage.Sets/src/mage/cards/p/PainKami.java +++ b/Mage.Sets/src/mage/cards/p/PainKami.java @@ -28,7 +28,7 @@ public final class PainKami extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}{R}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/Painbringer.java b/Mage.Sets/src/mage/cards/p/Painbringer.java index 02af94d9bc..bc415a2ba1 100644 --- a/Mage.Sets/src/mage/cards/p/Painbringer.java +++ b/Mage.Sets/src/mage/cards/p/Painbringer.java @@ -35,7 +35,7 @@ public final class Painbringer extends CardImpl { this.toughness = new MageInt(1); // {tap}, Exile any number of cards from your graveyard: Target creature gets -X/-X until end of turn, where X is the number of cards exiled this way. - DynamicValue X = new SignInversionDynamicValue(new GetXValue()); + DynamicValue X = new SignInversionDynamicValue(GetXValue.instance); Effect effect = new BoostTargetEffect(X, X, Duration.EndOfTurn); effect.setText("Target creature gets -X/-X until end of turn, where X is the number of cards exiled this way"); Ability ability = new SimpleActivatedAbility(effect, new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/p/Panacea.java b/Mage.Sets/src/mage/cards/p/Panacea.java index 70de0178e6..099c2d61c0 100644 --- a/Mage.Sets/src/mage/cards/p/Panacea.java +++ b/Mage.Sets/src/mage/cards/p/Panacea.java @@ -25,7 +25,7 @@ public final class Panacea extends CardImpl { // {X}{X}, {tap}: Prevent the next X damage that would be dealt to any target this turn. Ability ability = new SimpleActivatedAbility( - new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue()), + new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, ManacostVariableValue.instance), new ManaCostsImpl("{X}{X}") ); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java b/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java index 4d87ffe984..84b1f2598e 100644 --- a/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java +++ b/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java @@ -34,7 +34,7 @@ public final class PeemaAetherSeer extends CardImpl { this.toughness = new MageInt(2); // When Peema Aether-Seer enters the battlefield, you get an amount of {E} equal to the greatest power among creatures you control. - Effect effect = new GetEnergyCountersControllerEffect(new GreatestPowerAmongControlledCreaturesValue()); + Effect effect = new GetEnergyCountersControllerEffect(GreatestPowerAmongControlledCreaturesValue.instance); effect.setText("you get an amount of {E} equal to the greatest power among creatures you control"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); diff --git a/Mage.Sets/src/mage/cards/p/PetalmaneBaku.java b/Mage.Sets/src/mage/cards/p/PetalmaneBaku.java index 85812a645e..167b6d2ba1 100644 --- a/Mage.Sets/src/mage/cards/p/PetalmaneBaku.java +++ b/Mage.Sets/src/mage/cards/p/PetalmaneBaku.java @@ -37,7 +37,7 @@ public final class PetalmaneBaku extends CardImpl { // {1}, Remove X ki counters from Petalmane Baku: Add X mana of any one color. Ability ability = new DynamicManaAbility( new Mana(0, 0, 0, 0, 0, 0, 1, 0), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new ManaCostsImpl<>("{1}"), "Add X mana of any one color", true, new CountersSourceCount(CounterType.KI)); diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianSwarmlord.java b/Mage.Sets/src/mage/cards/p/PhyrexianSwarmlord.java index 4f2f1f4e2d..3dd4288d02 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianSwarmlord.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianSwarmlord.java @@ -30,7 +30,7 @@ public final class PhyrexianSwarmlord extends CardImpl { this.addAbility(InfectAbility.getInstance()); this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", - new CreateTokenEffect(new InsectInfectToken(), new OpponentsPoisonCountersCount()))); + new CreateTokenEffect(new InsectInfectToken(), OpponentsPoisonCountersCount.instance))); } public PhyrexianSwarmlord(final PhyrexianSwarmlord card) { diff --git a/Mage.Sets/src/mage/cards/p/PresenceOfTheWise.java b/Mage.Sets/src/mage/cards/p/PresenceOfTheWise.java index 0129a82eb5..7c7037e939 100644 --- a/Mage.Sets/src/mage/cards/p/PresenceOfTheWise.java +++ b/Mage.Sets/src/mage/cards/p/PresenceOfTheWise.java @@ -20,7 +20,7 @@ public final class PresenceOfTheWise extends CardImpl { // You gain 2 life for each card in your hand. this.getSpellAbility().addEffect(new GainLifeEffect( - new MultipliedValue(new CardsInControllerHandCount(), 2),"You gain 2 life for each card in your hand")); + new MultipliedValue(CardsInControllerHandCount.instance, 2),"You gain 2 life for each card in your hand")); } public PresenceOfTheWise(final PresenceOfTheWise card) { diff --git a/Mage.Sets/src/mage/cards/p/ProfaneCommand.java b/Mage.Sets/src/mage/cards/p/ProfaneCommand.java index 769dbf2bbf..9e9b5172f9 100644 --- a/Mage.Sets/src/mage/cards/p/ProfaneCommand.java +++ b/Mage.Sets/src/mage/cards/p/ProfaneCommand.java @@ -38,7 +38,7 @@ public final class ProfaneCommand extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); diff --git a/Mage.Sets/src/mage/cards/p/Prosperity.java b/Mage.Sets/src/mage/cards/p/Prosperity.java index edb928d7bc..17d84d0b32 100644 --- a/Mage.Sets/src/mage/cards/p/Prosperity.java +++ b/Mage.Sets/src/mage/cards/p/Prosperity.java @@ -19,7 +19,7 @@ public final class Prosperity extends CardImpl { // Each player draws X cards. - this.getSpellAbility().addEffect(new DrawCardAllEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardAllEffect(ManacostVariableValue.instance)); } public Prosperity(final Prosperity card) { diff --git a/Mage.Sets/src/mage/cards/p/ProsshSkyraiderOfKher.java b/Mage.Sets/src/mage/cards/p/ProsshSkyraiderOfKher.java index 3b3e48838b..bc9badb09f 100644 --- a/Mage.Sets/src/mage/cards/p/ProsshSkyraiderOfKher.java +++ b/Mage.Sets/src/mage/cards/p/ProsshSkyraiderOfKher.java @@ -38,7 +38,7 @@ public final class ProsshSkyraiderOfKher extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When you cast Prossh, Skyraider of Kher, create X 0/1 red Kobold creature tokens named Kobolds of Kher Keep, where X is the amount of mana spent to cast Prossh. - this.addAbility(new CastSourceTriggeredAbility(new CreateTokenEffect(new ProsshKoboldToken(), new ManaSpentToCastCount()), false)); + this.addAbility(new CastSourceTriggeredAbility(new CreateTokenEffect(new ProsshKoboldToken(), ManaSpentToCastCount.instance), false)); // Sacrifice another creature: Prossh gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, true)))); diff --git a/Mage.Sets/src/mage/cards/p/PsychicDrain.java b/Mage.Sets/src/mage/cards/p/PsychicDrain.java index 6deb03654b..8008a2e7fb 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicDrain.java +++ b/Mage.Sets/src/mage/cards/p/PsychicDrain.java @@ -21,9 +21,9 @@ public final class PsychicDrain extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{B}"); // Target player puts the top X cards of their library into their graveyard and you gain X life. - this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); - Effect effect = new GainLifeEffect(new ManacostVariableValue()); + Effect effect = new GainLifeEffect(ManacostVariableValue.instance); effect.setText("and you gain X life"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java b/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java index 9df5371fa9..74128f25f3 100644 --- a/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java +++ b/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java @@ -28,7 +28,7 @@ public final class PsychosisCrawler extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); this.addAbility(new DrawCardControllerTriggeredAbility(new LoseLifeOpponentsEffect(1), false)); } diff --git a/Mage.Sets/src/mage/cards/p/PullFromTomorrow.java b/Mage.Sets/src/mage/cards/p/PullFromTomorrow.java index 2a2760fdeb..bc19074670 100644 --- a/Mage.Sets/src/mage/cards/p/PullFromTomorrow.java +++ b/Mage.Sets/src/mage/cards/p/PullFromTomorrow.java @@ -20,7 +20,7 @@ public final class PullFromTomorrow extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}"); // Draw X cards, then discard a card. - getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue())); + getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.instance)); Effect effect = new DiscardControllerEffect(1); effect.setText(", then discard a card"); getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/p/Pyromancy.java b/Mage.Sets/src/mage/cards/p/Pyromancy.java index b1d4d0a3cf..4cc770be5a 100644 --- a/Mage.Sets/src/mage/cards/p/Pyromancy.java +++ b/Mage.Sets/src/mage/cards/p/Pyromancy.java @@ -25,7 +25,7 @@ public final class Pyromancy extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{R}"); // {3}, Discard a card at random: Pyromancy deals damage to any target equal to the converted mana cost of the discarded card. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new DiscardCostCardConvertedMana()), new ManaCostsImpl("{3}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(DiscardCostCardConvertedMana.instance), new ManaCostsImpl("{3}")); ability.addTarget(new TargetAnyTarget()); ability.addCost(new DiscardCardCost(true)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/q/QuagVampires.java b/Mage.Sets/src/mage/cards/q/QuagVampires.java index 4cd03cf178..ebea154499 100644 --- a/Mage.Sets/src/mage/cards/q/QuagVampires.java +++ b/Mage.Sets/src/mage/cards/q/QuagVampires.java @@ -36,7 +36,7 @@ public final class QuagVampires extends CardImpl { // Quag Vampires enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true), "with a +1/+1 counter on it for each time it was kicked")); } diff --git a/Mage.Sets/src/mage/cards/r/RakdossReturn.java b/Mage.Sets/src/mage/cards/r/RakdossReturn.java index 5d9276caf3..a24d77837e 100644 --- a/Mage.Sets/src/mage/cards/r/RakdossReturn.java +++ b/Mage.Sets/src/mage/cards/r/RakdossReturn.java @@ -28,7 +28,7 @@ public final class RakdossReturn extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{R}"); // Rakdos's Return deals X damage to target opponent or planeswalker. That player or that planeswalker’s controller discards X cards. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addEffect(new RakdossReturnEffect()); this.getSpellAbility().addTarget(new TargetOpponentOrPlaneswalker()); } @@ -65,7 +65,7 @@ class RakdossReturnEffect extends OneShotEffect { if (player == null) { return false; } - Effect effect = new DiscardTargetEffect(new ManacostVariableValue()); + Effect effect = new DiscardTargetEffect(ManacostVariableValue.instance); effect.setTargetPointer(new FixedTarget(player.getId(), game)); return effect.apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/r/RalsStaticaster.java b/Mage.Sets/src/mage/cards/r/RalsStaticaster.java index d5b83f2540..87de152208 100644 --- a/Mage.Sets/src/mage/cards/r/RalsStaticaster.java +++ b/Mage.Sets/src/mage/cards/r/RalsStaticaster.java @@ -48,7 +48,7 @@ public final class RalsStaticaster extends CardImpl { // Whenever Ral's Staticaster attacks, if you control a Ral planeswalker, Ral's Staticaster gets +1/+0 for each card in your hand until end of turn. this.addAbility(new ConditionalInterveningIfTriggeredAbility( new AttacksTriggeredAbility(new BoostSourceEffect( - new CardsInControllerHandCount(), new StaticValue(0), + CardsInControllerHandCount.instance, new StaticValue(0), Duration.EndOfTurn, true), false), new PermanentsOnTheBattlefieldCondition(filter), "Whenever {this} attacks, if you control a Ral planeswalker, " diff --git a/Mage.Sets/src/mage/cards/r/RashidaScalebane.java b/Mage.Sets/src/mage/cards/r/RashidaScalebane.java index 2e69046533..af3c5daf3d 100644 --- a/Mage.Sets/src/mage/cards/r/RashidaScalebane.java +++ b/Mage.Sets/src/mage/cards/r/RashidaScalebane.java @@ -46,7 +46,7 @@ public final class RashidaScalebane extends CardImpl { // {tap}: Destroy target attacking or blocking Dragon. It can't be regenerated. You gain life equal to its power. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost()); - Effect effect = new GainLifeEffect(new TargetPermanentPowerCount()); + Effect effect = new GainLifeEffect(TargetPermanentPowerCount.instance); effect.setText("You gain life equal to its power"); ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/r/RavagingBlaze.java b/Mage.Sets/src/mage/cards/r/RavagingBlaze.java index 6a85da0180..4b8f4e7f45 100644 --- a/Mage.Sets/src/mage/cards/r/RavagingBlaze.java +++ b/Mage.Sets/src/mage/cards/r/RavagingBlaze.java @@ -22,10 +22,10 @@ public final class RavagingBlaze extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{R}{R}"); // Ravaging Blaze deals X damage to target creature. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetControllerEffect(new ManacostVariableValue()), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetControllerEffect(ManacostVariableValue.instance), SpellMasteryCondition.instance, "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.")); } diff --git a/Mage.Sets/src/mage/cards/r/RealmSeekers.java b/Mage.Sets/src/mage/cards/r/RealmSeekers.java index 283fff9287..5ac43f2142 100644 --- a/Mage.Sets/src/mage/cards/r/RealmSeekers.java +++ b/Mage.Sets/src/mage/cards/r/RealmSeekers.java @@ -37,7 +37,7 @@ public final class RealmSeekers extends CardImpl { this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect( CounterType.P1P1.createInstance(), - new CardsInAllHandsCount(), + CardsInAllHandsCount.instance, false), "with X +1/+1 counters on it, where X is the total number of cards in all players' hands")); diff --git a/Mage.Sets/src/mage/cards/r/Reanimate.java b/Mage.Sets/src/mage/cards/r/Reanimate.java index 3a70eaa36e..d91e2ad3e4 100644 --- a/Mage.Sets/src/mage/cards/r/Reanimate.java +++ b/Mage.Sets/src/mage/cards/r/Reanimate.java @@ -25,7 +25,7 @@ public final class Reanimate extends CardImpl { // Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost. getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - Effect effect = new LoseLifeSourceControllerEffect(new TargetConvertedManaCost()); + Effect effect = new LoseLifeSourceControllerEffect(TargetConvertedManaCost.instance); effect.setText("You lose life equal to its converted mana cost"); getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/r/RedManaBattery.java b/Mage.Sets/src/mage/cards/r/RedManaBattery.java index 461a4664e3..1281c0d257 100644 --- a/Mage.Sets/src/mage/cards/r/RedManaBattery.java +++ b/Mage.Sets/src/mage/cards/r/RedManaBattery.java @@ -36,7 +36,7 @@ public final class RedManaBattery extends CardImpl { // {tap}, Remove any number of charge counters from Red Mana Battery: Add {R}, then add an additional {R} for each charge counter removed this way. ability = new DynamicManaAbility( Mana.RedMana(1), - new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance), new TapSourceCost(), "Add {R}, then add {R} for each charge counter removed this way", true, new CountersSourceCount(CounterType.CHARGE)); diff --git a/Mage.Sets/src/mage/cards/r/RedSunsZenith.java b/Mage.Sets/src/mage/cards/r/RedSunsZenith.java index a95deffc58..9d39917e0c 100644 --- a/Mage.Sets/src/mage/cards/r/RedSunsZenith.java +++ b/Mage.Sets/src/mage/cards/r/RedSunsZenith.java @@ -26,7 +26,7 @@ public final class RedSunsZenith extends CardImpl { // If a creature dealt damage this way would die this turn, exile it instead. // Shuffle Red Sun's Zenith into its owner's library. this.getSpellAbility().addTarget(new TargetAnyTarget()); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); this.getSpellAbility().addWatcher(new DamagedByWatcher()); diff --git a/Mage.Sets/src/mage/cards/r/ReleaseTheGremlins.java b/Mage.Sets/src/mage/cards/r/ReleaseTheGremlins.java index a176fbb338..eee1db1427 100644 --- a/Mage.Sets/src/mage/cards/r/ReleaseTheGremlins.java +++ b/Mage.Sets/src/mage/cards/r/ReleaseTheGremlins.java @@ -28,7 +28,7 @@ public final class ReleaseTheGremlins extends CardImpl { this.getSpellAbility().addTarget(new TargetArtifactPermanent()); // Create X 2/2 red Gremlin creature tokens. - this.getSpellAbility().addEffect(new CreateTokenEffect(new GremlinToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new GremlinToken(), ManacostVariableValue.instance)); this.getSpellAbility().setTargetAdjuster(ReleaseTheGremlinsAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/r/RetributionOfTheAncients.java b/Mage.Sets/src/mage/cards/r/RetributionOfTheAncients.java index ce921ada40..42aab39e6f 100644 --- a/Mage.Sets/src/mage/cards/r/RetributionOfTheAncients.java +++ b/Mage.Sets/src/mage/cards/r/RetributionOfTheAncients.java @@ -36,7 +36,7 @@ public final class RetributionOfTheAncients extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}"); - DynamicValue xValue = new SignInversionDynamicValue(new GetXValue()); + DynamicValue xValue = new SignInversionDynamicValue(GetXValue.instance); // {B}, Remove X +1/+1 counters from among creatures you control: Target creature gets -X/-X until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(xValue,xValue,Duration.EndOfTurn, true), new ManaCostsImpl("{B}")); ability.addCost(new RemoveVariableCountersTargetCost(filter, CounterType.P1P1, "X", 0)); diff --git a/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java b/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java index 35ff9c2d52..4dd55e8cdc 100644 --- a/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java +++ b/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java @@ -19,7 +19,7 @@ public final class RishkarsExpertise extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); // Draw cards equal to the greatest power among creatures you control. - Effect effect = new DrawCardSourceControllerEffect(new GreatestPowerAmongControlledCreaturesValue()); + Effect effect = new DrawCardSourceControllerEffect(GreatestPowerAmongControlledCreaturesValue.instance); effect.setText("Draw cards equal to the greatest power among creatures you control"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/r/RockSlide.java b/Mage.Sets/src/mage/cards/r/RockSlide.java index c0ab560071..fe4a7869d9 100644 --- a/Mage.Sets/src/mage/cards/r/RockSlide.java +++ b/Mage.Sets/src/mage/cards/r/RockSlide.java @@ -36,7 +36,7 @@ public final class RockSlide extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}"); // Rock Slide deals X damage divided as you choose among any number of target attacking or blocking creatures without flying. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue, filter)); } diff --git a/Mage.Sets/src/mage/cards/r/RollingEarthquake.java b/Mage.Sets/src/mage/cards/r/RollingEarthquake.java index 005778c3c5..5e201d5140 100644 --- a/Mage.Sets/src/mage/cards/r/RollingEarthquake.java +++ b/Mage.Sets/src/mage/cards/r/RollingEarthquake.java @@ -29,7 +29,7 @@ public final class RollingEarthquake extends CardImpl { // Rolling Earthquake deals X damage to each creature without horsemanship and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageEverythingEffect(ManacostVariableValue.instance, filter)); } public RollingEarthquake(final RollingEarthquake card) { diff --git a/Mage.Sets/src/mage/cards/r/RollingThunder.java b/Mage.Sets/src/mage/cards/r/RollingThunder.java index b4b7e696ff..696e3ed0f6 100644 --- a/Mage.Sets/src/mage/cards/r/RollingThunder.java +++ b/Mage.Sets/src/mage/cards/r/RollingThunder.java @@ -20,7 +20,7 @@ public final class RollingThunder extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}{R}"); // Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue)); } diff --git a/Mage.Sets/src/mage/cards/r/RotHulk.java b/Mage.Sets/src/mage/cards/r/RotHulk.java index 152f27ddca..81b82e5526 100644 --- a/Mage.Sets/src/mage/cards/r/RotHulk.java +++ b/Mage.Sets/src/mage/cards/r/RotHulk.java @@ -55,7 +55,7 @@ public final class RotHulk extends CardImpl { // up to X target Zombie cards from your graveyard // X is the number of opponents you have. ability.getTargets().clear(); - int numbTargets = new OpponentsCount().calculate(game, ability, null); + int numbTargets = OpponentsCount.instance.calculate(game, ability, null); ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, filterZombie)); } } diff --git a/Mage.Sets/src/mage/cards/r/RushOfBlood.java b/Mage.Sets/src/mage/cards/r/RushOfBlood.java index 3a1b06858c..09daee68f0 100644 --- a/Mage.Sets/src/mage/cards/r/RushOfBlood.java +++ b/Mage.Sets/src/mage/cards/r/RushOfBlood.java @@ -22,7 +22,7 @@ public final class RushOfBlood extends CardImpl { // Target creature gets +X/+0 until end of turn, where X is its power. - this.getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true)); + this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, new StaticValue(0), Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/r/RushwoodGrove.java b/Mage.Sets/src/mage/cards/r/RushwoodGrove.java index 670f8b8f6b..604f7383f5 100644 --- a/Mage.Sets/src/mage/cards/r/RushwoodGrove.java +++ b/Mage.Sets/src/mage/cards/r/RushwoodGrove.java @@ -34,7 +34,7 @@ public final class RushwoodGrove extends CardImpl { // {T}, Remove any number of storage counters from Rushwood Grove: Add {G} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.GreenMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {G} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java index dcecae03c6..159e756f99 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java +++ b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java @@ -43,7 +43,7 @@ public final class SageOfAncientLore extends CardImpl { this.secondSideCardClazz = mage.cards.w.WerewolfOfAncientHunger.class; // Sage of Ancient Lore's power and toughness are each equal to the number of cards in your hand. - DynamicValue xValue = new CardsInControllerHandCount(); + DynamicValue xValue = CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalContinuousEffect(new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame), new TransformedCondition(true), "{this}'s power and toughness are each equal to the total number of cards in your hand"))); diff --git a/Mage.Sets/src/mage/cards/s/SaltcrustedSteppe.java b/Mage.Sets/src/mage/cards/s/SaltcrustedSteppe.java index 8bc8e64d08..9b20de817d 100644 --- a/Mage.Sets/src/mage/cards/s/SaltcrustedSteppe.java +++ b/Mage.Sets/src/mage/cards/s/SaltcrustedSteppe.java @@ -36,7 +36,7 @@ public final class SaltcrustedSteppe extends CardImpl { this.addAbility(ability); // {1}, Remove X storage counters from Saltcrusted Steppe: Add X mana in any combination of {G} and/or {W}. ability = new SimpleManaAbility(Zone.BATTLEFIELD, - new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.G, ColoredManaSymbol.W), + new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.G, ColoredManaSymbol.W), new GenericManaCost(1)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SanctumOfTheSun.java b/Mage.Sets/src/mage/cards/s/SanctumOfTheSun.java index 46269e831e..0a8238c866 100644 --- a/Mage.Sets/src/mage/cards/s/SanctumOfTheSun.java +++ b/Mage.Sets/src/mage/cards/s/SanctumOfTheSun.java @@ -32,7 +32,7 @@ public final class SanctumOfTheSun extends CardImpl { new InfoEffect("(Transforms from Azor's Gateway.)")).setRuleAtTheTop(true)); // {T}: Add X mana of any one color, where X is your life total. - this.addAbility(new DynamicManaAbility(new Mana(0, 0, 0, 0, 0, 0, 1, 0), new ControllerLifeCount(), new TapSourceCost(), + this.addAbility(new DynamicManaAbility(new Mana(0, 0, 0, 0, 0, 0, 1, 0), ControllerLifeCount.instance, new TapSourceCost(), "Add X mana of any one color, where X is is your life total", true)); } diff --git a/Mage.Sets/src/mage/cards/s/SandSilos.java b/Mage.Sets/src/mage/cards/s/SandSilos.java index 360ca7ffc8..61b800e3bd 100644 --- a/Mage.Sets/src/mage/cards/s/SandSilos.java +++ b/Mage.Sets/src/mage/cards/s/SandSilos.java @@ -44,7 +44,7 @@ public final class SandSilos extends CardImpl { // {tap}, Remove any number of storage counters from Sand Silos: Add {U} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.BlueMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {U} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/s/SandsOfDelirium.java b/Mage.Sets/src/mage/cards/s/SandsOfDelirium.java index cbbb1c6011..f10c51c2bf 100644 --- a/Mage.Sets/src/mage/cards/s/SandsOfDelirium.java +++ b/Mage.Sets/src/mage/cards/s/SandsOfDelirium.java @@ -25,7 +25,7 @@ public final class SandsOfDelirium extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // {X}, {tap}: Target player puts the top X cards of their library into their graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(new ManacostVariableValue()), new VariableManaCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(ManacostVariableValue.instance), new VariableManaCost()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SaprazzanCove.java b/Mage.Sets/src/mage/cards/s/SaprazzanCove.java index 9f1c510d2a..5806b041e1 100644 --- a/Mage.Sets/src/mage/cards/s/SaprazzanCove.java +++ b/Mage.Sets/src/mage/cards/s/SaprazzanCove.java @@ -34,7 +34,7 @@ public final class SaprazzanCove extends CardImpl { // {tap}, Remove any number of storage counters from Saprazzan Cove: Add {U} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.BlueMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {U} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/s/SavageTwister.java b/Mage.Sets/src/mage/cards/s/SavageTwister.java index 26acebbd85..0b9090439b 100644 --- a/Mage.Sets/src/mage/cards/s/SavageTwister.java +++ b/Mage.Sets/src/mage/cards/s/SavageTwister.java @@ -20,7 +20,7 @@ public final class SavageTwister extends CardImpl { // Savage Twister deals X damage to each creature. - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, new FilterCreaturePermanent())); } public SavageTwister(final SavageTwister card) { diff --git a/Mage.Sets/src/mage/cards/s/ScavengingGhoul.java b/Mage.Sets/src/mage/cards/s/ScavengingGhoul.java index 103d57b360..d71e11b07b 100644 --- a/Mage.Sets/src/mage/cards/s/ScavengingGhoul.java +++ b/Mage.Sets/src/mage/cards/s/ScavengingGhoul.java @@ -32,7 +32,7 @@ public final class ScavengingGhoul extends CardImpl { // At the beginning of each end step, put a corpse counter on Scavenging Ghoul for each creature that died this turn. this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.CORPSE.createInstance(), - new CreaturesDiedThisTurnCount(), true), TargetController.ANY, false), new CreaturesDiedWatcher()); + CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false), new CreaturesDiedWatcher()); // Remove a corpse counter from Scavenging Ghoul: Regenerate Scavenging Ghoul. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new RemoveCountersSourceCost(CounterType.CORPSE.createInstance()))); diff --git a/Mage.Sets/src/mage/cards/s/SecureTheWastes.java b/Mage.Sets/src/mage/cards/s/SecureTheWastes.java index 8d8e83e675..2540f72bbe 100644 --- a/Mage.Sets/src/mage/cards/s/SecureTheWastes.java +++ b/Mage.Sets/src/mage/cards/s/SecureTheWastes.java @@ -19,7 +19,7 @@ public final class SecureTheWastes extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}"); // create X 1/1 white Warrior creature tokens. - this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), ManacostVariableValue.instance)); } public SecureTheWastes(final SecureTheWastes card) { diff --git a/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java b/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java index 7ef32df750..3516ba3642 100644 --- a/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java @@ -54,7 +54,7 @@ public final class SelvalaHeartOfTheWilds extends CardImpl { // {G}, {T}: Add X mana in any combination of colors, where X is the greatest power among creatures you control. ManaEffect manaEffect = new AddManaInAnyCombinationEffect( - new GreatestPowerAmongControlledCreaturesValue(), rule2, + GreatestPowerAmongControlledCreaturesValue.instance, rule2, ColoredManaSymbol.B, ColoredManaSymbol.U, ColoredManaSymbol.R, ColoredManaSymbol.W, ColoredManaSymbol.G); Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, manaEffect, new ManaCostsImpl("{G}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/s/SereneOffering.java b/Mage.Sets/src/mage/cards/s/SereneOffering.java index b8a0060a5a..09a48a3deb 100644 --- a/Mage.Sets/src/mage/cards/s/SereneOffering.java +++ b/Mage.Sets/src/mage/cards/s/SereneOffering.java @@ -22,7 +22,7 @@ public final class SereneOffering extends CardImpl { // Destroy target enchantment. You gain life equal to its converted mana cost. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - Effect effect = new GainLifeEffect(new TargetConvertedManaCost()); + Effect effect = new GainLifeEffect(TargetConvertedManaCost.instance); effect.setText("You gain life equal to its converted mana cost"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); diff --git a/Mage.Sets/src/mage/cards/s/SerraAvatar.java b/Mage.Sets/src/mage/cards/s/SerraAvatar.java index 49680a7cc6..9fb4458a34 100644 --- a/Mage.Sets/src/mage/cards/s/SerraAvatar.java +++ b/Mage.Sets/src/mage/cards/s/SerraAvatar.java @@ -29,7 +29,7 @@ public final class SerraAvatar extends CardImpl { this.toughness = new MageInt(0); // Serra Avatar's power and toughness are each equal to your life total. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new ControllerLifeCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(ControllerLifeCount.instance, Duration.EndOfGame))); // When Serra Avatar is put into a graveyard from anywhere, shuffle it into its owner's library. this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); diff --git a/Mage.Sets/src/mage/cards/s/SeveredStrands.java b/Mage.Sets/src/mage/cards/s/SeveredStrands.java index a0e7278361..523aedf125 100644 --- a/Mage.Sets/src/mage/cards/s/SeveredStrands.java +++ b/Mage.Sets/src/mage/cards/s/SeveredStrands.java @@ -26,7 +26,7 @@ public final class SeveredStrands extends CardImpl { // You gain life equal to the sacrificed creature's toughness. Destroy target creature an opponent controls. this.getSpellAbility().addEffect(new GainLifeEffect( - new SacrificeCostCreaturesToughness(), + SacrificeCostCreaturesToughness.instance, "You gain life equal to the " + "sacrificed creature's toughness." )); diff --git a/Mage.Sets/src/mage/cards/s/ShatteredCrypt.java b/Mage.Sets/src/mage/cards/s/ShatteredCrypt.java index 90425abc24..7ce9d8e152 100644 --- a/Mage.Sets/src/mage/cards/s/ShatteredCrypt.java +++ b/Mage.Sets/src/mage/cards/s/ShatteredCrypt.java @@ -29,7 +29,7 @@ public final class ShatteredCrypt extends CardImpl { Effect effect = new ReturnFromGraveyardToHandTargetEffect(); effect.setText("Return X target creature cards from your graveyard to your hand"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(ManacostVariableValue.instance)); this.getSpellAbility().setTargetAdjuster(ShatteredCryptAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/s/ShiningShoal.java b/Mage.Sets/src/mage/cards/s/ShiningShoal.java index 79ad6ea8bf..f4d8b7a908 100644 --- a/Mage.Sets/src/mage/cards/s/ShiningShoal.java +++ b/Mage.Sets/src/mage/cards/s/ShiningShoal.java @@ -44,7 +44,7 @@ public final class ShiningShoal extends CardImpl { this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true))); // The next X damage that a source of your choice would deal to you and/or creatures you control this turn is dealt to any target instead. - this.getSpellAbility().addEffect(new ShiningShoalRedirectDamageTargetEffect(Duration.EndOfTurn, new ExileFromHandCostCardConvertedMana())); + this.getSpellAbility().addEffect(new ShiningShoalRedirectDamageTargetEffect(Duration.EndOfTurn, ExileFromHandCostCardConvertedMana.instance)); this.getSpellAbility().addTarget(new TargetSource()); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/s/SickeningDreams.java b/Mage.Sets/src/mage/cards/s/SickeningDreams.java index ba51c25580..3a74c9e7ee 100644 --- a/Mage.Sets/src/mage/cards/s/SickeningDreams.java +++ b/Mage.Sets/src/mage/cards/s/SickeningDreams.java @@ -30,7 +30,7 @@ public final class SickeningDreams extends CardImpl { this.getSpellAbility().addCost(new SickeningDreamsAdditionalCost()); // Sickening Dreams deals X damage to each creature and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new GetXValue(), new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DamageEverythingEffect(GetXValue.instance, new FilterCreaturePermanent())); } public SickeningDreams(final SickeningDreams card) { diff --git a/Mage.Sets/src/mage/cards/s/SickeningShoal.java b/Mage.Sets/src/mage/cards/s/SickeningShoal.java index 32b4fb3587..5bec8f2fe7 100644 --- a/Mage.Sets/src/mage/cards/s/SickeningShoal.java +++ b/Mage.Sets/src/mage/cards/s/SickeningShoal.java @@ -40,7 +40,7 @@ public final class SickeningShoal extends CardImpl { this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true))); // Target creature gets -X/-X until end of turn. - DynamicValue x = new SignInversionDynamicValue(new ExileFromHandCostCardConvertedMana()); + DynamicValue x = new SignInversionDynamicValue(ExileFromHandCostCardConvertedMana.instance); this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/s/SilklashSpider.java b/Mage.Sets/src/mage/cards/s/SilklashSpider.java index 0cd6ebd135..05b44bcf58 100644 --- a/Mage.Sets/src/mage/cards/s/SilklashSpider.java +++ b/Mage.Sets/src/mage/cards/s/SilklashSpider.java @@ -40,7 +40,7 @@ public final class SilklashSpider extends CardImpl { this.addAbility(ReachAbility.getInstance()); // {X}{G}{G}: Silklash Spider deals X damage to each creature with flying. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new DamageAllEffect(new ManacostVariableValue(), filter), + new DamageAllEffect(ManacostVariableValue.instance, filter), new ManaCostsImpl("{X}{G}{G}"))); } diff --git a/Mage.Sets/src/mage/cards/s/SkeletalScrying.java b/Mage.Sets/src/mage/cards/s/SkeletalScrying.java index 712f565e93..558d631939 100644 --- a/Mage.Sets/src/mage/cards/s/SkeletalScrying.java +++ b/Mage.Sets/src/mage/cards/s/SkeletalScrying.java @@ -34,7 +34,7 @@ public final class SkeletalScrying extends CardImpl { ability.setRuleAtTheTop(true); this.addAbility(ability); // You draw X cards and you lose X life. - this.getSpellAbility().addEffect(new SkeletalScryingEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new SkeletalScryingEffect(ManacostVariableValue.instance)); } diff --git a/Mage.Sets/src/mage/cards/s/SkitterOfLizards.java b/Mage.Sets/src/mage/cards/s/SkitterOfLizards.java index 95353e03aa..b4a9f5a524 100644 --- a/Mage.Sets/src/mage/cards/s/SkitterOfLizards.java +++ b/Mage.Sets/src/mage/cards/s/SkitterOfLizards.java @@ -35,7 +35,7 @@ public final class SkitterOfLizards extends CardImpl { // Skitter of Lizards enters the battlefield with a +1/+1 counter on it for each time it was kicked. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new MultikickerCount(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), MultikickerCount.instance, true), "with a +1/+1 counter on it for each time it was kicked")); } diff --git a/Mage.Sets/src/mage/cards/s/Skyscribing.java b/Mage.Sets/src/mage/cards/s/Skyscribing.java index eba3cb37bf..cf37f0c5c6 100644 --- a/Mage.Sets/src/mage/cards/s/Skyscribing.java +++ b/Mage.Sets/src/mage/cards/s/Skyscribing.java @@ -20,7 +20,7 @@ public final class Skyscribing extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}"); // Each player draws X cards. - this.getSpellAbility().addEffect(new DrawCardAllEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardAllEffect(ManacostVariableValue.instance)); // Forecast - {2}{U}, Reveal Skyscribing from your hand: Each player draws a card. this.addAbility(new ForecastAbility(new DrawCardAllEffect(1), new ManaCostsImpl("{2}{U}"))); } diff --git a/Mage.Sets/src/mage/cards/s/SnakeBasket.java b/Mage.Sets/src/mage/cards/s/SnakeBasket.java index 66862965c2..6cc0acd59d 100644 --- a/Mage.Sets/src/mage/cards/s/SnakeBasket.java +++ b/Mage.Sets/src/mage/cards/s/SnakeBasket.java @@ -25,7 +25,7 @@ public final class SnakeBasket extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); // {X}, Sacrifice Snake Basket: create X 1/1 green Snake creature tokens. Activate this ability only any time you could cast a sorcery. - Effect effect = new CreateTokenEffect(new SnakeToken(), new ManacostVariableValue()); + Effect effect = new CreateTokenEffect(new SnakeToken(), ManacostVariableValue.instance); Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SokenzanSpellblade.java b/Mage.Sets/src/mage/cards/s/SokenzanSpellblade.java index fda9d9d998..56e925fe0c 100644 --- a/Mage.Sets/src/mage/cards/s/SokenzanSpellblade.java +++ b/Mage.Sets/src/mage/cards/s/SokenzanSpellblade.java @@ -35,7 +35,7 @@ public final class SokenzanSpellblade extends CardImpl { // Bushido 1 this.addAbility(new BushidoAbility(1)); // {1}{R}: Sokenzan Spellblade gets +X/+0 until end of turn, where X is the number of cards in your hand. - Effect effect = new BoostSourceEffect(new CardsInControllerHandCount(), new StaticValue(0), Duration.EndOfTurn, true); + Effect effect = new BoostSourceEffect(CardsInControllerHandCount.instance, new StaticValue(0), Duration.EndOfTurn, true); effect.setText("{this} gets +X/+0 until end of turn, where X is the number of cards in your hand"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{R}") diff --git a/Mage.Sets/src/mage/cards/s/Soothsaying.java b/Mage.Sets/src/mage/cards/s/Soothsaying.java index fe88a0035c..2f67392f25 100644 --- a/Mage.Sets/src/mage/cards/s/Soothsaying.java +++ b/Mage.Sets/src/mage/cards/s/Soothsaying.java @@ -27,7 +27,7 @@ public final class Soothsaying extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShuffleLibrarySourceEffect(), new ManaCostsImpl<>("{3}{U}{U}"))); // {X}: Look at the top X cards of your library, then put them back in any order. - Effect effect = new LookLibraryControllerEffect(new ManacostVariableValue()); + Effect effect = new LookLibraryControllerEffect(ManacostVariableValue.instance); effect.setText("Look at the top X cards of your library, then put them back in any order"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("X"))); } diff --git a/Mage.Sets/src/mage/cards/s/SophicCentaur.java b/Mage.Sets/src/mage/cards/s/SophicCentaur.java index d28ffa11af..76ed6c4d03 100644 --- a/Mage.Sets/src/mage/cards/s/SophicCentaur.java +++ b/Mage.Sets/src/mage/cards/s/SophicCentaur.java @@ -33,7 +33,7 @@ public final class SophicCentaur extends CardImpl { this.toughness = new MageInt(1); // {2}{G}{G}, {tap}, Discard a card: You gain 2 life for each card in your hand. - DynamicValue lifeToGainAmount = new MultipliedValue(new CardsInControllerHandCount(), 2); + DynamicValue lifeToGainAmount = new MultipliedValue(CardsInControllerHandCount.instance, 2); Effect effect = new GainLifeEffect(lifeToGainAmount); effect.setText("You gain 2 life for each card in your hand"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}{G}")); diff --git a/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java b/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java index d197ae5806..62a0867b8b 100644 --- a/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java +++ b/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java @@ -39,7 +39,7 @@ public final class SoramaroFirstToDream extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Soramaro, First to Dream's power and toughness are each equal to the number of cards in your hand. - DynamicValue xValue= new CardsInControllerHandCount(); + DynamicValue xValue= CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // {4}, Return a land you control to its owner's hand: Draw a card. diff --git a/Mage.Sets/src/mage/cards/s/SoulStrings.java b/Mage.Sets/src/mage/cards/s/SoulStrings.java index 4dc5d88060..5ae9b10d29 100644 --- a/Mage.Sets/src/mage/cards/s/SoulStrings.java +++ b/Mage.Sets/src/mage/cards/s/SoulStrings.java @@ -23,7 +23,7 @@ public final class SoulStrings extends CardImpl { // Return two target creature cards from your graveyard to your hand unless any player pays {X}. Effect effect = new DoUnlessAnyPlayerPaysEffect( - new ReturnFromGraveyardToHandTargetEffect(), new ManacostVariableValue()); + new ReturnFromGraveyardToHandTargetEffect(), ManacostVariableValue.instance); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(2, new FilterCreatureCard("creature cards from your graveyard"))); } diff --git a/Mage.Sets/src/mage/cards/s/SpellContortion.java b/Mage.Sets/src/mage/cards/s/SpellContortion.java index aab49c9ab4..fd89cb7298 100644 --- a/Mage.Sets/src/mage/cards/s/SpellContortion.java +++ b/Mage.Sets/src/mage/cards/s/SpellContortion.java @@ -29,7 +29,7 @@ public final class SpellContortion extends CardImpl { // Counter target spell unless its controller pays {2}. Draw a card for each time Spell Contortion was kicked. this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(2))); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new MultikickerCount())); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(MultikickerCount.instance)); this.getSpellAbility().addTarget(new TargetSpell()); } diff --git a/Mage.Sets/src/mage/cards/s/SphinxsRevelation.java b/Mage.Sets/src/mage/cards/s/SphinxsRevelation.java index 4658f43450..9a982e8c06 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxsRevelation.java +++ b/Mage.Sets/src/mage/cards/s/SphinxsRevelation.java @@ -21,7 +21,7 @@ public final class SphinxsRevelation extends CardImpl { // You gain X life and draw X cards. - ManacostVariableValue manaX = new ManacostVariableValue(); + ManacostVariableValue manaX = ManacostVariableValue.instance; this.getSpellAbility().addEffect(new GainLifeEffect(manaX)); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(manaX)); } diff --git a/Mage.Sets/src/mage/cards/s/SpiralingEmbers.java b/Mage.Sets/src/mage/cards/s/SpiralingEmbers.java index 68696268ca..f6b5adc920 100644 --- a/Mage.Sets/src/mage/cards/s/SpiralingEmbers.java +++ b/Mage.Sets/src/mage/cards/s/SpiralingEmbers.java @@ -23,7 +23,7 @@ public final class SpiralingEmbers extends CardImpl { // Spiraling Embers deals damage to any target equal to the number of cards in your hand. - Effect effect = new DamageTargetEffect(new CardsInControllerHandCount()); + Effect effect = new DamageTargetEffect(CardsInControllerHandCount.instance); effect.setText("{this} deals damage to any target equal to the number of cards in your hand."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/s/SpontaneousGeneration.java b/Mage.Sets/src/mage/cards/s/SpontaneousGeneration.java index eab38e464e..6820a1e7dd 100644 --- a/Mage.Sets/src/mage/cards/s/SpontaneousGeneration.java +++ b/Mage.Sets/src/mage/cards/s/SpontaneousGeneration.java @@ -19,7 +19,7 @@ public final class SpontaneousGeneration extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); // Create a 1/1 green Saproling creature token for each card in your hand. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new CardsInControllerHandCount())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), CardsInControllerHandCount.instance)); } public SpontaneousGeneration(final SpontaneousGeneration card) { diff --git a/Mage.Sets/src/mage/cards/s/SpringjackPasture.java b/Mage.Sets/src/mage/cards/s/SpringjackPasture.java index c5f7f6a91a..d4ba3405d7 100644 --- a/Mage.Sets/src/mage/cards/s/SpringjackPasture.java +++ b/Mage.Sets/src/mage/cards/s/SpringjackPasture.java @@ -49,12 +49,12 @@ public final class SpringjackPasture extends CardImpl { // {tap}, Sacrifice X Goats: Add X mana of any one color. You gain X life. ability = new DynamicManaAbility( new Mana(0,0,0,0,0,0,1,0), - new GetXValue(), + GetXValue.instance, new TapSourceCost(), "Add X mana of any one color", true); ability.addCost(new SacrificeXTargetCost(filter)); - ability.addEffect(new GainLifeEffect(new GetXValue())); + ability.addEffect(new GainLifeEffect(GetXValue.instance)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SquallLine.java b/Mage.Sets/src/mage/cards/s/SquallLine.java index b2b8c82201..37e98c9e64 100644 --- a/Mage.Sets/src/mage/cards/s/SquallLine.java +++ b/Mage.Sets/src/mage/cards/s/SquallLine.java @@ -27,7 +27,7 @@ public final class SquallLine extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{G}{G}"); // Squall Line deals X damage to each creature with flying and each player. - this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } + this.getSpellAbility().addEffect(new DamageEverythingEffect(ManacostVariableValue.instance, filter)); } public SquallLine(final SquallLine card) { super(card); diff --git a/Mage.Sets/src/mage/cards/s/Starstorm.java b/Mage.Sets/src/mage/cards/s/Starstorm.java index 1d74ac89d2..bdf7d1c097 100644 --- a/Mage.Sets/src/mage/cards/s/Starstorm.java +++ b/Mage.Sets/src/mage/cards/s/Starstorm.java @@ -22,7 +22,7 @@ public final class Starstorm extends CardImpl { // Starstorm deals X damage to each creature. - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, new FilterCreaturePermanent())); // Cycling {3} this.addAbility(new CyclingAbility(new ManaCostsImpl("{3}"))); } diff --git a/Mage.Sets/src/mage/cards/s/StormHerd.java b/Mage.Sets/src/mage/cards/s/StormHerd.java index 9ba7cb1bc3..c2fac4e69c 100644 --- a/Mage.Sets/src/mage/cards/s/StormHerd.java +++ b/Mage.Sets/src/mage/cards/s/StormHerd.java @@ -19,7 +19,7 @@ public final class StormHerd extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{8}{W}{W}"); // create X 1/1 white Pegasus creature tokens with flying, where X is your life total. - this.getSpellAbility().addEffect(new CreateTokenEffect(new PegasusToken(), new ControllerLifeCount())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new PegasusToken(), ControllerLifeCount.instance)); } public StormHerd(final StormHerd card) { diff --git a/Mage.Sets/src/mage/cards/s/StormSeeker.java b/Mage.Sets/src/mage/cards/s/StormSeeker.java index 63460d878c..173b24552c 100644 --- a/Mage.Sets/src/mage/cards/s/StormSeeker.java +++ b/Mage.Sets/src/mage/cards/s/StormSeeker.java @@ -20,7 +20,7 @@ public final class StormSeeker extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}"); // Storm Seeker deals damage to target player equal to the number of cards in that player's hand. - Effect effect = new DamageTargetEffect(new CardsInTargetHandCount()); + Effect effect = new DamageTargetEffect(CardsInTargetHandCount.instance); effect.setText("{this} deals damage to target player equal to the number of cards in that player's hand."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/s/StreamOfLife.java b/Mage.Sets/src/mage/cards/s/StreamOfLife.java index 97e91d04b3..51924a217b 100644 --- a/Mage.Sets/src/mage/cards/s/StreamOfLife.java +++ b/Mage.Sets/src/mage/cards/s/StreamOfLife.java @@ -20,7 +20,7 @@ public final class StreamOfLife extends CardImpl { // Target player gains X life. - this.getSpellAbility().addEffect(new GainLifeTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new GainLifeTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/s/StreetSpasm.java b/Mage.Sets/src/mage/cards/s/StreetSpasm.java index fa0f2d43e8..e10d340862 100644 --- a/Mage.Sets/src/mage/cards/s/StreetSpasm.java +++ b/Mage.Sets/src/mage/cards/s/StreetSpasm.java @@ -37,10 +37,10 @@ public final class StreetSpasm extends CardImpl { // Street Spasm deals X damage to target creature without flying you don't control. this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); // Overload {X}{X}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - this.addAbility(new OverloadAbility(this, new DamageAllEffect(new ManacostVariableValue(), filter), new ManaCostsImpl("{X}{X}{R}{R}"))); + this.addAbility(new OverloadAbility(this, new DamageAllEffect(ManacostVariableValue.instance, filter), new ManaCostsImpl("{X}{X}{R}{R}"))); } public StreetSpasm(final StreetSpasm card) { diff --git a/Mage.Sets/src/mage/cards/s/StrengthOfTheTajuru.java b/Mage.Sets/src/mage/cards/s/StrengthOfTheTajuru.java index 48f0586a2b..73a007d69f 100644 --- a/Mage.Sets/src/mage/cards/s/StrengthOfTheTajuru.java +++ b/Mage.Sets/src/mage/cards/s/StrengthOfTheTajuru.java @@ -49,7 +49,7 @@ enum StrengthOfTheTajuruAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); - int numbTargets = new MultikickerCount().calculate(game, ability, null) + 1; + int numbTargets = MultikickerCount.instance.calculate(game, ability, null) + 1; ability.addTarget(new TargetCreaturePermanent(0, numbTargets)); } } diff --git a/Mage.Sets/src/mage/cards/s/StrokeOfGenius.java b/Mage.Sets/src/mage/cards/s/StrokeOfGenius.java index f9d0145f2c..8effb65627 100644 --- a/Mage.Sets/src/mage/cards/s/StrokeOfGenius.java +++ b/Mage.Sets/src/mage/cards/s/StrokeOfGenius.java @@ -21,7 +21,7 @@ public final class StrokeOfGenius extends CardImpl { // Target player draws X cards. - this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/s/Sturmgeist.java b/Mage.Sets/src/mage/cards/s/Sturmgeist.java index 6bc161a0d4..f21efdda14 100644 --- a/Mage.Sets/src/mage/cards/s/Sturmgeist.java +++ b/Mage.Sets/src/mage/cards/s/Sturmgeist.java @@ -31,7 +31,7 @@ public final class Sturmgeist extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Sturmgeist's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); // Whenever Sturmgeist deals combat damage to a player, draw a card. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); } diff --git a/Mage.Sets/src/mage/cards/s/Subdue.java b/Mage.Sets/src/mage/cards/s/Subdue.java index 63ac77351e..970e3df788 100644 --- a/Mage.Sets/src/mage/cards/s/Subdue.java +++ b/Mage.Sets/src/mage/cards/s/Subdue.java @@ -24,7 +24,7 @@ public final class Subdue extends CardImpl { // Prevent all combat damage that would be dealt by target creature this turn. That creature gets +0/+X until end of turn, where X is its converted mana cost. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true)); - this.getSpellAbility().addEffect(new BoostTargetEffect(new StaticValue(0), new TargetConvertedManaCost(), Duration.EndOfTurn, true) + this.getSpellAbility().addEffect(new BoostTargetEffect(new StaticValue(0), TargetConvertedManaCost.instance, Duration.EndOfTurn, true) .setText("That creature gets +0/+X until end of turn, where X is its converted mana cost")); } diff --git a/Mage.Sets/src/mage/cards/s/SubterraneanHangar.java b/Mage.Sets/src/mage/cards/s/SubterraneanHangar.java index 9676c73977..9ddc675a34 100644 --- a/Mage.Sets/src/mage/cards/s/SubterraneanHangar.java +++ b/Mage.Sets/src/mage/cards/s/SubterraneanHangar.java @@ -34,7 +34,7 @@ public final class SubterraneanHangar extends CardImpl { // {tap}, Remove any number of storage counters from Subterranean Hangar: Add {B} for each storage counter removed this way. Ability ability = new DynamicManaAbility( Mana.BlackMana(1), - new RemovedCountersForCostValue(), + RemovedCountersForCostValue.instance, new TapSourceCost(), "Add {B} for each storage counter removed this way", true, new CountersSourceCount(CounterType.STORAGE)); diff --git a/Mage.Sets/src/mage/cards/s/SuddenImpact.java b/Mage.Sets/src/mage/cards/s/SuddenImpact.java index b3affd2363..6f889719a2 100644 --- a/Mage.Sets/src/mage/cards/s/SuddenImpact.java +++ b/Mage.Sets/src/mage/cards/s/SuddenImpact.java @@ -21,7 +21,7 @@ public final class SuddenImpact extends CardImpl { // Sudden Impact deals damage to target player equal to the number of cards in that player's hand. - Effect effect = new DamageTargetEffect(new CardsInTargetHandCount()); + Effect effect = new DamageTargetEffect(CardsInTargetHandCount.instance); effect.setText("{this} deals damage to target player equal to the number of cards in that player's hand."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/s/SunbringersTouch.java b/Mage.Sets/src/mage/cards/s/SunbringersTouch.java index d1a1104cd4..1cca7cfa8c 100644 --- a/Mage.Sets/src/mage/cards/s/SunbringersTouch.java +++ b/Mage.Sets/src/mage/cards/s/SunbringersTouch.java @@ -30,7 +30,7 @@ public final class SunbringersTouch extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}{G}"); // Bolster X, where X is the number of cards in your hand. - this.getSpellAbility().addEffect(new BolsterEffect(new CardsInControllerHandCount())); + this.getSpellAbility().addEffect(new BolsterEffect(CardsInControllerHandCount.instance)); // Each creature you control with a +1/+1 counter on it gains trample until end of turn. Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filter); diff --git a/Mage.Sets/src/mage/cards/s/SupplyDemand.java b/Mage.Sets/src/mage/cards/s/SupplyDemand.java index 8085fd8f4e..a9ca239a28 100644 --- a/Mage.Sets/src/mage/cards/s/SupplyDemand.java +++ b/Mage.Sets/src/mage/cards/s/SupplyDemand.java @@ -31,7 +31,7 @@ public final class SupplyDemand extends SplitCard { // Supply // create X 1/1 green Saproling creature tokens. - getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new ManacostVariableValue())); + getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), ManacostVariableValue.instance)); // Demand // Search your library for a multicolored card, reveal it, and put it into your hand. Then shuffle your library. diff --git a/Mage.Sets/src/mage/cards/s/SurgeOfStrength.java b/Mage.Sets/src/mage/cards/s/SurgeOfStrength.java index 7a9a5d7924..d71e125bb6 100644 --- a/Mage.Sets/src/mage/cards/s/SurgeOfStrength.java +++ b/Mage.Sets/src/mage/cards/s/SurgeOfStrength.java @@ -42,7 +42,7 @@ public final class SurgeOfStrength extends CardImpl { Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("Target creature gains trample"); this.getSpellAbility().addEffect(effect); - effect = new BoostTargetEffect(new TargetConvertedManaCost(), new StaticValue(0), Duration.EndOfTurn, true); + effect = new BoostTargetEffect(TargetConvertedManaCost.instance, new StaticValue(0), Duration.EndOfTurn, true); effect.setText("and gets +X/+0 until end of turn, where X is that creature's converted mana cost"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/s/SwallowingPlague.java b/Mage.Sets/src/mage/cards/s/SwallowingPlague.java index 9b17abee58..7392aca66b 100644 --- a/Mage.Sets/src/mage/cards/s/SwallowingPlague.java +++ b/Mage.Sets/src/mage/cards/s/SwallowingPlague.java @@ -23,8 +23,8 @@ public final class SwallowingPlague extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}{B}"); this.subtype.add(SubType.ARCANE); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); - this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); + this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/s/SwellOfCourage.java b/Mage.Sets/src/mage/cards/s/SwellOfCourage.java index 372a09d6c5..457048a651 100644 --- a/Mage.Sets/src/mage/cards/s/SwellOfCourage.java +++ b/Mage.Sets/src/mage/cards/s/SwellOfCourage.java @@ -24,7 +24,7 @@ public final class SwellOfCourage extends CardImpl { // Creatures you control get +2/+2 until end of turn. this.getSpellAbility().addEffect(new BoostControlledEffect(2,2, Duration.EndOfTurn)); // Reinforce X-{X}{W}{W} - this.addAbility(new ReinforceAbility(new ManacostVariableValue(), new ManaCostsImpl("{X}{W}{W}"))); + this.addAbility(new ReinforceAbility(ManacostVariableValue.instance, new ManaCostsImpl("{X}{W}{W}"))); } public SwellOfCourage(final SwellOfCourage card) { diff --git a/Mage.Sets/src/mage/cards/s/SwordOfWarAndPeace.java b/Mage.Sets/src/mage/cards/s/SwordOfWarAndPeace.java index d003579100..9968d14771 100644 --- a/Mage.Sets/src/mage/cards/s/SwordOfWarAndPeace.java +++ b/Mage.Sets/src/mage/cards/s/SwordOfWarAndPeace.java @@ -69,7 +69,7 @@ class SwordOfWarAndPeaceAbility extends TriggeredAbilityImpl { public SwordOfWarAndPeaceAbility() { super(Zone.BATTLEFIELD, new SwordOfWarAndPeaceDamageEffect()); - this.addEffect(new GainLifeEffect(new CardsInControllerHandCount())); + this.addEffect(new GainLifeEffect(CardsInControllerHandCount.instance)); } public SwordOfWarAndPeaceAbility(final SwordOfWarAndPeaceAbility ability) { diff --git a/Mage.Sets/src/mage/cards/s/SylvanYeti.java b/Mage.Sets/src/mage/cards/s/SylvanYeti.java index 688718f865..d402b7450b 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanYeti.java +++ b/Mage.Sets/src/mage/cards/s/SylvanYeti.java @@ -27,7 +27,7 @@ public final class SylvanYeti extends CardImpl { this.toughness = new MageInt(4); // Sylvan Yeti's power is equal to the number of cards in your hand. - Effect effect = new SetPowerSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame); + Effect effect = new SetPowerSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); } diff --git a/Mage.Sets/src/mage/cards/t/TalonOfPain.java b/Mage.Sets/src/mage/cards/t/TalonOfPain.java index 0558c9b933..b6fa0d3724 100644 --- a/Mage.Sets/src/mage/cards/t/TalonOfPain.java +++ b/Mage.Sets/src/mage/cards/t/TalonOfPain.java @@ -42,7 +42,7 @@ public final class TalonOfPain extends CardImpl { this.addAbility(new TalonOfPainTriggeredAbility()); // {X}, {T}, Remove X charge counters from Talon of Pain: Talon of Pain deals X damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.instance), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addCost(new TalonOfPainRemoveVariableCountersSourceCost(CounterType.CHARGE.createInstance())); ability.addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/t/TectonicBreak.java b/Mage.Sets/src/mage/cards/t/TectonicBreak.java index c8c47de18c..14bd9c3565 100644 --- a/Mage.Sets/src/mage/cards/t/TectonicBreak.java +++ b/Mage.Sets/src/mage/cards/t/TectonicBreak.java @@ -19,7 +19,7 @@ public final class TectonicBreak extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}{R}"); // Each player sacrifices X lands. - this.getSpellAbility().addEffect(new SacrificeAllEffect(new ManacostVariableValue(), new FilterControlledLandPermanent("lands"))); + this.getSpellAbility().addEffect(new SacrificeAllEffect(ManacostVariableValue.instance, new FilterControlledLandPermanent("lands"))); } public TectonicBreak(final TectonicBreak card) { diff --git a/Mage.Sets/src/mage/cards/t/Temper.java b/Mage.Sets/src/mage/cards/t/Temper.java index 602872e085..b0bdd776b1 100644 --- a/Mage.Sets/src/mage/cards/t/Temper.java +++ b/Mage.Sets/src/mage/cards/t/Temper.java @@ -26,7 +26,7 @@ public final class Temper extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{1}{W}"); // Prevent the next X damage that would be dealt to target creature this turn. For each 1 damage prevented this way, put a +1/+1 counter on that creature. - this.getSpellAbility().addEffect(new TemperPreventDamageTargetEffect(new ManacostVariableValue(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new TemperPreventDamageTargetEffect(ManacostVariableValue.instance, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/t/TheBattleOfEndor.java b/Mage.Sets/src/mage/cards/t/TheBattleOfEndor.java index 6c6ee7f1a9..4362c26c53 100644 --- a/Mage.Sets/src/mage/cards/t/TheBattleOfEndor.java +++ b/Mage.Sets/src/mage/cards/t/TheBattleOfEndor.java @@ -32,7 +32,7 @@ public final class TheBattleOfEndor extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{X}{G}{G}{G}"); // Create X 1/1 green Ewok creature tokens. - this.getSpellAbility().addEffect(new CreateTokenEffect(new EwokToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new EwokToken(), ManacostVariableValue.instance)); // Put X +1/+1 counters on each creature you control. this.getSpellAbility().addEffect(new TheBattleOfEndorEffect()); diff --git a/Mage.Sets/src/mage/cards/t/TheBattleOfGeonosis.java b/Mage.Sets/src/mage/cards/t/TheBattleOfGeonosis.java index 5c8f41b4c3..7207f52b1a 100644 --- a/Mage.Sets/src/mage/cards/t/TheBattleOfGeonosis.java +++ b/Mage.Sets/src/mage/cards/t/TheBattleOfGeonosis.java @@ -27,15 +27,15 @@ public final class TheBattleOfGeonosis extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{R}{R}"); // The Battle of Geonosis deals X + 1 damage to each opponent and each creature your opponents control. - Effect effect = new DamagePlayersEffect(Outcome.Damage, new IntPlusDynamicValue(1, new ManacostVariableValue()), TargetController.OPPONENT); + Effect effect = new DamagePlayersEffect(Outcome.Damage, new IntPlusDynamicValue(1, ManacostVariableValue.instance), TargetController.OPPONENT); effect.setText("The Battle of Geonosis deals X plus 1 damage to each opponent"); this.getSpellAbility().addEffect(effect); - effect = new DamageAllEffect(new IntPlusDynamicValue(1, new ManacostVariableValue()), new FilterOpponentsCreaturePermanent()); + effect = new DamageAllEffect(new IntPlusDynamicValue(1, ManacostVariableValue.instance), new FilterOpponentsCreaturePermanent()); effect.setText("and each creature your opponents control"); this.getSpellAbility().addEffect(effect); // Creatures you control get +X/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostControlledEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn)); } diff --git a/Mage.Sets/src/mage/cards/t/TheBattleOfHoth.java b/Mage.Sets/src/mage/cards/t/TheBattleOfHoth.java index 3ce64d602b..dda5b9c9b6 100644 --- a/Mage.Sets/src/mage/cards/t/TheBattleOfHoth.java +++ b/Mage.Sets/src/mage/cards/t/TheBattleOfHoth.java @@ -19,7 +19,7 @@ public final class TheBattleOfHoth extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{W}{W}{W}"); // Create X 5/5 white artifact AT-AT creature tokens wiht "When this creature dies, create two 1/1 white Trooper creature tokens." - this.getSpellAbility().addEffect(new CreateTokenEffect(new ATATToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new ATATToken(), ManacostVariableValue.instance)); } public TheBattleOfHoth(final TheBattleOfHoth card) { diff --git a/Mage.Sets/src/mage/cards/t/TheBattleOfYavin.java b/Mage.Sets/src/mage/cards/t/TheBattleOfYavin.java index 5377a77dc8..90ec0851cd 100644 --- a/Mage.Sets/src/mage/cards/t/TheBattleOfYavin.java +++ b/Mage.Sets/src/mage/cards/t/TheBattleOfYavin.java @@ -65,7 +65,7 @@ class TheBattleOfYavinEffect extends OneShotEffect { return false; } - int amount = (new ManacostVariableValue()).calculate(game, source, this); + int amount = (ManacostVariableValue.instance).calculate(game, source, this); if (amount > 0) { LinkedList sacrifices = new LinkedList<>(); diff --git a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java index 2238235f42..f817054089 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java @@ -49,7 +49,7 @@ public final class ThoughtDissector extends CardImpl { class ThoughtDissectorEffect extends OneShotEffect { - private static final ManacostVariableValue amount = new ManacostVariableValue(); + private static final ManacostVariableValue amount = ManacostVariableValue.instance; public ThoughtDissectorEffect() { super(Outcome.Detriment); diff --git a/Mage.Sets/src/mage/cards/t/Thud.java b/Mage.Sets/src/mage/cards/t/Thud.java index 54c775bc20..cdcc431c5b 100644 --- a/Mage.Sets/src/mage/cards/t/Thud.java +++ b/Mage.Sets/src/mage/cards/t/Thud.java @@ -26,7 +26,7 @@ public final class Thud extends CardImpl { )); // Thud deals damage equal to the sacrificed creature's power to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new SacrificeCostCreaturesPower())); + this.getSpellAbility().addEffect(new DamageTargetEffect(SacrificeCostCreaturesPower.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java index a83deed0d4..5805188ef9 100644 --- a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java +++ b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java @@ -53,7 +53,7 @@ public final class TibaltTheFiendBlooded extends CardImpl { ability.addEffect(effect); this.addAbility(ability); // -4: Tibalt, the Fiend-Blooded deals damage equal to the number of cards in target player's hand to that player. - effect = new DamageTargetEffect(new CardsInTargetHandCount(), true); + effect = new DamageTargetEffect(CardsInTargetHandCount.instance, true); effect.setText("{this} deals damage equal to the number of cards in target player's hand to that player"); ability = new LoyaltyAbility(effect, -4); ability.addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java index 50ec788f1a..2a83a5105e 100644 --- a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java +++ b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java @@ -37,7 +37,7 @@ public final class TishanaVoiceOfThunder extends CardImpl { this.toughness = new MageInt(0); // Tishana, Voice of Thunder's power and toughness are each equal to the number of cards in your hand. - DynamicValue xValue = new CardsInControllerHandCount(); + DynamicValue xValue = CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // You have no maximum hand size. diff --git a/Mage.Sets/src/mage/cards/t/TitansRevenge.java b/Mage.Sets/src/mage/cards/t/TitansRevenge.java index 0ce6a02ea8..37529c2469 100644 --- a/Mage.Sets/src/mage/cards/t/TitansRevenge.java +++ b/Mage.Sets/src/mage/cards/t/TitansRevenge.java @@ -21,7 +21,7 @@ public final class TitansRevenge extends CardImpl { // Titan's Revenge deals X damage to any target. Clash with an opponent. If you win, return Titan's Revenge to its owner's hand. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellAbility().addEffect(ClashWinReturnToHandSpellEffect.getInstance()); } diff --git a/Mage.Sets/src/mage/cards/t/ToilTrouble.java b/Mage.Sets/src/mage/cards/t/ToilTrouble.java index c3783993f1..7a18f7047c 100644 --- a/Mage.Sets/src/mage/cards/t/ToilTrouble.java +++ b/Mage.Sets/src/mage/cards/t/ToilTrouble.java @@ -26,7 +26,7 @@ public final class ToilTrouble extends SplitCard { // Trouble // Trouble deals damage to target player equal to the number of cards in that player's hand. - Effect effect = new DamageTargetEffect(new CardsInTargetHandCount()); + Effect effect = new DamageTargetEffect(CardsInTargetHandCount.instance); effect.setText("Trouble deals damage to target player equal to the number of cards in that player's hand"); getRightHalfCard().getSpellAbility().addEffect(effect); getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/t/ToxicDeluge.java b/Mage.Sets/src/mage/cards/t/ToxicDeluge.java index b3f9b3e9e4..ec64b49f4f 100644 --- a/Mage.Sets/src/mage/cards/t/ToxicDeluge.java +++ b/Mage.Sets/src/mage/cards/t/ToxicDeluge.java @@ -26,7 +26,7 @@ public final class ToxicDeluge extends CardImpl { // As an additional cost to cast Toxic Deluge, pay X life. this.getSpellAbility().addCost(new PayVariableLifeCost(true)); // All creatures get -X/-X until end of turn. - DynamicValue xValue = new SignInversionDynamicValue(new GetXValue()); + DynamicValue xValue = new SignInversionDynamicValue(GetXValue.instance); this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent("All creatures"), false, null, true)); } diff --git a/Mage.Sets/src/mage/cards/t/TribalUnity.java b/Mage.Sets/src/mage/cards/t/TribalUnity.java index bb468b356d..8d03dd0471 100644 --- a/Mage.Sets/src/mage/cards/t/TribalUnity.java +++ b/Mage.Sets/src/mage/cards/t/TribalUnity.java @@ -30,7 +30,7 @@ public final class TribalUnity extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{2}{G}"); // Creatures of the creature type of your choice get +X/+X until end of turn. - this.getSpellAbility().addEffect(new TribalUnityEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new TribalUnityEffect(ManacostVariableValue.instance)); } public TribalUnity(final TribalUnity card) { diff --git a/Mage.Sets/src/mage/cards/t/TropicalStorm.java b/Mage.Sets/src/mage/cards/t/TropicalStorm.java index b85d7c05d0..0178952b1a 100644 --- a/Mage.Sets/src/mage/cards/t/TropicalStorm.java +++ b/Mage.Sets/src/mage/cards/t/TropicalStorm.java @@ -31,7 +31,7 @@ public final class TropicalStorm extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}"); // Tropical Storm deals X damage to each creature with flying and 1 additional damage to each blue creature. - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filter)); this.getSpellAbility().addEffect(new DamageAllEffect(1, filter2).setText("and 1 additional damage to each blue creature")); } diff --git a/Mage.Sets/src/mage/cards/u/UntamedMight.java b/Mage.Sets/src/mage/cards/u/UntamedMight.java index 3d887eced9..9ae6aca3a4 100644 --- a/Mage.Sets/src/mage/cards/u/UntamedMight.java +++ b/Mage.Sets/src/mage/cards/u/UntamedMight.java @@ -20,7 +20,7 @@ public final class UntamedMight extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{G}"); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new ManacostVariableValue(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(ManacostVariableValue.instance, ManacostVariableValue.instance, Duration.EndOfTurn)); } public UntamedMight(final UntamedMight card) { diff --git a/Mage.Sets/src/mage/cards/v/VengefulArchon.java b/Mage.Sets/src/mage/cards/v/VengefulArchon.java index 6921e84308..c271f2e00d 100644 --- a/Mage.Sets/src/mage/cards/v/VengefulArchon.java +++ b/Mage.Sets/src/mage/cards/v/VengefulArchon.java @@ -56,7 +56,7 @@ public final class VengefulArchon extends CardImpl { class VengefulArchonEffect extends PreventDamageToControllerEffect { public VengefulArchonEffect() { - super(Duration.EndOfTurn, false, true, new ManacostVariableValue()); + super(Duration.EndOfTurn, false, true, ManacostVariableValue.instance); staticText = "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, {this} deals that much damage to target player or planeswalker"; } diff --git a/Mage.Sets/src/mage/cards/v/VensersJournal.java b/Mage.Sets/src/mage/cards/v/VensersJournal.java index f3b19c26e9..6bfa3dc7b0 100644 --- a/Mage.Sets/src/mage/cards/v/VensersJournal.java +++ b/Mage.Sets/src/mage/cards/v/VensersJournal.java @@ -30,7 +30,7 @@ public final class VensersJournal extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // At the beginning of your upkeep, you gain 1 life for each card in your hand. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(new CardsInControllerHandCount()), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(CardsInControllerHandCount.instance), TargetController.YOU, false)); } public VensersJournal(final VensersJournal card) { diff --git a/Mage.Sets/src/mage/cards/v/VentifactBottle.java b/Mage.Sets/src/mage/cards/v/VentifactBottle.java index 92e69ef651..4b0c2db6e5 100644 --- a/Mage.Sets/src/mage/cards/v/VentifactBottle.java +++ b/Mage.Sets/src/mage/cards/v/VentifactBottle.java @@ -36,7 +36,7 @@ public final class VentifactBottle extends CardImpl { // {X}{1}, {tap}: Put X charge counters on Ventifact Bottle. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, - new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), new ManacostVariableValue(), true), + new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), ManacostVariableValue.instance, true), new ManaCostsImpl("{1}{X}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/v/ViciousBetrayal.java b/Mage.Sets/src/mage/cards/v/ViciousBetrayal.java index 3d5faf818a..ccb6b03444 100644 --- a/Mage.Sets/src/mage/cards/v/ViciousBetrayal.java +++ b/Mage.Sets/src/mage/cards/v/ViciousBetrayal.java @@ -30,7 +30,7 @@ public final class ViciousBetrayal extends CardImpl { this.getSpellAbility().addCost(new SacrificeXTargetCost(new FilterControlledCreaturePermanent())); // Target creature gets +2/+2 until end of turn for each creature sacrificed this way. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(new GetXValue(), new GetXValue(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(GetXValue.instance, GetXValue.instance, Duration.EndOfTurn)); } public ViciousBetrayal(final ViciousBetrayal card) { @@ -55,7 +55,7 @@ class GetXValue implements DynamicValue { @Override public GetXValue copy() { - return new GetXValue(); + return GetXValue.instance; } @Override diff --git a/Mage.Sets/src/mage/cards/v/ViciousShadows.java b/Mage.Sets/src/mage/cards/v/ViciousShadows.java index 273cd5bf24..c65f819cf8 100644 --- a/Mage.Sets/src/mage/cards/v/ViciousShadows.java +++ b/Mage.Sets/src/mage/cards/v/ViciousShadows.java @@ -22,7 +22,7 @@ public final class ViciousShadows extends CardImpl { // Whenever a creature dies, you may have Vicious Shadows deal damage to target player equal to the number of cards in that player's hand. - Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(new CardsInTargetHandCount()), true); + Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(CardsInTargetHandCount.instance), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java b/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java index 948eb6ae9e..dc3d414a5d 100644 --- a/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java +++ b/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java @@ -51,7 +51,7 @@ public final class VishKalBloodArbiter extends CardImpl { this.addAbility(LifelinkAbility.getInstance()); // Sacrifice a creature: Put X +1/+1 counters on Vish Kal, Blood Arbiter, where X is the sacrificed creature's power. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new SacrificeCostCreaturesPower(), true), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), SacrificeCostCreaturesPower.instance, true), new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // Remove all +1/+1 counters from Vish Kal: Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way. DynamicValue removedCounters = new SignInversionDynamicValue(new VishKalBloodArbiterDynamicValue()); diff --git a/Mage.Sets/src/mage/cards/v/VolcanicGeyser.java b/Mage.Sets/src/mage/cards/v/VolcanicGeyser.java index 85a3f91712..1f13748ea7 100644 --- a/Mage.Sets/src/mage/cards/v/VolcanicGeyser.java +++ b/Mage.Sets/src/mage/cards/v/VolcanicGeyser.java @@ -20,7 +20,7 @@ public final class VolcanicGeyser extends CardImpl { // Volcanic Geyser deals X damage to any target. - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/v/VolcanoHellion.java b/Mage.Sets/src/mage/cards/v/VolcanoHellion.java index de37cde0ff..b8bd54d50e 100644 --- a/Mage.Sets/src/mage/cards/v/VolcanoHellion.java +++ b/Mage.Sets/src/mage/cards/v/VolcanoHellion.java @@ -32,7 +32,7 @@ public final class VolcanoHellion extends CardImpl { this.toughness = new MageInt(5); // Volcano Hellion has echo {X}, where X is your life total. - this.addAbility(new EchoAbility(new ControllerLifeCount(), "{this} has echo {X}, where X is your life total.")); + this.addAbility(new EchoAbility(ControllerLifeCount.instance, "{this} has echo {X}, where X is your life total.")); // When Volcano Hellion enters the battlefield, it deals an amount of damage of your choice to you and target creature. The damage can't be prevented. Ability ability = new EntersBattlefieldTriggeredAbility(new VolcanoHellionEffect(), false); diff --git a/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java b/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java index 3e8ebbb7e5..d7344404e4 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java +++ b/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java @@ -34,7 +34,7 @@ public final class VolrathTheFallen extends CardImpl { // {1}{B}, Discard a creature card: // Volrath the Fallen gets +X/+X until end of turn, where X is the discarded card's converted mana cost. - Effect effect = new BoostSourceEffect(new DiscardCostCardConvertedMana(),new DiscardCostCardConvertedMana(),Duration.EndOfTurn); + Effect effect = new BoostSourceEffect(DiscardCostCardConvertedMana.instance,DiscardCostCardConvertedMana.instance,Duration.EndOfTurn); effect.setText("{this} gets +X/+X until end of turn, where X is the discarded card's converted mana cost"); Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/cards/v/VoyagerDrake.java b/Mage.Sets/src/mage/cards/v/VoyagerDrake.java index afe52717fa..058ab18bf9 100644 --- a/Mage.Sets/src/mage/cards/v/VoyagerDrake.java +++ b/Mage.Sets/src/mage/cards/v/VoyagerDrake.java @@ -64,7 +64,7 @@ enum VoyagerDrakeAdjuster implements TargetAdjuster { @Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); - int numbTargets = new MultikickerCount().calculate(game, ability, null); + int numbTargets = MultikickerCount.instance.calculate(game, ability, null); if (numbTargets > 0) { ability.addTarget(new TargetCreaturePermanent(0, numbTargets)); } diff --git a/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java b/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java index 77d38291e9..1504be0bf4 100644 --- a/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java @@ -40,7 +40,7 @@ public final class WakerOfTheWilds extends CardImpl { Zone.BATTLEFIELD, new AddCountersTargetEffect( CounterType.P1P1.createInstance(0), - new ManacostVariableValue() + ManacostVariableValue.instance ).setText("Put X +1/+1 counters on target land you control."), new ManaCostsImpl("{X}{G}{G}") ); diff --git a/Mage.Sets/src/mage/cards/w/WarCadence.java b/Mage.Sets/src/mage/cards/w/WarCadence.java index 57c5707a1c..a3864feb41 100644 --- a/Mage.Sets/src/mage/cards/w/WarCadence.java +++ b/Mage.Sets/src/mage/cards/w/WarCadence.java @@ -44,7 +44,7 @@ public final class WarCadence extends CardImpl { class WarCadenceReplacementEffect extends ReplacementEffectImpl { - DynamicValue xCosts = new ManacostVariableValue(); + DynamicValue xCosts = ManacostVariableValue.instance; WarCadenceReplacementEffect() { super(Duration.EndOfTurn, Outcome.Neutral); diff --git a/Mage.Sets/src/mage/cards/w/WarTax.java b/Mage.Sets/src/mage/cards/w/WarTax.java index 3f9fb3cf9d..e9d14ff822 100644 --- a/Mage.Sets/src/mage/cards/w/WarTax.java +++ b/Mage.Sets/src/mage/cards/w/WarTax.java @@ -45,7 +45,7 @@ public final class WarTax extends CardImpl { class WarTaxCantAttackUnlessPaysEffect extends PayCostToAttackBlockEffectImpl { - DynamicValue xCosts = new ManacostVariableValue(); + DynamicValue xCosts = ManacostVariableValue.instance; WarTaxCantAttackUnlessPaysEffect() { super(Duration.EndOfTurn, Outcome.Neutral, RestrictType.ATTACK); diff --git a/Mage.Sets/src/mage/cards/w/WarbreakTrumpeter.java b/Mage.Sets/src/mage/cards/w/WarbreakTrumpeter.java index 9bd8284627..6e801451f6 100644 --- a/Mage.Sets/src/mage/cards/w/WarbreakTrumpeter.java +++ b/Mage.Sets/src/mage/cards/w/WarbreakTrumpeter.java @@ -31,7 +31,7 @@ public final class WarbreakTrumpeter extends CardImpl { this.addAbility(new MorphAbility(this, new ManaCostsImpl("{X}{X}{R}"))); // When Warbreak Trumpeter is turned face up, create X 1/1 red Goblin creature tokens. - DynamicValue morphX = new MorphManacostVariableValue(); + DynamicValue morphX = MorphManacostVariableValue.instance; this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new CreateTokenEffect(new GoblinToken(), morphX))); } diff --git a/Mage.Sets/src/mage/cards/w/WarpedPhysique.java b/Mage.Sets/src/mage/cards/w/WarpedPhysique.java index 9cfa58584c..2f1fb5588a 100644 --- a/Mage.Sets/src/mage/cards/w/WarpedPhysique.java +++ b/Mage.Sets/src/mage/cards/w/WarpedPhysique.java @@ -26,7 +26,7 @@ public final class WarpedPhysique extends CardImpl { // Target creature gets +X/-X until end of turn, where X is the number of cards in your hand. - DynamicValue xValue = new CardsInControllerHandCount(); + DynamicValue xValue = CardsInControllerHandCount.instance; this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, new SignInversionDynamicValue(xValue), Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java index b7df1697b4..61bdd50855 100644 --- a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java +++ b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java @@ -48,7 +48,7 @@ public final class WerewolfOfAncientHunger extends CardImpl { // Werewolf of Ancient Hunger's power and toughness are each equal to the total number of cards in all players' hands. this.addAbility(new SimpleStaticAbility(Zone.ALL, - new ConditionalContinuousEffect(new SetPowerToughnessSourceEffect(new CardsInAllHandsCount(), Duration.EndOfGame), + new ConditionalContinuousEffect(new SetPowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame), new TransformedCondition(false), "{this}'s power and toughness are each equal to the total number of cards in all players' hands"))); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf of Ancient Hunger. diff --git a/Mage.Sets/src/mage/cards/w/Whetwheel.java b/Mage.Sets/src/mage/cards/w/Whetwheel.java index bb37398d79..cc09655c80 100644 --- a/Mage.Sets/src/mage/cards/w/Whetwheel.java +++ b/Mage.Sets/src/mage/cards/w/Whetwheel.java @@ -26,7 +26,7 @@ public final class Whetwheel extends CardImpl { // {X}{X}, {tap}: Target player puts the top X cards of their library into their graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect( - new ManacostVariableValue()), new ManaCostsImpl("{X}{X}")); + ManacostVariableValue.instance), new ManaCostsImpl("{X}{X}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java b/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java index d5d28212bb..b08a197b18 100644 --- a/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java +++ b/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java @@ -36,7 +36,7 @@ public final class WhiteManaBattery extends CardImpl { // {tap}, Remove any number of charge counters from White Mana Battery: Add {W}, then add an additional {W} for each charge counter removed this way. ability = new DynamicManaAbility( Mana.WhiteMana(1), - new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance), new TapSourceCost(), "Add {W}, then add {W} for each charge counter removed this way", true, new CountersSourceCount(CounterType.CHARGE)); diff --git a/Mage.Sets/src/mage/cards/w/WhiteSunsZenith.java b/Mage.Sets/src/mage/cards/w/WhiteSunsZenith.java index b13069cf27..772562ec28 100644 --- a/Mage.Sets/src/mage/cards/w/WhiteSunsZenith.java +++ b/Mage.Sets/src/mage/cards/w/WhiteSunsZenith.java @@ -20,7 +20,7 @@ public final class WhiteSunsZenith extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}{W}{W}"); // create X 2/2 white Cat creature tokens. Shuffle White Sun's Zenith into its owner's library. - this.getSpellAbility().addEffect(new CreateTokenEffect(new CatToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new CatToken(), ManacostVariableValue.instance)); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); } diff --git a/Mage.Sets/src/mage/cards/w/Windstorm.java b/Mage.Sets/src/mage/cards/w/Windstorm.java index 8d4899a342..7ad059c67f 100644 --- a/Mage.Sets/src/mage/cards/w/Windstorm.java +++ b/Mage.Sets/src/mage/cards/w/Windstorm.java @@ -27,7 +27,7 @@ public final class Windstorm extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{G}"); - this.getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filter)); + this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.instance, filter)); } public Windstorm(final Windstorm card) { diff --git a/Mage.Sets/src/mage/cards/w/WineOfBloodAndIron.java b/Mage.Sets/src/mage/cards/w/WineOfBloodAndIron.java index 47f98cbfd3..f5e9142898 100644 --- a/Mage.Sets/src/mage/cards/w/WineOfBloodAndIron.java +++ b/Mage.Sets/src/mage/cards/w/WineOfBloodAndIron.java @@ -29,7 +29,7 @@ public final class WineOfBloodAndIron extends CardImpl { // {4}: Target creature gets +X/+0 until end of turn, where X is its power. Sacrifice Wine of Blood and Iron at the beginning of the next end step. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true), + new BoostTargetEffect(TargetPermanentPowerCount.instance, new StaticValue(0), Duration.EndOfTurn, true), new GenericManaCost(4)); Effect effect = new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()), false); diff --git a/Mage.Sets/src/mage/cards/w/WolfbriarElemental.java b/Mage.Sets/src/mage/cards/w/WolfbriarElemental.java index 93d321340d..4a96c707c5 100644 --- a/Mage.Sets/src/mage/cards/w/WolfbriarElemental.java +++ b/Mage.Sets/src/mage/cards/w/WolfbriarElemental.java @@ -31,7 +31,7 @@ public final class WolfbriarElemental extends CardImpl { this.addAbility(new MultikickerAbility("{G}")); // When Wolfbriar Elemental enters the battlefield, create a 2/2 green Wolf creature token for each time it was kicked. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WolfToken(), new MultikickerCount()))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WolfToken(), MultikickerCount.instance))); } public WolfbriarElemental(final WolfbriarElemental card) { diff --git a/Mage.Sets/src/mage/cards/w/WordOfBlasting.java b/Mage.Sets/src/mage/cards/w/WordOfBlasting.java index e30c450431..ee30e19b78 100644 --- a/Mage.Sets/src/mage/cards/w/WordOfBlasting.java +++ b/Mage.Sets/src/mage/cards/w/WordOfBlasting.java @@ -31,7 +31,7 @@ public final class WordOfBlasting extends CardImpl { // Destroy target Wall. It can't be regenerated. Word of Blasting deals damage equal to that Wall's converted mana cost to the Wall's controller. this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); - Effect effect = new DamageTargetControllerEffect(new TargetConvertedManaCost()); + Effect effect = new DamageTargetControllerEffect(TargetConvertedManaCost.instance); effect.setText("{this} deals damage equal to that Wall's converted mana cost to the Wall's controller"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/w/WorthyCause.java b/Mage.Sets/src/mage/cards/w/WorthyCause.java index 4d196b4f2c..3564befc98 100644 --- a/Mage.Sets/src/mage/cards/w/WorthyCause.java +++ b/Mage.Sets/src/mage/cards/w/WorthyCause.java @@ -29,7 +29,7 @@ public final class WorthyCause extends CardImpl { this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // You gain life equal to the sacrificed creature's toughness. - Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); + Effect effect = new GainLifeEffect(SacrificeCostCreaturesToughness.instance); effect.setText("You gain life equal to the sacrificed creature's toughness"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/z/ZedruuTheGreathearted.java b/Mage.Sets/src/mage/cards/z/ZedruuTheGreathearted.java index 88c4dfcd3d..78c292f791 100644 --- a/Mage.Sets/src/mage/cards/z/ZedruuTheGreathearted.java +++ b/Mage.Sets/src/mage/cards/z/ZedruuTheGreathearted.java @@ -35,10 +35,10 @@ public final class ZedruuTheGreathearted extends CardImpl { this.toughness = new MageInt(4); // At the beginning of your upkeep, you gain X life and draw X cards, where X is the number of permanents you own that your opponents control. - Effect effect = new GainLifeEffect(new PermanentsYouOwnThatOpponentsControlCount()); + Effect effect = new GainLifeEffect(PermanentsYouOwnThatOpponentsControlCount.instance); effect.setText("you gain X life"); Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false); - effect = new DrawCardSourceControllerEffect(new PermanentsYouOwnThatOpponentsControlCount()); + effect = new DrawCardSourceControllerEffect(PermanentsYouOwnThatOpponentsControlCount.instance); effect.setText("and draw X cards, where X is the number of permanents you own that your opponents control"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttachedPermanentToughnessValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttachedPermanentToughnessValue.java index 2dab3cdd79..43529161fe 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttachedPermanentToughnessValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttachedPermanentToughnessValue.java @@ -12,29 +12,29 @@ import mage.game.Game; import mage.game.permanent.Permanent; /** - * * @author MTGfan */ -public class AttachedPermanentToughnessValue implements DynamicValue { - +public enum AttachedPermanentToughnessValue implements DynamicValue { + instance; + @Override public int calculate(Game game, Ability source, Effect effect) { Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); return enchanted.getToughness().getValue(); } - + @Override - public AttachedPermanentToughnessValue copy(){ - return new AttachedPermanentToughnessValue(); + public AttachedPermanentToughnessValue copy() { + return AttachedPermanentToughnessValue.instance; } - + @Override public String toString() { return "equal to"; } - - @Override + + @Override public String getMessage() { return "that creature's toughness"; } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttackedThisTurnOpponentsCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttackedThisTurnOpponentsCount.java index 1e69de1d4f..2435fda94a 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttackedThisTurnOpponentsCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AttackedThisTurnOpponentsCount.java @@ -7,29 +7,24 @@ import mage.abilities.effects.Effect; import mage.game.Game; import mage.watchers.common.PlayersAttackedThisTurnWatcher; -import java.util.UUID; - /** * @author JayDi85 */ -public class AttackedThisTurnOpponentsCount implements DynamicValue { +public enum AttackedThisTurnOpponentsCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - return this.calculate(game, sourceAbility.getControllerId()); - } - - public int calculate(Game game, UUID controllerId) { PlayersAttackedThisTurnWatcher watcher = game.getState().getWatcher(PlayersAttackedThisTurnWatcher.class); if (watcher != null) { - return watcher.getAttackedOpponentsCount(controllerId); + return watcher.getAttackedOpponentsCount(sourceAbility.getControllerId()); } return 0; } @Override public AttackedThisTurnOpponentsCount copy() { - return new AttackedThisTurnOpponentsCount(); + return AttackedThisTurnOpponentsCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllHandsCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllHandsCount.java index 7220265e7b..5910f57a6c 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllHandsCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllHandsCount.java @@ -1,26 +1,26 @@ package mage.abilities.dynamicvalue.common; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** - * * @author emerald000 */ -public class CardsInAllHandsCount implements DynamicValue { - +public enum CardsInAllHandsCount implements DynamicValue { + instance; + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int count = 0; for (UUID playerId : game.getState().getPlayersInRange(sourceAbility.getControllerId(), game)) { Player player = game.getPlayer(playerId); - if (player != null) - { + if (player != null) { count += player.getHand().size(); } } @@ -29,7 +29,7 @@ public class CardsInAllHandsCount implements DynamicValue { @Override public CardsInAllHandsCount copy() { - return new CardsInAllHandsCount(); + return CardsInAllHandsCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java index 476057003c..ea8cde0572 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java @@ -6,7 +6,8 @@ import mage.abilities.effects.Effect; import mage.game.Game; import mage.players.Player; -public class CardsInControllerHandCount implements DynamicValue { +public enum CardsInControllerHandCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -21,7 +22,7 @@ public class CardsInControllerHandCount implements DynamicValue { @Override public CardsInControllerHandCount copy() { - return new CardsInControllerHandCount(); + return CardsInControllerHandCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java index dd7ac467d9..c5e63adb19 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java @@ -6,7 +6,8 @@ import mage.abilities.effects.Effect; import mage.game.Game; import mage.players.Player; -public class CardsInTargetHandCount implements DynamicValue { +public enum CardsInTargetHandCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -21,7 +22,7 @@ public class CardsInTargetHandCount implements DynamicValue { @Override public DynamicValue copy() { - return new CardsInTargetHandCount(); + return CardsInTargetHandCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java index 393f45db14..686f85b959 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java @@ -7,10 +7,10 @@ import mage.game.Game; import mage.players.Player; /** - * * @author cbrianhill */ -public class CardsInTargetPlayerHandCount implements DynamicValue { +public enum CardsInTargetPlayerHandCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -23,7 +23,7 @@ public class CardsInTargetPlayerHandCount implements DynamicValue { @Override public CardsInTargetPlayerHandCount copy() { - return new CardsInTargetPlayerHandCount(); + return CardsInTargetPlayerHandCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ControllerLifeCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ControllerLifeCount.java index e756e77e3e..512691fd8f 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ControllerLifeCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ControllerLifeCount.java @@ -6,7 +6,8 @@ import mage.abilities.effects.Effect; import mage.game.Game; import mage.players.Player; -public class ControllerLifeCount implements DynamicValue { +public enum ControllerLifeCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -19,7 +20,7 @@ public class ControllerLifeCount implements DynamicValue { @Override public ControllerLifeCount copy() { - return new ControllerLifeCount(); + return ControllerLifeCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java index ef2ae61ed2..d5b3fb0b13 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java @@ -10,7 +10,8 @@ import mage.watchers.common.CreaturesDiedWatcher; /** * @author LoneFox */ -public class CreaturesDiedThisTurnCount implements DynamicValue { +public enum CreaturesDiedThisTurnCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -23,7 +24,7 @@ public class CreaturesDiedThisTurnCount implements DynamicValue { @Override public CreaturesDiedThisTurnCount copy() { - return new CreaturesDiedThisTurnCount(); + return CreaturesDiedThisTurnCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DiscardCostCardConvertedMana.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DiscardCostCardConvertedMana.java index 145cf7ddaf..03e750bcc3 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DiscardCostCardConvertedMana.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DiscardCostCardConvertedMana.java @@ -11,7 +11,8 @@ import mage.game.Game; /** * @author LevelX2 */ -public class DiscardCostCardConvertedMana implements DynamicValue { +public enum DiscardCostCardConvertedMana implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -26,7 +27,7 @@ public class DiscardCostCardConvertedMana implements DynamicValue { @Override public DiscardCostCardConvertedMana copy() { - return new DiscardCostCardConvertedMana(); + return DiscardCostCardConvertedMana.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ExileFromHandCostCardConvertedMana.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ExileFromHandCostCardConvertedMana.java index f13c39c282..48bba82766 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ExileFromHandCostCardConvertedMana.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ExileFromHandCostCardConvertedMana.java @@ -14,10 +14,10 @@ import mage.game.Game; * cost. If no card was exiled the getManaCostsToPay().getX() will be used as * value. * - * * @author LevelX2 */ -public class ExileFromHandCostCardConvertedMana implements DynamicValue { +public enum ExileFromHandCostCardConvertedMana implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -35,7 +35,7 @@ public class ExileFromHandCostCardConvertedMana implements DynamicValue { @Override public ExileFromHandCostCardConvertedMana copy() { - return new ExileFromHandCostCardConvertedMana(); + return ExileFromHandCostCardConvertedMana.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/GetXValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GetXValue.java index 07c5eefe0f..84a0302bb4 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/GetXValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GetXValue.java @@ -8,14 +8,15 @@ import mage.abilities.effects.Effect; import mage.game.Game; /** - * * @author BetaSteward_at_googlemail.com */ -public class GetXValue implements DynamicValue { +public enum GetXValue implements DynamicValue { + instance; + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int amount = 0; - for (VariableCost cost: sourceAbility.getCosts().getVariableCosts()) { + for (VariableCost cost : sourceAbility.getCosts().getVariableCosts()) { amount += cost.getAmount(); } return amount; @@ -23,7 +24,7 @@ public class GetXValue implements DynamicValue { @Override public GetXValue copy() { - return new GetXValue(); + return GetXValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java index a668e5c337..714cc80a63 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java @@ -10,10 +10,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; /** - * * @author Styxo */ -public class GreatestPowerAmongControlledCreaturesValue implements DynamicValue { +public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -32,7 +32,7 @@ public class GreatestPowerAmongControlledCreaturesValue implements DynamicValue @Override public GreatestPowerAmongControlledCreaturesValue copy() { - return new GreatestPowerAmongControlledCreaturesValue(); + return GreatestPowerAmongControlledCreaturesValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManaSpentToCastCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManaSpentToCastCount.java index 767c185e7a..0ad7fed22b 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManaSpentToCastCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManaSpentToCastCount.java @@ -10,13 +10,10 @@ import mage.game.Game; import mage.game.stack.Spell; /** - * * @author LevelX2 */ -public class ManaSpentToCastCount implements DynamicValue { - - public ManaSpentToCastCount() { - } +public enum ManaSpentToCastCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability source, Effect effect) { @@ -36,7 +33,7 @@ public class ManaSpentToCastCount implements DynamicValue { @Override public ManaSpentToCastCount copy() { - return new ManaSpentToCastCount(); + return ManaSpentToCastCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManacostVariableValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManacostVariableValue.java index e29a7a9a88..bade65f544 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManacostVariableValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ManacostVariableValue.java @@ -5,7 +5,8 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.game.Game; -public class ManacostVariableValue implements DynamicValue { +public enum ManacostVariableValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -14,7 +15,7 @@ public class ManacostVariableValue implements DynamicValue { @Override public ManacostVariableValue copy() { - return new ManacostVariableValue(); + return ManacostVariableValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/MorphManacostVariableValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/MorphManacostVariableValue.java index b3f84b9a60..bc137d87e2 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/MorphManacostVariableValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/MorphManacostVariableValue.java @@ -11,10 +11,10 @@ import mage.abilities.effects.Effect; import mage.game.Game; /** - * * @author LevelX2 */ -public class MorphManacostVariableValue implements DynamicValue { +public enum MorphManacostVariableValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -27,7 +27,7 @@ public class MorphManacostVariableValue implements DynamicValue { @Override public MorphManacostVariableValue copy() { - return new MorphManacostVariableValue(); + return MorphManacostVariableValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/MultikickerCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/MultikickerCount.java index 4d69367763..b4b583c1da 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/MultikickerCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/MultikickerCount.java @@ -9,20 +9,17 @@ import mage.cards.Card; import mage.game.Game; /** - * * @author LevelX2 */ -public class MultikickerCount implements DynamicValue { - - public MultikickerCount() { - } +public enum MultikickerCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability source, Effect effect) { int count = 0; Card card = game.getCard(source.getSourceId()); if (card != null) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof KickerAbility) { count += ((KickerAbility) ability).getKickedCounter(game, source); } @@ -33,7 +30,7 @@ public class MultikickerCount implements DynamicValue { @Override public MultikickerCount copy() { - return new MultikickerCount(); + return MultikickerCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java index 2435bb53ad..d8eee3f627 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java @@ -8,7 +8,8 @@ import mage.game.Game; /** * @author JayDi85 */ -public class OpponentsCount implements DynamicValue { +public enum OpponentsCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -17,7 +18,7 @@ public class OpponentsCount implements DynamicValue { @Override public OpponentsCount copy() { - return new OpponentsCount(); + return OpponentsCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsPoisonCountersCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsPoisonCountersCount.java index 8851841caa..76f16fe6ad 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsPoisonCountersCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsPoisonCountersCount.java @@ -10,7 +10,8 @@ import mage.players.Player; import java.util.Set; import java.util.UUID; -public class OpponentsPoisonCountersCount implements DynamicValue { +public enum OpponentsPoisonCountersCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -27,7 +28,7 @@ public class OpponentsPoisonCountersCount implements DynamicValue { @Override public DynamicValue copy() { - return new OpponentsPoisonCountersCount(); + return OpponentsPoisonCountersCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java index 66c49c9618..3a98ec1d65 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java @@ -1,15 +1,17 @@ package mage.abilities.dynamicvalue.common; -import java.util.Set; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.game.Game; import mage.game.permanent.Permanent; -public class PermanentsYouOwnThatOpponentsControlCount implements DynamicValue { +import java.util.Set; +import java.util.UUID; + +public enum PermanentsYouOwnThatOpponentsControlCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -28,7 +30,7 @@ public class PermanentsYouOwnThatOpponentsControlCount implements DynamicValue { @Override public PermanentsYouOwnThatOpponentsControlCount copy() { - return new PermanentsYouOwnThatOpponentsControlCount(); + return PermanentsYouOwnThatOpponentsControlCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/RemovedCountersForCostValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/RemovedCountersForCostValue.java index 26c4584099..2b8620a561 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/RemovedCountersForCostValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/RemovedCountersForCostValue.java @@ -13,10 +13,10 @@ import mage.abilities.effects.Effect; import mage.game.Game; /** - * * @author LevelX2 */ -public class RemovedCountersForCostValue implements DynamicValue { +public enum RemovedCountersForCostValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -35,7 +35,7 @@ public class RemovedCountersForCostValue implements DynamicValue { @Override public RemovedCountersForCostValue copy() { - return new RemovedCountersForCostValue(); + return RemovedCountersForCostValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/RevealTargetFromHandCostCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/RevealTargetFromHandCostCount.java index b7574ac2f5..f9994726cc 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/RevealTargetFromHandCostCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/RevealTargetFromHandCostCount.java @@ -13,10 +13,10 @@ import mage.abilities.effects.Effect; import mage.game.Game; /** - * * @author emerald000 */ -public class RevealTargetFromHandCostCount implements DynamicValue { +public enum RevealTargetFromHandCostCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -35,7 +35,7 @@ public class RevealTargetFromHandCostCount implements DynamicValue { @Override public RevealTargetFromHandCostCount copy() { - return new RevealTargetFromHandCostCount(); + return RevealTargetFromHandCostCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesPower.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesPower.java index 290a303c88..4cdaed1a82 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesPower.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesPower.java @@ -10,8 +10,8 @@ import mage.game.Game; /** * @author LevelX2 */ -public class SacrificeCostCreaturesPower implements DynamicValue { - +public enum SacrificeCostCreaturesPower implements DynamicValue { +instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { for (Cost cost : sourceAbility.getCosts()) { @@ -26,7 +26,7 @@ public class SacrificeCostCreaturesPower implements DynamicValue { @Override public SacrificeCostCreaturesPower copy() { - return new SacrificeCostCreaturesPower(); + return SacrificeCostCreaturesPower.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesToughness.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesToughness.java index bfc03a261c..514b24f8a3 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesToughness.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SacrificeCostCreaturesToughness.java @@ -10,7 +10,8 @@ import mage.game.Game; /** * @author LevelX2 */ -public class SacrificeCostCreaturesToughness implements DynamicValue { +public enum SacrificeCostCreaturesToughness implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -25,7 +26,7 @@ public class SacrificeCostCreaturesToughness implements DynamicValue { @Override public SacrificeCostCreaturesToughness copy() { - return new SacrificeCostCreaturesToughness(); + return SacrificeCostCreaturesToughness.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java index d42cc3f528..6c49909cad 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java @@ -10,14 +10,10 @@ import mage.game.stack.Spell; import mage.game.stack.StackObject; /** - * * @author Nicolas */ -public class SunburstCount implements DynamicValue { - - public SunburstCount() { - - } +public enum SunburstCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability source, Effect effect) { @@ -48,7 +44,7 @@ public class SunburstCount implements DynamicValue { @Override public SunburstCount copy() { - return new SunburstCount(); + return SunburstCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetConvertedManaCost.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetConvertedManaCost.java index 7be84e3585..26fe5ed8f5 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetConvertedManaCost.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetConvertedManaCost.java @@ -8,10 +8,10 @@ import mage.cards.Card; import mage.game.Game; /** - * * @author North */ -public class TargetConvertedManaCost implements DynamicValue { +public enum TargetConvertedManaCost implements DynamicValue { + instance; @Override public int calculate(Game game, Ability source, Effect effect) { @@ -24,7 +24,7 @@ public class TargetConvertedManaCost implements DynamicValue { @Override public TargetConvertedManaCost copy() { - return new TargetConvertedManaCost(); + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanentPowerCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanentPowerCount.java index 814eb19970..ab7e13d4b9 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanentPowerCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanentPowerCount.java @@ -9,10 +9,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; /** - * * @author North */ -public class TargetPermanentPowerCount implements DynamicValue { +public enum TargetPermanentPowerCount implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -29,7 +29,7 @@ public class TargetPermanentPowerCount implements DynamicValue { @Override public TargetPermanentPowerCount copy() { - return new TargetPermanentPowerCount(); + return TargetPermanentPowerCount.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ZuberasDiedDynamicValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ZuberasDiedDynamicValue.java index e81289233c..c9310b6311 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ZuberasDiedDynamicValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ZuberasDiedDynamicValue.java @@ -9,20 +9,21 @@ import mage.watchers.common.ZuberasDiedWatcher; /** * Created by Eric on 9/24/2016. */ -public class ZuberasDiedDynamicValue implements DynamicValue { +public enum ZuberasDiedDynamicValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { ZuberasDiedWatcher watcher = game.getState().getWatcher(ZuberasDiedWatcher.class); - if(watcher == null){ + if (watcher == null) { return 0; } - return watcher.getZuberasDiedThisTurn(); + return watcher.getZuberasDiedThisTurn(); } @Override public ZuberasDiedDynamicValue copy() { - return new ZuberasDiedDynamicValue(); + return ZuberasDiedDynamicValue.instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java index e5aabcfe01..434b57f96a 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java @@ -50,7 +50,7 @@ public class SunburstAbility extends EntersBattlefieldAbility { class SunburstEffect extends OneShotEffect { - private static final DynamicValue amount = new SunburstCount(); + private static final DynamicValue amount = SunburstCount.instance; public SunburstEffect() { super(Outcome.Benefit); diff --git a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java index c324972d06..4131d1b323 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java @@ -24,7 +24,7 @@ public final class ObNixilisOfTheBlackOathEmblem extends Emblem { // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." public ObNixilisOfTheBlackOathEmblem() { this.setName("Emblem Nixilis"); - DynamicValue xValue = new SacrificeCostCreaturesPower(); + DynamicValue xValue = SacrificeCostCreaturesPower.instance; Effect effect = new GainLifeEffect(xValue); effect.setText("You gain X life"); Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}")); diff --git a/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java b/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java index bf125dadf4..04fb098a1f 100644 --- a/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java @@ -53,7 +53,7 @@ public class FeedingGroundsPlane extends Plane { this.getAbilities().add(ability); // Active player can roll the planar die: Whenever you roll {CHAOS}, target red or green creature gets X +1/+1 counters - Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), new TargetConvertedManaCost()); + Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), TargetConvertedManaCost.instance); Target chaosTarget = new TargetCreaturePermanent(1, 1, filter, false); List chaosEffects = new ArrayList();