From a22eb4ab7c82d41b44da9d646776a08b87ca636c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 27 May 2024 16:55:19 +0200 Subject: log actual number of troops lost --- rules.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 5afbba0..942a1df 100644 --- a/rules.js +++ b/rules.js @@ -2416,15 +2416,14 @@ function remove_stack_from_combat(s) { } function goto_retreat() { - let hits = Math.abs(game.count) + let lost = Math.abs(game.count) + let hits = lost let loser = get_loser() // no more fighting for the loser remove_stack_from_combat(loser) - log("P" + get_supreme_commander(loser) + " lost " + hits + " troops.") - // apply hits for (let i = game.selected.length - 1; i >= 0 && hits > 0; --i) { let p = game.selected[i] @@ -2442,6 +2441,8 @@ function goto_retreat() { } } + log("P" + get_supreme_commander(loser) + " lost " + (lost-hits) + " troops") + resume_retreat() } -- cgit v1.2.3