Implemented Brine Seer

This commit is contained in:
Evan Kranzler 2018-06-04 08:54:36 -04:00
parent 347fa8aff2
commit 4bd3c6c9e1
2 changed files with 87 additions and 0 deletions

View file

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

View file

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