Fixed Into the Caves, for realsies this time.

This commit is contained in:
Christian 'ketura' McCarty
2025-04-06 17:07:55 -05:00
parent 91024f1f29
commit ac22e0644d
4 changed files with 57 additions and 13 deletions

View File

@@ -449,7 +449,7 @@
requires: [ requires: [
{ {
type: CanSpot type: CanSpot
filter: name(Frodo,AssignableToSkirmishAgainst(minion)) filter: name(Frodo),AssignableToSkirmishAgainst(minion)
} }
{ {
type: CanSpot type: CanSpot

View File

@@ -115,4 +115,15 @@ public enum Keyword implements Filterable {
public boolean isRealKeyword() { public boolean isRealKeyword() {
return realKeyword; return realKeyword;
} }
public static Keyword parse(String name) {
String nameCaps = name.toUpperCase().trim().replace(' ', '_').replace('-', '_');
String nameLower = name.toLowerCase();
for (Keyword keyword : values()) {
if (keyword.getHumanReadable().toLowerCase().equals(nameLower) || keyword.toString().equals(nameCaps))
return keyword;
}
return null;
}
} }

View File

@@ -18,8 +18,8 @@ public class Card_17_096_Tests
new HashMap<>() new HashMap<>()
{{ {{
put("eowyn", "17_96"); put("eowyn", "17_96");
put("scout", "1_270"); put("scout", "1_270");
put("soldier", "1_271");
}}, }},
GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo, GenericCardTestHelper.FOTRFrodo,

View File

@@ -17,8 +17,9 @@ public class Card_17_100_Tests
return new GenericCardTestHelper( return new GenericCardTestHelper(
new HashMap<>() new HashMap<>()
{{ {{
put("card", "17_100"); put("caves", "17_100");
// put other cards in here as needed for the test case
put("sauron", "9_48");
}}, }},
GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo, GenericCardTestHelper.FOTRFrodo,
@@ -38,12 +39,14 @@ public class Card_17_100_Tests
* Twilight Cost: 1 * Twilight Cost: 1
* Type: Condition * Type: Condition
* Subtype: Support area * Subtype: Support area
* Game Text: To play, spot 3 [rohan] companions.<br><b>Assignment:</b> Assign a minion to Frodo to make that minion lose all game text keywords of your choice and unable to gain game text keywords until the regroup phase. * Game Text: To play, spot 3 [rohan] companions.
* <b>Assignment:</b> Assign a minion to Frodo to make that minion lose all game text keywords of your choice
* and unable to gain game text keywords until the regroup phase.
*/ */
var scn = GetScenario(); var scn = GetScenario();
var card = scn.GetFreepsCard("card"); var card = scn.GetFreepsCard("caves");
assertEquals("Into the Caves", card.getBlueprint().getTitle()); assertEquals("Into the Caves", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle()); assertNull(card.getBlueprint().getSubtitle());
@@ -55,18 +58,48 @@ public class Card_17_100_Tests
assertEquals(1, card.getBlueprint().getTwilightCost()); assertEquals(1, card.getBlueprint().getTwilightCost());
} }
// Uncomment any @Test markers below once this is ready to be used @Test
//@Test public void IntotheCavesAssignsFrodoToMinionToRemoveKeywords() throws DecisionResultInvalidException, CardNotFoundException {
public void IntotheCavesTest1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup //Pre-game setup
var scn = GetScenario(); var scn = GetScenario();
var card = scn.GetFreepsCard("card"); var frodo = scn.GetRingBearer();
scn.FreepsMoveCardToHand(card); var caves = scn.GetFreepsCard("caves");
scn.FreepsMoveCardToSupportArea(caves);
var sauron = scn.GetShadowCard("sauron");
scn.ShadowMoveCharToTable(sauron);
scn.StartGame(); scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(1, scn.GetTwilight()); scn.SkipToPhase(Phase.ARCHERY);
scn.SkipToPhase(Phase.ASSIGNMENT);
assertTrue(scn.hasKeyword(sauron, Keyword.DAMAGE));
assertTrue(scn.hasKeyword(sauron, Keyword.ENDURING));
assertTrue(scn.hasKeyword(sauron, Keyword.FIERCE));
assertFalse(scn.IsCharAssigned(frodo));
assertFalse(scn.IsCharAssigned(sauron));
assertTrue(scn.FreepsActionAvailable(caves));
scn.FreepsUseCardAction(caves);
assertTrue(scn.IsCharAssigned(frodo));
assertTrue(scn.IsCharAssigned(sauron));
assertTrue(scn.FreepsDecisionAvailable("keyword"));
scn.FreepsChooseMultipleChoiceOption("DAMAGE");
assertFalse(scn.hasKeyword(sauron, Keyword.DAMAGE));
assertTrue(scn.hasKeyword(sauron, Keyword.ENDURING));
assertTrue(scn.hasKeyword(sauron, Keyword.FIERCE));
scn.FreepsChooseYes();
scn.FreepsChooseMultipleChoiceOption("ENDURING");
assertFalse(scn.hasKeyword(sauron, Keyword.DAMAGE));
assertFalse(scn.hasKeyword(sauron, Keyword.ENDURING));
assertTrue(scn.hasKeyword(sauron, Keyword.FIERCE));
scn.FreepsChooseNo();
assertFalse(scn.hasKeyword(sauron, Keyword.DAMAGE));
assertFalse(scn.hasKeyword(sauron, Keyword.ENDURING));
assertTrue(scn.hasKeyword(sauron, Keyword.FIERCE));
assertTrue(scn.ShadowAnyDecisionsAvailable());
} }
} }