From b8d750a17e753c206a178d45980e7f55680efe69 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 12 Jul 2023 16:45:05 +0200 Subject: Cniva hits on 3+. --- rules.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/rules.js b/rules.js index 2abe4b9..6621b0f 100644 --- a/rules.js +++ b/rules.js @@ -4005,14 +4005,29 @@ function roll_rival_emperor_dice() { } function roll_barbarian_dice(tribe) { - log(BARBARIAN_NAME[tribe]) let prov = is_province(game.where) + let hits = 0 let n = 0 - for (let id = first_barbarian[tribe]; id <= last_barbarian[tribe]; ++id) - if (get_barbarian_location(id) === game.where) - if (prov || is_barbarian_active(id)) - n += is_barbarian_leader(id) ? 2 : 1 - return roll_dice(n, 4) + for (let id = first_barbarian[tribe]; id <= last_barbarian[tribe]; ++id) { + if (get_barbarian_location(id) === game.where) { + if (prov || is_barbarian_active(id)) { + if (id === CNIVA) { + log(barbarian_name(id)) + hits += roll_dice(2, 3) + } else if (id === ARDASHIR || id == SHAPUR) { + log(barbarian_name(id)) + hits += roll_dice(2, 4) + } else { + n += 1 + } + } + } + } + if (n > 0) { + log(BARBARIAN_NAME[tribe]) + hits += roll_dice(n, 4) + } + return hits } function roll_spiculum_dice() { -- cgit v1.2.3