Fixed salve for really real this time.

This commit is contained in:
Christian 'ketura' McCarty
2025-04-06 20:23:16 -05:00
parent c1e02b8fa5
commit 3d39aa8309
2 changed files with 43 additions and 16 deletions

View File

@@ -379,7 +379,7 @@
culture: Gandalf culture: Gandalf
twilight: 0 twilight: 0
type: Condition type: Condition
target: companion,not(hasAttached(name(Salve))) target: companion,OnePerBearer
keywords: Spell keywords: Spell
effects: [ effects: [
{ {
@@ -395,10 +395,17 @@
type: aboutToTakeWound type: aboutToTakeWound
filter: exhausted,bearer filter: exhausted,bearer
} }
cost: { cost: [
type: discard {
select: self type: memorize
} filter: bearer
memory: bearer
}
{
type: discard
select: self
}
]
effect: { effect: {
type: preventWound type: preventWound
select: memory(bearer) select: memory(bearer)

View File

@@ -17,8 +17,11 @@ public class Card_12_032_Tests
return new GenericCardTestHelper( return new GenericCardTestHelper(
new HashMap<>() new HashMap<>()
{{ {{
put("card", "12_32"); put("salve", "12_32");
// put other cards in here as needed for the test case put("aragorn", "1_89");
put("marksman", "1_176");
}}, }},
GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo, GenericCardTestHelper.FOTRFrodo,
@@ -38,12 +41,13 @@ public class Card_12_032_Tests
* Twilight Cost: 0 * Twilight Cost: 0
* Type: Condition * Type: Condition
* Subtype: * Subtype:
* Game Text: <b>Spell</b>. To play, spot a [gandalf] Wizard. Bearer must be a companion. Limit 1 per bearer.<br><b>Response:</b> If bearer is about to take a wound that would kill him or her, discard this condition to prevent that wound. * Game Text: <b>Spell</b>. To play, spot a [gandalf] Wizard. Bearer must be a companion. Limit 1 per bearer.
* <b>Response:</b> If bearer is about to take a wound that would kill him or her, discard this condition to prevent that wound.
*/ */
var scn = GetScenario(); var scn = GetScenario();
var card = scn.GetFreepsCard("card"); var card = scn.GetFreepsCard("salve");
assertEquals("Salve", card.getBlueprint().getTitle()); assertEquals("Salve", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle()); assertNull(card.getBlueprint().getSubtitle());
@@ -55,18 +59,34 @@ public class Card_12_032_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 SalveProtectsBearerFromLethalDamage() throws DecisionResultInvalidException, CardNotFoundException {
public void SalveTest1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup //Pre-game setup
var scn = GetScenario(); var scn = GetScenario();
var card = scn.GetFreepsCard("card"); var salve = scn.GetFreepsCard("salve");
scn.FreepsMoveCardToHand(card); var aragorn = scn.GetFreepsCard("aragorn");
scn.FreepsMoveCharToTable(aragorn);
scn.FreepsAttachCardsTo(aragorn, salve);
scn.ShadowMoveCharToTable("marksman");
scn.StartGame(); scn.StartGame();
scn.FreepsPlayCard(card); scn.AddWoundsToChar(aragorn, 3);
scn.SkipToPhase(Phase.ARCHERY);
scn.PassCurrentPhaseActions();
scn.FreepsChooseCard(aragorn);
assertEquals(1, scn.GetVitality(aragorn));
assertEquals(Zone.ATTACHED, salve.getZone());
assertEquals(Zone.FREE_CHARACTERS, aragorn.getZone());
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(Zone.DISCARD, salve.getZone());
assertEquals(Zone.FREE_CHARACTERS, aragorn.getZone());
assertEquals(1, scn.GetVitality(aragorn));
assertEquals(0, scn.GetTwilight());
} }
} }