summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
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()
},
}