Fixed Rallying Call failing to add threats if the twilight pool was at exactly 0 after playing the southron. (This should also address some other various play-from-hand effects that would encounter the same problem at exactly 0).
- Also fixed Dark Shape Sprang unit test and Cirdan-downstream unit test framework change
This commit is contained in:
@@ -49,7 +49,7 @@ public class PlayCardFromHand implements EffectAppenderProducer {
|
|||||||
final Filterable onFilterable = onFilterableSource.getFilterable(actionContext);
|
final Filterable onFilterable = onFilterableSource.getFilterable(actionContext);
|
||||||
return Filters.and(Filters.playable(game, costModifier, ignoreRoamingPenalty, ignoreInDeadPile), ExtraFilters.attachableTo(game, costModifier, onFilterable));
|
return Filters.and(Filters.playable(game, costModifier, ignoreRoamingPenalty, ignoreInDeadPile), ExtraFilters.attachableTo(game, costModifier, onFilterable));
|
||||||
}
|
}
|
||||||
return Filters.playable(game, removedTwilight, costModifier, ignoreRoamingPenalty, ignoreInDeadPile, true);
|
return Filters.playable(game, 0, costModifier, ignoreRoamingPenalty, ignoreInDeadPile, true);
|
||||||
},
|
},
|
||||||
(actionContext) -> {
|
(actionContext) -> {
|
||||||
final LotroGame game = actionContext.getGame();
|
final LotroGame game = actionContext.getGame();
|
||||||
|
|||||||
@@ -1125,7 +1125,7 @@ public class GenericCardTestHelper extends AbstractAtTest {
|
|||||||
return _game.isFinished();
|
return _game.isFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FreepsResolveRuleFirst() throws DecisionResultInvalidException { FreepsResolveActionOrder(null); }
|
public void FreepsResolveRuleFirst() throws DecisionResultInvalidException { FreepsResolveActionOrder(GetADParamAsList(P1, "actionText").getFirst()); }
|
||||||
public void FreepsResolveActionOrder(String option) throws DecisionResultInvalidException { ChooseAction(P1, "actionText", option); }
|
public void FreepsResolveActionOrder(String option) throws DecisionResultInvalidException { ChooseAction(P1, "actionText", option); }
|
||||||
|
|
||||||
public Filterable GenerateFreepsFilter(String filter) throws InvalidCardDefinitionException {
|
public Filterable GenerateFreepsFilter(String filter) throws InvalidCardDefinitionException {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class Card_10_019_Tests
|
|||||||
|
|
||||||
var scn = GetScenario();
|
var scn = GetScenario();
|
||||||
|
|
||||||
var card = scn.GetFreepsCard("card");
|
var card = scn.GetFreepsCard("sprang");
|
||||||
|
|
||||||
assertEquals("A Dark Shape Sprang", card.getBlueprint().getTitle());
|
assertEquals("A Dark Shape Sprang", card.getBlueprint().getTitle());
|
||||||
assertNull(card.getBlueprint().getSubtitle());
|
assertNull(card.getBlueprint().getSubtitle());
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ public class Card_10_047_Tests
|
|||||||
return new GenericCardTestHelper(
|
return new GenericCardTestHelper(
|
||||||
new HashMap<>()
|
new HashMap<>()
|
||||||
{{
|
{{
|
||||||
put("card", "10_47");
|
put("call", "10_47");
|
||||||
// put other cards in here as needed for the test case
|
put("southron", "4_220");
|
||||||
}},
|
}},
|
||||||
GenericCardTestHelper.FellowshipSites,
|
GenericCardTestHelper.FellowshipSites,
|
||||||
GenericCardTestHelper.FOTRFrodo,
|
GenericCardTestHelper.FOTRFrodo,
|
||||||
@@ -38,12 +38,14 @@ public class Card_10_047_Tests
|
|||||||
* Twilight Cost: 0
|
* Twilight Cost: 0
|
||||||
* Type: Condition
|
* Type: Condition
|
||||||
* Subtype: Support area
|
* Subtype: Support area
|
||||||
* Game Text: To play, spot a [raider] Man.<br>Threats cannot be removed by Free Peoples cards.<br><b>Shadow:</b> Remove (1) and play a Southron to add a threat.
|
* Game Text: To play, spot a [raider] Man.
|
||||||
|
* Threats cannot be removed by Free Peoples cards.
|
||||||
|
* <b>Shadow:</b> Remove (1) and play a Southron to add a threat.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var scn = GetScenario();
|
var scn = GetScenario();
|
||||||
|
|
||||||
var card = scn.GetFreepsCard("card");
|
var card = scn.GetFreepsCard("call");
|
||||||
|
|
||||||
assertEquals("Rallying Call", card.getBlueprint().getTitle());
|
assertEquals("Rallying Call", card.getBlueprint().getTitle());
|
||||||
assertNull(card.getBlueprint().getSubtitle());
|
assertNull(card.getBlueprint().getSubtitle());
|
||||||
@@ -55,18 +57,60 @@ public class Card_10_047_Tests
|
|||||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
assertEquals(0, card.getBlueprint().getTwilightCost());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment any @Test markers below once this is ready to be used
|
@Test
|
||||||
//@Test
|
public void RallyingCallRemoves1AndPlaysASouthronToAddAThreat() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
public void RallyingCallTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
var scn = GetScenario();
|
var scn = GetScenario();
|
||||||
|
|
||||||
var card = scn.GetFreepsCard("card");
|
var call = scn.GetShadowCard("call");
|
||||||
scn.FreepsMoveCardToHand(card);
|
var southron = scn.GetShadowCard("southron");
|
||||||
|
scn.ShadowMoveCardToSupportArea(call);
|
||||||
|
scn.ShadowMoveCardToHand(southron);
|
||||||
|
|
||||||
scn.StartGame();
|
scn.StartGame();
|
||||||
scn.FreepsPlayCard(card);
|
scn.SetTwilight(7);
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertEquals(10, scn.GetTwilight());
|
||||||
|
assertEquals(0, scn.getThreats());
|
||||||
|
assertTrue(scn.ShadowActionAvailable(call));
|
||||||
|
assertTrue(scn.ShadowPlayAvailable(southron));
|
||||||
|
assertEquals(Zone.HAND, southron.getZone());
|
||||||
|
|
||||||
|
scn.ShadowUseCardAction(call);
|
||||||
|
|
||||||
|
//10 twiliight -4 base -2 roaming -1 extra tax from Call
|
||||||
|
assertEquals(3, scn.GetTwilight());
|
||||||
|
assertEquals(1, scn.getThreats());
|
||||||
|
assertEquals(Zone.SHADOW_CHARACTERS, southron.getZone());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void RallyingCallHasEffectEvenWhenFinalTwilightPoolIsZero() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
//Pre-game setup
|
||||||
|
var scn = GetScenario();
|
||||||
|
|
||||||
|
var call = scn.GetShadowCard("call");
|
||||||
|
var southron = scn.GetShadowCard("southron");
|
||||||
|
scn.ShadowMoveCardToSupportArea(call);
|
||||||
|
scn.ShadowMoveCardToHand(southron);
|
||||||
|
|
||||||
|
scn.StartGame();
|
||||||
|
scn.SetTwilight(4);
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertEquals(7, scn.GetTwilight());
|
||||||
|
assertEquals(0, scn.getThreats());
|
||||||
|
assertTrue(scn.ShadowActionAvailable(call));
|
||||||
|
assertTrue(scn.ShadowPlayAvailable(southron));
|
||||||
|
assertEquals(Zone.HAND, southron.getZone());
|
||||||
|
|
||||||
|
scn.ShadowUseCardAction(call);
|
||||||
|
|
||||||
|
//We must ensure that the final tally results in an empty twilight pool
|
||||||
|
// as it is here that PlayCardFromHand falters if set up incorrectly
|
||||||
assertEquals(0, scn.GetTwilight());
|
assertEquals(0, scn.GetTwilight());
|
||||||
|
assertEquals(1, scn.getThreats());
|
||||||
|
assertEquals(Zone.SHADOW_CHARACTERS, southron.getZone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user