diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_elven_playtest.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_elven_playtest.json index fe8f934c3..1df5a6a57 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_elven_playtest.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set101/set101_elven_playtest.json @@ -9,17 +9,13 @@ "effects": { "type": "event", "cost": { - "type": "exert", - "filter": "choose(elf)", + "type": "chooseAndAddTwilight", + "memorize": "allyCost" }, - "effect": [ - { - "type": "modifyStrength", - "filter": "choose(name(Gimli))", - "until": "start(regroup)", - "amount": 2 - } - ] + "effect": { + "type": "putcardsfromdeckintohand", + "filter": "choose(culture(elven),ally,maxTwilight(memory(allyCost)))", + } } }, @@ -29,19 +25,23 @@ "culture": "elven", "cost": 1, "type": "event", - "keyword": ["skirmish"], + "keyword": ["skirmish", "tale"], + "condition": { + "type": "canSpot", + "filter": "elf,inskirmish" + }, "effects": { "type": "event", + "cost": { - "type": "exert", - "filter": "choose(elf)", + "type": "discard", + "filter": "choose(your,culture(elven),tale)", }, "effect": [ { - "type": "modifyStrength", - "filter": "choose(name(Gimli))", - "until": "start(regroup)", - "amount": 2 + "type": "wound", + "filter": "choose(minion,inSkirmishAgainst(elf))", + "count": 1 } ] } @@ -86,33 +86,49 @@ "151_10": { - "title": "*Let Fly the\Darts of Lindon", + "title": "*Let Fly the Darts of Lindon", "culture": "elven", "cost": 1, "type": "condition", - "keyword": ["support area"], - "effects": [ - { - "type": "modifier", - "modifier": { - "type": "addKeyword", - "filter": "dwarf", - "keyword": "damage+1" - } - }, - { - "type": "trigger", - "optional": true, - "trigger": { - "type": "winsSkirmish", - "filter": "dwarf" + "keyword": ["tale"], + "target": "elf,companion", + "effects": { + "type": "activated", + "phase": "archery", + "cost": [ + { + "type": "exert", + "filter": "bearer", + "count": 1 }, + { + "type": "spot", + "filter": "choose(minion)", + "memorize": "untarget" + }, + ], + "effect": { + "type": "preventable", "effect": { - "type": "wound", - "filter": "choose(orc)" - } + "type": "addModifier", + "modifier": { + "type": "cantTakeWounds", + "filter": "memory(untarget)", + "condition": { + "type": "phase", + "phase": "archery" + } + }, + "until": "start(regroup)" + }, + "text": "Would you like to remove (2) to prevent a minion taking no archery wounds?", + "player": "shadowPlayer", + "cost": { + "type": "removeTwilight", + "amount": 2 + }, } - ] + } }, @@ -121,29 +137,43 @@ "culture": "elven", "cost": 2, "type": "artifact", - "target": "name(Gimli)", "keyword": ["support area"], + "condition": { + "type": "or", + "condition": [ + { + "type": "canSpot", + "filter": "name(Elrond)" + }, + { + "type": "canSpot", + "filter": "elf", + "count": 3 + } + ] + }, "effects": [ { "type": "modifier", "modifier": { - "type": "addKeyword", - "filter": "dwarf", - "keyword": "damage+1" + "type": "modifyStrength", + "filter": "companion,hasAttached(culture(elven),tale)", + "amount": 1 } }, { - "type": "trigger", - "optional": true, - "trigger": { - "type": "winsSkirmish", - "filter": "dwarf" - }, - "effect": { - "type": "wound", - "filter": "choose(orc)" - } - } + "type": "activated", + "phase": "skirmish", + "cost": { + "type": "discard", + "filter": "choose(culture(elven),tale)" + }, + "effect": { + "type": "modifyStrength", + "filter": "choose(culture(elven),companion)", + "amount": 1 + } + } ] }, @@ -153,28 +183,48 @@ "culture": "elven", "cost": 1, "type": "condition", - "keyword": ["support area"], + "keyword": ["support area", "tale"], "effects": [ { - "type": "modifier", - "modifier": { - "type": "addKeyword", - "filter": "dwarf", - "keyword": "damage+1" - } - }, + "type": "trigger", + "optional": true, + "text": "Would you like to spot 1 [elven] or [gandalf] ring to place a card from hand beneath your draw deck and draw a card?", + "trigger": { + "type": "moves" + }, + "condition": { + "type": "canSpot", + "filter": "or(culture(elven),culture(gandalf)),ring", + "count": 1 + }, + "effect": [ + { + "type": "putCardsFromHandOnBottomOfDeck", + "filter": "choose(any)" + }, + { + "type": "drawCards", + "count": 1 + } + ] + }, { - "type": "trigger", - "optional": true, - "trigger": { - "type": "winsSkirmish", - "filter": "dwarf" - }, - "effect": { - "type": "wound", - "filter": "choose(orc)" - } - } + "type": "trigger", + "optional": true, + "text": "Would you like to spot 3 [elven] or [gandalf] rings to heal a companion?", + "trigger": { + "type": "moves" + }, + "condition": { + "type": "canSpot", + "filter": "or(culture(elven),culture(gandalf)),ring", + "count": 3 + }, + "effect": { + "type": "heal", + "filter": "choose(companion)" + }, + } ] }, 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 2fe3a0b10..94eb9c3f2 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 @@ -216,6 +216,18 @@ public class GenericCardTestHelper extends AbstractAtTest { return _game.getGameState().getDeck(player).size(); } + public PhysicalCardImpl GetFreepsBottomOfDeck() { return GetPlayerBottomOfDeck(P1); } + public PhysicalCardImpl GetShadowBottomOfDeck() { return GetPlayerBottomOfDeck(P2); } + public PhysicalCardImpl GetPlayerBottomOfDeck(String player) + { + List deck = _game.getGameState().getDeck(player); + return (PhysicalCardImpl) deck.get(deck.size() - 1); + } + + public PhysicalCardImpl GetFreepsTopOfDeck() { return GetPlayerTopOfDeck(P1); } + public PhysicalCardImpl GetShadowTopOfDeck() { return GetPlayerTopOfDeck(P2); } + public PhysicalCardImpl GetPlayerTopOfDeck(String player) { return (PhysicalCardImpl) _game.getGameState().getDeck(player).get(0); } + public int GetFreepsDiscardCount() { return GetPlayerDiscardCount(P1); } public int GetShadowDiscardCount() { return GetPlayerDiscardCount(P2); } public int GetPlayerDiscardCount(String player) @@ -404,8 +416,37 @@ public class GenericCardTestHelper extends AbstractAtTest { public boolean FreepsCanChooseCharacter(PhysicalCardImpl card) { return FreepsGetCardChoices().contains(String.valueOf(card.getCardId())); } public boolean ShadowCanChooseCharacter(PhysicalCardImpl card) { return ShadowGetCardChoices().contains(String.valueOf(card.getCardId())); } - public int FreepsCardChoiceCount() { return FreepsGetCardChoices().size(); } - public int ShadowCardChoiceCount() { return ShadowGetCardChoices().size(); } + public int GetFreepsCardChoiceCount() { return FreepsGetCardChoices().size(); } + public int GetShadowCardChoiceCount() { return ShadowGetCardChoices().size(); } + + public void FreepsChooseCardBPFromSelection(PhysicalCardImpl card) throws DecisionResultInvalidException { ChooseCardBPFromSelection(P1, card);} + public void ShadowChooseCardBPFromSelection(PhysicalCardImpl card) throws DecisionResultInvalidException { ChooseCardBPFromSelection(P2, card);} + + public void ChooseCardBPFromSelection(String player, PhysicalCardImpl card) throws DecisionResultInvalidException { + AwaitingDecision decision = _userFeedback.getAwaitingDecision(player); + + String[] ids = GetAwaitingDecisionParam(player,"blueprintId"); + for(int i = 0; i < ids.length; i++) + { + String id = ids[i]; + if(id == card.getBlueprintId()) + { + // I have no idea why the spacing is required, but the BP parser skips to the fourth position + playerDecided(player, " " + i); + return; + } + } + + playerDecided(player, card.getBlueprintId()); + } + + public void FreepsChooseCardIDFromSelection(PhysicalCardImpl card) throws DecisionResultInvalidException { ChooseCardIDFromSelection(P1, card);} + public void ShadowChooseCardIDFromSelection(PhysicalCardImpl card) throws DecisionResultInvalidException { ChooseCardIDFromSelection(P2, card);} + + public void ChooseCardIDFromSelection(String player, PhysicalCardImpl card) throws DecisionResultInvalidException { + AwaitingDecision decision = _userFeedback.getAwaitingDecision(player); + playerDecided(player, "" + card.getCardId()); + } public boolean IsCharAssigned(PhysicalCardImpl card) { List assigns = _game.getGameState().getAssignments(); @@ -464,6 +505,10 @@ public class GenericCardTestHelper extends AbstractAtTest { public void ShadowAcceptOptionalTrigger() throws DecisionResultInvalidException { playerDecided(P2, "0"); } public void ShadowDeclineOptionalTrigger() throws DecisionResultInvalidException { playerDecided(P2, ""); } + public void FreepsChooseYes() throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P1, "Yes"); } + public void ShadowChooseYes() throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P2, "Yes"); } + public void FreepsChooseNo() throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P1, "No"); } + public void ShadowChooseNo() throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P2, "No"); } public void FreepsChooseMultipleChoiceOption(String option) throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P1, option); } public void ShadowChooseMultipleChoiceOption(String option) throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P2, option); } public void ChooseMultipleChoiceOption(String playerID, String option) throws DecisionResultInvalidException { ChooseAction(playerID, "results", option); } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_007Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_007Tests.java index 4b46c652b..06dc837be 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_007Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_007Tests.java @@ -6,7 +6,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.MoveLimitModifier; import org.junit.Test; import java.util.HashMap; @@ -22,8 +21,10 @@ public class Card_V1_007Tests return new GenericCardTestHelper( new HashMap() {{ - put("card", "151_7"); - // put other cards in here as needed for the test case + put("counsel", "151_7"); + put("elrond", "1_40"); + put("galadriel", "1_45"); + put("orophin", "1_56"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -31,51 +32,57 @@ public class Card_V1_007Tests ); } - // Uncomment both @Test markers below once this is ready to be used - - //@Test - public void TheCounseloftheWiseStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void CounselStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** * Set: V1 - * Title: The Counsel of the Wise + * Title: Counsel of the Wise * Side: Free Peoples * Culture: elven * Twilight Cost: 0 * Type: event * Subtype: Fellowship - * Game Text: Add x to take an [elven] ally with a twilight cost of x into hand from your draw deck. + * Game Text: Add (X) to take an [elven] ally with a twilight cost of X or less into hand from your draw deck. */ //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl counsel = scn.GetFreepsCard("counsel"); - assertFalse(card.getBlueprint().isUnique()); - assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed - assertEquals(0, card.getBlueprint().getTwilightCost()); - //assertEquals(, card.getBlueprint().getStrength()); - //assertEquals(, card.getBlueprint().getVitality()); - //assertEquals(, card.getBlueprint().getResistance()); - //assertEquals(Signet., card.getBlueprint().getSignet()); - //assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies - assertEquals(CardType.EVENT, card.getBlueprint().getCardType()); - assertEquals(Culture.ELVEN, card.getBlueprint().getCulture()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertFalse(counsel.getBlueprint().isUnique()); + //assertTrue(scn.HasKeyword(counsel, Keyword.TALE)); + assertEquals(0, counsel.getBlueprint().getTwilightCost()); + assertEquals(CardType.EVENT, counsel.getBlueprint().getCardType()); + assertEquals(Culture.ELVEN, counsel.getBlueprint().getCulture()); + assertEquals(Side.FREE_PEOPLE, counsel.getBlueprint().getSide()); } - //@Test - public void TheCounseloftheWiseTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void CounseloftheWiseChoosing4PermitsTakingElrondIntoHand() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl counsel = scn.GetFreepsCard("counsel"); + scn.FreepsMoveCardToHand(counsel); scn.StartGame(); - scn.FreepsPlayCard(card); + assertEquals(1, scn.GetFreepsHandCount()); + assertEquals(3, scn.GetFreepsDeckCount()); assertEquals(0, scn.GetTwilight()); + + scn.FreepsPlayCard(counsel); + scn.FreepsChoose("4"); + assertTrue(scn.FreepsDecisionAvailable("Choose card from deck")); + // Choices available should be 1 Elrond, 1 Galadriel, 1 Orophin + assertEquals(3, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCardBPFromSelection(scn.GetFreepsCard("elrond")); + + assertEquals(1, scn.GetFreepsHandCount()); + assertEquals(2, scn.GetFreepsDeckCount()); + assertEquals(1, scn.GetFreepsDiscardCount()); + assertEquals(4, scn.GetTwilight()); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_008Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_008Tests.java index 4aee3c0ce..91f912209 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_008Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_008Tests.java @@ -17,13 +17,17 @@ import static org.junit.Assert.assertTrue; public class Card_V1_008Tests { - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { return new GenericCardTestHelper( new HashMap() {{ - put("card", "151_8"); - // put other cards in here as needed for the test case + put("there", "151_8"); + put("arwen", "1_30"); + put("aragorn", "1_89"); + put("tale", "1_66"); + put("saga", "1_114"); + + put("orc1", "1_191"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -31,9 +35,7 @@ public class Card_V1_008Tests ); } - // Uncomment both @Test markers below once this is ready to be used - - //@Test + @Test public void IWasThereStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** @@ -44,38 +46,105 @@ public class Card_V1_008Tests * Twilight Cost: 1 * Type: event * Subtype: Skirmish - * Game Text: Discard an [elven] tale to wound a minion skirmishing an elf. + * Game Text: Spot a minion skirmishing an Elf and discard an [elven] tale to wound that minion. */ //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl there = scn.GetFreepsCard("there"); - assertFalse(card.getBlueprint().isUnique()); - assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed - assertEquals(1, card.getBlueprint().getTwilightCost()); - //assertEquals(, card.getBlueprint().getStrength()); - //assertEquals(, card.getBlueprint().getVitality()); - //assertEquals(, card.getBlueprint().getResistance()); - //assertEquals(Signet., card.getBlueprint().getSignet()); - //assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies - assertEquals(CardType.EVENT, card.getBlueprint().getCardType()); - assertEquals(Culture.ELVEN, card.getBlueprint().getCulture()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertFalse(there.getBlueprint().isUnique()); + assertTrue(scn.HasKeyword(there, Keyword.TALE)); // test for keywords as needed + assertEquals(1, there.getBlueprint().getTwilightCost()); + assertEquals(CardType.EVENT, there.getBlueprint().getCardType()); + assertEquals(Culture.ELVEN, there.getBlueprint().getCulture()); + assertEquals(Side.FREE_PEOPLE, there.getBlueprint().getSide()); } - //@Test - public void IWasThereTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void IWasThereDoesNotTriggerIfNoSkirmishingElves() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl there = scn.GetFreepsCard("there"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn"); + PhysicalCardImpl tale = scn.GetFreepsCard("tale"); + PhysicalCardImpl saga = scn.GetFreepsCard("saga"); + scn.FreepsMoveCardToHand(there, arwen, aragorn, tale, saga); + + PhysicalCardImpl orc1 = scn.GetShadowCard("orc1"); + scn.ShadowMoveCharToTable(orc1); scn.StartGame(); - scn.FreepsPlayCard(card); + scn.FreepsPlayCard(arwen); + scn.FreepsPlayCard(aragorn); + scn.FreepsPlayCard(saga); + scn.FreepsPlayCard(tale); - assertEquals(1, scn.GetTwilight()); + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(aragorn, orc1); + assertEquals(Zone.HAND, there.getZone()); + scn.FreepsResolveSkirmish(aragorn); + assertFalse(scn.FreepsActionAvailable("I Was There")); + } + + @Test + public void IWasThereDoesNotTriggerIfNoElvenTales() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl there = scn.GetFreepsCard("there"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn"); + PhysicalCardImpl saga = scn.GetFreepsCard("saga"); + scn.FreepsMoveCardToHand(there, arwen, aragorn, saga); + + PhysicalCardImpl orc1 = scn.GetShadowCard("orc1"); + scn.ShadowMoveCharToTable(orc1); + + scn.StartGame(); + scn.FreepsPlayCard(arwen); + scn.FreepsPlayCard(aragorn); + scn.FreepsPlayCard(saga); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(arwen, orc1); + assertEquals(Zone.HAND, there.getZone()); + scn.FreepsResolveSkirmish(arwen); + assertFalse(scn.FreepsActionAvailable("I Was There")); + } + + @Test + public void IWasThereTriggersIfElvenTaleAndElfSkirmish() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl there = scn.GetFreepsCard("there"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + PhysicalCardImpl tale = scn.GetFreepsCard("tale"); + scn.FreepsMoveCardToHand(there, arwen, tale); + + PhysicalCardImpl orc1 = scn.GetShadowCard("orc1"); + scn.ShadowMoveCharToTable(orc1); + + scn.StartGame(); + scn.FreepsPlayCard(arwen); + scn.FreepsPlayCard(tale); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(arwen, orc1); + assertEquals(Zone.HAND, there.getZone()); + scn.FreepsResolveSkirmish(arwen); + assertTrue(scn.FreepsActionAvailable("I Was There")); + assertEquals(0, scn.GetWoundsOn(orc1)); + scn.FreepsPlayCard(there); + // Tale of Gil-galad should now be in the discard pile as a cost + assertEquals(Zone.DISCARD, tale.getZone()); + assertEquals(1, scn.GetWoundsOn(orc1)); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_010Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_010Tests.java index 09a0913b7..4329f30ff 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_010Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_010Tests.java @@ -17,13 +17,16 @@ import static org.junit.Assert.assertTrue; public class Card_V1_010Tests { - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { return new GenericCardTestHelper( new HashMap() {{ - put("card", "151_10"); - // put other cards in here as needed for the test case + put("darts", "151_10"); + put("galadriel", "1_45"); + put("greenleaf", "1_50"); + + put("scout", "1_191"); + put("runner", "1_178"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -31,14 +34,12 @@ public class Card_V1_010Tests ); } - // Uncomment both @Test markers below once this is ready to be used - - //@Test - public void LetFlytheDartsofLindonStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void LetFlytheDartsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** * Set: V1 - * Title: *Let Fly the\Darts of Lindon + * Title: *Let Fly the Darts of Lindon * Side: Free Peoples * Culture: elven * Twilight Cost: 1 @@ -46,38 +47,117 @@ public class Card_V1_010Tests * Subtype: * Game Text: Tale. * Bearer must be an [elven] companion. - * Archery: If bearer is an archer, exert bearer to spot a minion. That minion cannot take archery wounds until the regroup phase. The Shadow player may remove (2) to prevent this. + * Archery: If bearer is an archer, exert bearer to spot a minion. That minion cannot take archery wounds + * until the regroup phase. The Shadow player may remove (2) to prevent this. */ //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl darts = scn.GetFreepsCard("darts"); - assertTrue(card.getBlueprint().isUnique()); - assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed - assertEquals(1, card.getBlueprint().getTwilightCost()); - //assertEquals(, card.getBlueprint().getStrength()); - //assertEquals(, card.getBlueprint().getVitality()); - //assertEquals(, card.getBlueprint().getResistance()); - //assertEquals(Signet., card.getBlueprint().getSignet()); - //assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies - assertEquals(CardType.CONDITION, card.getBlueprint().getCardType()); - assertEquals(Culture.ELVEN, card.getBlueprint().getCulture()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertTrue(darts.getBlueprint().isUnique()); + assertTrue(scn.HasKeyword(darts, Keyword.TALE)); // test for keywords as needed + assertEquals(1, darts.getBlueprint().getTwilightCost()); + assertEquals(CardType.CONDITION, darts.getBlueprint().getCardType()); + assertEquals(Culture.ELVEN, darts.getBlueprint().getCulture()); + assertEquals(Side.FREE_PEOPLE, darts.getBlueprint().getSide()); } - //@Test - public void LetFlytheDartsofLindonTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void LetFlytheDartsOnlyPlaysOnElvenCompanions() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl darts = scn.GetFreepsCard("darts"); + PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel"); + PhysicalCardImpl greenleaf = scn.GetFreepsCard("greenleaf"); + scn.FreepsMoveCardToHand(darts, galadriel, greenleaf); scn.StartGame(); - scn.FreepsPlayCard(card); + assertFalse(scn.FreepsActionAvailable("let fly the darts")); + scn.FreepsPlayCard(galadriel); + assertFalse(scn.FreepsActionAvailable("let fly the darts")); + scn.FreepsPlayCard(greenleaf); + assertTrue(scn.FreepsActionAvailable("let fly the darts")); + } - assertEquals(1, scn.GetTwilight()); + @Test + public void LetFlytheDartsExertsToProtectMinionFromArrows() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl darts = scn.GetFreepsCard("darts"); + PhysicalCardImpl greenleaf = scn.GetFreepsCard("greenleaf"); + scn.FreepsMoveCardToHand(darts, greenleaf); + + PhysicalCardImpl scout = scn.GetShadowCard("scout"); + PhysicalCardImpl runner = scn.GetShadowCard("runner"); + scn.ShadowMoveCharToTable(scout, runner); + + scn.StartGame(); + scn.FreepsPlayCard(greenleaf); + scn.FreepsPlayCard(darts); + scn.SetTwilight(0); + + scn.SkipToPhase(Phase.ARCHERY); + assertEquals(4, scn.GetTwilight()); + assertEquals(0, scn.GetWoundsOn(greenleaf)); + assertTrue(scn.FreepsActionAvailable("let fly the darts")); + scn.FreepsUseCardAction(darts); + assertTrue(scn.FreepsDecisionAvailable("Choose")); + scn.FreepsChooseCard(scout); + assertTrue(scn.ShadowDecisionAvailable("Would you like to remove (2) to prevent a minion taking no archery wounds?")); + scn.ShadowChooseNo(); + + assertEquals(4, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(greenleaf)); + + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsSkipCurrentPhaseAction(); + + //Since the Scout was barred from taking archery wounds, Gemp automatically assigns the single arrow + // to the Runner, killing it. + assertEquals(Zone.DISCARD, runner.getZone()); + + + } + + @Test + public void LetFlytheDartsPermitsShadowToPrevent() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl darts = scn.GetFreepsCard("darts"); + PhysicalCardImpl greenleaf = scn.GetFreepsCard("greenleaf"); + scn.FreepsMoveCardToHand(darts, greenleaf); + + PhysicalCardImpl scout = scn.GetShadowCard("scout"); + PhysicalCardImpl runner = scn.GetShadowCard("runner"); + scn.ShadowMoveCharToTable(scout, runner); + + scn.StartGame(); + scn.FreepsPlayCard(greenleaf); + scn.FreepsPlayCard(darts); + scn.SetTwilight(0); + + scn.SkipToPhase(Phase.ARCHERY); + assertEquals(4, scn.GetTwilight()); + assertEquals(0, scn.GetWoundsOn(greenleaf)); + assertTrue(scn.FreepsActionAvailable("let fly the darts")); + scn.FreepsUseCardAction(darts); + assertTrue(scn.FreepsDecisionAvailable("Choose")); + scn.FreepsChooseCard(scout); + assertTrue(scn.ShadowDecisionAvailable("Would you like to remove (2) to prevent a minion taking no archery wounds?")); + scn.ShadowChooseYes(); + + assertEquals(2, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(greenleaf)); + + scn.ShadowSkipCurrentPhaseAction(); + scn.FreepsSkipCurrentPhaseAction(); + + //There should be 2 options, 1 for each minion that arrows can be assigned to. + assertEquals(2, scn.ShadowGetADParam("cardId").length); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_011Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_011Tests.java index a67935a4c..4cc76565f 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_011Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_011Tests.java @@ -17,13 +17,18 @@ import static org.junit.Assert.assertTrue; public class Card_V1_011Tests { - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { return new GenericCardTestHelper( new HashMap() {{ - put("card", "151_11"); - // put other cards in here as needed for the test case + put("library", "151_11"); + put("arwen", "1_30"); + put("elrond", "3_13"); + put("galadriel", "1_45"); + put("orophin", "1_56"); + put("tale", "1_66"); + + put("runner", "1_178"); }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -31,9 +36,7 @@ public class Card_V1_011Tests ); } - // Uncomment both @Test markers below once this is ready to be used - - //@Test + @Test public void LibraryofRivendellStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** @@ -52,32 +55,106 @@ public class Card_V1_011Tests //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl library = scn.GetFreepsCard("library"); - assertTrue(card.getBlueprint().isUnique()); - assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed - assertEquals(2, card.getBlueprint().getTwilightCost()); - //assertEquals(, card.getBlueprint().getStrength()); - //assertEquals(, card.getBlueprint().getVitality()); - //assertEquals(, card.getBlueprint().getResistance()); - //assertEquals(Signet., card.getBlueprint().getSignet()); - //assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies - assertEquals(CardType.ARTIFACT, card.getBlueprint().getCardType()); - assertEquals(Culture.ELVEN, card.getBlueprint().getCulture()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertTrue(library.getBlueprint().isUnique()); + assertTrue(scn.HasKeyword(library, Keyword.SUPPORT_AREA)); // test for keywords as needed + assertEquals(2, library.getBlueprint().getTwilightCost()); + assertEquals(CardType.ARTIFACT, library.getBlueprint().getCardType()); + assertEquals(Culture.ELVEN, library.getBlueprint().getCulture()); + assertEquals(Side.FREE_PEOPLE, library.getBlueprint().getSide()); } - //@Test - public void LibraryofRivendellTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void LibraryofRivendellCanPlayIfSpot3Elves() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl library = scn.GetFreepsCard("library"); + PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel"); + PhysicalCardImpl orophin = scn.GetFreepsCard("orophin"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + scn.FreepsMoveCardToHand(library, galadriel, orophin, arwen); scn.StartGame(); - scn.FreepsPlayCard(card); + assertFalse(scn.FreepsActionAvailable("Library")); + scn.FreepsPlayCard(arwen); + assertFalse(scn.FreepsActionAvailable("Library")); + scn.FreepsPlayCard(orophin); + assertFalse(scn.FreepsActionAvailable("Library")); + scn.FreepsPlayCard(galadriel); + assertTrue(scn.FreepsActionAvailable("Library")); + } - assertEquals(2, scn.GetTwilight()); + @Test + public void LibraryofRivendellCanPlayIfSpotElrond() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl library = scn.GetFreepsCard("library"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + scn.FreepsMoveCardToHand(library, elrond); + + scn.StartGame(); + assertFalse(scn.FreepsActionAvailable("Library")); + scn.FreepsPlayCard(elrond); + assertTrue(scn.FreepsActionAvailable("Library")); + } + + @Test + public void LibraryofRivendellPumpsTaleBearers() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl library = scn.GetFreepsCard("library"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + PhysicalCardImpl tale = scn.GetFreepsCard("tale"); + scn.FreepsMoveCardToHand(library, tale); + scn.FreepsMoveCharToTable(arwen, elrond); + + scn.StartGame(); + //decline elrond's text + scn.FreepsDeclineOptionalTrigger(); + + scn.FreepsPlayCard(tale); + scn.FreepsChooseCard(arwen); + assertEquals(6, scn.GetStrength(arwen)); + + scn.FreepsPlayCard(library); + assertEquals(7, scn.GetStrength(arwen)); + } + + @Test + public void LibraryofRivendellBurnsTalesToPumpElfCompanions() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl library = scn.GetFreepsCard("library"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + PhysicalCardImpl arwen = scn.GetFreepsCard("arwen"); + PhysicalCardImpl tale = scn.GetFreepsCard("tale"); + scn.FreepsMoveCardToHand(library, tale); + scn.FreepsMoveCharToTable(arwen, elrond); + + PhysicalCardImpl runner = scn.GetShadowCard("runner"); + scn.ShadowMoveCharToTable(runner); + + scn.StartGame(); + //decline elrond's text + scn.FreepsDeclineOptionalTrigger(); + + scn.FreepsPlayCard(tale); + scn.FreepsChooseCard(elrond); + scn.FreepsPlayCard(library); + + scn.SkipToPhase(Phase.ASSIGNMENT); + scn.SkipCurrentPhaseActions(); + scn.FreepsAssignToMinions(arwen, runner); + scn.FreepsResolveSkirmish(arwen); + assertTrue(scn.FreepsActionAvailable("Library")); + assertEquals(6, scn.GetStrength(arwen)); + scn.FreepsUseCardAction(library); + assertEquals(7, scn.GetStrength(arwen)); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_012Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_012Tests.java index a20873dda..de2abfe43 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_012Tests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/vset1/vpack1/Card_V1_012Tests.java @@ -6,7 +6,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.MoveLimitModifier; import org.junit.Test; import java.util.HashMap; @@ -17,13 +16,19 @@ import static org.junit.Assert.assertTrue; public class Card_V1_012Tests { - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { return new GenericCardTestHelper( new HashMap() {{ - put("card", "151_12"); - // put other cards in here as needed for the test case + put("three", "151_12"); + put("narya", "3_34"); + put("vilya", "3_27"); + put("nenya", "3_23"); + put("gandalf", "1_364"); + put("elrond", "1_40"); + put("galadriel", "1_45"); + + }}, GenericCardTestHelper.FellowshipSites, GenericCardTestHelper.FOTRFrodo, @@ -31,10 +36,8 @@ public class Card_V1_012Tests ); } - // Uncomment both @Test markers below once this is ready to be used - - //@Test - public void ThreeRingsfortheElvenKingsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void ThreeRingsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { /** * Set: V1 @@ -45,38 +48,122 @@ public class Card_V1_012Tests * Type: condition * Subtype: Support Area * Game Text: Tale. - * Each time the fellowship moves you may spot an [elven] or [gandalf] ring to place a card from hand beneath your draw deck and draw a card. If you can spot 3 [elven] or [gandalf] rings you may also heal a companion. + * Each time the fellowship moves you may spot an [elven] or [gandalf] ring to place a three from + * hand beneath your draw deck and draw a three. If you can spot 3 [elven] or [gandalf] rings you + * may also heal a companion. */ //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); + PhysicalCardImpl three = scn.GetFreepsCard("three"); - assertTrue(card.getBlueprint().isUnique()); - assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed - assertEquals(1, card.getBlueprint().getTwilightCost()); - //assertEquals(, card.getBlueprint().getStrength()); - //assertEquals(, card.getBlueprint().getVitality()); - //assertEquals(, card.getBlueprint().getResistance()); - //assertEquals(Signet., card.getBlueprint().getSignet()); - //assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies - assertEquals(CardType.CONDITION, card.getBlueprint().getCardType()); - assertEquals(Culture.ELVEN, card.getBlueprint().getCulture()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertTrue(three.getBlueprint().isUnique()); + assertTrue(scn.HasKeyword(three, Keyword.SUPPORT_AREA)); + assertTrue(scn.HasKeyword(three, Keyword.TALE)); + assertEquals(1, three.getBlueprint().getTwilightCost()); + assertEquals(CardType.CONDITION, three.getBlueprint().getCardType()); + assertEquals(Culture.ELVEN, three.getBlueprint().getCulture()); + assertEquals(Side.FREE_PEOPLE, three.getBlueprint().getSide()); } - //@Test - public void ThreeRingsfortheElvenKingsTest1() throws DecisionResultInvalidException, CardNotFoundException { + @Test + public void ThreeRingsSpotsNaryaToMusterUnderDrawDeck() throws DecisionResultInvalidException, CardNotFoundException { //Pre-game setup GenericCardTestHelper scn = GetScenario(); - PhysicalCardImpl card = scn.GetFreepsCard("card"); - scn.FreepsMoveCardToHand(card); + PhysicalCardImpl three = scn.GetFreepsCard("three"); + PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf"); + PhysicalCardImpl narya = scn.GetFreepsCard("narya"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + PhysicalCardImpl vilya = scn.GetFreepsCard("vilya"); + PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel"); + PhysicalCardImpl nenya = scn.GetFreepsCard("nenya"); + scn.FreepsMoveCardToHand(three, gandalf, narya, elrond, vilya); scn.StartGame(); - scn.FreepsPlayCard(card); + scn.FreepsPlayCard(three); + scn.FreepsPlayCard(gandalf); + scn.FreepsPlayCard(narya); + + assertEquals(2, scn.GetFreepsHandCount()); + assertEquals(2, scn.GetFreepsDeckCount()); + scn.FreepsSkipCurrentPhaseAction(); + + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); + scn.FreepsAcceptOptionalTrigger(); + assertEquals(2, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCardIDFromSelection(vilya); + // vilya put on the bottom of the deck, and then drew one card to get back to 2 + assertEquals(2, scn.GetFreepsHandCount()); + assertEquals(2, scn.GetFreepsDeckCount()); + assertEquals(vilya, scn.GetFreepsBottomOfDeck()); + assertFalse(scn.FreepsAnyDecisionsAvailable()); + } + + @Test + public void ThreeRingsSpotsVilyaToMusterUnderDrawDeck() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl three = scn.GetFreepsCard("three"); + PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf"); + PhysicalCardImpl narya = scn.GetFreepsCard("narya"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + PhysicalCardImpl vilya = scn.GetFreepsCard("vilya"); + PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel"); + PhysicalCardImpl nenya = scn.GetFreepsCard("nenya"); + scn.FreepsMoveCardToHand(three, gandalf, narya, elrond, vilya); + + scn.StartGame(); + scn.FreepsPlayCard(three); + scn.FreepsPlayCard(gandalf); + scn.FreepsPlayCard(elrond); + scn.FreepsPlayCard(vilya); + + assertEquals(1, scn.GetFreepsHandCount()); + assertEquals(2, scn.GetFreepsDeckCount()); + scn.FreepsSkipCurrentPhaseAction(); + + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); + scn.FreepsAcceptOptionalTrigger(); + // narya automatically put on the bottom of the deck, and then drew one card to get back to 1 + assertEquals(1, scn.GetFreepsHandCount()); + assertEquals(2, scn.GetFreepsDeckCount()); + assertEquals(narya, scn.GetFreepsBottomOfDeck()); + assertFalse(scn.FreepsAnyDecisionsAvailable()); + } + + @Test + public void ThreeRingsSpotsThreeRingsToHeal() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + PhysicalCardImpl three = scn.GetFreepsCard("three"); + PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf"); + PhysicalCardImpl narya = scn.GetFreepsCard("narya"); + PhysicalCardImpl elrond = scn.GetFreepsCard("elrond"); + PhysicalCardImpl vilya = scn.GetFreepsCard("vilya"); + PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel"); + PhysicalCardImpl nenya = scn.GetFreepsCard("nenya"); + scn.FreepsMoveCardToHand(three, gandalf, narya, elrond, vilya, galadriel, nenya); + + scn.StartGame(); + scn.FreepsPlayCard(three); + scn.FreepsPlayCard(gandalf); + scn.FreepsPlayCard(narya); + scn.FreepsPlayCard(elrond); + scn.FreepsPlayCard(vilya); + scn.FreepsPlayCard(galadriel); + scn.FreepsPlayCard(nenya); + + scn.AddWoundsToChar(gandalf, 1); + scn.AddWoundsToChar(scn.GetRingBearer(), 1); + + scn.FreepsSkipCurrentPhaseAction(); + + assertTrue(scn.FreepsHasOptionalTriggerAvailable()); + scn.FreepsAcceptOptionalTrigger();R - assertEquals(1, scn.GetTwilight()); } }