From 2aff2d4437653529dc4b031cb230c868820425a8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 12 Sep 2020 15:43:04 -0400 Subject: [PATCH] [ZNR] Implemented Roiling Vortex --- Mage.Sets/src/mage/cards/r/RoilingVortex.java | 69 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RoilingVortex.java diff --git a/Mage.Sets/src/mage/cards/r/RoilingVortex.java b/Mage.Sets/src/mage/cards/r/RoilingVortex.java new file mode 100644 index 0000000000..4d846a7ffc --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RoilingVortex.java @@ -0,0 +1,69 @@ +package mage.cards.r; + +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.CantGainLifeAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.stack.StackObject; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RoilingVortex extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a spell"); + + static { + filter.add(RoilingVortexPredicate.instance); + } + + public RoilingVortex(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + + // At the beginning of each player's upkeep, Roiling Vortex deals 1 damage to them. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + Zone.BATTLEFIELD, new DamageTargetEffect(1, true, "them"), + TargetController.ANY, false, true + )); + + // Whenever a player casts a spell, if no mana was spent to cast that spell, Roiling Vortex deals 5 damage to that player. + this.addAbility(new SpellCastAllTriggeredAbility(new DamageTargetEffect( + 5, true, "that player", + "if no mana was spent to cast that spell, {this}" + ), filter, false, SetTargetPointer.PLAYER)); + + // {R}: Your opponents can't gain life this turn. + this.addAbility(new SimpleActivatedAbility( + new CantGainLifeAllEffect(Duration.EndOfTurn, TargetController.OPPONENT), + new ColoredManaCost(ColoredManaSymbol.R) + )); + } + + private RoilingVortex(final RoilingVortex card) { + super(card); + } + + @Override + public RoilingVortex copy() { + return new RoilingVortex(this); + } +} + +enum RoilingVortexPredicate implements Predicate { + instance; + + @Override + public boolean apply(StackObject input, Game game) { + return input.getStackAbility().getManaCostsToPay().getPayment().count() == 0; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 4cb0e35652..a36fe67950 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -301,6 +301,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Rockslide Sorcerer", 154, Rarity.UNCOMMON, mage.cards.r.RockslideSorcerer.class)); cards.add(new SetCardInfo("Roil Eruption", 155, Rarity.COMMON, mage.cards.r.RoilEruption.class)); cards.add(new SetCardInfo("Roiling Regrowth", 201, Rarity.UNCOMMON, mage.cards.r.RoilingRegrowth.class)); + cards.add(new SetCardInfo("Roiling Vortex", 156, Rarity.RARE, mage.cards.r.RoilingVortex.class)); cards.add(new SetCardInfo("Roost of Drakes", 74, Rarity.UNCOMMON, mage.cards.r.RoostOfDrakes.class)); cards.add(new SetCardInfo("Ruin Crab", 75, Rarity.UNCOMMON, mage.cards.r.RuinCrab.class)); cards.add(new SetCardInfo("Scale the Heights", 202, Rarity.COMMON, mage.cards.s.ScaleTheHeights.class));