Incorporating PR #121 from Phallen Cassidy: when neither branch of a choice can be fulfilled, resorts to having the player choose which to perform rather than performing neither.
This commit is contained in:
@@ -53,11 +53,6 @@ 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);
|
||||
@@ -65,6 +60,16 @@ public class Choice implements EffectAppenderProducer {
|
||||
return new StackActionEffect(subAction);
|
||||
}
|
||||
|
||||
if (playableEffectAppenders.isEmpty()) {
|
||||
actionContext.setValueToMemory(memorize, "");
|
||||
textIndex = 0;
|
||||
for (EffectAppender possibleEffectAppender : possibleEffectAppenders) {
|
||||
playableEffectAppenders.add(possibleEffectAppender);
|
||||
effectTexts.add(GameUtils.substituteText(textArray[textIndex], actionContext));
|
||||
textIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
SubAction subAction = new SubAction(action);
|
||||
subAction.appendCost(
|
||||
new PlayoutDecisionEffect(choosingPlayer,
|
||||
|
||||
Reference in New Issue
Block a user