diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java index 86b9855d5..b4e3fff83 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java @@ -268,7 +268,7 @@ public class PlayConditions { return false; } - public static boolean isGettingWounded(Effect effect, LotroGame game, Filter... filters) { + public static boolean isGettingWounded(Effect effect, LotroGame game, Filterable... filters) { if (effect.getType() == EffectResult.Type.WOUND) { WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect; return Filters.filter(woundEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), filters).size() > 0; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/site/Card5_119.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/site/Card5_119.java new file mode 100644 index 000000000..679584592 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/site/Card5_119.java @@ -0,0 +1,58 @@ +package com.gempukku.lotro.cards.set5.site; + +import com.gempukku.lotro.cards.AbstractSite; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.PreventCardEffect; +import com.gempukku.lotro.cards.effects.RemoveTwilightEffect; +import com.gempukku.lotro.common.Block; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.effects.WoundCharactersEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * Set: Battle of Helm's Deep + * Twilight Cost: 8 + * Type: Site + * Site: 8T + * Game Text: Plains. Response: If your mounted minion is about to take a wound, remove (2) to prevent that wound. + */ +public class Card5_119 extends AbstractSite { + public Card5_119() { + super("Nan Curunir", Block.TWO_TOWERS, 8, 8, Direction.RIGHT); + addKeyword(Keyword.PLAINS); + } + + @Override + public List getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { + if (PlayConditions.isGettingWounded(effect, game, CardType.MINION, Filters.owner(playerId)) + && game.getGameState().getTwilightPool() >= 2) { + final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect; + final Collection cardsToBeWounded = woundEffect.getAffectedCardsMinusPrevented(game); + + final PlayEventAction action = new PlayEventAction(self); + action.appendCost( + new RemoveTwilightEffect(2)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose minion", CardType.MINION, Filters.owner(playerId), Filters.in(cardsToBeWounded)) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard minion) { + action.appendEffect( + new PreventCardEffect(woundEffect, minion)); + } + }); + return Collections.singletonList(action); + } + return null; + } +}