summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-12-10 18:21:08 +0100
committerTor Andersson <tor@ccxvii.net>2024-12-10 18:21:08 +0100
commit35c925531b670275801c7d7057fb3b5c46985c92 (patch)
tree7164f9359c35c045049758110a095c186eea0744
parentf7f10fb376e1019b2c49d6e1fac1b35031bf00b3 (diff)
downloadmaria-35c925531b670275801c7d7057fb3b5c46985c92.tar.gz
Eliminate subordinate general in mixed stacks if too many hits.
-rw-r--r--rules.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index ca03f0e..b2164de 100644
--- a/rules.js
+++ b/rules.js
@@ -4113,13 +4113,15 @@ function goto_retreat() {
let loser = get_loser()
+ let xfer = is_mixed_stack(loser) ? 0 : 1
+
// no more fighting for the loser
remove_stack_from_combat(loser)
// apply hits
for (let i = game.selected.length - 1; i >= 0 && hits > 0; --i) {
let p = game.selected[i]
- while (game.troops[p] > 1 && hits > 0) {
+ while (game.troops[p] > xfer && hits > 0) {
lost[piece_power[p]]++
--game.troops[p]
--hits