Added tests for half the nazgul V1 cards. Added CancelKeywordBonusFrom and performed minor tweaks to the function signatures of related modifiers.
This commit is contained in:
@@ -9,9 +9,22 @@
|
|||||||
"effects": {
|
"effects": {
|
||||||
"type": "event",
|
"type": "event",
|
||||||
"effect": {
|
"effect": {
|
||||||
"type": "playCardFromDiscard",
|
"type": "choice",
|
||||||
"filter": "choose(culture(wraith),item)"
|
"texts": [
|
||||||
},
|
"Play a {wraith} item from your draw deck",
|
||||||
|
"Play a {wraith} item from your discard pile"
|
||||||
|
],
|
||||||
|
"effects": [
|
||||||
|
{
|
||||||
|
"type": "playCardFromDrawDeck",
|
||||||
|
"filter": "choose(culture(wraith),item)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "playCardFromDiscard",
|
||||||
|
"filter": "choose(culture(wraith),item)",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -35,12 +48,19 @@
|
|||||||
"amount": -1
|
"amount": -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "modifier",
|
"type": "activated",
|
||||||
"modifier": {
|
"phase": "assignment",
|
||||||
"type": "cantBeAssignedToSkirmishAgainst",
|
"condition": {
|
||||||
"fpCharacter": "companion,strengthLessThan(5)",
|
"type": "canSpot",
|
||||||
"minion": "self"
|
"filter": "companion,strengthMoreThan(4)",
|
||||||
|
"count": 1
|
||||||
|
},
|
||||||
|
"effect": {
|
||||||
|
"type": "assignFpCharacterToSkirmish",
|
||||||
|
"player": "fp",
|
||||||
|
"fpCharacter": "choose(companion,strengthMoreThan(4))",
|
||||||
|
"against": "self"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -53,32 +73,50 @@
|
|||||||
"cost": 1,
|
"cost": 1,
|
||||||
"type": "artifact",
|
"type": "artifact",
|
||||||
"possession": "helm",
|
"possession": "helm",
|
||||||
"target": "twilight,nazgul",
|
"keyword": "support area",
|
||||||
"vitality": 1,
|
"vitality": 1,
|
||||||
"effects": [
|
"effects": [
|
||||||
{
|
{
|
||||||
"type": "modifier",
|
"type": "modifier",
|
||||||
"modifier": {
|
"modifier": {
|
||||||
"type": "addKeyword",
|
"type": "cancelkeywordbonusfrom",
|
||||||
"filter": "dwarf",
|
"filter": "inSkirmishAgainst(bearer)",
|
||||||
"keyword": "damage+1"
|
"from": "attachedTo(inSkirmishAgainst(bearer))",
|
||||||
|
"keyword": "damage",
|
||||||
|
"condition": {
|
||||||
|
"type": "canSpot",
|
||||||
|
"filter": "bearer,twilight"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "modifier",
|
||||||
|
"modifier": {
|
||||||
|
"type": "cancelstrengthbonusfrom",
|
||||||
|
"filter": "attachedTo(inSkirmishAgainst(bearer))",
|
||||||
|
"condition": {
|
||||||
|
"type": "canSpot",
|
||||||
|
"filter": "bearer,twilight"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"type": "activated",
|
"type": "activated",
|
||||||
"phase": "skirmish",
|
"phase": "skirmish",
|
||||||
|
|
||||||
"condition": {
|
|
||||||
"type": "canspot",
|
|
||||||
"filter": "ring bearer,exhausted"
|
|
||||||
},
|
|
||||||
"cost": {
|
"cost": {
|
||||||
"type": "exert",
|
"type": "removeTwilight",
|
||||||
"filter": "bearer"
|
"amount": 1
|
||||||
},
|
},
|
||||||
"effect": {
|
"condition": {
|
||||||
"type": "putonring"
|
"type": "canSpot",
|
||||||
}
|
"filter": "self,zone(support)"
|
||||||
|
},
|
||||||
|
"effect": {
|
||||||
|
"type": "transfer",
|
||||||
|
"filter": "choose(self,zone(support))",
|
||||||
|
"where": "choose(nazgul,not(hasAttached(helm)))"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -216,6 +216,11 @@ public class FilterFactory {
|
|||||||
int amount = Integer.parseInt(parameter);
|
int amount = Integer.parseInt(parameter);
|
||||||
return (actionContext) -> Filters.lessStrengthThan(amount);
|
return (actionContext) -> Filters.lessStrengthThan(amount);
|
||||||
});
|
});
|
||||||
|
parameterFilters.put("strengthMoreThan",
|
||||||
|
(parameter, environment) -> {
|
||||||
|
int amount = Integer.parseInt(parameter);
|
||||||
|
return (actionContext) -> Filters.moreStrengthThan(amount);
|
||||||
|
});
|
||||||
parameterFilters.put("vitalityMoreThan",
|
parameterFilters.put("vitalityMoreThan",
|
||||||
(parameter, environment) -> {
|
(parameter, environment) -> {
|
||||||
int amount = Integer.parseInt(parameter);
|
int amount = Integer.parseInt(parameter);
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.gempukku.lotro.cards.build.field.effect.modifier;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.cards.build.*;
|
||||||
|
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||||
|
import com.gempukku.lotro.common.Keyword;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.CancelKeywordBonusTargetModifier;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.RemoveKeywordModifier;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
|
||||||
|
public class CancelKeywordBonusFrom implements ModifierSourceProducer {
|
||||||
|
@Override
|
||||||
|
public ModifierSource getModifierSource(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||||
|
FieldUtils.validateAllowedFields(object, "filter", "from", "condition", "keyword");
|
||||||
|
|
||||||
|
final JSONObject[] conditionArray = FieldUtils.getObjectArray(object.get("condition"), "condition");
|
||||||
|
final String filter = FieldUtils.getString(object.get("filter"), "filter");
|
||||||
|
final String from = FieldUtils.getString(object.get("from"), "from");
|
||||||
|
|
||||||
|
Keyword keyword = FieldUtils.getEnum(Keyword.class, object.get("keyword"), "keyword");
|
||||||
|
|
||||||
|
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||||
|
final FilterableSource fromFilterableSource = environment.getFilterFactory().generateFilter(from, environment);
|
||||||
|
final Requirement[] requirements = environment.getRequirementFactory().getRequirements(conditionArray, environment);
|
||||||
|
|
||||||
|
return new ModifierSource() {
|
||||||
|
@Override
|
||||||
|
public Modifier getModifier(ActionContext actionContext) {
|
||||||
|
return new CancelKeywordBonusTargetModifier(actionContext.getSource(), keyword,
|
||||||
|
new RequirementCondition(requirements, actionContext),
|
||||||
|
filterableSource.getFilterable(actionContext),
|
||||||
|
fromFilterableSource.getFilterable(actionContext));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,16 +9,19 @@ import org.json.simple.JSONObject;
|
|||||||
public class CancelStrengthBonusFrom implements ModifierSourceProducer {
|
public class CancelStrengthBonusFrom implements ModifierSourceProducer {
|
||||||
@Override
|
@Override
|
||||||
public ModifierSource getModifierSource(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
public ModifierSource getModifierSource(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||||
FieldUtils.validateAllowedFields(object, "filter");
|
FieldUtils.validateAllowedFields(object, "filter", "condition");
|
||||||
|
|
||||||
final String filter = FieldUtils.getString(object.get("filter"), "filter");
|
final String filter = FieldUtils.getString(object.get("filter"), "filter");
|
||||||
|
final JSONObject[] conditionArray = FieldUtils.getObjectArray(object.get("condition"), "condition");
|
||||||
|
|
||||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||||
|
final Requirement[] requirements = environment.getRequirementFactory().getRequirements(conditionArray, environment);
|
||||||
|
|
||||||
return new ModifierSource() {
|
return new ModifierSource() {
|
||||||
@Override
|
@Override
|
||||||
public Modifier getModifier(ActionContext actionContext) {
|
public Modifier getModifier(ActionContext actionContext) {
|
||||||
return new CancelStrengthBonusSourceModifier(actionContext.getSource(),
|
return new CancelStrengthBonusSourceModifier(actionContext.getSource(),
|
||||||
|
new RequirementCondition(requirements, actionContext),
|
||||||
filterableSource.getFilterable(actionContext));
|
filterableSource.getFilterable(actionContext));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class ModifierSourceFactory {
|
|||||||
modifierProducers.put("allycanparticipateinarcheryfireandskirmishes", new AllyCanParticipateInArcheryFireAndSkirmishes());
|
modifierProducers.put("allycanparticipateinarcheryfireandskirmishes", new AllyCanParticipateInArcheryFireAndSkirmishes());
|
||||||
modifierProducers.put("allycanparticipateinskirmishes", new AllyCanParticipateInSkirmishes());
|
modifierProducers.put("allycanparticipateinskirmishes", new AllyCanParticipateInSkirmishes());
|
||||||
modifierProducers.put("archerytotal", new ArcheryTotal());
|
modifierProducers.put("archerytotal", new ArcheryTotal());
|
||||||
|
modifierProducers.put("cancelkeywordbonusfrom", new CancelKeywordBonusFrom());
|
||||||
modifierProducers.put("cancelstrengthbonusfrom", new CancelStrengthBonusFrom());
|
modifierProducers.put("cancelstrengthbonusfrom", new CancelStrengthBonusFrom());
|
||||||
modifierProducers.put("cancelstrengthbonusto", new CancelStrengthBonusTo());
|
modifierProducers.put("cancelstrengthbonusto", new CancelStrengthBonusTo());
|
||||||
modifierProducers.put("canplaystackedcards", new CanPlayStackedCards());
|
modifierProducers.put("canplaystackedcards", new CanPlayStackedCards());
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class Filters {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Filter moreStrangthThan(final int strength) {
|
public static Filter moreStrengthThan(final int strength) {
|
||||||
return new Filter() {
|
return new Filter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
||||||
|
|||||||
@@ -22,8 +22,11 @@ public class Card_V1_037_Tests
|
|||||||
return new GenericCardTestHelper(
|
return new GenericCardTestHelper(
|
||||||
new HashMap<String, String>()
|
new HashMap<String, String>()
|
||||||
{{
|
{{
|
||||||
put("card", "151_37");
|
put("fell", "151_37");
|
||||||
// put other cards in here as needed for the test case
|
put("fell2", "151_37");
|
||||||
|
put("nazgul", "1_232");
|
||||||
|
put("blade", "1_216");
|
||||||
|
put("ring", "9_44");
|
||||||
}},
|
}},
|
||||||
GenericCardTestHelper.FellowshipSites,
|
GenericCardTestHelper.FellowshipSites,
|
||||||
GenericCardTestHelper.FOTRFrodo,
|
GenericCardTestHelper.FOTRFrodo,
|
||||||
@@ -31,9 +34,7 @@ public class Card_V1_037_Tests
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment both @Test markers below once this is ready to be used
|
@Test
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void FellVoicesCallStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
public void FellVoicesCallStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,34 +51,58 @@ public class Card_V1_037_Tests
|
|||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl fell = scn.GetFreepsCard("fell");
|
||||||
|
|
||||||
assertFalse(card.getBlueprint().isUnique());
|
assertFalse(fell.getBlueprint().isUnique());
|
||||||
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
|
assertEquals(Side.SHADOW, fell.getBlueprint().getSide());
|
||||||
assertEquals(Culture.WRAITH, card.getBlueprint().getCulture());
|
assertEquals(Culture.WRAITH, fell.getBlueprint().getCulture());
|
||||||
assertEquals(CardType.EVENT, card.getBlueprint().getCardType());
|
assertEquals(CardType.EVENT, fell.getBlueprint().getCardType());
|
||||||
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
|
//assertEquals(Race.CREATURE, fell.getBlueprint().getRace());
|
||||||
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
|
assertTrue(scn.HasKeyword(fell, Keyword.SHADOW)); // test for keywords as needed
|
||||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
assertEquals(0, fell.getBlueprint().getTwilightCost());
|
||||||
//assertEquals(, card.getBlueprint().getStrength());
|
//assertEquals(, fell.getBlueprint().getStrength());
|
||||||
//assertEquals(, card.getBlueprint().getVitality());
|
//assertEquals(, fell.getBlueprint().getVitality());
|
||||||
//assertEquals(, card.getBlueprint().getResistance());
|
//assertEquals(, fell.getBlueprint().getResistance());
|
||||||
//assertEquals(Signet., card.getBlueprint().getSignet());
|
//assertEquals(Signet., fell.getBlueprint().getSignet());
|
||||||
//assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
//assertEquals(, fell.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void FellVoicesCallTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
public void FellVoicesCallPullsItemsFromDiscardOrDrawDeck() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl fell = scn.GetShadowCard("fell");
|
||||||
scn.FreepsMoveCardToHand(card);
|
PhysicalCardImpl fell2 = scn.GetShadowCard("fell2");
|
||||||
|
PhysicalCardImpl nazgul = scn.GetShadowCard("nazgul");
|
||||||
|
PhysicalCardImpl blade = scn.GetShadowCard("blade");
|
||||||
|
PhysicalCardImpl ring = scn.GetShadowCard("ring");
|
||||||
|
scn.FreepsMoveCardToHand(fell, fell2);
|
||||||
|
scn.FreepsMoveCharToTable(nazgul);
|
||||||
|
scn.FreepsMoveCardToDiscard(ring);
|
||||||
|
scn.FreepsMoveCardsToTopOfDeck(blade);
|
||||||
|
|
||||||
scn.StartGame();
|
scn.StartGame();
|
||||||
scn.FreepsPlayCard(card);
|
|
||||||
|
|
||||||
assertEquals(0, scn.GetTwilight());
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertTrue(scn.ShadowCardPlayAvailable(fell));
|
||||||
|
assertEquals(Zone.DISCARD, ring.getZone());
|
||||||
|
assertEquals(Zone.DECK, blade.getZone());
|
||||||
|
scn.ShadowPlayCard(fell);
|
||||||
|
|
||||||
|
assertTrue(scn.ShadowDecisionAvailable("Choose action to perform"));
|
||||||
|
assertEquals(2, scn.ShadowGetMultipleChoices().size());
|
||||||
|
scn.ShadowChooseMultipleChoiceOption("discard");
|
||||||
|
assertEquals(Zone.ATTACHED, ring.getZone());
|
||||||
|
assertEquals(nazgul, ring.getAttachedTo());
|
||||||
|
|
||||||
|
assertTrue(scn.ShadowCardPlayAvailable(fell2));
|
||||||
|
scn.ShadowPlayCard(fell2);
|
||||||
|
|
||||||
|
assertEquals(Zone.ATTACHED, blade.getZone());
|
||||||
|
assertEquals(nazgul, blade.getAttachedTo());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,13 @@ public class Card_V1_038_Tests
|
|||||||
return new GenericCardTestHelper(
|
return new GenericCardTestHelper(
|
||||||
new HashMap<String, String>()
|
new HashMap<String, String>()
|
||||||
{{
|
{{
|
||||||
put("card", "151_38");
|
put("harry", "151_38");
|
||||||
// put other cards in here as needed for the test case
|
put("rider", "12_161");
|
||||||
|
put("wk", "1_237");
|
||||||
|
|
||||||
|
put("farin", "1_11");
|
||||||
|
put("aragorn", "1_89");
|
||||||
|
put("pippin", "1_307");
|
||||||
}},
|
}},
|
||||||
GenericCardTestHelper.FellowshipSites,
|
GenericCardTestHelper.FellowshipSites,
|
||||||
GenericCardTestHelper.FOTRFrodo,
|
GenericCardTestHelper.FOTRFrodo,
|
||||||
@@ -31,9 +36,7 @@ public class Card_V1_038_Tests
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment both @Test markers below once this is ready to be used
|
@Test
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void HarryGoatleafStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
public void HarryGoatleafStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,34 +57,74 @@ public class Card_V1_038_Tests
|
|||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl harry = scn.GetFreepsCard("harry");
|
||||||
|
|
||||||
assertTrue(card.getBlueprint().isUnique());
|
assertTrue(harry.getBlueprint().isUnique());
|
||||||
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
|
assertEquals(Side.SHADOW, harry.getBlueprint().getSide());
|
||||||
assertEquals(Culture.WRAITH, card.getBlueprint().getCulture());
|
assertEquals(Culture.WRAITH, harry.getBlueprint().getCulture());
|
||||||
assertEquals(CardType.MINION, card.getBlueprint().getCardType());
|
assertEquals(CardType.MINION, harry.getBlueprint().getCardType());
|
||||||
assertEquals(Race.CREATURE, card.getBlueprint().getRace());
|
assertEquals(Race.MAN, harry.getBlueprint().getRace());
|
||||||
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
|
//assertTrue(scn.HasKeyword(harry, Keyword.SUPPORT_AREA)); // test for keywords as needed
|
||||||
assertEquals(1, card.getBlueprint().getTwilightCost());
|
assertEquals(1, harry.getBlueprint().getTwilightCost());
|
||||||
assertEquals(3, card.getBlueprint().getStrength());
|
assertEquals(3, harry.getBlueprint().getStrength());
|
||||||
assertEquals(1, card.getBlueprint().getVitality());
|
assertEquals(1, harry.getBlueprint().getVitality());
|
||||||
//assertEquals(, card.getBlueprint().getResistance());
|
//assertEquals(, harry.getBlueprint().getResistance());
|
||||||
//assertEquals(Signet., card.getBlueprint().getSignet());
|
//assertEquals(Signet., harry.getBlueprint().getSignet());
|
||||||
assertEquals(2, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
assertEquals(2, harry.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void HarryGoatleafTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
public void AllNazgulAreCostMinusOne() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl harry = scn.GetShadowCard("harry");
|
||||||
scn.FreepsMoveCardToHand(card);
|
PhysicalCardImpl rider = scn.GetShadowCard("rider");
|
||||||
|
PhysicalCardImpl wk = scn.GetShadowCard("wk");
|
||||||
|
scn.ShadowMoveCharToTable(harry);
|
||||||
|
scn.ShadowMoveCardToHand(rider, wk);
|
||||||
|
|
||||||
scn.StartGame();
|
scn.StartGame();
|
||||||
scn.FreepsPlayCard(card);
|
|
||||||
|
|
||||||
assertEquals(1, scn.GetTwilight());
|
scn.SetTwilight(17);
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertEquals(5, rider.getBlueprint().getTwilightCost());
|
||||||
|
assertEquals(8, wk.getBlueprint().getTwilightCost());
|
||||||
|
assertEquals(20, scn.GetTwilight());
|
||||||
|
|
||||||
|
scn.ShadowPlayCard(rider);
|
||||||
|
assertEquals(14, scn.GetTwilight()); // -5 minion cost, +1 from Harry, -2 roaming
|
||||||
|
|
||||||
|
scn.ShadowPlayCard(wk);
|
||||||
|
assertEquals(5, scn.GetTwilight()); // -8 minion cost, +1 from Harry, -2 roaming
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void AssignmentAbilityAssignsHarryToStrength5PlusComp() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
//Pre-game setup
|
||||||
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
|
PhysicalCardImpl harry = scn.GetShadowCard("harry");
|
||||||
|
scn.ShadowMoveCharToTable(harry);
|
||||||
|
|
||||||
|
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
|
||||||
|
PhysicalCardImpl farin = scn.GetFreepsCard("farin");
|
||||||
|
PhysicalCardImpl pippin = scn.GetFreepsCard("pippin");
|
||||||
|
scn.FreepsMoveCharToTable(aragorn, farin, pippin);
|
||||||
|
|
||||||
|
scn.StartGame();
|
||||||
|
|
||||||
|
scn.SkipToPhase(Phase.ASSIGNMENT);
|
||||||
|
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
assertTrue(scn.ShadowCardActionAvailable(harry));
|
||||||
|
|
||||||
|
scn.ShadowUseCardAction(harry);
|
||||||
|
assertTrue(scn.FreepsDecisionAvailable("assign"));
|
||||||
|
assertEquals(2, scn.GetFreepsCardChoiceCount());
|
||||||
|
scn.FreepsChooseCard(aragorn);
|
||||||
|
assertTrue(scn.IsCharAssigned(aragorn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.gempukku.lotro.game.CardNotFoundException;
|
|||||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||||
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
|
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
|
||||||
|
import junit.framework.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -22,7 +23,17 @@ public class Card_V1_039_Tests
|
|||||||
return new GenericCardTestHelper(
|
return new GenericCardTestHelper(
|
||||||
new HashMap<String, String>()
|
new HashMap<String, String>()
|
||||||
{{
|
{{
|
||||||
put("card", "151_39");
|
put("crown", "151_39");
|
||||||
|
put("crown2", "151_39");
|
||||||
|
put("nazgul1", "1_232");
|
||||||
|
put("nazgul2", "1_232");
|
||||||
|
put("twigul1", "2_84");
|
||||||
|
put("twigul2", "2_84");
|
||||||
|
|
||||||
|
put("arwen", "1_30");
|
||||||
|
put("gwemegil", "1_47");
|
||||||
|
put("gimli", "1_13");
|
||||||
|
put("axe", "1_14");
|
||||||
// put other cards in here as needed for the test case
|
// put other cards in here as needed for the test case
|
||||||
}},
|
}},
|
||||||
GenericCardTestHelper.FellowshipSites,
|
GenericCardTestHelper.FellowshipSites,
|
||||||
@@ -31,9 +42,7 @@ public class Card_V1_039_Tests
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment both @Test markers below once this is ready to be used
|
@Test
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void PaleCrownStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
public void PaleCrownStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,34 +62,179 @@ public class Card_V1_039_Tests
|
|||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl crown = scn.GetFreepsCard("crown");
|
||||||
|
|
||||||
assertFalse(card.getBlueprint().isUnique());
|
assertFalse(crown.getBlueprint().isUnique());
|
||||||
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
|
assertEquals(Side.SHADOW, crown.getBlueprint().getSide());
|
||||||
assertEquals(Culture.WRAITH, card.getBlueprint().getCulture());
|
assertEquals(Culture.WRAITH, crown.getBlueprint().getCulture());
|
||||||
assertEquals(CardType.ARTIFACT, card.getBlueprint().getCardType());
|
assertEquals(CardType.ARTIFACT, crown.getBlueprint().getCardType());
|
||||||
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
|
//assertEquals(Race.CREATURE, crown.getBlueprint().getRace());
|
||||||
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
|
assertTrue(scn.HasKeyword(crown, Keyword.SUPPORT_AREA));
|
||||||
assertEquals(1, card.getBlueprint().getTwilightCost());
|
assertEquals(PossessionClass.HELM, crown.getBlueprint().getPossessionClasses().stream().findFirst().get()); // test for keywords as needed
|
||||||
//assertEquals(, card.getBlueprint().getStrength());
|
assertEquals(1, crown.getBlueprint().getTwilightCost());
|
||||||
assertEquals(1, card.getBlueprint().getVitality());
|
//assertEquals(, crown.getBlueprint().getStrength());
|
||||||
//assertEquals(, card.getBlueprint().getResistance());
|
assertEquals(1, crown.getBlueprint().getVitality());
|
||||||
//assertEquals(Signet., card.getBlueprint().getSignet());
|
//assertEquals(, crown.getBlueprint().getResistance());
|
||||||
//assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
//assertEquals(Signet., crown.getBlueprint().getSignet());
|
||||||
|
//assertEquals(, crown.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void PaleCrownTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
public void TwilightBearerCancelsStrengthAndDamageBonuses() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
|
||||||
scn.FreepsMoveCardToHand(card);
|
PhysicalCardImpl gwemegil = scn.GetFreepsCard("gwemegil");
|
||||||
|
PhysicalCardImpl gimli = scn.GetFreepsCard("gimli");
|
||||||
|
PhysicalCardImpl axe = scn.GetFreepsCard("axe");
|
||||||
|
scn.FreepsMoveCharToTable(arwen, gimli);
|
||||||
|
scn.AttachCardsTo(arwen, gwemegil);
|
||||||
|
scn.AttachCardsTo(gimli, axe);
|
||||||
|
|
||||||
|
PhysicalCardImpl twigul1 = scn.GetShadowCard("twigul1");
|
||||||
|
PhysicalCardImpl twigul2 = scn.GetShadowCard("twigul2");
|
||||||
|
PhysicalCardImpl crown = scn.GetShadowCard("crown");
|
||||||
|
PhysicalCardImpl crown2 = scn.GetShadowCard("crown2");
|
||||||
|
scn.ShadowMoveCharToTable(twigul1, twigul2);
|
||||||
|
scn.AttachCardsTo(twigul1, crown);
|
||||||
|
scn.AttachCardsTo(twigul2, crown2);
|
||||||
|
|
||||||
scn.StartGame();
|
scn.StartGame();
|
||||||
scn.FreepsPlayCard(card);
|
|
||||||
|
|
||||||
assertEquals(1, scn.GetTwilight());
|
scn.SkipToPhase(Phase.ASSIGNMENT);
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
|
||||||
|
assertEquals(8, scn.GetStrength(arwen)); // 6 base, +2 sword
|
||||||
|
assertTrue(scn.HasKeyword(arwen, Keyword.DAMAGE));
|
||||||
|
assertEquals(1, scn.GetKeywordCount(arwen, Keyword.DAMAGE));
|
||||||
|
|
||||||
|
assertEquals(8, scn.GetStrength(gimli)); // 6 base, +2 axe
|
||||||
|
assertTrue(scn.HasKeyword(gimli, Keyword.DAMAGE));
|
||||||
|
assertEquals(2, scn.GetKeywordCount(gimli, Keyword.DAMAGE));
|
||||||
|
|
||||||
|
scn.FreepsAssignToMinions(new PhysicalCardImpl[]{arwen, twigul1}, new PhysicalCardImpl[]{gimli, twigul2});
|
||||||
|
|
||||||
|
scn.FreepsResolveSkirmish(arwen);
|
||||||
|
assertEquals(9, scn.GetStrength(arwen)); // 6 base, +3 from ability, no +2 from sword
|
||||||
|
assertFalse(scn.HasKeyword(arwen, Keyword.DAMAGE)); // damage bonus from sword negated
|
||||||
|
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
|
||||||
|
scn.FreepsResolveSkirmish(gimli);
|
||||||
|
assertEquals(6, scn.GetStrength(gimli)); // 6 base, no +2 from axe
|
||||||
|
assertTrue(scn.HasKeyword(gimli, Keyword.DAMAGE)); // damage bonus from base
|
||||||
|
assertEquals(1, scn.GetKeywordCount(gimli, Keyword.DAMAGE)); // damage bonus from axe negated
|
||||||
|
|
||||||
|
scn.FreepsUseCardAction(gimli);
|
||||||
|
assertEquals(8, scn.GetStrength(gimli)); // 6 base, +2 from ability, no +2 from axe
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void NonTwilightBearerDoesNotCancelBonuses() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
//Pre-game setup
|
||||||
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
|
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
|
||||||
|
PhysicalCardImpl gwemegil = scn.GetFreepsCard("gwemegil");
|
||||||
|
PhysicalCardImpl gimli = scn.GetFreepsCard("gimli");
|
||||||
|
PhysicalCardImpl axe = scn.GetFreepsCard("axe");
|
||||||
|
scn.FreepsMoveCharToTable(arwen, gimli);
|
||||||
|
scn.AttachCardsTo(arwen, gwemegil);
|
||||||
|
scn.AttachCardsTo(gimli, axe);
|
||||||
|
|
||||||
|
PhysicalCardImpl nazgul1 = scn.GetShadowCard("nazgul1");
|
||||||
|
PhysicalCardImpl nazgul2 = scn.GetShadowCard("nazgul2");
|
||||||
|
PhysicalCardImpl crown = scn.GetShadowCard("crown");
|
||||||
|
PhysicalCardImpl crown2 = scn.GetShadowCard("crown2");
|
||||||
|
scn.ShadowMoveCharToTable(nazgul1, nazgul2);
|
||||||
|
scn.AttachCardsTo(nazgul1, crown);
|
||||||
|
scn.AttachCardsTo(nazgul2, crown2);
|
||||||
|
|
||||||
|
scn.StartGame();
|
||||||
|
|
||||||
|
scn.SkipToPhase(Phase.ASSIGNMENT);
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
|
||||||
|
assertEquals(8, scn.GetStrength(arwen)); // 6 base, +2 sword
|
||||||
|
assertTrue(scn.HasKeyword(arwen, Keyword.DAMAGE));
|
||||||
|
assertEquals(1, scn.GetKeywordCount(arwen, Keyword.DAMAGE));
|
||||||
|
|
||||||
|
assertEquals(8, scn.GetStrength(gimli)); // 6 base, +2 axe
|
||||||
|
assertTrue(scn.HasKeyword(gimli, Keyword.DAMAGE));
|
||||||
|
assertEquals(2, scn.GetKeywordCount(gimli, Keyword.DAMAGE));
|
||||||
|
|
||||||
|
scn.FreepsAssignToMinions(new PhysicalCardImpl[]{arwen, nazgul1}, new PhysicalCardImpl[]{gimli, nazgul2});
|
||||||
|
|
||||||
|
scn.FreepsResolveSkirmish(arwen);
|
||||||
|
assertEquals(11, scn.GetStrength(arwen)); // 6 base, +3 from ability, +2 from sword not negated
|
||||||
|
assertTrue(scn.HasKeyword(arwen, Keyword.DAMAGE)); // damage bonus from sword not negated
|
||||||
|
assertEquals(1, scn.GetKeywordCount(arwen, Keyword.DAMAGE));
|
||||||
|
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
|
||||||
|
scn.FreepsResolveSkirmish(gimli);
|
||||||
|
assertEquals(8, scn.GetStrength(gimli)); // 6 base, +2 from axe not negated
|
||||||
|
assertTrue(scn.HasKeyword(gimli, Keyword.DAMAGE));
|
||||||
|
assertEquals(2, scn.GetKeywordCount(gimli, Keyword.DAMAGE)); // damage bonus from axe not negated
|
||||||
|
|
||||||
|
scn.FreepsUseCardAction(gimli);
|
||||||
|
assertEquals(10, scn.GetStrength(gimli)); // 6 base, +2 from ability, +2 from axe not negated
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void SkirmishAbilityPays1ToTransferToNazgul() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
//Pre-game setup
|
||||||
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
|
PhysicalCardImpl frodo = scn.GetRingBearer();
|
||||||
|
|
||||||
|
PhysicalCardImpl nazgul1 = scn.GetShadowCard("nazgul1");
|
||||||
|
PhysicalCardImpl twigul1 = scn.GetShadowCard("twigul1");
|
||||||
|
PhysicalCardImpl crown = scn.GetShadowCard("crown");
|
||||||
|
PhysicalCardImpl crown2 = scn.GetShadowCard("crown2");
|
||||||
|
scn.ShadowMoveCharToTable(nazgul1, twigul1);
|
||||||
|
scn.ShadowMoveCardToHand(crown, crown2);
|
||||||
|
|
||||||
|
scn.StartGame();
|
||||||
|
|
||||||
|
scn.SetTwilight(10);
|
||||||
|
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
scn.ShadowPlayCard(crown);
|
||||||
|
assertEquals(Zone.SUPPORT, crown.getZone());
|
||||||
|
scn.ShadowPlayCard(crown2);
|
||||||
|
|
||||||
|
scn.SkipToPhase(Phase.ASSIGNMENT);
|
||||||
|
scn.PassCurrentPhaseActions();
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
scn.ShadowAssignToMinions(frodo, nazgul1, twigul1);
|
||||||
|
|
||||||
|
scn.FreepsResolveSkirmish(frodo);
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertEquals(2, scn.GetVitality(nazgul1));
|
||||||
|
assertEquals(3, scn.GetVitality(twigul1));
|
||||||
|
|
||||||
|
assertEquals(11, scn.GetTwilight());
|
||||||
|
|
||||||
|
assertTrue(scn.ShadowCardActionAvailable(crown));
|
||||||
|
scn.ShadowUseCardAction(crown);
|
||||||
|
assertEquals(10, scn.GetTwilight());
|
||||||
|
assertTrue(scn.ShadowDecisionAvailable("Choose cards to transfer to"));
|
||||||
|
assertEquals(2, scn.GetShadowCardChoiceCount());
|
||||||
|
scn.ShadowChooseCard(nazgul1);
|
||||||
|
assertEquals(3, scn.GetVitality(nazgul1));
|
||||||
|
|
||||||
|
scn.FreepsPassCurrentPhaseAction();
|
||||||
|
|
||||||
|
assertTrue(scn.ShadowCardActionAvailable(crown2));
|
||||||
|
scn.ShadowUseCardAction(crown2);
|
||||||
|
assertEquals(9, scn.GetTwilight());
|
||||||
|
assertEquals(4, scn.GetVitality(twigul1));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user