Merge remote-tracking branch 'origin/master'

This commit is contained in:
Oleg Agafonov 2019-01-13 07:47:20 +04:00
commit 5bc905d717
411 changed files with 1351 additions and 571 deletions

View file

@ -34,7 +34,7 @@ public final class AbandonHope extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// Look at target opponent's hand and choose X cards from it. That player discards those cards. // 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().addEffect(new DiscardCardYouChooseTargetEffect(manaX, TargetController.ANY));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().setCostAdjuster(AbandonHopeAdjuster.instance); this.getSpellAbility().setCostAdjuster(AbandonHopeAdjuster.instance);

View file

@ -1,7 +1,6 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -14,8 +13,9 @@ import mage.constants.*;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class AdamaroFirstToDesire extends CardImpl { public final class AdamaroFirstToDesire extends CardImpl {
@ -60,7 +60,7 @@ class MostCardsInOpponentsHandCount implements DynamicValue {
@Override @Override
public DynamicValue copy() { public DynamicValue copy() {
return new mage.abilities.dynamicvalue.common.CardsInControllerHandCount(); return new MostCardsInOpponentsHandCount();
} }
@Override @Override

View file

@ -36,7 +36,7 @@ public final class AeonChronicler extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// Aeon Chronicler's power and toughness are each equal to the number of cards in your hand. // 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. // Suspend X-{X}{3}{U}. X can't be 0.
this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl("{3}{U}"), this, true)); this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl("{3}{U}"), this, true));

View file

@ -25,7 +25,7 @@ public final class AetherMutation extends CardImpl {
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// create X 1/1 green Saproling creature tokens, where X is that creature's converted mana cost. // 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) { public AetherMutation(final AetherMutation card) {

View file

@ -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. //If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetControllerEffect(new TargetPermanentPowerCount()), new DamageTargetControllerEffect(TargetPermanentPowerCount.instance),
KickedCondition.instance, KickedCondition.instance,
"if this spell was kicked, it deals damage equal to that creature's power to the creature's controller.")); "if this spell was kicked, it deals damage equal to that creature's power to the creature's controller."));

View file

@ -42,7 +42,7 @@ public final class AirdropCondor extends CardImpl {
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to any target. // {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.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)));
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());
this.addAbility(ability); this.addAbility(ability);

View file

@ -49,7 +49,7 @@ public final class AjaniCallerOfThePride extends CardImpl {
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
// -8: create X 2/2 white Cat creature tokens, where X is your life total. // -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) { public AjaniCallerOfThePride(final AjaniCallerOfThePride card) {

View file

@ -44,7 +44,7 @@ public final class AjaniValiantProtector extends CardImpl {
this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.LIBRARY), 1)); 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. // -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."); effect.setText("Put X +1/+1 counters on target creature, where X is your life total.");
ability = new LoyaltyAbility(effect, -11); ability = new LoyaltyAbility(effect, -11);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);

View file

@ -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. // 9: Put X +1/+1 counters on target creature, where X is your life total.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect( Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(
CounterType.P1P1.createInstance(), CounterType.P1P1.createInstance(),
new ControllerLifeCount() ControllerLifeCount.instance
).setText("put X +1/+1 counters on target creature, where X is your life total"), -9); ).setText("put X +1/+1 counters on target creature, where X is your life total"), -9);
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -23,10 +23,10 @@ public final class AlabasterPotion extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{W}"); 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. // 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()); this.getSpellAbility().addTarget(new TargetPlayer());
Mode mode = new Mode(); 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()); mode.addTarget(new TargetAnyTarget());
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
} }

View file

@ -81,7 +81,7 @@ class AmplifireEffect extends OneShotEffect {
game.addEffect(new SetPowerToughnessSourceEffect( game.addEffect(new SetPowerToughnessSourceEffect(
2 * lastCard.getPower().getValue(), 2 * lastCard.getPower().getValue(),
2 * lastCard.getToughness().getValue(), 2 * lastCard.getToughness().getValue(),
Duration.UntilYourNextTurn Duration.UntilYourNextTurn, SubLayer.SetPT_7b
), source); ), source);
} }
player.putCardsOnBottomOfLibrary(cards, game, source, false); player.putCardsOnBottomOfLibrary(cards, game, source, false);

View file

@ -61,7 +61,7 @@ class AncientExcavationEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
DynamicValue numCards = new CardsInControllerHandCount(); DynamicValue numCards = CardsInControllerHandCount.instance;
int amount = numCards.calculate(game, source, this); int amount = numCards.calculate(game, source, this);
player.drawCards(amount, game); player.drawCards(amount, game);
player.discard(amount, false, source, game); player.discard(amount, false, source, game);

View file

@ -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. // Apex Hawks enters the battlefield with a +1/+1 counter on it for each time it was kicked.
this.addAbility(new EntersBattlefieldAbility( 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")); ,"with a +1/+1 counter on it for each time it was kicked"));
} }

View file

@ -43,13 +43,13 @@ public final class ArashiTheSkyAsunder extends CardImpl {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// {X}{G}, {tap}: Arashi, the Sky Asunder deals X damage to target creature with flying. // {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.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability); this.addAbility(ability);
// Channel - {X}{G}{G}, Discard Arashi: Arashi deals X damage to each creature with flying. // 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) { public ArashiTheSkyAsunder(final ArashiTheSkyAsunder card) {

View file

@ -25,7 +25,7 @@ public final class ArtifactMutation extends CardImpl {
this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellAbility().addTarget(new TargetArtifactPermanent());
// create X 1/1 green Saproling creature tokens, where X is that artifact's converted mana cost. // 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) { public ArtifactMutation(final ArtifactMutation card) {

View file

@ -27,7 +27,7 @@ public final class AshenSkinZubera extends CardImpl {
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(2); 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()); ability.addTarget(new TargetOpponent());
this.addAbility(ability, new ZuberasDiedWatcher()); this.addAbility(ability, new ZuberasDiedWatcher());
} }

View file

@ -41,7 +41,7 @@ public final class AtalyaSamiteMaster extends CardImpl {
this.toughness = new MageInt(3); 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. // {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."); 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
@ -55,7 +55,7 @@ public final class AtalyaSamiteMaster extends CardImpl {
// or you gain X life // or you gain X life
Mode mode = new Mode(); 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); ability.addMode(mode);
this.addAbility(ability); this.addAbility(ability);

View file

@ -37,7 +37,7 @@ public final class Atogatog extends CardImpl {
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = 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. // 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, this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostSourceEffect(xValue, xValue,Duration.EndOfTurn), new BoostSourceEffect(xValue, xValue,Duration.EndOfTurn),

View file

@ -25,7 +25,7 @@ public final class AuraMutation extends CardImpl {
this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); this.getSpellAbility().addTarget(new TargetEnchantmentPermanent());
// create X 1/1 green Saproling creature tokens, where X is that enchantment's converted mana cost. // 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) { public AuraMutation(final AuraMutation card) {

View file

@ -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. // 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. // 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 DamageMultiEffect(xValue));
this.getSpellAbility().addEffect(new AureliasFuryEffect()); this.getSpellAbility().addEffect(new AureliasFuryEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue)); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue));

View file

@ -45,7 +45,7 @@ public final class AyliEternalPilgrim extends CardImpl {
this.addAbility(DeathtouchAbility.getInstance()); this.addAbility(DeathtouchAbility.getInstance());
// {1}, Sacrifice another creature: You gain life equal to the sacrificed creature's toughness. // {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"); effect.setText("You gain life equal to the sacrificed creature's toughness");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE))); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)));

View file

@ -25,7 +25,7 @@ public final class BalduvianRage extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{R}");
// Target attacking creature gets +X/+0 until end of turn. // 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())); this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterAttackingCreature()));
// Draw a card at the beginning of the next turn's upkeep. // Draw a card at the beginning of the next turn's upkeep.

View file

@ -30,7 +30,7 @@ public final class BallistaSquad extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// {X}{W}, {T}: Ballista Squad deals X damage to target attacking or blocking creature. // {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.addCost(new TapSourceCost());
ability.addTarget(new TargetAttackingOrBlockingCreature()); ability.addTarget(new TargetAttackingOrBlockingCreature());
this.addAbility(ability); this.addAbility(ability);

View file

@ -32,7 +32,7 @@ public final class BaneOfTheLiving extends CardImpl {
// Morph {X}{B}{B} // Morph {X}{B}{B}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{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. // 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))); this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostAllEffect(morphX, morphX, Duration.EndOfTurn, new FilterCreaturePermanent("all creatures"), false, "", true)));
} }

View file

@ -106,7 +106,7 @@ class BaneFireEffect extends OneShotEffect {
class BanefireCantCounterEffect extends ContinuousRuleModifyingEffectImpl { class BanefireCantCounterEffect extends ContinuousRuleModifyingEffectImpl {
Condition condition = new testCondition(new ManacostVariableValue(), 5); Condition condition = new testCondition(ManacostVariableValue.instance, 5);
public BanefireCantCounterEffect() { public BanefireCantCounterEffect() {
super(Duration.WhileOnStack, Outcome.Benefit); super(Duration.WhileOnStack, Outcome.Benefit);

View file

@ -32,9 +32,9 @@ public final class Banshee extends CardImpl {
this.toughness = new MageInt(1); 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. // {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.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()); ability.addTarget(new TargetAnyTarget());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -45,7 +45,7 @@ public final class BarrageTyrant extends CardImpl {
this.addAbility(new DevoidAbility(this.color)); 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. // {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"); 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)));

View file

@ -27,10 +27,10 @@ public final class BattleAtTheBridge extends CardImpl {
addAbility(new ImproviseAbility()); addAbility(new ImproviseAbility());
// Target creature gets -X/-X until end of turn. You gain X life. // 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().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance));
} }
public BattleAtTheBridge(final BattleAtTheBridge card) { public BattleAtTheBridge(final BattleAtTheBridge card) {

View file

@ -29,8 +29,8 @@ public final class BelbesArmor extends CardImpl {
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new BoostTargetEffect( new BoostTargetEffect(
new MultipliedValue(new ManacostVariableValue(), -1), new MultipliedValue(ManacostVariableValue.instance, -1),
new ManacostVariableValue(), ManacostVariableValue.instance,
Duration.EndOfTurn Duration.EndOfTurn
), ),
new ManaCostsImpl("{X}")); new ManaCostsImpl("{X}"));

View file

@ -43,7 +43,7 @@ public final class Berserk extends CardImpl {
Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target creature gains trample"); effect.setText("Target creature gains trample");
this.getSpellAbility().addEffect(effect); 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"); effect.setText("and gets +X/+0 until end of turn, where X is its power");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new BerserkDestroyEffect()); this.getSpellAbility().addEffect(new BerserkDestroyEffect());

View file

@ -41,6 +41,7 @@ public final class BiogenicUpgrade extends CardImpl {
"one, two, or three target creatures" "one, two, or three target creatures"
)); ));
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, filter)); this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, filter));
this.getSpellAbility().addEffect(new BiogenicUpgradeEffect());
} }
private BiogenicUpgrade(final BiogenicUpgrade card) { private BiogenicUpgrade(final BiogenicUpgrade card) {

View file

@ -22,7 +22,7 @@ public final class BiomassMutation extends CardImpl {
// Creatures you control have base power and toughness X/X until end of turn. // 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)); this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures you control"), true));
} }

View file

@ -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. // {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( ability = new DynamicManaAbility(
Mana.BlackMana(1), Mana.BlackMana(1),
new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance),
new TapSourceCost(), new TapSourceCost(),
"Add {B}, then add {B} for each charge counter removed this way", "Add {B}, then add {B} for each charge counter removed this way",
true, new CountersSourceCount(CounterType.CHARGE)); true, new CountersSourceCount(CounterType.CHARGE));

View file

@ -20,7 +20,7 @@ public final class Blaze extends CardImpl {
// Blaze deals X damage to any target. // 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()); this.getSpellAbility().addTarget(new TargetAnyTarget());
} }

View file

@ -38,7 +38,7 @@ public final class BlazingShoal extends CardImpl {
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter),true))); this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter),true)));
// Target creature gets +X/+0 until end of turn. // 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()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -42,9 +42,9 @@ public final class BloodChinFanatic extends CardImpl {
this.toughness = new MageInt(3); 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. // {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.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"); 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}"));
ability.addEffect(effect2); ability.addEffect(effect2);

View file

@ -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. // 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), 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."); effect.setText("with a +1/+1 counter on it for each creature that died this turn.");
this.addAbility(new EntersBattlefieldAbility(effect), new CreaturesDiedWatcher()); this.addAbility(new EntersBattlefieldAbility(effect), new CreaturesDiedWatcher());
} }

View file

@ -21,7 +21,7 @@ public final class BloodcurdlingScream extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}");
// Target creature gets +X/+0 until end of turn. // 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()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -32,7 +32,7 @@ public final class BloodhuskRitualist extends CardImpl {
this.addAbility(new MultikickerAbility("{B}")); this.addAbility(new MultikickerAbility("{B}"));
// When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked. // 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()); ability.addTarget(new TargetOpponent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -33,7 +33,7 @@ public final class BloodshotCyclops extends CardImpl {
// {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed
// creature's power to any target. // creature's power to any target.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new DamageTargetEffect(new SacrificeCostCreaturesPower()), new DamageTargetEffect(SacrificeCostCreaturesPower.instance),
new TapSourceCost()); new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());

View file

@ -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. // {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( ability = new DynamicManaAbility(
Mana.BlueMana(1), Mana.BlueMana(1),
new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), new IntPlusDynamicValue(1, RemovedCountersForCostValue.instance),
new TapSourceCost(), new TapSourceCost(),
"Add {U}, then add {U} for each charge counter removed this way", "Add {U}, then add {U} for each charge counter removed this way",
true, new CountersSourceCount(CounterType.CHARGE)); true, new CountersSourceCount(CounterType.CHARGE));

View file

@ -21,7 +21,7 @@ public final class BlueSunsZenith extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}{U}{U}"); 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. // 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().addEffect(ShuffleSpellEffect.getInstance());
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -18,7 +18,7 @@ public final class BondOfAgony extends CardImpl {
public BondOfAgony(UUID ownerId, CardSetInfo setInfo) { public BondOfAgony(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}"); 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. // 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 // magenoxx: here we don't use PayVariableLifeCost as {X} shouldn't actually be announced

View file

@ -27,7 +27,7 @@ public final class BorrowingTheEastWind extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G}{G}"); 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. // 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) { public BorrowingTheEastWind(final BorrowingTheEastWind card) {
super(card); super(card);

View file

@ -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. // {tap}, Remove any number of storage counters from Bottomless Vault: Add {B} for each storage counter removed this way.
Ability ability = new DynamicManaAbility( Ability ability = new DynamicManaAbility(
Mana.BlackMana(1), Mana.BlackMana(1),
new RemovedCountersForCostValue(), RemovedCountersForCostValue.instance,
new TapSourceCost(), new TapSourceCost(),
"Add {B} for each storage counter removed this way", "Add {B} for each storage counter removed this way",
true, new CountersSourceCount(CounterType.STORAGE)); true, new CountersSourceCount(CounterType.STORAGE));

View file

@ -118,7 +118,7 @@ class BrainInAJarScryEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
int x = new RemovedCountersForCostValue().calculate(game, source, this); int x = RemovedCountersForCostValue.instance.calculate(game, source, this);
if (x > 0) { if (x > 0) {
return controller.scry(x, source, game); return controller.scry(x, source, game);
} }

View file

@ -21,7 +21,7 @@ public final class Braingeyser extends CardImpl {
// Target player draws X cards. // Target player draws X cards.
this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new DrawCardTargetEffect(ManacostVariableValue.instance));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -29,7 +29,7 @@ public final class Brightflame extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}{R}{W}{W}"); 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. // 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().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().setAbilityWord(AbilityWord.RADIANCE); this.getSpellAbility().setAbilityWord(AbilityWord.RADIANCE);
} }

View file

@ -30,7 +30,7 @@ public final class BrokenAmbitions extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}"); 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. // 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()); this.getSpellAbility().addTarget(new TargetSpell());
} }

View file

@ -69,7 +69,7 @@ class BurnAtTheStakeEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { 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)); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) { if (permanent != null) {

View file

@ -78,7 +78,7 @@ class CabalInterrogatorEffect extends OneShotEffect {
return false; return false;
} }
int amountToReveal = (new ManacostVariableValue()).calculate(game, source, this); int amountToReveal = (ManacostVariableValue.instance).calculate(game, source, this);
Cards revealedCards = new CardsImpl(); Cards revealedCards = new CardsImpl();
if (amountToReveal > 0 && targetPlayer.getHand().size() > amountToReveal) { if (amountToReveal > 0 && targetPlayer.getHand().size() > amountToReveal) {

View file

@ -33,7 +33,7 @@ public final class CacklingWitch extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {X}{B}, {tap}, Discard a card: Target creature gets +X/+0 until end of turn. // {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, Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostTargetEffect(manaX, new StaticValue(0), Duration.EndOfTurn), new BoostTargetEffect(manaX, new StaticValue(0), Duration.EndOfTurn),
new ManaCostsImpl("{X}{B}")); new ManaCostsImpl("{X}{B}"));

View file

@ -36,7 +36,7 @@ public final class CalciformPools extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// {1}, Remove X storage counters from Calciform Pools: Add X mana in any combination of {W} and/or {U}. // {1}, Remove X storage counters from Calciform Pools: Add X mana in any combination of {W} and/or {U}.
ability = new SimpleManaAbility(Zone.BATTLEFIELD, ability = new SimpleManaAbility(Zone.BATTLEFIELD,
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.W, ColoredManaSymbol.U), new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.W, ColoredManaSymbol.U),
new GenericManaCost(1)); new GenericManaCost(1));
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
this.addAbility(ability); this.addAbility(ability);

View file

@ -25,7 +25,7 @@ public final class Carrion extends CardImpl {
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); 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. // 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) { public Carrion(final Carrion card) {

View file

@ -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")); "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. // {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"), .setText("It deals X damage to any target"),
new ManaCostsImpl("{X}")); new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());

View file

@ -82,7 +82,7 @@ enum ChampionOfStraySoulsAdjuster implements TargetAdjuster {
public void adjustTargets(Ability ability, Game game) { public void adjustTargets(Ability ability, Game game) {
for (Effect effect : ability.getEffects()) { for (Effect effect : ability.getEffects()) {
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) { if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
int xValue = new GetXValue().calculate(game, ability, null); int xValue = GetXValue.instance.calculate(game, ability, null);
ability.getTargets().clear(); ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard"))); ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
} }

View file

@ -28,7 +28,7 @@ public final class ChillHaunting extends CardImpl {
// Target creature gets -X/-X until end of turn. // Target creature gets -X/-X until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); 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)); this.getSpellAbility().addEffect(new BoostTargetEffect(xval, xval, Duration.EndOfTurn));
} }

View file

@ -31,7 +31,7 @@ public final class CinderElemental extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// {X}{R}, {tap}, Sacrifice Cinder Elemental: Cinder Elemental deals X damage to any target. // {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 TapSourceCost());
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());

View file

@ -36,16 +36,16 @@ public final class ClanDefiance extends CardImpl {
this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(3); this.getSpellAbility().getModes().setMaxModes(3);
// Clan Defiance deals X damage to target creature with flying; // 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)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
// Clan Defiance deals X damage to target creature without flying; // Clan Defiance deals X damage to target creature without flying;
Mode mode1 = new Mode(); Mode mode1 = new Mode();
mode1.addEffect(new DamageTargetEffect(new ManacostVariableValue())); mode1.addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
mode1.addTarget(new TargetCreaturePermanent(filter2)); mode1.addTarget(new TargetCreaturePermanent(filter2));
this.getSpellAbility().addMode(mode1); this.getSpellAbility().addMode(mode1);
// and/or Clan Defiance deals X damage to target player. // and/or Clan Defiance deals X damage to target player.
Mode mode2 = new Mode(); Mode mode2 = new Mode();
mode2.addEffect(new DamageTargetEffect(new ManacostVariableValue())); mode2.addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
mode2.addTarget(new TargetPlayerOrPlaneswalker()); mode2.addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addMode(mode2); this.getSpellAbility().addMode(mode2);

View file

@ -19,7 +19,7 @@ public final class ClashOfWills extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}");
// Counter target spell unless its controller pays {X}. // 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()); this.getSpellAbility().addTarget(new TargetSpell());
} }

View file

@ -63,7 +63,7 @@ public final class ClockworkAvian extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new AvianAddCountersSourceEffect( new AvianAddCountersSourceEffect(
CounterType.P1P0.createInstance(), CounterType.P1P0.createInstance(),
new ManacostVariableValue(), ManacostVariableValue.instance,
true, true true, true
), ),
new ManaCostsImpl("{X}"), new ManaCostsImpl("{X}"),

View file

@ -59,7 +59,7 @@ public final class ClockworkBeast extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new BeastAddCountersSourceEffect( new BeastAddCountersSourceEffect(
CounterType.P1P0.createInstance(), CounterType.P1P0.createInstance(),
new ManacostVariableValue(), ManacostVariableValue.instance,
true, true true, true
), ),
new ManaCostsImpl("{X}"), new ManaCostsImpl("{X}"),

View file

@ -70,7 +70,7 @@ public final class ClockworkSteed extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new ClockworkSteedAddCountersSourceEffect( new ClockworkSteedAddCountersSourceEffect(
CounterType.P1P0.createInstance(), CounterType.P1P0.createInstance(),
new ManacostVariableValue(), ManacostVariableValue.instance,
true, true true, true
), ),
new ManaCostsImpl("{X}"), new ManaCostsImpl("{X}"),

View file

@ -73,7 +73,7 @@ public final class ClockworkSwarm extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new SwarmAddCountersSourceEffect( new SwarmAddCountersSourceEffect(
CounterType.P1P0.createInstance(), CounterType.P1P0.createInstance(),
new ManacostVariableValue(), ManacostVariableValue.instance,
true, true true, true
), ),
new ManaCostsImpl("{X}"), new ManaCostsImpl("{X}"),

View file

@ -0,0 +1,115 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
import mage.abilities.effects.common.TapEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
* @author L_J
*/
public final class Cocoon extends CardImpl {
public Cocoon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}");
this.subtype.add(SubType.AURA);
// Enchant creature you control
TargetPermanent auraTarget = new TargetControlledCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// When Cocoon enters the battlefield, tap enchanted creature and put three pupa counters on Cocoon.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect());
ability.addEffect(new AddCountersSourceEffect(CounterType.PUPA.createInstance(3)));
this.addAbility(ability);
// Enchanted creature doesnt untap during your untap step if Cocoon has a pupa counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepEnchantedEffect(),
new SourceHasCounterCondition(CounterType.PUPA)).setText("Enchanted creature doesn't untap during its controller's untap step if Cocoon has a pupa counter on it")));
// At the beginning of your upkeep, remove a pupa counter from Cocoon. If you cant, sacrifice it, put a +1/+1 counter on enchanted creature, and that creature gains flying.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CocoonEffect(), TargetController.YOU, false));
}
public Cocoon(final Cocoon card) {
super(card);
}
@Override
public Cocoon copy() {
return new Cocoon(this);
}
}
class CocoonEffect extends OneShotEffect {
CocoonEffect() {
super(Outcome.Sacrifice);
staticText = "remove a pupa counter from {this}. If you cant, sacrifice it, put a +1/+1 counter on enchanted creature, and that creature gains flying";
}
CocoonEffect(final CocoonEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent != null) {
int amount = permanent.getCounters(game).getCount(CounterType.PUPA);
if (amount > 0) {
permanent.removeCounters(CounterType.PUPA.createInstance(), game);
} else {
Permanent enchantedPermanent = game.getPermanent(permanent.getAttachedTo());
permanent.sacrifice(source.getSourceId(), game);
if (enchantedPermanent != null) {
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
effect.setTargetPointer(new FixedTarget(enchantedPermanent, game));
effect.apply(game, source);
ContinuousEffect effect2 = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.Custom);
effect2.setTargetPointer(new FixedTarget(enchantedPermanent, game));
game.addEffect(effect2, source);
}
}
return true;
}
return false;
}
@Override
public CocoonEffect copy() {
return new CocoonEffect(this);
}
}

View file

@ -49,7 +49,7 @@ enum CometStormAdjuster implements TargetAdjuster {
@Override @Override
public void adjustTargets(Ability ability, Game game) { public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear(); 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)); ability.addTarget(new TargetAnyTarget(numbTargets));
} }
} }

View file

@ -21,7 +21,7 @@ public final class Condescend extends CardImpl {
// Counter target spell unless its controller pays {X}. // 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()); this.getSpellAbility().addTarget(new TargetSpell());
// Scry 2. // Scry 2.
this.getSpellAbility().addEffect(new ScryEffect(2)); this.getSpellAbility().addEffect(new ScryEffect(2));

View file

@ -35,7 +35,7 @@ public final class CopperLeafAngel extends CardImpl {
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// {tap}, Sacrifice X lands: Put X +1/+1 counters on Copper-Leaf Angel. // {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)); ability.addCost(new SacrificeXTargetCost(new FilterControlledLandPermanent("lands"), false));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,7 +27,7 @@ public final class CorrosiveGale extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G/P}"); 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) { public CorrosiveGale(final CorrosiveGale card) {

View file

@ -24,8 +24,8 @@ public final class CratersClaws extends CardImpl {
// Crater's Claws deals X damage to any target. // Crater's Claws deals X damage to any target.
// <i>Ferocious</i> &mdash; Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater. // <i>Ferocious</i> &mdash; 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( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetEffect(new IntPlusDynamicValue(2, new ManacostVariableValue())), new DamageTargetEffect(new IntPlusDynamicValue(2, ManacostVariableValue.instance)),
new DamageTargetEffect(new ManacostVariableValue()), new DamageTargetEffect(ManacostVariableValue.instance),
FerociousCondition.instance, FerociousCondition.instance,
"{this} deals X damage to any target." "{this} deals X damage to any target."
+ "<br><i>Ferocious</i> &mdash; {this} deals X plus 2 damage to that permanent or player instead if you control a creature with power 4 or greater")); + "<br><i>Ferocious</i> &mdash; {this} deals X plus 2 damage to that permanent or player instead if you control a creature with power 4 or greater"));

View file

@ -35,7 +35,7 @@ public final class CreatureBond extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// When enchanted creature dies, Creature Bond deals damage equal to that creature's toughness to the creature's controller. // 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) { public CreatureBond(final CreatureBond card) {

View file

@ -43,7 +43,7 @@ public final class CrimsonHellkite extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// {X}, {tap}: Crimson Hellkite deals X damage to target creature. Spend only red mana on X. // {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"); 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());

View file

@ -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. // {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( ability = new ConditionalAnyColorManaAbility(
new TapSourceCost(), new TapSourceCost(),
new RemovedCountersForCostValue(), RemovedCountersForCostValue.instance,
new CrucibleOfTheSpiritDragonManaBuilder(), new CrucibleOfTheSpiritDragonManaBuilder(),
false false
); );

View file

@ -44,7 +44,7 @@ public final class CruelSadist extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// {2}{B}, {T}, Remove X +1/+1 counters from Cruel Sadist: Cruel Sadist deals X damage to target creature. // {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"); effect.setText("{this} deals X damage to target creature");
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}")); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());

View file

@ -38,7 +38,7 @@ public final class CryptRats extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana on X. // {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"); 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}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect,new ManaCostsImpl("{X}"));
VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0); VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0);

View file

@ -29,7 +29,7 @@ public final class CutRibbons extends SplitCard {
// Ribbons // Ribbons
// Each opponent loses X life. // Each opponent loses X life.
getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true)); getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true));
getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(new ManacostVariableValue())); getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(ManacostVariableValue.instance));
} }

View file

@ -59,7 +59,7 @@ public final class DamiaSageOfStone extends CardImpl {
class DamiaSageOfStoneTriggeredAbility extends BeginningOfUpkeepTriggeredAbility { class DamiaSageOfStoneTriggeredAbility extends BeginningOfUpkeepTriggeredAbility {
DamiaSageOfStoneTriggeredAbility() { 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) { DamiaSageOfStoneTriggeredAbility(final DamiaSageOfStoneTriggeredAbility ability) {

View file

@ -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. // 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()); 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"); effect.setText("Target player creates X 2/2 black Zombie creature tokens");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
DynamicValue value = new ZombiesControlledByTargetPlayerCount(); DynamicValue value = new ZombiesControlledByTargetPlayerCount();

View file

@ -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. // 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( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new GainLifeEffect(xValue), new GainLifeEffect(xValue),
new ManaWasSpentCondition(ColoredManaSymbol.G), "You gain X life if {G} was spent to cast {this}")); new ManaWasSpentCondition(ColoredManaSymbol.G), "You gain X life if {G} was spent to cast {this}"));

View file

@ -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. // 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)); this.getSpellAbility().addEffect(new LoseLifeAllPlayersEffect(xValue));
Effect effect = new DiscardEachPlayerEffect(xValue, false); Effect effect = new DiscardEachPlayerEffect(xValue, false);
effect.setText(", discards X cards"); effect.setText(", discards X cards");

View file

@ -21,8 +21,8 @@ public final class DeathGrasp extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{W}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{W}{B}");
this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance));
this.getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellAbility().addTarget(new TargetAnyTarget());
} }

View file

@ -35,7 +35,7 @@ public final class DeathMutation extends CardImpl {
this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addTarget(new TargetPermanent(filter));
// create X 1/1 green Saproling creature tokens, where X is that creature's converted mana cost. // 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) { public DeathMutation(final DeathMutation card) {

View file

@ -22,7 +22,7 @@ public final class DeathWind extends CardImpl {
// Target creature gets -X/-X until end of turn. // 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().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -69,7 +69,7 @@ class DeathforgeShamanEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
DynamicValue value = new MultikickerCount(); DynamicValue value = MultikickerCount.instance;
int damage = value.calculate(game, source, this) * 2; int damage = value.calculate(game, source, this) * 2;
return new DamageTargetEffect(damage).apply(game, source); return new DamageTargetEffect(damage).apply(game, source);
} }

View file

@ -28,7 +28,7 @@ public final class DeathsShadow extends CardImpl {
this.toughness = new MageInt(13); this.toughness = new MageInt(13);
// Death's Shadow gets -X/-X, where X is your life total. // 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))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.WhileOnBattlefield)));
} }

View file

@ -32,7 +32,7 @@ public final class DecreeOfJustice extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{2}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{2}{W}{W}");
// Create X 4/4 white Angel creature tokens with flying. // 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} // Cycling {2}{W}
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}"))); this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}")));

View file

@ -31,7 +31,7 @@ public final class Demonfire extends CardImpl {
// Demonfire deals X damage to any target. // Demonfire deals X damage to any target.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetEffect(new ManacostVariableValue()), new DamageTargetEffect(ManacostVariableValue.instance),
new InvertCondition(HellbentCondition.instance), new InvertCondition(HellbentCondition.instance),
"{this} deals X damage to any target")); "{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. // 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( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetEffect(new ManacostVariableValue(), false), new DamageTargetEffect(ManacostVariableValue.instance, false),
HellbentCondition.instance, HellbentCondition.instance,
"<br/><i>Hellbent</i> &mdash; If you have no cards in hand, this spell can't be countered and the damage can't be prevented.")); "<br/><i>Hellbent</i> &mdash; If you have no cards in hand, this spell can't be countered and the damage can't be prevented."));
// can't be countered // can't be countered

View file

@ -28,7 +28,7 @@ public final class DescendantOfSoramaro extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(3); 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. // {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"); 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, this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
effect, new ManaCostsImpl("{1}{U}"))); effect, new ManaCostsImpl("{1}{U}")));

View file

@ -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. // 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().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetArtifactPermanent(new FilterArtifactPermanent("artifact with converted mana cost X"))); 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"); effect.setText("{this} deals X damage to that artifact's controller");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().setTargetAdjuster(DetonateAdjuster.instance); this.getSpellAbility().setTargetAdjuster(DetonateAdjuster.instance);

View file

@ -32,10 +32,10 @@ public final class DevastatingDreams extends CardImpl {
this.getSpellAbility().addCost(new DevastatingDreamsAdditionalCost()); this.getSpellAbility().addCost(new DevastatingDreamsAdditionalCost());
// Each player sacrifices X lands. // 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. // 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) { public DevastatingDreams(final DevastatingDreams card) {

View file

@ -55,8 +55,8 @@ class DevastatingSummonsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
DevastatingSummonsElementalToken token = new DevastatingSummonsElementalToken(); DevastatingSummonsElementalToken token = new DevastatingSummonsElementalToken();
token.getPower().modifyBaseValue(new GetXValue().calculate(game, source, this)); token.getPower().modifyBaseValue(GetXValue.instance.calculate(game, source, this));
token.getToughness().modifyBaseValue(new GetXValue().calculate(game, source, this)); token.getToughness().modifyBaseValue(GetXValue.instance.calculate(game, source, this));
token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId()); token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId());

View file

@ -23,7 +23,7 @@ public final class DevilsPlay extends CardImpl {
// Devil's Play deals X damage to any target. // 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()); this.getSpellAbility().addTarget(new TargetAnyTarget());
// Flashback {X}{R}{R}{R} // Flashback {X}{R}{R}{R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{R}{R}{R}"), TimingRule.SORCERY)); this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{R}{R}{R}"), TimingRule.SORCERY));

View file

@ -58,7 +58,7 @@ class DiabolicRevelationEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { 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()); TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard());
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());

View file

@ -25,7 +25,7 @@ public final class DiamondValley extends CardImpl {
public DiamondValley(UUID ownerId, CardSetInfo setInfo) { public DiamondValley(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); 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"); effect.setText("You gain life equal to the sacrificed creature's toughness");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));

View file

@ -23,7 +23,7 @@ public final class Disintegrate extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}"); 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. // 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")); this.getSpellAbility().addEffect(new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature"));
Effect effect = new ExileTargetIfDiesEffect(); Effect effect = new ExileTargetIfDiesEffect();
effect.setText("If the creature would die this turn, exile it instead"); effect.setText("If the creature would die this turn, exile it instead");

View file

@ -23,7 +23,7 @@ public final class DivineOffering extends CardImpl {
// Destroy target artifact. You gain life equal to its converted mana cost. // Destroy target artifact. You gain life equal to its converted mana cost.
this.getSpellAbility().addEffect(new DestroyTargetEffect()); 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"); effect.setText("You gain life equal to its converted mana cost");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellAbility().addTarget(new TargetArtifactPermanent());

View file

@ -37,8 +37,8 @@ public final class DranaKalastriaBloodchief extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance()); 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 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(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn)); ability.addEffect(new BoostSourceEffect(ManacostVariableValue.instance, new StaticValue(0), Duration.EndOfTurn));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -32,7 +32,7 @@ public final class DreadSlag extends CardImpl {
// Trample // Trample
this.addAbility(TrampleAbility.getInstance()); this.addAbility(TrampleAbility.getInstance());
// Dread Slag gets -4/-4 for each card in your hand. // 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 effect = new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield);
effect.setText("{this} gets -4/-4 for each card in your hand"); effect.setText("{this} gets -4/-4 for each card in your hand");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -36,7 +36,7 @@ public final class DreadshipReef extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// {1}, Remove X storage counters from Dreadship Reef: Add X mana in any combination of {U} and/or {B}. // {1}, Remove X storage counters from Dreadship Reef: Add X mana in any combination of {U} and/or {B}.
ability = new SimpleManaAbility(Zone.BATTLEFIELD, ability = new SimpleManaAbility(Zone.BATTLEFIELD,
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.U, ColoredManaSymbol.B), new AddManaInAnyCombinationEffect(RemovedCountersForCostValue.instance, ColoredManaSymbol.U, ColoredManaSymbol.B),
new GenericManaCost(1)); new GenericManaCost(1));
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance())); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
this.addAbility(ability); this.addAbility(ability);

View file

@ -25,7 +25,7 @@ public final class DreambornMuse extends CardImpl {
this.toughness = new MageInt(2); 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. // 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."); 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)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false));

Some files were not shown because too many files have changed in this diff Show more