From 2aee9aa61a05246460d5aa798847cfa564a532ad Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 3 Jan 2012 10:39:15 +0000 Subject: [PATCH] "Traveler's Homestead" --- .../lotro/cards/set13/gandalf/Card13_042.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/gandalf/Card13_042.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/gandalf/Card13_042.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/gandalf/Card13_042.java new file mode 100644 index 000000000..8d50c305c --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/gandalf/Card13_042.java @@ -0,0 +1,73 @@ +package com.gempukku.lotro.cards.set13.gandalf; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +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.cards.effects.SelfDiscardEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.GameUtils; +import com.gempukku.lotro.logic.actions.ActivateCardAction; +import com.gempukku.lotro.logic.actions.RequiredTriggerAction; +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: Bloodlines + * Side: Free + * Culture: Gandalf + * Twilight Cost: 3 + * Type: Condition • Support Area + * Game Text: To play, spot a Wizard. When you play this, add X [GANDALF] tokens here, where X is the current region + * number. Maneuver: Discard this from play or remove 2 tokens from here to discard a Shadow condition from play. + */ +public class Card13_042 extends AbstractPermanent { + public Card13_042() { + super(Side.FREE_PEOPLE, 3, CardType.CONDITION, Culture.GANDALF, Zone.SUPPORT, "Traveler's Homestead", true); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { + return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) + && PlayConditions.canSpot(game, Race.WIZARD); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.played(game, effectResult, self)) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new AddTokenEffect(self, self, Token.GANDALF, GameUtils.getRegion(game.getGameState()))); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)) { + ActivateCardAction action = new ActivateCardAction(self); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new RemoveTokenEffect(self, self, Token.GANDALF, 2)); + possibleCosts.add( + new SelfDiscardEffect(self)); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.CONDITION, Side.SHADOW)); + return Collections.singletonList(action); + } + return null; + } +}