From c083292a70bf6ace367e27969c5a388e3740c8ca Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 6 Mar 2012 11:49:44 +0000 Subject: [PATCH] "Ents Marching" --- .../lotro/cards/set18/gandalf/Card18_020.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_020.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_020.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_020.java new file mode 100644 index 000000000..67eb155a0 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_020.java @@ -0,0 +1,59 @@ +package com.gempukku.lotro.cards.set18.gandalf; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +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.effects.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.effects.DrawCardsEffect; +import com.gempukku.lotro.logic.modifiers.KeywordModifier; + +/** + * Set: Treachery & Deceit + * Side: Free + * Culture: Gandalf + * Twilight Cost: 3 + * Type: Event • Maneuver + * Game Text: If the fellowship is in region 1 or region 2, exert 2 Ents to make an Ent defender +1 until the regroup + * phase. If the fellowship is in region 3, spot a [GANDALF] companion to draw a card. + */ +public class Card18_020 extends AbstractEvent { + public Card18_020() { + super(Side.FREE_PEOPLE, 3, Culture.GANDALF, "Ents Marching", Phase.MANEUVER); + } + + @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) + && + ((GameUtils.getRegion(game.getGameState()) == 3 && PlayConditions.canSpot(game, Culture.GANDALF, CardType.COMPANION)) + || ((GameUtils.getRegion(game.getGameState()) == 1 || GameUtils.getRegion(game.getGameState()) == 2) && PlayConditions.canExert(self, game, 1, 2, Race.ENT))); + } + + @Override + public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + final PlayEventAction action = new PlayEventAction(self); + if (GameUtils.getRegion(game.getGameState()) == 3) + action.appendEffect( + new DrawCardsEffect(action, playerId, 1)); + else { + action.appendCost( + new ChooseAndExertCharactersEffect(action, playerId, 2, 2, Race.ENT)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose an Ent", Race.ENT) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard card) { + action.appendEffect( + new AddUntilStartOfPhaseModifierEffect( + new KeywordModifier(self, card, Keyword.DEFENDER, 1), Phase.REGROUP)); + } + }); + } + return action; + } +}