diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractLotroCardBlueprint.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractLotroCardBlueprint.java index f39bb9a94..02279c43d 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractLotroCardBlueprint.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractLotroCardBlueprint.java @@ -196,6 +196,11 @@ public abstract class AbstractLotroCardBlueprint implements LotroCardBlueprint { return null; } + @Override + public List getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + return null; + } + @Override public List getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { return null; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/modifiers/spotting/SimpleLotroCardBlueprint.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/modifiers/spotting/SimpleLotroCardBlueprint.java index 733c98052..5b5202bdf 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/modifiers/spotting/SimpleLotroCardBlueprint.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/modifiers/spotting/SimpleLotroCardBlueprint.java @@ -72,6 +72,11 @@ public class SimpleLotroCardBlueprint implements LotroCardBlueprint { return null; } + @Override + public List getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + return null; + } + @Override public List getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { return null; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/wraith/Card12_183.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/wraith/Card12_183.java new file mode 100644 index 000000000..d8677672a --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/wraith/Card12_183.java @@ -0,0 +1,58 @@ +package com.gempukku.lotro.cards.set12.wraith; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.effects.RevealCardEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +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.GameState; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.actions.OptionalTriggerAction; +import com.gempukku.lotro.logic.modifiers.ModifiersQuerying; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Black Rider + * Side: Shadow + * Culture: Wraith + * Twilight Cost: 8 + * Type: Minion • Nazgul + * Strength: 14 + * Vitality: 4 + * Site: 3 + * Game Text: Fierce. The Witch-King is twilight cost -1 for each wound on the Ring-bearer. Each time a companion is + * played, you may reveal this card from hand to exert the Ring-bearer. + */ +public class Card12_183 extends AbstractMinion { + public Card12_183() { + super(8, 14, 4, 3, Race.NAZGUL, Culture.WRAITH, "The Witch-king", true); + addKeyword(Keyword.FIERCE); + } + + @Override + public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) { + return -gameState.getWounds(gameState.getRingBearer(gameState.getCurrentPlayerId())); + } + + @Override + public List getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (TriggerConditions.played(game, effectResult, CardType.COMPANION) + && !playerId.equals(game.getGameState().getCurrentPlayerId())) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendCost( + new RevealCardEffect(self, self)); + action.appendEffect( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.ringBearer)); + return Collections.singletonList(action); + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprint.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprint.java index c778e49d3..cf7da5f69 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprint.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprint.java @@ -69,6 +69,8 @@ public interface LotroCardBlueprint { public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self); + public List getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self); + public List getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self); public RequiredTriggerAction getDiscardedFromPlayRequiredTrigger(LotroGame game, PhysicalCard self); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java index 1892a7f36..1c117e1bf 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java @@ -203,6 +203,19 @@ public class DefaultActionsEnvironment implements ActionsEnvironment { } } } + + // Optional triggers from hand + for (PhysicalCard cardInHand : _lotroGame.getGameState().getHand(playerId)) { + for (EffectResult effectResult : effectResults) { + List actions = cardInHand.getBlueprint().getOptionalAfterTriggersFromHand(playerId, _lotroGame, effectResult, cardInHand); + if (actions != null) { + for (OptionalTriggerAction action : actions) { + if (!effectResult.wasOptionalTriggerUsed(action)) + gatheredActions.put(action, effectResult); + } + } + } + } } for (Action gatheredAction : gatheredActions.keySet())