diff --git a/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java b/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java new file mode 100644 index 00000000000..a35431625a7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java @@ -0,0 +1,87 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class DryadGreenseeker extends CardImpl { + + public DryadGreenseeker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.DRYAD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {T}: Look at the top card of your library. If it's a land card, you may reveal it and put it into your hand. + this.addAbility(new SimpleActivatedAbility( + new DryadGreenseekerEffect(), + new TapSourceCost() + )); + } + + public DryadGreenseeker(final DryadGreenseeker card) { + super(card); + } + + @Override + public DryadGreenseeker copy() { + return new DryadGreenseeker(this); + } +} + +class DryadGreenseekerEffect extends OneShotEffect { + + public DryadGreenseekerEffect() { + super(Outcome.DrawCard); + this.staticText = "Look at the top card of your library. " + + "If it's a land card, you may reveal it and put it into your hand."; + } + + public DryadGreenseekerEffect(final DryadGreenseekerEffect effect) { + super(effect); + } + + @Override + public DryadGreenseekerEffect copy() { + return new DryadGreenseekerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Card card = player.getLibrary().getFromTop(game); + if (card == null) { + return false; + } + player.lookAtCards(null, card, game); + if (!card.isLand()) { + return true; + } + if (!player.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) { + return true; + } + player.revealCards(source, new CardsImpl(card), game); + return player.moveCards(card, Zone.HAND, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 732dd3a3289..d81408d3d55 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -78,6 +78,7 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Divination", 51, Rarity.COMMON, mage.cards.d.Divination.class)); cards.add(new SetCardInfo("Draconic Disciple", 215, Rarity.UNCOMMON, mage.cards.d.DraconicDisciple.class)); cards.add(new SetCardInfo("Druid of the Cowl", 177, Rarity.COMMON, mage.cards.d.DruidOfTheCowl.class)); + cards.add(new SetCardInfo("Dryad Greenseeker", 178, Rarity.UNCOMMON, mage.cards.d.DryadGreenseeker.class)); cards.add(new SetCardInfo("Dwarven Priest", 11, Rarity.COMMON, mage.cards.d.DwarvenPriest.class)); cards.add(new SetCardInfo("Dwindle", 53, Rarity.COMMON, mage.cards.d.Dwindle.class)); cards.add(new SetCardInfo("Electrify", 139, Rarity.COMMON, mage.cards.e.Electrify.class));