Adjusting merged errata
Fixing some issues that weren't compiling. Removed the unneeded cantBeAssignedToSkirmishByFpPlayer modifier and replaced references to it with cantBeAssignedToSkirmishAgainst, which has a side filter. Fixed affected unit tests to pass.
This commit is contained in:
@@ -67,12 +67,14 @@
|
|||||||
{
|
{
|
||||||
"type": "modifier",
|
"type": "modifier",
|
||||||
"modifier": {
|
"modifier": {
|
||||||
"type": "cantBeAssignedToSkirmishByFpPlayer",
|
"type": "cantBeAssignedToSkirmishAgainst",
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "canSpot",
|
"type": "canSpot",
|
||||||
"filter": "hobbit"
|
"filter": "hobbit"
|
||||||
},
|
},
|
||||||
"filter": "self"
|
"minion": "self",
|
||||||
|
"fpCharacter": "any",
|
||||||
|
"side": "free people"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -148,9 +150,14 @@
|
|||||||
],
|
],
|
||||||
"effects": [
|
"effects": [
|
||||||
{
|
{
|
||||||
"type": "modifyStrength",
|
"type": "addmodifier",
|
||||||
"filter": "memory(bearer),inSkirmishAgainst(nazgul)",
|
"modifier": {
|
||||||
"amount": 3
|
"type": "modifyStrength",
|
||||||
|
"filter": "memory(bearer),inSkirmishAgainst(nazgul)",
|
||||||
|
|
||||||
|
"amount": 3
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "takeOffRing"
|
"type": "takeOffRing"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
"effect": {
|
"effect": {
|
||||||
"type": "heal",
|
"type": "heal",
|
||||||
"filter": "another,elf"
|
"filter": "choose(another,elf)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -97,8 +97,8 @@
|
|||||||
"type": "modifyStrength",
|
"type": "modifyStrength",
|
||||||
"filter": "memory(chosenAlly)",
|
"filter": "memory(chosenAlly)",
|
||||||
"amount": 3,
|
"amount": 3,
|
||||||
"until": "start(regroup)"
|
},
|
||||||
}
|
"until": "start(regroup)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "allyCanParticipateInArcheryFireAndSkirmishes",
|
"type": "allyCanParticipateInArcheryFireAndSkirmishes",
|
||||||
@@ -126,13 +126,13 @@
|
|||||||
{
|
{
|
||||||
"type": "removeTwilight",
|
"type": "removeTwilight",
|
||||||
"amount": 2
|
"amount": 2
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "canSpot",
|
|
||||||
"count": 2,
|
|
||||||
"memorize": "culture(isengard),minion"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"condition": {
|
||||||
|
"type": "canSpot",
|
||||||
|
"filter": "culture(isengard),minion",
|
||||||
|
"count": 2,
|
||||||
|
},
|
||||||
"effect": [
|
"effect": [
|
||||||
{
|
{
|
||||||
"type": "revealRandomCardsFromHand",
|
"type": "revealRandomCardsFromHand",
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
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.cards.build.field.effect.appender.MultiEffectAppender;
|
|
||||||
import com.gempukku.lotro.logic.modifiers.CantBeAssignedToSkirmishModifier;
|
|
||||||
import com.gempukku.lotro.logic.modifiers.FreePeoplePlayerMayNotAssignCharacterModifier;
|
|
||||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
|
|
||||||
public class FreePeoplePlayerMayNotAssignCharacter implements ModifierSourceProducer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ModifierSource getModifierSource(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
|
||||||
FieldUtils.validateAllowedFields(effectObject, "filter", "condition");
|
|
||||||
|
|
||||||
final JSONObject[] conditionArray = FieldUtils.getObjectArray(effectObject.get("condition"), "condition");
|
|
||||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter");
|
|
||||||
|
|
||||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
|
||||||
final Requirement[] requirements = environment.getRequirementFactory().getRequirements(conditionArray, environment);
|
|
||||||
|
|
||||||
MultiEffectAppender result = new MultiEffectAppender();
|
|
||||||
|
|
||||||
return new ModifierSource() {
|
|
||||||
@Override
|
|
||||||
public Modifier getModifier(ActionContext actionContext) {
|
|
||||||
return new FreePeoplePlayerMayNotAssignCharacterModifier(actionContext.getSource(),
|
|
||||||
new RequirementCondition(requirements, actionContext),
|
|
||||||
filterableSource.getFilterable(actionContext));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -56,7 +56,6 @@ public class ModifierSourceFactory {
|
|||||||
modifierProducers.put("allycanparticipateinarcheryfireandskirmishes", new AllyCanParticipateInArcheryFireAndSkirmishes());
|
modifierProducers.put("allycanparticipateinarcheryfireandskirmishes", new AllyCanParticipateInArcheryFireAndSkirmishes());
|
||||||
modifierProducers.put("cantlookorrevealhand", new CantLookOrRevealHand());
|
modifierProducers.put("cantlookorrevealhand", new CantLookOrRevealHand());
|
||||||
modifierProducers.put("cantbeassignedtoskirmish", new CantBeAssignedToSkirmish());
|
modifierProducers.put("cantbeassignedtoskirmish", new CantBeAssignedToSkirmish());
|
||||||
modifierProducers.put("fpplayermaynotassigncharacter", new FreePeoplePlayerMayNotAssignCharacter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModifierSource getModifier(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
public ModifierSource getModifier(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class Galadriel_LoLErrataTests
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void AllyHealsCappedAt2() throws DecisionResultInvalidException, CardNotFoundException {
|
public void AllyHealsCappedAt3() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
//Pre-game setup
|
//Pre-game setup
|
||||||
GenericCardTestHelper scn = GetHome6AllyScenario();
|
GenericCardTestHelper scn = GetHome6AllyScenario();
|
||||||
scn.FreepsMoveCharToTable("galadriel");
|
scn.FreepsMoveCharToTable("galadriel");
|
||||||
@@ -116,9 +116,9 @@ public class Galadriel_LoLErrataTests
|
|||||||
|
|
||||||
assertEquals(Phase.BETWEEN_TURNS, scn.GetCurrentPhase());
|
assertEquals(Phase.BETWEEN_TURNS, scn.GetCurrentPhase());
|
||||||
|
|
||||||
//There are 5 total elf allies in play: 1 is home 3, and 1 is Galadriel herself. The rest should be eligible.
|
//There are 5 total elf allies in play: 1 is home 3. The rest should be eligible.
|
||||||
assertEquals(3, scn.FreepsGetADParamAsList("cardId").size());
|
assertEquals(4, scn.FreepsGetADParamAsList("cardId").size());
|
||||||
assertEquals("0", scn.FreepsGetADParam("min"));
|
assertEquals("0", scn.FreepsGetADParam("min"));
|
||||||
assertEquals("2", scn.FreepsGetADParam("max"));
|
assertEquals("3", scn.FreepsGetADParam("max"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class StingErrataTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void StingAbilityExertsFrodoAndRevealsTwoCards() throws DecisionResultInvalidException, CardNotFoundException {
|
public void StingAbilityExertsFrodoAndRevealsFourCards() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
GenericCardTestHelper scn = GetScenario();
|
GenericCardTestHelper scn = GetScenario();
|
||||||
|
|
||||||
PhysicalCardImpl frodo = scn.GetRingBearer();
|
PhysicalCardImpl frodo = scn.GetRingBearer();
|
||||||
@@ -124,7 +124,7 @@ public class StingErrataTests
|
|||||||
scn.FreepsUseCardAction(sting);
|
scn.FreepsUseCardAction(sting);
|
||||||
|
|
||||||
//Reveals 2 cards
|
//Reveals 2 cards
|
||||||
assertEquals(2, scn.FreepsGetADParamAsList("blueprintId").size());
|
assertEquals(4, scn.FreepsGetADParamAsList("blueprintId").size());
|
||||||
assertEquals(1, scn.GetWoundsOn(frodo));
|
assertEquals(1, scn.GetWoundsOn(frodo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class TalentForNBSErrataTests
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set: 1E
|
* Set: 1E
|
||||||
* Title: *A Talent for Not Being Seen
|
* Title: A Talent for Not Being Seen
|
||||||
* Side: Free Peoples
|
* Side: Free Peoples
|
||||||
* Culture: Shire
|
* Culture: Shire
|
||||||
* Twilight Cost: 0
|
* Twilight Cost: 0
|
||||||
@@ -50,7 +50,7 @@ public class TalentForNBSErrataTests
|
|||||||
|
|
||||||
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
|
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
|
||||||
|
|
||||||
assertTrue(talent.getBlueprint().isUnique());
|
assertFalse(talent.getBlueprint().isUnique());
|
||||||
assertEquals(0, talent.getBlueprint().getTwilightCost());
|
assertEquals(0, talent.getBlueprint().getTwilightCost());
|
||||||
|
|
||||||
assertTrue(scn.HasKeyword(talent, Keyword.STEALTH));
|
assertTrue(scn.HasKeyword(talent, Keyword.STEALTH));
|
||||||
@@ -103,27 +103,6 @@ public class TalentForNBSErrataTests
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void TalentDoesNotReduceIfNonHobbitCompanions() throws DecisionResultInvalidException, CardNotFoundException {
|
|
||||||
//Pre-game setup
|
|
||||||
GenericCardTestHelper scn = GetScenario();
|
|
||||||
|
|
||||||
PhysicalCardImpl frodo = scn.GetRingBearer();
|
|
||||||
PhysicalCardImpl merry = scn.GetFreepsCard("merry");
|
|
||||||
PhysicalCardImpl boromir = scn.GetFreepsCard("boromir");
|
|
||||||
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
|
|
||||||
|
|
||||||
scn.FreepsMoveCharToTable(merry, boromir);
|
|
||||||
scn.FreepsMoveCardToHand(talent);
|
|
||||||
|
|
||||||
scn.StartGame();
|
|
||||||
|
|
||||||
scn.FreepsPlayCard(talent);
|
|
||||||
scn.FreepsSkipCurrentPhaseAction();
|
|
||||||
|
|
||||||
// 3 for Frodo/Merry/Boromir, 1 for the site, Talent does not trigger
|
|
||||||
assertEquals(4, scn.GetTwilight());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user