AssignedToSkirmish json hook split into AssignedAgainst
Properly created a json hook for AssignedAgainst, which is what AssignedToSkirmish was actually invoking. Updated all cards that used AssignedToSkirmish; cards which only cared about one side use AssignedToSkirmish, while cards that want to know both sides are changed to AssignedAgainst
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"side": "free people",
|
||||
"filter": "self",
|
||||
"against": "companion",
|
||||
@@ -86,7 +86,7 @@
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"side": "free people",
|
||||
"filter": "self",
|
||||
"against": "companion"
|
||||
@@ -118,7 +118,7 @@
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"side": "free people",
|
||||
"filter": "self",
|
||||
"against": "companion"
|
||||
|
||||
@@ -1459,7 +1459,7 @@
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"filter": "self",
|
||||
"memorizeAgainst": "against"
|
||||
},
|
||||
|
||||
@@ -800,7 +800,7 @@
|
||||
"effects": {
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"filter": "self",
|
||||
"against": "companion",
|
||||
"memorizeAgainst": "assignedAgainst"
|
||||
|
||||
@@ -554,7 +554,7 @@
|
||||
"effects": {
|
||||
"type": "responseEvent",
|
||||
"trigger": {
|
||||
"type": "assignedToSkirmish",
|
||||
"type": "assignedAgainst",
|
||||
"side": "free people",
|
||||
"filter": "hobbit",
|
||||
"against": "nazgul",
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
<pre style="font-size:80%">
|
||||
<b>Most recent update</b>
|
||||
|
||||
<b>2021 December 21 - A</b>
|
||||
<b>2021 December 22 - A</b>
|
||||
- Fixed I Would Have Gone With You to the End (V1_23) permitting the use of any stacked cards for its ability.
|
||||
- Fixed Gaze of the Eye's image not showing the uniqueness dot.
|
||||
- Fixed Desperate Defense of the Ring (1R244) triggering each time minions are added to that companion's skirmish, instead of once per total assignment.
|
||||
- Due to the above fix, several other cards also had their underlying code for assignment triggers affected.
|
||||
If you see any issues with cards that trigger upon being assigned (such as the set 16 wraiths), please let us know!
|
||||
|
||||
|
||||
<b>2021 December 21</b>
|
||||
- NEW ERRATA: Great Hill Troll (8C102).
|
||||
Twilight Cost: 9 -> 10
|
||||
Game Text:
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.trigger;
|
||||
|
||||
import com.gempukku.lotro.cards.build.ActionContext;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.FilterableSource;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.timing.results.AssignAgainstResult;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class AssignedAgainst implements TriggerCheckerProducer {
|
||||
@Override
|
||||
public TriggerChecker getTriggerChecker(JSONObject value, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "filter", "side", "against", "memorizeAgainst", "memorizeAssigned");
|
||||
|
||||
final String filter = FieldUtils.getString(value.get("filter"), "filter", "any");
|
||||
final String against = FieldUtils.getString(value.get("against"), "against", "any");
|
||||
final String memorizeAssigned = FieldUtils.getString(value.get("memorizeAssigned"), "memorizeAssigned");
|
||||
final String memorizeAgainst = FieldUtils.getString(value.get("memorizeAgainst"), "memorizeAgainst");
|
||||
final Side side = FieldUtils.getEnum(Side.class, value.get("side"), "side");
|
||||
|
||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||
final FilterableSource againstSource = environment.getFilterFactory().generateFilter(against, environment);
|
||||
|
||||
return new TriggerChecker() {
|
||||
@Override
|
||||
public boolean isBefore() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accepts(ActionContext actionContext) {
|
||||
final Filterable assignedFilterable = filterableSource.getFilterable(actionContext);
|
||||
final Filterable againstFilterable = againstSource.getFilterable(actionContext);
|
||||
final boolean result = TriggerConditions.assignedAgainst(actionContext.getGame(), actionContext.getEffectResult(), side,
|
||||
againstFilterable, assignedFilterable);
|
||||
if (result && memorizeAgainst != null) {
|
||||
AssignAgainstResult assignmentResult = (AssignAgainstResult) actionContext.getEffectResult();
|
||||
actionContext.setCardMemory(memorizeAgainst, assignmentResult.getAgainst());
|
||||
}
|
||||
if (result && memorizeAssigned != null) {
|
||||
AssignAgainstResult assignmentResult = (AssignAgainstResult) actionContext.getEffectResult();
|
||||
actionContext.setCardMemory(memorizeAssigned, assignmentResult.getAssignedCard());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,13 @@ import org.json.simple.JSONObject;
|
||||
public class AssignedToSkirmish implements TriggerCheckerProducer {
|
||||
@Override
|
||||
public TriggerChecker getTriggerChecker(JSONObject value, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "filter", "side", "against", "memorizeAgainst", "memorizeAssigned");
|
||||
FieldUtils.validateAllowedFields(value, "filter", "side", "memorize");
|
||||
|
||||
final String filter = FieldUtils.getString(value.get("filter"), "filter", "any");
|
||||
final String against = FieldUtils.getString(value.get("against"), "against", "any");
|
||||
final String memorizeAssigned = FieldUtils.getString(value.get("memorizeAssigned"), "memorizeAssigned");
|
||||
final String memorizeAgainst = FieldUtils.getString(value.get("memorizeAgainst"), "memorizeAgainst");
|
||||
final String memorize = FieldUtils.getString(value.get("memorize"), "memorize");
|
||||
final Side side = FieldUtils.getEnum(Side.class, value.get("side"), "side");
|
||||
|
||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||
final FilterableSource againstSource = environment.getFilterFactory().generateFilter(against, environment);
|
||||
|
||||
return new TriggerChecker() {
|
||||
@Override
|
||||
@@ -34,16 +31,10 @@ public class AssignedToSkirmish implements TriggerCheckerProducer {
|
||||
@Override
|
||||
public boolean accepts(ActionContext actionContext) {
|
||||
final Filterable assignedFilterable = filterableSource.getFilterable(actionContext);
|
||||
final Filterable againstFilterable = againstSource.getFilterable(actionContext);
|
||||
final boolean result = TriggerConditions.assignedAgainst(actionContext.getGame(), actionContext.getEffectResult(), side,
|
||||
againstFilterable, assignedFilterable);
|
||||
if (result && memorizeAgainst != null) {
|
||||
final boolean result = TriggerConditions.assignedToSkirmish(actionContext.getGame(), actionContext.getEffectResult(), side, assignedFilterable);
|
||||
if (result && memorize != null) {
|
||||
AssignAgainstResult assignmentResult = (AssignAgainstResult) actionContext.getEffectResult();
|
||||
actionContext.setCardMemory(memorizeAgainst, assignmentResult.getAgainst());
|
||||
}
|
||||
if (result && memorizeAssigned != null) {
|
||||
AssignAgainstResult assignmentResult = (AssignAgainstResult) actionContext.getEffectResult();
|
||||
actionContext.setCardMemory(memorizeAssigned, assignmentResult.getAssignedCard());
|
||||
actionContext.setCardMemory(memorize, assignmentResult.getAssignedCard());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public class TriggerCheckerFactory {
|
||||
triggerCheckers.put("activated", new ActivatedTriggerCheckerProducer());
|
||||
triggerCheckers.put("addsburden", new AddsBurden());
|
||||
triggerCheckers.put("addsthreat", new AddsThreat());
|
||||
triggerCheckers.put("assignedagainst", new AssignedAgainst());
|
||||
triggerCheckers.put("assignedtoskirmish", new AssignedToSkirmish());
|
||||
triggerCheckers.put("cancelledskirmish", new CancelledSkirmish());
|
||||
triggerCheckers.put("condition", new ConditionTrigger());
|
||||
|
||||
Reference in New Issue
Block a user