From 7faba18fb8ac21b42bacd420776b73b370ba2195 Mon Sep 17 00:00:00 2001 From: Devon Henegar Date: Mon, 29 Apr 2024 19:32:30 -0400 Subject: [PATCH] Add config and tests for v2 Denethor --- .../pc/setV02/setv02-Gondor-playtest.hjson | 68 ++++++++- .../pc/vsets/set_v02/Card_V2_016_Tests.java | 2 - .../pc/vsets/set_v02/Card_V2_018_Tests.java | 134 ++++++++++++++++-- 3 files changed, 188 insertions(+), 16 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV02/setv02-Gondor-playtest.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV02/setv02-Gondor-playtest.hjson index 05135a2f6..2f38c36e6 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV02/setv02-Gondor-playtest.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/setV02/setv02-Gondor-playtest.hjson @@ -157,17 +157,73 @@ race: Man strength: 5 vitality: 3 - /*requires: { - - } effects: [ { - + type: modifier + modifier: { + type: modifyStrength + filter: culture(gondor),companion + amount: { + type: requires + requires: { + type: IsGreaterThanOrEqual + firstNumber: { + type: ForEachThreat + } + secondNumber: { + type: ForEachYouCanSpot + filter: companion + } + } + true: -2 + false: 0 + } + } } { - + type: trigger + optional: true + text: Would you like to add 2 threats to choose a Gondor companion to become strength +2 and Defender +1 until the regroup phase (1 threat if target is Boromir)? + trigger: { + type: startOfPhase + phase: maneuver + } + cost: [ + { + type: spot + filter: choose(culture(gondor),companion) + memorize: chosenGondorian + } + { + type: addThreats + amount: { + type: requires + requires: { + type: memoryMatches + memory: chosenGondorian + filter: name(Boromir) + } + true: 1 + false: 2 + } + } + ] + effect: [ + { + type: modifyStrength + filter: memory(chosenGondorian) + amount: 2 + until: start(regroup) + } + { + type: addKeyword + filter: memory(chosenGondorian) + keyword: defender+1 + until: start(regroup) + } + ] } - ]*/ + ] gametext: While you can spot the same number of threats as companions, each [gondor] companion is strength -2.
At the start of the maneuver phase, you may add 2 threats to make a [gondor] companion defender +1 and strength +2 until the regroup phase (or add 1 threat if that companion is Boromir). lore: "" promotext: "" diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_016_Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_016_Tests.java index bda8a4185..fb149d8b1 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_016_Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_016_Tests.java @@ -5,8 +5,6 @@ import com.gempukku.lotro.common.*; import com.gempukku.lotro.game.CardNotFoundException; import com.gempukku.lotro.game.PhysicalCardImpl; import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; -import com.gempukku.lotro.logic.modifiers.FPCulturesSideSpotCountModifier; -import com.gempukku.lotro.logic.modifiers.FPCulturesSpotCountModifier; import org.junit.Test; import java.util.HashMap; diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_018_Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_018_Tests.java index d9f1093c2..957f41d51 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_018_Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vsets/set_v02/Card_V2_018_Tests.java @@ -19,6 +19,9 @@ public class Card_V2_018_Tests new HashMap<>() {{ put("card", "102_18"); + put("boromir", "1_97"); + put("faramir", "4_117"); + put("twk", "1_237"); // put other cards in here as needed for the test case }}, GenericCardTestHelper.FellowshipSites, @@ -46,9 +49,9 @@ public class Card_V2_018_Tests * At the start of the maneuver phase, you may add 2 threats to make a [gondor] companion defender +1 and strength +2 until the regroup phase (or add 1 threat if that companion is Boromir). */ - var scn = GetScenario(); + GenericCardTestHelper scn = GetScenario(); - var card = scn.GetFreepsCard("card"); + PhysicalCardImpl card = scn.GetFreepsCard("card"); assertEquals("Denethor", card.getBlueprint().getTitle()); assertEquals("Formidable Father", card.getBlueprint().getSubtitle()); @@ -64,18 +67,133 @@ public class Card_V2_018_Tests assertEquals(SitesBlock.KING, card.getBlueprint().getAllyHomeSiteBlock()); } - // Uncomment any @Test markers below once this is ready to be used - //@Test - public void DenethorTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void gondorCompanionsAreDiminishedWhenThreatsAreFull() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup - var scn = GetScenario(); + GenericCardTestHelper scn = GetScenario(); - var card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl boromir = scn.GetFreepsCard("boromir"); + PhysicalCardImpl faramir = scn.GetFreepsCard("faramir"); + + scn.FreepsMoveCardToHand(card, boromir, faramir); scn.StartGame(); scn.FreepsPlayCard(card); assertEquals(3, scn.GetTwilight()); + + scn.FreepsPlayCard(boromir); + scn.FreepsPlayCard(faramir); + + // Their starting strengths should be 7 with zero threats + assertEquals(0, scn.GetThreats()); + assertEquals(7, scn.GetStrength(boromir)); + assertEquals(7, scn.GetStrength(faramir)); + + + // Their starting strengths should be 7 with one threat + scn.AddThreats(1); + assertEquals(1, scn.GetThreats()); + assertEquals(7, scn.GetStrength(boromir)); + assertEquals(7, scn.GetStrength(faramir)); + + // Their starting strengths should be 7 with two threats + scn.AddThreats(1); + assertEquals(2, scn.GetThreats()); + assertEquals(7, scn.GetStrength(boromir)); + assertEquals(7, scn.GetStrength(faramir)); + + // Their starting strengths should be 5 with three threats + scn.AddThreats(1); + assertEquals(3, scn.GetThreats()); + assertEquals(5, scn.GetStrength(boromir)); + assertEquals(5, scn.GetStrength(faramir)); + } + + @Test + public void startOfManeuverTriggerCostTwoThreatsToBoostFaramir() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl boromir = scn.GetFreepsCard("boromir"); + PhysicalCardImpl faramir = scn.GetFreepsCard("faramir"); + PhysicalCardImpl twk = scn.GetShadowCard("twk"); + + scn.FreepsMoveCardToHand(card, boromir, faramir, twk); + + scn.StartGame(); + scn.FreepsPlayCard(card); + + assertEquals(3, scn.GetTwilight()); + + scn.FreepsPlayCard(boromir); + scn.FreepsPlayCard(faramir); + + // Their starting strengths should be 7 with zero threats + assertEquals(0, scn.GetThreats()); + assertEquals(7, scn.GetStrength(faramir)); + assertFalse(scn.HasKeyword(faramir, Keyword.DEFENDER)); + + scn.SkipToPhase(Phase.SHADOW); + scn.ShadowMoveCardToHand(twk); + + scn.ShadowPlayCard(twk); + + scn.SkipToPhase(Phase.MANEUVER); + + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); + scn.FreepsAcceptOptionalTrigger(); + + scn.FreepsChooseCard(faramir); + + assertEquals(2, scn.GetThreats()); + assertEquals(9, scn.GetStrength(faramir)); + assertTrue(scn.HasKeyword(faramir, Keyword.DEFENDER)); + assertEquals(1, scn.GetKeywordCount(faramir, Keyword.DEFENDER)); + } + + @Test + public void startOfManeuverTriggerCostOneThreatToBoostBoromir() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl boromir = scn.GetFreepsCard("boromir"); + PhysicalCardImpl faramir = scn.GetFreepsCard("faramir"); + PhysicalCardImpl twk = scn.GetShadowCard("twk"); + + scn.FreepsMoveCardToHand(card, boromir, faramir, twk); + + scn.StartGame(); + scn.FreepsPlayCard(card); + + assertEquals(3, scn.GetTwilight()); + + scn.FreepsPlayCard(boromir); + scn.FreepsPlayCard(faramir); + + // Their starting strengths should be 7 with zero threats + assertEquals(0, scn.GetThreats()); + assertEquals(7, scn.GetStrength(boromir)); + assertFalse(scn.HasKeyword(boromir, Keyword.DEFENDER)); + + scn.SkipToPhase(Phase.SHADOW); + scn.ShadowMoveCardToHand(twk); + + scn.ShadowPlayCard(twk); + + scn.SkipToPhase(Phase.MANEUVER); + + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); + scn.FreepsAcceptOptionalTrigger(); + + scn.FreepsChooseCard(boromir); + + assertEquals(1, scn.GetThreats()); + assertEquals(9, scn.GetStrength(boromir)); + assertTrue(scn.HasKeyword(boromir, Keyword.DEFENDER)); + assertEquals(1, scn.GetKeywordCount(boromir, Keyword.DEFENDER)); } }