From aaaed7fd5b85539ca0abe52a9a470be38fd97d80 Mon Sep 17 00:00:00 2001 From: marcins78 Date: Thu, 24 Jan 2013 15:36:42 +0000 Subject: [PATCH] "Gandalf", "Wisest of the Istari" --- .../lotro/cards/set20/gandalf/Card20_155.java | 3 ++ .../lotro/cards/set20/gandalf/Card20_157.java | 44 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_157.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_155.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_155.java index af5f88d8a..3514c5a0f 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_155.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_155.java @@ -11,6 +11,7 @@ import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.decisions.CardsSelectionDecision; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; import com.gempukku.lotro.logic.decisions.IntegerAwaitingDecision; +import com.gempukku.lotro.logic.effects.AddTwilightEffect; import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; @@ -46,6 +47,8 @@ public class Card20_155 extends AbstractEvent { @Override public void decisionMade(String result) throws DecisionResultInvalidException { final int x = getValidatedResult(result); + action.appendCost( + new AddTwilightEffect(self, x)); action.appendEffect( new PlayoutDecisionEffect(playerId, new CardsSelectionDecision(1, "Choose up to 4 Shadow conditions with combined twilight cost of up to "+x, diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_157.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_157.java new file mode 100644 index 000000000..5dc15f8b3 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/gandalf/Card20_157.java @@ -0,0 +1,44 @@ +package com.gempukku.lotro.cards.set20.gandalf; + +import com.gempukku.lotro.cards.AbstractCompanion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.effects.SelfExertEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +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.OptionalTriggerAction; +import com.gempukku.lotro.logic.effects.DrawCardsEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * 4 + * •Gandalf, Wisest of the Istari + * Gandalf Companion • Wizard + * 7 4 7 + * Each time you play a [Gandalf] spell, you may exert Gandalf to draw a card. + */ +public class Card20_157 extends AbstractCompanion { + public Card20_157() { + super(4, 7, 4, 7, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "Wisest of the Istari", true); + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.played(game, effectResult, Culture.GANDALF, Keyword.SPELL) + && PlayConditions.canSelfExert(self, game)) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendCost( + new SelfExertEffect(action, self)); + action.appendEffect( + new DrawCardsEffect(action, playerId, 1)); + return Collections.singletonList(action); + } + return null; + } +}