diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/wraith/Card20_296.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/wraith/Card20_296.java new file mode 100644 index 000000000..fd62a3455 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/wraith/Card20_296.java @@ -0,0 +1,92 @@ +package com.gempukku.lotro.cards.set20.wraith; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.SpotEffect; +import com.gempukku.lotro.cards.effects.choose.*; +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.effects.WoundCharactersEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * 0 + * •Nine for Mortal Men + * Ringwraith Artifact • Support Area + * To play, exert a Nazgul (or spot The Witch-king). + * Response: If a Nazgul is about to take a wound, stack a [Ringwraith] card from hand here to prevent that wound. + * Shadow: Discard 2 cards stacked here to take a [Ringwraith] card from your discard pile into hand. + */ +public class Card20_296 extends AbstractPermanent { + public Card20_296() { + super(Side.SHADOW, 0, CardType.CONDITION, Culture.WRAITH, Zone.SUPPORT, "Nine for Mortal Men", null, true); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { + return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) + && (PlayConditions.canSpot(game, Filters.witchKing) || PlayConditions.canExert(self, game, Race.NAZGUL)); + } + + @Override + public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + PlayPermanentAction action = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new SpotEffect(1, Filters.witchKing) { + @Override + public String getText(LotroGame game) { + return "Spot The Witch-king"; + } + }); + possibleCosts.add( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.NAZGUL) { + @Override + public String getText(LotroGame game) { + return "Exert a Nazgul"; + } + }); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + return action; + } + + @Override + public List getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { + if (TriggerConditions.isGettingWounded(effect, game, Race.NAZGUL) + && PlayConditions.hasCardInHand(game, playerId, 1, Culture.WRAITH)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ChooseAndStackCardsFromHandEffect(action, playerId, 1, 1, self, Culture.WRAITH)); + action.appendEffect( + new ChooseAndPreventCardEffect(self, (WoundCharactersEffect) effect, playerId, "Choose Nazgul to prevent wound to", Race.NAZGUL)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 0) + && game.getGameState().getStackedCards(self).size()>=2) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ChooseAndDiscardStackedCardsEffect(action, playerId, 1, 1, self, Filters.any)); + action.appendEffect( + new ChooseAndPutCardFromDiscardIntoHandEffect(action, playerId, 1, 1, Culture.WRAITH)); + return Collections.singletonList(action); + } + return null; + } +}