summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-15 12:09:31 +0200
committerTor Andersson <tor@ccxvii.net>2023-04-15 12:09:31 +0200
commitf60e0514870fa6af46073671f1f9a02baf649e4a (patch)
treea6133c9d93c00bc7805ff8b4d5d3590600cc6c78
parent903e1002013938c5111726b9896b0f8da7666b74 (diff)
downloadwilderness-war-f60e0514870fa6af46073671f1f9a02baf649e4a.tar.gz
Add explicit "End construction" button instead of pass/next.
-rw-r--r--play.js1
-rw-r--r--rules.js25
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()
},
}