From 29f6a1a42060ce3a15b5d7e4bec0c538eb937085 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 25 Jun 2022 12:38:59 +0200 Subject: Tweak next prompt wording. Use "Pass" consistently for response event prompts. Use "Pass" when there are more stockades/forts to build. --- rules.js | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/rules.js b/rules.js index ea9d0ab..f1ac342 100644 --- a/rules.js +++ b/rules.js @@ -4504,7 +4504,7 @@ states.attacker_events = { view.prompt += " You don't have " + dont_have.join(" or ") + "." if (have.length === 0 && dont_have.length === 0) view.prompt += " You have no more response events." - gen_action_next() + gen_action_pass() }, play_event(c) { push_undo() @@ -4523,6 +4523,9 @@ states.attacker_events = { break } }, + pass() { + goto_battle_defender_events() + }, next() { goto_battle_defender_events() }, @@ -4573,7 +4576,7 @@ states.defender_events = { view.prompt += " You don't have " + dont_have.join(" or ") + "." if (have.length === 0 && dont_have.length === 0) view.prompt += " You have no more response events." - gen_action_next() + gen_action_pass() }, play_event(c) { push_undo() @@ -4592,6 +4595,9 @@ states.defender_events = { break } }, + pass() { + goto_battle_roll() + }, next() { goto_battle_roll() }, @@ -6745,7 +6751,10 @@ states.construct_stockades = { inactive: "construct stockades", prompt() { view.prompt = `Construct Stockades${format_remain(game.count)}.` - gen_action_next() + if (game.count > 0) + gen_action_pass() + else + gen_action_next() if (game.count > 0) { for (let s = first_space; s <= last_space; ++s) { if (has_friendly_supplied_drilled_troops(s) || is_originally_friendly(s)) { @@ -6772,6 +6781,9 @@ states.construct_stockades = { player.stockades.push(s) game.count -- }, + pass() { + end_action_phase() + }, next() { end_action_phase() }, @@ -6790,7 +6802,10 @@ states.construct_forts = { inactive: "construct forts", prompt() { view.prompt = `Construct Forts${format_remain(game.count)}.` - gen_action_next() + if (game.count > 0) + gen_action_pass() + else + gen_action_next() if (game.count > 0) { for (let s = first_space; s <= last_space; ++s) { if (has_friendly_supplied_drilled_troops(s)) { @@ -6823,6 +6838,10 @@ states.construct_forts = { } game.count -- }, + pass() { + delete game.list + end_action_phase() + }, next() { delete game.list end_action_phase() @@ -9454,10 +9473,8 @@ function gen_action(action, argument) { } } -function gen_action_next(prompt) { - if (!view.actions) - view.actions = {} - view.actions.next = prompt || 1 +function gen_action_next() { + gen_action('next') } function gen_action_pass() { -- cgit v1.2.3