From 5e96bef638afd7d3fcaadd3ba261e6651ad686cb Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 15 Dec 2012 23:35:42 +0000 Subject: [PATCH] - Both "Forces of Mordor" and "Uruk Spy" now give a choice of number of minions to spot, therefore allowing to spot less than are in play. --- .../lotro/cards/set1/isengard/Card1_155.java | 38 ++++++++++++------- .../lotro/cards/set1/sauron/Card1_248.java | 23 ++++++++--- .../src/main/webapp/includes/changeLog.html | 4 ++ 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_155.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_155.java index 9a279c38a..45943fbc1 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_155.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_155.java @@ -13,9 +13,12 @@ import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.actions.ActivateCardAction; +import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import com.gempukku.lotro.logic.decisions.IntegerAwaitingDecision; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; import com.gempukku.lotro.logic.timing.EffectResult; -import com.gempukku.lotro.logic.timing.UnrespondableEffect; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -37,24 +40,33 @@ public class Card1_155 extends AbstractMinion { } @Override - public List getOptionalInPlayAfterActions(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) { + public List getOptionalInPlayAfterActions(final String playerId, final LotroGame game, EffectResult effectResult, final PhysicalCard self) { if (effectResult.getType() == EffectResult.Type.PUT_ON_THE_ONE_RING && PlayConditions.canExert(self, game, self)) { final ActivateCardAction action = new ActivateCardAction(self); action.appendCost(new SelfExertEffect(action, self)); - // TODO this should give option to player to spot less + int isengardMinionCount = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Culture.ISENGARD, CardType.MINION); - for (int i = 0; i < isengardMinionCount; i++) { + if (isengardMinionCount > 0) { action.appendEffect( - new UnrespondableEffect() { - @Override - public void doPlayEffect(LotroGame game) { - List deck = game.getGameState().getDeck(playerId); - if (deck.size() > 0 && deck.get(0).getBlueprint().getSide() == Side.SHADOW) - action.appendEffect(new AddBurdenEffect(self.getOwner(), self, 1)); - } - }); - action.appendEffect(new DiscardTopCardFromDeckEffect(self, playerId, false)); + new PlayoutDecisionEffect(playerId, + new IntegerAwaitingDecision(1, "Choose number of minions to spot", 0, isengardMinionCount, isengardMinionCount) { + @Override + public void decisionMade(String result) throws DecisionResultInvalidException { + int spotted = getValidatedResult(result); + if (spotted > 0) + action.appendEffect( + new DiscardTopCardFromDeckEffect(self, playerId, spotted, false) { + @Override + protected void cardsDiscardedCallback(Collection cards) { + int shadow = Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), Side.SHADOW).size(); + if (shadow > 0) + action.appendEffect( + new AddBurdenEffect(playerId, self, shadow)); + } + }); + } + })); } return Collections.singletonList(action); } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_248.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_248.java index 296d21ee0..5f5d933b1 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_248.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_248.java @@ -9,7 +9,10 @@ import com.gempukku.lotro.common.Side; 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.DecisionResultInvalidException; +import com.gempukku.lotro.logic.decisions.IntegerAwaitingDecision; import com.gempukku.lotro.logic.effects.AddTwilightEffect; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; /** * Set: The Fellowship of the Ring @@ -25,12 +28,22 @@ public class Card1_248 extends AbstractOldEvent { } @Override - public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { - PlayEventAction action = new PlayEventAction(self); - // TODO This should give an option to spot less + public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + final PlayEventAction action = new PlayEventAction(self); int sauronMinions = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Culture.SAURON, CardType.MINION); - action.appendEffect( - new AddTwilightEffect(self, sauronMinions)); + if (sauronMinions > 0) + action.appendEffect( + new PlayoutDecisionEffect(playerId, + new IntegerAwaitingDecision(1, "Choose number of minions to spot", 0, sauronMinions, sauronMinions) { + @Override + public void decisionMade(String result) throws DecisionResultInvalidException { + int validatedResult = getValidatedResult(result); + if (validatedResult > 0) + action.appendEffect( + new AddTwilightEffect(self, validatedResult)); + } + } + )); return action; } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index eab370763..2e4e72e05 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -1,4 +1,8 @@
+15 Dec. 2012
+- Both "Forces of Mordor" and "Uruk Spy" now give a choice of number of minions to spot, therefore allowing to spot less
+than are in play.
+
 14 Dec. 2012
 - Effects that play attachments should now correctly check available twilight (including the cost of the effect)
 before being allowed to be played.