Add SarumanFirstSentenceActive

This commit is contained in:
Troy Biesterfeld
2021-04-13 21:50:38 -05:00
parent 13d216efcd
commit 381d3e89df
3 changed files with 37 additions and 8 deletions

View File

@@ -30,7 +30,7 @@
"modifier": { "modifier": {
"type": "modifyStrength", "type": "modifyStrength",
"filter": "memory(chosenAlly)", "filter": "memory(chosenAlly)",
"amount": 3, "amount": 3
}, },
"until": "start(regroup)" "until": "start(regroup)"
}, },
@@ -42,7 +42,6 @@
] ]
} }
}, },
"53_68": { "53_68": {
"side": "shadow", "side": "shadow",
"site": 4, "site": 4,
@@ -60,17 +59,25 @@
"modifier": { "modifier": {
"type": "cantTakeWounds", "type": "cantTakeWounds",
"filter": "self", "filter": "self",
"condition": { "condition": [
"type": "phase", {
"phase": "archery" "type": "phase",
} "phase": "archery"
},
{
"type": "sarumanfirstsentenceactive"
}
]
} }
}, },
{ {
"type": "modifier", "type": "modifier",
"modifier": { "modifier": {
"type": "cantbeassignedtoskirmish", "type": "cantbeassignedtoskirmish",
"filter": "self" "filter": "self",
"condition": {
"type": "sarumanfirstsentenceactive"
}
} }
}, },
{ {
@@ -104,5 +111,5 @@
} }
} }
] ]
}, }
} }

View File

@@ -44,6 +44,7 @@ public class RequirementFactory {
requirementProducers.put("cardsinhandmorethan", new CardsInHandMoreThan()); requirementProducers.put("cardsinhandmorethan", new CardsInHandMoreThan());
requirementProducers.put("cardsindeckcount", new CardsInDeckCount()); requirementProducers.put("cardsindeckcount", new CardsInDeckCount());
requirementProducers.put("playedcardthisphase", new PlayedCardThisPhase()); requirementProducers.put("playedcardthisphase", new PlayedCardThisPhase());
requirementProducers.put("sarumanfirstsentenceactive", new SarumanFirstSentenceActive());
} }
public Requirement getRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException { public Requirement getRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {

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.Requirement;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.ModifierFlag;
import org.json.simple.JSONObject;
public class SarumanFirstSentenceActive implements RequirementProducer {
@Override
public Requirement getPlayRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(object);
return (actionContext) -> {
final LotroGame game = actionContext.getGame();
return !game.getModifiersQuerying().hasFlagActive(game, ModifierFlag.SARUMAN_FIRST_SENTENCE_INACTIVE);
};
}
}