diff --git a/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java b/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java new file mode 100644 index 00000000000..bb748064a5b --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java @@ -0,0 +1,100 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.LoseCreatureTypeSourceEffect; +import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NyleaKeenEyed extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("creature spells"); + + public NyleaKeenEyed(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.GOD); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // As long as your devotion to green is less than five, Nylea isn't a creature. + this.addAbility(new SimpleStaticAbility(new LoseCreatureTypeSourceEffect(DevotionCount.G, 5)) + .addHint(DevotionCount.G.getHint())); + + // Creature spells you cast cost {1} less to cast. + this.addAbility(new SimpleStaticAbility(new SpellsCostReductionControllerEffect(filter, 1))); + + // {2}{G}: Reveal the top card of your library. If it's a creature card, put it into your hand. Otherwise, you may put it into your graveyard. + this.addAbility(new SimpleActivatedAbility(new NyleaKeenEyedEffect(), new ManaCostsImpl("{2}{G}"))); + } + + private NyleaKeenEyed(final NyleaKeenEyed card) { + super(card); + } + + @Override + public NyleaKeenEyed copy() { + return new NyleaKeenEyed(this); + } +} + +class NyleaKeenEyedEffect extends OneShotEffect { + + NyleaKeenEyedEffect() { + super(Outcome.Benefit); + staticText = "reveal the top card of your library. If it's a creature card, " + + "put it into your hand. Otherwise, you may put it into your graveyard"; + } + + private NyleaKeenEyedEffect(final NyleaKeenEyedEffect effect) { + super(effect); + } + + @Override + public NyleaKeenEyedEffect copy() { + return new NyleaKeenEyedEffect(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.revealCards(source, new CardsImpl(card), game); + if (card.isCreature()) { + return player.moveCards(card, Zone.HAND, source, game); + } + if (!player.chooseUse(outcome, "Put " + card.getName() + " into your graveyard?", source, game)) { + return true; + } + return player.moveCards(card, Zone.GRAVEYARD, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index eda19893005..ca8cf2dd729 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -71,6 +71,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Mire's Grasp", 106, Rarity.COMMON, mage.cards.m.MiresGrasp.class)); cards.add(new SetCardInfo("Mountain", 253, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Nadir Kraken", 55, Rarity.RARE, mage.cards.n.NadirKraken.class)); + cards.add(new SetCardInfo("Nylea, Keen-Eyed", 185, Rarity.MYTHIC, mage.cards.n.NyleaKeenEyed.class)); cards.add(new SetCardInfo("Nyx Lotus", 235, Rarity.RARE, mage.cards.n.NyxLotus.class)); cards.add(new SetCardInfo("Nyxborn Colossus", 191, Rarity.COMMON, mage.cards.n.NyxbornColossus.class)); cards.add(new SetCardInfo("Nyxborn Courser", 29, Rarity.COMMON, mage.cards.n.NyxbornCourser.class));