From a67c99e98883ff4408dbf83ca19d3db7488c5752 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 cd09d1a..756d217 100644 --- a/rules.js +++ b/rules.js @@ -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) -- cgit v1.2.3