From f60e0514870fa6af46073671f1f9a02baf649e4a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 15 Apr 2023 12:09:31 +0200 Subject: Add explicit "End construction" button instead of pass/next. --- play.js | 1 + rules.js | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/play.js b/play.js index ca342df..7e2e764 100644 --- a/play.js +++ b/play.js @@ -1485,6 +1485,7 @@ function update_map() { action_button("pass", "Pass") action_button("next", "Next") + action_button("end_construction", "End construction") action_button("end_move", "End move") action_button("undo", "Undo") } diff --git a/rules.js b/rules.js index 0e3c181..a0aafd4 100644 --- a/rules.js +++ b/rules.js @@ -6921,10 +6921,7 @@ states.construct_stockades = { inactive: "construct stockades", prompt() { view.prompt = `Construct Stockades${format_remain(game.count)}.` - if (game.count > 0) - gen_action_pass() - else - gen_action_next() + gen_action("end_construction") if (game.count > 0) { for (let s = first_space; s <= last_space; ++s) { if (has_friendly_supplied_drilled_troops(s) || is_originally_friendly(s)) { @@ -6951,11 +6948,14 @@ states.construct_stockades = { set_add(player.stockades, s) game.count -- }, - pass() { + end_construction() { end_action_phase() }, + pass() { + this.end_construction() + }, next() { - end_action_phase() + this.end_construction() }, } @@ -6972,10 +6972,7 @@ states.construct_forts = { inactive: "construct forts", prompt() { view.prompt = `Construct Forts${format_remain(game.count)}.` - if (game.count > 0) - gen_action_pass() - else - gen_action_next() + gen_action("end_construction") if (game.count > 0) { for (let s = first_space; s <= last_space; ++s) { if (has_friendly_supplied_drilled_troops(s)) { @@ -7008,13 +7005,15 @@ states.construct_forts = { } game.count -- }, - pass() { + end_construction() { delete game.list end_action_phase() }, + pass() { + this.end_construction() + }, next() { - delete game.list - end_action_phase() + this.end_construction() }, } -- cgit v1.2.3