Implemented Vivien's Grizzly

This commit is contained in:
Evan Kranzler 2019-04-01 19:19:00 -04:00
parent 86f651b871
commit 47605b3792
2 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,85 @@
package mage.cards.v;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ViviensGrizzly extends CardImpl {
public ViviensGrizzly(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add(SubType.BEAR);
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// {3}{G}: Look at the top card of your library. If it's a creature or planeswalker card, you may reveal it and put it into your hand. If you don't put the card into your hand, put it on the bottom of your library.
this.addAbility(new SimpleActivatedAbility(
new ViviensGrizzlyEffect(), new ManaCostsImpl("{3}{G}")
));
}
private ViviensGrizzly(final ViviensGrizzly card) {
super(card);
}
@Override
public ViviensGrizzly copy() {
return new ViviensGrizzly(this);
}
}
class ViviensGrizzlyEffect extends OneShotEffect {
ViviensGrizzlyEffect() {
super(Outcome.Benefit);
staticText = "Look at the top card of your library. " +
"If it's a creature or planeswalker card, " +
"you may reveal it and put it into your hand. " +
"If you don't put the card into your hand, " +
"put it on the bottom of your library.";
}
private ViviensGrizzlyEffect(final ViviensGrizzlyEffect effect) {
super(effect);
}
@Override
public ViviensGrizzlyEffect copy() {
return new ViviensGrizzlyEffect(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);
Cards cards = new CardsImpl(card);
player.lookAtCards(source, null, cards, game);
if ((!card.isPlaneswalker() && !card.isCreature())
|| !player.chooseUse(outcome, "Put this card in your hand?", source, game)) {
player.putCardsOnBottomOfLibrary(cards, game, source, false);
} else {
player.revealCards(source, cards, game);
player.moveCards(card, Zone.HAND, source, game);
}
return true;
}
}

View file

@ -84,6 +84,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Tibalt's Rager", 147, Rarity.UNCOMMON, mage.cards.t.TibaltsRager.class));
cards.add(new SetCardInfo("Tibalt, Rakish Instigator", 146, Rarity.UNCOMMON, mage.cards.t.TibaltRakishInstigator.class));
cards.add(new SetCardInfo("Time Wipe", 223, Rarity.RARE, mage.cards.t.TimeWipe.class));
cards.add(new SetCardInfo("Vivien's Grizzly", 182, Rarity.COMMON, mage.cards.v.ViviensGrizzly.class));
cards.add(new SetCardInfo("Vraska's Finisher", 112, Rarity.COMMON, mage.cards.v.VraskasFinisher.class));
cards.add(new SetCardInfo("Vraska, Swarm's Eminence", 236, Rarity.UNCOMMON, mage.cards.v.VraskaSwarmsEminence.class));
cards.add(new SetCardInfo("Wanderer's Strike", 38, Rarity.COMMON, mage.cards.w.WanderersStrike.class));