From b4886e795d5123ed39411930c0c52f6d09b1ebed Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 12 Dec 2011 13:18:42 +0000 Subject: [PATCH] "Orc Artisan" --- .../lotro/cards/TriggerConditions.java | 13 +++++ .../lotro/cards/set12/orc/Card12_091.java | 48 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/orc/Card12_091.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 4f210661b..b67f0f977 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 @@ -242,6 +242,19 @@ public class TriggerConditions { return false; } + public static boolean playedOn(LotroGame game, EffectResult effectResult, Filterable targetFilter, Filterable... filters) { + if (effectResult.getType() == EffectResult.Type.PLAY) { + final PlayCardResult playResult = (PlayCardResult) effectResult; + final PhysicalCard attachedTo = playResult.getAttachedTo(); + if (attachedTo == null) + return false; + PhysicalCard playedCard = playResult.getPlayedCard(); + return Filters.and(filters).accepts(game.getGameState(), game.getModifiersQuerying(), playedCard) + && Filters.and(targetFilter).accepts(game.getGameState(), game.getModifiersQuerying(), attachedTo); + } + return false; + } + public static boolean movesTo(LotroGame game, EffectResult effectResult, Filterable... filters) { if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO && Filters.and(filters).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())) { diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/orc/Card12_091.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/orc/Card12_091.java new file mode 100644 index 000000000..c9615221e --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/orc/Card12_091.java @@ -0,0 +1,48 @@ +package com.gempukku.lotro.cards.set12.orc; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Race; +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.effects.AddTwilightEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Black Rider + * Side: Shadow + * Culture: Orc + * Twilight Cost: 5 + * Type: Minion • Orc + * Strength: 12 + * Vitality: 3 + * Site: 4 + * Game Text: Each time you play an [ORC] possession on an [ORC] Orc, you may add (1) (or (2) if that Orc is at a + * battleground or underground site). + */ +public class Card12_091 extends AbstractMinion { + public Card12_091() { + super(5, 12, 3, 4, Race.ORC, Culture.ORC, "Orc Artisan"); + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.playedOn(game, effectResult, Filters.and(Culture.ORC, Race.ORC), Culture.ORC, CardType.POSSESSION)) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + int count = PlayConditions.location(game, Filters.or(Keyword.BATTLEGROUND, Keyword.UNDERGROUND)) ? 2 : 1; + action.appendEffect( + new AddTwilightEffect(self, count)); + return Collections.singletonList(action); + } + return null; + } +}