From fda398aefb2a582cce8bd782e5bfab960d40f9ad Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 30 Aug 2011 11:16:02 +0000 Subject: [PATCH] "Uruviel" --- .../lotro/cards/set1/elven/Card1_067.java | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/elven/Card1_067.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/elven/Card1_067.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/elven/Card1_067.java new file mode 100644 index 000000000..7ca5d031d --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/elven/Card1_067.java @@ -0,0 +1,102 @@ +package com.gempukku.lotro.cards.set1.elven; + +import com.gempukku.lotro.cards.AbstractAlly; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.modifiers.ProxyingModifier; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filter; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.LotroCardBlueprint; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.modifiers.Modifier; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.LinkedList; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Free + * Culture: Elven + * Twilight Cost: 2 + * Type: Ally • Home 6 • Elf + * Strength: 5 + * Vitality: 2 + * Site: 6 + * Game Text: While you can spot your site 6, Uruviel has the game text of that site. + */ +public class Card1_067 extends AbstractAlly { + public Card1_067() { + super(2, 6, 5, 2, Culture.ELVEN, "Uruviel", "1_67", true); + addKeyword(Keyword.ELF); + } + + private Filter getFilter(PhysicalCard self) { + return Filters.and(Filters.type(CardType.SITE), Filters.owner(self.getOwner()), Filters.siteNumber(3)); + } + + private LotroCardBlueprint getCopied(LotroGame game, PhysicalCard self) { + PhysicalCard firstActive = Filters.findFirstActive(game.getGameState(), game.getModifiersQuerying(), getFilter(self)); + if (firstActive != null) + return firstActive.getBlueprint(); + return null; + } + + @Override + public Modifier getAlwaysOnEffect(PhysicalCard self) { + return new ProxyingModifier(self, getFilter(self)); + } + + @Override + public List getRequiredIsAboutToActions(LotroGame game, Effect effect, EffectResult effectResult, PhysicalCard self) { + LotroCardBlueprint copied = getCopied(game, self); + if (copied != null) + return copied.getRequiredIsAboutToActions(game, effect, effectResult, self); + return null; + } + + @Override + public List getRequiredWhenActions(LotroGame game, EffectResult effectResult, PhysicalCard self) { + LotroCardBlueprint copied = getCopied(game, self); + if (copied != null) + return copied.getRequiredWhenActions(game, effectResult, self); + return null; + } + + @Override + public List getPlayableIsAboutToActions(String playerId, LotroGame game, Effect effect, EffectResult effectResult, PhysicalCard self) { + LotroCardBlueprint copied = getCopied(game, self); + if (copied != null) + return copied.getPlayableIsAboutToActions(playerId, game, effect, effectResult, self); + return null; + } + + @Override + public List getPlayableWhenActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + LotroCardBlueprint copied = getCopied(game, self); + if (copied != null) + return copied.getPlayableWhenActions(playerId, game, effectResult, self); + return null; + } + + @Override + public List getPlayablePhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (self.getZone() == Zone.FREE_SUPPORT) { + LotroCardBlueprint copied = getCopied(game, self); + if (copied != null) + return copied.getPlayablePhaseActions(playerId, game, self); + return null; + } else if (PlayConditions.canPlayDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) { + List actions = new LinkedList(); + + appendPlayAllyActions(actions, game, self); + appendHealAllyActions(actions, game, self); + + return actions; + } + return null; + } +}