diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-02-11 19:02:19 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-02-11 19:16:19 +0100 |
commit | a67c99e98883ff4408dbf83ca19d3db7488c5752 (patch) | |
tree | 5c81cb776014672edd4173581d1cbbd1fc1cb093 | |
parent | 80aac888c43987f1d4770732e7fee25a3989c63f (diff) | |
download | time-of-crisis-a67c99e98883ff4408dbf83ca19d3db7488c5752.tar.gz |
v4: foederati - adjacent only (active or inactive)
-rw-r--r-- | rules.js | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -3561,11 +3561,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 } @@ -3576,12 +3573,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) } } @@ -3598,8 +3592,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) @@ -3616,7 +3610,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() { @@ -3638,7 +3632,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) |