Implemented Gruesome Menagerie

This commit is contained in:
Evan Kranzler 2018-09-18 20:42:44 -04:00
parent 1c113fb9c6
commit 8876465320
2 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1,109 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author TheElk801
*/
public final class GruesomeMenagerie extends CardImpl {
public GruesomeMenagerie(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
// Choose a creature card with converted mana cost 1 in your graveyard, then do the same for creature cards with converted mana costs 2 and 3. Return those cards to the battlefield.
this.getSpellAbility().addEffect(new GruesomeMenagerieEffect());
}
public GruesomeMenagerie(final GruesomeMenagerie card) {
super(card);
}
@Override
public GruesomeMenagerie copy() {
return new GruesomeMenagerie(this);
}
}
class GruesomeMenagerieEffect extends OneShotEffect {
private static final FilterCard filter1
= new FilterCreatureCard("creature card with converted mana cost 1");
private static final FilterCard filter2
= new FilterCreatureCard("creature card with converted mana cost 2");
private static final FilterCard filter3
= new FilterCreatureCard("creature card with converted mana cost 3");
static {
filter1.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 1));
filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 2));
filter3.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 3));
}
public GruesomeMenagerieEffect() {
super(Outcome.Benefit);
this.staticText = "Choose a creature card with converted mana cost 1 "
+ "in your graveyard, then do the same for creature cards "
+ "with converted mana costs 2 and 3. "
+ "Return those cards to the battlefield.";
}
public GruesomeMenagerieEffect(final GruesomeMenagerieEffect effect) {
super(effect);
}
@Override
public GruesomeMenagerieEffect copy() {
return new GruesomeMenagerieEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl();
Target target;
target = new TargetCardInYourGraveyard(filter1);
if (player.choose(outcome, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
cards.add(card);
}
}
target = new TargetCardInYourGraveyard(filter2);
if (player.choose(outcome, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
cards.add(card);
}
}
target = new TargetCardInYourGraveyard(filter3);
if (player.choose(outcome, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
cards.add(card);
}
}
return player.moveCards(cards, Zone.BATTLEFIELD, source, game);
}
}

View file

@ -100,6 +100,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Golgari Guildgate", 249, Rarity.COMMON, mage.cards.g.GolgariGuildgate.class));
cards.add(new SetCardInfo("Golgari Locket", 237, Rarity.COMMON, mage.cards.g.GolgariLocket.class));
cards.add(new SetCardInfo("Golgari Raiders", 130, Rarity.UNCOMMON, mage.cards.g.GolgariRaiders.class));
cards.add(new SetCardInfo("Gruesome Menagerie", 71, Rarity.RARE, mage.cards.g.GruesomeMenagerie.class));
cards.add(new SetCardInfo("Guild Summit", 41, Rarity.UNCOMMON, mage.cards.g.GuildSummit.class));
cards.add(new SetCardInfo("Haazda Marshal", 13, Rarity.UNCOMMON, mage.cards.h.HaazdaMarshal.class));
cards.add(new SetCardInfo("Hammer Dropper", 176, Rarity.COMMON, mage.cards.h.HammerDropper.class));