From 3f60a6b5c7141eea3be0186898597261036e74be Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 24 May 2024 18:36:46 +0200 Subject: limit max number of troops to 8 * generals in play --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index f28c49a..2c0e69c 100644 --- a/rules.js +++ b/rules.js @@ -115,7 +115,12 @@ function max_power_troops(pow) { return 3 if (game.scenario === 2 && pow === P_PRUSSIA) return 24 - return max_power_troops_4[pow] + let max = max_power_troops_4[pow] + let n = 0 + for (let p of all_power_generals[pow]) + if (game.pos[p] < REMOVED) + n += 8 + return Math.min(n, max) } const all_powers = [ 0, 1, 2, 3, 4, 5, 6 ] -- cgit v1.2.3