From d2b859e9966bddaa99d54e316c0ddca6ad322464 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 7 Nov 2011 23:30:21 +0000 Subject: [PATCH] "Gorgoroth Soldier" --- .../lotro/cards/set7/sauron/Card7_278.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_278.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_278.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_278.java new file mode 100644 index 000000000..496a7d780 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_278.java @@ -0,0 +1,60 @@ +package com.gempukku.lotro.cards.set7.sauron; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.PreventCardEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Race; +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.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.effects.WoundCharactersEffect; +import com.gempukku.lotro.logic.timing.Effect; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Shadow + * Culture: Sauron + * Twilight Cost: 3 + * Type: Minion • Orc + * Strength: 9 + * Vitality: 2 + * Site: 5 + * Game Text: Besieger. Response: If a besieger is about to take a wound, discard 2 cards from hand to prevent it. + */ +public class Card7_278 extends AbstractMinion { + public Card7_278() { + super(3, 9, 2, 5, Race.ORC, Culture.SAURON, "Gorgoroth Soldier"); + addKeyword(Keyword.BESIEGER); + } + + @Override + public List getOptionalInPlayBeforeActions(String playerId, LotroGame game, final Effect effect, final PhysicalCard self) { + if (PlayConditions.isGettingWounded(effect, game, Keyword.BESIEGER) + && PlayConditions.canDiscardFromHand(game, playerId, 2, Filters.any)) { + final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect; + final Collection cardsToBeWounded = woundEffect.getAffectedCardsMinusPrevented(game); + final ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 2)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose besieger", Keyword.BESIEGER, Filters.in(cardsToBeWounded)) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard besieger) { + action.appendEffect( + new PreventCardEffect(woundEffect, besieger)); + } + }); + return Collections.singletonList(action); + } + return null; + } +}