"Gandalf", "Wisest of the Istari"

This commit is contained in:
marcins78
2013-01-24 15:36:42 +00:00
parent c301b40ee6
commit aaaed7fd5b
2 changed files with 47 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.decisions.CardsSelectionDecision; import com.gempukku.lotro.logic.decisions.CardsSelectionDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.decisions.IntegerAwaitingDecision; 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.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
@@ -46,6 +47,8 @@ public class Card20_155 extends AbstractEvent {
@Override @Override
public void decisionMade(String result) throws DecisionResultInvalidException { public void decisionMade(String result) throws DecisionResultInvalidException {
final int x = getValidatedResult(result); final int x = getValidatedResult(result);
action.appendCost(
new AddTwilightEffect(self, x));
action.appendEffect( action.appendEffect(
new PlayoutDecisionEffect(playerId, new PlayoutDecisionEffect(playerId,
new CardsSelectionDecision(1, "Choose up to 4 Shadow conditions with combined twilight cost of up to "+x, new CardsSelectionDecision(1, "Choose up to 4 Shadow conditions with combined twilight cost of up to "+x,

View File

@@ -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<OptionalTriggerAction> 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;
}
}