From da38a6a9083f340ea1225e7761c42ad7ead30fdf Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 6 Nov 2020 15:29:23 -0500
Subject: [PATCH] add some doc

---
 src/endWeek/reports/dairyReport.js | 41 ++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/endWeek/reports/dairyReport.js b/src/endWeek/reports/dairyReport.js
index b661d9292a3..4ae14e08276 100644
--- a/src/endWeek/reports/dairyReport.js
+++ b/src/endWeek/reports/dairyReport.js
@@ -26,7 +26,6 @@ App.EndWeek.dairyReport = function() {
 	V.milkmaidTrustThreshold = 35;
 	let He, His, he, his, him, wife, girl;
 	let he2, his2;
-	let Tadd;
 	let milkResults;
 	let growth;
 	let cashValue;
@@ -353,7 +352,7 @@ App.EndWeek.dairyReport = function() {
 		App.Events.addParagraph(el, r);
 	}
 
-	Tadd = (V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren);
+	const Tadd = (V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren);
 	if (DL + Tadd > 0) {
 		r = [];
 		if (DL !== 1) {
@@ -415,6 +414,8 @@ App.EndWeek.dairyReport = function() {
 
 
 		/* Perform facility based rule changes */
+
+		// Set diet
 		if (V.dairySlimMaintain === 0) {
 			if (V.dairyWeightSetting === 0) {
 				if (slave.weight <= 30) {
@@ -454,6 +455,8 @@ App.EndWeek.dairyReport = function() {
 		} else if (slave.diet === "fattening" || slave.diet === "healthy" || V.dairyRestraintsSetting > 1) {
 			slave.diet = "healthy";
 		}
+
+		// Set clothing and accessories
 		if (V.dairyRestraintsSetting > 1) {
 			slave.collar = "none";
 			slave.faceAccessory = "none";
@@ -468,6 +471,8 @@ App.EndWeek.dairyReport = function() {
 			slave.chastityPenis = 0;
 			slave.chastityVagina = 0;
 		}
+
+		// Set living standard
 		switch (V.dairyDecoration) {
 			case "Arabian Revivalist":
 			case "Aztec Revivalist":
@@ -484,6 +489,8 @@ App.EndWeek.dairyReport = function() {
 			default:
 				slave.rules.living = "normal";
 		}
+
+		// Set child destination
 		if (V.dairyPregSetting > 0) {
 			WombCleanGenericReserve(slave, "incubator", 9999);
 			WombCleanGenericReserve(slave, "nursery", 9999);
@@ -530,6 +537,8 @@ App.EndWeek.dairyReport = function() {
 			slave.devotion -= 5;
 			slave.trust -= 5;
 		}
+
+		// Heal
 		if (slave.health.condition < -80) {
 			improveCondition(slave, 20);
 		} else if (slave.health.condition < -40) {
@@ -539,9 +548,13 @@ App.EndWeek.dairyReport = function() {
 		} else if (slave.health.condition < 90) {
 			improveCondition(slave, 3);
 		}
+
+		// Empty inflation
 		if (slave.inflation > 0) {
 			deflate(slave);
 		}
+
+		// Boobs grow
 		const gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;
 		if (slave.lactation > 0 && (V.dairySlimMaintain === 0 || slave.boobs > 700)) {
 			if (slave.boobs < 2000) {
@@ -558,16 +571,22 @@ App.EndWeek.dairyReport = function() {
 			}
 			slave.boobs += growth;
 		}
+
+		// Prostate growth
 		if (slave.prostate === 1) {
 			slave.prostate = 2;
 			cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
 			surgeryDamage(slave, 10);
 		}
+
+		// Undo Vasectomy
 		if (slave.vasectomy === 1) {
 			slave.vasectomy = 0;
 			cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
 			surgeryDamage(slave, 10);
 		}
+
+		// Slim
 		if (V.dairySlimMaintain === 0) {
 			if (V.dairyImplantsSetting <= 1) {
 				if (slave.lactation < 2 && (slave.boobs > 300 || slave.balls === 0 || slave.lactation === 1 || V.dairyImplantsSetting === 1)) {
@@ -582,6 +601,8 @@ App.EndWeek.dairyReport = function() {
 				}
 			}
 		}
+
+		// Hormones
 		if (V.dairyHormonesSetting >= 0) {
 			if (slave.lactation > 0) {
 				slave.hormones = V.dairyHormonesSetting;
@@ -591,6 +612,8 @@ App.EndWeek.dairyReport = function() {
 				slave.hormones = V.dairyHormonesSetting;
 			}
 		}
+
+		// Feeders
 		if (V.dairyFeedersUpgrade === 1 && V.dairyFeedersSetting > 0) {
 			if (V.dairySlimMaintain === 0 && slave.diet === "fattening") {
 				slave.weight += 2;
@@ -733,7 +756,8 @@ App.EndWeek.dairyReport = function() {
 				}
 			}
 		}
-		/* closes (${V.dairyFeedersUpgrade} === 1) && (V.dairyFeedersSetting > 0) */
+
+		// Stimulators
 		if (V.dairyStimulatorsUpgrade === 1 && V.dairyStimulatorsSetting > 0) {
 			if (V.dairyStimulatorsSetting > 1 && slave.anus < 4) {
 				slave.anus++;
@@ -813,6 +837,8 @@ App.EndWeek.dairyReport = function() {
 				}
 			}
 		}
+
+		// Restraints
 		if (V.dairyRestraintsSetting > 1) {
 			if (slave.lactation > 0) {
 				slave.lactationAdaptation += 1;
@@ -856,6 +882,8 @@ App.EndWeek.dairyReport = function() {
 				cmSlave = slave;
 			}
 		}
+
+		// Stimulator + Feeders + Pregnancy
 		if ((V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting) > 5) {
 			if (slave.devotion <= 95 && slave.sexualFlaw !== "self hating") {
 				if (slave.sexualFlaw !== "breeder" || slave.preg < 0) {
@@ -1007,7 +1035,9 @@ App.EndWeek.dairyReport = function() {
 			} else {
 				slave.chem++;
 			}
-		}/* closes (V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting) > 5 */
+		}
+
+		// Pregnancy
 		if (V.dairyPregUpgrade === 1 && V.dairyPregSetting > 0) {
 			if (slave.ovaries === 1 && slave.vagina > -1) {
 				femCumWeek += girlCumAmount(slave);
@@ -1054,8 +1084,9 @@ App.EndWeek.dairyReport = function() {
 				}
 			}
 		}
-	}
+	} // End slave loop.
 
+	// Inflation
 	if (inflatedSlaves.milk > 0) {
 		milkWeek -= ((8 * inflatedSlaves.milk * 10) + 8);
 	}
-- 
GitLab