From 9d58bfa984ba47815376b7341d63f17c356668ff Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 18 Apr 2023 21:41:05 +0200 Subject: Don't abruptly end Elite Backing and 7th Special Forces states. --- rules.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index eeb70ac..866965a 100644 --- a/rules.js +++ b/rules.js @@ -3792,7 +3792,7 @@ states.rally = { function resume_rally() { if (game.op.elite_backing) - end_elite_backing() + game.state = "elite_backing_done" else if (game.vm) end_operation() else @@ -5751,7 +5751,7 @@ states.sabotage = { } function end_sabotage_phase() { - if (has_capability(CAP_7TH_SF) && (game.sabotage.length > 0 || game.terror.length > 0)) { + if (has_capability(CAP_7TH_SF) && count_terror_and_sabotage() > 0) { game.current = GOVT game.state = "sabotage_7th_sf" game.prop.count = 0 @@ -5779,14 +5779,24 @@ states.sabotage_7th_sf = { logi("Removed Terror from S" + s) remove_terror(s) } - if (++game.prop.count === 3) - goto_resources_phase() + if (++game.prop.count === 3 || count_terror_and_sabotage() === 0) + game.state = "sabotage_7th_sf_done" }, skip() { goto_resources_phase() }, } +states.sabotage_7th_sf_done = { + prompt() { + view.prompt = "7th Special Forces: All done." + view.actions.done = 1 + }, + done() { + goto_resources_phase() + }, +} + // PROPAGANDA: RESOURCES PHASE function calc_govt_earnings() { @@ -6096,6 +6106,17 @@ states.elite_backing = { }, } +states.elite_backing_done = { + prompt() { + view.prompt = "Elite Backing: All done." + view.actions.done = 1 + }, + done() { + game.op = null + end_elite_backing() + }, +} + // PROPAGANDA: REDEPLOY PHASE function goto_redeploy_phase() { -- cgit v1.2.3