Various card fixes

- Fixed Mordor Scimitar only triggering off itself being assigned and not its bearer
- Fixed Neekerbreeker's syntax errors
- Fixed Celebring being Aid (1) instead of (2)
- (hopefully) Fixed Morannon Plains only asking one player
- (hopefully) fixed Out of Dark Waters not triggering if the tentacle was killed by the wound
This commit is contained in:
Christian 'ketura' McCarty
2024-11-27 01:44:55 -06:00
parent a2000ac20b
commit bb1b558cb5
9 changed files with 49 additions and 33 deletions

View File

@@ -1040,7 +1040,7 @@
optional: true
trigger: {
type: assignedAgainst
filter: self
filter: bearer
against: companion
memorizeAgainst: assignedComp
}

View File

@@ -818,7 +818,7 @@
player: free people
optional: true
trigger: {
type: movesTo
type: movesFrom
filter: self
}
requires: {
@@ -902,12 +902,11 @@
{
type: memorize
filter: character,minResistance(5)
memorize: healedChars
memory: healedChars
}
{
type: heal
select: all(memory(healedChars))
memorize: healedChars
}
{
type: exert

View File

@@ -179,6 +179,7 @@
type: aidCost
cost: {
type: addTwilight
amount: 2
}
}
{

View File

@@ -152,21 +152,13 @@
}
effect: [
{
type: optional
text: Would you like to reinforce a culture token
player: free people
type: ForEachPlayer
effect: {
type: reinforceTokens
player: free people
}
}
{
type: optional
text: Would you like to reinforce a culture token
player: shadow
effect: {
type: reinforceTokens
player: shadow
type: optional
text: Would you like to reinforce a culture token
effect: {
type: reinforceTokens
}
}
}
]

View File

@@ -242,12 +242,11 @@
{
type: memorize
filter: character,minResistance(5)
memorize: healedChars
memory: healedChars
}
{
type: heal
select: all(memory(healedChars))
memorize: healedChars
}
{
type: exert

View File

@@ -83,6 +83,7 @@
type: CostToEffect
cost: {
type: Discard
player: freeps
select: choose(tentacle)
}
effect: {
@@ -369,11 +370,18 @@
{
type: Trigger
optional: true
trigger: {
type: TakesWound
filter: tentacle
memorize: woundedTentacle
}
trigger: [
{
type: TakesWound
filter: tentacle
memorize: woundedTentacle
}
{
type: Killed
filter: tentacle
cause: wounds
}
]
effect: {
type: StackCardsFromPlay
select: memory(woundedTentacle)

View File

@@ -7,6 +7,7 @@ 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.game.PhysicalCard;
import com.gempukku.lotro.logic.effects.KillEffect;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.timing.results.ForEachKilledResult;
import org.json.simple.JSONObject;
@@ -14,12 +15,13 @@ import org.json.simple.JSONObject;
public class Killed implements TriggerCheckerProducer {
@Override
public TriggerChecker getTriggerChecker(JSONObject value, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(value, "filter", "killer", "inSkirmish", "memorize");
FieldUtils.validateAllowedFields(value, "filter", "killer", "inSkirmish", "cause", "memorize");
final String filter = FieldUtils.getString(value.get("filter"), "filter", "any");
final String byFilter = FieldUtils.getString(value.get("killer"), "killer", "any");
final String memorize = FieldUtils.getString(value.get("memorize"), "memorize");
final boolean inSkirmish = FieldUtils.getBoolean(value.get("inSkirmish"), "inSkirmish", false);
final KillEffect.Cause cause = FieldUtils.getEnum(KillEffect.Cause.class, value.get("cause"), "cause");
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
final FilterableSource byFilterableSource = environment.getFilterFactory().generateFilter(byFilter, environment);
@@ -37,10 +39,10 @@ public class Killed implements TriggerCheckerProducer {
boolean result = false;
if(inSkirmish) {
result = TriggerConditions.forEachKilledInASkirmish(actionContext.getGame(), actionContext.getEffectResult(), byFilterable, filterable);
result = TriggerConditions.forEachKilledInASkirmish(actionContext.getGame(), actionContext.getEffectResult(), byFilterable, cause, filterable);
}
else {
result = TriggerConditions.forEachKilledBy(actionContext.getGame(), actionContext.getEffectResult(), byFilterable, filterable);
result = TriggerConditions.forEachKilledBy(actionContext.getGame(), actionContext.getEffectResult(), byFilterable, cause, filterable);
}
if (result && memorize != null) {

View File

@@ -21,7 +21,19 @@ public class KillEffect extends AbstractSuccessfulEffect {
private final Cause _cause;
public enum Cause {
WOUNDS, OVERWHELM, CARD_EFFECT
WOUNDS, OVERWHELM, CARD_EFFECT;
public static Cause parse(String name) {
String nameCaps = name.toUpperCase().trim()
.replace(' ', '_')
.replace('-', '_');
for (Cause cause : values()) {
if (cause.toString().equals(nameCaps))
return cause;
}
return null;
}
}
public KillEffect(PhysicalCard card, PhysicalCard killer, Cause cause) {

View File

@@ -297,14 +297,14 @@ public class TriggerConditions {
}
public static boolean forEachKilled(LotroGame game, EffectResult effectResult, Filterable... filters) {
return forEachKilledBy(game, effectResult, Filters.any, filters);
return forEachKilledBy(game, effectResult, Filters.any, null, filters);
}
public static boolean forEachKilledBy(LotroGame game, EffectResult effectResult, Filterable killedBy, Filterable... killed) {
public static boolean forEachKilledBy(LotroGame game, EffectResult effectResult, Filterable killedBy, KillEffect.Cause cause, Filterable... killed) {
if (effectResult.getType() == EffectResult.Type.FOR_EACH_WOUNDED) {
return forEachMortallyWoundedBy(game, effectResult, killedBy, killed);
} else if (effectResult.getType() == EffectResult.Type.FOR_EACH_KILLED) {
if (forEachKilledInASkirmish(game, effectResult, killedBy, killed))
if (forEachKilledInASkirmish(game, effectResult, killedBy, cause, killed))
return true;
ForEachKilledResult killResult = (ForEachKilledResult) effectResult;
@@ -319,12 +319,15 @@ public class TriggerConditions {
return false;
}
public static boolean forEachKilledInASkirmish(LotroGame game, EffectResult effectResult, Filterable killedBy, Filterable... killed) {
public static boolean forEachKilledInASkirmish(LotroGame game, EffectResult effectResult, Filterable killedBy, KillEffect.Cause cause, Filterable... killed) {
if (effectResult.getType() == EffectResult.Type.FOR_EACH_KILLED
&& game.getGameState().getCurrentPhase() == Phase.SKIRMISH
&& Filters.countActive(game, Filters.inSkirmish, killedBy) > 0) {
ForEachKilledResult killResult = (ForEachKilledResult) effectResult;
if(cause != null && killResult.getCause() != cause)
return false;
return Filters.and(killed).accepts(game, killResult.getKilledCard());
}
return false;