summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-14 01:35:15 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commit662c74265ea9c3bdeb04fea06abcc659c01085e8 (patch)
tree2d0b1c7819ea3d15c2e1a4563dcedace06e99d63 /rules.js
parent63d05083dae2e5af214163f0c4677d4abb758462 (diff)
downloadandean-abyss-662c74265ea9c3bdeb04fea06abcc659c01085e8.tar.gz
7th Special Forces during Sabotage.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js40
1 files changed, 38 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 25df28f..987a38e 100644
--- a/rules.js
+++ b/rules.js
@@ -15,6 +15,8 @@
// TODO: auto-skip civic action
// TODO: auto-skip agitation
+// TODO: auto-end Extort ?
+
const AUTOMATIC = true
let states = {}
@@ -1218,6 +1220,7 @@ function place_terror(s) {
}
function remove_terror(s) {
+ log(`Removed Terror from S${s}.`)
let n = map_get(game.terror, s, 0)
if (n > 1)
map_set(game.terror, s, n - 1)
@@ -2042,7 +2045,7 @@ function adjust_eligibility(faction) {
game.cylinder[faction] = ELIGIBLE
else if (game.cylinder[faction] !== ELIGIBLE)
game.cylinder[faction] = INELIGIBLE
-
+
if (game.marked & (1 << faction))
game.cylinder[faction] = INELIGIBLE
if (game.marked & (16 << faction))
@@ -5317,7 +5320,7 @@ function goto_sabotage_phase() {
if (can_sabotage_phase())
game.state = "sabotage"
else
- goto_resources_phase()
+ end_sabotage_phase()
}
}
@@ -5356,8 +5359,41 @@ states.sabotage = {
space(s) {
place_sabotage(s)
if (!can_sabotage_phase())
+ end_sabotage_phase()
+ },
+}
+
+function end_sabotage_phase() {
+ if (has_capability(CAP_7TH_SF) && (game.sabotage.length > 0 || game.terror.length > 0)) {
+ game.current = GOVT
+ game.state = "sabotage_7th_sf"
+ game.prop.count = 0
+ } else {
+ goto_resources_phase()
+ }
+}
+
+states.sabotage_7th_sf = {
+ prompt() {
+ view.prompt = "Remove 1-3 Terror or Sabotage."
+ for (let s of game.sabotage)
+ gen_action_space(s)
+ for (let i = 0; i < game.terror.length; i += 2)
+ gen_action_space(game.terror[i])
+ if (game.prop.count > 0)
+ view.actions.skip = 1
+ },
+ space(s) {
+ if (is_loc(s))
+ remove_sabotage(s)
+ else
+ remove_terror(s)
+ if (++game.prop.count === 3)
goto_resources_phase()
},
+ skip() {
+ goto_resources_phase()
+ },
}
// PROPAGANDA: RESOURCES PHASE