From 02a2c30c99328757a4be388761958d324c74939c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 31 May 2021 19:11:07 -0400 Subject: [PATCH] [MH2] Implemented Radiant Epicure --- .../src/mage/cards/r/RadiantEpicure.java | 83 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons2.java | 1 + 2 files changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RadiantEpicure.java diff --git a/Mage.Sets/src/mage/cards/r/RadiantEpicure.java b/Mage.Sets/src/mage/cards/r/RadiantEpicure.java new file mode 100644 index 0000000000..479a818cbe --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RadiantEpicure.java @@ -0,0 +1,83 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; +import mage.watchers.common.ManaSpentToCastWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RadiantEpicure extends CardImpl { + + public RadiantEpicure(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Converge — When Radiant Epicure enters the battlefield, each opponent loses X life and you gain X life, where X is the number of colors of mana spent to cast this spell. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new RadiantEpicureEffect(), false, "Converge — " + ), new ManaSpentToCastWatcher()); + } + + private RadiantEpicure(final RadiantEpicure card) { + super(card); + } + + @Override + public RadiantEpicure copy() { + return new RadiantEpicure(this); + } +} + +class RadiantEpicureEffect extends OneShotEffect { + + RadiantEpicureEffect() { + super(Outcome.Benefit); + staticText = "each opponent loses X life and you gain X life, " + + "where X is the number of colors of mana spent to cast this spell"; + } + + private RadiantEpicureEffect(final RadiantEpicureEffect effect) { + super(effect); + } + + @Override + public RadiantEpicureEffect copy() { + return new RadiantEpicureEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + ManaSpentToCastWatcher watcher = game.getState().getWatcher(ManaSpentToCastWatcher.class, source.getSourceId()); + if (player == null || watcher == null) { + return false; + } + Mana payment = watcher.getAndResetLastPayment(); + if (payment == null) { + return false; + } + int xValue = payment.getDifferentColors(); + new DamagePlayersEffect(xValue, TargetController.OPPONENT).apply(game, source); + player.gainLife(xValue, game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index ce3a7d2a66..bed4885d20 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -134,6 +134,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Profane Tutor", 97, Rarity.RARE, mage.cards.p.ProfaneTutor.class)); cards.add(new SetCardInfo("Prophetic Titan", 209, Rarity.UNCOMMON, mage.cards.p.PropheticTitan.class)); cards.add(new SetCardInfo("Quirion Ranger", 285, Rarity.UNCOMMON, mage.cards.q.QuirionRanger.class)); + cards.add(new SetCardInfo("Radiant Epicure", 98, Rarity.UNCOMMON, mage.cards.r.RadiantEpicure.class)); cards.add(new SetCardInfo("Ravenous Squirrel", 211, Rarity.UNCOMMON, mage.cards.r.RavenousSquirrel.class)); cards.add(new SetCardInfo("Raving Visionary", 56, Rarity.UNCOMMON, mage.cards.r.RavingVisionary.class)); cards.add(new SetCardInfo("Razortide Bridge", 252, Rarity.COMMON, mage.cards.r.RazortideBridge.class));