From 85bac22b6c75666f30d46f21a57d910d35e5ac9d Mon Sep 17 00:00:00 2001 From: "marcin.sciesinski" Date: Sat, 2 Mar 2019 16:29:05 -0800 Subject: [PATCH] The "Response" is covered by a different set of rules than the "playableInPhases" --- .../lotro/cards/set5/sauron/Card5_096.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/sauron/Card5_096.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/sauron/Card5_096.java index 51b544073..2eab713cb 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/sauron/Card5_096.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/sauron/Card5_096.java @@ -1,6 +1,8 @@ package com.gempukku.lotro.cards.set5.sauron; import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.AbstractResponseEvent; +import com.gempukku.lotro.cards.PlayConditions; import com.gempukku.lotro.cards.actions.PlayEventAction; import com.gempukku.lotro.cards.effects.AddBurdenEffect; import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect; @@ -56,7 +58,7 @@ public class Card5_096 extends AbstractEvent { RevealCardFromHandResult revealResult = (RevealCardFromHandResult) effectResult; if (revealResult.getSource().getOwner().equals(game.getGameState().getCurrentPlayerId()) && revealResult.getRevealedCard() == self - && checkPlayRequirements(playerId, game, self, 0, 0, false, false)) { + && checkResponsePlayRequirements(playerId, game, self, 0, 0, false, false)) { PlayEventAction action = new PlayEventAction(self); action.appendEffect( new AddBurdenEffect(self.getOwner(), self, 2)); @@ -65,4 +67,14 @@ public class Card5_096 extends AbstractEvent { } return null; } + + private boolean checkResponsePlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { + if (!game.getModifiersQuerying().canPayExtraCostsToPlay(game.getGameState(), self)) + return false; + + int toilCount = game.getModifiersQuerying().getKeywordCount(game.getGameState(), self, Keyword.TOIL); + if (toilCount > 0) + twilightModifier -= toilCount * Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.owner(playerId), getCulture(), Filters.character, Filters.canExert(self)); + return (getSide() != Side.SHADOW || PlayConditions.canPayForShadowCard(game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty)); + } }