Fixing Helpless PC errata not blocking the Sam response action (for json Sams)

This commit is contained in:
Christian 'ketura' McCarty
2024-05-27 17:55:03 -05:00
parent d717729398
commit fab8a47580
5 changed files with 163 additions and 20 deletions

View File

@@ -712,7 +712,7 @@
}
}
{
type: trigger
type: ActivatedTrigger
optional: true
trigger: {
type: killed
@@ -750,8 +750,7 @@
}
}
{
type: trigger
optional: true
type: ActivatedTrigger
trigger: {
type: killed
filter: name(Frodo),ring bearer

View File

@@ -1221,7 +1221,7 @@
}
}
{
type: trigger
type: ActivatedTrigger
optional: true
trigger: {
type: killed

View File

@@ -152,8 +152,7 @@
]
}
{
type: trigger
optional: true
type: ActivatedTrigger
trigger: {
type: killed
filter: name(Frodo),ring bearer

View File

@@ -207,7 +207,7 @@
}
}
{
type: trigger
type: ActivatedTrigger
optional: true
trigger: {
type: killed

View File

@@ -18,8 +18,10 @@ public class Card_02_076_ErrataTests
return new GenericCardTestHelper(
new HashMap<>()
{{
put("card", "52_76");
// put other cards in here as needed for the test case
put("sam", "1_311");
put("helpless", "52_76");
put("toto", "10_68");
put("nelya","1_233");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -35,18 +37,18 @@ public class Card_02_076_ErrataTests
* Name: Helpless
* Unique: False
* Side: Shadow
* Culture: Wraith
* Culture: Ringwraith
* Twilight Cost: 1
* Type: Condition
* Subtype: Support area
* Game Text: Bearer's special abilities cannot be used.
* Maneuver: Exert a non-enduring Nazgul to transfer this <thin>to a Ring-bound companion.</thin>
* Response: If a burden is removed, spot or reveal a Nazgul from hand to transfer this to a Ring-bound companion.
* Maneuver: Exert a non-enduring Nazgul to transfer this to a Ring-bound companion.
* Response: If a burden is removed, spot or reveal a Nazgul from hand to transfer this to a Ring-bound companion.
*/
var scn = GetScenario();
var card = scn.GetFreepsCard("card");
var card = scn.GetFreepsCard("helpless");
assertEquals("Helpless", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle());
@@ -58,18 +60,161 @@ public class Card_02_076_ErrataTests
assertEquals(1, card.getBlueprint().getTwilightCost());
}
// Uncomment any @Test markers below once this is ready to be used
//@Test
public void HelplessTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void HelplessBlocksSpecialAbilities() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
var frodo = scn.GetRingBearer();
var sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(sam);
var helpless = scn.GetShadowCard("helpless");
var nelya = scn.GetShadowCard("nelya");
scn.ShadowAttachCardsTo(sam, helpless);
scn.ShadowMoveCharToTable(nelya);
scn.StartGame();
scn.FreepsPlayCard(card);
//The Fellowship burden-removing special ability should be blocked
assertFalse(scn.FreepsActionAvailable(sam));
assertEquals(1, scn.GetTwilight());
scn.SkipToAssignments();
scn.FreepsAssignToMinions(frodo, nelya);
scn.FreepsResolveSkirmish(frodo);
scn.PassCurrentPhaseActions();
//The Response ring-bearer special ability should also be blocked
assertFalse(scn.FreepsHasOptionalTriggerAvailable());
}
@Test
public void HelplessDoesNotBlockAbilitiesWhileInSupportArea() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var frodo = scn.GetRingBearer();
var sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(sam);
var helpless = scn.GetShadowCard("helpless");
var nelya = scn.GetShadowCard("nelya");
scn.ShadowMoveCardToSupportArea(helpless);
scn.ShadowMoveCharToTable(nelya);
scn.StartGame();
//The Fellowship burden-removing special ability should NOT be blocked
assertTrue(scn.FreepsActionAvailable(sam));
scn.SkipToAssignments();
scn.FreepsAssignToMinions(frodo, nelya);
scn.FreepsResolveSkirmish(frodo);
scn.PassCurrentPhaseActions();
//The Response ring-bearer special ability should also NOT be blocked
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
}
@Test
public void HelplessManeuverActionTransfersToRingBoundCompanion() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var frodo = scn.GetRingBearer();
var sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(sam);
var helpless = scn.GetShadowCard("helpless");
var toto = scn.GetShadowCard("toto");
var nelya = scn.GetShadowCard("nelya");
scn.ShadowMoveCardToSupportArea(helpless);
scn.ShadowMoveCharToTable(toto, nelya);
scn.StartGame();
scn.SkipToPhase(Phase.MANEUVER);
scn.FreepsPassCurrentPhaseAction();
assertTrue(scn.ShadowActionAvailable(helpless));
assertEquals(0, scn.GetWoundsOn(toto));
assertEquals(0, scn.GetWoundsOn(nelya));
assertEquals(Zone.SUPPORT, helpless.getZone());
scn.ShadowUseCardAction(helpless);
// Exert automatically put on Nelya as the only non-enduring nazgul option
assertEquals(0, scn.GetWoundsOn(toto));
assertEquals(1, scn.GetWoundsOn(nelya));
//Can go on either Sam or Frodo
assertEquals(2, scn.GetShadowCardChoiceCount());
scn.ShadowChooseCard(frodo);
assertEquals(Zone.ATTACHED, helpless.getZone());
assertEquals(frodo, helpless.getAttachedTo());
}
@Test
public void HelplessResponseCanSpotNazgulToTransfer() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(sam);
var helpless = scn.GetShadowCard("helpless");
var toto = scn.GetShadowCard("toto");
var nelya = scn.GetShadowCard("nelya");
scn.ShadowMoveCardToSupportArea(helpless);
scn.ShadowMoveCharToTable(nelya);
scn.ShadowMoveCardToDiscard(toto);
scn.StartGame();
//1 added from bid
assertEquals(1, scn.GetBurdens());
scn.FreepsUseCardAction(sam);
assertEquals(Zone.SUPPORT, helpless.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
scn.ShadowChooseCard(sam);
assertEquals(Zone.ATTACHED, helpless.getZone());
assertEquals(sam, helpless.getAttachedTo());
assertFalse(scn.FreepsActionAvailable(sam));
}
@Test
public void HelplessResponseCanRevealNazgulToTransfer() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(sam);
var helpless = scn.GetShadowCard("helpless");
var toto = scn.GetShadowCard("toto");
var nelya = scn.GetShadowCard("nelya");
scn.ShadowMoveCardToSupportArea(helpless);
scn.ShadowMoveCardToHand(nelya);
scn.ShadowMoveCardToDiscard(toto);
scn.StartGame();
//1 added from bid
assertEquals(1, scn.GetBurdens());
scn.FreepsUseCardAction(sam);
assertEquals(Zone.SUPPORT, helpless.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
scn.FreepsDismissRevealedCards();
scn.ShadowChooseCard(sam);
assertEquals(Zone.ATTACHED, helpless.getZone());
assertEquals(sam, helpless.getAttachedTo());
assertFalse(scn.FreepsActionAvailable(sam));
}
}