diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-24 18:36:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 3f60a6b5c7141eea3be0186898597261036e74be (patch) | |
tree | 91b7a2e7b4b5be12bad42849a115d763863535e8 | |
parent | 79fc402a6aca823b694c7a4d9921222e1512f7b9 (diff) | |
download | friedrich-3f60a6b5c7141eea3be0186898597261036e74be.tar.gz |
limit max number of troops to 8 * generals in play
-rw-r--r-- | rules.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 ] |