From bf5204edfb411c9219331b83f7b78d8fb4fc2ec3 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Tue, 21 Sep 2021 14:56:15 -0500 Subject: [PATCH] Adding Dwarven Hospitality from VSet1 --- .../cards/set101/set101_dwarven_playtest.json | 27 +- .../lotro/cards/GenericCardTestHelper.java | 2 + .../pc/vset1/vpack1/Card_V1_001Tests.java | 261 ++++++++++++------ 3 files changed, 190 insertions(+), 100 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_dwarven_playtest.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_dwarven_playtest.json index c62440e17..082890cf0 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_dwarven_playtest.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_dwarven_playtest.json @@ -9,23 +9,30 @@ ], "effects": [ { - "type": "extraCost", - "cost": { - "type": "exert", - "filter": "choose(dwarf)" + "type": "modifier", + "modifier": { + "type": "modifyStrength", + "amount": 1, + "condition": { + "type": "location", + "filter": "siteBlock(fellowship),or(siteNumber(4),siteNumber(5),siteNumber(6),siteNumber(7),siteNumber(8))" + }, + "filter": "dwarf,hasAttachedCount(2,or(possession,artifact))" } }, { "type": "trigger", + "optional": true, "trigger": { - "type": "played", - "filter": "orc", - "memorize": "playedOrc" + "type": "moves", + }, + "condition": { + "type": "canSpot", + "filter": "dwarf,hasAttachedCount(2,or(possession,artifact))" }, "effect": { - "type": "discardTopCardsFromDeck", - "forced": true, - "deck": "ownerFromMemory(playedOrc)" + "type": "drawCards", + "count": 1 } } ] diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java index 35fc74061..d00444cd3 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTestHelper.java @@ -299,6 +299,8 @@ public class GenericCardTestHelper extends AbstractAtTest { public int GetTwilight() { return _game.getGameState().getTwilightPool(); } public void SetTwilight(int amount) { _game.getGameState().setTwilight(amount); } + public int GetMoveLimit() { return _game.getGameState().getMoveCount(); } + public PhysicalCardImpl GetRingBearer() { return (PhysicalCardImpl)_game.getGameState().getRingBearer(P1); } public PhysicalCardImpl GetCurrentSite() { return (PhysicalCardImpl)_game.getGameState().getCurrentSite(); } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_001Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_001Tests.java index 8b603c12a..3188125b9 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_001Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_001Tests.java @@ -6,11 +6,13 @@ import com.gempukku.lotro.common.Phase; 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.MoveLimitModifier; import org.junit.Test; import java.util.HashMap; import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class Card_V1_001Tests @@ -20,128 +22,207 @@ public class Card_V1_001Tests return new GenericCardTestHelper( new HashMap() {{ - put("aragorn", "1_89"); - put("boromir", "1_97"); - put("lords", "101_1"); - - put("runner1", "1_178"); - put("runner2", "1_178"); - }} + put("gimli", "1_13"); + put("farin", "1_11"); + put("hosp", "151_1"); + put("handaxe1", "2_10"); + put("handaxe2", "2_10"); + put("handaxe3", "2_10"); + }}, + GenericCardTestHelper.FellowshipSites, + GenericCardTestHelper.FOTRFrodo, + GenericCardTestHelper.FOTRRing ); } @Test - public void LordsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + public void HospitalityStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** * Set: VSet1, VPack1 - * Title: The Lords of Gondor Have Returned + * Title: Hospitality of the Dwarves * Side: Free Peoples - * Culture: Gondor - * Twilight Cost: 2 + * Culture: Dwarven + * Twilight Cost: 1 * Type: Condition * Subtype: Support Area - * Game Text: While Boromir is assigned to skirmish more than one minion, Aragorn is strength +3. - * While Aragorn is assigned to skirmish more than one minion, Boromir is strength +3. + * Game Text: At sites 4 through 8, each [dwarf] companion bearing more than 1 possession is strength +1. + * Each time the fellowship moves you may spot a [dwarf] companion bearing more than one possession to draw a card. */ //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl lords = scn.GetFreepsCard("lords"); + PhysicalCardImpl hosp = scn.GetFreepsCard("hosp"); - assertTrue(scn.HasKeyword(lords, Keyword.SUPPORT_AREA)); - assertEquals(2, lords.getBlueprint().getTwilightCost()); - assertTrue(lords.getBlueprint().isUnique()); + assertTrue(scn.HasKeyword(hosp, Keyword.SUPPORT_AREA)); + assertEquals(1, hosp.getBlueprint().getTwilightCost()); + assertTrue(hosp.getBlueprint().isUnique()); } -// @Test -// public void OneIsBuffedWhenOtherAssignedMultiple() throws DecisionResultInvalidException, CardNotFoundException { -// //Pre-game setup -// GenericCardTestHelper scn = GetScenario(); -// -// PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn"); -// PhysicalCardImpl boromir = scn.GetFreepsCard("boromir"); -// PhysicalCardImpl lords = scn.GetFreepsCard("lords"); -// -// scn.FreepsMoveCharToTable(aragorn); -// scn.FreepsMoveCharToTable(boromir); -// scn.FreepsMoveCardToHand(lords); -// -// PhysicalCardImpl runner1 = scn.GetShadowCard("runner1"); -// PhysicalCardImpl runner2 = scn.GetShadowCard("runner2"); -// -// scn.ShadowMoveCharToTable(runner1); -// scn.ShadowMoveCharToTable(runner2); -// -// scn.StartGame(); -// scn.FreepsPlayCard(lords); -// scn.SkipToPhase(Phase.ASSIGNMENT); -// -// assertEquals(7, scn.GetStrength(boromir)); -// assertEquals(8, scn.GetStrength(aragorn)); -// -// scn.FreepsSkipCurrentPhaseAction(); -// scn.ShadowSkipCurrentPhaseAction(); -// -// //Let shadow assign so we don't have to worry about defender bonuses -// scn.FreepsSkipCurrentPhaseAction(); -// scn.ShadowAssignToMinions(boromir, runner1, runner2); -// -// assertEquals(7, scn.GetStrength(boromir)); -// assertEquals(11, scn.GetStrength(aragorn)); -// -// scn.FreepsResolveSkirmish(boromir); -// -// scn.SkipToPhase(Phase.REGROUP); -// scn.SkipCurrentPhaseActions(); -// scn.ShadowSkipCurrentPhaseAction(); -// scn.FreepsChooseToMove(); -// -// scn.SkipToPhase(Phase.ASSIGNMENT); -// -// //Let shadow assign so we don't have to worry about defender bonuses -// scn.FreepsSkipCurrentPhaseAction(); -// scn.ShadowAssignToMinions(aragorn, runner1, runner2); -// -// assertEquals(10, scn.GetStrength(boromir)); -// assertEquals(8, scn.GetStrength(aragorn)); -// } - - @Test - public void NoBuffsWhenAssignedSingle() throws DecisionResultInvalidException, CardNotFoundException { + public void StrengthBuffWhenAt4To8AndBearing2PlusItems() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn"); - PhysicalCardImpl boromir = scn.GetFreepsCard("boromir"); - PhysicalCardImpl lords = scn.GetFreepsCard("lords"); + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + PhysicalCardImpl farin = scn.GetFreepsCard("farin"); + PhysicalCardImpl hosp = scn.GetFreepsCard("hosp"); - scn.FreepsMoveCharToTable(aragorn); - scn.FreepsMoveCharToTable(boromir); - scn.FreepsMoveCardToHand(lords); + PhysicalCardImpl handaxe1 = scn.GetFreepsCard("handaxe1"); + PhysicalCardImpl handaxe2 = scn.GetFreepsCard("handaxe2"); + PhysicalCardImpl handaxe3 = scn.GetFreepsCard("handaxe3"); - PhysicalCardImpl runner1 = scn.GetShadowCard("runner1"); - PhysicalCardImpl runner2 = scn.GetShadowCard("runner2"); - - scn.ShadowMoveCharToTable(runner1); - scn.ShadowMoveCharToTable(runner2); + scn.FreepsMoveCharToTable(gimli); + scn.FreepsMoveCharToTable(farin); + scn.FreepsMoveCardToHand(hosp); + scn.FreepsMoveCardToHand(handaxe1); + scn.FreepsMoveCardToHand(handaxe2); + scn.FreepsMoveCardToHand(handaxe3); scn.StartGame(); - scn.FreepsPlayCard(lords); - scn.SkipToPhase(Phase.ASSIGNMENT); + scn.FreepsPlayCard(hosp); - assertEquals(7, scn.GetStrength(boromir)); - assertEquals(8, scn.GetStrength(aragorn)); + // Putting two hand axes on Gimli and one on Farin + scn.FreepsPlayCard(handaxe1); + scn.FreepsChooseCard(gimli); + scn.FreepsPlayCard(handaxe2); + scn.FreepsChooseCard(gimli); + scn.FreepsPlayCard(handaxe3); + //last axe goes on Farin automatically + // 6 base strength + 1 axe + 1 axe + assertEquals(8, scn.GetStrength(gimli)); + // 5 base strength + 1 axe + assertEquals(6, scn.GetStrength(farin)); + + //Cheat our way to unlimited moves + scn.ApplyAdHocModifier(new MoveLimitModifier(null, 8)); + + // Move to site 2 + scn.SkipToPhase(Phase.REGROUP); + + // Move to site 3 scn.SkipCurrentPhaseActions(); + scn.FreepsChooseToMove(); + //THe other effect of Hospitality can be ignored + scn.FreepsAcceptOptionalTrigger(); - scn.FreepsAssignToMinions(new PhysicalCardImpl[]{ boromir, runner1 }, new PhysicalCardImpl[]{ aragorn, runner2 }); + assertEquals(8, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); - assertEquals(7, scn.GetStrength(boromir)); - assertEquals(8, scn.GetStrength(aragorn)); + + // Move to site 4 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + // 6 base strength + 1 axe + 1 axe + 1 Hospitality + assertEquals(9, scn.GetStrength(gimli)); + // 6 base strength + 1 axe + 1 axe + 0 Hospitality + assertEquals(6, scn.GetStrength(farin)); + + // Move to site 5 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); + + // Move to site 6 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); + + // Move to site 7 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); + + // Move to site 8 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); + + // Move to site 9 + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsChooseToMove(); + scn.FreepsAcceptOptionalTrigger(); + + //lose the hospitality + assertEquals(8, scn.GetStrength(gimli)); + assertEquals(6, scn.GetStrength(farin)); + } + + @Test + public void DrawsCardWhenBearing2PlusItems() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + PhysicalCardImpl hosp = scn.GetFreepsCard("hosp"); + + PhysicalCardImpl handaxe1 = scn.GetFreepsCard("handaxe1"); + PhysicalCardImpl handaxe2 = scn.GetFreepsCard("handaxe2"); + + scn.FreepsMoveCharToTable(gimli); + scn.FreepsMoveCardToHand(hosp); + scn.FreepsMoveCardToHand(handaxe1); + scn.FreepsMoveCardToHand(handaxe2); + + scn.StartGame(); + scn.FreepsPlayCard(hosp); + + // Putting two hand axes on Gimli + scn.FreepsPlayCard(handaxe1); + scn.FreepsPlayCard(handaxe2); + + //one farin, one axe in the deck + assertEquals(2, scn.GetFreepsDeckCount()); + assertEquals(0, scn.GetFreepsHandCount()); + + scn.FreepsSkipCurrentPhaseAction(); + scn.FreepsAcceptOptionalTrigger(); + + assertEquals(1, scn.GetFreepsDeckCount()); + assertEquals(1, scn.GetFreepsHandCount()); + + scn.SkipToPhase(Phase.REGROUP); + + scn.FreepsMoveCardToDiscard(handaxe1); + assertEquals(1, scn.GetAttachedCards(gimli).size()); + + // Move to site 3 + scn.SkipCurrentPhaseActions(); + scn.FreepsChooseToMove(); + + //Should not have drawn a card with only 1 possession on gimli + assertEquals(1, scn.GetFreepsDeckCount()); + assertEquals(1, scn.GetFreepsHandCount()); + assertFalse(scn.FreepsAnyDecisionsAvailable()); } }