diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-11-02 15:50:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-11-02 15:50:31 +0100 |
commit | b5797e6d486a1dfc9ef4fc98ef400f442a533236 (patch) | |
tree | 83b8097844234fc5244fdaef2b62e5810bb279ea | |
parent | dffebaad66b230a35ef220de666b8bfc0ae9bbf7 (diff) | |
download | algeria-b5797e6d486a1dfc9ef4fc98ef400f442a533236.tar.gz |
Round halved firepower per unit.
-rw-r--r-- | rules.js | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -3799,8 +3799,10 @@ function goto_combat() { //logi("G" + gov_roll + " Combat") for (let u of game.combat.gov_units) { if (game.combat.harass) { - logi(`${unit_firepower(u)/2} U${u} (half)`) - gov_firepower += unit_firepower(u) / 2 + // When units fire at half Firepower Rating, round fractions up. + let fp = Math.ceil(unit_firepower(u)/2) + logi(`${fp} U${u} (half)`) + gov_firepower += fp } else { logi(`${unit_firepower(u)} U${u}`) gov_firepower += unit_firepower(u) @@ -3810,11 +3812,6 @@ function goto_combat() { set_unit_loc(u, loc) } - // When units fire at half Firepower Rating, round fractions up. - if (game.combat.harass) { - gov_firepower = Math.ceil(gov_firepower) - } - for (let i = 0; i < game.mission_air_pts; ++i) { let roll = roll_d6() logi("G" + roll + " Air PTS") |