summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-03-20 22:53:08 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commit2f226e47deea5242687cfc332ba03aea0e56057d (patch)
treeb63b1063029c0e016eaf56a4c8f9de0cd57333a2
parent1805573356a0ffe54a57d471cf834d0f9b8e7a1e (diff)
downloadwilderness-war-2f226e47deea5242687cfc332ba03aea0e56057d.tar.gz
Confirm end move without moving.
-rw-r--r--rules.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 70ebdd8..013f4d4 100644
--- a/rules.js
+++ b/rules.js
@@ -3058,7 +3058,10 @@ states.move = {
if (!has_unbesieged_enemy_fort_or_fortress(from))
gen_action('stop');
} else {
- gen_action_next()
+ if (game.move.used > 0)
+ gen_action_next()
+ else
+ gen_action_pass()
}
gen_action_demolish();
@@ -3133,11 +3136,27 @@ states.move = {
next() {
end_move();
},
+ pass() {
+ push_undo();
+ game.state = 'confirm_end_move';
+ },
demolish_fort: goto_demolish_fort,
demolish_stockade: goto_demolish_stockade,
demolish_fieldworks: goto_demolish_fieldworks,
}
+states.confirm_end_move = {
+ inactive: "move",
+ prompt() {
+ view.prompt = `You have not moved yet \u2014 are you sure you want to pass?`;
+ view.who = moving_piece();
+ gen_action_pass();
+ },
+ pass() {
+ end_move();
+ }
+}
+
function goto_retroactive_foul_weather() {
if (game.options.retroactive && game.retro_foul_weather) {
console.log("RETRO REWIND");