"Shadow Between"

This commit is contained in:
marcins78@gmail.com
2011-10-28 09:56:38 +00:00
parent 90d76373b7
commit b4f38354e9

View File

@@ -0,0 +1,68 @@
package com.gempukku.lotro.cards.set7.elven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.common.*;
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.ChooseAndHealCharactersEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: The Return of the King
* Side: Free
* Culture: Elven
* Twilight Cost: 2
* Type: Condition • Support Area
* Game Text: To play, spot an Elf. At the start of your regroup phase, you may discard this condition or a card from
* hand to heal an Elf.
*/
public class Card7_028 extends AbstractPermanent {
public Card7_028() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.ELVEN, Zone.SUPPORT, "Shadow Between", true);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canSpot(game, Race.ELF);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.START_OF_PHASE
&& game.getGameState().getCurrentPhase() == Phase.REGROUP) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new DiscardCardsFromPlayEffect(self, self) {
@Override
public String getText(LotroGame game) {
return "Discard this condition";
}
});
possibleCosts.add(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 1) {
@Override
public String getText(LotroGame game) {
return "Discard a card from hand";
}
});
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new ChooseAndHealCharactersEffect(action, playerId, Race.ELF));
return Collections.singletonList(action);
}
return null;
}
}