summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-17 12:08:13 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commit1db9608960fb9cf85959948baa677a1262942855 (patch)
tree62e05280032022daa13920df766890b5858a1d33 /rules.js
parent13690f493b77cec4bff55472d5a3ad9ec1d4ea4b (diff)
downloadnevsky-1db9608960fb9cf85959948baa677a1262942855.tar.gz
Clamp melee hits in storm before totaling.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files 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)