From c922ac271b901cdb154b56e2a8def0fa19853af0 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 8 Sep 2011 22:47:12 +0000 Subject: [PATCH] "Relics of Moria" --- .../lotro/cards/set1/moria/Card1_195.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_195.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_195.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_195.java new file mode 100644 index 000000000..16292e53f --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_195.java @@ -0,0 +1,61 @@ +package com.gempukku.lotro.cards.set1.moria; + +import com.gempukku.lotro.cards.AbstractLotroCardBlueprint; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromDiscardEffect; +import com.gempukku.lotro.cards.effects.RemoveTwilightEffect; +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.actions.DefaultCostToEffectAction; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Shadow + * Culture: Moria + * Twilight Cost: 1 + * Type: Condition + * Game Text: Plays to your support area. Shadow: Remove (2) to play a [MORIA] possession from your discard pile. + */ +public class Card1_195 extends AbstractLotroCardBlueprint { + public Card1_195() { + super(Side.SHADOW, CardType.CONDITION, Culture.MORIA, "Relics of Moria"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return PlayConditions.canPayForShadowCard(game, self, twilightModifier); + } + + @Override + public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return new PlayPermanentAction(self, Zone.SHADOW_SUPPORT, twilightModifier); + } + + @Override + public int getTwilightCost() { + return 1; + } + + @Override + public List getPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canPlayCardDuringPhase(game, Phase.SHADOW, self) + && checkPlayRequirements(playerId, game, self, 0)) + return Collections.singletonList(getPlayCardAction(playerId, game, self, 0)); + + if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 2)) { + DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.SHADOW, "Remove (2) to play a [MORIA] possession from your discard pile."); + action.addCost(new RemoveTwilightEffect(2)); + action.addEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, Filters.and(Filters.culture(Culture.MORIA), Filters.type(CardType.POSSESSION)))); + return Collections.singletonList(action); + } + return null; + } +}