"Phial of Galadriel", "Light in Dark Places"

This commit is contained in:
marcins78
2013-01-07 16:46:08 +00:00
parent dc9116ceaf
commit 08592ded14

View File

@@ -0,0 +1,84 @@
package com.gempukku.lotro.cards.set20.elven;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.AttachPermanentAction;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.SpotEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
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.ActivateCardAction;
import com.gempukku.lotro.logic.effects.HealCharactersEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* 1
* Phial of Galadriel, Light in Dark Places
* Elven Artifact
* 2
* To play, exert an Elf (or spot Galadriel).
* Bearer must be a Ring-bound companion.
* Fellowship: Discard this artfiact to heal bearer (and remove a burden if bearer is the Ring-bearer).
*/
public class Card20_101 extends AbstractAttachableFPPossession {
public Card20_101() {
super(1, 0, 0, Culture.ELVEN, CardType.ARTIFACT, null, "Phial of Galadriel", "Light in Dark Places", true);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, Filter additionalAttachmentFilter, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, additionalAttachmentFilter, twilightModifier)
&& (PlayConditions.canSpot(game, Filters.galadriel) || PlayConditions.canExert(self, game, Race.ELF));
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(CardType.COMPANION, Keyword.RING_BOUND);
}
@Override
public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filterable additionalAttachmentFilter, int twilightModifier) {
AttachPermanentAction playCardAction = super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new SpotEffect(1, Filters.galadriel));
possibleCosts.add(
new ChooseAndExertCharactersEffect(playCardAction, playerId, 1, 1, Race.ELF) {
@Override
public String getText(LotroGame game) {
return "Exert an Elf";
}
});
playCardAction.appendCost(
new ChoiceEffect(playCardAction, playerId, possibleCosts));
return playCardAction;
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
&& PlayConditions.canSelfDiscard(self, game)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
action.appendEffect(
new HealCharactersEffect(self, self.getAttachedTo()));
if (Filters.ringBearer.accepts(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo()))
action.appendEffect(
new RemoveBurdenEffect(playerId, self));
return Collections.singletonList(action);
}
return null;
}
}