From 1db9608960fb9cf85959948baa677a1262942855 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 17 Jan 2023 12:08:13 +0100 Subject: Clamp melee hits in storm before totaling. --- rules.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index beca253..13ceba4 100644 --- a/rules.js +++ b/rules.js @@ -7459,8 +7459,8 @@ function goto_strike() { for (let pos of current_strike_positions()) { let lord = get_battle_array(pos) if (lord !== NOBODY) { - let hits = (game.battle.ah[pos] = count_lord_hits(lord)) - let xhits = (game.battle.ahx[pos] = count_lord_xhits(lord)) + let hits = count_lord_hits(lord) + let xhits = count_lord_xhits(lord) // STORM: Max 6 hits per lord in melee (12 since we count half-hits). if (game.battle.storm) { @@ -7468,6 +7468,9 @@ function goto_strike() { hits = 12 } + game.battle.ah[pos] = hits + game.battle.ahx[pos] = xhits + if (xhits > 2) log(`L${lord} ${xhits / 2} crossbow hits`) else if (xhits > 0) -- cgit v1.2.3