From a6012c72ac6f0ddeb5b559372032f0f52bbd7aae Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 16 Aug 2015 19:58:45 +0200 Subject: [PATCH] * Lobotomy - Fixed bug with selecting cards from target players hand. --- Mage.Sets/src/mage/sets/tempest/Lobotomy.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/tempest/Lobotomy.java b/Mage.Sets/src/mage/sets/tempest/Lobotomy.java index 440bfc0170..e666c50d0e 100644 --- a/Mage.Sets/src/mage/sets/tempest/Lobotomy.java +++ b/Mage.Sets/src/mage/sets/tempest/Lobotomy.java @@ -46,8 +46,8 @@ import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.players.Player; +import mage.target.TargetCard; import mage.target.TargetPlayer; -import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; /** @@ -100,13 +100,13 @@ class LobotomyEffect extends OneShotEffect { if (targetPlayer != null && sourceObject != null && controller != null) { // reveal hand of target player - targetPlayer.revealCards(sourceObject.getName(), targetPlayer.getHand(), game); + targetPlayer.revealCards(sourceObject.getIdName(), targetPlayer.getHand(), game); // You choose card other than a basic land card - TargetCardInHand target = new TargetCardInHand(filter); + TargetCard target = new TargetCard(Zone.HAND, filter); target.setNotTarget(true); Card chosenCard = null; - if (controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) { + if (controller.chooseTarget(Outcome.Benefit, targetPlayer.getHand(), target, source, game)) { chosenCard = game.getCard(target.getFirstTarget()); } @@ -115,6 +115,7 @@ class LobotomyEffect extends OneShotEffect { FilterCard filterNamedCards = new FilterCard(); if (chosenCard != null) { filterNamedCards.add(new NamePredicate(chosenCard.getName())); + filterNamedCards.setMessage("cards named " + chosenCard.getName()); } else { filterNamedCards.add(new NamePredicate("----")); // so no card matches } @@ -129,8 +130,8 @@ class LobotomyEffect extends OneShotEffect { } } // search cards in hand - TargetCardInHand targetCardsHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCards); - controller.chooseTarget(outcome, targetPlayer.getGraveyard(), targetCardsHand, source, game); + TargetCard targetCardsHand = new TargetCard(0, Integer.MAX_VALUE, Zone.HAND, filterNamedCards); + controller.chooseTarget(outcome, targetPlayer.getHand(), targetCardsHand, source, game); for (UUID cardId : targetCardsHand.getTargets()) { Card card = game.getCard(cardId); if (card != null) {