"Our Time"

This commit is contained in:
marcins78@gmail.com
2012-03-06 12:44:29 +00:00
parent dd3aa28599
commit 78035d5605

View File

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