"Uncertain Future"

This commit is contained in:
marcins78@gmail.com
2011-12-04 17:58:15 +00:00
parent f1bb7f874d
commit 03ffc7ec17

View File

@@ -0,0 +1,92 @@
package com.gempukku.lotro.cards.set11.elven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.*;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.decisions.YesNoDecision;
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.game.PhysicalCard;
import java.util.List;
import java.util.Collections;
import java.util.LinkedList;
/**
* Set: Shadows
* Side: Free
* Culture: Elven
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: When you play this condition, spot an Elf to add 3 [ELVEN] tokens here. Maneuver: Discard this condition
* or remove an [ELVEN] token from here to reveal the top card of your draw deck. You may place that card beneath your
* draw deck.
*/
public class Card11_026 extends AbstractPermanent {
public Card11_026() {
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.ELVEN, Zone.SUPPORT, "Uncertain Future", true);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, self)
&& PlayConditions.canSpot(game, Race.ELF)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new AddTokenEffect(self, self, Token.ELVEN, 3));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new RemoveTokenEffect(self, self, Token.ELVEN) {
@Override
public String getText(LotroGame game) {
return "Remove an ELVEN token from here";
}
});
possibleCosts.add(
new SelfDiscardEffect(self) {
@Override
public String getText(LotroGame game) {
return "Discard this condition";
}
});
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new RevealTopCardsOfDrawDeckEffect(self, playerId, 1) {
@Override
protected void cardsRevealed(List<PhysicalCard> cards) {
for (final PhysicalCard card : cards) {
action.appendEffect(
new PlayoutDecisionEffect(playerId,
new YesNoDecision("Do you want to put " + GameUtils.getCardLink(card) + " beneath your draw deck?") {
@Override
protected void yes() {
action.appendEffect(
new PutCardFromDeckOnBottomOfDeckEffect(self, card));
}
}));
}
}
});
return Collections.singletonList(action);
}
return null;
}
}