summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-20 10:46:35 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-20 10:46:35 +0200
commit8da79606f2db817aba5775dbb511837c92e87023 (patch)
tree9fdbaf0f39d6bf0ed516257637e06c82b417bc7d
parenta35e8edccdbdfa29c29beb68f30fed84725e682b (diff)
downloadalgeria-8da79606f2db817aba5775dbb511837c92e87023.tar.gz
auto pass
-rw-r--r--play.js1
-rw-r--r--rules.js70
2 files changed, 55 insertions, 16 deletions
diff --git a/play.js b/play.js
index ebb1629..d05b184 100644
--- a/play.js
+++ b/play.js
@@ -577,6 +577,7 @@ function on_update() { // eslint-disable-line no-unused-vars
action_button("use_air_point", "Air Point")
action_button("airmobilize", "Airmobilize")
action_button("no_react", "No React")
+ action_button("auto_pass", "Auto-Pass")
action_button("pass", "Pass")
action_button("add_fln_psl", "+1 FLN PSL")
diff --git a/rules.js b/rules.js
index a299048..9dab02b 100644
--- a/rules.js
+++ b/rules.js
@@ -2742,6 +2742,8 @@ function end_deployment() {
function goto_operations_phase() {
game.passes = 0
+ delete game.fln_auto_pass
+ delete game.gov_auto_pass
// In Algeria, the OAS marker will automatically conduct one Suppression mission in the Operations Phase, at no cost in PSP and no requirement for a Police unit.
if (is_area_algerian(game.oas)) {
@@ -2767,9 +2769,13 @@ function goto_fln_operations_phase() {
game.phasing = FLN_NAME
set_active_player()
log_h2(`${game.active} Operations`)
- game.state = "fln_operations"
-
clear_combat()
+
+ if (game.fln_auto_pass) {
+ fln_pass()
+ } else {
+ game.state = "fln_operations"
+ }
}
const FLN_PROPAGANDA_COST = 1
@@ -2815,6 +2821,7 @@ states.fln_operations = {
// Only allow to Government to take a mission if they didn't just pass.
view.actions.gov_mission = !game.passes
+ gen_action("auto_pass")
gen_action("pass")
},
propaganda() {
@@ -2838,13 +2845,25 @@ states.fln_operations = {
goto_gov_operations_phase()
},
pass() {
+ fln_pass()
+ },
+ auto_pass() {
+ game.fln_auto_pass = true
+ fln_pass()
+ }
+}
+
+function fln_pass() {
+ if (game.fln_auto_pass) {
+ log("FLN Auto Passes")
+ } else {
log("FLN Passes")
- game.passes += 1
- if (game.passes >= 2) {
- end_operations_phase()
- } else {
- goto_gov_operations_phase()
- }
+ }
+ game.passes += 1
+ if (game.passes >= 2) {
+ end_operations_phase()
+ } else {
+ goto_gov_operations_phase()
}
}
@@ -3635,9 +3654,13 @@ function goto_gov_operations_phase() {
game.phasing = GOV_NAME
set_active_player()
log_h2(`${game.active} Operations`)
- game.state = "gov_operations"
-
clear_combat()
+
+ if (game.gov_auto_pass) {
+ gov_pass()
+ } else {
+ game.state = "gov_operations"
+ }
}
const GOV_INTELLIGENCE_COST = 1
@@ -3675,6 +3698,7 @@ states.gov_operations = {
}
})
+ gen_action("auto_pass")
gen_action("pass")
},
flush() {
@@ -3692,14 +3716,26 @@ states.gov_operations = {
population_resettlement() {
goto_gov_population_resettlement_mission()
},
+ auto_pass() {
+ game.gov_auto_pass = true
+ gov_pass()
+ },
pass() {
+ gov_pass()
+ }
+}
+
+function gov_pass() {
+ if (game.gov_auto_pass) {
+ log("Government Auto Passes")
+ } else {
log("Government Passes")
- game.passes += 1
- if (game.passes >= 2) {
- end_operations_phase()
- } else {
- goto_fln_operations_phase()
- }
+ }
+ game.passes += 1
+ if (game.passes >= 2) {
+ end_operations_phase()
+ } else {
+ goto_fln_operations_phase()
}
}
@@ -4340,6 +4376,8 @@ function clear_combat() {
function end_operations_phase() {
game.passes = 0
+ delete game.fln_auto_pass
+ delete game.gov_auto_pass
clear_combat()
goto_turn_interphase()
}