diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/ActionsEnvironment.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/ActionsEnvironment.java index c6456dd4d..2fd87b3bb 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/ActionsEnvironment.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/ActionsEnvironment.java @@ -30,6 +30,7 @@ public interface ActionsEnvironment { void addUntilEndOfPhaseActionProxy(ActionProxy actionProxy, Phase phase); void addUntilEndOfTurnActionProxy(ActionProxy actionProxy); + void addAlwaysOnActionProxy(ActionProxy actionProxy); void addActionToStack(Action action); 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 bc98177af..62b371cb4 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 @@ -52,6 +52,7 @@ public class DefaultActionsEnvironment implements ActionsEnvironment { return result; } + @Override public void addAlwaysOnActionProxy(ActionProxy actionProxy) { _actionProxies.add(actionProxy); } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/pregame/MulliganProcess.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/pregame/MulliganProcess.java index de4234cc0..43ab72a30 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/pregame/MulliganProcess.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/pregame/MulliganProcess.java @@ -7,7 +7,7 @@ import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.PlayOrder; import com.gempukku.lotro.logic.decisions.MultipleChoiceAwaitingDecision; import com.gempukku.lotro.logic.timing.processes.GameProcess; -import com.gempukku.lotro.logic.timing.processes.turn.BetweenTurnsProcess; +import com.gempukku.lotro.logic.timing.processes.turn.EndOfTurnGameProcess; import java.util.HashSet; import java.util.Set; @@ -49,7 +49,7 @@ public class MulliganProcess implements GameProcess { }); _nextProcess = new MulliganProcess(_playOrder); } else { - _nextProcess = new BetweenTurnsProcess(); + _nextProcess = new EndOfTurnGameProcess(); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java index e31ab3180..025d57c72 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java @@ -1347,12 +1347,12 @@ public class GenericCardTestHelper extends AbstractAtTest { public void ApplyAdHocModifier(Modifier mod) { - _game.getModifiersEnvironment().addUntilEndOfTurnModifier(mod); + _game.getModifiersEnvironment().addAlwaysOnModifier(mod); } public void ApplyAdHocAction(ActionProxy action) { - _game.getActionsEnvironment().addUntilEndOfTurnActionProxy(action); + _game.getActionsEnvironment().addAlwaysOnActionProxy(action); } public void ShadowTakeControlOfSite() throws DecisionResultInvalidException { diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set13/Card_13_137_Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set13/Card_13_137_Tests.java index d924ab677..73fc97966 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set13/Card_13_137_Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set13/Card_13_137_Tests.java @@ -3,7 +3,6 @@ package com.gempukku.lotro.cards.official.set13; import com.gempukku.lotro.cards.GenericCardTestHelper; import com.gempukku.lotro.common.*; import com.gempukku.lotro.game.CardNotFoundException; -import com.gempukku.lotro.game.PhysicalCardImpl; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; import org.junit.Test; @@ -18,8 +17,10 @@ public class Card_13_137_Tests return new GenericCardTestHelper( new HashMap<>() {{ - put("card", "13_137"); - // put other cards in here as needed for the test case + put("theoden", "13_137"); + put("eowyn", "5_122"); + put("eomer", "4_267"); + put("theodred", "13_138"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -47,7 +48,7 @@ public class Card_13_137_Tests var scn = GetScenario(); - var card = scn.GetFreepsCard("card"); + var card = scn.GetFreepsCard("theoden"); assertEquals("Théoden", card.getBlueprint().getTitle()); assertEquals("The Renowned", card.getBlueprint().getSubtitle()); @@ -62,18 +63,119 @@ public class Card_13_137_Tests assertEquals(7, card.getBlueprint().getResistance()); } - // Uncomment any @Test markers below once this is ready to be used - //@Test - public void TheodenTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void TheodenIsDefenderPlus1IfYouCanSpotEowyn() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup var scn = GetScenario(); - var card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + var theoden = scn.GetFreepsCard("theoden"); + var eowyn = scn.GetFreepsCard("eowyn"); + scn.FreepsMoveCardToHand(eowyn); + scn.FreepsMoveCharToTable(theoden); scn.StartGame(); - scn.FreepsPlayCard(card); - assertEquals(3, scn.GetTwilight()); + assertFalse(scn.hasKeyword(theoden, Keyword.DEFENDER)); + assertEquals(0, scn.GetKeywordCount(theoden, Keyword.DEFENDER)); + + scn.FreepsPlayCard(eowyn); + + assertTrue(scn.hasKeyword(theoden, Keyword.DEFENDER)); + assertEquals(1, scn.GetKeywordCount(theoden, Keyword.DEFENDER)); + } + + @Test + public void TheodenIsDamagePlus1IfYouCanSpotEomer() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + var theoden = scn.GetFreepsCard("theoden"); + var eomer = scn.GetFreepsCard("eomer"); + scn.FreepsMoveCardToHand(eomer); + scn.FreepsMoveCharToTable(theoden); + + scn.StartGame(); + + assertFalse(scn.hasKeyword(theoden, Keyword.DAMAGE)); + assertEquals(0, scn.GetKeywordCount(theoden, Keyword.DAMAGE)); + + scn.FreepsPlayCard(eomer); + + assertTrue(scn.hasKeyword(theoden, Keyword.DAMAGE)); + assertEquals(1, scn.GetKeywordCount(theoden, Keyword.DAMAGE)); + } + + @Test + public void TheodenAdds1ToMoveLimitIfYouCanSpotTheodred() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + var theoden = scn.GetFreepsCard("theoden"); + var theodred = scn.GetFreepsCard("theodred"); + scn.FreepsMoveCardToHand(theodred); + scn.FreepsMoveCharToTable(theoden); + + scn.StartGame(); + + assertEquals(2, scn.GetMoveLimit()); + + scn.FreepsPlayCard(theodred); + + assertEquals(3, scn.GetMoveLimit()); + } + + @Test + public void TheodenMoveLimitIsNotAvailableToShadowPlayerIfPlayedInStartingFellowship() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + //We are specifically getting player 2's versions of the cards + var theoden = scn.GetShadowCard("theoden"); + var theodred = scn.GetShadowCard("theodred"); + + //Since we are specifically testing the starting fellowship, we won't use + // the normal StartGame call (since that skips starting fellowships) + //scn.StartGame(); + + scn.FreepsPassCurrentPhaseAction(); + scn.ShadowChooseCardBPFromSelection(theoden); + scn.ShadowChooseCardBPFromSelection(theodred); + + scn.SkipMulligans(); + + assertEquals(Phase.FELLOWSHIP, scn.GetCurrentPhase()); + + //Move limit should have been reset + assertEquals(2, scn.GetMoveLimit()); + } + + @Test + public void TheodenMoveLimitIsNotAvailableToShadowPlayer() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + //We are specifically getting player 2's versions of the cards + var eviltheoden = scn.GetShadowCard("theoden"); + var eviltheodred = scn.GetShadowCard("theodred"); + + var theoden = scn.GetFreepsCard("theoden"); + var theodred = scn.GetFreepsCard("theodred"); + + //Since we are specifically testing the starting fellowship, we won't use + // the normal StartGame call (since that skips starting fellowships) + //scn.StartGame(); + + scn.FreepsPassCurrentPhaseAction(); + + scn.ShadowChooseCardBPFromSelection(eviltheoden); + scn.ShadowChooseCardBPFromSelection(eviltheodred); + + scn.SkipMulligans(); + scn.SkipToSite(2); + + assertEquals(Phase.FELLOWSHIP, scn.GetCurrentPhase()); + + //Move limit should have been reset + assertEquals(2, scn.GetMoveLimit()); } }