[LTR] Implement Elven Farsight

This commit is contained in:
theelk801 2023-06-10 08:49:48 -04:00
parent 4ccc7b71e0
commit 6df5d3cf6b
2 changed files with 72 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));