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",
|
||||
"modifier": {
|
||||
"type": "cantBeAssignedToSkirmishByFpPlayer",
|
||||
"type": "cantBeAssignedToSkirmishAgainst",
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "hobbit"
|
||||
},
|
||||
"filter": "self"
|
||||
"minion": "self",
|
||||
"fpCharacter": "any",
|
||||
"side": "free people"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -148,9 +150,14 @@
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"type": "modifyStrength",
|
||||
"filter": "memory(bearer),inSkirmishAgainst(nazgul)",
|
||||
"amount": 3
|
||||
"type": "addmodifier",
|
||||
"modifier": {
|
||||
"type": "modifyStrength",
|
||||
"filter": "memory(bearer),inSkirmishAgainst(nazgul)",
|
||||
|
||||
"amount": 3
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
"type": "takeOffRing"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"effect": {
|
||||
"type": "heal",
|
||||
"filter": "another,elf"
|
||||
"filter": "choose(another,elf)"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -97,8 +97,8 @@
|
||||
"type": "modifyStrength",
|
||||
"filter": "memory(chosenAlly)",
|
||||
"amount": 3,
|
||||
"until": "start(regroup)"
|
||||
}
|
||||
},
|
||||
"until": "start(regroup)"
|
||||
},
|
||||
{
|
||||
"type": "allyCanParticipateInArcheryFireAndSkirmishes",
|
||||
@@ -126,13 +126,13 @@
|
||||
{
|
||||
"type": "removeTwilight",
|
||||
"amount": 2
|
||||
},
|
||||
{
|
||||
"type": "canSpot",
|
||||
"count": 2,
|
||||
"memorize": "culture(isengard),minion"
|
||||
}
|
||||
],
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "culture(isengard),minion",
|
||||
"count": 2,
|
||||
},
|
||||
"effect": [
|
||||
{
|
||||
"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("cantlookorrevealhand", new CantLookOrRevealHand());
|
||||
modifierProducers.put("cantbeassignedtoskirmish", new CantBeAssignedToSkirmish());
|
||||
modifierProducers.put("fpplayermaynotassigncharacter", new FreePeoplePlayerMayNotAssignCharacter());
|
||||
}
|
||||
|
||||
public ModifierSource getModifier(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
|
||||
@@ -97,7 +97,7 @@ public class Galadriel_LoLErrataTests
|
||||
|
||||
|
||||
@Test
|
||||
public void AllyHealsCappedAt2() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
public void AllyHealsCappedAt3() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
//Pre-game setup
|
||||
GenericCardTestHelper scn = GetHome6AllyScenario();
|
||||
scn.FreepsMoveCharToTable("galadriel");
|
||||
@@ -116,9 +116,9 @@ public class Galadriel_LoLErrataTests
|
||||
|
||||
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.
|
||||
assertEquals(3, scn.FreepsGetADParamAsList("cardId").size());
|
||||
//There are 5 total elf allies in play: 1 is home 3. The rest should be eligible.
|
||||
assertEquals(4, scn.FreepsGetADParamAsList("cardId").size());
|
||||
assertEquals("0", scn.FreepsGetADParam("min"));
|
||||
assertEquals("2", scn.FreepsGetADParam("max"));
|
||||
assertEquals("3", scn.FreepsGetADParam("max"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class StingErrataTests
|
||||
}
|
||||
|
||||
@Test
|
||||
public void StingAbilityExertsFrodoAndRevealsTwoCards() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
public void StingAbilityExertsFrodoAndRevealsFourCards() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
GenericCardTestHelper scn = GetScenario();
|
||||
|
||||
PhysicalCardImpl frodo = scn.GetRingBearer();
|
||||
@@ -124,7 +124,7 @@ public class StingErrataTests
|
||||
scn.FreepsUseCardAction(sting);
|
||||
|
||||
//Reveals 2 cards
|
||||
assertEquals(2, scn.FreepsGetADParamAsList("blueprintId").size());
|
||||
assertEquals(4, scn.FreepsGetADParamAsList("blueprintId").size());
|
||||
assertEquals(1, scn.GetWoundsOn(frodo));
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TalentForNBSErrataTests
|
||||
|
||||
/**
|
||||
* Set: 1E
|
||||
* Title: *A Talent for Not Being Seen
|
||||
* Title: A Talent for Not Being Seen
|
||||
* Side: Free Peoples
|
||||
* Culture: Shire
|
||||
* Twilight Cost: 0
|
||||
@@ -50,7 +50,7 @@ public class TalentForNBSErrataTests
|
||||
|
||||
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
|
||||
|
||||
assertTrue(talent.getBlueprint().isUnique());
|
||||
assertFalse(talent.getBlueprint().isUnique());
|
||||
assertEquals(0, talent.getBlueprint().getTwilightCost());
|
||||
|
||||
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