From b3f85795d1e72d0ee68da99f4976c734b63f0485 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Fri, 14 Mar 2025 18:21:45 -0400 Subject: Clean govern --- rules.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index eedc18a..5a8a9ab 100644 --- a/rules.js +++ b/rules.js @@ -1514,6 +1514,7 @@ function goto_conscript_space() { } states.conscript = { + inactive: "Conscript", prompt() { view.prompt = "Conscript: Select Tributaries, Qasbah or Delhi to place troops." @@ -1535,6 +1536,7 @@ states.conscript = { } states.conscript_space = { + inactive: "Conscript", prompt() { view.prompt = `Conscript: Place up to ${conscript_count()} Troops.` view.where = game.cmd.where @@ -1575,7 +1577,7 @@ function can_govern_in_space(s) { if (has_piece(AVAILABLE, DS, ELITE)) return true - if (has_piece(s, DS, ELITE) && has_piece(AVAILABLE, DS, DISC)) + if (has_piece(s, DS, ELITE) && has_piece(AVAILABLE, DS, DISC) && !has_piece(s, DS, DISC)) return true return false @@ -1601,6 +1603,7 @@ function goto_govern_space() { } states.govern = { + inactive: "Govern", prompt() { if (game.vm && game.vm.fp === 9) view.prompt = "Govern: Ignore Locations requirements." @@ -1617,12 +1620,14 @@ states.govern = { space(s) { push_undo() select_cmd_space(s, 1) + log_space(game.cmd.where, "Govern") goto_govern_space() }, end_govern: end_command, } states.govern_space = { + inactive: "Govern", prompt() { view.prompt = "Govern: Place a Governor or place a Qasbah and remove two Obedient Units." view.where = game.cmd.where @@ -1663,7 +1668,6 @@ states.govern_space = { } function end_govern_space() { - log_space(game.cmd.where, "Govern") pop_summary() game.state = "govern" } @@ -1851,6 +1855,7 @@ function end_rally_space() { } states.rally = { + inactive: "Rally", prompt() { if (game.current === BK) view.prompt = "Rally: Select Maharashtra or a Province with your presence" @@ -1875,6 +1880,7 @@ states.rally = { } states.rally_space = { + inactive: "Rally", prompt() { view.prompt = `Rally: Place up to ${rally_count()} ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}` view.where = game.cmd.where @@ -5408,7 +5414,7 @@ CODE[8 * 2 + 1] = [ [ vm_current, DS ], [ vm_prompt, ()=>`In each Province, free Govern and then add a Troop.` ], [ vm_space, true, 0, 999, (s)=>(is_adjacent_to_city(C_DEVAGIRI, s) || is_adjacent_to_city(C_GULBARGA, s)) && can_govern_in_space(s) ], - [ vm_free_govern ], + [ vm_govern_in_space ], [ vm_place, false, 1, 1, DS, TROOPS ], [ vm_endspace ], [ vm_return ], -- cgit v1.2.3