From e0573b581d1cd973f41f5264d20e52fe508cb199 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Wed, 2 Nov 2011 23:45:05 +0000 Subject: [PATCH] "Support of the City" --- .../lotro/cards/set7/gondor/Card7_123.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_123.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_123.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_123.java new file mode 100644 index 000000000..d2af25d70 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_123.java @@ -0,0 +1,58 @@ +package com.gempukku.lotro.cards.set7.gondor; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddTokenEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect; +import com.gempukku.lotro.common.*; +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.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.LinkedList; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Free + * Culture: Gondor + * Twilight Cost: 0 + * Type: Condition • Support Area + * Game Text: Fellowship: Play a [GONDOR] Man to place a [GONDOR] token here. Fellowship: Play a [GONDOR] companion. + * That companion's twilight cost is -1 for each token here. Discard this condition. + */ +public class Card7_123 extends AbstractPermanent { + public Card7_123() { + super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.GONDOR, Zone.SUPPORT, "Support of the City"); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) { + List actions = new LinkedList(); + if (PlayConditions.canPlayFromHand(playerId, game, Culture.GONDOR, Race.MAN)) { + ActivateCardAction action = new ActivateCardAction(self); + action.setText("Add a GONDOR token here"); + action.appendCost( + new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Culture.GONDOR, Race.MAN)); + action.appendEffect( + new AddTokenEffect(self, self, Token.GONDOR, 1)); + actions.add(action); + } + int tokenCount = game.getGameState().getTokenCount(self, Token.GONDOR); + if (PlayConditions.canPlayFromHand(playerId, game, -tokenCount, Culture.GONDOR, CardType.COMPANION)) { + ActivateCardAction action = new ActivateCardAction(self); + action.setText("Play a GONDOR companion with modified twilight cost"); + action.appendEffect( + new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -tokenCount, Culture.GONDOR, CardType.COMPANION)); + action.appendEffect( + new DiscardCardsFromPlayEffect(self, self)); + actions.add(action); + } + return actions; + } + return null; + } +}