From 69f87f5e64278ea05f37f71f3681ebfe2a58fc7f Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 6 Nov 2020 16:12:16 -0500
Subject: [PATCH] formula improve

---
 src/endWeek/reports/dairyReport.js | 45 +++++++++++++++---------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/endWeek/reports/dairyReport.js b/src/endWeek/reports/dairyReport.js
index 60be3e1a64e..29546f43ab5 100644
--- a/src/endWeek/reports/dairyReport.js
+++ b/src/endWeek/reports/dairyReport.js
@@ -14,6 +14,9 @@ App.EndWeek.dairyReport = function() {
 	let anusesStretched = 0, birthers = 0, births = 0, cumWeek = 0, femCumWeek = 0, FLsFetish = 0, milkWeek = 0, balltacular = 0, boobtacular = 0, careerForgotten = 0, chemMinor = 0, chemSevere = 0, desterilized = 0, hateFilled = 0, horrified = 0, intelligenceLost = 0, mindbroken = 0, profits = 0, skillsLost = 0, stupidified = 0, vaginasStretched = 0;
 	let cmSlave, dsSlave, hfSlave, hrSlave, slSlave, cfSlave, stSlave, btSlave;
 	const inflatedSlaves = App.Facilities.Dairy.inflation();
+	const dairySettings = V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting;
+	const restrainedInjected = V.dairyRestraintsSetting + V.injectionUpgrade;
+	const boobsCalc = Math.trunc(V.injectionUpgrade * 2) + V.dairyRestraintsSetting + V.dairyFeedersSetting;
 	V.bioreactorPerfectedID = 0;
 	V.legendaryBallsID = 0;
 	V.legendaryCowID = 0;
@@ -620,20 +623,19 @@ App.EndWeek.dairyReport = function() {
 				improveCondition(slave, 25);
 			} else {
 				if (V.dairySlimMaintain === 0 && slave.lactation > 0) {
-					const growthCalc = Math.trunc(V.injectionUpgrade * 2) + V.dairyFeedersSetting + V.dairyRestraintsSetting;
 					if (V.dairyStimulatorsSetting > 0) {
 						if (V.dairyFeedersSetting > 1) {
 							if (slave.boobs < 50000) {
 								if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
 									if (slave.boobs < 2000) {
-										growth = 75 * growthCalc + (50 / 4);
+										growth = 75 * boobsCalc + (50 / 4);
 									} else if (slave.boobs < 5000 * gigantomastiaMod) {
-										growth = 50 * growthCalc + (50 / 4);
+										growth = 50 * boobsCalc + (50 / 4);
 									} else {
-										growth = 25 * growthCalc + (50 / 4);
+										growth = 25 * boobsCalc + (50 / 4);
 									}
 								} else {
-									growth = 25 * growthCalc + ((50 - slave.physicalAge) / 4);
+									growth = 25 * boobsCalc + ((50 - slave.physicalAge) / 4);
 								}
 								if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
 									boobtacular++;
@@ -649,14 +651,14 @@ App.EndWeek.dairyReport = function() {
 							if (slave.boobs < 25000) {
 								if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
 									if (slave.boobs < 2000) {
-										growth = 75 * growthCalc + (50 / 4);
+										growth = 75 * boobsCalc + (50 / 4);
 									} else if (slave.boobs < 5000 * gigantomastiaMod) {
-										growth = 50 * growthCalc + (50 / 4);
+										growth = 50 * boobsCalc + (50 / 4);
 									} else {
-										growth = 25 * growthCalc + (50 / 4);
+										growth = 25 * boobsCalc + (50 / 4);
 									}
 								} else {
-									growth = 25 * growthCalc + ((50 - slave.physicalAge) / 4);
+									growth = 25 * boobsCalc + ((50 - slave.physicalAge) / 4);
 								}
 								if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
 									boobtacular++;
@@ -671,14 +673,14 @@ App.EndWeek.dairyReport = function() {
 						if (slave.boobs < 10000) {
 							if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
 								if (slave.boobs < 2000) {
-									growth = 75 * growthCalc + (50 / 4);
+									growth = 75 * boobsCalc + (50 / 4);
 								} else if (slave.boobs < 5000 * gigantomastiaMod) {
-									growth = 50 * growthCalc + (50 / 4);
+									growth = 50 * boobsCalc + (50 / 4);
 								} else {
-									growth = 25 * growthCalc + (50 / 4);
+									growth = 25 * boobsCalc + (50 / 4);
 								}
 							} else {
-								growth = 25 * growthCalc + ((50 - slave.physicalAge) / 4);
+								growth = 25 * boobsCalc + ((50 - slave.physicalAge) / 4);
 							}
 							if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
 								boobtacular++;
@@ -692,14 +694,14 @@ App.EndWeek.dairyReport = function() {
 						if (slave.boobs < 5000) {
 							if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
 								if (slave.boobs < 2000) {
-									growth = 75 * growthCalc + (50 / 4);
+									growth = 75 * boobsCalc + (50 / 4);
 								} else if (slave.boobs < 5000 * gigantomastiaMod) {
-									growth = 50 * growthCalc + (50 / 4);
+									growth = 50 * boobsCalc + (50 / 4);
 								} else {
-									growth = 25 * growthCalc + (50 / 4);
+									growth = 25 * boobsCalc + (50 / 4);
 								}
 							} else {
-								growth = 25 * growthCalc + ((50 - slave.physicalAge) / 4);
+								growth = 25 * boobsCalc + ((50 - slave.physicalAge) / 4);
 							}
 							if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
 								boobtacular++;
@@ -712,7 +714,7 @@ App.EndWeek.dairyReport = function() {
 					}
 				}
 				if (slave.balls > 0) {
-					const ballFormula = 10 * (slave.balls - (V.dairyRestraintsSetting + V.injectionUpgrade));
+					const ballFormula = 10 * (slave.balls - restrainedInjected);
 					if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
 						if (slave.geneMods.NCS === 0 && slave.balls < 125) {
 							slave.balls++;
@@ -739,7 +741,7 @@ App.EndWeek.dairyReport = function() {
 						}
 					}
 					if (slave.dick > 0) {
-						const dickFormula = 10 * (4 + slave.dick - (V.dairyRestraintsSetting + V.injectionUpgrade));
+						const dickFormula = 10 * (4 + slave.dick - restrainedInjected);
 						if (slave.dick < 10) {
 							if (slave.geneMods.NCS === 0 && random(1, 100) > dickFormula) {
 								slave.dick++;
@@ -765,7 +767,6 @@ App.EndWeek.dairyReport = function() {
 			if (slave.health.condition < 60) {
 				improveCondition(slave, 20);
 			} else if (V.dairySlimMaintain === 0 && slave.lactation > 0) {
-				const boobsCalc = Math.trunc(V.injectionUpgrade * 2) + V.dairyFeedersSetting + V.dairyRestraintsSetting;
 				if (V.dairyFeedersSetting > 1) {
 					if (slave.boobs < 50000) {
 						if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
@@ -879,7 +880,7 @@ App.EndWeek.dairyReport = function() {
 		}
 
 		// Stimulator + Feeders + Pregnancy
-		if ((V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting) > 5) {
+		if (dairySettings > 5) {
 			if (slave.devotion <= 95 && slave.sexualFlaw !== "self hating") {
 				if (slave.sexualFlaw !== "breeder" || slave.preg < 0) {
 					if (slave.devotion > -75) {
@@ -956,7 +957,7 @@ App.EndWeek.dairyReport = function() {
 			} else {
 				slave.chem += 2;
 			}
-		} else if ((V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting) > 3) {
+		} else if (dairySettings > 3) {
 			if (slave.devotion < 75) {
 				if (slave.devotion > -75) {
 					slave.devotion -= 5;
-- 
GitLab