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 62a93f565..e06e986dd 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 @@ -1,6 +1,6 @@ { "151_1": { - "title": "*Hospitality of the Dwarves", + "title": "Hospitality of the Dwarves", "culture": "dwarven", "cost": 1, "type": "condition", @@ -9,32 +9,65 @@ ], "effects": [ { - "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,item)" - } - }, - { - "type": "trigger", - "optional": true, - "trigger": { - "type": "moves" - }, + "type": "activated", + "phase": "maneuver", "condition": { - "type": "canSpot", - "filter": "dwarf,hasAttachedCount(2,item)" + "type": "location", + "filter": "or(siteNumber(4),siteNumber(5),siteNumber(6),siteNumber(7),siteNumber(8))" }, - "effect": { - "type": "drawCards", - "count": 1 - } - } + "effect": [ + { + "type": "addmodifier", + "modifier": { + "type": "removeKeyword", + "filter": "dwarf", + "keyword": "damage" + }, + "until": "start(regroup)" + }, + { + "type": "addmodifier", + "modifier": { + "type": "cantTakeMoreWoundsThan", + "amount": 1, + "filter": "dwarf,hasAttachedCount(2,item)", + "phase": "maneuver" + }, + "until": "start(archery)" + }, + { + "type": "addmodifier", + "modifier": { + "type": "cantTakeMoreWoundsThan", + "amount": 1, + "filter": "dwarf,hasAttachedCount(2,item)", + "phase": "archery" + }, + "until": "start(assignment)" + }, + { + "type": "addmodifier", + "modifier": { + "type": "cantTakeMoreWoundsThan", + "amount": 1, + "filter": "dwarf,hasAttachedCount(2,item)", + "phase": "assignment" + }, + "until": "start(regroup)" + }, + { + "type": "addmodifier", + "modifier": { + "type": "cantTakeMoreWoundsThan", + "amount": 1, + "filter": "dwarf,hasAttachedCount(2,item)", + "phase": "skirmish" + }, + "until": "start(regroup)" + }, + ] + }, + ] }, @@ -74,7 +107,7 @@ }, "effect": { "type": "putStackedCardsIntoHand", - "filter": "choose(side(free people))", + "filter": "choose(any)", "on": "self" } } @@ -138,9 +171,16 @@ "effect": [ { "type": "modifyStrength", - "filter": "choose(name(Gimli))", + "filter": "choose(dwarf)", "until": "start(regroup)", - "amount": 2 + "memorize": "chosenDwarf", + "amount": 3 + }, + { + "type": "addKeyword", + "filter": "memory(chosenDwarf)", + "keyword": "damage+1", + "until": "start(regroup)" } ] } @@ -160,10 +200,38 @@ "type": "event", "effect": [ { - "type": "addKeyword", + "type": "heal", "filter": "choose(dwarf,hasAttachedCount(2,item))", - "keyword": "defender+1", - "until": "start(regroup)" + "times": 1, + "memorize": "healedDwarf" + }, + { + "type": "memorizenumber", + "memory": "originalItemCount", + "amount": { + "type": "forEachYouCanSpot", + "filter": "item,attachedTo(memory(healedDwarf))" + } + }, + { + "type": "returntohand", + "filter": "choose(item,attachedTo(memory(healedDwarf)))", + "count": "0-50" + }, + { + "type": "wound", + "filter": "choose(minion)", + "count": { + "type": "subtract", + "firstNumber": { + "type": "fromMemory", + "memory": "originalItemCount" + }, + "secondNumber": { + "type": "forEachYouCanSpot", + "filter": "item,attachedTo(memory(healedDwarf))" + } + } } ] } @@ -189,9 +257,10 @@ "times": 1 }, "effect": { - "type": "heal", - "filter": "choose(name(Gimli))", - "times": 1 + "type": "addKeyword", + "filter": "choose(dwarf)", + "keyword": "defender+1", + "until": "start(regroup)" } } }, 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 99249fa0a..79c5ed68f 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 @@ -111,6 +111,15 @@ public class GenericCardTestHelper extends AbstractAtTest { public PhysicalCardImpl GetFreepsCard(String cardName) { return Cards.get(P1).get(cardName); } public PhysicalCardImpl GetShadowCard(String cardName) { return Cards.get(P2).get(cardName); } + public PhysicalCardImpl GetFreepsCardByID(String id) { return GetCardByID(P1, Integer.parseInt(id)); } + public PhysicalCardImpl GetFreepsCardByID(int id) { return GetCardByID(P1, id); } + public PhysicalCardImpl GetShadowCardByID(String id) { return GetCardByID(P2, Integer.parseInt(id)); } + public PhysicalCardImpl GetShadowCardByID(int id) { return GetCardByID(P2, id); } + public PhysicalCardImpl GetCardByID(String player, int id) { + return Cards.get(player).values().stream() + .filter(x -> x.getCardId() == id) + .findFirst().orElse(null); + } public PhysicalCardImpl GetFreepsSite(int siteNum) { return GetSite(P1, siteNum); } public PhysicalCardImpl GetShadowSite(int siteNum) { return GetSite(P2, siteNum); } @@ -265,7 +274,12 @@ public class GenericCardTestHelper extends AbstractAtTest { } } - + public void FreepsAttachCardsTo(PhysicalCardImpl bearer, String...names) { + Arrays.stream(names).forEach(name -> AttachCardsTo(bearer, GetFreepsCard(name))); + } + public void ShadowAttachCardsTo(PhysicalCardImpl bearer, String...names) { + Arrays.stream(names).forEach(name -> AttachCardsTo(bearer, GetShadowCard(name))); + } public void AttachCardsTo(PhysicalCardImpl bearer, PhysicalCardImpl...cards) { Arrays.stream(cards).forEach(card -> _game.getGameState().attachCard(_game, card, bearer)); } @@ -287,15 +301,20 @@ public class GenericCardTestHelper extends AbstractAtTest { Arrays.stream(cards).forEach(card -> MoveCardToZone(P1, card, Zone.DECK)); } - public void FreepsMoveCharToTable(String cardName) { FreepsMoveCharToTable(GetFreepsCard(cardName)); } + public void FreepsMoveCharToTable(String...names) { + Arrays.stream(names).forEach(name -> FreepsMoveCharToTable(GetFreepsCard(name))); + } public void FreepsMoveCharToTable(PhysicalCardImpl...cards) { Arrays.stream(cards).forEach(card -> MoveCardToZone(P1, card, Zone.FREE_CHARACTERS)); } - public void ShadowMoveCharToTable(String cardName) { FreepsMoveCharToTable(GetShadowCard(cardName)); } + public void ShadowMoveCharToTable(String...names) { + Arrays.stream(names).forEach(name -> ShadowMoveCharToTable(GetShadowCard(name))); + } public void ShadowMoveCharToTable(PhysicalCardImpl...cards) { Arrays.stream(cards).forEach(card -> MoveCardToZone(P2, card, Zone.SHADOW_CHARACTERS)); } + public void FreepsMoveCardToSupportArea(String cardName) { FreepsMoveCardToSupportArea(GetFreepsCard(cardName)); } public void FreepsMoveCardToSupportArea(PhysicalCardImpl...cards) { Arrays.stream(cards).forEach(card -> MoveCardToZone(P1, card, Zone.SUPPORT)); 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 907d22231..66ea2de02 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 @@ -1,11 +1,12 @@ package com.gempukku.lotro.cards.unofficial.pc.vset1.vpack1; import com.gempukku.lotro.cards.GenericCardTestHelper; -import com.gempukku.lotro.common.Keyword; -import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filters; 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.KeywordModifier; import com.gempukku.lotro.logic.modifiers.MoveLimitModifier; import org.junit.Test; @@ -28,6 +29,8 @@ public class Card_V1_001Tests put("handaxe1", "2_10"); put("handaxe2", "2_10"); put("handaxe3", "2_10"); + + put("troop", "1_143"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -47,8 +50,9 @@ public class Card_V1_001Tests * Twilight Cost: 1 * Type: Condition * Subtype: Support Area - * 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. + * Game Text: Maneuver: If the fellowship is at any sites 4 through 8, make each Dwarf lose all damage bonuses + * until the regroup phase, and each Dwarf bearing 2 or more items takes no more than 1 wound per phase until the + * regroup phase. */ //Pre-game setup @@ -56,129 +60,15 @@ public class Card_V1_001Tests PhysicalCardImpl hosp = scn.GetFreepsCard("hosp"); - assertTrue(scn.HasKeyword(hosp, Keyword.SUPPORT_AREA)); + assertFalse(hosp.getBlueprint().isUnique()); assertEquals(1, hosp.getBlueprint().getTwilightCost()); - assertTrue(hosp.getBlueprint().isUnique()); + assertEquals(CardType.CONDITION, hosp.getBlueprint().getCardType()); + assertEquals(Culture.DWARVEN, hosp.getBlueprint().getCulture()); + assertTrue(scn.HasKeyword(hosp, Keyword.SUPPORT_AREA)); } @Test - public void StrengthBuffWhenAt4To8AndBearing2PlusItems() throws DecisionResultInvalidException, CardNotFoundException { - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); - - PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); - PhysicalCardImpl farin = scn.GetFreepsCard("farin"); - PhysicalCardImpl hosp = scn.GetFreepsCard("hosp"); - - PhysicalCardImpl handaxe1 = scn.GetFreepsCard("handaxe1"); - PhysicalCardImpl handaxe2 = scn.GetFreepsCard("handaxe2"); - PhysicalCardImpl handaxe3 = scn.GetFreepsCard("handaxe3"); - - scn.FreepsMoveCharToTable(gimli); - scn.FreepsMoveCharToTable(farin); - scn.FreepsMoveCardToHand(hosp); - scn.FreepsMoveCardToHand(handaxe1); - scn.FreepsMoveCardToHand(handaxe2); - scn.FreepsMoveCardToHand(handaxe3); - - scn.StartGame(); - scn.FreepsPlayCard(hosp); - - // 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(); - - assertEquals(8, scn.GetStrength(gimli)); - assertEquals(6, scn.GetStrength(farin)); - - - // 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 { + public void AbilityOnlyActivatesAtSites4To8() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); @@ -189,40 +79,118 @@ public class Card_V1_001Tests PhysicalCardImpl handaxe2 = scn.GetFreepsCard("handaxe2"); scn.FreepsMoveCharToTable(gimli); - scn.FreepsMoveCardToHand(hosp); + scn.FreepsMoveCardToSupportArea(hosp); scn.FreepsMoveCardToHand(handaxe1); scn.FreepsMoveCardToHand(handaxe2); + PhysicalCardImpl troop = scn.GetShadowCard("troop"); + scn.ShadowMoveCharToTable(troop); + + //Max out the move limit so we don't have to juggle play back and forth + scn.ApplyAdHocModifier(new MoveLimitModifier(null, 10)); + 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()); + //Site 2 + scn.SkipToPhase(Phase.MANEUVER); + assertFalse(scn.FreepsCardActionAvailable(hosp)); - 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.SkipToPhase(Phase.ASSIGNMENT); scn.SkipCurrentPhaseActions(); + scn.SkipCurrentPhaseActions(); // skips the assignment on both sides + + scn.SkipCurrentPhaseActions(); //in regroup 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()); + //Site 3 + scn.SkipToPhase(Phase.MANEUVER); + assertFalse(scn.FreepsCardActionAvailable(hosp)); + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.SkipCurrentPhaseActions(); // skips the assignment on both sides + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 4 + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsCardActionAvailable(hosp)); + scn.FreepsUseCardAction(hosp); + assertFalse(scn.HasKeyword(gimli, Keyword.DAMAGE)); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(gimli, troop); + scn.FreepsResolveSkirmish(gimli); + scn.SkipCurrentPhaseActions(); // passes skirmish actions + + assertEquals(1, scn.GetWoundsOn(gimli)); + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 5 + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsCardActionAvailable(hosp)); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(gimli, troop); + scn.FreepsResolveSkirmish(gimli); + scn.SkipCurrentPhaseActions(); // passes skirmish actions + + //Without the wound protection, gimli dies with 2 wounds this round + assertEquals(Zone.DEAD, gimli.getZone()); + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 6 + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsCardActionAvailable(hosp)); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.SkipCurrentPhaseActions(); // skips the assignment on both sides + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 7 + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsCardActionAvailable(hosp)); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.SkipCurrentPhaseActions(); // skips the assignment on both sides + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 8 + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsCardActionAvailable(hosp)); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.SkipCurrentPhaseActions(); // skips the assignment on both sides + + scn.SkipCurrentPhaseActions(); //in regroup + scn.ShadowSkipCurrentPhaseAction(); //reconcile + scn.FreepsChooseToMove(); + + //Site 5 + scn.SkipToPhase(Phase.MANEUVER); + assertFalse(scn.FreepsCardActionAvailable(hosp)); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_002Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_002Tests.java index 8bab830ac..065ed40e9 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_002Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_002Tests.java @@ -24,7 +24,8 @@ public class Card_V1_002Tests put("axe", "1_9"); put("axe2", "1_9"); put("deep", "151_2"); - put("beneath", "2_1"); + put("emhr", "4_46"); + put("strike", "1_3"); put("runner", "1_178"); put("plunder", "1_193"); @@ -64,18 +65,22 @@ public class Card_V1_002Tests //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl beneath = scn.GetFreepsCard("beneath"); + PhysicalCardImpl emhr = scn.GetFreepsCard("emhr"); PhysicalCardImpl deep = scn.GetFreepsCard("deep"); PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); PhysicalCardImpl axe = scn.GetFreepsCard("axe2"); - scn.FreepsMoveCardToSupportArea(beneath); + PhysicalCardImpl strike = scn.GetFreepsCard("strike"); + scn.FreepsMoveCardToSupportArea(emhr); scn.FreepsMoveCardToSupportArea(deep); scn.FreepsMoveCharToTable(gimli); scn.FreepsMoveCardToDiscard("axe"); + scn.FreepsMoveCardToDiscard("runner"); + scn.FreepsMoveCardToDiscard("plunder"); + scn.FreepsMoveCardToDeck(strike); scn.StartGame(); - scn.FreepsUseCardAction(beneath); + scn.FreepsUseCardAction("Discard 1"); assertTrue(scn.FreepsHasOptionalTriggerAvailable()); scn.FreepsAcceptOptionalTrigger(); @@ -89,23 +94,26 @@ public class Card_V1_002Tests //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl beneath = scn.GetFreepsCard("beneath"); + PhysicalCardImpl emhr = scn.GetFreepsCard("emhr"); PhysicalCardImpl deep = scn.GetFreepsCard("deep"); PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); - PhysicalCardImpl axe = scn.GetFreepsCard("axe"); - PhysicalCardImpl axe2 = scn.GetFreepsCard("axe2"); - - scn.FreepsMoveCardToSupportArea(beneath); - scn.FreepsMoveCardToSupportArea(deep); + PhysicalCardImpl strike = scn.GetFreepsCard("strike"); + scn.FreepsMoveCardToSupportArea(emhr); + scn.FreepsMoveCardToHand(deep); scn.FreepsMoveCharToTable(gimli); scn.FreepsMoveCardToDiscard("axe"); - + scn.FreepsMoveCardToDiscard("runner"); + scn.FreepsMoveCardToDiscard("plunder"); + scn.FreepsMoveCardToDeck(strike); scn.ShadowMoveCharToTable("runner"); scn.StartGame(); - scn.FreepsUseCardAction(beneath); + scn.FreepsPlayCard(deep); + + scn.FreepsUseCardAction("Discard 1"); + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); scn.FreepsAcceptOptionalTrigger(); scn.SkipToPhase(Phase.MANEUVER); diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_004Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_004Tests.java index 4cf9227d9..47978ab52 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_004Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_004Tests.java @@ -55,12 +55,13 @@ public class Card_V1_004Tests assertFalse(friend.getBlueprint().isUnique()); assertEquals(1, friend.getBlueprint().getTwilightCost()); assertEquals(CardType.EVENT, friend.getBlueprint().getCardType()); + assertTrue(scn.HasKeyword(friend, Keyword.MANEUVER)); assertEquals(Culture.DWARVEN, friend.getBlueprint().getCulture()); assertEquals(Side.FREE_PEOPLE, friend.getBlueprint().getSide()); } @Test - public void ElfriendExertsElfToPumpGimli() throws DecisionResultInvalidException, CardNotFoundException { + public void ElfriendExertsElfToPumpADwarf() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); @@ -80,12 +81,15 @@ public class Card_V1_004Tests assertEquals(6, scn.GetStrength(gimli)); scn.FreepsPlayCard(friend); assertEquals(1, scn.GetWoundsOn(legolas)); - assertEquals(8, scn.GetStrength(gimli)); + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(2, scn.GetKeywordCount(gimli, Keyword.DAMAGE)); scn.SkipToPhase(Phase.ARCHERY); - assertEquals(8, scn.GetStrength(gimli)); + assertEquals(9, scn.GetStrength(gimli)); + assertEquals(2, scn.GetKeywordCount(gimli, Keyword.DAMAGE)); scn.SkipToPhase(Phase.REGROUP); assertEquals(6, scn.GetStrength(gimli)); + assertEquals(1, scn.GetKeywordCount(gimli, Keyword.DAMAGE)); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_005Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_005Tests.java index 0804b6523..68253873d 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_005Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_005Tests.java @@ -10,6 +10,7 @@ import com.gempukku.lotro.logic.modifiers.MoveLimitModifier; import org.junit.Test; import java.util.HashMap; +import java.util.List; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; @@ -27,11 +28,17 @@ public class Card_V1_005Tests put("guard", "1_7"); put("handaxe1", "2_10"); put("handaxe2", "2_10"); + put("armor", "1_8"); + put("bracers", "2_3"); + put("ring", "9_6"); + put("runner", "1_178"); - }}, - GenericCardTestHelper.FellowshipSites, - GenericCardTestHelper.FOTRFrodo, - GenericCardTestHelper.FOTRRing + put("runner2", "1_178"); + put("runner3", "1_178"); + put("runner4", "1_178"); + put("runner5", "1_178"); + put("runner6", "1_178"); + }} ); } @@ -54,15 +61,15 @@ public class Card_V1_005Tests PhysicalCardImpl onedwarf = scn.GetFreepsCard("onedwarf"); - assertFalse(onedwarf.getBlueprint().isUnique()); assertEquals(1, onedwarf.getBlueprint().getTwilightCost()); assertEquals(CardType.EVENT, onedwarf.getBlueprint().getCardType()); + assertTrue(scn.HasKeyword(onedwarf, Keyword.MANEUVER)); assertEquals(Culture.DWARVEN, onedwarf.getBlueprint().getCulture()); assertEquals(Side.FREE_PEOPLE, onedwarf.getBlueprint().getSide()); } @Test - public void OneDwarfAppliesDefender() throws DecisionResultInvalidException, CardNotFoundException { + public void OneDwarfHeals() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); @@ -76,16 +83,57 @@ public class Card_V1_005Tests scn.ShadowMoveCharToTable("runner"); scn.StartGame(); + scn.AddWoundsToChar(gimli, 2); scn.SkipToPhase(Phase.MANEUVER); assertTrue(scn.FreepsActionAvailable("One Dwarf")); - assertEquals(0, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); + assertEquals(2, scn.GetWoundsOn(gimli)); scn.FreepsPlayCard(onedwarf); - assertEquals(1, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); + assertEquals(1, scn.GetWoundsOn(gimli)); } @Test - public void OneDwarfCantBePlayedIfNoDwarvesWithItems() throws DecisionResultInvalidException, CardNotFoundException { + public void OneDwarfDiscardsVariableNumberOfItemsToWoundMinions() 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.AddWoundsToChar(gimli, 2); + scn.SkipToPhase(Phase.MANEUVER); + assertTrue(scn.FreepsActionAvailable("One Dwarf")); + + assertEquals(2, scn.GetWoundsOn(gimli)); + scn.FreepsPlayCard(onedwarf); + assertEquals(1, scn.GetWoundsOn(gimli)); + 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 GenericCardTestHelper scn = GetScenario(); diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_006Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_006Tests.java index c845fe661..5dab39d32 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_006Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_006Tests.java @@ -60,7 +60,7 @@ public class Card_V1_006Tests } @Test - public void SoBoldOffersHealEachMove() throws DecisionResultInvalidException, CardNotFoundException { + public void SoBoldOffersDefenderEachMove() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); @@ -72,24 +72,24 @@ public class Card_V1_006Tests scn.StartGame(); scn.FreepsPlayCard(bold); - scn.AddWoundsToChar(gimli, 2); scn.SkipCurrentPhaseActions(); assertTrue(scn.FreepsHasOptionalTriggerAvailable()); assertEquals(0, scn.GetWoundsOn(legolas)); - assertEquals(2, scn.GetWoundsOn(gimli)); + assertEquals(0, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); scn.FreepsAcceptOptionalTrigger(); assertEquals(1, scn.GetWoundsOn(legolas)); - assertEquals(1, scn.GetWoundsOn(gimli)); + assertEquals(1, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); scn.SkipToPhase(Phase.REGROUP); scn.SkipCurrentPhaseActions(); + assertEquals(0, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); scn.FreepsChooseToMove(); assertTrue(scn.FreepsHasOptionalTriggerAvailable()); scn.FreepsAcceptOptionalTrigger(); assertEquals(2, scn.GetWoundsOn(legolas)); - assertEquals(0, scn.GetWoundsOn(gimli)); + assertEquals(1, scn.GetKeywordCount(gimli, Keyword.DEFENDER)); } }