summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-09 16:02:07 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-09 17:04:56 +0200
commit026086902880a4b89f2d7a95570c1c108c45fce8 (patch)
tree7dff13b941699495b65a9103103aabe09f8d1ccb
parent96e5760852f70fa492958c538b46fe66dbe8fb35 (diff)
downloadtime-of-crisis-026086902880a4b89f2d7a95570c1c108c45fce8.tar.gz
Select available only if can place governor or create army.
-rw-r--r--rules.js25
1 files 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
}