From 4a08debffef42a57b0cc91bb5a153d1d7678cd79 Mon Sep 17 00:00:00 2001 From: Sol Date: Fri, 22 Feb 2013 01:16:19 +0000 Subject: [PATCH] - If a SA can target the Stack and another zone, remove the host spell if it's on the Stack --- .../forge/card/spellability/TargetSelection.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/forge/card/spellability/TargetSelection.java b/src/main/java/forge/card/spellability/TargetSelection.java index 606a1211f54..fd7171c74be 100644 --- a/src/main/java/forge/card/spellability/TargetSelection.java +++ b/src/main/java/forge/card/spellability/TargetSelection.java @@ -266,14 +266,23 @@ public class TargetSelection { final List zone = tgt.getZone(); final boolean mandatory = this.target.getMandatory() ? this.target.hasCandidates(this.ability, true) : false; - if (zone.contains(ZoneType.Stack) && (zone.size() == 1)) { + final boolean canTgtStack = zone.contains(ZoneType.Stack); + + if (canTgtStack && (zone.size() == 1)) { // If Zone is Stack, the choices are handled slightly differently this.chooseCardFromStack(mandatory); return; } List choices = CardLists.getTargetableCards(CardLists.getValidCards(Singletons.getModel().getGame().getCardsIn(zone), this.target.getValidTgts(), this.ability.getActivatingPlayer(), this.ability.getSourceCard()), this.ability); - + if (canTgtStack) { + // Since getTargetableCards doesn't have additional checks if one of the Zones is stack + // Remove the activating card from targeting itself if its on the Stack + Card activatingCard = tgt.getSourceCard(); + if (activatingCard.isInZone(ZoneType.Stack)) { + choices.remove(tgt.getSourceCard()); + } + } ArrayList objects = getUniqueTargets(this.ability); if (tgt.isUniqueTargets()) { @@ -549,7 +558,7 @@ public class TargetSelection { final Card divLibrary = new Card(); divLibrary.setName("--CARDS IN LIBRARY:--"); final Card divStack = new Card(); - divStack.setName("--CARDS IN LIBRARY:--"); + divStack.setName("--CARDS IN STACK:--"); List choicesZoneUnfiltered = choices; final List crdsBattle = new ArrayList();