Fixed Theoden, The Renowned's move limit affecting the other player when he and Theodred are in the starting fellowship.

- Made the test rig AdHoc functions permanent rather than until end of turn
This commit is contained in:
Christian 'ketura' McCarty
2025-04-16 22:16:43 -05:00
parent 724a3bf6ec
commit ec2fc5a64b
5 changed files with 119 additions and 15 deletions

View File

@@ -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);

View File

@@ -52,6 +52,7 @@ public class DefaultActionsEnvironment implements ActionsEnvironment {
return result;
}
@Override
public void addAlwaysOnActionProxy(ActionProxy actionProxy) {
_actionProxies.add(actionProxy);
}

View File

@@ -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();
}
}

View File

@@ -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 {

View File

@@ -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());
}
}