summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index 8d55078..4e33e65 100644
--- a/rules.js
+++ b/rules.js
@@ -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])
+ }
}
}