diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-04-15 12:09:31 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-04-15 12:09:31 +0200 |
commit | f60e0514870fa6af46073671f1f9a02baf649e4a (patch) | |
tree | a6133c9d93c00bc7805ff8b4d5d3590600cc6c78 | |
parent | 903e1002013938c5111726b9896b0f8da7666b74 (diff) | |
download | wilderness-war-f60e0514870fa6af46073671f1f9a02baf649e4a.tar.gz |
Add explicit "End construction" button instead of pass/next.
-rw-r--r-- | play.js | 1 | ||||
-rw-r--r-- | rules.js | 25 |
2 files changed, 13 insertions, 13 deletions
@@ -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") } @@ -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() }, } |