From 4bd3c6c9e10f5722908daed015586da55c0e5196 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 4 Jun 2018 08:54:36 -0400 Subject: [PATCH] Implemented Brine Seer --- Mage.Sets/src/mage/cards/b/BrineSeer.java | 86 +++++++++++++++++++++++ Mage.Sets/src/mage/sets/UrzasDestiny.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BrineSeer.java diff --git a/Mage.Sets/src/mage/cards/b/BrineSeer.java b/Mage.Sets/src/mage/cards/b/BrineSeer.java new file mode 100644 index 0000000000..0fd6145ab3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BrineSeer.java @@ -0,0 +1,86 @@ +package mage.cards.b; + +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.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.target.common.TargetCardInHand; + +/** + * + * @author TheElk801 + */ +public final class BrineSeer extends CardImpl { + + public BrineSeer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{U}, {tap}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way. + Ability ability = new SimpleActivatedAbility(new BrineSeerEffect(), new ManaCostsImpl("{2}{U}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public BrineSeer(final BrineSeer card) { + super(card); + } + + @Override + public BrineSeer copy() { + return new BrineSeer(this); + } +} + +class BrineSeerEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("any number of blue cards in your hand"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public BrineSeerEffect() { + super(Outcome.Detriment); + this.staticText = "reveal any number of blue cards in your hand. " + + "Counter target spell unless its controller pays {1} for each card revealed this way"; + } + + public BrineSeerEffect(final BrineSeerEffect effect) { + super(effect); + } + + @Override + public BrineSeerEffect copy() { + return new BrineSeerEffect(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(); + return new CounterUnlessPaysEffect(new GenericManaCost(xValue)).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index 479176fbf0..517c7e8706 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -40,6 +40,7 @@ public final class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Braidwood Cup", 126, Rarity.UNCOMMON, mage.cards.b.BraidwoodCup.class)); cards.add(new SetCardInfo("Braidwood Sextant", 127, Rarity.UNCOMMON, mage.cards.b.BraidwoodSextant.class)); cards.add(new SetCardInfo("Brass Secretary", 128, Rarity.UNCOMMON, mage.cards.b.BrassSecretary.class)); + cards.add(new SetCardInfo("Brine Seer", 28, Rarity.UNCOMMON, mage.cards.b.BrineSeer.class)); cards.add(new SetCardInfo("Bubbling Beebles", 29, Rarity.COMMON, mage.cards.b.BubblingBeebles.class)); cards.add(new SetCardInfo("Bubbling Muck", 54, Rarity.COMMON, mage.cards.b.BubblingMuck.class)); cards.add(new SetCardInfo("Caltrops", 129, Rarity.UNCOMMON, mage.cards.c.Caltrops.class));