From 8afede13561654c8b3bd83ecf5f969f9b5713f1d Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 20 Oct 2011 14:49:30 +0000 Subject: [PATCH] "Banner of Elbereth" --- .../lotro/cards/set6/elven/Card6_014.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/elven/Card6_014.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/elven/Card6_014.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/elven/Card6_014.java new file mode 100644 index 000000000..603c4b554 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/elven/Card6_014.java @@ -0,0 +1,63 @@ +package com.gempukku.lotro.cards.set6.elven; + +import com.gempukku.lotro.cards.AbstractAttachableFPPossession; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.LiberateASiteEffect; +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.ActivateCardAction; +import com.gempukku.lotro.logic.actions.OptionalTriggerAction; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.effects.DrawCardEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Ents of Fangorn + * Side: Free + * Culture: Elven + * Twilight Cost: 1 + * Type: Possession • Hand Weapon + * Game Text: Bearer must be an Elf companion. Each time bearer wins a skirmish, you may draw a card. + * Response: If bearer wins a skirmish, discard this possession to liberate a site. + */ +public class Card6_014 extends AbstractAttachableFPPossession { + public Card6_014() { + super(1, 0, 0, Culture.ELVEN, PossessionClass.HAND_WEAPON, "Banner of Elbereth"); + } + + @Override + protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.and(Race.ELF, CardType.COMPANION); + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (PlayConditions.winsSkirmish(effectResult, self.getAttachedTo())) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendEffect( + new DrawCardEffect(playerId, 1)); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getOptionalInPlayAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (PlayConditions.winsSkirmish(effectResult, self.getAttachedTo()) + && PlayConditions.canSelfDiscard(self, game)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new DiscardCardsFromPlayEffect(self, self)); + action.appendEffect( + new LiberateASiteEffect(self)); + return Collections.singletonList(action); + } + return null; + } +}