From ea457f105c87fb1ae8da8a9366f505b077780cd1 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 20 Nov 2011 03:35:02 +0000 Subject: [PATCH] "Bilbo" --- .../lotro/cards/set9/shire/Card9_049.java | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/shire/Card9_049.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/shire/Card9_049.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/shire/Card9_049.java new file mode 100644 index 000000000..f8af46422 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/shire/Card9_049.java @@ -0,0 +1,78 @@ +package com.gempukku.lotro.cards.set9.shire; + +import com.gempukku.lotro.cards.AbstractCompanion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddBurdenEffect; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Race; +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.AddTwilightEffect; +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: Reflections + * Side: Free + * Culture: Shire + * Twilight Cost: 2 + * Type: Companion • Hobbit + * Strength: 3 + * Vitality: 4 + * Resistance: 8 + * Game Text: Ring-bound. Each time the fellowship moves, if the twilight pool has 2 or fewer twilight tokens, add + * 2 burdens or add (3). Regroup: Add a burden to play a [SHIRE] tale. + */ +public class Card9_049 extends AbstractCompanion { + public Card9_049() { + super(2, 3, 4, Culture.SHIRE, Race.HOBBIT, null, "Bilbo", true); + addKeyword(Keyword.CAN_START_WITH_RING); + addKeyword(Keyword.RING_BOUND); + } + + @Override + public int getResistance() { + return 8; + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.WHEN_FELLOWSHIP_MOVES + && game.getGameState().getTwilightPool() <= 2) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + List possibleEffects = new LinkedList(); + possibleEffects.add( + new AddBurdenEffect(self, 2)); + possibleEffects.add( + new AddTwilightEffect(self, 3)); + action.appendEffect( + new ChoiceEffect(action, self.getOwner(), possibleEffects)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self) + && PlayConditions.canPlayFromHand(playerId, game, Culture.SHIRE, Keyword.TALE)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new AddBurdenEffect(self, 1)); + action.appendEffect( + new ChooseAndPlayCardFromHandEffect(playerId, game, Culture.SHIRE, Keyword.TALE)); + return Collections.singletonList(action); + } + return null; + } +}