From 332e27324e8f5cd3af8cafdff80f4a2bf645813b Mon Sep 17 00:00:00 2001 From: PhallenCassidy Date: Fri, 13 Apr 2018 23:24:34 -0400 Subject: [PATCH] Fix to 7C262 "Above the Battlement" No longer allows players to play a stacked Besieger to play a [Sauron] Orc from discard, per Individual Card Ruling in the Comprehensive Rules 4.0 --- .../lotro/cards/set7/sauron/Card7_262.java | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_262.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_262.java index 0262ffe8c..0492f5db8 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_262.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_262.java @@ -11,6 +11,8 @@ import com.gempukku.lotro.common.*; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.decisions.MultipleChoiceAwaitingDecision; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; import com.gempukku.lotro.logic.timing.Effect; import java.util.LinkedList; @@ -33,29 +35,43 @@ public class Card7_262 extends AbstractEvent { @Override public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) - && PlayConditions.canPlayFromDiscard(playerId, game, Culture.SAURON, Race.ORC) - && (PlayConditions.canRemoveBurdens(game, self, 1) - || PlayConditions.canPlayFromStacked(playerId, game, Filters.siteControlled(playerId), Keyword.BESIEGER)); + && (PlayConditions.canPlayFromDiscard(playerId, game, Culture.SAURON, Race.ORC) + && PlayConditions.canRemoveBurdens(game, self, 1)) + || PlayConditions.canPlayFromStacked(playerId, game, Filters.siteControlled(playerId), Keyword.BESIEGER); } @Override - public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { final PlayEventAction action = new PlayEventAction(self); - List possibleCosts = new LinkedList(); - possibleCosts.add( - new ChooseAndPlayCardFromStackedEffect(playerId, Filters.siteControlled(playerId), Keyword.BESIEGER) { - @Override - public String getText(LotroGame game) { - return "Play a besieger stacked on a site you control"; + if (PlayConditions.canPlayFromStacked(playerId, game, Filters.siteControlled(playerId), Keyword.BESIEGER) + && PlayConditions.canRemoveBurdens(game, self, 1) + && PlayConditions.canPlayFromDiscard(playerId, game, Culture.SAURON, Race.ORC)) { + action.appendEffect( + new PlayoutDecisionEffect(playerId, + new MultipleChoiceAwaitingDecision(1, "Which would you like to do?", new String[]{"Play a besieger stacked on a site you control", "Remove a burden to play a SAURON Orc from Discard"}) { + @Override + protected void validDecisionMade(int index, String result) { + if (result.equals("Play a besieger stacked on a site you control")) { + action.appendEffect( + new ChooseAndPlayCardFromStackedEffect(playerId, Filters.siteControlled(playerId), Keyword.BESIEGER)); + } else { + action.appendCost( + new RemoveBurdenEffect(playerId, self)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game, Culture.SAURON, Race.ORC)); } - }); - possibleCosts.add( - new RemoveBurdenEffect(playerId, self)); - action.appendCost( - new ChoiceEffect(action, playerId, possibleCosts)); - - action.appendEffect( - new ChooseAndPlayCardFromDiscardEffect(playerId, game, Culture.SAURON, Race.ORC)); + } + })); + } else if (PlayConditions.canPlayFromStacked(playerId, game, Filters.siteControlled(playerId), Keyword.BESIEGER)) { + action.appendEffect( + new ChooseAndPlayCardFromStackedEffect(playerId, Filters.siteControlled(playerId), Keyword.BESIEGER)); + } else if (PlayConditions.canRemoveBurdens(game, self, 1) + && PlayConditions.canPlayFromDiscard(playerId, game, Culture.SAURON, Race.ORC)) { + action.appendCost( + new RemoveBurdenEffect(playerId, self)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game, Culture.SAURON, Race.ORC)); + } return action; } }