From dec7f038204bcc0df2f351b0d40c609ae8d0350e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 11 Jan 2019 19:11:57 -0500 Subject: [PATCH] Implemented Open the Gates --- Mage.Sets/src/mage/cards/o/OpenTheGates.java | 49 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 50 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OpenTheGates.java diff --git a/Mage.Sets/src/mage/cards/o/OpenTheGates.java b/Mage.Sets/src/mage/cards/o/OpenTheGates.java new file mode 100644 index 0000000000..673655a821 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OpenTheGates.java @@ -0,0 +1,49 @@ +package mage.cards.o; + +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OpenTheGates extends CardImpl { + + private static final FilterCard filter = new FilterCard("basic land card or a Gate card"); + + static { + filter.add(Predicates.or( + Predicates.and( + new SupertypePredicate(SuperType.BASIC), + new CardTypePredicate(CardType.LAND) + ), new SubtypePredicate(SubType.GATE) + )); + } + + public OpenTheGates(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + // Search your library for a basic land card or a Gate card, reveal it, put it into your hand, then shuffled your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); + } + + private OpenTheGates(final OpenTheGates card) { + super(card); + } + + @Override + public OpenTheGates copy() { + return new OpenTheGates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index 590142f758..4e6e4807da 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -176,6 +176,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 263, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Nikya of the Old Ways", 193, Rarity.RARE, mage.cards.n.NikyaOfTheOldWays.class)); cards.add(new SetCardInfo("Noxious Groodion", 78, Rarity.COMMON, mage.cards.n.NoxiousGroodion.class)); + cards.add(new SetCardInfo("Open the Gates", 133, Rarity.COMMON, mage.cards.o.OpenTheGates.class)); cards.add(new SetCardInfo("Orzhov Enforcer", 79, Rarity.UNCOMMON, mage.cards.o.OrzhovEnforcer.class)); cards.add(new SetCardInfo("Orzhov Guildgate", 252, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Orzhov Guildgate", 253, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS));