From e9d31b9265233fcc9ac1a47e35893d6de01c3af8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 8 Jan 2015 17:44:57 +0100 Subject: [PATCH] * Satyr Wayfinder - Fixed that the put land card to hand effect was not optional. --- .../sets/bornofthegods/SatyrWayfinder.java | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SatyrWayfinder.java b/Mage.Sets/src/mage/sets/bornofthegods/SatyrWayfinder.java index 9177c9ae9b..9ab83afe4c 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SatyrWayfinder.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SatyrWayfinder.java @@ -29,6 +29,7 @@ package mage.sets.bornofthegods; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -95,25 +96,17 @@ class SatyrWayfinderEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Cards cards = new CardsImpl(Zone.PICK); - - boolean properCardFound = false; - int count = Math.min(player.getLibrary().size(), 4); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); - if (filterPutInHand.match(card, source.getSourceId(), source.getControllerId(), game)) { - properCardFound = true; - } - } - } - + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player != null && sourceObject != null) { + Cards cards = new CardsImpl(Zone.LIBRARY); + cards.addAll(player.getLibrary().getTopCards(game, 4)); + boolean properCardFound = cards.count(filterPutInHand, source.getControllerId(), source.getSourceId(), game) > 0; if (!cards.isEmpty()) { - player.revealCards("Satyr Wayfinder", cards, game); - TargetCard target = new TargetCard(Zone.PICK, filterPutInHand); - if (properCardFound && player.choose(Outcome.DrawCard, cards, target, game)) { + player.revealCards(sourceObject.getLogName(), cards, game); + TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand); + if (properCardFound && + player.chooseUse(outcome, "Put a land card into your hand?", game) && + player.choose(Outcome.DrawCard, cards, target, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { cards.remove(card);