From 7269b04cc888e0518efbab95fd3f5f669fc72b09 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 6 Nov 2011 17:26:12 +0000 Subject: [PATCH] "Out of Sight and Shot" --- .../lotro/cards/set7/wraith/Card7_204.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/wraith/Card7_204.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/wraith/Card7_204.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/wraith/Card7_204.java new file mode 100644 index 000000000..cb30f2e70 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/wraith/Card7_204.java @@ -0,0 +1,65 @@ +package com.gempukku.lotro.cards.set7.wraith; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect; +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.actions.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Shadow + * Culture: Wraith + * Twilight Cost: 1 + * Type: Condition • Support Area + * Game Text: To play, spot a Nazgul. Each time a companion is played, the Free Peoples player must exert a companion. + * Shadow: Spot a Nazgul and discard this condition to play a Nazgul from your discard pile. + */ +public class Card7_204 extends AbstractPermanent { + public Card7_204() { + super(Side.SHADOW, 1, CardType.CONDITION, Culture.WRAITH, Zone.SUPPORT, "Out of Sight and Shot", true); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canSpot(game, Race.NAZGUL); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (PlayConditions.played(game, effectResult, CardType.COMPANION)) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new ChooseAndExertCharactersEffect(action, game.getGameState().getCurrentPlayerId(), 1, 1, CardType.COMPANION)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 0) + && PlayConditions.canSpot(game, Race.NAZGUL) + && PlayConditions.canSelfDiscard(self, game) + && PlayConditions.canPlayFromDiscard(playerId, game, Race.NAZGUL)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new DiscardCardsFromPlayEffect(self, self)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Race.NAZGUL)); + return Collections.singletonList(action); + } + return null; + } +}