summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-08 00:46:04 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-08 00:46:04 +0200
commit0d0cf16d1273a3906b5d6a415d026fcb95d9bfff (patch)
treee2fc3163208550f7815cc28626029ee5837c6828 /rules.js
parentda2a93b7c5944a4d149dcb247ccc56069b8c90d0 (diff)
downloadtime-of-crisis-0d0cf16d1273a3906b5d6a415d026fcb95d9bfff.tar.gz
Improve Foederati message.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js18
1 files 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()
},
}