From 27957012c9ba824bacdb75d00fdff7d69b5d4f74 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Thu, 4 Nov 2021 15:20:01 -0500 Subject: [PATCH] [VOW] Implemented Cartographer's Survey --- .../src/mage/cards/c/CartographersSurvey.java | 73 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CartographersSurvey.java diff --git a/Mage.Sets/src/mage/cards/c/CartographersSurvey.java b/Mage.Sets/src/mage/cards/c/CartographersSurvey.java new file mode 100644 index 00000000000..3e4989f9623 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CartographersSurvey.java @@ -0,0 +1,73 @@ +package mage.cards.c; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author weirddan455 + */ +public final class CartographersSurvey extends CardImpl { + + public CartographersSurvey(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Look at the top seven cards of your library. Put up to two land cards from among them onto the battlefield tapped. Put the rest on the bottom of your library in a random order. + this.getSpellAbility().addEffect(new CartographersSurveyEffect()); + } + + private CartographersSurvey(final CartographersSurvey card) { + super(card); + } + + @Override + public CartographersSurvey copy() { + return new CartographersSurvey(this); + } +} + +class CartographersSurveyEffect extends LookLibraryControllerEffect { + + public CartographersSurveyEffect() { + super(Outcome.PutLandInPlay, StaticValue.get(7), false, Zone.LIBRARY, false); + this.setBackInRandomOrder(true); + staticText = "Look at the top seven cards of your library. Put up to two land cards from among them onto the battlefield tapped. Put the rest on the bottom of your library in a random order"; + } + + private CartographersSurveyEffect(final CartographersSurveyEffect effect) { + super(effect); + } + + @Override + public CartographersSurveyEffect copy() { + return new CartographersSurveyEffect(this); + } + + @Override + protected void actionWithSelectedCards(Cards cards, Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + TargetCard target = new TargetCard(0, 2, Zone.LIBRARY, StaticFilters.FILTER_CARD_LANDS); + controller.choose(outcome, cards, target, game); + Cards pickedCards = new CardsImpl(target.getTargets()); + if (!pickedCards.isEmpty()) { + cards.removeAll(pickedCards); + controller.moveCards(pickedCards.getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null); + } + } + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index c2fe88c3787..e7796e4c291 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -48,6 +48,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Blossom-Clad Werewolf", 226, Rarity.COMMON, mage.cards.b.BlossomCladWerewolf.class)); cards.add(new SetCardInfo("Bramble Wurm", 189, Rarity.UNCOMMON, mage.cards.b.BrambleWurm.class)); cards.add(new SetCardInfo("By Invitation Only", 5, Rarity.RARE, mage.cards.b.ByInvitationOnly.class)); + cards.add(new SetCardInfo("Cartographer's Survey", 190, Rarity.UNCOMMON, mage.cards.c.CartographersSurvey.class)); cards.add(new SetCardInfo("Cemetery Protector", 6, Rarity.MYTHIC, mage.cards.c.CemeteryProtector.class)); cards.add(new SetCardInfo("Cemetery Prowler", 191, Rarity.MYTHIC, mage.cards.c.CemeteryProwler.class)); cards.add(new SetCardInfo("Change of Fortune", 150, Rarity.RARE, mage.cards.c.ChangeOfFortune.class));