change ManaSpentToCastCondition to enum

This commit is contained in:
Evan Kranzler 2022-11-02 19:41:57 -04:00
parent 3f94bdf944
commit d2f5d8dbed
36 changed files with 59 additions and 58 deletions

View file

@ -32,7 +32,7 @@ public final class AzoriusHerald extends CardImpl {
// When Azorius Herald enters the battlefield, you gain 4 life. // When Azorius Herald enters the battlefield, you gain 4 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4))); this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4)));
// When Azorius Herald enters the battlefield, sacrifice it unless {U} was spent to cast it. // When Azorius Herald enters the battlefield, sacrifice it unless {U} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.BLUE), false));
} }
private AzoriusHerald(final AzoriusHerald card) { private AzoriusHerald(final AzoriusHerald card) {

View file

@ -34,12 +34,12 @@ public final class BatwingBrume extends CardImpl {
// Prevent all combat damage that would be dealt this turn if {W} was spent to cast Batwing Brume. Each player loses 1 life for each attacking creature they control if {B} was spent to cast Batwing Brume. // Prevent all combat damage that would be dealt this turn if {W} was spent to cast Batwing Brume. Each player loses 1 life for each attacking creature they control if {B} was spent to cast Batwing Brume.
Effect effect = new ConditionalReplacementEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true), Effect effect = new ConditionalReplacementEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true),
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.W))); new LockedInCondition(ManaWasSpentCondition.WHITE));
effect.setText("Prevent all combat damage that would be dealt this turn if {W} was spent to cast this spell"); effect.setText("Prevent all combat damage that would be dealt this turn if {W} was spent to cast this spell");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new BatwingBrumeEffect(), new BatwingBrumeEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.B), "Each player loses 1 life for each attacking creature they control if {B} was spent to cast this spell")); ManaWasSpentCondition.BLACK, "Each player loses 1 life for each attacking creature they control if {B} was spent to cast this spell"));
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {W}{B} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {W}{B} was spent.)</i>"));
} }

View file

@ -36,7 +36,7 @@ public final class BorosFuryShield extends CardImpl {
// If {R} was spent to cast Boros Fury-Shield, it deals damage to that creature's controller equal to the creature's power. // If {R} was spent to cast Boros Fury-Shield, it deals damage to that creature's controller equal to the creature's power.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new BorosFuryShieldDamageEffect(), new BorosFuryShieldDamageEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.R), "If {R} was spent to cast this spell, it deals damage to that creature's controller equal to the creature's power")); ManaWasSpentCondition.RED, "If {R} was spent to cast this spell, it deals damage to that creature's controller equal to the creature's power"));
} }
private BorosFuryShield(final BorosFuryShield card) { private BorosFuryShield(final BorosFuryShield card) {

View file

@ -54,8 +54,8 @@ class CankerousThirstEffect extends OneShotEffect {
// Only used for getCondition // Only used for getCondition
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.B), ManaWasSpentCondition.BLACK,
new ManaWasSpentCondition(ColoredManaSymbol.G) ManaWasSpentCondition.RED
); );
public CankerousThirstEffect() { public CankerousThirstEffect() {
@ -76,7 +76,7 @@ class CankerousThirstEffect 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) {
if (new ManaWasSpentCondition(ColoredManaSymbol.B).apply(game, source)) { if (ManaWasSpentCondition.BLACK.apply(game, source)) {
Permanent targetCreature1 = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent targetCreature1 = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature1 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature1.getIdName() + " get -3/-3 until end of turn?", source, game)) { if (targetCreature1 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature1.getIdName() + " get -3/-3 until end of turn?", source, game)) {
ContinuousEffect effect = new BoostTargetEffect(-3, -3, Duration.EndOfTurn); ContinuousEffect effect = new BoostTargetEffect(-3, -3, Duration.EndOfTurn);
@ -84,7 +84,7 @@ class CankerousThirstEffect extends OneShotEffect {
game.addEffect(effect, source); game.addEffect(effect, source);
} }
} }
if (new ManaWasSpentCondition(ColoredManaSymbol.G).apply(game, source)) { if (ManaWasSpentCondition.GREEN.apply(game, source)) {
Permanent targetCreature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent targetCreature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (targetCreature2 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature2.getIdName() + " get +3/+3 until end of turn?", source, game)) { if (targetCreature2 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature2.getIdName() + " get +3/+3 until end of turn?", source, game)) {
ContinuousEffect effect = new BoostTargetEffect(+3, +3, Duration.EndOfTurn); ContinuousEffect effect = new BoostTargetEffect(+3, +3, Duration.EndOfTurn);

View file

@ -33,7 +33,7 @@ public final class CourtHussar extends CardImpl {
// When Court Hussar enters the battlefield, look at the top three cards of your library, then put one of them into your hand and the rest on the bottom of your library in any order. // When Court Hussar enters the battlefield, look at the top three cards of your library, then put one of them into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY))); this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY)));
// When Court Hussar enters the battlefield, sacrifice it unless {W} was spent to cast it. // When Court Hussar enters the battlefield, sacrifice it unless {W} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.WHITE), false));
} }
private CourtHussar(final CourtHussar card) { private CourtHussar(final CourtHussar card) {

View file

@ -48,7 +48,7 @@ public final class CryptChampion extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect())); this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect()));
// When Crypt Champion enters the battlefield, sacrifice it unless {R} was spent to cast it. // When Crypt Champion enters the battlefield, sacrifice it unless {R} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.RED), false));
} }
private CryptChampion(final CryptChampion card) { private CryptChampion(final CryptChampion card) {

View file

@ -26,10 +26,10 @@ public final class DawnglowInfusion extends CardImpl {
DynamicValue xValue = ManacostVariableValue.REGULAR; DynamicValue xValue = ManacostVariableValue.REGULAR;
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 spell")); ManaWasSpentCondition.GREEN, "You gain X life if {G} was spent to cast this spell"));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new GainLifeEffect(xValue), new GainLifeEffect(xValue),
new ManaWasSpentCondition(ColoredManaSymbol.W), "and X life if {W} was spent to cast this spell")); ManaWasSpentCondition.WHITE, "and X life if {W} was spent to cast this spell"));
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {G}{W} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {G}{W} was spent.)</i>"));
} }

View file

@ -32,7 +32,7 @@ public final class DryadsCaress extends CardImpl {
//If {W} was spent to cast Dryad's Caress, untap all creatures you control. //If {W} was spent to cast Dryad's Caress, untap all creatures you control.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), rule), new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), rule),
new ManaWasSpentCondition(ColoredManaSymbol.W), "If {W} was spent to cast this spell, untap all creatures you control")); ManaWasSpentCondition.WHITE, "If {W} was spent to cast this spell, untap all creatures you control"));
} }
private DryadsCaress(final DryadsCaress card) { private DryadsCaress(final DryadsCaress card) {

View file

@ -35,10 +35,10 @@ public final class Firespout extends CardImpl {
// Firespout deals 3 damage to each creature without flying if {R} was spent to cast Firespout and 3 damage to each creature with flying if {G} was spent to cast it. // Firespout deals 3 damage to each creature without flying if {R} was spent to cast Firespout and 3 damage to each creature with flying if {G} was spent to cast it.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageAllEffect(3, filter1), new DamageAllEffect(3, filter1),
new ManaWasSpentCondition(ColoredManaSymbol.R), "{this} deals 3 damage to each creature without flying if {R} was spent to cast this spell")); ManaWasSpentCondition.RED, "{this} deals 3 damage to each creature without flying if {R} was spent to cast this spell"));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageAllEffect(3, filter2), new DamageAllEffect(3, filter2),
new ManaWasSpentCondition(ColoredManaSymbol.G), "and 3 damage to each creature with flying if {G} was spent to cast this spell. <i>(Do both if {R}{G} was spent.)</i>")); ManaWasSpentCondition.GREEN, "and 3 damage to each creature with flying if {G} was spent to cast this spell. <i>(Do both if {R}{G} was spent.)</i>"));
} }
private Firespout(final Firespout card) { private Firespout(final Firespout card) {

View file

@ -37,7 +37,7 @@ public final class FlashConscription extends CardImpl {
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("That creature gains haste until end of turn")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("That creature gains haste until end of turn"));
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new GainAbilityTargetEffect(new FlashConscriptionTriggeredAbility(), Duration.EndOfTurn), new GainAbilityTargetEffect(new FlashConscriptionTriggeredAbility(), Duration.EndOfTurn),
new ManaWasSpentCondition(ColoredManaSymbol.W), ManaWasSpentCondition.WHITE,
"If {W} was spent to cast this spell, the creature gains " "If {W} was spent to cast this spell, the creature gains "
+ "\"Whenever this creature deals combat damage, you gain that much life\" until end of turn" + "\"Whenever this creature deals combat damage, you gain that much life\" until end of turn"
)); ));

View file

@ -30,7 +30,7 @@ public final class GruulScrapper extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
//When Gruul Scrapper enters the battlefield, if Red was spent to cast Gruul Scrapper, it gains haste until end of turn. //When Gruul Scrapper enters the battlefield, if Red was spent to cast Gruul Scrapper, it gains haste until end of turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalContinuousEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaWasSpentCondition(ColoredManaSymbol.R), " if {R} was spent to cast this spell, it gains haste until end of turn"))); this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalContinuousEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), ManaWasSpentCondition.RED, " if {R} was spent to cast this spell, it gains haste until end of turn")));
} }

View file

@ -30,7 +30,7 @@ public final class InduceParanoia extends CardImpl {
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new InduceParanoiaEffect(), new InduceParanoiaEffect(),
new CounterTargetEffect(), new CounterTargetEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.B), "Counter target spell. If {B} was spent to cast this spell, that spell's controller mills X cards, where X is the spell's mana value.")); ManaWasSpentCondition.BLACK, "Counter target spell. If {B} was spent to cast this spell, that spell's controller mills X cards, where X is the spell's mana value."));
// Counter target spell. // Counter target spell.
this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addTarget(new TargetSpell());

View file

@ -39,12 +39,12 @@ public final class InvertTheSkies extends CardImpl {
// Creatures your opponents control lose flying until end of turn if {G} was spent to cast Invert the Skies, and creatures you control gain flying until end of turn if {U} was spent to cast it. // Creatures your opponents control lose flying until end of turn if {G} was spent to cast Invert the Skies, and creatures you control gain flying until end of turn if {U} was spent to cast it.
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new LoseAbilityAllEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, filter), new LoseAbilityAllEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, filter),
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.G)), new LockedInCondition(ManaWasSpentCondition.GREEN),
"Creatures your opponents control lose flying until end of turn if {G} was spent to cast this spell,")); "Creatures your opponents control lose flying until end of turn if {G} was spent to cast this spell,"));
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn),
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.U)), new LockedInCondition(ManaWasSpentCondition.BLUE),
"and creatures you control gain flying until end of turn if {U} was spent to cast this spell")); "and creatures you control gain flying until end of turn if {U} was spent to cast this spell"));
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {G}{U} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {G}{U} was spent.)</i>"));

View file

@ -37,10 +37,10 @@ public final class Moonhold extends CardImpl {
effect2.setText("and can't cast creature spells this turn if {W} was spent to cast this spell."); effect2.setText("and can't cast creature spells this turn if {W} was spent to cast this spell.");
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect( this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(
effect, effect,
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.R)))); new LockedInCondition(ManaWasSpentCondition.RED)));
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect( this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(
effect2, effect2,
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.W)))); new LockedInCondition(ManaWasSpentCondition.WHITE)));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new InfoEffect(" <i>(Do both if {R}{W} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect(" <i>(Do both if {R}{W} was spent.)</i>"));
} }

View file

@ -46,8 +46,8 @@ public final class MythosOfBrokkos extends CardImpl {
class MythosOfBrokkosEffect extends OneShotEffect { class MythosOfBrokkosEffect extends OneShotEffect {
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.U), ManaWasSpentCondition.BLUE,
new ManaWasSpentCondition(ColoredManaSymbol.B) ManaWasSpentCondition.BLACK
); );
private static final FilterCard filter = new FilterPermanentCard("permanent cards"); private static final FilterCard filter = new FilterPermanentCard("permanent cards");

View file

@ -47,8 +47,8 @@ public final class MythosOfIlluna extends CardImpl {
class MythosOfIllunaEffect extends OneShotEffect { class MythosOfIllunaEffect extends OneShotEffect {
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.R), ManaWasSpentCondition.RED,
new ManaWasSpentCondition(ColoredManaSymbol.G) ManaWasSpentCondition.GREEN
); );
MythosOfIllunaEffect() { MythosOfIllunaEffect() {

View file

@ -42,8 +42,8 @@ public final class MythosOfNethroi extends CardImpl {
class MythosOfNethroiEffect extends OneShotEffect { class MythosOfNethroiEffect extends OneShotEffect {
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.G), ManaWasSpentCondition.GREEN,
new ManaWasSpentCondition(ColoredManaSymbol.W) ManaWasSpentCondition.WHITE
); );
MythosOfNethroiEffect() { MythosOfNethroiEffect() {

View file

@ -47,8 +47,8 @@ public class MythosOfSnapdax extends CardImpl {
class MythosOfSnapdaxEffect extends OneShotEffect { class MythosOfSnapdaxEffect extends OneShotEffect {
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.R), ManaWasSpentCondition.RED,
new ManaWasSpentCondition(ColoredManaSymbol.B) ManaWasSpentCondition.BLACK
); );
private static final List<CardType> cardTypes = Arrays.asList( private static final List<CardType> cardTypes = Arrays.asList(
CardType.ARTIFACT, CardType.ARTIFACT,

View file

@ -28,8 +28,8 @@ import static mage.constants.Outcome.Benefit;
public final class MythosOfVadrok extends CardImpl { public final class MythosOfVadrok extends CardImpl {
private static final Condition condition = new CompoundCondition( private static final Condition condition = new CompoundCondition(
new ManaWasSpentCondition(ColoredManaSymbol.W), ManaWasSpentCondition.WHITE,
new ManaWasSpentCondition(ColoredManaSymbol.U) ManaWasSpentCondition.BLUE
); );
public MythosOfVadrok(UUID ownerId, CardSetInfo setInfo) { public MythosOfVadrok(UUID ownerId, CardSetInfo setInfo) {

View file

@ -31,7 +31,7 @@ public final class OgreSavant extends CardImpl {
//When Ogre Savant enters the battlefield, if {U} was spent to cast Ogre Savant, return target creature to its owners hand. //When Ogre Savant enters the battlefield, if {U} was spent to cast Ogre Savant, return target creature to its owners hand.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(),false); TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(),false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.U), this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, ManaWasSpentCondition.BLUE,
"if {U} was spent to cast this spell, return target creature to its owner's hand.")); "if {U} was spent to cast this spell, return target creature to its owner's hand."));
} }

View file

@ -35,7 +35,7 @@ public final class PatagiaViper extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PatagiaViperSnakeToken(), 2), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PatagiaViperSnakeToken(), 2), false));
// When Patagia Viper enters the battlefield, sacrifice it unless {U} was spent to cast it. // When Patagia Viper enters the battlefield, sacrifice it unless {U} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.BLUE), false));
} }
private PatagiaViper(final PatagiaViper card) { private PatagiaViper(final PatagiaViper card) {

View file

@ -37,7 +37,7 @@ public final class Plaxmanta extends CardImpl {
new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES))); new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES)));
// When Plaxmanta enters the battlefield, sacrifice it unless {G} was spent to cast it. // When Plaxmanta enters the battlefield, sacrifice it unless {G} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.G)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.GREEN), false));
} }
private Plaxmanta(final Plaxmanta card) { private Plaxmanta(final Plaxmanta card) {

View file

@ -28,10 +28,10 @@ public final class RepelIntruders extends CardImpl {
target.setRequired(false); target.setRequired(false);
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CreateTokenEffect(new KithkinSoldierToken(), 2), new CreateTokenEffect(new KithkinSoldierToken(), 2),
new ManaWasSpentCondition(ColoredManaSymbol.W), "Create two 1/1 white Kithkin Soldier creature tokens if {W} was spent to cast this spell")); ManaWasSpentCondition.WHITE, "Create two 1/1 white Kithkin Soldier creature tokens if {W} was spent to cast this spell"));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CounterTargetEffect(), new CounterTargetEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.U), "Counter up to one target creature spell if {U} was spent to cast this spell")); ManaWasSpentCondition.BLUE, "Counter up to one target creature spell if {U} was spent to cast this spell"));
this.getSpellAbility().addTarget(target); this.getSpellAbility().addTarget(target);
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {W}{U} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {W}{U} was spent.)</i>"));

View file

@ -31,7 +31,7 @@ public final class RevenantPatriarch extends CardImpl {
// When Revenant Patriarch enters the battlefield, if {W} was spent to cast it, target player skips their next combat phase. // When Revenant Patriarch enters the battlefield, if {W} was spent to cast it, target player skips their next combat phase.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("target player skips their next combat phase."), false); TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("target player skips their next combat phase."), false);
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.W), this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, ManaWasSpentCondition.WHITE,
"if {W} was spent to cast it, target player skips their next combat phase.")); "if {W} was spent to cast it, target player skips their next combat phase."));
// Revenant Patriarch can't block. // Revenant Patriarch can't block.
this.addAbility(new CantBlockAbility()); this.addAbility(new CantBlockAbility());

View file

@ -36,7 +36,7 @@ public final class RibbonsOfNight extends CardImpl {
//If {U} was spent to cast Ribbons of Night, draw a card. //If {U} was spent to cast Ribbons of Night, draw a card.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(1), new DrawCardSourceControllerEffect(1),
new ManaWasSpentCondition(ColoredManaSymbol.U), "If {U} was spent to cast this spell, draw a card")); ManaWasSpentCondition.BLUE, "If {U} was spent to cast this spell, draw a card"));
} }
private RibbonsOfNight(final RibbonsOfNight card) { private RibbonsOfNight(final RibbonsOfNight card) {

View file

@ -29,11 +29,11 @@ public final class RiversGrasp extends CardImpl {
// If {U} was spent to cast River's Grasp, return up to one target creature to its owner's hand. If {B} was spent to cast River's Grasp, target player reveals their hand, you choose a nonland card from it, then that player discards that card. // If {U} was spent to cast River's Grasp, return up to one target creature to its owner's hand. If {B} was spent to cast River's Grasp, target player reveals their hand, you choose a nonland card from it, then that player discards that card.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new ReturnToHandTargetEffect(), new ReturnToHandTargetEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.U), ManaWasSpentCondition.BLUE,
"If {U} was spent to cast this spell, return up to one target creature to its owner's hand")); "If {U} was spent to cast this spell, return up to one target creature to its owner's hand"));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DiscardCardYouChooseTargetEffect(StaticFilters.FILTER_CARD_NON_LAND, TargetController.ANY), new DiscardCardYouChooseTargetEffect(StaticFilters.FILTER_CARD_NON_LAND, TargetController.ANY),
new ManaWasSpentCondition(ColoredManaSymbol.B), ManaWasSpentCondition.BLACK,
"If {B} was spent to cast this spell, target player reveals their hand, you choose a nonland card from it, then that player discards that card") "If {B} was spent to cast this spell, target player reveals their hand, you choose a nonland card from it, then that player discards that card")
.setTargetPointer(new SecondTargetPointer())); .setTargetPointer(new SecondTargetPointer()));

View file

@ -29,7 +29,7 @@ public final class RollingSpoil extends CardImpl {
// If {B} was spent to cast Rolling Spoil, all creatures get -1/-1 until end of turn. // If {B} was spent to cast Rolling Spoil, all creatures get -1/-1 until end of turn.
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostAllEffect(-1, -1, Duration.EndOfTurn), new BoostAllEffect(-1, -1, Duration.EndOfTurn),
new ManaWasSpentCondition(ColoredManaSymbol.B), "If {B} was spent to cast this spell, all creatures get -1/-1 until end of turn")); ManaWasSpentCondition.BLACK, "If {B} was spent to cast this spell, all creatures get -1/-1 until end of turn"));
} }
private RollingSpoil(final RollingSpoil card) { private RollingSpoil(final RollingSpoil card) {

View file

@ -31,7 +31,7 @@ public final class SeedSpark extends CardImpl {
//If {G} was spent to cast Seed Spark, create two 1/1 green Saproling creature tokens. //If {G} was spent to cast Seed Spark, create two 1/1 green Saproling creature tokens.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CreateTokenEffect(new SaprolingToken(), 2), new CreateTokenEffect(new SaprolingToken(), 2),
new ManaWasSpentCondition(ColoredManaSymbol.G), "If {G} was spent to cast this spell, create two 1/1 green Saproling creature tokens")); ManaWasSpentCondition.GREEN, "If {G} was spent to cast this spell, create two 1/1 green Saproling creature tokens"));
} }
private SeedSpark(final SeedSpark card) { private SeedSpark(final SeedSpark card) {

View file

@ -34,7 +34,7 @@ public final class ShriekingGrotesque extends CardImpl {
// When Shrieking Grotesque enters the battlefield, if {B} was spent to cast it, target player discards a card. // When Shrieking Grotesque enters the battlefield, if {B} was spent to cast it, target player discards a card.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1), false); TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1), false);
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.B), this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, ManaWasSpentCondition.BLACK,
"if {B} was spent to cast this spell, target player discards a card.")); "if {B} was spent to cast this spell, target player discards a card."));
} }

View file

@ -49,7 +49,7 @@ public final class SquealingDevil extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// When Squealing Devil enters the battlefield, sacrifice it unless {B} was spent to cast it. // When Squealing Devil enters the battlefield, sacrifice it unless {B} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.B)), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(ManaWasSpentCondition.BLACK), false));
} }

View file

@ -30,7 +30,7 @@ public final class SteamcoreWeird extends CardImpl {
// When Steamcore Weird enters the battlefield, if {R} was spent to cast Steamcore Weird, it deals 2 damage to any target. // When Steamcore Weird enters the battlefield, if {R} was spent to cast Steamcore Weird, it deals 2 damage to any target.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it")); TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it"));
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.R), this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, ManaWasSpentCondition.RED,
"if {R} was spent to cast this spell, it deals 2 damage to any target.")); "if {R} was spent to cast this spell, it deals 2 damage to any target."));
} }

View file

@ -32,7 +32,7 @@ public final class TinStreetHooligan extends CardImpl {
// When Tin Street Hooligan enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact. // When Tin Street Hooligan enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact.
Ability ability = new ConditionalInterveningIfTriggeredAbility( Ability ability = new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()), new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()),
new ManaWasSpentCondition(ColoredManaSymbol.G), ManaWasSpentCondition.GREEN,
"When {this} enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact."); "When {this} enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact.");
ability.addTarget(new TargetArtifactPermanent()); ability.addTarget(new TargetArtifactPermanent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -41,10 +41,10 @@ public final class TorrentOfSouls extends CardImpl {
Target targetPlayer = new TargetPlayer(); Target targetPlayer = new TargetPlayer();
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new ReturnToBattlefieldUnderYourControlTargetEffect(), new ReturnToBattlefieldUnderYourControlTargetEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.B), "Return up to one target creature card from your graveyard to the battlefield if {B} was spent to cast this spell")); ManaWasSpentCondition.BLACK, "Return up to one target creature card from your graveyard to the battlefield if {B} was spent to cast this spell"));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new TorrentOfSoulsEffect(), new TorrentOfSoulsEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.R), "Creatures target player controls get +2/+0 and gain haste until end of turn if {R} was spent to cast this spell")); ManaWasSpentCondition.RED, "Creatures target player controls get +2/+0 and gain haste until end of turn if {R} was spent to cast this spell"));
this.getSpellAbility().addTarget(targetCreature); this.getSpellAbility().addTarget(targetCreature);
this.getSpellAbility().addTarget(targetPlayer); this.getSpellAbility().addTarget(targetPlayer);

View file

@ -26,10 +26,10 @@ public final class UnnervingAssault extends CardImpl {
// Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast Unnerving Assault, and creatures you control get +1/+0 until end of turn if {R} was spent to cast it. // Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast Unnerving Assault, and creatures you control get +1/+0 until end of turn if {R} was spent to cast it.
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostAllEffect(-1, 0, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false), new BoostAllEffect(-1, 0, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false),
new ManaWasSpentCondition(ColoredManaSymbol.U), "Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast this spell,")); ManaWasSpentCondition.BLUE, "Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast this spell,"));
this.getSpellAbility().addEffect(new ConditionalContinuousEffect( this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostControlledEffect(1, 0, Duration.EndOfTurn), new BoostControlledEffect(1, 0, Duration.EndOfTurn),
new ManaWasSpentCondition(ColoredManaSymbol.R), " and creatures you control get +1/+0 until end of turn if {R} was spent to cast this spell")); ManaWasSpentCondition.RED, " and creatures you control get +1/+0 until end of turn if {R} was spent to cast this spell"));
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {U}{R} was spent.)</i>")); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {U}{R} was spent.)</i>"));
} }

View file

@ -49,7 +49,7 @@ public final class VigorMortis extends CardImpl {
class VigorMortisReplacementEffect extends ReplacementEffectImpl { class VigorMortisReplacementEffect extends ReplacementEffectImpl {
private static final Condition condition = new ManaWasSpentCondition(ColoredManaSymbol.G); private static final Condition condition = ManaWasSpentCondition.GREEN;
VigorMortisReplacementEffect() { VigorMortisReplacementEffect() {
super(Duration.EndOfStep, Outcome.BoostCreature); super(Duration.EndOfStep, Outcome.BoostCreature);

View file

@ -1,5 +1,3 @@
package mage.abilities.condition.common; package mage.abilities.condition.common;
import mage.Mana; import mage.Mana;
@ -15,13 +13,16 @@ import mage.watchers.common.ManaSpentToCastWatcher;
* *
* @author LevelX2 * @author LevelX2
*/ */
public enum ManaWasSpentCondition implements Condition {
WHITE(ColoredManaSymbol.W),
public class ManaWasSpentCondition implements Condition { BLUE(ColoredManaSymbol.U),
BLACK(ColoredManaSymbol.B),
RED(ColoredManaSymbol.R),
GREEN(ColoredManaSymbol.G);
protected ColoredManaSymbol coloredManaSymbol; protected ColoredManaSymbol coloredManaSymbol;
public ManaWasSpentCondition(ColoredManaSymbol coloredManaSymbol) { ManaWasSpentCondition(ColoredManaSymbol coloredManaSymbol) {
this.coloredManaSymbol = coloredManaSymbol; this.coloredManaSymbol = coloredManaSymbol;
} }