summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-18 21:41:05 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commit9d58bfa984ba47815376b7341d63f17c356668ff (patch)
treee3e3dd1e204179d33a26e5df3052c85c33b47578
parentdfef3ea74ea73966a9685f8f2c72ef556a6acc58 (diff)
downloadandean-abyss-9d58bfa984ba47815376b7341d63f17c356668ff.tar.gz
Don't abruptly end Elite Backing and 7th Special Forces states.
-rw-r--r--rules.js29
1 files 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() {