diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-09 16:02:07 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-09 17:04:56 +0200 |
commit | 026086902880a4b89f2d7a95570c1c108c45fce8 (patch) | |
tree | 7dff13b941699495b65a9103103aabe09f8d1ccb /rules.js | |
parent | 96e5760852f70fa492958c538b46fe66dbe8fb35 (diff) | |
download | time-of-crisis-026086902880a4b89f2d7a95570c1c108c45fce8.tar.gz |
Select available only if can place governor or create army.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -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 } |