mirror of
https://github.com/correl/mage.git
synced 2024-12-27 11:07:39 +00:00
* Lobotomy - Fixed bug with selecting cards from target players hand.
This commit is contained in:
parent
f16dcac52c
commit
a6012c72ac
1 changed files with 7 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue