summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-14 13:45:32 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-14 13:45:32 +0200
commit30a618e7ac66468bd2fd8f7c9fc21cb748ecd900 (patch)
treea9e094f9203c343b2b119ca1e2b4faaf392591f8
parent8298fed69a64c4b82cb9bb969436105ab249f27b (diff)
downloadalgeria-30a618e7ac66468bd2fd8f7c9fc21cb748ecd900.tar.gz
react after harass
-rw-r--r--rules.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 31ac783..8470cb4 100644
--- a/rules.js
+++ b/rules.js
@@ -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()
}