From a32ed8eaf27473df806dc1d1c4fb0188eb231f22 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Mon, 2 Dec 2024 00:26:18 -0600 Subject: [PATCH] (Hopefully) fixing Phallen's choice PR such that it doesn't ruin any cards with a choice that happens to be a cost --- .../build/field/effect/appender/Choice.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/Choice.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/Choice.java index 581cebb03..b54208d36 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/Choice.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/Choice.java @@ -53,18 +53,32 @@ public class Choice implements EffectAppenderProducer { textIndex++; } - if (playableEffectAppenders.size() == 0) { - actionContext.setValueToMemory(memorize, ""); - return null; - } - if (playableEffectAppenders.size() == 1) { SubAction subAction = new SubAction(action); - playableEffectAppenders.get(0).appendEffect(cost, subAction, delegateActionContext); + playableEffectAppenders.getFirst().appendEffect(cost, subAction, delegateActionContext); actionContext.setValueToMemory(memorize, textArray[0]); return new StackActionEffect(subAction); } + if (playableEffectAppenders.isEmpty()) { + actionContext.setValueToMemory(memorize, ""); + + // Costs that are a choice should not let the player pick freely, else it effectively results in there + // being no cost at all. + if(cost) + return null; + + // If we are an effect however, then we will let "no valid choices" default to the player choosing + // which fork to go down; this should eliminate situations like Here Lies Balin doing nothing + // if there is a single 1-vitality Orc on the field + textIndex = 0; + for (var possibleEffectAppender : possibleEffectAppenders) { + playableEffectAppenders.add(possibleEffectAppender); + effectTexts.add(GameUtils.substituteText(textArray[textIndex], actionContext)); + textIndex++; + } + } + SubAction subAction = new SubAction(action); subAction.appendCost( new PlayoutDecisionEffect(choosingPlayer,