diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-03-10 12:15:04 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-03-10 12:45:00 +0100 |
commit | 11e9ca1a0d8699dadf296c3bee7f922588a61195 (patch) | |
tree | 9935bc98286ec9fb91d623a0698eb6264d354d85 | |
parent | 5fa490516ba075eb9ff486449f70f9457dca802d (diff) | |
download | nevsky-11e9ca1a0d8699dadf296c3bee7f922588a61195.tar.gz |
Add confirmation when approaching enemy Lord.
-rw-r--r-- | play.js | 1 | ||||
-rw-r--r-- | rules.js | 25 |
2 files changed, 25 insertions, 1 deletions
@@ -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") @@ -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) { |