From 63363eab881ab0f5872f26e1cefbd5e60de5e786 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 4 Jun 2018 09:00:36 -0400 Subject: [PATCH] Implemented Ivy Seer --- Mage.Sets/src/mage/cards/i/IvySeer.java | 89 +++++++++++++++++++++++ Mage.Sets/src/mage/sets/UrzasDestiny.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IvySeer.java diff --git a/Mage.Sets/src/mage/cards/i/IvySeer.java b/Mage.Sets/src/mage/cards/i/IvySeer.java new file mode 100644 index 0000000000..0ac2d1288b --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IvySeer.java @@ -0,0 +1,89 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RevealTargetFromHandCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class IvySeer extends CardImpl { + + public IvySeer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{G}, {tap}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way. + Ability ability = new SimpleActivatedAbility(new IvySeerEffect(), new ManaCostsImpl("{2}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IvySeer(final IvySeer card) { + super(card); + } + + @Override + public IvySeer copy() { + return new IvySeer(this); + } +} + +class IvySeerEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("any number of green cards in your hand"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public IvySeerEffect() { + super(Outcome.BoostCreature); + this.staticText = "reveal any number of green cards in your hand. " + + "Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way"; + } + + public IvySeerEffect(final IvySeerEffect effect) { + super(effect); + } + + @Override + public IvySeerEffect copy() { + return new IvySeerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter)); + if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { + return false; + } + int xValue = cost.getNumberRevealedCards(); + game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index b035916d72..8502c1d91e 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -82,6 +82,7 @@ public final class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Illuminated Wings", 34, Rarity.COMMON, mage.cards.i.IlluminatedWings.class)); cards.add(new SetCardInfo("Impatience", 88, Rarity.RARE, mage.cards.i.Impatience.class)); cards.add(new SetCardInfo("Iridescent Drake", 35, Rarity.UNCOMMON, mage.cards.i.IridescentDrake.class)); + cards.add(new SetCardInfo("Ivy Seer", 110, Rarity.UNCOMMON, mage.cards.i.IvySeer.class)); cards.add(new SetCardInfo("Junk Diver", 132, Rarity.RARE, mage.cards.j.JunkDiver.class)); cards.add(new SetCardInfo("Keldon Champion", 90, Rarity.UNCOMMON, mage.cards.k.KeldonChampion.class)); cards.add(new SetCardInfo("Keldon Vandals", 91, Rarity.COMMON, mage.cards.k.KeldonVandals.class));