From b4701cc0254dcbee0c8ce870b79bd08787c204b9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 14 Sep 2018 13:56:29 -0400 Subject: [PATCH] Implemented Detour --- Mage.Sets/src/mage/cards/d/Detour.java | 52 ++++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 53 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/Detour.java diff --git a/Mage.Sets/src/mage/cards/d/Detour.java b/Mage.Sets/src/mage/cards/d/Detour.java new file mode 100644 index 0000000000..cb4a870c92 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/Detour.java @@ -0,0 +1,52 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +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; + +/** + * + * @author TheElk801 + */ +public final class Detour extends CardImpl { + + private static final FilterCard filter + = new FilterCard("basic land cards and/or Gate cards"); + + static { + filter.add(Predicates.or( + Predicates.and( + new CardTypePredicate(CardType.LAND), + new SupertypePredicate(SuperType.BASIC) + ), new SubtypePredicate(SubType.GATE) + )); + } + + public Detour(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Search your library for up to two basic lands and/or Gates and put them onto the battlefield tapped. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect( + new TargetCardInLibrary(0, 2, filter), true + )); + } + + public Detour(final Detour card) { + super(card); + } + + @Override + public Detour copy() { + return new Detour(this); + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index 77ceefc179..2560f5a599 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -49,6 +49,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Darkblade Agent", 164, Rarity.COMMON, mage.cards.d.DarkbladeAgent.class)); cards.add(new SetCardInfo("Deadly Visit", 68, Rarity.COMMON, mage.cards.d.DeadlyVisit.class)); cards.add(new SetCardInfo("Deafening Clarion", 165, Rarity.RARE, mage.cards.d.DeafeningClarion.class)); + cards.add(new SetCardInfo("Detour", 125, Rarity.UNCOMMON, mage.cards.d.Detour.class)); cards.add(new SetCardInfo("Dimir Guildgate", 245, Rarity.COMMON, mage.cards.d.DimirGuildgate.class)); cards.add(new SetCardInfo("Dimir Guildgate", 246, Rarity.COMMON, mage.cards.d.DimirGuildgate.class)); cards.add(new SetCardInfo("Dimir Informant", 36, Rarity.COMMON, mage.cards.d.DimirInformant.class));