diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-14 13:45:32 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-14 13:45:32 +0200 |
commit | 30a618e7ac66468bd2fd8f7c9fc21cb748ecd900 (patch) | |
tree | a9e094f9203c343b2b119ca1e2b4faaf392591f8 /rules.js | |
parent | 8298fed69a64c4b82cb9bb969436105ab249f27b (diff) | |
download | algeria-30a618e7ac66468bd2fd8f7c9fc21cb748ecd900.tar.gz |
react after harass
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -2904,7 +2904,7 @@ states.fln_harass = { game.combat = { fln_units: [], gov_units: [], - half_firepower: 1 + harass: 1 } for (let u of list) { if (is_gov_unit(u)) { @@ -2920,7 +2920,7 @@ states.fln_harass = { function goto_combat() { // TODO merge contacted / fln_units - // game.combat = {fln_units: [], gov_units: [], half_firepower: false} + // game.combat = {fln_units: [], gov_units: [], harass: false} // game.combat = {hits_on_fln: 0, hits_on_gov: 0, distribute_gov_psl: 0} let loc = unit_loc(game.combat.fln_units[0]) @@ -2941,7 +2941,7 @@ function goto_combat() { gov_firepower += unit_firepower(u) } let half_str = '' - if (game.combat.half_firepower) { + if (game.combat.harass) { // When units fire at half Firepower Rating, round fractions up. gov_firepower = Math.ceil(gov_firepower / 2) half_str = " (half)" @@ -3008,7 +3008,17 @@ function end_combat() { set_unit_box(u, OC) } - // TODO allow React on Harass mission? + // allow React on Harass mission + if (game.combat.harass) { + if (check_victory()) + return + // Gov can React + delete game.combat.harass + if (can_gov_react()) { + goto_gov_react_mission() + return + } + } end_gov_mission() } |