diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-08 00:46:04 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-08 00:46:04 +0200 |
commit | 0d0cf16d1273a3906b5d6a415d026fcb95d9bfff (patch) | |
tree | e2fc3163208550f7815cc28626029ee5837c6828 /rules.js | |
parent | da2a93b7c5944a4d149dcb247ccc56069b8c90d0 (diff) | |
download | time-of-crisis-0d0cf16d1273a3906b5d6a415d026fcb95d9bfff.tar.gz |
Improve Foederati message.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -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() }, } |