diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/dwarven/Card15_003.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/dwarven/Card15_003.java new file mode 100644 index 000000000..74ff76826 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/dwarven/Card15_003.java @@ -0,0 +1,76 @@ +package com.gempukku.lotro.cards.set15.dwarven; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.effects.*; +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.OptionalTriggerAction; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * Set: The Hunters + * Side: Free + * Culture: Dwarven + * Twilight Cost: 2 + * Type: Condition • Support Area + * Game Text: When you play this, you may spot a Dwarf to place 2 [DWARVEN] tokens here. Fellowship: Discard this from + * play or remove a [DWARVEN] token from here to reveal the top card of your draw deck. If it is a [DWARVEN] card, + * take it into your hand, otherwise, place it in your discard pile. + */ +public class Card15_003 extends AbstractPermanent { + public Card15_003() { + super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.DWARVEN, Zone.SUPPORT, "Chamber of Records"); + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.played(game, effectResult, self) + && PlayConditions.canSpot(game, Race.DWARF)) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendEffect( + new AddTokenEffect(self, self, Token.DWARVEN, 2)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) { + final ActivateCardAction action = new ActivateCardAction(self); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new RemoveTokenEffect(self, self, Token.DWARVEN)); + possibleCosts.add( + new SelfDiscardEffect(self)); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new RevealTopCardsOfDrawDeckEffect(self, playerId, 1) { + @Override + protected void cardsRevealed(List cards) { + for (PhysicalCard card : cards) { + if (card.getBlueprint().getCulture() == Culture.DWARVEN) + action.appendEffect( + new PutCardFromDeckIntoHandOrDiscardEffect(card)); + else + action.appendEffect( + new DiscardCardFromDeckEffect(card)); + } + } + }); + return Collections.singletonList(action); + } + return null; + } +}