From e3691f91a1433de022580a3127417d8b058594a2 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 20 Dec 2011 00:46:12 +0000 Subject: [PATCH] "City of the Trees" --- .../lotro/cards/TriggerConditions.java | 4 ++ .../lotro/cards/set13/elven/Card13_012.java | 56 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/elven/Card13_012.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/TriggerConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/TriggerConditions.java index 63a2f2acb..aaafb9d64 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/TriggerConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/TriggerConditions.java @@ -34,6 +34,10 @@ public class TriggerConditions { && game.getGameState().getCurrentPhase() == phase); } + public static boolean endOfTurn(LotroGame game, EffectResult effectResult) { + return effectResult.getType() == EffectResult.Type.END_OF_TURN; + } + public static boolean winsSkirmish(LotroGame game, EffectResult effectResult, Filterable... filters) { if (effectResult.getType() == EffectResult.Type.CHARACTER_WON_SKIRMISH) { CharacterWonSkirmishResult wonResult = (CharacterWonSkirmishResult) effectResult; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/elven/Card13_012.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/elven/Card13_012.java new file mode 100644 index 000000000..2d200b234 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/elven/Card13_012.java @@ -0,0 +1,56 @@ +package com.gempukku.lotro.cards.set13.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.SelfDiscardEffect; +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.OptionalTriggerAction; +import com.gempukku.lotro.logic.actions.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.DrawCardsEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Bloodlines + * Side: Free + * Culture: Elven + * Twilight Cost: 1 + * Type: Condition • Support Area + * Game Text: At the end of your turn, discard this from play if the fellowship did not move more than once this turn. + * At the start of each skirmish involving an Elf and a wounded minion, you may draw a card. + */ +public class Card13_012 extends AbstractPermanent { + public Card13_012() { + super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.ELVEN, Zone.SUPPORT, "City of the Trees"); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.endOfTurn(game, effectResult) + && game.getGameState().getMoveCount() == 1) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new SelfDiscardEffect(self)); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.startOfPhase(game, effectResult, Phase.SKIRMISH) + && PlayConditions.canSpot(game, Race.ELF, Filters.inSkirmishAgainst(CardType.MINION, Filters.wounded))) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendEffect( + new DrawCardsEffect(playerId, 1)); + return Collections.singletonList(action); + } + return null; + } +}