From 6df5d3cf6b219b93c1a4c2946c941c407030dbdb Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 10 Jun 2023 08:49:48 -0400 Subject: [PATCH] [LTR] Implement Elven Farsight --- Mage.Sets/src/mage/cards/e/ElvenFarsight.java | 71 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ElvenFarsight.java diff --git a/Mage.Sets/src/mage/cards/e/ElvenFarsight.java b/Mage.Sets/src/mage/cards/e/ElvenFarsight.java new file mode 100644 index 0000000000..08886233d8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ElvenFarsight.java @@ -0,0 +1,71 @@ +package mage.cards.e; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ElvenFarsight extends CardImpl { + + public ElvenFarsight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + // Scry 3, then you may reveal the top card of your library. If it's a creature card, draw a card. + this.getSpellAbility().addEffect(new ElvenFarsightEffect()); + } + + private ElvenFarsight(final ElvenFarsight card) { + super(card); + } + + @Override + public ElvenFarsight copy() { + return new ElvenFarsight(this); + } +} + +class ElvenFarsightEffect extends OneShotEffect { + + ElvenFarsightEffect() { + super(Outcome.Benefit); + staticText = "scry 3, then you may reveal the top card of your library. If it's a creature card, draw a card"; + } + + private ElvenFarsightEffect(final ElvenFarsightEffect effect) { + super(effect); + } + + @Override + public ElvenFarsightEffect copy() { + return new ElvenFarsightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.scry(3, source, game); + Card card = player.getLibrary().getFromTop(game); + if (card == null || !player.chooseUse(outcome, "Reveal " + card.getName() + '?', source, game)) { + return true; + } + player.revealCards(source, new CardsImpl(card), game); + if (card.isCreature(game)) { + player.drawCards(1, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index de230aa819..3f3bf400bb 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -54,6 +54,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Eastfarthing Farmer", 8, Rarity.COMMON, mage.cards.e.EastfarthingFarmer.class)); cards.add(new SetCardInfo("Elrond, Lord of Rivendell", 49, Rarity.UNCOMMON, mage.cards.e.ElrondLordOfRivendell.class)); cards.add(new SetCardInfo("Elven Chorus", 160, Rarity.RARE, mage.cards.e.ElvenChorus.class)); + cards.add(new SetCardInfo("Elven Farsight", 161, Rarity.COMMON, mage.cards.e.ElvenFarsight.class)); cards.add(new SetCardInfo("Ent-Draught Basin", 238, Rarity.UNCOMMON, mage.cards.e.EntDraughtBasin.class)); cards.add(new SetCardInfo("Eowyn, Fearless Knight", 201, Rarity.RARE, mage.cards.e.EowynFearlessKnight.class)); cards.add(new SetCardInfo("Erebor Flamesmith", 122, Rarity.COMMON, mage.cards.e.EreborFlamesmith.class));