"Gandalf"

This commit is contained in:
marcins78@gmail.com
2012-01-25 16:18:37 +00:00
parent 5d396233dd
commit 86cfaac5b3

View File

@@ -0,0 +1,64 @@
package com.gempukku.lotro.cards.set15.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.AddBurdenEffect;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.effects.DrawCardsEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Hunters
* Side: Free
* Culture: Gandalf
* Twilight Cost: 4
* Type: Companion • Wizard
* Strength: 8
* Vitality: 4
* Resistance: 7
* Game Text: To play, spot 2 Hobbits. Each time you play a spell, you may add a burden to wound a minion. At the start
* of each skirmish involving Gandalf, you may draw a card and then discard a card from your hand.
*/
public class Card15_029 extends AbstractCompanion {
public Card15_029() {
super(4, 8, 4, 7, Culture.GANDALF, Race.WIZARD, null, "Gandalf", 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, 2, Race.HOBBIT);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, Filters.owner(playerId), Keyword.SPELL)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new AddBurdenEffect(self, 1));
action.appendEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION));
return Collections.singletonList(action);
}
if (TriggerConditions.startOfPhase(game, effectResult, Phase.SKIRMISH)
&& PlayConditions.canSpot(game, self, Filters.inSkirmish)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new DrawCardsEffect(action, playerId, 1));
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 1));
return Collections.singletonList(action);
}
return null;
}
}