From 0d0cf16d1273a3906b5d6a415d026fcb95d9bfff Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 8 Jul 2023 00:46:04 +0200 Subject: Improve Foederati message. --- rules.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/rules.js b/rules.js index 01c874c..3b06b4f 100644 --- a/rules.js +++ b/rules.js @@ -3124,19 +3124,15 @@ states.foederati_general = { barbarian(id) { let tribe = get_barbarian_tribe(id) let from = get_barbarian_location(id) - if (count_legions_in_army(game.count) > count_barbarians_in_army(game.count)) { - if (is_barbarian_inactive(id)) - log("Foederati inactive " + BARBARIAN_NAME[tribe] + " from %" + from + " to %" + game.where + ".") - else - log("Foederati " + BARBARIAN_NAME[tribe] + " from %" + from + " to %" + game.where + ".") + let name = is_barbarian_inactive(id) ? "inactive " + BARBARIAN_NAME[tribe] : BARBARIAN_NAME[tribe] + if (from === game.where) + log("Foederati " + name + " in %" + from + ".") + else + log("Foederati " + name + " in %" + from + " to %" + game.where + ".") + if (count_legions_in_army(game.count) > count_barbarians_in_army(game.count)) set_barbarian_location(id, ARMY + game.count) - } else { - if (is_barbarian_inactive(id)) - log("Foederati inactive " + BARBARIAN_NAME[tribe] + " in %" + from + ".") - else - log("Foederati " + BARBARIAN_NAME[tribe] + " in %" + from + ".") + else eliminate_barbarian(id) - } resume_take_actions() }, } -- cgit v1.2.3