From f7f309a4c2738f1237f1071b5e12f2df3b74290c Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 4 Sep 2011 23:39:49 +0000 Subject: [PATCH] "The Gaffer" --- .../lotro/cards/set1/shire/Card1_291.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_291.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_291.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_291.java new file mode 100644 index 000000000..bafc5274f --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_291.java @@ -0,0 +1,65 @@ +package com.gempukku.lotro.cards.set1.shire; + +import com.gempukku.lotro.cards.AbstractAlly; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.ExertCharacterEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Phase; +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.CostToEffectAction; +import com.gempukku.lotro.logic.effects.HealCharacterEffect; +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 Fellowship of the Ring + * Side: Free + * Culture: Shire + * Twilight Cost: 1 + * Type: Ally • Home 1 • Hobbit + * Strength: 2 + * Vitality: 2 + * Site: 1 + * Game Text: Fellowship: Exert The Gaffer to heal Frodo or Sam. + */ +public class Card1_291 extends AbstractAlly { + public Card1_291() { + super(1, 1, 2, 2, Culture.SHIRE, "The Gaffer", true); + addKeyword(Keyword.HOBBIT); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self) + && PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self)) { + CostToEffectAction action = new CostToEffectAction(self, Keyword.FELLOWSHIP, "Exert The Gaffer to heal Frodo or Sam."); + action.addCost( + new ExertCharacterEffect(self)); + + PhysicalCard frodo = Filters.findFirstActive(game.getGameState(), game.getModifiersQuerying(), Filters.name("Frodo")); + PhysicalCard sam = Filters.findFirstActive(game.getGameState(), game.getModifiersQuerying(), Filters.name("Sam")); + + List possibleEffects = new LinkedList(); + if (frodo != null) + possibleEffects.add( + new HealCharacterEffect(frodo)); + if (sam != null) + possibleEffects.add( + new HealCharacterEffect(sam)); + + action.addEffect( + new ChoiceEffect(action, playerId, possibleEffects, false)); + + return Collections.singletonList(action); + } + return null; + } +}