mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
change ManaSpentToCastCondition to enum
This commit is contained in:
parent
3f94bdf944
commit
d2f5d8dbed
36 changed files with 59 additions and 58 deletions
|
@ -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) {
|
||||
|
|
|
@ -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("<i>(Do both if {W}{B} was spent.)</i>"));
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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("<i>(Do both if {G}{W} was spent.)</i>"));
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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. <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) {
|
||||
|
|
|
@ -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"
|
||||
));
|
||||
|
|
|
@ -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")));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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("<i>(Do both if {G}{U} was spent.)</i>"));
|
||||
|
|
|
@ -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(" <i>(Do both if {R}{W} was spent.)</i>"));
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<CardType> cardTypes = Arrays.asList(
|
||||
CardType.ARTIFACT,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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."));
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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("<i>(Do both if {W}{U} was spent.)</i>"));
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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()));
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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."));
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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."));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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("<i>(Do both if {U}{R} was spent.)</i>"));
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue