diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_024.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_024.java new file mode 100644 index 000000000..371e183a3 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set18/gandalf/Card18_024.java @@ -0,0 +1,68 @@ +package com.gempukku.lotro.cards.set18.gandalf; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.RemoveCardsFromTheGameEffect; +import com.gempukku.lotro.cards.effects.RemoveTwilightEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.common.*; +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.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.AddTwilightEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Treachery & Deceit + * Side: Free + * Culture: Gandalf + * Twilight Cost: 0 + * Type: Condition • Support Area + * Game Text: Spell. To play, exert Gandalf. When you play this condition, remove (3). At the start of the maneuver + * phase, add (4) and remove this condition from the game. + */ +public class Card18_024 extends AbstractPermanent { + public Card18_024() { + super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.GANDALF, Zone.SUPPORT, "Our Time", true); + addKeyword(Keyword.SPELL); + } + + @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.canExert(self, game, Filters.gandalf); + } + + @Override + public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + final PlayPermanentAction playCardAction = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty); + playCardAction.appendCost( + new ChooseAndExertCharactersEffect(playCardAction, playerId, 1, 1, Filters.gandalf)); + return playCardAction; + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.played(game, effectResult, self)) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new RemoveTwilightEffect(3)); + return Collections.singletonList(action); + } + if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new AddTwilightEffect(self, 4)); + action.appendEffect( + new RemoveCardsFromTheGameEffect(self.getOwner(), self, Collections.singleton(self))); + return Collections.singletonList(action); + } + return null; + } +}