From 026086902880a4b89f2d7a95570c1c108c45fce8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 9 Jul 2023 16:02:07 +0200 Subject: Select available only if can place governor or create army. --- rules.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/rules.js b/rules.js index 1ad40df..85dcf54 100644 --- a/rules.js +++ b/rules.js @@ -1685,8 +1685,15 @@ function can_select_general(id) { if (where === UNAVAILABLE) return game.mip >= id % 6 - if (where === AVAILABLE) - return game.mip >= 1 + + if (where === AVAILABLE) { + if (game.mip >= 1) { + for (let i = 0; i < 12; ++i) + if (is_own_province(i)) + return true + } + return false + } // Disperse Mob if (game.mip >= 1 && get_mobs(where) && is_own_province(where)) @@ -1721,8 +1728,15 @@ function can_select_governor(id) { if (where === UNAVAILABLE) return game.sip >= id % 6 - if (where === AVAILABLE) - return game.sip >= 1 + + if (where === AVAILABLE) { + if (game.sip >= 1) { + for (let i = 0; i < 12; ++i) + if (can_place_governor(i)) + return true + } + return false + } // Recall if (game.sip >= 2) @@ -2960,7 +2974,6 @@ states.replace_pretender_governor = { }, } - // CARD: CASTRA function can_play_castra() { @@ -3198,7 +3211,7 @@ states.foederati_militia = { function can_play_mob() { for (let where = 0; where < 12; ++where) - if (!get_mobs(where) && is_enemy_province(where)) + if (!get_mobs(where) && is_enemy_province(where) && !is_province_of_populace_emperor(where)) return true return false } -- cgit v1.2.3