From befe5246c8e2968334033c14613f5420bd8ad185 Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Sun, 1 Sep 2024 00:56:10 +0200
Subject: Fix Washington attrition with 6 CU (roll for single attrition).

---
 rules.js | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/rules.js b/rules.js
index 0834fc5..2292b71 100644
--- a/rules.js
+++ b/rules.js
@@ -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)
+				}
 			}
 		}
 
-- 
cgit v1.2.3