Fixed Berserker Torch (Toil on Shadow attachments)

This commit is contained in:
marcin.sciesinski
2021-03-21 19:02:44 -07:00
parent 6834d5d3cf
commit 17a8e73c8c
2 changed files with 26 additions and 1 deletions

View File

@@ -43,7 +43,8 @@ public class PlayUtils {
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
if (card.getBlueprint().getSide() == Side.SHADOW) {
final int twilightCostOnTarget = game.getModifiersQuerying().getTwilightCost(game, card, physicalCard, twilightModifier, false);
return twilightCostOnTarget <= game.getGameState().getTwilightPool() - withTwilightRemoved;
int potentialDiscount = game.getModifiersQuerying().getPotentialDiscount(game, card);
return twilightCostOnTarget - potentialDiscount <= game.getGameState().getTwilightPool() - withTwilightRemoved;
} else {
return true;
}

View File

@@ -1,5 +1,6 @@
package com.gempukku.lotro.at;
import com.gempukku.lotro.common.Token;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCard;
@@ -332,4 +333,27 @@ public class ToilAtTest extends AbstractAtTest {
// It's 6 not 8, because of roaming penalty
assertEquals(6, _game.getGameState().getTwilightPool());
}
@Test
public void berserkerTorchPlaysCorrectly() throws DecisionResultInvalidException, CardNotFoundException {
initializeSimplestGame();
PhysicalCardImpl urukDominator = createCard(P2, "12_152");
PhysicalCardImpl berserkerTorch = createCard(P2, "12_136");
skipMulligans();
moveCardToZone(urukDominator, Zone.HAND);
moveCardToZone(berserkerTorch, Zone.HAND);
_game.getGameState().setTwilight(6);
playerDecided(P1, "");
playerDecided(P2, getCardActionId(P2, "Play"));
playerDecided(P2, getCardActionId(P2, "Play"));
assertEquals(Zone.ATTACHED, berserkerTorch.getZone());
assertEquals(1, _game.getGameState().getTokenCount(urukDominator, Token.WOUND));
assertEquals(0, _game.getGameState().getTwilightPool());
}
}