diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-09-01 00:56:10 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-09-01 00:59:12 +0200 |
commit | befe5246c8e2968334033c14613f5420bd8ad185 (patch) | |
tree | fa63dd11bc76a090a5e670861fd14de19a8f7533 | |
parent | 0e04985adb759e257604cc14226d79fbc9b127a8 (diff) | |
download | washingtons-war-befe5246c8e2968334033c14613f5420bd8ad185.tar.gz |
Fix Washington attrition with 6 CU (roll for single attrition).
-rw-r--r-- | rules.js | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -3939,10 +3939,14 @@ states.american_winter_attrition = { // american stack else if (n_american > 0 && n_french === 0) { - if (wq && has_washington) - apply_winter_attrition(remove_american_cu, s, n_american - 5) - else + if (wq && has_washington) { + if (n_american === 6) + apply_single_winter_attrition(remove_american_cu, s) + else + apply_winter_attrition(remove_american_cu, s, n_american - 5) + } else { apply_winter_attrition(remove_american_cu, s, n_american) + } } // mixed stack @@ -3952,14 +3956,19 @@ states.american_winter_attrition = { n_total = Math.max(0, n_total - 5) // TODO: let player choose (but why would they ever choose French?) - let half = Math.floor(n_total / 2) - let lose_american = Math.min(half, n_american) - log(lose_american + " American CU at " + s) - remove_american_cu(s, n_american) - half -= lose_american - if (half > 0) { - log(half + " French CU at " + s) - remove_french_cu(s, half) + + if (n_total === 1) { + apply_winter_attrition(remove_american_cu, s, n_american) + } else { + let half = Math.floor(n_total / 2) + let lose_american = Math.min(half, n_american) + log(lose_american + " American CU at " + s) + remove_american_cu(s, n_american) + half -= lose_american + if (half > 0) { + log(half + " French CU at " + s) + remove_french_cu(s, half) + } } } |