From b31786752425be4f8225d340294f669f04e05bb3 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sun, 8 Nov 2020 19:11:15 -0500
Subject: [PATCH] slaveslength

---
 src/endWeek/reports/arcadeReport.js | 160 ++++++++++++++--------------
 1 file changed, 80 insertions(+), 80 deletions(-)

diff --git a/src/endWeek/reports/arcadeReport.js b/src/endWeek/reports/arcadeReport.js
index 5ed70a30c9b..fefe9896bb2 100644
--- a/src/endWeek/reports/arcadeReport.js
+++ b/src/endWeek/reports/arcadeReport.js
@@ -9,16 +9,16 @@ App.EndWeek.arcadeReport = function() {
 	el.append(arcadeStats);
 
 	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.arcade);
-	const _DL = slaves.length;
-	let _cockmilked = 0, _milked = 0, _milkProfits = 0, _profits = 0, _boobsImplanted = 0, _prostatesImplanted = 0, _vasectomiesUndone = 0, _mSlave, _bSlave, _pSlave, _cSlave, _milkResults, _growth;
+	const slavesLength = slaves.length;
+	let cockmilked = 0, milked = 0, milkProfits = 0, profits = 0, boobsImplanted = 0, prostatesImplanted = 0, vasectomiesUndone = 0, mSlave, bSlave, pSlave, cSlave, milkResults, growth;
 
 	// Statistics gathering
 	V.facility = V.facility || {};
 	V.facility.arcade = initFacilityStatistics(V.facility.arcade);
-	const _arcadeNameCaps = capFirstChar(V.arcadeName);
+	const arcadeNameCaps = capFirstChar(V.arcadeName);
 
-	if (_DL > 1) {
-		App.UI.DOM.appendNewElement("p", el, `There are ${_DL} inmates confined in ${V.arcadeName}.`, ["bold", "indent"]);
+	if (slavesLength > 1) {
+		App.UI.DOM.appendNewElement("p", el, `There are ${slavesLength} inmates confined in ${V.arcadeName}.`, ["bold", "indent"]);
 	} else {
 		App.UI.DOM.appendNewElement("p", el, `There is one inmate confined in ${V.arcadeName}.`, ["bold", "indent"]);
 	}
@@ -34,7 +34,7 @@ App.EndWeek.arcadeReport = function() {
 	}
 	App.Events.addNode(el, r, "div", "indent");
 	if (V.arcadeDecoration !== "standard") {
-		App.Events.addNode(el, [`${_arcadeNameCaps}'s customers enjoy <span class="green">getting off in ${V.arcadeDecoration} surroundings.</span>`], "p", "indent");
+		App.Events.addNode(el, [`${arcadeNameCaps}'s customers enjoy <span class="green">getting off in ${V.arcadeDecoration} surroundings.</span>`], "p", "indent");
 	}
 
 	for (const slave of slaves) {
@@ -111,43 +111,43 @@ App.EndWeek.arcadeReport = function() {
 		if (V.arcadeUpgradeCollectors > 0) {
 			if (slave.vasectomy === 1) {
 				slave.vasectomy = 0;
-				_vasectomiesUndone++;
+				vasectomiesUndone++;
 				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
 				surgeryDamage(slave, 10);
 			} else if (slave.lactation < 2) {
 				slave.lactation = 2;
-				_boobsImplanted++;
-				_bSlave = slave;
+				boobsImplanted++;
+				bSlave = slave;
 				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
 				surgeryDamage(slave, 10);
 			} else if (slave.prostate === 1) {
 				slave.prostate = 2;
-				_prostatesImplanted++;
-				_pSlave = slave;
+				prostatesImplanted++;
+				pSlave = slave;
 				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
 				surgeryDamage(slave, 10);
 			} else if (slave.lactation > 0 || slave.balls > 0) {
-				_milkResults = App.SlaveAssignment.getMilked(slave, 1.0);
+				milkResults = App.SlaveAssignment.getMilked(slave, 1.0);
 				if (V.showEWD !== 0) {
-					r.push(App.UI.DOM.makeElement("div", `${He} ${_milkResults.text}`, "indent"));
+					r.push(App.UI.DOM.makeElement("div", `${He} ${milkResults.text}`, "indent"));
 				}
-				_milkProfits += _milkResults.cash;
-				_growth = 0;
-				const _gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;
+				milkProfits += milkResults.cash;
+				growth = 0;
+				const gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;
 				if (slave.boobs < 2000) {
-					_growth = 100;
-				} else if (slave.boobs < 5000 * _gigantomastiaMod) {
-					_growth = 50;
-				} else if (slave.boobs < 10000 * _gigantomastiaMod) {
-					_growth = 25;
+					growth = 100;
+				} else if (slave.boobs < 5000 * gigantomastiaMod) {
+					growth = 50;
+				} else if (slave.boobs < 10000 * gigantomastiaMod) {
+					growth = 25;
 				}
 				if (slave.geneMods.NCS === 1) {
 					/*
 					** NCS will allow some growth for Arcade milking, but not as much as the Dairy.
 					*/
-					_growth = Math.trunc(_growth / 3.5);
+					growth = Math.trunc(growth / 3.5);
 				}
-				slave.boobs += _growth;
+				slave.boobs += growth;
 				if (
 					(slave.balls > 0) &&
 					(slave.balls < 10) &&
@@ -163,12 +163,12 @@ App.EndWeek.arcadeReport = function() {
 					slave.dick++;
 				}
 				if (slave.lactation > 0) {
-					_milked++;
-					_mSlave = slave;
+					milked++;
+					mSlave = slave;
 				}
 				if (slave.balls > 0) {
-					_cockmilked++;
-					_cSlave = slave;
+					cockmilked++;
+					cSlave = slave;
 				}
 			}
 		}
@@ -183,51 +183,51 @@ App.EndWeek.arcadeReport = function() {
 		App.Events.addNode(el, r, "div", "indent");
 	}
 
-	if (_DL + V.fuckdolls > 0) {
+	if (slavesLength + V.fuckdolls > 0) {
 		r = [];
-		if (_milked === 1) {
-			const {his} = getPronouns(_mSlave);
+		if (milked === 1) {
+			const {his} = getPronouns(mSlave);
 			r.push(`One of them is lactating and spends ${his} time in ${V.arcadeName} being simultaneously milked and fucked.`);
-		} else if (_milked > 1) {
-			r.push(`${_milked} of them are lactating and spend their time in ${V.arcadeName} being simultaneously milked and fucked.`);
+		} else if (milked > 1) {
+			r.push(`${milked} of them are lactating and spend their time in ${V.arcadeName} being simultaneously milked and fucked.`);
 		}
 
-		if (_vasectomiesUndone) {
-			if (_vasectomiesUndone === 1) {
+		if (vasectomiesUndone) {
+			if (vasectomiesUndone === 1) {
 				r.push(`One`);
 			} else {
-				_vasectomiesUndone;
+				vasectomiesUndone;
 			}
-			r.push(`of them had severed vas deferens, so they were reattached to allow sperm through, costing <span class="red">${cashFormat(V.surgeryCost * _vasectomiesUndone)}.</span>`);
+			r.push(`of them had severed vas deferens, so they were reattached to allow sperm through, costing <span class="red">${cashFormat(V.surgeryCost * vasectomiesUndone)}.</span>`);
 		}
-		if (_boobsImplanted) {
-			if (_boobsImplanted === 1) {
-				const {he} = getPronouns(_bSlave);
+		if (boobsImplanted) {
+			if (boobsImplanted === 1) {
+				const {he} = getPronouns(bSlave);
 				r.push(`One of them was not lactating, so ${he} was`);
 			} else {
-				r.push(`${_boobsImplanted} of them were not lactating, so they were`);
+				r.push(`${boobsImplanted} of them were not lactating, so they were`);
 			}
-			r.push(`implanted with long-acting lactation inducing drugs, costing <span class="red">${cashFormat(V.surgeryCost * _boobsImplanted)}.</span>`);
+			r.push(`implanted with long-acting lactation inducing drugs, costing <span class="red">${cashFormat(V.surgeryCost * boobsImplanted)}.</span>`);
 		}
-		if (_prostatesImplanted) {
-			if (_prostatesImplanted === 1) {
-				const {he} = getPronouns(_pSlave);
+		if (prostatesImplanted) {
+			if (prostatesImplanted === 1) {
+				const {he} = getPronouns(pSlave);
 				r.push(`One of them was not producing the maximum possible amount of precum, so ${he} was`);
 			} else {
-				r.push(`${_prostatesImplanted} of them were not producing the maximum possible amount of precum, so they were`);
+				r.push(`${prostatesImplanted} of them were not producing the maximum possible amount of precum, so they were`);
 			}
-			r.push(`implanted with long-acting prostate stimulation drugs, costing <span class="red">${cashFormat(V.surgeryCost * _prostatesImplanted)}.</span>`);
+			r.push(`implanted with long-acting prostate stimulation drugs, costing <span class="red">${cashFormat(V.surgeryCost * prostatesImplanted)}.</span>`);
 		}
-		if (_cockmilked === 1) {
-			const {he} = getPronouns(_cSlave);
+		if (cockmilked === 1) {
+			const {he} = getPronouns(cSlave);
 			r.push(`One of them retains testicles and is brutally cockmilked as ${he} is used.`);
-		} else if (_cockmilked > 1) {
-			r.push(`${_cockmilked} of them retain testicles and are brutally cockmilked as they are used.`);
+		} else if (cockmilked > 1) {
+			r.push(`${cockmilked} of them retain testicles and are brutally cockmilked as they are used.`);
 		}
 
 		r.push(`The arcade makes you`);
 		if (V.policies.publicFuckdolls === 0) {
-			r.push(`<span class="yellowgreen">${cashFormat(_profits)}</span> from selling the inmates' holes`);
+			r.push(`<span class="yellowgreen">${cashFormat(profits)}</span> from selling the inmates' holes`);
 		} else {
 			r.push(`<span class="green">more reputable</span> from freely providing the inmates' holes`);
 		}
@@ -235,68 +235,68 @@ App.EndWeek.arcadeReport = function() {
 			r.push(`and`);
 		}
 		if (V.arcadeUpgradeCollectors > 0) {
-			r.push(`<span class="yellowgreen">${cashFormat(_milkProfits)}</span> from selling the fluids they produced`);
+			r.push(`<span class="yellowgreen">${cashFormat(milkProfits)}</span> from selling the fluids they produced`);
 		}
 		r.push(`this week.`);
 		if (V.arcologies[0].FSPaternalist > 20) {
-			repX(forceNeg(Math.trunc(_profits / 20)), "arcade");
+			repX(forceNeg(Math.trunc(profits / 20)), "arcade");
 		}
 		App.Events.addNode(el, r, "div", "indent");
 	}
 
 	if (V.arcadeUpgradeFuckdolls === 2) {
-		let _currentSlave, _Age = -1, _FD = -1, _MB = -1, _Con = -1;
+		let currentSlave, Age = -1, FD = -1, MB = -1, Con = -1;
 		for (const slave of slaves) {
 			if (slave.sentence === 0) { /* let's not convert slaves we are punishing into Fuckdolls */
 				if (slave.fetish === "mindbroken") {
 					if (slave.fuckdoll === 0) {
 						if (slave.physicalAge > 35) {
-							_Age = V.i;
+							Age = V.i;
 							break;
-						} else if (_FD === -1) {
-							_FD = V.i;
+						} else if (FD === -1) {
+							FD = V.i;
 						}
-					} else if (_MB === -1) {
+					} else if (MB === -1) {
 						if (slave.vagina >= 4 || slave.anus >= 4) {
-							_Con = V.i;
+							Con = V.i;
 						} else if (slave.physicalAge > 35) {
-							_Age = V.i;
+							Age = V.i;
 						} else {
-							_MB = V.i;
+							MB = V.i;
 						}
 					}
-				} else if (_Con === -1) {
+				} else if (Con === -1) {
 					if (slave.vagina >= 4 || slave.anus >= 4) {
-						_Con = V.i;
+						Con = V.i;
 					} else if (slave.physicalAge > 35) {
-						_Age = V.i;
+						Age = V.i;
 					}
 				}
 			}
 		}
-		if (_FD > -1) {
-			_currentSlave = V.slaves[_FD];
-		} else if (_Con > -1) {
-			_currentSlave = V.slaves[_Con];
-		} else if (_MB > -1) {
-			_currentSlave = V.slaves[_MB];
-		} else if (_Age > -1) {
-			_currentSlave = V.slaves[_Age];
+		if (FD > -1) {
+			currentSlave = V.slaves[FD];
+		} else if (Con > -1) {
+			currentSlave = V.slaves[Con];
+		} else if (MB > -1) {
+			currentSlave = V.slaves[MB];
+		} else if (Age > -1) {
+			currentSlave = V.slaves[Age];
 		}
-		if (_currentSlave) {
-			const {he} = getPronouns(_currentSlave);
-			App.UI.DOM.appendNewElement("div", el, `${_currentSlave.slaveName} is low-quality merchandise, so ${he} has been converted into a Fuckdoll.`, "indent");
-			removeSlave(_currentSlave);
-			if (!_currentSlave) { /* if not, then technically there was an error INVALID SLAVE */
+		if (currentSlave) {
+			const {he} = getPronouns(currentSlave);
+			App.UI.DOM.appendNewElement("div", el, `${currentSlave.slaveName} is low-quality merchandise, so ${he} has been converted into a Fuckdoll.`, "indent");
+			removeSlave(currentSlave);
+			if (!currentSlave) { /* if not, then technically there was an error INVALID SLAVE */
 				V.fuckdolls++;
-				_SL--;
+				SL--;
 			}
 		} else {
-			App.UI.DOM.appendNewElement("div", el, `No slaves have failed quality inspection for Fuckdoll conversion. ${_arcadeNameCaps} will remain overcrowded this week.`, "indent");
+			App.UI.DOM.appendNewElement("div", el, `No slaves have failed quality inspection for Fuckdoll conversion. ${arcadeNameCaps} will remain overcrowded this week.`, "indent");
 		}
 	}
 
-	if (_DL > 0) {
+	if (slavesLength > 0) {
 		// Record statistics gathering
 		let b = V.facility.arcade;
 		b.whoreIncome = 0;
-- 
GitLab