From fa105f802ddb9a3b652cb98a1dab59c1390af9fd Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Fri, 13 Jan 2023 01:08:01 -0600 Subject: [PATCH] Fixing One Dwarf in Moria not offering the discard if the chosen dwarf has no wounds --- .../unofficial/pc/setV01/V1_dwarven.hjson | 16 +++++--- .../pc/vsets/set_v01/Card_V1_005_Tests.java | 38 +++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV01/V1_dwarven.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV01/V1_dwarven.hjson index 01449da58..c57ff6155 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV01/V1_dwarven.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV01/V1_dwarven.hjson @@ -203,22 +203,28 @@ type: event effect: [ { - type: heal + type: chooseActiveCards + count: 1 filter: choose(dwarf,hasAttachedCount(2,item)) + memorize: chosenDwarf + text: Choose a Dwarf with 2 or more items to heal + } + { + type: heal + filter: memory(chosenDwarf) times: 1 - memorize: healedDwarf } { type: memorizenumber memory: originalItemCount amount: { type: forEachYouCanSpot - filter: item,attachedTo(memory(healedDwarf)) + filter: item,attachedTo(memory(chosenDwarf)) } } { type: returntohand - filter: choose(item,attachedTo(memory(healedDwarf))) + filter: choose(item,attachedTo(memory(chosenDwarf))) count: 0-50 } { @@ -232,7 +238,7 @@ } secondNumber: { type: forEachYouCanSpot - filter: item,attachedTo(memory(healedDwarf)) + filter: item,attachedTo(memory(chosenDwarf)) } } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v01/Card_V1_005_Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v01/Card_V1_005_Tests.java index e0135bebe..b4823cdca 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v01/Card_V1_005_Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v01/Card_V1_005_Tests.java @@ -129,6 +129,44 @@ public class Card_V1_005_Tests assertEquals(Zone.SHADOW_CHARACTERS, scn.GetShadowCardByID(choices[5]).getZone()); } + @Test + public void OneDwarfDiscardsAndWoundsEvenIfDwarfIsFullyHealed() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl onedwarf = scn.GetFreepsCard("onedwarf"); + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + scn.FreepsMoveCardToHand(onedwarf); + scn.FreepsMoveCharToTable(gimli); + scn.FreepsMoveCharToTable("guard"); + scn.FreepsAttachCardsTo(gimli, "handaxe1", "handaxe2", "armor", "bracers", "ring"); + + scn.ShadowMoveCharToTable("runner", "runner2", "runner3", "runner4", "runner5", "runner6"); + + scn.StartGame(); + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsActionAvailable("One Dwarf")); + + assertEquals(0, scn.GetWoundsOn(gimli)); + scn.FreepsPlayCard(onedwarf); + assertTrue(scn.FreepsDecisionAvailable("Choose cards to return to hand")); + assertEquals(5, scn.GetFreepsCardChoiceCount()); // There are 5 items on gimli + String[] choices = scn.FreepsGetCardChoices().toArray(new String[0]); + scn.FreepsChoose(choices[0], choices[1], choices[2], choices[3], choices[4]); + + assertTrue(scn.FreepsDecisionAvailable("Choose cards to wound")); + choices = scn.FreepsGetCardChoices().toArray(new String[0]); + scn.FreepsChoose(choices[0], choices[1], choices[2], choices[3], choices[4]); + + assertEquals(Zone.DISCARD, scn.GetShadowCardByID(choices[0]).getZone()); + assertEquals(Zone.DISCARD, scn.GetShadowCardByID(choices[1]).getZone()); + assertEquals(Zone.DISCARD, scn.GetShadowCardByID(choices[2]).getZone()); + assertEquals(Zone.DISCARD, scn.GetShadowCardByID(choices[3]).getZone()); + assertEquals(Zone.DISCARD, scn.GetShadowCardByID(choices[4]).getZone()); + + assertEquals(Zone.SHADOW_CHARACTERS, scn.GetShadowCardByID(choices[5]).getZone()); + } + @Test public void OneDwarfCantBePlayedIfNoDwarvesWithTwoItems() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup