Finished Sauron V1 unit test additions (no revamps). Minor adjustments to past unit tests. Added CanMove requirement.

This commit is contained in:
Christian 'ketura' McCarty
2022-07-26 22:25:20 -05:00
parent 689cb6c224
commit 4035093c90
13 changed files with 616 additions and 148 deletions

View File

@@ -42,7 +42,7 @@
"type": "activatedTrigger",
"trigger": {
"type": "abouttodiscard",
"filter": "another,culture(sauron),condition"
"filter": "culture(sauron),condition"
},
"cost": {
"type": "removeburdens",

View File

@@ -0,0 +1,21 @@
package com.gempukku.lotro.cards.build.field.effect.requirement;
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
import com.gempukku.lotro.cards.build.PlayerSource;
import com.gempukku.lotro.cards.build.Requirement;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.PlayerResolver;
import com.gempukku.lotro.logic.timing.PlayConditions;
import org.json.simple.JSONObject;
public class CanMove implements RequirementProducer {
@Override
public Requirement getPlayRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(object);
return (actionContext) -> {
return PlayConditions.canMove(actionContext.getGame());
};
}
}

View File

@@ -15,6 +15,7 @@ public class RequirementFactory {
public RequirementFactory() {
requirementProducers.put("not", new NotRequirementProducer());
requirementProducers.put("or", new OrRequirementProducer());
requirementProducers.put("canmove", new CanMove());
requirementProducers.put("canspot", new CanSpot());
requirementProducers.put("canspotburdens", new CanSpotBurdens());
requirementProducers.put("canspotindeadpile", new CanSpotInDeadPile());

View File

@@ -408,6 +408,10 @@ public class PlayConditions {
return Filters.findFirstActive(game, Filters.siteControlled(playerId)) != null;
}
public static boolean canMove(LotroGame game) {
return game.getGameState().getMoveCount() < game.getModifiersQuerying().getMoveLimit(game, 2);
}
public static boolean canRemoveAnyCultureTokens(LotroGame game, int count, Filterable... fromFilters) {
return !game.getModifiersQuerying().hasFlagActive(game, ModifierFlag.CANT_TOUCH_CULTURE_TOKENS)
&& Filters.countActive(game, Filters.and(fromFilters, Filters.hasAnyCultureTokens(count))) > 0;

View File

@@ -54,6 +54,7 @@ public class GenericCardTestHelper extends AbstractAtTest {
public static final String FOTRFrodo = "1_290";
public static final String GimliRB = "9_4";
public static final String FOTRRing = "1_2";
public static final String GreatRing = "19_1";
private final FilterFactory FilterFactory = new FilterFactory();
private final CardGenerationEnvironment Environment = new LotroCardBlueprintBuilder();
@@ -487,7 +488,9 @@ public class GenericCardTestHelper extends AbstractAtTest {
public int GetTwilight() { return _game.getGameState().getTwilightPool(); }
public void SetTwilight(int amount) { _game.getGameState().setTwilight(amount); }
public int GetMoveLimit() { return _game.getGameState().getMoveCount(); }
public int GetMoveLimit() { return _game.getModifiersQuerying().getMoveLimit(_game, 2); }
public int GetMoveCount() { return _game.getGameState().getMoveCount(); }
public PhysicalCardImpl GetRingBearer() { return (PhysicalCardImpl)_game.getGameState().getRingBearer(P1); }
@@ -721,7 +724,9 @@ public class GenericCardTestHelper extends AbstractAtTest {
public void ShadowChooseMultipleChoiceOption(String option) throws DecisionResultInvalidException { ChooseMultipleChoiceOption(P2, option); }
public void ChooseMultipleChoiceOption(String playerID, String option) throws DecisionResultInvalidException { ChooseAction(playerID, "results", option); }
public void FreepsChooseAction(String paramName, String option) throws DecisionResultInvalidException { ChooseAction(P1, paramName, option); }
public void FreepsChooseAction(String option) throws DecisionResultInvalidException { ChooseAction(P1, "actionText", option); }
public void ShadowChooseAction(String paramName, String option) throws DecisionResultInvalidException { ChooseAction(P2, paramName, option); }
public void ShadowChooseAction(String option) throws DecisionResultInvalidException { ChooseAction(P2, "actionText", option); }
public void ChooseAction(String playerID, String paramName, String option) throws DecisionResultInvalidException {
List<String> choices = GetADParamAsList(playerID, paramName);
for(String choice : choices){

View File

@@ -125,6 +125,7 @@ public class Card_V1_024_Tests
assertEquals("Exert Aragorn", choices[0]);
assertEquals("Discard You Have My Sword", choices[1]);
assertEquals(0, scn.GetWoundsOn(aragorn));
scn.FreepsChooseMultipleChoiceOption("Exert");
assertEquals(1, scn.GetWoundsOn(aragorn));

View File

@@ -76,7 +76,7 @@ public class Card_V1_042_Tests
}
@Test
public void EachTwigulSkirmishVictory() throws DecisionResultInvalidException, CardNotFoundException {
public void EachTwigulSkirmishVictoryShufflesARingwraithCard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();

View File

@@ -22,8 +22,13 @@ public class Card_V1_044_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_44");
// put other cards in here as needed for the test case
put("fell", "151_44");
put("orc", "1_270");
put("scond", "1_242");
put("runner", "1_178");
put("fcond", "1_100");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +36,7 @@ public class Card_V1_044_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void FelltoItsPowerStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -50,34 +53,95 @@ public class Card_V1_044_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl fell = scn.GetFreepsCard("fell");
assertFalse(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.EVENT, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
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
assertFalse(fell.getBlueprint().isUnique());
assertEquals(Side.SHADOW, fell.getBlueprint().getSide());
assertEquals(Culture.SAURON, fell.getBlueprint().getCulture());
assertEquals(CardType.EVENT, fell.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, fell.getBlueprint().getRace());
assertTrue(scn.HasKeyword(fell, Keyword.REGROUP)); // test for keywords as needed
assertEquals(1, fell.getBlueprint().getTwilightCost());
//assertEquals(, fell.getBlueprint().getStrength());
//assertEquals(, fell.getBlueprint().getVitality());
//assertEquals(, fell.getBlueprint().getResistance());
//assertEquals(Signet., fell.getBlueprint().getSignet());
//assertEquals(, fell.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void FelltoItsPowerTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void FellDiscardsAnOrcToAddABurden() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl fell = scn.GetShadowCard("fell");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCharToTable(orc);
scn.ShadowMoveCardToHand(fell);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(1, scn.GetTwilight());
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertEquals(1, scn.GetBurdens()); // 1 from bidding
assertEquals(Zone.SHADOW_CHARACTERS, orc.getZone());
assertTrue(scn.ShadowCardPlayAvailable(fell));
scn.ShadowPlayCard(fell);
assertEquals(2, scn.GetBurdens());
assertEquals(Zone.DISCARD, orc.getZone());
}
@Test
public void FellRequiresASauronOrcToPlay() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl fell = scn.GetShadowCard("fell");
PhysicalCardImpl runner = scn.GetShadowCard("runner");
scn.ShadowMoveCharToTable(runner);
scn.ShadowMoveCardToHand(fell);
scn.StartGame();
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertFalse(scn.ShadowCardPlayAvailable(fell));
}
@Test
public void FreepsCanDiscardAFreepsConditionToPrevent() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl fell = scn.GetShadowCard("fell");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
PhysicalCardImpl scond = scn.GetShadowCard("scond");
scn.ShadowMoveCharToTable(orc);
scn.ShadowMoveCardToSupportArea(scond);
scn.ShadowMoveCardToHand(fell);
PhysicalCardImpl fcond = scn.GetFreepsCard("fcond");
scn.FreepsMoveCardToSupportArea(fcond);
scn.StartGame();
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertEquals(1, scn.GetBurdens()); // 1 from bidding
assertEquals(Zone.SUPPORT, fcond.getZone());
assertEquals(Zone.SUPPORT, scond.getZone());
scn.ShadowPlayCard(fell);
assertTrue(scn.FreepsDecisionAvailable("Would you like to discard a Free Peoples condition to prevent adding a burden"));
scn.FreepsChooseYes();
assertEquals(1, scn.GetBurdens());
assertEquals(Zone.DISCARD, fcond.getZone());
assertEquals(Zone.SUPPORT, scond.getZone());
assertEquals(Zone.DISCARD, orc.getZone());
}
}

View File

@@ -22,8 +22,14 @@ public class Card_V1_045_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_45");
// put other cards in here as needed for the test case
put("gaze", "151_45");
put("cond", "1_242");
put("selfdiscard", "7_268");
put("orc", "1_270");
put("gandalf", "1_72");
put("sleep", "1_84");
put("introspection", "12_29");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +37,7 @@ public class Card_V1_045_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void GazeoftheEyeStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -50,34 +54,169 @@ public class Card_V1_045_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl gaze = scn.GetFreepsCard("gaze");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
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
assertTrue(gaze.getBlueprint().isUnique());
assertEquals(Side.SHADOW, gaze.getBlueprint().getSide());
assertEquals(Culture.SAURON, gaze.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, gaze.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, gaze.getBlueprint().getRace());
assertTrue(scn.HasKeyword(gaze, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, gaze.getBlueprint().getTwilightCost());
//assertEquals(, gaze.getBlueprint().getStrength());
//assertEquals(, gaze.getBlueprint().getVitality());
//assertEquals(, gaze.getBlueprint().getResistance());
//assertEquals(Signet., gaze.getBlueprint().getSignet());
//assertEquals(, gaze.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void GazeoftheEyeTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void GazeProtectsNothingWithNoBurdens() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl gaze = scn.GetShadowCard("gaze");
PhysicalCardImpl cond = scn.GetShadowCard("cond");
scn.ShadowMoveCardToSupportArea(gaze, cond);
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
PhysicalCardImpl sleep1 = scn.GetFreepsCard("sleep");
scn.FreepsMoveCharToTable(gandalf);
scn.FreepsMoveCardToHand(sleep1);
scn.StartGame();
scn.FreepsPlayCard(card);
scn.RemoveBurdens(1); // to compensate for the starting bid burden
scn.FreepsPlayCard(sleep1);
assertFalse(scn.ShadowHasOptionalTriggerAvailable());
}
@Test
public void GazeProtectsOtherConditions() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl gaze = scn.GetShadowCard("gaze");
PhysicalCardImpl cond = scn.GetShadowCard("cond");
scn.ShadowMoveCardToSupportArea(gaze, cond);
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
PhysicalCardImpl introspection = scn.GetFreepsCard("introspection");
scn.FreepsMoveCharToTable(gandalf);
scn.FreepsMoveCardToHand(introspection);
scn.StartGame();
scn.FreepsPlayCard(introspection);
//scn.ShadowDeclineOptionalTrigger();
scn.ShadowChooseCard(cond);
assertEquals(1, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(0, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
}
@Test
public void GazeProtectsSelf() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl gaze = scn.GetShadowCard("gaze");
PhysicalCardImpl cond = scn.GetShadowCard("cond");
scn.ShadowMoveCardToSupportArea(gaze, cond);
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
PhysicalCardImpl introspection = scn.GetFreepsCard("introspection");
scn.FreepsMoveCharToTable(gandalf);
scn.FreepsMoveCardToHand(introspection);
scn.StartGame();
scn.FreepsPlayCard(introspection);
//scn.ShadowDeclineOptionalTrigger();
scn.ShadowChooseCard(gaze);
assertEquals(1, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(0, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
}
@Test
public void GazeProtectsAgainstNukeWithEnoughBurdens() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl gaze = scn.GetShadowCard("gaze");
PhysicalCardImpl cond = scn.GetShadowCard("cond");
scn.ShadowMoveCardToSupportArea(gaze, cond);
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
PhysicalCardImpl sleep = scn.GetFreepsCard("sleep");
scn.FreepsMoveCharToTable(gandalf);
scn.FreepsMoveCardToHand(sleep);
scn.StartGame();
scn.AddBurdens(1);
scn.FreepsPlayCard(sleep);
//scn.ShadowDeclineOptionalTrigger();
assertEquals(2, scn.GetBurdens());
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
scn.ShadowChooseCard(gaze);
assertEquals(1, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(0, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, cond.getZone());
assertEquals(Zone.SUPPORT, gaze.getZone());
}
@Test
public void GazeProtectsAgainstSelfDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl gaze = scn.GetShadowCard("gaze");
PhysicalCardImpl selfdiscard = scn.GetShadowCard("selfdiscard");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCharToTable(orc);
scn.ShadowMoveCardToSupportArea(gaze,selfdiscard);
scn.StartGame();
scn.SkipToPhase(Phase.REGROUP);
assertEquals(1, scn.GetBurdens());
assertEquals(Zone.SUPPORT, selfdiscard.getZone());
scn.FreepsPassCurrentPhaseAction();
scn.ShadowUseCardAction(selfdiscard);
assertTrue(scn.ShadowHasOptionalTriggerAvailable());
scn.ShadowAcceptOptionalTrigger();
assertEquals(0, scn.GetBurdens()); // from initial starting bid
assertEquals(Zone.SUPPORT, selfdiscard.getZone());
assertEquals(1, scn.GetTwilight());
}
}

View File

@@ -22,18 +22,17 @@ public class Card_V1_046_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_46");
// put other cards in here as needed for the test case
put("iseeyou", "151_46");
put("orc", "1_271");
put("orc2", "1_271");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
GenericCardTestHelper.GreatRing
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void ISeeYouStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -52,34 +51,104 @@ public class Card_V1_046_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl iseeyou = scn.GetFreepsCard("iseeyou");
assertFalse(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
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
assertFalse(iseeyou.getBlueprint().isUnique());
assertEquals(Side.SHADOW, iseeyou.getBlueprint().getSide());
assertEquals(Culture.SAURON, iseeyou.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, iseeyou.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, iseeyou.getBlueprint().getRace());
assertTrue(scn.HasKeyword(iseeyou, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(0, iseeyou.getBlueprint().getTwilightCost());
//assertEquals(, iseeyou.getBlueprint().getStrength());
//assertEquals(, iseeyou.getBlueprint().getVitality());
//assertEquals(, iseeyou.getBlueprint().getResistance());
//assertEquals(Signet., iseeyou.getBlueprint().getSignet());
//assertEquals(, iseeyou.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void ISeeYouTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void SiteNumberIsReducedPerBurden() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl iseeyou = scn.GetShadowCard("iseeyou");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
PhysicalCardImpl orc2 = scn.GetShadowCard("orc2");
scn.ShadowMoveCardToSupportArea(iseeyou);
scn.ShadowMoveCharToTable(orc);
scn.ShadowMoveCardToHand(orc2);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(0, scn.GetTwilight());
scn.RemoveBurdens(1);
assertEquals(6, scn.GetSiteNumber(orc));
scn.AddBurdens(1);
assertEquals(5, scn.GetSiteNumber(orc));
scn.AddBurdens(1);
assertEquals(4, scn.GetSiteNumber(orc));
scn.AddBurdens(1);
assertEquals(3, scn.GetSiteNumber(orc));
scn.AddBurdens(1);
assertEquals(2, scn.GetSiteNumber(orc));
scn.FreepsPassCurrentPhaseAction();
assertEquals(3, scn.GetTwilight()); // 1 from comp, 2 from site, not enough to play soldier normally
assertTrue(scn.ShadowCardPlayAvailable(orc2)); //home site reduced to 2, doesn't pay roaming and so can play
}
@Test
public void SauronMinionsWithSiteNumber1OrLessAreStrengthPlus1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl iseeyou = scn.GetShadowCard("iseeyou");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCardToSupportArea(iseeyou);
scn.ShadowMoveCharToTable(orc);
scn.StartGame();
scn.RemoveBurdens(1);
assertEquals(7, scn.GetStrength(orc)); // site 6
scn.AddBurdens(1);
assertEquals(7, scn.GetStrength(orc)); // site 5
scn.AddBurdens(1);
assertEquals(7, scn.GetStrength(orc)); // site 4
scn.AddBurdens(1);
assertEquals(7, scn.GetStrength(orc)); // site 3
scn.AddBurdens(1);
assertEquals(7, scn.GetStrength(orc)); // site 2
scn.AddBurdens(1);
assertEquals(8, scn.GetStrength(orc)); // site 1, +1 str
scn.AddBurdens(1);
assertEquals(8, scn.GetStrength(orc)); // site 0, +1 str
scn.AddBurdens(1);
assertEquals(8, scn.GetStrength(orc)); // site -1 (rounds to 0), +1 str
}
@Test
public void DiscardsWhenRingRemoved() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl iseeyou = scn.GetShadowCard("iseeyou");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCardToSupportArea(iseeyou);
scn.ShadowMoveCharToTable(orc);
PhysicalCardImpl ring = scn.GetFreepsCard(GenericCardTestHelper.GreatRing);
scn.StartGame();
scn.SkipToPhase(Phase.MANEUVER);
scn.FreepsChooseAction("The One Ring");
assertEquals(Zone.SUPPORT, iseeyou.getZone());
scn.SkipToPhase(Phase.REGROUP); // great ring automatically removes itself
assertEquals(Zone.DISCARD, iseeyou.getZone());
}
}

View File

@@ -22,8 +22,8 @@ public class Card_V1_047_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_47");
// put other cards in here as needed for the test case
put("betrayed", "151_47");
put("orc", "1_271");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +31,7 @@ public class Card_V1_047_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void ItBetrayedIsildurStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -50,34 +48,124 @@ public class Card_V1_047_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl betrayed = scn.GetFreepsCard("betrayed");
assertFalse(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.EVENT, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
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
assertFalse(betrayed.getBlueprint().isUnique());
assertEquals(Side.SHADOW, betrayed.getBlueprint().getSide());
assertEquals(Culture.SAURON, betrayed.getBlueprint().getCulture());
assertEquals(CardType.EVENT, betrayed.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, betrayed.getBlueprint().getRace());
assertTrue(scn.HasKeyword(betrayed, Keyword.REGROUP)); // test for keywords as needed
assertEquals(1, betrayed.getBlueprint().getTwilightCost());
//assertEquals(, betrayed.getBlueprint().getStrength());
//assertEquals(, betrayed.getBlueprint().getVitality());
//assertEquals(, betrayed.getBlueprint().getResistance());
//assertEquals(Signet., betrayed.getBlueprint().getSignet());
//assertEquals(, betrayed.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void ItBetrayedIsildurTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void RequiresASauronOrcAndFiveBurdens() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl betrayed = scn.GetShadowCard("betrayed");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCardToHand(betrayed, orc);
//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(card);
assertEquals(1, scn.GetTwilight());
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertFalse(scn.ShadowCardPlayAvailable(betrayed));
scn.ShadowPassCurrentPhaseAction();
scn.ShadowDeclineReconciliation();
scn.FreepsChooseToMove();
scn.AddBurdens(4); // Now at 5 with the starting bid
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertFalse(scn.ShadowCardPlayAvailable(betrayed));
scn.ShadowPassCurrentPhaseAction();
scn.ShadowDeclineReconciliation();
scn.FreepsChooseToMove();
scn.ShadowMoveCharToTable(orc);
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertTrue(scn.ShadowCardPlayAvailable(betrayed));
}
@Test
public void DiscardsOrcToMakeMoveLimitMinus1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl betrayed = scn.GetShadowCard("betrayed");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCardToHand(betrayed);
scn.ShadowMoveCharToTable(orc);
scn.StartGame();
scn.AddBurdens(4); // Now at 5 with the starting bid
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertEquals(2, scn.GetMoveLimit()); // 2 moves: 1 in fellowship, 1 in regroup
assertTrue(scn.ShadowCardPlayAvailable(betrayed));
assertEquals(Zone.SHADOW_CHARACTERS, orc.getZone());
scn.ShadowPlayCard(betrayed);
assertTrue(scn.ShadowDecisionAvailable("choose"));
scn.ShadowChooseMultipleChoiceOption("move limit -1");
assertEquals(1, scn.GetMoveLimit());
assertEquals(Zone.DISCARD, orc.getZone());
scn.PassCurrentPhaseActions();
// Move prompt entirely skipped
assertEquals(Phase.FELLOWSHIP, scn.GetCurrentPhase());
}
@Test
public void DiscardsOrcToForceMovementIfAllowed() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl betrayed = scn.GetShadowCard("betrayed");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
scn.ShadowMoveCardToHand(betrayed);
scn.ShadowMoveCharToTable(orc);
scn.StartGame();
scn.AddBurdens(4); // Now at 5 with the starting bid
scn.SkipToPhase(Phase.REGROUP);
scn.FreepsPassCurrentPhaseAction();
assertEquals(2, scn.GetMoveLimit()); // 2 moves: 1 in fellowship, 1 in regroup
assertTrue(scn.ShadowCardPlayAvailable(betrayed));
assertEquals(Zone.SHADOW_CHARACTERS, orc.getZone());
scn.ShadowPlayCard(betrayed);
assertTrue(scn.ShadowDecisionAvailable("choose"));
scn.ShadowChooseMultipleChoiceOption("move again");
assertEquals(2, scn.GetMoveLimit());
assertEquals(Zone.DISCARD, orc.getZone());
scn.PassCurrentPhaseActions();
// Move prompt entirely skipped
assertEquals(Phase.SHADOW, scn.GetCurrentPhase());
}
}

View File

@@ -6,6 +6,7 @@ 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.effects.choose.ChooseAndPutCardFromDiscardOnBottomOfDeckEffect;
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
import org.junit.Test;
@@ -22,8 +23,9 @@ public class Card_V1_048_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_48");
// put other cards in here as needed for the test case
put("troop", "151_48");
put("guard1", "1_7");
put("guard2", "1_7");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +33,7 @@ public class Card_V1_048_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void OrcAmbushTroopStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -55,34 +55,58 @@ public class Card_V1_048_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl troop = scn.GetFreepsCard("troop");
assertFalse(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.MINION, card.getBlueprint().getCardType());
assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(3, card.getBlueprint().getTwilightCost());
assertEquals(8, card.getBlueprint().getStrength());
assertEquals(2, card.getBlueprint().getVitality());
//assertEquals(, card.getBlueprint().getResistance());
//assertEquals(Signet., card.getBlueprint().getSignet());
assertEquals(6, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
assertFalse(troop.getBlueprint().isUnique());
assertEquals(Side.SHADOW, troop.getBlueprint().getSide());
assertEquals(Culture.SAURON, troop.getBlueprint().getCulture());
assertEquals(CardType.MINION, troop.getBlueprint().getCardType());
assertEquals(Race.ORC, troop.getBlueprint().getRace());
assertTrue(scn.HasKeyword(troop, Keyword.TRACKER)); // test for keywords as needed
assertEquals(3, troop.getBlueprint().getTwilightCost());
assertEquals(8, troop.getBlueprint().getStrength());
assertEquals(2, troop.getBlueprint().getVitality());
//assertEquals(, troop.getBlueprint().getResistance());
//assertEquals(Signet., troop.getBlueprint().getSignet());
assertEquals(6, troop.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void OrcAmbushTroopTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void TroopIsArcherIfOneExhaustedCompanion() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl troop = scn.GetShadowCard("troop");
scn.ShadowMoveCharToTable(troop);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(3, scn.GetTwilight());
assertFalse(scn.HasKeyword(troop, Keyword.ARCHER));
scn.AddWoundsToChar(scn.GetRingBearer(), 3);
assertTrue(scn.HasKeyword(troop, Keyword.ARCHER));
}
@Test
public void TroopIsStrengthPlus3IfThreeExhaustedCompanions() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl troop = scn.GetShadowCard("troop");
scn.ShadowMoveCharToTable(troop);
PhysicalCardImpl guard1 = scn.GetFreepsCard("guard1");
PhysicalCardImpl guard2 = scn.GetFreepsCard("guard2");
scn.FreepsMoveCharToTable(guard1, guard2);
scn.StartGame();
assertEquals(8, scn.GetStrength(troop));
scn.AddWoundsToChar(scn.GetRingBearer(), 3);
assertEquals(8, scn.GetStrength(troop));
scn.AddWoundsToChar(guard1, 1);
assertEquals(8, scn.GetStrength(troop));
scn.AddWoundsToChar(guard2, 1);
assertEquals(11, scn.GetStrength(troop));
}
}

View File

@@ -22,8 +22,10 @@ public class Card_V1_049_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_49");
// put other cards in here as needed for the test case
put("past", "151_49");
put("orc", "1_271");
put("runner", "1_178");
put("troll", "8_102");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +33,7 @@ public class Card_V1_049_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void AShadowofthePastStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -52,34 +52,86 @@ public class Card_V1_049_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl past = scn.GetFreepsCard("past");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
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
assertTrue(past.getBlueprint().isUnique());
assertEquals(Side.SHADOW, past.getBlueprint().getSide());
assertEquals(Culture.SAURON, past.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, past.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, past.getBlueprint().getRace());
assertTrue(scn.HasKeyword(past, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, past.getBlueprint().getTwilightCost());
//assertEquals(, past.getBlueprint().getStrength());
//assertEquals(, past.getBlueprint().getVitality());
//assertEquals(, past.getBlueprint().getResistance());
//assertEquals(Signet., past.getBlueprint().getSignet());
//assertEquals(, past.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void AShadowofthePastTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void FourBurdensMakesSauronOrcsFierce() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl past = scn.GetShadowCard("past");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
PhysicalCardImpl runner = scn.GetShadowCard("runner");
PhysicalCardImpl troll = scn.GetShadowCard("troll");
scn.ShadowMoveCardToSupportArea(past);
scn.ShadowMoveCharToTable(orc, runner, troll);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(1, scn.GetTwilight());
assertFalse(scn.HasKeyword(orc, Keyword.FIERCE));
assertFalse(scn.HasKeyword(runner, Keyword.FIERCE));
scn.AddBurdens(3); // 4 with the initial starting bid
assertTrue(scn.HasKeyword(orc, Keyword.FIERCE));
assertFalse(scn.HasKeyword(runner, Keyword.FIERCE));
}
@Test
public void SixBurdensMakesSauronOrcsDamagePlusOne() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl past = scn.GetShadowCard("past");
PhysicalCardImpl orc = scn.GetShadowCard("orc");
PhysicalCardImpl runner = scn.GetShadowCard("runner");
PhysicalCardImpl troll = scn.GetShadowCard("troll");
scn.ShadowMoveCardToSupportArea(past);
scn.ShadowMoveCharToTable(orc, runner, troll);
scn.StartGame();
assertFalse(scn.HasKeyword(orc, Keyword.DAMAGE));
assertFalse(scn.HasKeyword(runner, Keyword.DAMAGE));
assertFalse(scn.HasKeyword(troll, Keyword.DAMAGE));
scn.AddBurdens(5); // 6 with the initial starting bid
assertTrue(scn.HasKeyword(orc, Keyword.DAMAGE));
assertEquals(1, scn.GetKeywordCount(orc, Keyword.DAMAGE));
assertFalse(scn.HasKeyword(runner, Keyword.DAMAGE));
assertFalse(scn.HasKeyword(troll, Keyword.DAMAGE));
}
@Test
public void SelfDiscardsInRegroup() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl past = scn.GetShadowCard("past");
scn.ShadowMoveCardToSupportArea(past);
scn.StartGame();
assertEquals(Zone.SUPPORT, past.getZone());
scn.SkipToPhase(Phase.REGROUP);
assertEquals(Zone.DISCARD, past.getZone());
}
}