diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_089.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_089.java new file mode 100644 index 000000000..ef12fa81c --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_089.java @@ -0,0 +1,49 @@ +package com.gempukku.lotro.cards.set4.gandalf; + +import com.gempukku.lotro.cards.AbstractCompanion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddTwilightEffect; +import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromDiscardEffect; +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.ActivateCardAction; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Two Towers + * Side: Free + * Culture: Gandalf + * Twilight Cost: 4 + * Type: Companion • Wizard + * Strength: 7 + * Vitality: 4 + * Resistance: 6 + * Signet: Theoden + * Game Text: Fellowship: If the twilight pool has fewer than 2 twilight tokens, add (2) to play a character from your + * discard pile. + */ +public class Card4_089 extends AbstractCompanion { + public Card4_089() { + super(4, 7, 4, Culture.GANDALF, Race.WIZARD, Signet.THÉODEN, "Gandalf", true); + } + + @Override + protected List getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self) + && game.getGameState().getTwilightPool() < 2 + && Filters.filter(game.getGameState().getDiscard(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION), Filters.playable(game)).size() > 0) { + ActivateCardAction action = new ActivateCardAction(self, Keyword.FELLOWSHIP); + action.appendCost( + new AddTwilightEffect(self, 2)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Filters.type(CardType.COMPANION))); + return Collections.singletonList(action); + } + return null; + } +}