From f0eacdc3e75e76fa8fdeadee08172dcbf4a3a3ce Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 28 Oct 2011 16:03:43 +0000 Subject: [PATCH] "Terrible and Evil" --- .../lotro/cards/set7/gandalf/Card7_050.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_050.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_050.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_050.java new file mode 100644 index 000000000..c14b2aa73 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_050.java @@ -0,0 +1,66 @@ +package com.gempukku.lotro.cards.set7.gandalf; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +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.decisions.DecisionResultInvalidException; +import com.gempukku.lotro.logic.decisions.IntegerAwaitingDecision; +import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; +import com.gempukku.lotro.logic.effects.WoundCharactersEffect; + +import java.util.Collection; + +/** + * Set: The Return of the King + * Side: Free + * Culture: Gandalf + * Twilight Cost: 3 + * Type: Event • Maneuver + * Game Text: Spell. Exert Gandalf X times to wound a minion X times. If that minion is a Nazgul, wound it again. + */ +public class Card7_050 extends AbstractEvent { + public Card7_050() { + super(Side.FREE_PEOPLE, 3, Culture.GANDALF, "Terrible and Evil", Phase.MANEUVER); + addKeyword(Keyword.SPELL); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canExert(self, game, Filters.name("Gandalf")); + } + + @Override + public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) { + final PlayEventAction action = new PlayEventAction(self); + int vitality = game.getModifiersQuerying().getVitality(game.getGameState(), Filters.findFirstActive(game.getGameState(), game.getModifiersQuerying(), Filters.name("Gandalf"))); + action.appendCost( + new PlayoutDecisionEffect(game.getUserFeedback(), playerId, + new IntegerAwaitingDecision(1, "Choose how many times you wish to exert Gandalf", 0, vitality - 1) { + @Override + public void decisionMade(String result) throws DecisionResultInvalidException { + int exertCount = getValidatedResult(result); + action.insertCost( + new ChooseAndExertCharactersEffect(action, playerId, exertCount, exertCount, Filters.name("Gandalf"))); + action.appendEffect( + new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, exertCount, CardType.MINION) { + @Override + protected void woundedCardsCallback(Collection cards) { + for (PhysicalCard card : cards) { + if (card.getBlueprint().getRace() == Race.NAZGUL) ; + action.appendEffect(new WoundCharactersEffect(self, card)); + } + + } + }); + } + })); + return action; + } +}