[MOM] Implement Overgrown Pest

This commit is contained in:
theelk801 2023-04-05 09:57:39 -04:00
parent 4c4a7fc4a6
commit e984d2a901
3 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,52 @@
package mage.cards.o;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.PutCards;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.card.DoubleFacedCardPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class OvergrownPest extends CardImpl {
private static final FilterCard filter = new FilterCard("a land or double-faced card");
static {
filter.add(Predicates.or(
CardType.LAND.getPredicate(),
DoubleFacedCardPredicate.instance
));
}
public OvergrownPest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add(SubType.PEST);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Overgrown Pest enters the battlefield, look at the top five cards of your library. You may reveal a land or double-faced card from among them and put that card into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM
)));
}
private OvergrownPest(final OvergrownPest card) {
super(card);
}
@Override
public OvergrownPest copy() {
return new OvergrownPest(this);
}
}

View file

@ -98,6 +98,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Norn's Inquisitor", 29, Rarity.UNCOMMON, mage.cards.n.NornsInquisitor.class)); cards.add(new SetCardInfo("Norn's Inquisitor", 29, Rarity.UNCOMMON, mage.cards.n.NornsInquisitor.class));
cards.add(new SetCardInfo("Omen Hawker", 70, Rarity.UNCOMMON, mage.cards.o.OmenHawker.class)); cards.add(new SetCardInfo("Omen Hawker", 70, Rarity.UNCOMMON, mage.cards.o.OmenHawker.class));
cards.add(new SetCardInfo("Oracle of Tragedy", 71, Rarity.UNCOMMON, mage.cards.o.OracleOfTragedy.class)); cards.add(new SetCardInfo("Oracle of Tragedy", 71, Rarity.UNCOMMON, mage.cards.o.OracleOfTragedy.class));
cards.add(new SetCardInfo("Overgrown Pest", 197, Rarity.COMMON, mage.cards.o.OvergrownPest.class));
cards.add(new SetCardInfo("Ozolith, the Shattered Spire", 198, Rarity.RARE, mage.cards.o.OzolithTheShatteredSpire.class)); cards.add(new SetCardInfo("Ozolith, the Shattered Spire", 198, Rarity.RARE, mage.cards.o.OzolithTheShatteredSpire.class));
cards.add(new SetCardInfo("Phyrexian Awakening", 30, Rarity.UNCOMMON, mage.cards.p.PhyrexianAwakening.class)); cards.add(new SetCardInfo("Phyrexian Awakening", 30, Rarity.UNCOMMON, mage.cards.p.PhyrexianAwakening.class));
cards.add(new SetCardInfo("Phyrexian Gargantua", 121, Rarity.UNCOMMON, mage.cards.p.PhyrexianGargantua.class)); cards.add(new SetCardInfo("Phyrexian Gargantua", 121, Rarity.UNCOMMON, mage.cards.p.PhyrexianGargantua.class));

View file

@ -0,0 +1,23 @@
package mage.filter.predicate.card;
import mage.cards.Card;
import mage.cards.ModalDoubleFacesCard;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum DoubleFacedCardPredicate implements Predicate<Card> {
instance;
@Override
public boolean apply(Card input, Game game) {
return input instanceof ModalDoubleFacesCard || input.getSecondCardFace() != null;
}
@Override
public String toString() {
return "Double-Faced";
}
}