From e6ad0863fddcf42b3e9daeb906f265eef4544a85 Mon Sep 17 00:00:00 2001 From: "marcin.sciesinski" Date: Wed, 18 Sep 2019 18:12:45 -0700 Subject: [PATCH] Fixed effects that reduce cost of playing a card on a card. --- .../lotro/cards/set13/rohan/Card13_124.java | 2 +- .../lotro/cards/set2/gandalf/Card2_023.java | 4 +- .../lotro/cards/set2/shire/Card2_102.java | 2 +- .../lotro/cards/set4/elven/Card4_080.java | 2 +- .../effect/modifier/ModifyPlayOnCost.java | 4 +- .../logic/modifiers/AbstractModifier.java | 7 +- .../lotro/logic/modifiers/Modifier.java | 132 +++++++++--------- .../lotro/logic/modifiers/ModifiersLogic.java | 2 +- .../logic/modifiers/TwilightCostModifier.java | 2 +- .../com/gempukku/lotro/at/CostAtTest.java | 39 ++++++ 10 files changed, 114 insertions(+), 82 deletions(-) create mode 100644 gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/at/CostAtTest.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/rohan/Card13_124.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/rohan/Card13_124.java index 2d692218b..0cc9b947a 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/rohan/Card13_124.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set13/rohan/Card13_124.java @@ -40,7 +40,7 @@ public class Card13_124 extends AbstractCompanion { public List getInPlayModifiers(LotroGame game, final PhysicalCard self) { return Collections.singletonList(new AbstractModifier(self, "The cost of each possession you play on Eowyn during the fellowship phase is twilight cost -1", CardType.POSSESSION, new PhaseCondition(Phase.FELLOWSHIP), ModifierEffect.TWILIGHT_COST_MODIFIER) { @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { if (target == self) return -1; return 0; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/gandalf/Card2_023.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/gandalf/Card2_023.java index 8beae4381..c41c15deb 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/gandalf/Card2_023.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/gandalf/Card2_023.java @@ -36,8 +36,8 @@ public class Card2_023 extends AbstractPermanent { CardType.POSSESSION, CardType.ARTIFACT), ModifierEffect.TWILIGHT_COST_MODIFIER) { @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { - if (physicalCard.getBlueprint().getCardType() == CardType.POSSESSION || physicalCard.getBlueprint().getCardType() == CardType.ARTIFACT) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { + if (target != null && physicalCard.getBlueprint().getCardType() == CardType.POSSESSION || physicalCard.getBlueprint().getCardType() == CardType.ARTIFACT) { CardType cardType = target.getBlueprint().getCardType(); if (target.getBlueprint().getTitle().equals("Gandalf") || (cardType == CardType.COMPANION && target.getBlueprint().getSignet() == Signet.GANDALF)) return -1; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/shire/Card2_102.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/shire/Card2_102.java index 4754d0b5e..fc029105d 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/shire/Card2_102.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/shire/Card2_102.java @@ -36,7 +36,7 @@ public class Card2_102 extends AbstractCompanion { return Collections.singletonList( new AbstractModifier(self, "The cost of each artifact, possession, and [SHIRE] tale played on Frodo is -1.", Filters.or(CardType.ARTIFACT, CardType.POSSESSION, Filters.and(Culture.SHIRE, Keyword.TALE)), ModifierEffect.TWILIGHT_COST_MODIFIER) { @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { if (target == self) return -1; return 0; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/elven/Card4_080.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/elven/Card4_080.java index 45982a59b..bac61d207 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/elven/Card4_080.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/elven/Card4_080.java @@ -40,7 +40,7 @@ public class Card4_080 extends AbstractCompanion { return Collections.singletonList( new AbstractModifier(self, "The twilight cost of each ranged weapon played on Ordulus is -1.", PossessionClass.RANGED_WEAPON, ModifierEffect.TWILIGHT_COST_MODIFIER) { @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { if (target == self) return -1; return 0; diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/modifier/ModifyPlayOnCost.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/modifier/ModifyPlayOnCost.java index b773f4b33..eec9a3fd6 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/modifier/ModifyPlayOnCost.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/modifier/ModifyPlayOnCost.java @@ -34,8 +34,8 @@ public class ModifyPlayOnCost implements ModifierSourceProducer { return new AbstractModifier(actionContext.getSource(), "Cost to play on is modifier", filterable, requirementCondition, ModifierEffect.TWILIGHT_COST_MODIFIER) { @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { - if (Filters.and(onFilterable).accepts(game, target)) + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { + if (target != null && Filters.and(onFilterable).accepts(game, target)) return evaluator.evaluateExpression(game, null); return 0; } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/AbstractModifier.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/AbstractModifier.java index 1ef003630..9ea67bb9d 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/AbstractModifier.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/AbstractModifier.java @@ -129,12 +129,7 @@ public abstract class AbstractModifier implements Modifier { } @Override - public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, boolean ignoreRoamingPenalty) { - return 0; - } - - @Override - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { return 0; } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/Modifier.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/Modifier.java index 5e998106a..872be13a2 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/Modifier.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/Modifier.java @@ -13,143 +13,141 @@ import java.util.Map; import java.util.Set; public interface Modifier { - public PhysicalCard getSource(); + PhysicalCard getSource(); - public String getText(LotroGame game, PhysicalCard self); + String getText(LotroGame game, PhysicalCard self); - public ModifierEffect getModifierEffect(); + ModifierEffect getModifierEffect(); - public boolean isNonCardTextModifier(); + boolean isNonCardTextModifier(); - public Condition getCondition(); + Condition getCondition(); boolean isExtraPossessionClass(LotroGame game, PhysicalCard physicalCard, PhysicalCard attachedTo); - public boolean affectsCard(LotroGame game, PhysicalCard physicalCard); + boolean affectsCard(LotroGame game, PhysicalCard physicalCard); - public boolean hasRemovedText(LotroGame game, PhysicalCard physicalCard); + boolean hasRemovedText(LotroGame game, PhysicalCard physicalCard); - public boolean hasKeyword(LotroGame game, PhysicalCard physicalCard, Keyword keyword); + boolean hasKeyword(LotroGame game, PhysicalCard physicalCard, Keyword keyword); - public boolean hasSignet(LotroGame game, PhysicalCard physicalCard, Signet signet); + boolean hasSignet(LotroGame game, PhysicalCard physicalCard, Signet signet); - public int getKeywordCountModifier(LotroGame game, PhysicalCard physicalCard, Keyword keyword); + int getKeywordCountModifier(LotroGame game, PhysicalCard physicalCard, Keyword keyword); - public boolean appliesKeywordModifier(LotroGame game, PhysicalCard modifierSource, Keyword keyword); + boolean appliesKeywordModifier(LotroGame game, PhysicalCard modifierSource, Keyword keyword); - public boolean isKeywordRemoved(LotroGame game, PhysicalCard physicalCard, Keyword keyword); + boolean isKeywordRemoved(LotroGame game, PhysicalCard physicalCard, Keyword keyword); - public int getStrengthModifier(LotroGame game, PhysicalCard physicalCard); + int getStrengthModifier(LotroGame game, PhysicalCard physicalCard); - public boolean appliesStrengthBonusModifier(LotroGame game, PhysicalCard modifierSource, PhysicalCard modifierTaget); + boolean appliesStrengthBonusModifier(LotroGame game, PhysicalCard modifierSource, PhysicalCard modifierTaget); - public int getVitalityModifier(LotroGame game, PhysicalCard physicalCard); + int getVitalityModifier(LotroGame game, PhysicalCard physicalCard); - public int getResistanceModifier(LotroGame game, PhysicalCard physicalCard); + int getResistanceModifier(LotroGame game, PhysicalCard physicalCard); - public int getMinionSiteNumberModifier(LotroGame game, PhysicalCard physicalCard); + int getMinionSiteNumberModifier(LotroGame game, PhysicalCard physicalCard); - public boolean isAdditionalCardTypeModifier(LotroGame game, PhysicalCard physicalCard, CardType cardType); + boolean isAdditionalCardTypeModifier(LotroGame game, PhysicalCard physicalCard, CardType cardType); - public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, boolean ignoreRoamingPenalty); + int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty); - public int getPlayOnTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target); + int getRoamingPenaltyModifier(LotroGame game, PhysicalCard physicalCard); - public int getRoamingPenaltyModifier(LotroGame game, PhysicalCard physicalCard); + int getOverwhelmMultiplier(LotroGame game, PhysicalCard physicalCard); - public int getOverwhelmMultiplier(LotroGame game, PhysicalCard physicalCard); + boolean canTakeWounds(LotroGame game, Collection woundSources, PhysicalCard physicalCard, int woundsAlreadyTakenInPhase, int woundsToTake); - public boolean canTakeWounds(LotroGame game, Collection woundSources, PhysicalCard physicalCard, int woundsAlreadyTakenInPhase, int woundsToTake); + boolean canTakeWoundsFromLosingSkirmish(LotroGame game, PhysicalCard physicalCard, Set winners); - public boolean canTakeWoundsFromLosingSkirmish(LotroGame game, PhysicalCard physicalCard, Set winners); + boolean canTakeArcheryWound(LotroGame game, PhysicalCard physicalCard); - public boolean canTakeArcheryWound(LotroGame game, PhysicalCard physicalCard); + boolean canBeExerted(LotroGame game, PhysicalCard exertionSource, PhysicalCard exertedCard); - public boolean canBeExerted(LotroGame game, PhysicalCard exertionSource, PhysicalCard exertedCard); + boolean isAllyParticipateInArcheryFire(LotroGame game, PhysicalCard card); - public boolean isAllyParticipateInArcheryFire(LotroGame game, PhysicalCard card); + boolean isAllyParticipateInSkirmishes(LotroGame game, Side sidePlayer, PhysicalCard card); - public boolean isAllyParticipateInSkirmishes(LotroGame game, Side sidePlayer, PhysicalCard card); + boolean isUnhastyCompanionAllowedToParticipateInSkirmishes(LotroGame game, PhysicalCard card); - public boolean isUnhastyCompanionAllowedToParticipateInSkirmishes(LotroGame game, PhysicalCard card); + boolean isAllyPreventedFromParticipatingInArcheryFire(LotroGame game, PhysicalCard card); - public boolean isAllyPreventedFromParticipatingInArcheryFire(LotroGame game, PhysicalCard card); + boolean isAllyPreventedFromParticipatingInSkirmishes(LotroGame game, Side sidePlayer, PhysicalCard card); - public boolean isAllyPreventedFromParticipatingInSkirmishes(LotroGame game, Side sidePlayer, PhysicalCard card); + int getArcheryTotalModifier(LotroGame game, Side side); - public int getArcheryTotalModifier(LotroGame game, Side side); - - public int getMoveLimitModifier(LotroGame game); + int getMoveLimitModifier(LotroGame game); boolean addsTwilightForCompanionMove(LotroGame game, PhysicalCard companion); - public boolean addsToArcheryTotal(LotroGame game, PhysicalCard card); + boolean addsToArcheryTotal(LotroGame game, PhysicalCard card); - public boolean canPlayAction(LotroGame game, String performingPlayer, Action action); + boolean canPlayAction(LotroGame game, String performingPlayer, Action action); - public List getExtraPhaseAction(LotroGame game, PhysicalCard card); + List getExtraPhaseAction(LotroGame game, PhysicalCard card); - public List getExtraPhaseActionFromStacked(LotroGame game, PhysicalCard card); + List getExtraPhaseActionFromStacked(LotroGame game, PhysicalCard card); - public boolean canPayExtraCostsToPlay(LotroGame game, PhysicalCard card); + boolean canPayExtraCostsToPlay(LotroGame game, PhysicalCard card); - public void appendExtraCosts(LotroGame game, CostToEffectAction action, PhysicalCard card); + void appendExtraCosts(LotroGame game, CostToEffectAction action, PhysicalCard card); - public boolean canHavePlayedOn(LotroGame game, PhysicalCard playedCard, PhysicalCard target); + boolean canHavePlayedOn(LotroGame game, PhysicalCard playedCard, PhysicalCard target); - public boolean canHaveTransferredOn(LotroGame game, PhysicalCard playedCard, PhysicalCard target); + boolean canHaveTransferredOn(LotroGame game, PhysicalCard playedCard, PhysicalCard target); - public boolean canBeTransferred(LotroGame game, PhysicalCard attachment); + boolean canBeTransferred(LotroGame game, PhysicalCard attachment); - public boolean shouldSkipPhase(LotroGame game, Phase phase, String playerId); + boolean shouldSkipPhase(LotroGame game, Phase phase, String playerId); - public boolean isValidAssignments(LotroGame game, Side Side, PhysicalCard companion, Set minions); + boolean isValidAssignments(LotroGame game, Side Side, PhysicalCard companion, Set minions); - public boolean isValidAssignments(LotroGame game, Side Side, Map> assignments); + boolean isValidAssignments(LotroGame game, Side Side, Map> assignments); - public boolean isPreventedFromBeingAssignedToSkirmish(LotroGame game, Side sidePlayer, PhysicalCard card); + boolean isPreventedFromBeingAssignedToSkirmish(LotroGame game, Side sidePlayer, PhysicalCard card); - public boolean canBeDiscardedFromPlay(LotroGame game, String performingPlayer, PhysicalCard card, PhysicalCard source); + boolean canBeDiscardedFromPlay(LotroGame game, String performingPlayer, PhysicalCard card, PhysicalCard source); - public boolean canBeLiberated(LotroGame game, String performingPlayer, PhysicalCard card, PhysicalCard source); + boolean canBeLiberated(LotroGame game, String performingPlayer, PhysicalCard card, PhysicalCard source); - public boolean canBeReturnedToHand(LotroGame game, PhysicalCard card, PhysicalCard source); + boolean canBeReturnedToHand(LotroGame game, PhysicalCard card, PhysicalCard source); - public boolean canBeHealed(LotroGame game, PhysicalCard card); + boolean canBeHealed(LotroGame game, PhysicalCard card); - public boolean canAddBurden(LotroGame game, String performingPlayer, PhysicalCard source); + boolean canAddBurden(LotroGame game, String performingPlayer, PhysicalCard source); - public boolean canRemoveBurden(LotroGame game, PhysicalCard source); + boolean canRemoveBurden(LotroGame game, PhysicalCard source); - public boolean canRemoveThreat(LotroGame game, PhysicalCard source); + boolean canRemoveThreat(LotroGame game, PhysicalCard source); - public boolean canLookOrRevealCardsInHand(LotroGame game, String revealingPlayerId, String actingPlayerId); + boolean canLookOrRevealCardsInHand(LotroGame game, String revealingPlayerId, String actingPlayerId); - public boolean canDiscardCardsFromHand(LotroGame game, String playerId, PhysicalCard source); + boolean canDiscardCardsFromHand(LotroGame game, String playerId, PhysicalCard source); - public boolean canDiscardCardsFromTopOfDeck(LotroGame game, String playerId, PhysicalCard source); + boolean canDiscardCardsFromTopOfDeck(LotroGame game, String playerId, PhysicalCard source); - public int getSpotCountModifier(LotroGame game, Filterable filter); + int getSpotCountModifier(LotroGame game, Filterable filter); - public boolean hasFlagActive(LotroGame game, ModifierFlag modifierFlag); + boolean hasFlagActive(LotroGame game, ModifierFlag modifierFlag); - public boolean isSiteReplaceable(LotroGame game, String playerId); + boolean isSiteReplaceable(LotroGame game, String playerId); - public boolean canPlaySite(LotroGame game, String playerId); + boolean canPlaySite(LotroGame game, String playerId); - public boolean shadowCanHaveInitiative(LotroGame game); + boolean shadowCanHaveInitiative(LotroGame game); - public Side hasInitiative(LotroGame game); + Side hasInitiative(LotroGame game); - public int getInitiativeHandSizeModifier(LotroGame game); + int getInitiativeHandSizeModifier(LotroGame game); - public boolean lostAllKeywords(LotroGame game, PhysicalCard card); + boolean lostAllKeywords(LotroGame game, PhysicalCard card); Evaluator getFpSkirmishStrengthOverrideEvaluator(LotroGame game, PhysicalCard fpCharacter); - public boolean canSpotCulture(LotroGame game, Culture culture, String playerId); + boolean canSpotCulture(LotroGame game, Culture culture, String playerId); - public int getFPCulturesSpotCountModifier(LotroGame game, String playerId); + int getFPCulturesSpotCountModifier(LotroGame game, String playerId); int getSanctuaryHealModifier(LotroGame game); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/ModifiersLogic.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/ModifiersLogic.java index d58b0c38e..ad5b2912a 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/ModifiersLogic.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/ModifiersLogic.java @@ -473,7 +473,7 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying { int result = physicalCard.getBlueprint().getTwilightCost() + twilightCostModifier; result += physicalCard.getBlueprint().getTwilightCostModifier(game, physicalCard, target); for (Modifier modifier : getModifiersAffectingCard(game, ModifierEffect.TWILIGHT_COST_MODIFIER, physicalCard)) { - result += modifier.getTwilightCostModifier(game, physicalCard, ignoreRoamingPenalty); + result += modifier.getTwilightCostModifier(game, physicalCard, target, ignoreRoamingPenalty); } result = Math.max(0, result); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/TwilightCostModifier.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/TwilightCostModifier.java index eeed943f8..879dab11a 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/TwilightCostModifier.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/modifiers/TwilightCostModifier.java @@ -32,7 +32,7 @@ public class TwilightCostModifier extends AbstractModifier { } @Override - public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, boolean ignoreRoamingPenalty) { + public int getTwilightCostModifier(LotroGame game, PhysicalCard physicalCard, PhysicalCard target, boolean ignoreRoamingPenalty) { return _evaluator.evaluateExpression(game, physicalCard); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/at/CostAtTest.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/at/CostAtTest.java new file mode 100644 index 000000000..f8bd62df8 --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/at/CostAtTest.java @@ -0,0 +1,39 @@ +package com.gempukku.lotro.at; + +import com.gempukku.lotro.common.Zone; +import com.gempukku.lotro.game.CardNotFoundException; +import com.gempukku.lotro.game.PhysicalCardImpl; +import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import com.gempukku.lotro.logic.vo.LotroDeck; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +public class CostAtTest extends AbstractAtTest { + @Test + public void playOnCostReduction() throws DecisionResultInvalidException, CardNotFoundException { + Map decks = new HashMap(); + + LotroDeck deck = createSimplestDeck(); + // Frodo, Reluctant Adventurer + deck.setRingBearer("2_102"); + decks.put(P1, deck); + addPlayerDeck(P2, decks, null); + + initializeGameWithDecks(decks); + + PhysicalCardImpl hobbitSword = createCard(P1, "1_299"); + + _game.getGameState().addCardToZone(_game, hobbitSword, Zone.HAND); + + skipMulligans(); + + // Play Hobbit Sword (on Frodo) - should be free + final int twilightPool = _game.getGameState().getTwilightPool(); + playerDecided(P1, "0"); + assertEquals(twilightPool, _game.getGameState().getTwilightPool()); + } +}