diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-02-11 19:02:19 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-02-15 10:36:15 +0100 |
commit | e7e48239a6da1e727735845e70e3565591da4de6 (patch) | |
tree | ad4130a485c9a85e3774b7b2269f08c6794e5779 /rules.js | |
parent | f7e4ab2a75786e8b132eaa6a09ce9bf5c00acf23 (diff) | |
download | time-of-crisis-e7e48239a6da1e727735845e70e3565591da4de6.tar.gz |
v4: foederati - adjacent only (active or inactive)
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -3602,11 +3602,8 @@ function can_foederati_from_region(where) { for (let tribe = 0; tribe < tribe_count; ++tribe) { if (find_active_non_leader_barbarian_of_tribe(where, tribe) >= 0) return true - if (is_classic()) { - // v3: only active barbarians - if (find_inactive_non_leader_barbarian_of_tribe(where, tribe) >= 0) - return true - } + if (find_inactive_non_leader_barbarian_of_tribe(where, tribe) >= 0) + return true } return false } @@ -3617,12 +3614,9 @@ function gen_foederati(where) { let id = find_active_non_leader_barbarian_of_tribe(where, tribe) if (id >= 0) gen_action_barbarian(id) - if (is_classic()) { - // v3: only active barbarians - id = find_inactive_non_leader_barbarian_of_tribe(where, tribe) - if (id >= 0) - gen_action_barbarian(id) - } + id = find_inactive_non_leader_barbarian_of_tribe(where, tribe) + if (id >= 0) + gen_action_barbarian(id) } } @@ -3639,8 +3633,8 @@ function can_play_foederati_v1() { return false } -function can_play_foederati_v3() { - // v3: only active barbarians and not adjacent +function can_play_foederati_v4() { + // v4: only barbarians in current region for (let i = 0; i < 6; ++i) { let id = game.current * 6 + i let where = get_general_location(id) @@ -3657,7 +3651,7 @@ function can_play_foederati() { if (is_classic()) return can_play_foederati_v1() else - return can_play_foederati_v3() + return can_play_foederati_v4() } function play_foederati() { @@ -3679,7 +3673,7 @@ states.foederati = { if (is_province(where) && has_lone_militia(where) && can_foederati_from_region_or_adjacent(where)) gen_action_militia(where) } else { - // v3: only active barbarians and not adjacent + // v4: only current region let where = get_general_location(id) if (is_region(where) && can_foederati_from_region(where)) gen_action_general(id) |