summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-10 12:15:04 +0100
committerTor Andersson <tor@ccxvii.net>2023-03-10 12:45:00 +0100
commit11e9ca1a0d8699dadf296c3bee7f922588a61195 (patch)
tree9935bc98286ec9fb91d623a0698eb6264d354d85
parent5fa490516ba075eb9ff486449f70f9457dca802d (diff)
downloadnevsky-11e9ca1a0d8699dadf296c3bee7f922588a61195.tar.gz
Add confirmation when approaching enemy Lord.
-rw-r--r--play.js1
-rw-r--r--rules.js25
2 files changed, 25 insertions, 1 deletions
diff --git a/play.js b/play.js
index 70302bd..b3e2f56 100644
--- a/play.js
+++ b/play.js
@@ -1755,6 +1755,7 @@ function on_update() {
action_button("hold", "Hold")
action_button("play", "Play")
+ action_button("approach", "Approach")
action_button("concede", "Concede")
action_button("battle", "Battle")
diff --git a/rules.js b/rules.js
index 4565437..a2e5737 100644
--- a/rules.js
+++ b/rules.js
@@ -1659,6 +1659,9 @@ exports.setup = function (seed, scenario, options) {
spoils: 0,
}
+ if (options.skip_confirm_approach)
+ game.skip_confirm_approach = 1
+
update_aliases()
log_h1(scenario)
@@ -4867,7 +4870,7 @@ function march_with_group_2() {
remove_legate_if_endangered(from)
if (has_unbesieged_enemy_lord(to)) {
- goto_avoid_battle()
+ goto_confirm_approach()
} else {
march_with_group_3()
}
@@ -4908,6 +4911,26 @@ function march_with_group_3() {
update_supply_possible()
}
+function goto_confirm_approach() {
+ if (game.skip_confirm_approach) {
+ goto_avoid_battle()
+ return
+ }
+ game.state = "confirm_approach"
+}
+
+states.confirm_approach = {
+ inactive: "March",
+ prompt() {
+ view.prompt = `March: Confirm Approach to enemy Lord.`
+ view.group = game.group
+ view.actions.approach = 1
+ },
+ approach() {
+ goto_avoid_battle()
+ }
+}
+
// === ACTION: MARCH - AVOID BATTLE ===
function count_besieged_lords(loc) {