From d2f5d8dbedb6100efd488541ad6dc76cd49fc2df Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 2 Nov 2022 19:41:57 -0400 Subject: [PATCH] change ManaSpentToCastCondition to enum --- Mage.Sets/src/mage/cards/a/AzoriusHerald.java | 2 +- Mage.Sets/src/mage/cards/b/BatwingBrume.java | 4 ++-- Mage.Sets/src/mage/cards/b/BorosFuryShield.java | 2 +- Mage.Sets/src/mage/cards/c/CankerousThirst.java | 8 ++++---- Mage.Sets/src/mage/cards/c/CourtHussar.java | 2 +- Mage.Sets/src/mage/cards/c/CryptChampion.java | 2 +- Mage.Sets/src/mage/cards/d/DawnglowInfusion.java | 4 ++-- Mage.Sets/src/mage/cards/d/DryadsCaress.java | 2 +- Mage.Sets/src/mage/cards/f/Firespout.java | 4 ++-- Mage.Sets/src/mage/cards/f/FlashConscription.java | 2 +- Mage.Sets/src/mage/cards/g/GruulScrapper.java | 2 +- Mage.Sets/src/mage/cards/i/InduceParanoia.java | 2 +- Mage.Sets/src/mage/cards/i/InvertTheSkies.java | 4 ++-- Mage.Sets/src/mage/cards/m/Moonhold.java | 4 ++-- Mage.Sets/src/mage/cards/m/MythosOfBrokkos.java | 4 ++-- Mage.Sets/src/mage/cards/m/MythosOfIlluna.java | 4 ++-- Mage.Sets/src/mage/cards/m/MythosOfNethroi.java | 4 ++-- Mage.Sets/src/mage/cards/m/MythosOfSnapdax.java | 4 ++-- Mage.Sets/src/mage/cards/m/MythosOfVadrok.java | 4 ++-- Mage.Sets/src/mage/cards/o/OgreSavant.java | 2 +- Mage.Sets/src/mage/cards/p/PatagiaViper.java | 2 +- Mage.Sets/src/mage/cards/p/Plaxmanta.java | 2 +- Mage.Sets/src/mage/cards/r/RepelIntruders.java | 4 ++-- Mage.Sets/src/mage/cards/r/RevenantPatriarch.java | 2 +- Mage.Sets/src/mage/cards/r/RibbonsOfNight.java | 2 +- Mage.Sets/src/mage/cards/r/RiversGrasp.java | 4 ++-- Mage.Sets/src/mage/cards/r/RollingSpoil.java | 2 +- Mage.Sets/src/mage/cards/s/SeedSpark.java | 2 +- Mage.Sets/src/mage/cards/s/ShriekingGrotesque.java | 2 +- Mage.Sets/src/mage/cards/s/SquealingDevil.java | 2 +- Mage.Sets/src/mage/cards/s/SteamcoreWeird.java | 2 +- Mage.Sets/src/mage/cards/t/TinStreetHooligan.java | 2 +- Mage.Sets/src/mage/cards/t/TorrentOfSouls.java | 4 ++-- Mage.Sets/src/mage/cards/u/UnnervingAssault.java | 4 ++-- Mage.Sets/src/mage/cards/v/VigorMortis.java | 2 +- .../condition/common/ManaWasSpentCondition.java | 13 +++++++------ 36 files changed, 59 insertions(+), 58 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AzoriusHerald.java b/Mage.Sets/src/mage/cards/a/AzoriusHerald.java index 72008c3960..678eebc83b 100644 --- a/Mage.Sets/src/mage/cards/a/AzoriusHerald.java +++ b/Mage.Sets/src/mage/cards/a/AzoriusHerald.java @@ -32,7 +32,7 @@ public final class AzoriusHerald extends CardImpl { // When Azorius Herald enters the battlefield, you gain 4 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4))); // 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) { diff --git a/Mage.Sets/src/mage/cards/b/BatwingBrume.java b/Mage.Sets/src/mage/cards/b/BatwingBrume.java index 2f70da8394..0b5b985ee7 100644 --- a/Mage.Sets/src/mage/cards/b/BatwingBrume.java +++ b/Mage.Sets/src/mage/cards/b/BatwingBrume.java @@ -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. 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"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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("(Do both if {W}{B} was spent.)")); } diff --git a/Mage.Sets/src/mage/cards/b/BorosFuryShield.java b/Mage.Sets/src/mage/cards/b/BorosFuryShield.java index dd7b6d6de4..609ad0e9d5 100644 --- a/Mage.Sets/src/mage/cards/b/BorosFuryShield.java +++ b/Mage.Sets/src/mage/cards/b/BorosFuryShield.java @@ -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. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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) { diff --git a/Mage.Sets/src/mage/cards/c/CankerousThirst.java b/Mage.Sets/src/mage/cards/c/CankerousThirst.java index 803f6f9d18..2b616a4936 100644 --- a/Mage.Sets/src/mage/cards/c/CankerousThirst.java +++ b/Mage.Sets/src/mage/cards/c/CankerousThirst.java @@ -54,8 +54,8 @@ class CankerousThirstEffect extends OneShotEffect { // Only used for getCondition private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.B), - new ManaWasSpentCondition(ColoredManaSymbol.G) + ManaWasSpentCondition.BLACK, + ManaWasSpentCondition.RED ); public CankerousThirstEffect() { @@ -76,7 +76,7 @@ class CankerousThirstEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); 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)); 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); @@ -84,7 +84,7 @@ class CankerousThirstEffect extends OneShotEffect { 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()); 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); diff --git a/Mage.Sets/src/mage/cards/c/CourtHussar.java b/Mage.Sets/src/mage/cards/c/CourtHussar.java index 0e39a447f3..847bd1e7e5 100644 --- a/Mage.Sets/src/mage/cards/c/CourtHussar.java +++ b/Mage.Sets/src/mage/cards/c/CourtHussar.java @@ -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. 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. - 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) { diff --git a/Mage.Sets/src/mage/cards/c/CryptChampion.java b/Mage.Sets/src/mage/cards/c/CryptChampion.java index 1b30f26a4c..9c52383a4c 100644 --- a/Mage.Sets/src/mage/cards/c/CryptChampion.java +++ b/Mage.Sets/src/mage/cards/c/CryptChampion.java @@ -48,7 +48,7 @@ public final class CryptChampion extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect())); // 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) { diff --git a/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java b/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java index 029e6fb807..4b33429655 100644 --- a/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java +++ b/Mage.Sets/src/mage/cards/d/DawnglowInfusion.java @@ -26,10 +26,10 @@ public final class DawnglowInfusion extends CardImpl { DynamicValue xValue = ManacostVariableValue.REGULAR; this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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( 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("(Do both if {G}{W} was spent.)")); } diff --git a/Mage.Sets/src/mage/cards/d/DryadsCaress.java b/Mage.Sets/src/mage/cards/d/DryadsCaress.java index d0bb8b4535..c693a8b545 100644 --- a/Mage.Sets/src/mage/cards/d/DryadsCaress.java +++ b/Mage.Sets/src/mage/cards/d/DryadsCaress.java @@ -32,7 +32,7 @@ public final class DryadsCaress extends CardImpl { //If {W} was spent to cast Dryad's Caress, untap all creatures you control. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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) { diff --git a/Mage.Sets/src/mage/cards/f/Firespout.java b/Mage.Sets/src/mage/cards/f/Firespout.java index 232736848b..6f894b1fd1 100644 --- a/Mage.Sets/src/mage/cards/f/Firespout.java +++ b/Mage.Sets/src/mage/cards/f/Firespout.java @@ -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. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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( new DamageAllEffect(3, filter2), - new ManaWasSpentCondition(ColoredManaSymbol.G), "and 3 damage to each creature with flying if {G} was spent to cast this spell. (Do both if {R}{G} was spent.)")); + ManaWasSpentCondition.GREEN, "and 3 damage to each creature with flying if {G} was spent to cast this spell. (Do both if {R}{G} was spent.)")); } private Firespout(final Firespout card) { diff --git a/Mage.Sets/src/mage/cards/f/FlashConscription.java b/Mage.Sets/src/mage/cards/f/FlashConscription.java index 3600f8622f..db1d3f0f7c 100644 --- a/Mage.Sets/src/mage/cards/f/FlashConscription.java +++ b/Mage.Sets/src/mage/cards/f/FlashConscription.java @@ -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 ConditionalContinuousEffect( new GainAbilityTargetEffect(new FlashConscriptionTriggeredAbility(), Duration.EndOfTurn), - new ManaWasSpentCondition(ColoredManaSymbol.W), + ManaWasSpentCondition.WHITE, "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" )); diff --git a/Mage.Sets/src/mage/cards/g/GruulScrapper.java b/Mage.Sets/src/mage/cards/g/GruulScrapper.java index c2ba1a253e..f67a55473f 100644 --- a/Mage.Sets/src/mage/cards/g/GruulScrapper.java +++ b/Mage.Sets/src/mage/cards/g/GruulScrapper.java @@ -30,7 +30,7 @@ public final class GruulScrapper extends CardImpl { 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. - 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"))); } diff --git a/Mage.Sets/src/mage/cards/i/InduceParanoia.java b/Mage.Sets/src/mage/cards/i/InduceParanoia.java index 724e6c0ab6..47f68d091d 100644 --- a/Mage.Sets/src/mage/cards/i/InduceParanoia.java +++ b/Mage.Sets/src/mage/cards/i/InduceParanoia.java @@ -30,7 +30,7 @@ public final class InduceParanoia extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new InduceParanoiaEffect(), 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. this.getSpellAbility().addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/cards/i/InvertTheSkies.java b/Mage.Sets/src/mage/cards/i/InvertTheSkies.java index 4d484900c9..49010cec24 100644 --- a/Mage.Sets/src/mage/cards/i/InvertTheSkies.java +++ b/Mage.Sets/src/mage/cards/i/InvertTheSkies.java @@ -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. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( 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,")); this.getSpellAbility().addEffect(new ConditionalContinuousEffect( 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")); this.getSpellAbility().addEffect(new InfoEffect("(Do both if {G}{U} was spent.)")); diff --git a/Mage.Sets/src/mage/cards/m/Moonhold.java b/Mage.Sets/src/mage/cards/m/Moonhold.java index d1d169b00b..a88a9b4b08 100644 --- a/Mage.Sets/src/mage/cards/m/Moonhold.java +++ b/Mage.Sets/src/mage/cards/m/Moonhold.java @@ -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."); this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect( effect, - new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.R)))); + new LockedInCondition(ManaWasSpentCondition.RED))); this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect( effect2, - new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.W)))); + new LockedInCondition(ManaWasSpentCondition.WHITE))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new InfoEffect(" (Do both if {R}{W} was spent.)")); } diff --git a/Mage.Sets/src/mage/cards/m/MythosOfBrokkos.java b/Mage.Sets/src/mage/cards/m/MythosOfBrokkos.java index bf73a35ea2..b037af9188 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfBrokkos.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfBrokkos.java @@ -46,8 +46,8 @@ public final class MythosOfBrokkos extends CardImpl { class MythosOfBrokkosEffect extends OneShotEffect { private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.U), - new ManaWasSpentCondition(ColoredManaSymbol.B) + ManaWasSpentCondition.BLUE, + ManaWasSpentCondition.BLACK ); private static final FilterCard filter = new FilterPermanentCard("permanent cards"); diff --git a/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java b/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java index 0f91420dcd..64211969b4 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java @@ -47,8 +47,8 @@ public final class MythosOfIlluna extends CardImpl { class MythosOfIllunaEffect extends OneShotEffect { private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.R), - new ManaWasSpentCondition(ColoredManaSymbol.G) + ManaWasSpentCondition.RED, + ManaWasSpentCondition.GREEN ); MythosOfIllunaEffect() { diff --git a/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java b/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java index cb2152248c..fb611e9e2d 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java @@ -42,8 +42,8 @@ public final class MythosOfNethroi extends CardImpl { class MythosOfNethroiEffect extends OneShotEffect { private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.G), - new ManaWasSpentCondition(ColoredManaSymbol.W) + ManaWasSpentCondition.GREEN, + ManaWasSpentCondition.WHITE ); MythosOfNethroiEffect() { diff --git a/Mage.Sets/src/mage/cards/m/MythosOfSnapdax.java b/Mage.Sets/src/mage/cards/m/MythosOfSnapdax.java index 9195528ca7..a87c7ba1ea 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfSnapdax.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfSnapdax.java @@ -47,8 +47,8 @@ public class MythosOfSnapdax extends CardImpl { class MythosOfSnapdaxEffect extends OneShotEffect { private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.R), - new ManaWasSpentCondition(ColoredManaSymbol.B) + ManaWasSpentCondition.RED, + ManaWasSpentCondition.BLACK ); private static final List cardTypes = Arrays.asList( CardType.ARTIFACT, diff --git a/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java b/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java index d93dc7196c..fdd3371ca8 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java @@ -28,8 +28,8 @@ import static mage.constants.Outcome.Benefit; public final class MythosOfVadrok extends CardImpl { private static final Condition condition = new CompoundCondition( - new ManaWasSpentCondition(ColoredManaSymbol.W), - new ManaWasSpentCondition(ColoredManaSymbol.U) + ManaWasSpentCondition.WHITE, + ManaWasSpentCondition.BLUE ); public MythosOfVadrok(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/o/OgreSavant.java b/Mage.Sets/src/mage/cards/o/OgreSavant.java index 278af44e90..52fa57c1db 100644 --- a/Mage.Sets/src/mage/cards/o/OgreSavant.java +++ b/Mage.Sets/src/mage/cards/o/OgreSavant.java @@ -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 owner’s hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(),false); 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.")); } diff --git a/Mage.Sets/src/mage/cards/p/PatagiaViper.java b/Mage.Sets/src/mage/cards/p/PatagiaViper.java index a1bc8f971f..c43cc985d1 100644 --- a/Mage.Sets/src/mage/cards/p/PatagiaViper.java +++ b/Mage.Sets/src/mage/cards/p/PatagiaViper.java @@ -35,7 +35,7 @@ public final class PatagiaViper extends CardImpl { 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. - 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) { diff --git a/Mage.Sets/src/mage/cards/p/Plaxmanta.java b/Mage.Sets/src/mage/cards/p/Plaxmanta.java index 8e84e2573f..9080dc9550 100644 --- a/Mage.Sets/src/mage/cards/p/Plaxmanta.java +++ b/Mage.Sets/src/mage/cards/p/Plaxmanta.java @@ -37,7 +37,7 @@ public final class Plaxmanta extends CardImpl { new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES))); // 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) { diff --git a/Mage.Sets/src/mage/cards/r/RepelIntruders.java b/Mage.Sets/src/mage/cards/r/RepelIntruders.java index 05a421df30..cd20d75b7b 100644 --- a/Mage.Sets/src/mage/cards/r/RepelIntruders.java +++ b/Mage.Sets/src/mage/cards/r/RepelIntruders.java @@ -28,10 +28,10 @@ public final class RepelIntruders extends CardImpl { target.setRequired(false); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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( 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().addEffect(new InfoEffect("(Do both if {W}{U} was spent.)")); diff --git a/Mage.Sets/src/mage/cards/r/RevenantPatriarch.java b/Mage.Sets/src/mage/cards/r/RevenantPatriarch.java index c0afb01cd2..66fd07ad9a 100644 --- a/Mage.Sets/src/mage/cards/r/RevenantPatriarch.java +++ b/Mage.Sets/src/mage/cards/r/RevenantPatriarch.java @@ -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. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("target player skips their next combat phase."), false); 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.")); // Revenant Patriarch can't block. this.addAbility(new CantBlockAbility()); diff --git a/Mage.Sets/src/mage/cards/r/RibbonsOfNight.java b/Mage.Sets/src/mage/cards/r/RibbonsOfNight.java index c3bf13ddb8..f5dcfa52a8 100644 --- a/Mage.Sets/src/mage/cards/r/RibbonsOfNight.java +++ b/Mage.Sets/src/mage/cards/r/RibbonsOfNight.java @@ -36,7 +36,7 @@ public final class RibbonsOfNight extends CardImpl { //If {U} was spent to cast Ribbons of Night, draw a card. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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) { diff --git a/Mage.Sets/src/mage/cards/r/RiversGrasp.java b/Mage.Sets/src/mage/cards/r/RiversGrasp.java index e5fd3a9c48..2136a51891 100644 --- a/Mage.Sets/src/mage/cards/r/RiversGrasp.java +++ b/Mage.Sets/src/mage/cards/r/RiversGrasp.java @@ -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. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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") .setTargetPointer(new SecondTargetPointer())); diff --git a/Mage.Sets/src/mage/cards/r/RollingSpoil.java b/Mage.Sets/src/mage/cards/r/RollingSpoil.java index 15e322bc6b..e7ea516150 100644 --- a/Mage.Sets/src/mage/cards/r/RollingSpoil.java +++ b/Mage.Sets/src/mage/cards/r/RollingSpoil.java @@ -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. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( 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) { diff --git a/Mage.Sets/src/mage/cards/s/SeedSpark.java b/Mage.Sets/src/mage/cards/s/SeedSpark.java index d9caeb7e27..36e0b976ed 100644 --- a/Mage.Sets/src/mage/cards/s/SeedSpark.java +++ b/Mage.Sets/src/mage/cards/s/SeedSpark.java @@ -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. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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) { diff --git a/Mage.Sets/src/mage/cards/s/ShriekingGrotesque.java b/Mage.Sets/src/mage/cards/s/ShriekingGrotesque.java index 638d1f2049..8efb3ea643 100644 --- a/Mage.Sets/src/mage/cards/s/ShriekingGrotesque.java +++ b/Mage.Sets/src/mage/cards/s/ShriekingGrotesque.java @@ -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. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1), false); 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.")); } diff --git a/Mage.Sets/src/mage/cards/s/SquealingDevil.java b/Mage.Sets/src/mage/cards/s/SquealingDevil.java index 81f84ed77d..a26b98884f 100644 --- a/Mage.Sets/src/mage/cards/s/SquealingDevil.java +++ b/Mage.Sets/src/mage/cards/s/SquealingDevil.java @@ -49,7 +49,7 @@ public final class SquealingDevil extends CardImpl { this.addAbility(ability); // 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)); } diff --git a/Mage.Sets/src/mage/cards/s/SteamcoreWeird.java b/Mage.Sets/src/mage/cards/s/SteamcoreWeird.java index 7333d208fa..8c2ace9527 100644 --- a/Mage.Sets/src/mage/cards/s/SteamcoreWeird.java +++ b/Mage.Sets/src/mage/cards/s/SteamcoreWeird.java @@ -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. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it")); 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.")); } diff --git a/Mage.Sets/src/mage/cards/t/TinStreetHooligan.java b/Mage.Sets/src/mage/cards/t/TinStreetHooligan.java index 00d1d4cc7d..5a938434cf 100644 --- a/Mage.Sets/src/mage/cards/t/TinStreetHooligan.java +++ b/Mage.Sets/src/mage/cards/t/TinStreetHooligan.java @@ -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. Ability ability = new ConditionalInterveningIfTriggeredAbility( 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."); ability.addTarget(new TargetArtifactPermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/TorrentOfSouls.java b/Mage.Sets/src/mage/cards/t/TorrentOfSouls.java index 28dd0af542..f899ea8914 100644 --- a/Mage.Sets/src/mage/cards/t/TorrentOfSouls.java +++ b/Mage.Sets/src/mage/cards/t/TorrentOfSouls.java @@ -41,10 +41,10 @@ public final class TorrentOfSouls extends CardImpl { Target targetPlayer = new TargetPlayer(); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( 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( 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(targetPlayer); diff --git a/Mage.Sets/src/mage/cards/u/UnnervingAssault.java b/Mage.Sets/src/mage/cards/u/UnnervingAssault.java index 200334dccb..5e1c2d1fad 100644 --- a/Mage.Sets/src/mage/cards/u/UnnervingAssault.java +++ b/Mage.Sets/src/mage/cards/u/UnnervingAssault.java @@ -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. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( 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( 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("(Do both if {U}{R} was spent.)")); } diff --git a/Mage.Sets/src/mage/cards/v/VigorMortis.java b/Mage.Sets/src/mage/cards/v/VigorMortis.java index efb3e501a0..0c637ecf14 100644 --- a/Mage.Sets/src/mage/cards/v/VigorMortis.java +++ b/Mage.Sets/src/mage/cards/v/VigorMortis.java @@ -49,7 +49,7 @@ public final class VigorMortis extends CardImpl { class VigorMortisReplacementEffect extends ReplacementEffectImpl { - private static final Condition condition = new ManaWasSpentCondition(ColoredManaSymbol.G); + private static final Condition condition = ManaWasSpentCondition.GREEN; VigorMortisReplacementEffect() { super(Duration.EndOfStep, Outcome.BoostCreature); diff --git a/Mage/src/main/java/mage/abilities/condition/common/ManaWasSpentCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ManaWasSpentCondition.java index a670f9e690..413e4bfb86 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/ManaWasSpentCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/ManaWasSpentCondition.java @@ -1,5 +1,3 @@ - - package mage.abilities.condition.common; import mage.Mana; @@ -15,13 +13,16 @@ import mage.watchers.common.ManaSpentToCastWatcher; * * @author LevelX2 */ - - -public class ManaWasSpentCondition implements Condition { +public enum ManaWasSpentCondition implements Condition { + WHITE(ColoredManaSymbol.W), + BLUE(ColoredManaSymbol.U), + BLACK(ColoredManaSymbol.B), + RED(ColoredManaSymbol.R), + GREEN(ColoredManaSymbol.G); protected ColoredManaSymbol coloredManaSymbol; - public ManaWasSpentCondition(ColoredManaSymbol coloredManaSymbol) { + ManaWasSpentCondition(ColoredManaSymbol coloredManaSymbol) { this.coloredManaSymbol = coloredManaSymbol; }