diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-16 01:09:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:27 +0100 |
commit | 7fae364e76db6646bd462adc58258d27c532e2b6 (patch) | |
tree | a898776a2160467cd7131e000ccf830b636659dc | |
parent | e40e0171938dfe33c7069f2ca5c199a294bcd586 (diff) | |
download | rommel-in-the-desert-7fae364e76db6646bd462adc58258d27c532e2b6.tar.gz |
Group dice when firing double/quadruple during assault/fortress defense.
-rw-r--r-- | rules.js | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -4737,25 +4737,30 @@ function is_minefield_offensive_fire() { function roll_battle_fire(who, tc) { let fc = unit_class[who] let cv = unit_cv(who) + let n = 1 // Double dice during assault if (is_assault_battle()) - cv *= 2 + n *= 2 // Double dice for non-armor defenders in fortress! if (fc !== ARMOR && is_fortress_defensive_fire()) - cv *= 2 + n *= 2 let fp = FIREPOWER_MATRIX[fc][tc] let result = [] let total = 0 - for (let i = 0; i < cv; ++i) { - let roll = roll_die() - if (roll >= fp) { - result.push(die_face_hit[roll]) - ++total - } else { - result.push(die_face_miss[roll]) + for (let k = 0; k < n; ++k) { + if (k > 0) + result.push(" ") + for (let i = 0; i < cv; ++i) { + let roll = roll_die() + if (roll >= fp) { + result.push(die_face_hit[roll]) + ++total + } else { + result.push(die_face_miss[roll]) + } } } |