diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set01/set1-elven.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set01/set1-elven.hjson index 790777da9..0f9e27662 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set01/set1-elven.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set01/set1-elven.hjson @@ -832,47 +832,44 @@ effects: { type: activated phase: maneuver - effect: { - type: choice - texts: [ - Exert a Dwarf to heal an Elf - Exert an Elf to heal a Dwarf - ] - effects: [ - { - type: costToEffect - cost: [ - { - type: addTwilight - } - { - type: exert - filter: choose(dwarf) - } - ] - effect: { - type: heal - filter: choose(elf) - } + text: Add (1) and either exert an Elf to heal a Dwarf, or exert a Dwarf to heal an Elf. + cost: [ + { + type: addTwilight + amount: 1 + } + { + type: exert + filter: choose(or(dwarf,elf)) + memorize: exerter + } + ] + effect: [ + { + type: conditional + requires: { + type: MemoryMatches + memory: exerter + filter: dwarf } - { - type: costToEffect - cost: [ - { - type: addTwilight - } - { - type: exert - filter: choose(elf) - } - ] - effect: { - type: heal - filter: choose(dwarf) - } + effect: { + type: heal + filter: choose(elf) } - ] - } + } + { + type: conditional + requires: { + type: MemoryMatches + memory: exerter + filter: elf + } + effect: { + type: heal + filter: choose(dwarf) + } + } + ] } } 1_60: { diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/errata/set01/set01-Elven-errata.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/errata/set01/set01-Elven-errata.hjson index c634952a5..0ac132e60 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/errata/set01/set01-Elven-errata.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/unofficial/pc/errata/set01/set01-Elven-errata.hjson @@ -579,47 +579,44 @@ effects: { type: activated phase: fellowship - effect: { - type: choice - texts: [ - Exert a Dwarf to heal an Elf - Exert an Elf to heal a Dwarf - ] - effects: [ - { - type: costToEffect - cost: [ - { - type: addTwilight - } - { - type: exert - filter: choose(dwarf) - } - ] - effect: { - type: heal - filter: choose(elf) - } + text: Add (1) and either exert an Elf to heal a Dwarf, or exert a Dwarf to heal an Elf. + cost: [ + { + type: addTwilight + amount: 1 + } + { + type: exert + filter: choose(or(dwarf,elf)) + memorize: exerter + } + ] + effect: [ + { + type: conditional + requires: { + type: MemoryMatches + memory: exerter + filter: dwarf } - { - type: costToEffect - cost: [ - { - type: addTwilight - } - { - type: exert - filter: choose(elf) - } - ] - effect: { - type: heal - filter: choose(dwarf) - } + effect: { + type: heal + filter: choose(elf) } - ] - } + } + { + type: conditional + requires: { + type: MemoryMatches + memory: exerter + filter: elf + } + effect: { + type: heal + filter: choose(dwarf) + } + } + ] } gametext: Fellowship: Add (1) and exert a Dwarf to heal an Elf, or add (1) and exert an Elf to heal a Dwarf. lore: “‘May it be a sign that though the world is now dark better days are at hand, and that friendship shall be renewed between our peoples.'” diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java index f495c580f..f381de0e2 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java @@ -267,11 +267,11 @@ public class LotroGameMediator { if (_lotroGame != null && _lotroGame.getWinnerPlayerId() == null) { for (Map.Entry playerDecision : new HashMap<>(_decisionQuerySentTimes).entrySet()) { - String playerId = playerDecision.getKey(); + String player = playerDecision.getKey(); long decisionSent = playerDecision.getValue(); if (currentTime > decisionSent + _timeSettings.maxSecondsPerDecision() * 1000L) { - addTimeSpentOnDecisionToUserClock(playerId); - _lotroGame.playerLost(playerId, "Player decision timed-out"); + addTimeSpentOnDecisionToUserClock(player); + _lotroGame.playerLost(player, "Player decision timed-out"); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set01/Card_01_059_Tests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set01/Card_01_059_Tests.java new file mode 100644 index 000000000..72015d100 --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/official/set01/Card_01_059_Tests.java @@ -0,0 +1,219 @@ +package com.gempukku.lotro.cards.official.set01; + +import com.gempukku.lotro.cards.GenericCardTestHelper; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.game.CardNotFoundException; +import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import org.junit.Test; + +import java.util.HashMap; + +import static org.junit.Assert.*; + +public class Card_01_059_Tests +{ + + protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { + return new GenericCardTestHelper( + new HashMap<>() + {{ + put("sts", "1_59"); + put("legolas", "1_50"); + put("gimli", "1_13"); + put("rumil", "1_57"); + put("grimir", "1_17"); + + put("runner", "1_178"); + + put("finalstrike", "10_20"); + put("gollum", "5_24"); + }}, + GenericCardTestHelper.FellowshipSites, + GenericCardTestHelper.FOTRFrodo, + GenericCardTestHelper.FOTRRing + ); + } + + @Test + public void ShouldertoShoulderStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + + /** + * Set: 1 + * Title: Shoulder to Shoulder + * Unique: False + * Side: FREE_PEOPLE + * Culture: Elven + * Twilight Cost: 1 + * Type: condition + * Subtype: Support Area + * Game Text: Fellowship: Add (1) and exert a Dwarf to heal an Elf, or add (1) and exert an Elf to heal a Dwarf. + */ + + //Pre-game setup + var scn = GetScenario(); + + var sts = scn.GetFreepsCard("sts"); + + assertFalse(sts.getBlueprint().isUnique()); + assertEquals(Side.FREE_PEOPLE, sts.getBlueprint().getSide()); + assertEquals(Culture.ELVEN, sts.getBlueprint().getCulture()); + assertEquals(CardType.CONDITION, sts.getBlueprint().getCardType()); + assertTrue(scn.HasKeyword(sts, Keyword.SUPPORT_AREA)); + assertEquals(1, sts.getBlueprint().getTwilightCost()); + } + + @Test + public void ManeuverActionWorksOnDwarves() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + var sts = scn.GetFreepsCard("sts"); + var legolas = scn.GetFreepsCard("legolas"); + var gimli = scn.GetFreepsCard("gimli"); + var rumil = scn.GetFreepsCard("rumil"); + var grimir = scn.GetFreepsCard("grimir"); + scn.FreepsMoveCharToTable(legolas, gimli); + scn.FreepsMoveCardToSupportArea(rumil, grimir, sts); + + scn.ShadowMoveCharToTable("runner"); + + scn.StartGame(); + + scn.SkipToPhase(Phase.MANEUVER); + scn.SetTwilight(0); + + scn.AddWoundsToChar(legolas, 1); + scn.AddWoundsToChar(gimli, 1); + scn.AddWoundsToChar(rumil, 1); + scn.AddWoundsToChar(grimir, 1); + + assertEquals(0, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(legolas)); + assertEquals(1, scn.GetWoundsOn(gimli)); + assertEquals(1, scn.GetWoundsOn(rumil)); + assertEquals(1, scn.GetWoundsOn(grimir)); + + assertTrue(scn.FreepsActionAvailable("Exert a Dwarf")); + scn.FreepsChooseAction("Exert a Dwarf"); + + assertEquals(4, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(gimli); + scn.FreepsChooseCard(rumil); + assertEquals(1, scn.GetTwilight()); + assertEquals(2, scn.GetWoundsOn(gimli)); + assertEquals(0, scn.GetWoundsOn(rumil)); + + scn.ShadowPassCurrentPhaseAction(); + assertTrue(scn.FreepsActionAvailable("Exert a Dwarf")); + scn.FreepsChooseAction("Exert a Dwarf"); + + //Legolas, Rumil, and Grimir + assertEquals(3, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(grimir); + assertEquals(2, scn.GetTwilight()); + assertEquals(2, scn.GetWoundsOn(grimir)); + assertEquals(0, scn.GetWoundsOn(legolas)); + } + + @Test + public void ManeuverActionWorksOnElves() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + var sts = scn.GetFreepsCard("sts"); + var legolas = scn.GetFreepsCard("legolas"); + var gimli = scn.GetFreepsCard("gimli"); + var rumil = scn.GetFreepsCard("rumil"); + var grimir = scn.GetFreepsCard("grimir"); + scn.FreepsMoveCharToTable(legolas, gimli); + scn.FreepsMoveCardToSupportArea(rumil, grimir, sts); + + scn.ShadowMoveCharToTable("runner"); + + scn.StartGame(); + + scn.SkipToPhase(Phase.MANEUVER); + scn.SetTwilight(0); + + scn.AddWoundsToChar(legolas, 1); + scn.AddWoundsToChar(gimli, 1); + scn.AddWoundsToChar(rumil, 1); + scn.AddWoundsToChar(grimir, 1); + + assertEquals(0, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(legolas)); + assertEquals(1, scn.GetWoundsOn(gimli)); + assertEquals(1, scn.GetWoundsOn(rumil)); + assertEquals(1, scn.GetWoundsOn(grimir)); + + assertTrue(scn.FreepsActionAvailable("Exert an Elf")); + scn.FreepsChooseAction("Exert an Elf"); + + //Initially either dwarves or elves can be selected + assertEquals(4, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(legolas); + + //Once an Elf has been selected, only Dwarves can be selected as a target + assertEquals(2, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(gimli); + assertEquals(1, scn.GetTwilight()); + assertEquals(2, scn.GetWoundsOn(legolas)); + assertEquals(0, scn.GetWoundsOn(gimli)); + + scn.ShadowPassCurrentPhaseAction(); + assertTrue(scn.FreepsActionAvailable("Exert an Elf")); + scn.FreepsChooseAction("Exert an Elf"); + + scn.FreepsChooseCard(rumil); + assertEquals(2, scn.GetTwilight()); + assertEquals(2, scn.GetWoundsOn(rumil)); + assertEquals(0, scn.GetWoundsOn(grimir)); + } + + @Test + public void STSIsProperlyBlockedByFinalStrike() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + var scn = GetScenario(); + + var sts = scn.GetFreepsCard("sts"); + var legolas = scn.GetFreepsCard("legolas"); + var gimli = scn.GetFreepsCard("gimli"); + scn.FreepsMoveCharToTable(legolas, gimli); + scn.FreepsMoveCardToSupportArea(sts); + + var gollum = scn.GetShadowCard("gollum"); + var finalstrike = scn.GetShadowCard("finalstrike"); + scn.ShadowMoveCardToSupportArea(finalstrike); + scn.ShadowMoveCharToTable(gollum); + + scn.StartGame(); + + scn.SkipToPhase(Phase.MANEUVER); + scn.SetTwilight(0); + + scn.AddWoundsToChar(legolas, 1); + + assertEquals(0, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(legolas)); + assertEquals(0, scn.GetWoundsOn(gimli)); + assertEquals(0, scn.GetWoundsOn(gollum)); + + scn.FreepsChooseAction("Exert a Dwarf"); + scn.FreepsChooseCard(gimli); + + assertTrue(scn.ShadowHasOptionalTriggerAvailable()); + scn.ShadowAcceptOptionalTrigger(); + + //Final Strike is a "Response:" action, so it can technically be repeated (for some reason) + scn.ShadowDeclineOptionalTrigger(); + + assertTrue(scn.ShadowDecisionAvailable("Maneuver action")); + + // The costs of STS should have still been paid, meaning that Gimli should have exerted + // and the twilight been added, but the effect (healing Legolas) should have been blocked + assertEquals(1, scn.GetTwilight()); + assertEquals(1, scn.GetWoundsOn(legolas)); + assertEquals(1, scn.GetWoundsOn(gimli)); + assertEquals(1, scn.GetWoundsOn(gollum)); + } +} diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_059_ErrataTests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_059_ErrataTests.java index 57a698acd..306195d2e 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_059_ErrataTests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_059_ErrataTests.java @@ -85,25 +85,21 @@ public class Card_01_059_ErrataTests assertEquals(1, scn.GetWoundsOn(rumil)); assertEquals(1, scn.GetWoundsOn(grimir)); - assertTrue(scn.FreepsActionAvailable(sts)); - scn.FreepsUseCardAction(sts); - assertEquals(2, scn.FreepsGetMultipleChoices().size()); - scn.FreepsChooseMultipleChoiceOption("Exert a Dwarf to heal an Elf"); + assertTrue(scn.FreepsActionAvailable("Exert a Dwarf")); + scn.FreepsChooseAction("Exert a Dwarf"); - assertEquals(2, scn.GetFreepsCardChoiceCount()); + assertEquals(4, scn.GetFreepsCardChoiceCount()); scn.FreepsChooseCard(gimli); scn.FreepsChooseCard(rumil); assertEquals(1, scn.GetTwilight()); assertEquals(2, scn.GetWoundsOn(gimli)); assertEquals(0, scn.GetWoundsOn(rumil)); - assertTrue(scn.FreepsActionAvailable(sts)); - scn.FreepsUseCardAction(sts); - assertEquals(2, scn.FreepsGetMultipleChoices().size()); - scn.FreepsChooseMultipleChoiceOption("Exert a Dwarf to heal an Elf"); + assertTrue(scn.FreepsActionAvailable("Exert a Dwarf")); + scn.FreepsChooseAction("Exert a Dwarf"); - assertEquals(2, scn.GetFreepsCardChoiceCount()); - //only one choice of each left + assertEquals(3, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(grimir); assertEquals(2, scn.GetTwilight()); assertEquals(2, scn.GetWoundsOn(grimir)); assertEquals(0, scn.GetWoundsOn(legolas)); @@ -135,25 +131,21 @@ public class Card_01_059_ErrataTests assertEquals(1, scn.GetWoundsOn(rumil)); assertEquals(1, scn.GetWoundsOn(grimir)); - assertTrue(scn.FreepsActionAvailable(sts)); - scn.FreepsUseCardAction(sts); - assertEquals(2, scn.FreepsGetMultipleChoices().size()); - scn.FreepsChooseMultipleChoiceOption("Exert an Elf to heal a Dwarf"); + assertTrue(scn.FreepsActionAvailable("Exert an Elf")); + scn.FreepsChooseAction("Exert an Elf"); - assertEquals(2, scn.GetFreepsCardChoiceCount()); + assertEquals(4, scn.GetFreepsCardChoiceCount()); scn.FreepsChooseCard(legolas); scn.FreepsChooseCard(gimli); assertEquals(1, scn.GetTwilight()); assertEquals(2, scn.GetWoundsOn(legolas)); assertEquals(0, scn.GetWoundsOn(gimli)); - assertTrue(scn.FreepsActionAvailable(sts)); - scn.FreepsUseCardAction(sts); - assertEquals(2, scn.FreepsGetMultipleChoices().size()); - scn.FreepsChooseMultipleChoiceOption("Exert an Elf to heal a Dwarf"); + assertTrue(scn.FreepsActionAvailable("Exert an Elf")); + scn.FreepsChooseAction("Exert an Elf"); - assertEquals(2, scn.GetFreepsCardChoiceCount()); - //only one choice of each left + assertEquals(3, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(rumil); assertEquals(2, scn.GetTwilight()); assertEquals(2, scn.GetWoundsOn(rumil)); assertEquals(0, scn.GetWoundsOn(grimir)); diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java index f8f42d1d3..09558070b 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java @@ -1,124 +1,108 @@ package com.gempukku.lotro.cards.unofficial.pc.errata.set01; import com.gempukku.lotro.cards.GenericCardTestHelper; -import com.gempukku.lotro.common.CardType; -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Keyword; -import com.gempukku.lotro.common.Side; +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 org.junit.Test; import java.util.HashMap; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class Card_01_316_ErrataTests { + protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { + return new GenericCardTestHelper( + new HashMap<>() {{ + put("talent", "51_316"); + put("sam", "1_311"); + put("merry", "1_302"); + put("pippin", "1_307"); + put("boromir", "1_97"); + }} + ); + } - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { - return new GenericCardTestHelper( - new HashMap<>() - {{ - put("talent1", "71_316"); - put("talent2", "71_316"); - put("sam", "1_311"); - put("merry", "1_302"); - put("pippin", "1_306"); - }}, - GenericCardTestHelper.FellowshipSites, - GenericCardTestHelper.FOTRFrodo, - GenericCardTestHelper.FOTRRing - ); - } + @Test + public void TalentStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { - @Test - public void ATalentforNotBeingSeenStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + /** + * Set: 1E + * Title: A Talent for Not Being Seen + * Side: Free Peoples + * Culture: Shire + * Twilight Cost: 0 + * Type: Condition + * Errata Game Text: Stealth. Bearer must be Merry or Pippin. Limit 1 per character. + * Each site's Shadow number is -1. + */ - /** - * Set: 1 - * Title: A Talent for Not Being Seen - * Unique: True - * Side: FREE_PEOPLE - * Culture: Shire - * Twilight Cost: 0 - * Type: condition - * Subtype: - * Game Text: Stealth. To play, exert Merry or Pippin. Bearer must be Merry or Pippin. - * Each site's Shadow number is -1. - */ + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); - //Pre-game setup - var scn = GetScenario(); + var talent = scn.GetFreepsCard("talent"); - var card = scn.GetFreepsCard("talent1"); + assertFalse(talent.getBlueprint().isUnique()); + assertEquals(Side.FREE_PEOPLE, talent.getBlueprint().getSide()); + assertEquals(Culture.SHIRE, talent.getBlueprint().getCulture()); + assertEquals(CardType.CONDITION, talent.getBlueprint().getCardType()); + assertEquals(0, talent.getBlueprint().getTwilightCost()); - assertFalse(card.getBlueprint().isUnique()); - assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); - assertEquals(Culture.SHIRE, card.getBlueprint().getCulture()); - assertEquals(CardType.CONDITION, card.getBlueprint().getCardType()); - assertFalse(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); - assertEquals(0, card.getBlueprint().getTwilightCost()); - } + assertTrue(scn.HasKeyword(talent, Keyword.STEALTH)); + assertFalse(scn.HasKeyword(talent, Keyword.SUPPORT_AREA)); + } - @Test - public void TalentExertsAndPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException { - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); + @Test + public void TalentOnlyPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); - var frodo = scn.GetRingBearer(); - var sam = scn.GetFreepsCard("sam"); - var merry = scn.GetFreepsCard("merry"); - var pippin = scn.GetFreepsCard("pippin"); - var talent1 = scn.GetFreepsCard("talent1"); - var talent2 = scn.GetFreepsCard("talent2"); + PhysicalCardImpl frodo = scn.GetRingBearer(); + PhysicalCardImpl sam = scn.GetFreepsCard("sam"); + PhysicalCardImpl merry = scn.GetFreepsCard("merry"); + PhysicalCardImpl pippin = scn.GetFreepsCard("pippin"); + PhysicalCardImpl talent = scn.GetFreepsCard("talent"); - scn.FreepsMoveCardToHand(talent1,talent2, sam, merry, pippin); + scn.FreepsMoveCharToTable(sam); + scn.FreepsMoveCharToTable(merry); + scn.FreepsMoveCharToTable(pippin); + scn.FreepsMoveCardToHand(talent); - scn.StartGame(); + scn.StartGame(); - assertFalse(scn.FreepsPlayAvailable(talent1)); - scn.FreepsPlayCard(sam); - assertFalse(scn.FreepsPlayAvailable(talent1)); + scn.FreepsPlayCard(talent); - scn.FreepsPlayCard(merry); - assertTrue(scn.FreepsPlayAvailable(talent1)); - assertEquals(0, scn.GetWoundsOn(merry)); - scn.FreepsPlayCard(talent1); - assertEquals(1, scn.GetWoundsOn(merry)); - assertSame(merry, talent1.getAttachedTo()); - - scn.FreepsPlayCard(pippin); - scn.FreepsPlayCard(talent2); - - //There are 4 companions in play, but only 2 valid targets for the exert - assertEquals(2, scn.GetFreepsCardChoiceCount()); - scn.FreepsChooseCard(merry); - - //plays automatically on pippin, since merry is already bearing one - assertEquals(2, scn.GetWoundsOn(merry)); - assertEquals(0, scn.GetWoundsOn(pippin)); - assertSame(pippin, talent2.getAttachedTo()); - } + //There are 4 companions in play, but only 2 valid targets + assertEquals(2, scn.FreepsGetADParamAsList("cardId").size()); + } - @Test - public void TalentReducesShadowBy1() throws DecisionResultInvalidException, CardNotFoundException { - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); + @Test + public void TalentReducesTwilightIfOnlyHobbits() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); - var frodo = scn.GetRingBearer(); - var merry = scn.GetFreepsCard("merry"); - var talent1 = scn.GetFreepsCard("talent1"); + PhysicalCardImpl frodo = scn.GetRingBearer(); + PhysicalCardImpl merry = scn.GetFreepsCard("merry"); + PhysicalCardImpl talent = scn.GetFreepsCard("talent"); - scn.FreepsMoveCharToTable(merry); - scn.FreepsAttachCardsTo(merry, talent1); + scn.FreepsMoveCharToTable(merry); + scn.FreepsMoveCardToHand(talent); + + scn.StartGame(); + + scn.FreepsPlayCard(talent); + scn.FreepsPassCurrentPhaseAction(); + + // 2 for Frodo/Merry, 1 for the site, -1 for Talent + assertEquals(2, scn.GetTwilight()); + + } - scn.StartGame(); - scn.FreepsPassCurrentPhaseAction(); - // 2 for Frodo/Merry, 2 for the site, -1 for Talent - assertEquals(3, scn.GetTwilight()); - } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.new b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.new new file mode 100644 index 000000000..f8f42d1d3 --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.new @@ -0,0 +1,124 @@ +package com.gempukku.lotro.cards.unofficial.pc.errata.set01; + +import com.gempukku.lotro.cards.GenericCardTestHelper; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.game.CardNotFoundException; +import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import org.junit.Test; + +import java.util.HashMap; + +import static org.junit.Assert.*; + +public class Card_01_316_ErrataTests +{ + + protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { + return new GenericCardTestHelper( + new HashMap<>() + {{ + put("talent1", "71_316"); + put("talent2", "71_316"); + put("sam", "1_311"); + put("merry", "1_302"); + put("pippin", "1_306"); + }}, + GenericCardTestHelper.FellowshipSites, + GenericCardTestHelper.FOTRFrodo, + GenericCardTestHelper.FOTRRing + ); + } + + @Test + public void ATalentforNotBeingSeenStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { + + /** + * Set: 1 + * Title: A Talent for Not Being Seen + * Unique: True + * Side: FREE_PEOPLE + * Culture: Shire + * Twilight Cost: 0 + * Type: condition + * Subtype: + * Game Text: Stealth. To play, exert Merry or Pippin. Bearer must be Merry or Pippin. + * Each site's Shadow number is -1. + */ + + //Pre-game setup + var scn = GetScenario(); + + var card = scn.GetFreepsCard("talent1"); + + assertFalse(card.getBlueprint().isUnique()); + assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide()); + assertEquals(Culture.SHIRE, card.getBlueprint().getCulture()); + assertEquals(CardType.CONDITION, card.getBlueprint().getCardType()); + assertFalse(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); + assertEquals(0, card.getBlueprint().getTwilightCost()); + } + + @Test + public void TalentExertsAndPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + var frodo = scn.GetRingBearer(); + var sam = scn.GetFreepsCard("sam"); + var merry = scn.GetFreepsCard("merry"); + var pippin = scn.GetFreepsCard("pippin"); + var talent1 = scn.GetFreepsCard("talent1"); + var talent2 = scn.GetFreepsCard("talent2"); + + scn.FreepsMoveCardToHand(talent1,talent2, sam, merry, pippin); + + scn.StartGame(); + + assertFalse(scn.FreepsPlayAvailable(talent1)); + scn.FreepsPlayCard(sam); + assertFalse(scn.FreepsPlayAvailable(talent1)); + + scn.FreepsPlayCard(merry); + assertTrue(scn.FreepsPlayAvailable(talent1)); + assertEquals(0, scn.GetWoundsOn(merry)); + scn.FreepsPlayCard(talent1); + assertEquals(1, scn.GetWoundsOn(merry)); + assertSame(merry, talent1.getAttachedTo()); + + scn.FreepsPlayCard(pippin); + scn.FreepsPlayCard(talent2); + + //There are 4 companions in play, but only 2 valid targets for the exert + assertEquals(2, scn.GetFreepsCardChoiceCount()); + scn.FreepsChooseCard(merry); + + //plays automatically on pippin, since merry is already bearing one + assertEquals(2, scn.GetWoundsOn(merry)); + assertEquals(0, scn.GetWoundsOn(pippin)); + assertSame(pippin, talent2.getAttachedTo()); + } + + + @Test + public void TalentReducesShadowBy1() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTestHelper scn = GetScenario(); + + var frodo = scn.GetRingBearer(); + var merry = scn.GetFreepsCard("merry"); + var talent1 = scn.GetFreepsCard("talent1"); + + scn.FreepsMoveCharToTable(merry); + scn.FreepsAttachCardsTo(merry, talent1); + + scn.StartGame(); + scn.FreepsPassCurrentPhaseAction(); + + // 2 for Frodo/Merry, 2 for the site, -1 for Talent + assertEquals(3, scn.GetTwilight()); + + } +} diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.old b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.old deleted file mode 100644 index 09558070b..000000000 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/set01/Card_01_316_ErrataTests.java.old +++ /dev/null @@ -1,108 +0,0 @@ -package com.gempukku.lotro.cards.unofficial.pc.errata.set01; - -import com.gempukku.lotro.cards.GenericCardTestHelper; -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 org.junit.Test; - -import java.util.HashMap; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class Card_01_316_ErrataTests -{ - protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException { - return new GenericCardTestHelper( - new HashMap<>() {{ - put("talent", "51_316"); - put("sam", "1_311"); - put("merry", "1_302"); - put("pippin", "1_307"); - put("boromir", "1_97"); - }} - ); - } - - @Test - public void TalentStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException { - - /** - * Set: 1E - * Title: A Talent for Not Being Seen - * Side: Free Peoples - * Culture: Shire - * Twilight Cost: 0 - * Type: Condition - * Errata Game Text: Stealth. Bearer must be Merry or Pippin. Limit 1 per character. - * Each site's Shadow number is -1. - */ - - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); - - var talent = scn.GetFreepsCard("talent"); - - assertFalse(talent.getBlueprint().isUnique()); - assertEquals(Side.FREE_PEOPLE, talent.getBlueprint().getSide()); - assertEquals(Culture.SHIRE, talent.getBlueprint().getCulture()); - assertEquals(CardType.CONDITION, talent.getBlueprint().getCardType()); - assertEquals(0, talent.getBlueprint().getTwilightCost()); - - assertTrue(scn.HasKeyword(talent, Keyword.STEALTH)); - assertFalse(scn.HasKeyword(talent, Keyword.SUPPORT_AREA)); - } - - @Test - public void TalentOnlyPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException { - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); - - PhysicalCardImpl frodo = scn.GetRingBearer(); - PhysicalCardImpl sam = scn.GetFreepsCard("sam"); - PhysicalCardImpl merry = scn.GetFreepsCard("merry"); - PhysicalCardImpl pippin = scn.GetFreepsCard("pippin"); - PhysicalCardImpl talent = scn.GetFreepsCard("talent"); - - scn.FreepsMoveCharToTable(sam); - scn.FreepsMoveCharToTable(merry); - scn.FreepsMoveCharToTable(pippin); - scn.FreepsMoveCardToHand(talent); - - scn.StartGame(); - - scn.FreepsPlayCard(talent); - - //There are 4 companions in play, but only 2 valid targets - assertEquals(2, scn.FreepsGetADParamAsList("cardId").size()); - } - - - @Test - public void TalentReducesTwilightIfOnlyHobbits() throws DecisionResultInvalidException, CardNotFoundException { - //Pre-game setup - GenericCardTestHelper scn = GetScenario(); - - PhysicalCardImpl frodo = scn.GetRingBearer(); - PhysicalCardImpl merry = scn.GetFreepsCard("merry"); - PhysicalCardImpl talent = scn.GetFreepsCard("talent"); - - scn.FreepsMoveCharToTable(merry); - scn.FreepsMoveCardToHand(talent); - - scn.StartGame(); - - scn.FreepsPlayCard(talent); - scn.FreepsPassCurrentPhaseAction(); - - // 2 for Frodo/Merry, 1 for the site, -1 for Talent - assertEquals(2, scn.GetTwilight()); - - } - - - -}