From 027dd88a2fc0d39338a0187941c54a46622c5b4b Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 15 Nov 2011 17:40:40 +0000 Subject: [PATCH] "Treebeard" --- .../lotro/cards/set10/gandalf/Card10_018.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set10/gandalf/Card10_018.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set10/gandalf/Card10_018.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set10/gandalf/Card10_018.java new file mode 100644 index 000000000..cd19a6ed3 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set10/gandalf/Card10_018.java @@ -0,0 +1,68 @@ +package com.gempukku.lotro.cards.set10.gandalf; + +import com.gempukku.lotro.cards.AbstractCompanion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ExertCharactersEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Race; +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 java.util.Collections; +import java.util.List; + +/** + * Set: Mount Doom + * Side: Free + * Culture: Gandalf + * Twilight Cost: 5 + * Type: Companion • Ent + * Strength: 12 + * Vitality: 4 + * Resistance: 6 + * Game Text: To play, spot 3 [GANDALF] companions. Regroup: Exert Treebeard twice to play a [GANDALF] condition from + * your discard pile and make an opponent discard one of his or her conditions. + */ +public class Card10_018 extends AbstractCompanion { + public Card10_018() { + super(5, 12, 4, Culture.GANDALF, Race.ENT, null, "Treebeard", true); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty) + && PlayConditions.canSpot(game, 2, Culture.GANDALF, CardType.COMPANION); + } + + @Override + protected List getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self) + && PlayConditions.canSelfExert(self, 2, game) + && PlayConditions.canPlayFromDiscard(playerId, game, Culture.GANDALF, CardType.CONDITION)) { + final ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ExertCharactersEffect(self, self)); + action.appendCost( + new ExertCharactersEffect(self, self)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Culture.GANDALF, CardType.CONDITION)); + action.appendEffect( + new ChooseOpponentEffect(playerId) { + @Override + protected void opponentChosen(String opponentId) { + action.appendEffect( + new ChooseAndDiscardCardsFromPlayEffect(action, opponentId, 1, 1, Filters.owner(opponentId), CardType.CONDITION)); + } + }); + return Collections.singletonList(action); + } + return null; + } +}