diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-05 07:58:05 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-05 07:58:05 -0400 |
commit | ca9acbbddbc56e4091c74ae1d9215a2cb41134a9 (patch) | |
tree | 3df290a0b34f165c4c893082a60f88e557bc951c /rules.js | |
parent | eba83e9a2378f3063ee0f1379963256673e0a66a (diff) | |
download | vijayanagara-ca9acbbddbc56e4091c74ae1d9215a2cb41134a9.tar.gz |
Rebel combat resolution based on casualties
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1520,12 +1520,13 @@ function goto_attack_resolution() { } function attack_influence_shift() { - // TODO: Must be linked to pieces removed, not hits scored. let up = null, down = null - if (game.cmd.a_hit > game.cmd.d_hit) { + let score_a = Math.min(game.cmd.a_hit, game.cmd.n_units[1]) + let score_d = Math.min(game.cmd.d_hit, game.cmd.n_units[0]) + if (score_a > score_d) { up = game.cmd.attacker down = game.cmd.target - } else if (game.cmd.a_hit < game.cmd.d_hit) { + } else if (score_a < score_d) { down = game.cmd.attacker up = game.cmd.target } |