From 7fe076d20703d9bc46d87323b0bde9b7d06bf82a Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Wed, 2 Nov 2011 23:00:24 +0000 Subject: [PATCH] "Noble Leaders" --- .../lotro/cards/set7/gondor/Card7_112.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_112.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_112.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_112.java new file mode 100644 index 000000000..4fda86503 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gondor/Card7_112.java @@ -0,0 +1,88 @@ +package com.gempukku.lotro.cards.set7.gondor; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddTokenEffect; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.RemoveTokenEffect; +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.actions.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.modifiers.KeywordModifier; +import com.gempukku.lotro.logic.modifiers.StrengthModifier; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Free + * Culture: Gondor + * Twilight Cost: 1 + * Type: Condition • Support Area + * Game Text: When you play this condition, place a [GONDOR] token here for each of the following characters you can + * spot: Aragorn, Boromir, Denethor or Faramir. Skirmish: Remove a token from here or discard this condition to make + * a [GONDOR] companion strength +1 and damage +1. + */ +public class Card7_112 extends AbstractPermanent { + public Card7_112() { + super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GONDOR, Zone.SUPPORT, "Noble Leaders", true); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (PlayConditions.played(game, effectResult, self)) { + int countSpottable = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.or(Filters.aragorn, Filters.boromir, Filters.name("Denethor"), Filters.name("Faramir"))); + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new AddTokenEffect(self, self, Token.GONDOR, countSpottable)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self)) { + ActivateCardAction action = new ActivateCardAction(self); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new RemoveTokenEffect(self, self, Token.GONDOR) { + @Override + public String getText(LotroGame game) { + return "Remove a token from here"; + } + }); + possibleCosts.add( + new DiscardCardsFromPlayEffect(self, self) { + @Override + public String getText(LotroGame game) { + return "Discard this condition"; + } + }); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose a GONDOR companion", Culture.GONDOR, CardType.COMPANION) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard card) { + game.getModifiersEnvironment().addUntilEndOfPhaseModifier( + new StrengthModifier(self, card, 1), Phase.SKIRMISH); + game.getModifiersEnvironment().addUntilEndOfPhaseModifier( + new KeywordModifier(self, card, Keyword.DAMAGE, 1), Phase.SKIRMISH); + } + }); + return Collections.singletonList(action); + } + return null; + } +}