From 2f226e47deea5242687cfc332ba03aea0e56057d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 20 Mar 2022 22:53:08 +0100 Subject: Confirm end move without moving. --- rules.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3