summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-24 22:39:03 +0100
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commit4a374a395750dd97f375871d72764b4c5a74b784 (patch)
tree739593da68585101d7668aa812c51063b64d6bec
parent803296a169fea2cc55ab6b028026723e86e25a8a (diff)
downloadandean-abyss-4a374a395750dd97f375871d72764b4c5a74b784.tar.gz
Automatic Sabotage.
-rw-r--r--rules.js35
1 files changed, 11 insertions, 24 deletions
diff --git a/rules.js b/rules.js
index aa2d3bf..9db7d6e 100644
--- a/rules.js
+++ b/rules.js
@@ -4772,10 +4772,17 @@ function goto_final_victory() {
function goto_sabotage_phase() {
game.prop.step = 2
game.current = GOVT
- if (can_sabotage_phase())
- game.state = "sabotage"
- else
- goto_resources_phase()
+
+ log_h2("Sabotage Phase")
+
+ for (let s = first_loc; s <= last_loc; ++s) {
+ if (can_sabotage_phase_space(s)) {
+ log("Sabotaged S" + s + ".")
+ place_sabotage(s)
+ }
+ }
+
+ goto_resources_phase()
}
function is_adjacent_to_city_farc_control(s) {
@@ -4796,26 +4803,6 @@ function can_sabotage_phase_space(s) {
return false
}
-function can_sabotage_phase() {
- for (let s = first_loc; s <= last_loc; ++s)
- if (can_sabotage_phase_space(s))
- return true
-}
-
-states.sabotage = {
- prompt() {
- view.prompt = "Sabotage LoCs."
- for (let s = first_loc; s <= last_loc; ++s)
- if (can_sabotage_phase_space(s))
- gen_action_space(s)
- },
- space(s) {
- place_sabotage(s)
- if (!can_sabotage_phase())
- goto_resources_phase()
- },
-}
-
// PROPAGANDA: RESOURCES PHASE
function calc_govt_earnings() {