From e7e48239a6da1e727735845e70e3565591da4de6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 11 Feb 2025 19:02:19 +0100 Subject: v4: foederati - adjacent only (active or inactive) --- rules.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/rules.js b/rules.js index 0b033c0..87f82f4 100644 --- a/rules.js +++ b/rules.js @@ -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) -- cgit v1.2.3