From db6d9bad0c8e29633c26b3efa4619b1c66e776c7 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 1 Nov 2011 12:34:23 +0000 Subject: [PATCH] "Gollum" --- .../gempukku/lotro/cards/PlayConditions.java | 4 ++ .../lotro/cards/set7/gollum/Card7_059.java | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gollum/Card7_059.java 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 fad5715ff..6bf7e1e7a 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 @@ -156,6 +156,10 @@ public class PlayConditions { return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION) - game.getGameState().getThreats() >= count; } + public static boolean canRemoveThreat(LotroGame game, PhysicalCard card, int count) { + return game.getGameState().getThreats() >= count; + } + public static boolean canExertMultiple(PhysicalCard source, LotroGame game, int times, int count, Filterable... filters) { return canExertMultiple(source, game.getGameState(), game.getModifiersQuerying(), times, count, filters); } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gollum/Card7_059.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gollum/Card7_059.java new file mode 100644 index 000000000..5c023f094 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gollum/Card7_059.java @@ -0,0 +1,69 @@ +package com.gempukku.lotro.cards.set7.gollum; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Phase; +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.RemoveThreatsEffect; +import com.gempukku.lotro.logic.modifiers.StrengthModifier; +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; + +/** + * Set: The Return of the King + * Side: Shadow + * Culture: Gollum + * Twilight Cost: 2 + * Type: Minion + * Strength: 5 + * Vitality: 4 + * Site: 3 + * Game Text: Skirmish: Exert Gollum twice or remove a threat to make him strength +2. + */ +public class Card7_059 extends AbstractMinion { + public Card7_059() { + super(2, 5, 4, 3, null, Culture.GOLLUM, "Gollum", true); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self, 0) + && + (PlayConditions.canSelfExert(self, 2, game) + || PlayConditions.canRemoveThreat(game, self, 1))) { + ActivateCardAction action = new ActivateCardAction(self); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, self) { + @Override + public String getText(LotroGame game) { + return "Exert Gollum twice"; + } + }); + possibleCosts.add( + new RemoveThreatsEffect(self, 1) { + @Override + public String getText(LotroGame game) { + return "Remove a threat"; + } + }); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new AddUntilEndOfPhaseModifierEffect( + new StrengthModifier(self, self, 2), Phase.SKIRMISH)); + return Collections.singletonList(action); + } + return null; + } +}