From a203c20151d58f223c72c0f0bf3579f94a363146 Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Fri, 19 Feb 2021 14:51:44 +0100
Subject: [PATCH] Code style and type checking improvements

---
 devTools/types/FC/misc.d.ts             |   8 +
 js/003-data/miscData.js                 | 161 ++++++++---------
 js/003-data/slaveWearData.js            |   1 +
 src/Mods/SpecialForce/SpecialForce.js   |  11 +-
 src/descriptions/arcologyDescription.js |   2 +-
 src/descriptions/officeDescription.js   |   2 +-
 src/endWeek/economics/persBusiness.js   |   2 +-
 src/interaction/main/toychest.js        |   4 +-
 src/interaction/main/useGuard.js        |   7 +-
 src/interaction/siCustom.js             |   9 +-
 src/interaction/siDescription.js        |   1 -
 src/interaction/siFinancial.js          |   1 -
 src/interaction/siNavigation.js         |   2 -
 src/interaction/siPhysicalRegimen.js    |  34 ++--
 src/interaction/siRules.js              |   5 +-
 src/interaction/siUtilities.js          |   3 +-
 src/interaction/siWardrobe.js           |   7 +-
 src/interaction/siWork.js               | 220 +++++++++++++++++++-----
 src/interaction/slaveInteract.js        |   4 +-
 src/js/assignJS.js                      |   4 +-
 src/js/birth/birth.js                   |  56 +++---
 src/js/consistencyCheck.js              |   2 +-
 src/js/economyJS.js                     | 119 +++++++------
 src/js/eventSelectionJS.js              |   1 -
 src/js/extendedFamilyModeJS.js          |  15 +-
 src/js/itemAvailability.js              |   5 +-
 src/js/pregJS.js                        |  12 +-
 src/js/quickListJS.js                   |   1 +
 src/js/relationshipChecks.js            |  10 +-
 src/js/removeSlave.js                   |   3 +-
 src/js/salon.js                         |  23 ++-
 src/js/sexActsJS.js                     |   5 -
 src/js/slaveCostJS.js                   |  51 ++++--
 src/js/slaveListing.js                  |  22 ++-
 src/js/slaveSummaryHelpers.js           |  18 +-
 src/js/slaveSummaryWidgets.js           |  14 +-
 src/js/statsChecker/statsChecker.js     |   1 -
 src/js/storyJS.js                       |  23 +--
 src/js/utilsArcology.js                 |   2 +-
 src/js/utilsMisc.js                     |  58 +++----
 src/js/utilsSlave.js                    |   2 +-
 src/js/utilsSlaves.js                   |  15 +-
 src/js/wombJS.js                        |   2 -
 43 files changed, 594 insertions(+), 354 deletions(-)

diff --git a/devTools/types/FC/misc.d.ts b/devTools/types/FC/misc.d.ts
index 1fe6353be8b..dda79ab6dd6 100644
--- a/devTools/types/FC/misc.d.ts
+++ b/devTools/types/FC/misc.d.ts
@@ -8,6 +8,14 @@ declare namespace FC {
 	type GingeringDetection = Zeroable<"slaver" | "mercenary" | "force">;
 	type SlaveActs = "PCChildrenFathered" | "PCKnockedUp" | "anal" | "births" | "birthsTotal" | "cum" | "laborCount" | "mammary" | "milk" | "oral" | "penetrative" | "pitKills" | "miscarriages" | "publicUse" | "slavesFathered" | "slavesKnockedUp" | "vaginal" | "abortions" | "birth";
 
+	interface SlaveSchool {
+		title: string,
+		nickname: string,
+		branchName: string,
+		slaveNoun: string,
+		readonly requirements: boolean,
+	}
+
 	namespace SlaveSummary {
 		interface SmartPiercing {
 			setting: {
diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js
index 59cd16e3e00..e40d3aa54ff 100644
--- a/js/003-data/miscData.js
+++ b/js/003-data/miscData.js
@@ -1727,86 +1727,6 @@ App.Data.misc = {
 
 	secExCombatPrestige: ["$He is well known for being a great commander.", "$He is famous for being an incredible commander.", "$He is known as a legendary commander all over the world."],
 
-	schools: new Map([
-		// Medical feel
-		["GRI", {
-			title:"Growth Research Institute",
-			nickname: "institute",
-			branchName:"subsidiary lab",
-			slaveNoun: "test subjects",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-
-		// Cowgirls
-		["TCR", {
-			title:"The Cattle Ranch",
-			nickname: "farm",
-			branchName:"local pasture",
-			slaveNoun: "stock",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-
-		// Futa
-		["TFS", {
-			title:"The Futanari Sisters",
-			nickname: "community",
-			branchName:"community",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 0); }
-		}],
-
-		// Standard
-		["HA", {
-			title:"The Hippolyta Academy",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-		["NUL", {
-			title:"Nueva Universidad de Libertad",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			requirements: true
-		}],
-		["SCP", {
-			title:"St. Claver Preparatory",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-		["TGA", {
-			title:"The Gymnasium-Academy",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 0); }
-		}],
-		["TSS", {
-			title:"The Slavegirl School",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-		["LDE", {
-			title:"L'École des Enculées",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 0); }
-		}],
-		["TUO", {
-			title:"The Utopian Orphanage",
-			nickname: "school",
-			branchName:"branch campus",
-			slaveNoun: "graduates",
-			get requirements() { return (V.seeDicks !== 100); }
-		}],
-	]),
-
 	bioreactorFluids: {
 		XX: {
 			femCum: 2,
@@ -1827,6 +1747,87 @@ App.Data.misc = {
 	}
 };
 
+/** @type {Map<FC.SlaveSchoolName, FC.SlaveSchool>} */
+App.Data.misc.schools = new Map([
+	// Medical feel
+	["GRI", {
+		title: "Growth Research Institute",
+		nickname: "institute",
+		branchName: "subsidiary lab",
+		slaveNoun: "test subjects",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+
+	// Cowgirls
+	["TCR", {
+		title: "The Cattle Ranch",
+		nickname: "farm",
+		branchName: "local pasture",
+		slaveNoun: "stock",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+
+	// Futa
+	["TFS", {
+		title: "The Futanari Sisters",
+		nickname: "community",
+		branchName: "community",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 0); }
+	}],
+
+	// Standard
+	["HA", {
+		title: "The Hippolyta Academy",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+	["NUL", {
+		title: "Nueva Universidad de Libertad",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		requirements: true
+	}],
+	["SCP", {
+		title: "St. Claver Preparatory",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+	["TGA", {
+		title: "The Gymnasium-Academy",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 0); }
+	}],
+	["TSS", {
+		title: "The Slavegirl School",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+	["LDE", {
+		title: "L'École des Enculées",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 0); }
+	}],
+	["TUO", {
+		title: "The Utopian Orphanage",
+		nickname: "school",
+		branchName: "branch campus",
+		slaveNoun: "graduates",
+		get requirements() { return (V.seeDicks !== 100); }
+	}],
+]);
+
 /* Nationalities based on V.continent value. Note that V.continent can be undefined! */
 App.Data.misc.nationalityPoolSelector = {
 	"North America": App.Data.misc.northAmericaNationalities,
diff --git a/js/003-data/slaveWearData.js b/js/003-data/slaveWearData.js
index 3c660cebb52..71b26894309 100644
--- a/js/003-data/slaveWearData.js
+++ b/js/003-data/slaveWearData.js
@@ -1576,6 +1576,7 @@ App.Data.bellyAccessory = new Map([
  * @typedef {object} slaveWearChastity
  * @property {string} name
  * @property {object} updateSlave
+ * @property {string} [note]
  * @property {itemFS} [fs]
  */
 
diff --git a/src/Mods/SpecialForce/SpecialForce.js b/src/Mods/SpecialForce/SpecialForce.js
index d4e2c74109b..2a873a316e5 100644
--- a/src/Mods/SpecialForce/SpecialForce.js
+++ b/src/Mods/SpecialForce/SpecialForce.js
@@ -1133,6 +1133,10 @@ App.SF.fsIntegration = (function() {
 	}
 })();
 
+/**
+ * @param {number} [endWeekCall=1]
+ * @returns {[string, number]}
+ */
 App.SF.AAR = function(endWeekCall = 1) {
 	const S = V.SF.Squad;
 	const size = App.SF.upgrades.total();
@@ -1505,11 +1509,8 @@ App.SF.AAR = function(endWeekCall = 1) {
 			V.SF.MercCon.CanAttend = -1;
 		}
 	}
-	if (endWeekCall > 0) {
-		return r;
-	} else {
-		return upkeep;
-	}
+
+	return [r, upkeep];
 };
 
 App.SF.env = function() {
diff --git a/src/descriptions/arcologyDescription.js b/src/descriptions/arcologyDescription.js
index 33764482c6f..2e59bb026cf 100644
--- a/src/descriptions/arcologyDescription.js
+++ b/src/descriptions/arcologyDescription.js
@@ -1,5 +1,5 @@
 /**
- * @param {DocumentFragment} [lastElement] will go on the same line as the last line
+ * @param {DocumentFragment|HTMLElement} [lastElement] will go on the same line as the last line
  * @returns {DocumentFragment}
  */
 App.Desc.playerArcology = function(lastElement) {
diff --git a/src/descriptions/officeDescription.js b/src/descriptions/officeDescription.js
index 35aeed12cad..2fec237146f 100644
--- a/src/descriptions/officeDescription.js
+++ b/src/descriptions/officeDescription.js
@@ -1,5 +1,5 @@
 /**
- * @param {DocumentFragment|string} [lastElement] will go on the same line as the last line
+ * @param {DocumentFragment|string|HTMLElement} [lastElement] will go on the same line as the last line
  * @returns {DocumentFragment}
  */
 App.Desc.officeDescription = function(lastElement) {
diff --git a/src/endWeek/economics/persBusiness.js b/src/endWeek/economics/persBusiness.js
index 8e74d89ff9f..6e1aca1d0bc 100644
--- a/src/endWeek/economics/persBusiness.js
+++ b/src/endWeek/economics/persBusiness.js
@@ -1175,7 +1175,7 @@ App.EndWeek.personalBusiness = function() {
 	App.Events.addParagraph(el, r);
 
 	if (V.SF.Toggle && V.SF.Active >= 1) {
-		$(el).wiki(App.SF.AAR());
+		$(el).wiki(App.SF.AAR()[0]);
 	}
 	return el;
 };
diff --git a/src/interaction/main/toychest.js b/src/interaction/main/toychest.js
index 047891aad72..407e3398380 100644
--- a/src/interaction/main/toychest.js
+++ b/src/interaction/main/toychest.js
@@ -1,11 +1,9 @@
 /* OPEN TOYCHEST */
 App.Interact.ToyChest = function(slave) {
 	"use strict";
-	/* eslint-disable no-unused-vars*/
 	const {
-		he, him, his, hers, himself, boy, He, His
+		he, him, his, himself, He, His
 	} = getPronouns(slave);
-	/* eslint-enable */
 
 	let r = `${slave.slaveName} `;
 	if (slave.fuckdoll) {
diff --git a/src/interaction/main/useGuard.js b/src/interaction/main/useGuard.js
index cd71dc610ff..057c5c88154 100644
--- a/src/interaction/main/useGuard.js
+++ b/src/interaction/main/useGuard.js
@@ -4,13 +4,10 @@
  */
 App.Interact.guardPose = function(slave) {
 	"use strict";
-	/* eslint-disable no-unused-vars*/
 	const {
-		he, him, his, hers, himself, boy,
+		he, him, his, boy, woman,
 		He, His
 	} = getPronouns(slave);
-	let man = (boy === "girl" ? "woman" : "man");
-	/* eslint-enable */
 
 	let r = `${slave.slaveName} is standing behind your left shoulder, guarding your person. `;
 	switch (slave.clothes) {
@@ -194,7 +191,7 @@ App.Interact.guardPose = function(slave) {
 			r += `${His} leotard and weapons make ${him} look like the heroine of an old exploitation film.`;
 			break;
 		case "a bunny outfit":
-			r += `${His} bunny outfit and weapons make ${him} look like the hench${man} of a villain from a cheesy vintage spy film.`;
+			r += `${His} bunny outfit and weapons make ${him} look like the hench${woman} of a villain from a cheesy vintage spy film.`;
 			break;
 		case "a slutty nurse outfit":
 			r += `Between ${his} nurse outfit and ${his} weapons ${he} looks prepared to do harm, and then to heal it.`;
diff --git a/src/interaction/siCustom.js b/src/interaction/siCustom.js
index a88ae05e48f..8efe1e3d470 100644
--- a/src/interaction/siCustom.js
+++ b/src/interaction/siCustom.js
@@ -129,7 +129,7 @@ App.UI.SlaveInteract.custom = function(slave) {
 		let slaveFullNameNode = document.createElement('span');
 		if (
 			((slave.devotion >= -50 || slave.trust < -20) && (slave.birthName !== slave.slaveName)) ||
-				(slave.devotion > 20 || slave.trust < -20)
+			(slave.devotion > 20 || slave.trust < -20)
 		) {
 			slaveFullNameNode.appendChild(slaveName());
 			slaveFullNameNode.appendChild(slaveSurname());
@@ -211,6 +211,7 @@ App.UI.SlaveInteract.custom = function(slave) {
 					)
 				);
 				return el;
+
 				function linkGuts() {
 					// Randomize the array
 					const shuffled = array.sort(() => 0.5 - Math.random());
@@ -396,6 +397,7 @@ App.UI.SlaveInteract.custom = function(slave) {
 			slaveSurnameNode.appendChild(result);
 			return slaveSurnameNode;
 		}
+
 		function updateName(slave, {oldName: oldName, oldSurname: oldSurname}) {
 			App.UI.SlaveInteract.rename(slave, {oldName: oldName, oldSurname: oldSurname});
 			refresh();
@@ -653,7 +655,7 @@ App.UI.SlaveInteract.custom = function(slave) {
 		choices.appendChild(note);
 		el.appendChild(choices);
 
-		textbox.onchange = function(e) {
+		textbox.onchange = () => {
 			const c = slave.custom;
 			if (textbox.value.length === 0) {
 				c.image = null;
@@ -669,7 +671,7 @@ App.UI.SlaveInteract.custom = function(slave) {
 				App.Art.refreshSlaveArt(slave, 3, "art-frame");
 			}
 		};
-		select.onchange = function(e) {
+		select.onchange = () => {
 			if (slave.custom.image !== null) {
 				slave.custom.image.format = select.value;
 			}
@@ -708,7 +710,6 @@ App.UI.SlaveInteract.custom = function(slave) {
 		return el;
 	}
 
-
 	function refresh() {
 		jQuery("#content-custom").empty().append(App.UI.SlaveInteract.custom(slave));
 	}
diff --git a/src/interaction/siDescription.js b/src/interaction/siDescription.js
index 86fddfb5659..09b0a872c71 100644
--- a/src/interaction/siDescription.js
+++ b/src/interaction/siDescription.js
@@ -26,7 +26,6 @@ App.UI.SlaveInteract.description = function(slave) {
 		el.append(descriptionLink);
 	}
 
-
 	return el;
 
 	function showOptions() {
diff --git a/src/interaction/siFinancial.js b/src/interaction/siFinancial.js
index 62c75f25c15..aa44af4ae9b 100644
--- a/src/interaction/siFinancial.js
+++ b/src/interaction/siFinancial.js
@@ -250,7 +250,6 @@ App.UI.SlaveInteract.financial = function(slave) {
 	App.Events.addNode(el, r, "p");
 	return el;
 
-
 	function refresh() {
 		jQuery("#content-financial").empty().append(App.UI.SlaveInteract.financial(slave));
 	}
diff --git a/src/interaction/siNavigation.js b/src/interaction/siNavigation.js
index 68ca74ac55e..638d53369e0 100644
--- a/src/interaction/siNavigation.js
+++ b/src/interaction/siNavigation.js
@@ -1,5 +1,3 @@
-
-
 /**
  * @param {App.Entity.SlaveState} slave
  * @returns {HTMLParagraphElement}
diff --git a/src/interaction/siPhysicalRegimen.js b/src/interaction/siPhysicalRegimen.js
index 93fbc512014..254e313cf94 100644
--- a/src/interaction/siPhysicalRegimen.js
+++ b/src/interaction/siPhysicalRegimen.js
@@ -308,7 +308,6 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) {
 		aphrodisiacOptions.push({text: `Extreme aphrodisiacs`, updateSlave: {aphrodisiacs: 2}});
 		aphrodisiacOptions.push({text: `Anaphrodisiacs`, updateSlave: {aphrodisiacs: -1}, note: `Suppresses libido`});
 
-
 		let el = document.createElement('div');
 		let title = document.createElement('div');
 		title.append(`Aphrodisiacs: `);
@@ -367,7 +366,8 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) {
 				}
 			} else if (slave.preg >= -1) {
 				fertilityBlock.append("Contraception and fertility: ");
-				let fertility = "";
+				/** @type {string} */
+				let fertility;
 				// fertility.id = "fertility";
 				if (slave.preg === -1) {
 					fertility = "using contraceptives";
@@ -407,10 +407,10 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) {
 				} else if (isInduced(slave)) {
 					note += `Hormones are being slipped into ${his} food; ${he} will give birth suddenly and rapidly this week`;
 				} else if (
-					slave.preg > slave.pregData.normalBirth - 2 &&
-						slave.preg > slave.pregData.minLiveBirth &&
-						slave.broodmother === 0 &&
-						!isInLabor(slave)
+					slave.preg > slave.pregData.normalBirth - 2
+					&& slave.preg > slave.pregData.minLiveBirth
+					&& slave.broodmother === 0
+					&& !isInLabor(slave)
 				) {
 					linkArray.push(App.UI.DOM.link(
 						`Induce labor`,
@@ -462,17 +462,17 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) {
 			App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices");
 		}
 		if (
-			(slave.pregKnown === 1) &&
-				(V.pregSpeedControl === 1) &&
-				(
-					slave.breedingMark !== 1 ||
-					V.propOutcome === 0 ||
-					V.eugenicsFullControl === 1 ||
-					V.arcologies[0].FSRestart === "unset"
-				) &&
-				(slave.indentureRestrictions < 1) &&
-				(slave.broodmother === 0) &&
-				V.seePreg !== 0
+			slave.pregKnown === 1
+			&& V.pregSpeedControl === 1
+			&& (
+				slave.breedingMark !== 1
+				|| V.propOutcome === 0
+				|| V.eugenicsFullControl === 1
+				|| V.arcologies[0].FSRestart === "unset"
+			)
+			&& slave.indentureRestrictions < 1
+			&& slave.broodmother === 0
+			&& V.seePreg !== 0
 		) {
 			let title = document.createElement('div');
 			let underline = document.createElement('span');
diff --git a/src/interaction/siRules.js b/src/interaction/siRules.js
index df2c601aa61..8dc56a8a507 100644
--- a/src/interaction/siRules.js
+++ b/src/interaction/siRules.js
@@ -115,7 +115,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 		penthouseCensus();
 		p.append("Living standard: ");
 
-		if (setup.facilityCareers.includes(slave.assignment)) {
+		if (App.Data.misc.facilityCareers.includes(slave.assignment)) {
 			App.UI.DOM.appendNewElement("span", p, ` ${His} living conditions are managed by ${his} assignment.`, "note");
 		} else if ((slave.assignment === "be your Head Girl") && (V.HGSuite === 1)) {
 			App.UI.DOM.appendNewElement("span", p, ` ${He} has ${his} own little luxurious room in the penthouse with everything ${he} needs to be a proper Head Girl.`, "note");
@@ -157,7 +157,6 @@ App.UI.SlaveInteract.rules = function(slave) {
 		}
 		p.append(div);
 
-
 		// Mobility Aids
 		if (!canWalk(slave) && canMove(slave)) {
 			div = document.createElement("div");
@@ -292,6 +291,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 		}
 		return App.UI.DOM.generateLinksStrip(links);
 	}
+
 	function orgasm(slave) {
 		let el = document.createElement('div');
 
@@ -458,6 +458,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 			el.append(row);
 		}
 	}
+
 	function refresh() {
 		jQuery("#content-rules").empty().append(App.UI.SlaveInteract.rules(slave));
 	}
diff --git a/src/interaction/siUtilities.js b/src/interaction/siUtilities.js
index c95185faa66..559affd293f 100644
--- a/src/interaction/siUtilities.js
+++ b/src/interaction/siUtilities.js
@@ -47,7 +47,8 @@ App.UI.SlaveInteract.generateRows = function(array, slave, category, accessCheck
 	for (const item of array) {
 		let link;
 		// Some items will never be in App.Data.slaveWear, especially "none" if it falls in between harsh and nice data sets. Trying to look it up would cause an error, which is what access check works around.
-		let unlocked = false;
+		/** @type {boolean|string} */
+		let unlocked;
 		if (accessCheck === true) {
 			const itemName = (category === "chastity") ? item.text.toLowerCase() : item.updateSlave[category]; // Yucky. Category name does not match for chastity (since it sets multiple kinds of chastity at once). Compare using a lowercase name instead.
 			unlocked = isItemAccessible.entry(itemName, category, slave);
diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js
index 16104045846..80272e91028 100644
--- a/src/interaction/siWardrobe.js
+++ b/src/interaction/siWardrobe.js
@@ -14,7 +14,6 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 	content.append(contents());
 	return content;
 
-
 	function contents() {
 		const frag = new DocumentFragment();
 		if (slave.fuckdoll === 0) {
@@ -97,7 +96,6 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 		}
 		el.append(span);
 
-
 		const FSFilters = new Map([]);
 		for (const FS of App.Data.FutureSociety.fsNames) {
 			if (V.arcologies[0][FS] > 0) {
@@ -446,7 +444,7 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 				// skip none in set, we set the link elsewhere.
 				continue;
 			}
-			if (object.empathyBelly) {
+			if (object.hasOwnProperty("empathyBelly")) {
 				empathyArray.push(key);
 			} else {
 				array.push(key);
@@ -737,7 +735,8 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 		const label = document.createElement('div');
 		label.append(`Chastity devices: `);
 
-		let chasCho = "";
+		/** @type {string} */
+		let chasCho;
 		if (slave.choosesOwnChastity === 1) {
 			chasCho = `choosing ${his} own chastity`;
 		} else if (slave.chastityAnus === 1 && slave.chastityPenis === 1 && slave.chastityVagina === 1) {
diff --git a/src/interaction/siWork.js b/src/interaction/siWork.js
index e9791109be2..027c4af5a1a 100644
--- a/src/interaction/siWork.js
+++ b/src/interaction/siWork.js
@@ -24,13 +24,19 @@ App.UI.SlaveInteract.work = function(slave) {
 		const arc = V.arcologies.find((a) => a.leaderID === slave.ID);
 		p.className = "scene-intro";
 		p.textContent = `${He} is serving as your Agent${arc ? ` leading ${arc.name}` : ` but is not currently assigned to an arcology`}. `;
-		p.appendChild(App.UI.DOM.link(`Recall and reenslave ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); }));
+		p.appendChild(App.UI.DOM.link(`Recall and reenslave ${him}`, () => {
+			removeJob(slave, slave.assignment, false);
+			refresh();
+		}));
 	} else if (slave.assignment === Job.AGENTPARTNER) {
 		const agent = getSlave(slave.relationshipTarget);
 		const arc = agent ? V.arcologies.find((a) => a.leaderID === agent.ID) : null;
 		p.className = "scene-intro";
 		p.textContent = `${He} is living with your Agent ${SlaveFullName(agent)}${arc ? ` in ${arc.name}` : ``}. `;
-		p.appendChild(App.UI.DOM.link(`Recall ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); }));
+		p.appendChild(App.UI.DOM.link(`Recall ${him}`, () => {
+			removeJob(slave, slave.assignment, false);
+			refresh();
+		}));
 	} else {
 		div = document.createElement('div');
 		div.id = "mini-scene";
@@ -310,7 +316,10 @@ App.UI.SlaveInteract.work = function(slave) {
 						sexOptions.push({text: `Use ${his} holes`, scene: `FButt`});
 					}
 				} else {
-					sexOptions.push({text: `Fuck ${him}`, disabled: `Remove ${his} chastity belt if you wish to fuck ${him}`});
+					sexOptions.push({
+						text: `Fuck ${him}`,
+						disabled: `Remove ${his} chastity belt if you wish to fuck ${him}`
+					});
 				}
 			}
 			if (slave.bellyPreg >= 300000) {
@@ -318,7 +327,10 @@ App.UI.SlaveInteract.work = function(slave) {
 					sexOptions.push({text: `Fuck ${him} on ${his} belly`, scene: `FBellyFuck`});
 					if (V.pregInventions >= 1) {
 						sexOptions.push({text: `Fuck ${him} in ${his} maternity swing`, scene: `FMaternitySwing`});
-						sexOptions.push({text: `Fuck ${him} with the help of ${his} assistants`, scene: `FAssistedSex`});
+						sexOptions.push({
+							text: `Fuck ${him} with the help of ${his} assistants`,
+							scene: `FAssistedSex`
+						});
 						sexOptions.push({text: `Fuck ${him} in your goo pool`, scene: `FPoolSex`});
 					}
 				}
@@ -327,7 +339,10 @@ App.UI.SlaveInteract.work = function(slave) {
 			if (canDoAnal(slave)) {
 				sexOptions.push({text: `Fuck ${his} ass`, scene: `FAnus`});
 			} else {
-				sexOptions.push({text: `Fuck ${his} ass`, disabled: `Remove ${his} chastity belt if you wish to fuck ${his} ass`});
+				sexOptions.push({
+					text: `Fuck ${his} ass`,
+					disabled: `Remove ${his} chastity belt if you wish to fuck ${his} ass`
+				});
 			}
 			sexOptions.push({text: `Use ${his} mouth`, scene: `FLips`});
 			sexOptions.push({text: `Kiss ${him}`, scene: `FKiss`});
@@ -356,7 +371,6 @@ App.UI.SlaveInteract.work = function(slave) {
 				sexOptions.push({text: `Grope ${his} butt`, scene: `FondleButt`});
 			}
 
-
 			if (slave.vagina > -1) {
 				if (canDoVaginal(slave)) {
 					sexOptions.push({text: `Grope ${his} pussy`, scene: `FondleVagina`});
@@ -373,7 +387,10 @@ App.UI.SlaveInteract.work = function(slave) {
 						}
 					}
 				} else {
-					sexOptions.push({text: `Use ${his} dick`, disabled: `Remove ${his} dick chastity belt if you wish to play with ${his} cock`});
+					sexOptions.push({
+						text: `Use ${his} dick`,
+						disabled: `Remove ${his} dick chastity belt if you wish to play with ${his} cock`
+					});
 				}
 			}
 
@@ -395,40 +412,84 @@ App.UI.SlaveInteract.work = function(slave) {
 					if ((V.milkPipeline > 88 && V.milkPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) {
 						if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) {
 							if (slave.inflationType === "milk" || slave.inflationType === "none") {
-								fillAssOptions.push({text: `Milk`, scene: `FillUpButt`, updateSlave: {inflationType: "milk", inflationMethod: 2}});
-								fillFaceOptions.push({text: `Milk`, scene: `FillUpFace`, updateSlave: {inflationType: "milk", inflationMethod: 1}});
+								fillAssOptions.push({
+									text: `Milk`,
+									scene: `FillUpButt`,
+									updateSlave: {inflationType: "milk", inflationMethod: 2}
+								});
+								fillFaceOptions.push({
+									text: `Milk`,
+									scene: `FillUpFace`,
+									updateSlave: {inflationType: "milk", inflationMethod: 1}
+								});
 							}
 						}
 					} else {
-						fillAssOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`});
-						fillFaceOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`});
+						fillAssOptions.push({
+							text: `Milk`,
+							disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`
+						});
+						fillFaceOptions.push({
+							text: `Milk`,
+							disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`
+						});
 					}
 					if ((V.cumPipeline > 88 && V.cumPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) {
 						if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) {
 							if (slave.inflationType === "cum" || slave.inflationType === "none") {
-								fillAssOptions.push({text: `Cum`, scene: `FillUpButt`, updateSlave: {inflationType: "cum", inflationMethod: 2}});
-								fillFaceOptions.push({text: `Cum`, scene: `FillUpFace`, updateSlave: {inflationType: "cum", inflationMethod: 1}});
+								fillAssOptions.push({
+									text: `Cum`,
+									scene: `FillUpButt`,
+									updateSlave: {inflationType: "cum", inflationMethod: 2}
+								});
+								fillFaceOptions.push({
+									text: `Cum`,
+									scene: `FillUpFace`,
+									updateSlave: {inflationType: "cum", inflationMethod: 1}
+								});
 							}
 						}
 					} else {
-						fillAssOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`});
-						fillFaceOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`});
+						fillAssOptions.push({
+							text: `Cum`,
+							disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`
+						});
+						fillFaceOptions.push({
+							text: `Cum`,
+							disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`
+						});
 					}
 				} /* dairyPiping === 1 */
 				if (V.boughtItem.toys.enema === 1) {
 					if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) {
 						if (slave.inflationType === "water" || slave.inflationType === "none") {
-							fillAssOptions.push({text: `Water`, scene: `FillUpButt`, updateSlave: {inflationType: "water", inflationMethod: 2}});
+							fillAssOptions.push({
+								text: `Water`,
+								scene: `FillUpButt`,
+								updateSlave: {inflationType: "water", inflationMethod: 2}
+							});
 						}
 						if (V.boughtItem.toys.medicalEnema === 1) {
 							if (slave.inflationType === "aphrodisiac" || slave.inflationType === "none") {
-								fillAssOptions.push({text: `Aphrodisiacs`, scene: `FillUpButt`, updateSlave: {inflationType: "aphrodisiac", inflationMethod: 2}});
+								fillAssOptions.push({
+									text: `Aphrodisiacs`,
+									scene: `FillUpButt`,
+									updateSlave: {inflationType: "aphrodisiac", inflationMethod: 2}
+								});
 							}
 							if (slave.inflationType === "curative" || slave.inflationType === "none") {
-								fillAssOptions.push({text: `Curatives`, scene: `FillUpButt`, updateSlave: {inflationType: "curative", inflationMethod: 2}});
+								fillAssOptions.push({
+									text: `Curatives`,
+									scene: `FillUpButt`,
+									updateSlave: {inflationType: "curative", inflationMethod: 2}
+								});
 							}
 							if (slave.inflationType === "tightener" || slave.inflationType === "none") {
-								fillAssOptions.push({text: `Rectal tighteners`, scene: `FillUpButt`, updateSlave: {inflationType: "tightener", inflationMethod: 2}});
+								fillAssOptions.push({
+									text: `Rectal tighteners`,
+									scene: `FillUpButt`,
+									updateSlave: {inflationType: "tightener", inflationMethod: 2}
+								});
 							}
 						}
 					} /* inflation < 3 */
@@ -436,7 +497,11 @@ App.UI.SlaveInteract.work = function(slave) {
 				if (V.wcPiping === 1) {
 					if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) {
 						if (slave.inflationType === "urine" || slave.inflationType === "none") {
-							fillAssOptions.push({text: `Urine`, scene: `FillUpButt`, updateSlave: {inflationType: "urine", inflationMethod: 2}});
+							fillAssOptions.push({
+								text: `Urine`,
+								scene: `FillUpButt`,
+								updateSlave: {inflationType: "urine", inflationMethod: 2}
+							});
 						}
 					}
 				} /* wcPiping === 1 */
@@ -444,10 +509,22 @@ App.UI.SlaveInteract.work = function(slave) {
 			if (slave.inflation === 0 && slave.bellyImplant < 1500) {
 				if (slave.assignment !== Job.DAIRY && slave.assignment !== Job.ARCADE && slave.assignment !== Job.CELLBLOCK) {
 					if (V.boughtItem.toys.buckets === 1) {
-						fillFaceOptions.push({text: `Two liters of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 1, inflationType: "food", inflationMethod: 1}});
+						fillFaceOptions.push({
+							text: `Two liters of slave food`,
+							scene: `forceFeeding`,
+							updateSlave: {inflation: 1, inflationType: "food", inflationMethod: 1}
+						});
 						if (slave.pregKnown === 0) {
-							fillFaceOptions.push({text: `A gallon of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 2, inflationType: "food", inflationMethod: 1}});
-							fillFaceOptions.push({text: `Two gallons of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 3, inflationType: "food", inflationMethod: 1}});
+							fillFaceOptions.push({
+								text: `A gallon of slave food`,
+								scene: `forceFeeding`,
+								updateSlave: {inflation: 2, inflationType: "food", inflationMethod: 1}
+							});
+							fillFaceOptions.push({
+								text: `Two gallons of slave food`,
+								scene: `forceFeeding`,
+								updateSlave: {inflation: 3, inflationType: "food", inflationMethod: 1}
+							});
 						}
 					}
 					fillFaceOptions.push({text: `Get another slave to do it`, goto: `SlaveOnSlaveFeeding`});
@@ -463,20 +540,36 @@ App.UI.SlaveInteract.work = function(slave) {
 			}
 			if (V.seeBestiality) {
 				if (V.farmyardKennels > 0 && V.active.canine) {
-					sexOptions.push({text: `Have a ${V.active.canine.species} mount ${him}`, scene: `FAnimal`, update: {animalType: "canine"}});
+					sexOptions.push({
+						text: `Have a ${V.active.canine.species} mount ${him}`,
+						scene: `FAnimal`,
+						update: {animalType: "canine"}
+					});
 				}
 				if (V.farmyardStables > 0 && V.active.hooved) {
-					sexOptions.push({text: `Let a ${V.active.hooved.species} mount ${him}`, scene: `FAnimal`, update: {animalType: "hooved"}});
+					sexOptions.push({
+						text: `Let a ${V.active.hooved.species} mount ${him}`,
+						scene: `FAnimal`,
+						update: {animalType: "hooved"}
+					});
 				}
 				if (V.farmyardCages > 0 && V.active.feline) {
-					sexOptions.push({text: `Have a ${V.active.feline.species} mount ${him}`, scene: `FAnimal`, update: {animalType: "feline"}});
+					sexOptions.push({
+						text: `Have a ${V.active.feline.species} mount ${him}`,
+						scene: `FAnimal`,
+						update: {animalType: "feline"}
+					});
 				}
 			}
 			sexOptions.push({text: `Abuse ${him}`, scene: `FAbuse`});
 			if (V.seeIncest === 1) {
 				const availRelatives = availableRelatives(slave);
 				if (availRelatives.mother) {
-					sexOptions.push({text: `Fuck ${him} with ${his} mother`, scene: `FRelation`, update: {partner: "mother"}});
+					sexOptions.push({
+						text: `Fuck ${him} with ${his} mother`,
+						scene: `FRelation`,
+						update: {partner: "mother"}
+					});
 				} else if (availRelatives.motherName !== null) {
 					sexOptions.push({text: `${His} mother, ${availRelatives.motherName}, is unavailable`});
 				}
@@ -490,15 +583,29 @@ App.UI.SlaveInteract.work = function(slave) {
 				if (slave.daughters > 0) {
 					if (availRelatives.daughters === 0) {
 						if (slave.daughters === 1) {
-							sexOptions.push({text: `Fuck ${him} with ${his} daughter`, disabled: `${His} ${availRelatives.oneDaughterRel} is unavailable`});
+							sexOptions.push({
+								text: `Fuck ${him} with ${his} daughter`,
+								disabled: `${His} ${availRelatives.oneDaughterRel} is unavailable`
+							});
 						} else {
-							sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, disabled: `${His} daughters are unavailable`});
+							sexOptions.push({
+								text: `Fuck ${him} with one of ${his} daughters`,
+								disabled: `${His} daughters are unavailable`
+							});
 						}
 					} else {
 						if (slave.daughters === 1) {
-							sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneDaughterRel}`, scene: `FRelation`, update: {partner: "daughter"}});
+							sexOptions.push({
+								text: `Fuck ${him} with ${his} ${availRelatives.oneDaughterRel}`,
+								scene: `FRelation`,
+								update: {partner: "daughter"}
+							});
 						} else {
-							sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, scene: `FRelation`, update: {partner: "daughter"}});
+							sexOptions.push({
+								text: `Fuck ${him} with one of ${his} daughters`,
+								scene: `FRelation`,
+								update: {partner: "daughter"}
+							});
 						}
 						/*
 							if (availRelatives.daughters > 1) {
@@ -510,15 +617,29 @@ App.UI.SlaveInteract.work = function(slave) {
 				if (slave.sisters > 0) {
 					if (availRelatives.sisters === 0) {
 						if (slave.sisters === 1) {
-							sexOptions.push({text: `Fuck ${him} with ${his} sister`, disabled: `${His} ${availRelatives.oneSisterRel} is unavailable`});
+							sexOptions.push({
+								text: `Fuck ${him} with ${his} sister`,
+								disabled: `${His} ${availRelatives.oneSisterRel} is unavailable`
+							});
 						} else {
-							sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, disabled: `${His} sisters are unavailable`});
+							sexOptions.push({
+								text: `Fuck ${him} with one of ${his} sisters`,
+								disabled: `${His} sisters are unavailable`
+							});
 						}
 					} else {
 						if (slave.sisters === 1) {
-							sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneSisterRel}`, scene: `FRelation`, update: {partner: "sister"}});
+							sexOptions.push({
+								text: `Fuck ${him} with ${his} ${availRelatives.oneSisterRel}`,
+								scene: `FRelation`,
+								update: {partner: "sister"}
+							});
 						} else {
-							sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, scene: `FRelation`, update: {partner: "sister"}});
+							sexOptions.push({
+								text: `Fuck ${him} with one of ${his} sisters`,
+								scene: `FRelation`,
+								update: {partner: "sister"}
+							});
 						}
 						/*
 							if (availRelatives.sisters > 1) {
@@ -531,10 +652,18 @@ App.UI.SlaveInteract.work = function(slave) {
 			if (slave.relationship > 0) {
 				const lover = getSlave(slave.relationshipTarget);
 				if (isSlaveAvailable(lover)) {
-					sexOptions.push({text: `Fuck ${him} with ${his} ${relationshipTermShort(slave)} ${SlaveFullName(lover)}`, scene: `FRelation`, update: {partner: "relationship"}});
+					sexOptions.push({
+						text: `Fuck ${him} with ${his} ${relationshipTermShort(slave)} ${SlaveFullName(lover)}`,
+						scene: `FRelation`,
+						update: {partner: "relationship"}
+					});
 				} else if (lover.assignment === Job.AGENT) {
 					if (slave.broodmother < 2) {
-						sexOptions.push({text: `Send ${him} to live with your agent ${SlaveFullName(lover)}`, goto: `Agent Company`, update: {subSlave: lover}});
+						sexOptions.push({
+							text: `Send ${him} to live with your agent ${SlaveFullName(lover)}`,
+							goto: `Agent Company`,
+							update: {subSlave: lover}
+						});
 					} else {
 						sexOptions.push({text: `A hyper-broodmother cannot be sent to live with your agent`});
 					}
@@ -555,7 +684,11 @@ App.UI.SlaveInteract.work = function(slave) {
 				}
 			}
 			if (slave.devotion >= 100 && slave.relationship < 0 && slave.relationship > -3) {
-				sexOptions.push({text: `Talk to ${him} about relationships`, goto: `Matchmaking`, update: {subSlave: 0}});
+				sexOptions.push({
+					text: `Talk to ${him} about relationships`,
+					goto: `Matchmaking`,
+					update: {subSlave: 0}
+				});
 			}
 			let ML = V.marrying.length;
 			if ((V.policies.mixedMarriage === 1 || V.cheatMode === 1) && slave.relationship !== 5 && slave.relationship !== -3) {
@@ -566,10 +699,16 @@ App.UI.SlaveInteract.work = function(slave) {
 						if (V.cheatMode === 1 || ML === 0) {
 							sexOptions.push({text: `Marry ${him}`, goto: "FMarry"});
 						} else {
-							sexOptions.push({text: `Marry ${him}`, disabled: `You already have a wedding planned for this weekend`});
+							sexOptions.push({
+								text: `Marry ${him}`,
+								disabled: `You already have a wedding planned for this weekend`
+							});
 						}
 					} else {
-						sexOptions.push({text: `Marry ${him}`, disabled: `You can only marry up to two slaves per week`});
+						sexOptions.push({
+							text: `Marry ${him}`,
+							disabled: `You can only marry up to two slaves per week`
+						});
 					}
 				}
 			}
@@ -673,6 +812,7 @@ App.UI.SlaveInteract.work = function(slave) {
 				}
 			}
 		}
+
 		return el;
 	}
 
diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js
index f7084dd5510..2dedd1bb788 100644
--- a/src/interaction/slaveInteract.js
+++ b/src/interaction/slaveInteract.js
@@ -74,7 +74,7 @@ App.UI.SlaveInteract.mainPage = function(slave) {
 	 * @property {Function} [onClick]
 	 */
 
-	 /** @type {Array<siCategory>} */
+	/** @type {Array<siCategory>} */
 	const buttons = [
 		{
 			title: "Description",
@@ -168,7 +168,7 @@ App.UI.SlaveInteract.mainPage = function(slave) {
 			btn.onclick = (event) => {
 				App.UI.tabBar.openTab(event, item.id);
 				jQuery(`#content-${item.id}`).empty().append(item.node);
-				if (item.hasOwnProperty("onClick")){
+				if (item.hasOwnProperty("onClick")) {
 					item.onClick();
 				}
 			};
diff --git a/src/js/assignJS.js b/src/js/assignJS.js
index fe0c3924c6a..06659766ee5 100644
--- a/src/js/assignJS.js
+++ b/src/js/assignJS.js
@@ -471,7 +471,6 @@ globalThis.assignJobSafely = function(slave, assignmentStr) {
 	}
 };
 
-
 /**
  * @param {App.Entity.SlaveState} slave
  * @param {FC.Assignment} assignment
@@ -887,6 +886,7 @@ App.Utils.moveFacilityWorkers = function(facility, managerAssignment = Job.REST,
 
 App.Utils.jobForAssignment = function() {
 	const map = new Map();
+
 	function fillMap() {
 		/**
 		 * @param {Map} m
@@ -922,6 +922,7 @@ App.Utils.jobForAssignment = function() {
 		}
 		return res;
 	}
+
 	return getJob;
 }();
 
@@ -954,7 +955,6 @@ globalThis.assignmentTransition = function(slave, assignTo, passage) {
 	}
 };
 
-
 /**
  * Creates a link that will remove all slaves from a facility, including manager.
  * @param {string} facilityName
diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js
index 5196259313a..5c85024eed5 100644
--- a/src/js/birth/birth.js
+++ b/src/js/birth/birth.js
@@ -20,6 +20,9 @@ globalThis.allBirths = function() {
 /**
  * Describes birth for a single slave, and can present options for the player to send the babies to a particular place
  * @param {App.Entity.SlaveState} slave
+ * @param {object} [obj]
+ * @param {boolean} [obj.birthStorm]
+ * @param {boolean} [obj.cSection]
  */
 globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {}) {
 	const el = document.createElement("p");
@@ -105,6 +108,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		App.UI.DOM.appendNewElement("span", title, SlaveFullName(slave), "coral");
 		return title;
 	}
+
 	/**
 	 * early birth calcs
 	 */
@@ -174,7 +178,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			suddenBirth += 2;
 		}
 		if (slave.geneticQuirks.uterineHypersensitivity === 2) {
-			suddenBirth += 1 * slave.counter.birthsTotal;
+			suddenBirth += slave.counter.birthsTotal;
 		}
 		if (slave.mpreg !== 1) {
 			if (slave.vagina > 2) {
@@ -186,6 +190,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		}
 		suddenBirth -= Math.trunc((slave.intelligence + slave.intelligenceImplant) / 10);
 	}
+
 	function preBirthScene() {
 		const el = new DocumentFragment();
 		const r = [];
@@ -199,6 +204,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			if (slave.broodmother === 0 || slave.broodmotherCountDown === 1) {
 				if (slave.assignment !== Job.DAIRY) {
 					if (V.universalRulesCSec === 1 || (slave.mpreg === 0 && slave.vagina < 0)) {
+						// TODO is this for future content?
 					} else {
 						if (hasAnyLegs(slave)) { // legless slaves are always carried in time
 							if ((random(1, 20) > suddenBirth) || (V.universalRulesBirthing === 1)) {
@@ -288,6 +294,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		App.Events.addNode(el, r);
 		return el;
 	}
+
 	function birthCalc() {
 		slave.pregControl = "none";
 
@@ -320,6 +327,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		}
 		diffSize = beforeSize / (1 + WombGetVolume(slave)); // 1 used to avoid divide by zero error.
 	}
+
 	function birthMainScene() {
 		const el = new DocumentFragment();
 		let r = [];
@@ -1054,9 +1062,11 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		App.Events.addNode(el, r);
 		return el;
 	}
+
 	function postBirthReaction() {
 		const el = new DocumentFragment();
-		let r = [];
+		/** @type {Array<string|HTMLElement>} */
+		let r;
 		/* ---- Postbirth reactions, body -------------------------------------------------------------------------------------------*/
 		if (!cSection) { // all this block only if no c'section used.
 			r = [];
@@ -1426,7 +1436,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 						slave.devotion += 3;
 					}
 				}
-				if (humiliation === 1 && slave.fetish !== "mindbroken" && slave.fuckdoll === 0) {
+				if (humiliation === 1 && slave.fuckdoll === 0) {
 					App.Events.addParagraph(el, r);
 					r = [];
 					r.push(`Giving birth in such a manner was completely humiliating,`);
@@ -1570,7 +1580,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				r.push(`Unless you provide otherwise, the ${children} will be remanded to one of ${V.arcologies[0].name}'s slave orphanages.`);
 				V.slaveOrphanageTotal += numBeingBorn; // Player may choose nothing. Assume that now, and reverse it later if needed.
 				if (!slaveDead) {
-					if (slave.fetish === "mindbroken" || slave.fuckdoll > 0) {
+					if (slave.fuckdoll > 0) {
 						r.push(`${slave.slaveName} shows no indication of an opinion on the matter.`);
 					} else if (slave.devotion > 95) {
 						r.push(`${slave.slaveName} worships you so completely that ${he} will not resent this.`);
@@ -1685,7 +1695,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					case "an orphanage":
 						r.push(`${slave.slaveName}`);
 						if (!slaveDead) {
-							if (slave.fetish === "mindbroken" || slave.fuckdoll > 0) {
+							if (slave.fuckdoll > 0) {
 								r.push(`shows no indication of an opinion on the matter.`);
 							} else if (slave.devotion > 95) {
 								r.push(`worships you so completely that ${he} will not resent this.`);
@@ -1708,7 +1718,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					case "a citizen school":
 						r.push(`${slave.slaveName}`);
 						if (!slaveDead) {
-							if (slave.fetish === "mindbroken" || slave.fuckdoll > 0) {
+							if (slave.fuckdoll > 0) {
 								r.push(`fails to acknowledge this.`);
 							} else if (slave.devotion > 95) {
 								r.push(`loves you already, but ${he}'ll`);
@@ -1799,6 +1809,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			App.Events.addNode(el, r);
 			return el;
 		}
+
 		function citizenSchoolResponse() {
 			const r = [];
 			const el = new DocumentFragment();
@@ -1831,6 +1842,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 
 			return el;
 		}
+
 		function eliteResponse() {
 			const r = [];
 			const el = new DocumentFragment();
@@ -1870,6 +1882,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			App.Events.addNode(el, r);
 			return el;
 		}
+
 		function futaResponse() {
 			const r = [];
 			const el = new DocumentFragment();
@@ -1892,6 +1905,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			App.Events.addNode(el, r);
 			return el;
 		}
+
 		function privatelyResponse() {
 			const r = [];
 			const el = new DocumentFragment();
@@ -1930,6 +1944,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			App.Events.addNode(el, r);
 			return el;
 		}
+
 		function auctionResponse() {
 			const r = [];
 			const el = new DocumentFragment();
@@ -1992,8 +2007,10 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			App.Events.addNode(el, r);
 			return el;
 		}
+
 		return el;
 	}
+
 	function birthPostpartum() {
 		const el = document.createElement("p");
 		numBeingBorn = babiesBeingBorn.length;
@@ -2036,6 +2053,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		}
 		return el;
 	}
+
 	function birthCritical() {
 		const el = document.createElement("p");
 		const r = [];
@@ -2244,7 +2262,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					break;
 				case Job.SUBORDINATE:
 					if (tempSub) {
-						({his2} = getPronouns(tempSub).appendSuffix("2"));
+						({his2, he2} = getPronouns(tempSub).appendSuffix("2"));
 					}
 					if (slave.fetish === "mindbroken") {
 						if (slave.subTarget === 0) {
@@ -3099,7 +3117,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 
 				case Job.NURSERY:		// TODO: this needs a rewrite
 					if (V.MatronID !== 0) {
-						({he2} = getPronouns(S.Matron).appendSuffix("2"));
+						({he2, him2} = getPronouns(S.Matron).appendSuffix("2"));
 					}
 					if (slave.fetish === "mindbroken") {
 						if (random(1, 20) > suddenBirth) {
@@ -3152,7 +3170,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 
 				case Job.SCHOOL:
 					if (S.Schoolteacher) {
-						({he2} = getPronouns(S.Schoolteacher).appendSuffix("2"));
+						({he2, his2} = getPronouns(S.Schoolteacher).appendSuffix("2"));
 					}
 					if (!canWalk(slave)) {
 						if (random(1, 20) > suddenBirth) {
@@ -3469,7 +3487,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					break;
 
 				case Job.HEADGIRLSUITE:
-					({he2} = getPronouns(S.HeadGirl).appendSuffix("2"));
+					({he2, his2} = getPronouns(S.HeadGirl).appendSuffix("2"));
 					if (slave.pregSource === V.HeadGirlID) {
 						if (random(1, 20) > suddenBirth) {
 							r.push(`${S.HeadGirl.slaveName} makes sure that the mother of ${his2} child is happy and comfortable for the upcoming birth, even if they won't be spending much time with their offspring. ${he2} carefully undresses ${slave.slaveName}, all the while whispering sweet nothings in ${his} ear. ${He} begins to push out ${firstText} baby${UH}, and ${his} child is carefully collected by their father. Once they are out of the way, ${S.HeadGirl.slaveName} moves in to fondle ${slave.slaveName}'s tired, still very gravid body.`);
@@ -4066,7 +4084,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 
 				case Job.SUBORDINATE:
 					if (tempSub) {
-						({he2} = getPronouns(tempSub).appendSuffix("2"));
+						({he2, his2} = getPronouns(tempSub).appendSuffix("2"));
 					}
 					if (slave.fetish === "mindbroken") {
 						if (slave.subTarget === 0) {
@@ -4725,6 +4743,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 
 				case Job.CONCUBINE:
 					if (slave.fetish === "mindbroken") {
+						// TODO fill out
 					} else {
 						r.push(`${slave.slaveName} cradles ${his} swollen belly, waiting for your return, when ${his} body begins to birth another of ${his} brood. Saddened that you aren't there for the show, ${he} begins waddling off to find you. By the time ${he} reaches your office, ${he} is barely holding back ${his} child. You rise to meet ${him} and struggle to help ${him} onto the couch, just before it's to late.`);
 						r.push(clothingBirth());
@@ -5914,7 +5933,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					break;
 
 				case Job.HEADGIRLSUITE:
-					({he2} = getPronouns(S.HeadGirl).appendSuffix("2"));
+					({he2, his2, He2} = getPronouns(S.HeadGirl).appendSuffix("2"));
 					if (slave.pregSource === V.HeadGirlID) {
 						r.push(`${S.HeadGirl.slaveName} makes sure that the mother of ${his2} ${children} is happy and comfortable for the upcoming birth, even if they won't be spending much time with their offspring. ${He2} carefully undresses ${slave.slaveName}, all the while whispering sweet nothings in ${his} ear. ${He} begins to push out ${his} ${babies},`);
 						if (slave.geneticQuirks.uterineHypersensitivity === 2) {
@@ -5983,9 +6002,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			// at assignment else in halls/etc, only if able to move
 
 			const rival = slave.rivalry > 0 ? getSlave(slave.rivalryTarget) : null;
-			if (rival) {
-				({he2} = getPronouns(rival).appendSuffix("2"));
-			}
 
 			if (slave.fetish === "mindbroken") {
 				r.push(`While wandering the penthouse absentmindedly, ${slave.slaveName}'s water breaks. ${He} carries on until the contractions drag ${him} to the floor.`);
@@ -6008,6 +6024,8 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					r.push(clothingBirth());
 					r.push(`${He} gathers ${his} ${newborns} and recovers ${his} strength before finding a servant to give ${his} ${children} to before hurrying to ${his} assignment.`);
 				} else if (birthScene > 66 && slave.rivalry === 3 && isSlaveAvailable(rival) && canWalk(rival)) {
+					({he2, his2, him2, He2} = getPronouns(rival).appendSuffix("2"));
+
 					if (slave.pregSource === rival.ID) {
 						r.push(`While hustling through the penthouse on ${his} way to give birth, ${slave.slaveName} finds ${his} path blocked by ${rival.slaveName} — and a hospital gurney, of all things. ${He2} appears genuinely concerned for the (soon-to-be) mother of ${his2} ${children}, and helps ${him} onto the bed, then pushes the surprised ${girl} onwards. ${slave.slaveName}, focusing on ${his} labor, begins to rethink the animosity ${he} feels for ${him2} — until ${he} realizes ${rival.slaveName} has brought them to the cafeteria. With a smug pride in ${his2} potency, ${he2} introduces the shocked pregnant ${girl} to ${his} new audience. ${His} contractions becoming too frequent to move, ${he} begins giving birth in front of ${his} audience.`);
 						humiliation = 1;
@@ -6055,7 +6073,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				case Job.SUBORDINATE: {
 					const domSlave = getSlave(slave.subTarget);
 					if (domSlave) {
-						({he2} = getPronouns(domSlave).appendSuffix("2"));
+						({he2, his2} = getPronouns(domSlave).appendSuffix("2"));
 					}
 					if (slave.fetish === "mindbroken") {
 						if (slave.subTarget === 0) {
@@ -6756,7 +6774,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					break;
 
 				case Job.HEADGIRLSUITE:
-					({he2} = getPronouns(S.HeadGirl).appendSuffix("2"));
+					({he2, his2} = getPronouns(S.HeadGirl).appendSuffix("2"));
 					if (!canWalk(slave)) {
 						if (slave.fetish === "mindbroken") {
 							r.push(`${slave.slaveName} is awoken from ${his} rest by a strong contraction. ${He} rolls over and begins to fall back to sleep as another wracks ${his} body.`);
@@ -6887,7 +6905,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				r.push(`Or ${he} would have been, if ${he} weren't locked in an arcade cabinet. A gush of liquid pours from the ${slave.slaveName}'s cunt, followed by the attendant in charge of the arcade hanging an "out of order" sign on ${his} exposed rear. While ${his} mouth is filled with a customer's dick, ${his} body instinctively attempts laboring on ${his} ${babies}. However, ${he} soon finds that ${he} is incapable of actually giving birth to ${his} ${children}. As blood begins to seep from ${his} nethers, ${he} desperately tries to get anyone's attention. The attendant rushes to ${his} aid, but fails to get the cabinet open in time to save ${slave.slaveName}. ${He} and ${his} ${children} were an unfortunate loss.`);
 				break;
 
-
 			default:
 				r.push(`As ${he} is helped back to ${his} bed and to give birth, ${his} water breaks and ${he} slumps to the ground. As ${his} helper rushes off to find aid, ${he} begins laboring on ${his} ${babies}. However, ${he} soon finds that ${he} is incapable of actually giving birth to ${his} ${children}. As blood begins to seep from ${his} nethers, ${he} desperately tries to get anyone's attention.`);
 				App.Events.addParagraph(el, r);
@@ -8055,7 +8072,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					}
 					break;
 
-
 				case "a ball gown":
 					if (slave.fetish === "mindbroken") {
 						r.push(`${babies}, indifferent to the obvious wetness forming`);
@@ -8185,7 +8201,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					}
 					break;
 
-
 				case "a mounty outfit":
 				case "a police uniform":
 				case "leather pants and pasties":
@@ -8215,7 +8230,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 					}
 					break;
 
-
 				case "lederhosen":
 					if (slave.fetish === "mindbroken") {
 						r.push(`${babies}, indifferent to the obvious wetness forming`);
diff --git a/src/js/consistencyCheck.js b/src/js/consistencyCheck.js
index e6f062fc540..95fc8a61994 100644
--- a/src/js/consistencyCheck.js
+++ b/src/js/consistencyCheck.js
@@ -1,6 +1,6 @@
 /**
  * checks V.slaves for consistency
- * @param {PassageRenderingEvent} event
+ * @param {JQuery.PassageRenderingEvent} event
  */
 App.Debug.slavesConsistency = function(event) {
 	if (event.passage.title !== "AS Dump" // Don't put in the work on passages we leave immediately anyway.
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 3f545c4ca1b..242afe79152 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -12,7 +12,7 @@ globalThis.DJRepBonus = function() {
 	if (!canSee(S.DJ)) {
 		value += 0.15;
 	}
-	if ( S.DJ.skill.entertainment > 10 && S.DJ.skill.entertainment <= 30) {
+	if (S.DJ.skill.entertainment > 10 && S.DJ.skill.entertainment <= 30) {
 		value += 0.05;
 		// V.DJ.slaveName's basic skills marginally <span class="green">improve</span> the atmosphere in V.clubName.
 	} else if (S.DJ.skill.entertainment <= 60) {
@@ -318,7 +318,6 @@ globalThis.calculateCosts = (function() {
 		cashX(forceNeg(getPCCosts()), "PCmedical");
 		getTotalSlaveCosts();
 
-
 		// these two apply a multiplicative effect to all costs so far.
 		// Calculate what the deduced expenses would be, then subtract
 		let costSoFar = (oldCash - V.cash); // How much we have spent by this point; expected to be positive.
@@ -342,7 +341,7 @@ globalThis.calculateCosts = (function() {
 			loopCosts += getSlaveCost(slave);
 		}
 		const reducibleUpkeep = Math.trunc(loopCosts * 0.2);
-		App.Utils.jobForAssignment(Job.QUARTER).employees().forEach( s => {
+		App.Utils.jobForAssignment(Job.QUARTER).employees().forEach(s => {
 			number += getSlaveMinorCosts(s);
 		});
 
@@ -537,7 +536,7 @@ globalThis.calculateCosts = (function() {
 				cashX(Math.abs(slaveCostMinor), "slaveAssignmentHouse", s);
 			}
 		});
-	// nothing to return, cashX already billed.
+		// nothing to return, cashX already billed.
 	}
 
 	// facility expenses
@@ -612,15 +611,15 @@ globalThis.calculateCosts = (function() {
 	}
 
 	function getFarmyardCosts() {
-		const facility = V.farmyard*V.facilityCost;
+		const facility = V.farmyard * V.facilityCost;
 		return (
 			(
 				(facility)
-				+(0.1*V.farmyardUpgrades.fertilizer*facility)
-				-(0.2*V.farmyardUpgrades.hydroponics*facility)
-				+(0.2*V.farmyardUpgrades.seeds*facility)
-				-(0.4*V.farmyardUpgrades.machinery*facility)
-			)*2
+				+ (0.1 * V.farmyardUpgrades.fertilizer * facility)
+				- (0.2 * V.farmyardUpgrades.hydroponics * facility)
+				+ (0.2 * V.farmyardUpgrades.seeds * facility)
+				- (0.4 * V.farmyardUpgrades.machinery * facility)
+			) * 2
 		);
 	}
 
@@ -784,7 +783,6 @@ globalThis.calculateCosts = (function() {
 		return costs;
 	}
 
-
 	function getPCMultiplierCosts(cost) {
 		if (V.PC.career === 'servant' || V.PC.career === 'handmaiden' || V.PC.career === 'child servant') {
 			if (V.personalAttention === PersonalAttention.MAID) {
@@ -807,9 +805,12 @@ globalThis.calculateCosts = (function() {
 		return Math.trunc(cost);
 	}
 
+	/**
+	 * @returns {number}
+	 */
 	function getSFCosts() {
 		if (V.SF.Toggle && V.SF.Active >= 1) {
-			return App.SF.AAR(0);
+			return App.SF.AAR(0)[1];
 		}
 		return 0;
 	}
@@ -826,9 +827,9 @@ globalThis.calculateCosts = (function() {
 	}
 
 	/**
-		* The amount of slaves served by a servant
-		* @param {App.Entity.SlaveState} slave
-		*/
+	 * The amount of slaves served by a servant
+	 * @param {App.Entity.SlaveState} slave
+	 */
 	function getSlaveMinorCosts(slave) {
 		let effectiveness = 0;
 		if (slave.trust < -20) {
@@ -971,7 +972,6 @@ globalThis.getSlaveCostArray = function(s) {
 	}
 	cost = Math.trunc(cost);
 	retval.push({text: "Living Expenses", value: cost});
-	cost = 0;
 
 	// Food
 	retval.push({text: "Basic slave food cost", value: foodCost * 4});
@@ -1023,14 +1023,20 @@ globalThis.getSlaveCostArray = function(s) {
 	}
 	if (s.geneticQuirks.mGain === 2 && s.geneticQuirks.mLoss !== 2) {
 		if (V.geneticMappingUpgrade >= 1) {
-			retval.push({text: "Additional dietary supplements due to myotonic hypertrophy", value: Math.trunc(foodCost * 0.2)});
+			retval.push({
+				text: "Additional dietary supplements due to myotonic hypertrophy",
+				value: Math.trunc(foodCost * 0.2)
+			});
 		} else {
 			retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)});
 		}
 	}
 	if (s.geneticQuirks.wGain === 2 && s.geneticQuirks.wLoss !== 2) {
 		if (V.geneticMappingUpgrade >= 1) {
-			retval.push({text: "Additional dietary supplements due to hyperleptinemia", value: Math.trunc(foodCost * 0.2)});
+			retval.push({
+				text: "Additional dietary supplements due to hyperleptinemia",
+				value: Math.trunc(foodCost * 0.2)
+			});
 		} else {
 			retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)});
 		}
@@ -1046,9 +1052,9 @@ globalThis.getSlaveCostArray = function(s) {
 			t += "natural ";
 		}
 		t += "lactation from ";
-		if (Math.trunc(s.boobs/10000) > 2) {
+		if (Math.trunc(s.boobs / 10000) > 2) {
 			t += "absurd udders";
-		} else if (Math.trunc(s.boobs/10000) > 1) {
+		} else if (Math.trunc(s.boobs / 10000) > 1) {
 			t += "enormous boobs";
 		} else {
 			t += "reasonable breasts";
@@ -1064,7 +1070,10 @@ globalThis.getSlaveCostArray = function(s) {
 			V.masterSuiteUpgradePregnancy === 1) {
 			// Extra feeding costs to support pregnancy are covered by master suite luxuries.
 			// TODO: Include them here anyway?
-			retval.push({text: `Extra feeding costs to support pregnancy are covered by ${V.masterSuiteName} luxuries`, value: 0});
+			retval.push({
+				text: `Extra feeding costs to support pregnancy are covered by ${V.masterSuiteName} luxuries`,
+				value: 0
+			});
 		} else {
 			t = "Extra feeding to support ";
 			if (s.pregControl === "speed up") {
@@ -1198,7 +1207,10 @@ globalThis.getSlaveCostArray = function(s) {
 			case 'curative':
 			case 'aphrodisiac':
 			case 'tightener':
-				retval.push({text: "Costs of specially formulated drug mixtures for enemas; 2 gallons", value: (100 + (drugsCost * 2))});
+				retval.push({
+					text: "Costs of specially formulated drug mixtures for enemas; 2 gallons",
+					value: (100 + (drugsCost * 2))
+				});
 				break;
 		}
 	} else if (s.inflation === 2) {
@@ -1212,7 +1224,10 @@ globalThis.getSlaveCostArray = function(s) {
 			case 'curative':
 			case 'aphrodisiac':
 			case 'tightener':
-				retval.push({text: "Costs of specially formulated drug mixtures for enemas", value: (50 + (drugsCost * 2))});
+				retval.push({
+					text: "Costs of specially formulated drug mixtures for enemas",
+					value: (50 + (drugsCost * 2))
+				});
 				break;
 		}
 	} else if (s.inflation === 1) {
@@ -1226,7 +1241,10 @@ globalThis.getSlaveCostArray = function(s) {
 			case 'curative':
 			case 'aphrodisiac':
 			case 'tightener':
-				retval.push({text: "Costs of specially formulated drug mixtures for enemas", value: (25 + (drugsCost * 2))});
+				retval.push({
+					text: "Costs of specially formulated drug mixtures for enemas",
+					value: (25 + (drugsCost * 2))
+				});
 				break;
 		}
 	}
@@ -1298,7 +1316,7 @@ globalThis.getSlaveCostArray = function(s) {
  * @returns {number}
  */
 globalThis.getSlaveCost = function(s) {
-	return getSlaveCostArray(s).reduce((result, {value})=>result + value, 0);
+	return getSlaveCostArray(s).reduce((result, {value}) => result + value, 0);
 };
 
 /**
@@ -1339,7 +1357,6 @@ globalThis.NPCSexSupply = function(lowerDemandLeft, lowerTotalDemand, middleDema
 		NPCSexSupply.lowerClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * (normalRandInt(150, 10) / 1000)), 500);
 	}
 
-
 	// Middle class calculations
 	const middleClassNPCRatio = NPCSexSupply.middleClass / middleDemandLeft;
 	const middleClassOptimalRatio = 0.5 + V.sexSubsidies.middleClass / 10 - V.sexSupplyBarriers.middleClass / 10;
@@ -1438,7 +1455,7 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman
 		const madamIntel = madam.intelligence + madam.intelligenceImplant;
 		App.EndWeek.saVars.madamBonus = 0;
 		if (madam.relationship === -3 && madam.devotion > 50) {
-		// As your loving ${wife}, ${he} does $his best to attract attention to your brothel.
+			// As your loving ${wife}, ${he} does $his best to attract attention to your brothel.
 			App.EndWeek.saVars.madamBonus += 0.25;
 		}
 		if (madam.skill.whoring > 10 && madam.skill.whoring <= 30) {
@@ -1520,7 +1537,6 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman
 		SJVBrothel(S.Madam, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef);
 	}
 
-
 	// Checking for space in the brothel
 	if (V.brothel > 0 && BL < V.club) {
 		brothelSpots = V.brothel - BL;
@@ -1692,12 +1708,12 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman
 	}
 
 	/**
-		* @param {App.Entity.SlaveState} s
-		* @param {number} lowerClassSexDemandRef
-		* @param {number} middleClassSexDemandRef
-		* @param {number} upperClassSexDemandRef
-		* @param {number} topClassSexDemandRef
-		*/
+	 * @param {App.Entity.SlaveState} s
+	 * @param {number} lowerClassSexDemandRef
+	 * @param {number} middleClassSexDemandRef
+	 * @param {number} upperClassSexDemandRef
+	 * @param {number} topClassSexDemandRef
+	 */
 	function SJVBrothel(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef) {
 		let toTheBrothel = 0;
 		let beautyMultiplier = 1;
@@ -1811,14 +1827,14 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman
 		}
 
 		/**
-			* The whoreScore function finds the appropriate customer class and then calculates the whore income stats associated with that class and adds to the class supply.
-			* whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligible it will service the highest it is capable of servicing properly. A whoreClass of 0 means it is on auto (always service the highest possible class).
-			* @param {App.Entity.SlaveState} s
-			* @param {number} lowerClassSexDemandRef
-			* @param {number} middleClassSexDemandRef
-			* @param {number} upperClassSexDemandRef
-			* @param {number} topClassSexDemandRef
-			*/
+		 * The whoreScore function finds the appropriate customer class and then calculates the whore income stats associated with that class and adds to the class supply.
+		 * whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligible it will service the highest it is capable of servicing properly. A whoreClass of 0 means it is on auto (always service the highest possible class).
+		 * @param {App.Entity.SlaveState} s
+		 * @param {number} lowerClassSexDemandRef
+		 * @param {number} middleClassSexDemandRef
+		 * @param {number} upperClassSexDemandRef
+		 * @param {number} topClassSexDemandRef
+		 */
 		function whoreScore(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef) {
 			let income = s.sexAmount * s.sexQuality;
 			let sexMin;
@@ -2085,7 +2101,7 @@ globalThis.endWeekSlaveMarket = function() {
 	const relativeTimeSupply = V.elapsedSupplyTimer / V.supplyTimer;
 	V.menialSupplyFactor += supplyVariance + Math.trunc(relativeTimeSupply * V.deltaSupply + (1 - relativeTimeSupply) * V.deltaSupplyOld); // Actual movement of supply gradually shifts from old to 'new' deltaSupply
 
-	function newTimer(side="demand") {
+	function newTimer(side = "demand") {
 		if (side === "demand") {
 			V.demandTimer = jsRandom(6, 10);
 			V.elapsedDemandTimer = 0;
@@ -2205,7 +2221,10 @@ globalThis.cashX = function(cost, what, who) {
 
 		// record the slave, if available
 		if (typeof who !== 'undefined' && who.ID !== -1) {
+			// We know it's a slave because the ID is != -1
+			// @ts-ignore
 			who.lastWeeksCashIncome += cost;
+			// @ts-ignore
 			who.lifetimeCashIncome += cost;
 		}
 	} else if (cost < 0) { // EXPENSES
@@ -2218,10 +2237,13 @@ globalThis.cashX = function(cost, what, who) {
 
 		// record the slave, if available
 		if (typeof who !== 'undefined' && who.ID !== -1) {
+			// We know it's a slave because the ID is != -1
 			if (what === "slaveTransfer") {
+				// @ts-ignore
 				who.slaveCost = cost;
 			} else {
 				// who.lastWeeksCashExpenses = cost; - weekly slave expenses are not tracked this way
+				// @ts-ignore
 				who.lifetimeCashExpenses += cost;
 			}
 		}
@@ -2369,7 +2391,7 @@ globalThis.SectorCounts = function() {
  */
 globalThis.agentBonus = function(arcology) {
 	const agent = App.currentAgent(arcology);
-	let bonus = Math.floor((agent.intelligence+agent.intelligenceImplant)/32);
+	let bonus = Math.floor((agent.intelligence + agent.intelligenceImplant) / 32);
 	if (agent.actualAge > 35) {
 		bonus++;
 	}
@@ -2430,13 +2452,14 @@ globalThis.supplyPoliciesReport = function(NPCclass) {
 	}
 
 	if (V.sexDemandResult[varName] > 1000) {
-		overSupply = V.sexDemandResult[varName] - 1000; V.sexDemandResult[varName] = 1000;
+		overSupply = V.sexDemandResult[varName] - 1000;
+		V.sexDemandResult[varName] = 1000;
 	}
-	r += `<i><br>&nbsp;Satisfaction is at ${V.sexDemandResult[varName]/10}%`;
+	r += `<i><br>&nbsp;Satisfaction is at ${V.sexDemandResult[varName] / 10}%`;
 	if (overSupply > 0) {
-		r += ` and the arcology provides ${overSupply/10}% more sexual services than required which <span class='red'>drives prices down,</span>`;
+		r += ` and the arcology provides ${overSupply / 10}% more sexual services than required which <span class='red'>drives prices down,</span>`;
 	}
-	r += ` ${V.NPCMarketShare[varName]/10 === V.sexDemandResult[varName]/10 ? `the entire` : `${V.NPCMarketShare[varName]/10}% of the`} market is serviced by other suppliers operating inside your arcology.</i><br>`;
+	r += ` ${V.NPCMarketShare[varName] / 10 === V.sexDemandResult[varName] / 10 ? `the entire` : `${V.NPCMarketShare[varName] / 10}% of the`} market is serviced by other suppliers operating inside your arcology.</i><br>`;
 
 	// charge supply barriers (unreported, since it's a flat amount that you were told when you enacted the policy)
 	const supplyCosts = [0, 1000, 5000, 20000, 60000];
diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js
index ab0beed8df6..c91d2d46dcc 100644
--- a/src/js/eventSelectionJS.js
+++ b/src/js/eventSelectionJS.js
@@ -704,7 +704,6 @@ if(eventSlave.drugs === "breast injections") {
 				}
 			} /* closes aging exemption */
 
-
 			if (eventSlave.devotion >= -150) {
 				if (eventSlave.devotion <= 50) {
 					V.events.push("RE standard punishment");
diff --git a/src/js/extendedFamilyModeJS.js b/src/js/extendedFamilyModeJS.js
index 18887bac233..023ece75ce1 100644
--- a/src/js/extendedFamilyModeJS.js
+++ b/src/js/extendedFamilyModeJS.js
@@ -114,9 +114,9 @@ globalThis.sameParent = function(slave1, slave2) {
  */
 globalThis.specificCharacterID = function(ID) {
 	return (ID > 0		// active slave
-		 || ID < -20	// missing slave
-		 || ID === -1	// player
-		 || ID === -3);	// player's old master
+		|| ID < -20	    // missing slave
+		|| ID === -1	// player
+		|| ID === -3);	// player's old master
 };
 
 /** Returns true if the father of slave is a specific, unique character (current or former slave, or the PC)
@@ -363,7 +363,14 @@ globalThis.randomAvailableParent = function(slave) {
  */
 globalThis.availableRelatives = function(slave) {
 	let avail = {
-		mother: false, motherName: null, father: false, fatherName: null, sisters: 0, daughters: 0, oneSisterRel: null, oneDaughterRel: null
+		mother: false,
+		motherName: null,
+		father: false,
+		fatherName: null,
+		sisters: 0,
+		daughters: 0,
+		oneSisterRel: null,
+		oneDaughterRel: null
 	};
 
 	V.slaves.forEach((other) => {
diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js
index b74893f2b90..0d63e42806a 100644
--- a/src/js/itemAvailability.js
+++ b/src/js/itemAvailability.js
@@ -23,6 +23,7 @@ globalThis.isItemAccessible = (function() {
 		}
 		return isAvailable(item, category, slave);
 	}
+
 	/**
 	 * Returns array of wearable clothing in format [name, value], basically player facing / game data.
 	 * @param {Map} map Map to look in (such as App.Data.clothes)
@@ -32,8 +33,8 @@ globalThis.isItemAccessible = (function() {
 	 */
 	function array(map, filter, filterValue) {
 		const array = [];
-		for (const [key, obj] of map) {	// FIXME: 'key' is declared but its value is never read.
-			if (filter && filterValue !== (obj[filter] || false)) {
+		for (const [key, obj] of map) {
+			if (filter && filterValue !== (obj[filter])) {
 				continue;
 			}
 			if (V.cheatMode || isAvailable(obj)) {
diff --git a/src/js/pregJS.js b/src/js/pregJS.js
index 4447999dbbb..94e61a195e8 100644
--- a/src/js/pregJS.js
+++ b/src/js/pregJS.js
@@ -384,17 +384,21 @@ globalThis.setPregType = function(actor) {
 	if (actor.geneticQuirks.superfetation === 2 && actor.womb.length > 0) {
 		let ftVol = FetusGetPrediction(actor, actor.pregData.normalBirth);
 		let cmVol = ftVol * actor.womb.length;
-		let maxVol = actor.pregAdaptation*2000;
+		let maxVol = actor.pregAdaptation * 2000;
 		if (V.seeHyperPreg === 0) {
 			maxVol /= 10; // without hyperpreg enabled it's limited to be roughly ten times smaller.
 		}
 		let freeVol = maxVol - cmVol;
-		let coeff = ((maxVol/actor.womb.length) / (freeVol/ftVol)) / 2; // more divide to 2 is to balance for ensured 1 ova even if over limit.
+		let coeff = ((maxVol / actor.womb.length) / (freeVol / ftVol)) / 2; // more divide to 2 is to balance for ensured 1 ova even if over limit.
 
 		if (coeff < 0) { coeff = 0; }
 
 		if (V.seeHyperPreg !== 0) {
-			coeff += jsRandom(0, fertilityStack/2); // this second chance for implantation. Should be affected only by chemical and genetic for easier implantation. Not directly related to ova count, only to body/womb condition. Raise successful implantation chance with already overfull womb. AFTER previous check.
+			// This is a second chance for implantation.
+			// Should be affected only by chemical and genetic for easier implantation.
+			// Not directly related to ova count, only to body/womb condition.
+			// Raise successful implantation chance with already overfull womb. AFTER previous check.
+			coeff += jsRandom(0, fertilityStack / 2);
 		}
 
 		if (ovum > coeff) {
@@ -586,7 +590,7 @@ globalThis.getBaseBoobs = function(slave) {
 globalThis.TerminatePregnancy = function(slave) {
 	if (slave.bellyPreg > 1500) {
 		// late term - highly fertile slaves spring back quicker
-		if (slave.geneticQuirks.fertility+slave.geneticQuirks.hyperFertility >= 4) {
+		if (slave.geneticQuirks.fertility + slave.geneticQuirks.hyperFertility >= 4) {
 			slave.pregWeek = -2;
 		} else if (slave.geneticQuirks.hyperFertility > 1) {
 			slave.pregWeek = -3;
diff --git a/src/js/quickListJS.js b/src/js/quickListJS.js
index ba8b35020f5..6331fb161d0 100644
--- a/src/js/quickListJS.js
+++ b/src/js/quickListJS.js
@@ -12,6 +12,7 @@ globalThis.sortDomObjects = function(objects, attrName, reverse = 0) {
 		}
 		return ((aVal === bVal) ? 0 : 1) * reverse;
 	}
+
 	return objects.toArray().sort(sortingByAttr);
 };
 
diff --git a/src/js/relationshipChecks.js b/src/js/relationshipChecks.js
index 393f628b790..629252b9158 100644
--- a/src/js/relationshipChecks.js
+++ b/src/js/relationshipChecks.js
@@ -1,5 +1,5 @@
 /**
- * @param {{ rivalry: number; }} id
+ * @param {{ rivalry: number }} id
  * @returns {string}
  */
 globalThis.rivalryTerm = function(id) {
@@ -13,7 +13,7 @@ globalThis.rivalryTerm = function(id) {
 };
 
 /**
- * @param {{ relationship: number; pronoun: number; }} id
+ * @param {{ relationship: number, pronoun: number }} id
  * @returns {string}
  */
 globalThis.relationshipTerm = function(id) {
@@ -31,7 +31,7 @@ globalThis.relationshipTerm = function(id) {
 };
 
 /**
- * @param {{ relationship: number; pronoun: number; }} id
+ * @param {{ relationship: number, pronoun: number }} id
  * @returns {string}
  */
 globalThis.relationshipTermShort = function(id) {
@@ -49,7 +49,7 @@ globalThis.relationshipTermShort = function(id) {
 };
 
 /**
- * @param {{ relationship: number; pronoun: number; }} id
+ * @param {{ relationship: number, pronoun: number }} id
  * @returns {string}
  */
 globalThis.PCrelationshipTerm = function(id) {
@@ -72,7 +72,7 @@ globalThis.PCrelationshipTerm = function(id) {
  * @param {boolean} [insertComma=false] - when true, if a relationship is found, it will be separated from the actor's name by a comma ("her father, Dave" instead of "her father Dave")
  * @returns {string|DocumentFragment}
  */
-globalThis.contextualIntro = function(context, actor, asLink=false, insertComma=false) {
+globalThis.contextualIntro = function(context, actor, asLink = false, insertComma = false) {
 	let first = true;
 	let r = ``;
 	const firstPreamble = (context === V.PC) ? "your" : getPronouns(context).possessive;
diff --git a/src/js/removeSlave.js b/src/js/removeSlave.js
index baac7d69529..071678f08b8 100644
--- a/src/js/removeSlave.js
+++ b/src/js/removeSlave.js
@@ -104,7 +104,8 @@ globalThis.removeSlave = function(slave) {
 				}
 			*/
 			if (s.ID === slave.subTarget || slave.subTarget === s.ID) {
-				slave.subTarget = 0; s.subTarget = 0;
+				slave.subTarget = 0;
+				s.subTarget = 0;
 			}
 
 			if (s.partners.has(AS_ID)) {
diff --git a/src/js/salon.js b/src/js/salon.js
index a3fa942df20..cd10fc15581 100644
--- a/src/js/salon.js
+++ b/src/js/salon.js
@@ -47,7 +47,7 @@ App.Medicine.Modification.eyeSelector = function(entity, cheat = false) {
 	/**
 	 * @param {string} name
 	 * @param {Array<string>} list
-	 * @param {function(string):void}callback
+	 * @param {function(string):void} callback
 	 * @param {string} selected
 	 * @returns {HTMLDivElement}
 	 */
@@ -233,8 +233,14 @@ App.Medicine.Modification.eyeSelector = function(entity, cheat = false) {
  * @returns {HTMLElement}
  */
 App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColor = "", cheat = false} = {}) {
-	let updatePrimary = (newVal) => { primaryEarColor = newVal; apply(); };
-	let updateSecondary = (newVal) => { secondaryEarColor = newVal; apply(); };
+	let updatePrimary = (newVal) => {
+		primaryEarColor = newVal;
+		apply();
+	};
+	let updateSecondary = (newVal) => {
+		secondaryEarColor = newVal;
+		apply();
+	};
 	const container = document.createElement("div");
 	container.id = "salon-ears";
 	container.append(content());
@@ -316,6 +322,7 @@ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColo
 		}
 		return App.UI.DOM.generateLinksStrip(links);
 	}
+
 	function apply() {
 		App.Art.refreshSlaveArt(slave, 3, "art-frame");
 		App.Medicine.Salon.ears(
@@ -339,8 +346,14 @@ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColo
  */
 App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailColor = "", cheat = false} = {}) {
 	const frag = new DocumentFragment();
-	let updatePrimary = (newVal) => { primaryTailColor = newVal.value; apply(); };
-	let updateSecondary = (newVal) => { secondaryTailColor = newVal.value; apply(); };
+	let updatePrimary = (newVal) => {
+		primaryTailColor = newVal.value;
+		apply();
+	};
+	let updateSecondary = (newVal) => {
+		secondaryTailColor = newVal.value;
+		apply();
+	};
 	const {His, his} = getPronouns(slave);
 
 	if (slave.tail !== "none") {
diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js
index c460cf0ac47..cfa4874d5db 100644
--- a/src/js/sexActsJS.js
+++ b/src/js/sexActsJS.js
@@ -1,15 +1,10 @@
 globalThis.VCheck = (function() {
 	"use strict";
-	/* eslint-disable no-unused-vars*/
 	let he;
 	let him;
 	let his;
-	let hers;
-	let himself;
-	let boy;
 	let He;
 	let His;
-	/* eslint-enable */
 
 	return {
 		Anal: AnalVCheck,
diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js
index 0c16a342c3b..9f56339cb3f 100644
--- a/src/js/slaveCostJS.js
+++ b/src/js/slaveCostJS.js
@@ -2,7 +2,7 @@
  * @param {boolean} [includeLaws=false]
  * @returns {number}
  */
-globalThis.minimumSlaveCost = function(includeLaws=false) {
+globalThis.minimumSlaveCost = function(includeLaws = false) {
 	let value = 3000;
 
 	if (V.terrain === "urban") {
@@ -602,7 +602,7 @@ globalThis.BeautyArray = (function() {
 			} else if (slave.butt <= 4) {
 				adjustBeauty("Big Bubble Butt: Transformation Fetishist / Asset Expansionist", (2 + 1.5 * (slave.butt - 2))); /* 5 */
 			} else if (slave.butt <= 10) {
-				adjustBeauty("Ridiculous Butt: Transformation Fetishist / Asset Expansionist", (5 + 1 * (slave.butt - 4))); /* 11 */
+				adjustBeauty("Ridiculous Butt: Transformation Fetishist / Asset Expansionist", (5 + (slave.butt - 4))); /* 11 */
 			} else {
 				adjustBeauty("Inhuman Butt: Transformation Fetishist / Asset Expansionist", (7 + 0.5 * (slave.butt - 5))); /* 14.5 */
 			} /* maybe buff butts? */
@@ -1621,6 +1621,7 @@ globalThis.BeautyArray = (function() {
 			adjustBeauty("Porn Prestige", (0.1 * beauty));
 		}
 	}
+
 	return BeautyReturn;
 })();
 
@@ -1630,7 +1631,6 @@ globalThis.Beauty = function(s) {
 	return beauty;
 };
 
-
 globalThis.BeautyTooltip = function(slave) {
 	// Make a link. Text should be slave's beauty. Clicking the link will display detailed info about that beauty over the top of the page (tooltip-style)
 	const beauty = Beauty(slave);
@@ -1648,10 +1648,22 @@ globalThis.BeautyTooltip = function(slave) {
 
 		el.appendChild(document.createTextNode(`Sort by: `));
 		el.appendChild(App.UI.DOM.generateLinksStrip([
-			App.UI.DOM.link("Text", () => { criteria = "text"; jQuery('#cheatBeautyContents').empty().append(BeautyFrame()); }, []),
-			App.UI.DOM.link("Value", () => { criteria = "value"; jQuery('#cheatBeautyContents').empty().append(BeautyFrame()); }, []),
-			App.UI.DOM.link("Ascending", () => { direction = "ascending"; jQuery('#cheatBeautyContents').empty().append(BeautyFrame()); }, []),
-			App.UI.DOM.link("Descending", () => { direction = "descending"; jQuery('#cheatBeautyContents').empty().append(BeautyFrame()); }, [])
+			App.UI.DOM.link("Text", () => {
+				criteria = "text";
+				jQuery('#cheatBeautyContents').empty().append(BeautyFrame());
+			}, []),
+			App.UI.DOM.link("Value", () => {
+				criteria = "value";
+				jQuery('#cheatBeautyContents').empty().append(BeautyFrame());
+			}, []),
+			App.UI.DOM.link("Ascending", () => {
+				direction = "ascending";
+				jQuery('#cheatBeautyContents').empty().append(BeautyFrame());
+			}, []),
+			App.UI.DOM.link("Descending", () => {
+				direction = "descending";
+				jQuery('#cheatBeautyContents').empty().append(BeautyFrame());
+			}, [])
 		]));
 
 		let cheatBeautyContents = App.UI.DOM.appendNewElement("div", el, BeautyFrame());
@@ -1711,6 +1723,7 @@ globalThis.FResultArray = (function() {
 	let result;
 	let retval;
 	let incestBonus;
+
 	/**
 	 * @param {App.Entity.SlaveState} slave
 	 * @param {number} [forSale=0] set to 1 if the value should not consider co-assignment and other temporary factors
@@ -1780,6 +1793,7 @@ globalThis.FResultArray = (function() {
 
 	/**
 	 * @param {App.Entity.SlaveState} slave
+	 * @param {number} [forSale=0]
 	 */
 	function calcUseWeights(slave, forSale = 0) {
 		adjustFResult(`Muscles`, slave.muscles / 30);
@@ -2049,6 +2063,7 @@ globalThis.FResultArray = (function() {
 
 	/**
 	 * @param {App.Entity.SlaveState} slave
+	 * @param {number} [forSale=0]
 	 */
 	function calcNotFuckdoll(slave, forSale = 0) {
 		if (!forSale) {
@@ -2153,7 +2168,6 @@ globalThis.FResultArray = (function() {
 	return FResult;
 })();
 
-
 /** Calculate the sexual value (FResult) of the slave
  * @param {App.Entity.SlaveState} s
  * @param {number} [forSale=0] set to 1 to ignore co-assignment and other temporary factors
@@ -2165,7 +2179,6 @@ globalThis.FResult = function(s, forSale = 0) {
 	return FResult;
 };
 
-
 /** Show an itemized breakdown of the sexual value (FResult) of the slave
  * @param {App.Entity.SlaveState} slave
  * @param {number} [forSale=0] set to 1 to ignore co-assignment and other temporary factors
@@ -2189,10 +2202,22 @@ globalThis.FResultTooltip = function(slave, forSale = 0) {
 
 		el.appendChild(document.createTextNode(`Sort by: `));
 		el.appendChild(App.UI.DOM.generateLinksStrip([
-			App.UI.DOM.link("Text", () => { criteria = "text"; jQuery('#cheatFResultContents').empty().append(FResultFrame); }, []),
-			App.UI.DOM.link("Value", () => { criteria = "value"; jQuery('#cheatFResultContents').empty().append(FResultFrame); }, []),
-			App.UI.DOM.link("Ascending", () => { direction = "ascending"; jQuery('#cheatFResultContents').empty().append(FResultFrame); }, []),
-			App.UI.DOM.link("Descending", () => { direction = "descending"; jQuery('#cheatFResultContents').empty().append(FResultFrame); }, [])
+			App.UI.DOM.link("Text", () => {
+				criteria = "text";
+				jQuery('#cheatFResultContents').empty().append(FResultFrame);
+			}, []),
+			App.UI.DOM.link("Value", () => {
+				criteria = "value";
+				jQuery('#cheatFResultContents').empty().append(FResultFrame);
+			}, []),
+			App.UI.DOM.link("Ascending", () => {
+				direction = "ascending";
+				jQuery('#cheatFResultContents').empty().append(FResultFrame);
+			}, []),
+			App.UI.DOM.link("Descending", () => {
+				direction = "descending";
+				jQuery('#cheatFResultContents').empty().append(FResultFrame);
+			}, [])
 		]));
 
 		let cheatFResultContents = App.UI.DOM.appendNewElement("div", el, FResultFrame());
diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js
index 5ed8b3dfebc..050b81f13a4 100644
--- a/src/js/slaveListing.js
+++ b/src/js/slaveListing.js
@@ -29,7 +29,7 @@ App.UI.SlaveList.render = function() {
 	// potentially can be a problem if played long enough to reach Number.MAX_SAFE_INTEGER
 	let listID = Number.MIN_SAFE_INTEGER;
 
-	/** @type {App.Art.SlaveArtBatch?} */
+	/** @type {App.Art.SlaveArtBatch} */
 	let batchRenderer = null;
 
 	return listDOM;
@@ -190,11 +190,11 @@ App.UI.SlaveList.render = function() {
 				if ((V.clinicInflateBelly > 0) && (slave.bellyImplant >= 0) && (slave.bellyImplant <= (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))) {
 					list.push(`implant filling`);
 				}
-				if ((slave.pregKnown === 1) && (V.clinicSpeedGestation > 0 || slave.pregControl === "speed up") && ((slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33))) {
+				if ((slave.pregKnown === 1) && (V.clinicSpeedGestation > 0 || slave.pregControl === "speed up") && ((slave.pregAdaptation * 1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth / 1.33))) {
 					list.push(`observation of accelerated pregnancy`);
 				} else if ((slave.pregKnown === 1) && (V.clinicSpeedGestation > 0 || slave.pregControl === "speed up")) {
 					list.push(`safely hurrying pregnancy along`);
-				} else if ((slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33)) {
+				} else if ((slave.pregAdaptation * 1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth / 1.33)) {
 					list.push(`observation during pregnancy`);
 				}
 			}
@@ -205,7 +205,6 @@ App.UI.SlaveList.render = function() {
 			}
 		} else if (slave.assignment === Job.SPA) {
 			let list = [];
-			let i;
 			if (slave.fetish === "mindbroken") {
 				assignment.innerText += `, mindbroken`;
 			} else {
@@ -298,12 +297,18 @@ App.UI.SlaveList.render = function() {
 		res.appendChild(document.createTextNode(' '));
 
 		if ((V.displayAssignments === 1) && (passageName === "Main") && (slave.ID !== V.HeadGirlID) && (slave.ID !== V.RecruiterID) && (slave.ID !== V.BodyguardID)) {
-			res.appendChild(App.UI.jobLinks.assignmentsFragment(slave.ID, "Main", (slave, assignment) => { App.UI.SlaveList.ScrollPosition.record(); assignJob(slave, assignment); }));
+			res.appendChild(App.UI.jobLinks.assignmentsFragment(slave.ID, "Main", (slave, assignment) => {
+				App.UI.SlaveList.ScrollPosition.record();
+				assignJob(slave, assignment);
+			}));
 		}
 		if (showTransfers) {
 			res.appendChild(document.createElement("br"));
 			res.appendChild(document.createTextNode('Transfer to: '));
-			res.appendChild(App.UI.jobLinks.transfersFragment(slave.ID, (slave, assignment) => { App.UI.SlaveList.ScrollPosition.record(); assignJob(slave, assignment); }));
+			res.appendChild(App.UI.jobLinks.transfersFragment(slave.ID, (slave, assignment) => {
+				App.UI.SlaveList.ScrollPosition.record();
+				assignJob(slave, assignment);
+			}));
 		}
 
 		res.appendChild(App.UI.SlaveSummary.render(slave));
@@ -633,6 +638,7 @@ App.UI.SlaveList.listSJFacilitySlaves = function(facility, facilityPassage, show
 			App.UI.SlaveList.SlaveInteract.stdInteract,
 			(slave) => App.UI.DOM.link(`Send ${getPronouns(slave).object} to ${facility.name}`, () => { assignmentTransition(slave, job.desc.assignment, facilityPassage); }));
 	}
+
 	if (facility.hasFreeSpace) {
 		const assignableSlaveIDs = job.desc.partTime ?
 			V.slaves.map(slave => slave.ID) : // all slaves can work here
@@ -881,7 +887,6 @@ App.UI.SlaveList.penthousePage = function() {
 		};
 	}
 
-
 	/**
 	 * @typedef tabDesc
 	 * @property {string} tabName
@@ -1142,7 +1147,8 @@ App.UI.SlaveList.slaveSelectionList = function() {
 	 */
 	function _listSlaves(assignmentStr) {
 		const slaves = V.slaves;
-		let unfilteredIDs = [];
+		/** @type {Array<number>} */
+		let unfilteredIDs;
 		switch (assignmentStr) {
 			case 'all':
 				unfilteredIDs = slaves.map(s => s.ID);
diff --git a/src/js/slaveSummaryHelpers.js b/src/js/slaveSummaryHelpers.js
index 67e8f38d135..fefd15ca935 100644
--- a/src/js/slaveSummaryHelpers.js
+++ b/src/js/slaveSummaryHelpers.js
@@ -201,13 +201,14 @@ App.UI.SlaveSummaryImpl = function() {
 				const p = fsp.slice(2);
 				FSData.policy[p] = {
 					active: (policy === "unset" || _.isNil(policy)) ? 0 : 1,
-					strength: Math.trunc(policy === "unset" ? 0: policy / 10)
+					strength: Math.trunc(policy === "unset" ? 0 : policy / 10)
 				};
 			}
 
 			const dislikeBigButts = (FSData.policy.TransformationFetishist.strength < 2) && (FSData.policy.HedonisticDecadence.strength < 2) && (FSData.policy.AssetExpansionist.strength < 2) && (arcology.FSIntellectualDependencyLawBeauty === 0);
 			FSData.bigButts = dislikeBigButts ? -1 : 0;
 		}
+
 		/**
 		 * @typedef {Object} FSDatum
 		 * @property {number} active FS policy is active (0,1)
@@ -243,7 +244,7 @@ App.UI.SlaveSummaryImpl = function() {
 			daughters5: "Has many daughters.",
 			daughters1: "Has several daughters.",
 			sisters10: "One of many sisters.",
-			sisters5:  "Has many sisters.",
+			sisters5: "Has many sisters.",
 			sisters1: "Has several sisters.",
 			emotionBind: "Emotionally bonded to you.",
 			emotionSlut: "Emotional slut."
@@ -256,7 +257,7 @@ App.UI.SlaveSummaryImpl = function() {
 			daughters5: "many daughters",
 			daughters1: "has daughters",
 			sisters10: "One of many sisters.",
-			sisters5:  "Has many sisters.",
+			sisters5: "Has many sisters.",
 			sisters1: "Has several sisters.",
 			emotionBind: "E Bonded",
 			emotionSlut: "E Slut"
@@ -526,7 +527,7 @@ App.UI.SlaveSummaryImpl = function() {
 						}
 				}
 			} else {
-				switch (cs){
+				switch (cs) {
 					// fall-through
 					case "women":
 					case "men":
@@ -538,7 +539,6 @@ App.UI.SlaveSummaryImpl = function() {
 			return null;
 		}
 
-
 		/**
 		 * @param {App.Entity.SlaveState} slave
 		 * @param {Node} c
@@ -804,7 +804,8 @@ App.UI.SlaveSummaryImpl = function() {
 			const modScore = SlaveStatsChecker.modScore(slave);
 			if (slave.corsetPiercing === 0 && modScore.piercing < 3 && modScore.tat < 2) {
 				return;
-			} else if (modScore.total > 15 || (modScore.piercing > 8 && modScore.tat > 5)) {
+			}
+			if (modScore.total > 15 || (modScore.piercing > 8 && modScore.tat > 5)) {
 				makeSpan(c, "Extensive body mods.");
 			} else if (modScore.total > 7) {
 				makeSpan(c, "Noticeable body mods.");
@@ -991,7 +992,6 @@ App.UI.SlaveSummaryImpl = function() {
 			}
 		}
 
-
 		/**
 		 * @param {App.Entity.SlaveState} slave
 		 * @param {Node} c
@@ -1106,7 +1106,7 @@ App.UI.SlaveSummaryImpl = function() {
 		 * @returns {void}
 		 */
 		function long_clothes(slave, c) {
-			makeSpan(c, helpers.getExactRating(data.long.clothes, slave.clothes,  'Naked.'));
+			makeSpan(c, helpers.getExactRating(data.long.clothes, slave.clothes, 'Naked.'));
 		}
 
 		/**
@@ -1265,6 +1265,7 @@ App.UI.SlaveSummaryImpl = function() {
 				}
 				return helpers.getNumericRating(tbl, slave.fetishStrength);
 			}
+
 			const fStr = fetishStr(slave);
 			if (fStr) {
 				makeSpan(c, fStr, "lightcoral", true, slave.fetishStrength);
@@ -1352,6 +1353,7 @@ App.UI.SlaveSummaryImpl = function() {
 				}
 				return helpers.getNumericRating(tbl, slave.fetishStrength);
 			}
+
 			const fStr = fetishStr(slave);
 			if (fStr) {
 				makeSpan(c, fStr, "lightcoral", true, slave.fetishStrength);
diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js
index 845adfab187..1747a8be993 100644
--- a/src/js/slaveSummaryWidgets.js
+++ b/src/js/slaveSummaryWidgets.js
@@ -96,7 +96,6 @@ App.UI.SlaveSummaryRenderers = function() {
 			makeSpan(c, "MaR:" + App.Utils.releaseSummaryShort(slave), styles);
 		},
 
-
 		/**
 		 * @param {App.Entity.SlaveState} slave
 		 * @param {Node} c
@@ -798,7 +797,7 @@ App.UI.SlaveSummaryRenderers = function() {
 	return {
 		short: shortRenderers,
 		long: longRenderers,
-		empty: function(){}
+		empty: function() {}
 	};
 }();
 
@@ -853,9 +852,12 @@ App.UI.SlaveSummary = function() {
 
 	function delegateForSetting(name, setting) {
 		switch (setting) {
-			case 0: return App.UI.SlaveSummaryRenderers.empty;
-			case 1: return App.UI.SlaveSummaryRenderers.short[name];
-			case 2: return App.UI.SlaveSummaryRenderers.long[name];
+			case 0:
+				return App.UI.SlaveSummaryRenderers.empty;
+			case 1:
+				return App.UI.SlaveSummaryRenderers.short[name];
+			case 2:
+				return App.UI.SlaveSummaryRenderers.long[name];
 		}
 	}
 
@@ -874,7 +876,7 @@ App.UI.SlaveSummary = function() {
 			if (!V.seeRace) {
 				delegates.race = emptyRenderer;
 			}
-		} catch (ex){
+		} catch (ex) {
 			console.error(ex);
 		}
 	}
diff --git a/src/js/statsChecker/statsChecker.js b/src/js/statsChecker/statsChecker.js
index 59ba470fc0b..0ad4d6b2ab4 100644
--- a/src/js/statsChecker/statsChecker.js
+++ b/src/js/statsChecker/statsChecker.js
@@ -1076,7 +1076,6 @@ globalThis.isVegetable = function(slave) {
 	return (slave.fetish === "mindbroken");
 };
 
-
 /**
  * Returns the hair color the slave was (or would be) born with.
  *
diff --git a/src/js/storyJS.js b/src/js/storyJS.js
index cc771ba9a0f..b8ce71c9f43 100644
--- a/src/js/storyJS.js
+++ b/src/js/storyJS.js
@@ -23,7 +23,7 @@ globalThis.variableAsNumber = function(x, minValue, maxValue, defaultValue = 0)
 };
 
 if (typeof interpolate === "undefined") {
-	const interpolate = function(x0, y0, x1, y1, x) {
+	globalThis.interpolate = function(x0, y0, x1, y1, x) {
 		if (x <= x0) {
 			return y0;
 		} else if (x >= x1) {
@@ -32,7 +32,6 @@ if (typeof interpolate === "undefined") {
 			return (x - x0) * ((y1 - y0) / (x1 - x0)) + y0;
 		}
 	};
-	globalThis.interpolate = interpolate;
 }
 
 /**
@@ -445,9 +444,9 @@ globalThis.overpowerCheck = function(slave, PC) {
 	} else {
 		strength = 30;
 	}
-	strength += (185-slave.height);
-	strength -= (PC.belly/1000);
-	strength += (PC.skill.warfare/3);
+	strength += (185 - slave.height);
+	strength -= (PC.belly / 1000);
+	strength += (PC.skill.warfare / 3);
 	strength -= (V.PC.health.shortDamage);
 
 	return strength;
@@ -477,15 +476,16 @@ globalThis.canLift = function(liftee, lifter) {
 		sumWeight += Math.pow(Math.trunc(liftee.balls / 10), 3);
 	}
 
-	return 20 + lifter.strength >= sumWeight && hasBothArms(lifter);
+	return 20 + lifter.muscles >= sumWeight && hasBothArms(lifter);
 };
 
 /**
  * returns array of IDs of all characters who impregnated slave
  * @param {FC.HumanState} slave
+ * @param {boolean} [genepool=false]
  * @returns {number[]}
  */
-globalThis.impregnatedBy = function(slave, genepool=false) {
+globalThis.impregnatedBy = function(slave, genepool = false) {
 	const IDArray = [];
 	if (!Array.isArray(slave.womb)) {
 		if (genepool) {
@@ -504,9 +504,10 @@ globalThis.impregnatedBy = function(slave, genepool=false) {
  * returns true if mother was impregnated by father
  * @param {FC.HumanState} mother
  * @param {FC.HumanState} father
+ * @param {boolean} [genepool=false]
  * @returns {boolean}
  */
-globalThis.isImpregnatedBy = function(mother, father, genepool=false) {
+globalThis.isImpregnatedBy = function(mother, father, genepool = false) {
 	return impregnatedBy(mother, genepool).includes(father.ID);
 };
 
@@ -633,7 +634,7 @@ globalThis.pregNumberName = function(nmbr1, nmbr2) {
 					pt += "nonu";
 					break;
 				default:
-					switch (p1)	{
+					switch (p1) {
 						case 1:
 							pt += "un";
 							break;
@@ -662,7 +663,7 @@ globalThis.pregNumberName = function(nmbr1, nmbr2) {
 							pt += "novem";
 							break;
 					}
-					switch (p2)	{
+					switch (p2) {
 						case 1:
 							pt += "dec";
 							break;
@@ -695,7 +696,7 @@ globalThis.pregNumberName = function(nmbr1, nmbr2) {
 						if (p2 !== 0) {
 							pt += "i";
 						}
-						switch (p3)	{
+						switch (p3) {
 							case 1:
 								pt += "centu";
 								break;
diff --git a/src/js/utilsArcology.js b/src/js/utilsArcology.js
index 4dd1a73849d..d55caf049e6 100644
--- a/src/js/utilsArcology.js
+++ b/src/js/utilsArcology.js
@@ -25,7 +25,7 @@ globalThis.getRevivalistNationality = function() {
 App.Utils.economicUncertainty = function(arcologyID) {
 	let uncertainty = arcologyID === 0 ? 5 : 10;
 	if (assistant.power === 1) {
-		uncertainty -= Math.max(Math.trunc(uncertainty/2), 0);
+		uncertainty -= Math.max(Math.trunc(uncertainty / 2), 0);
 	} else if (assistant.power > 1) {
 		uncertainty = 0;
 	}
diff --git a/src/js/utilsMisc.js b/src/js/utilsMisc.js
index d25cce3b183..aa9c8cb4075 100644
--- a/src/js/utilsMisc.js
+++ b/src/js/utilsMisc.js
@@ -1,34 +1,32 @@
 /**
-A categorizer is used to "slice" a value range into distinct categories in an efficient manner.
-
-If the values are objects their property named 'value' will be set to whatever
-the value used for the choice was. This is important for getters, where it can be accessed
-via this.value.
-
---- Example ---
-Original SugarCube code
-<<if _Slave.muscles > 95>>
-	Musc++
-<<elseif _Slave.muscles > 30>>
-	Musc+
-<<elseif _Slave.muscles > 5>>
-	Toned
-<<elseif _Slave.muscles > -6>>
-<<elseif _Slave.muscles > -31>>
-	<span class="red">weak</span>
-<<elseif _Slave.muscles > -96>>
-	<span class="red">weak+</span>
-<<else>>
-	<span class="red">weak++</span>
-<</if>>
-
-As a categorizer
-<<if ndef $cats>><<set $cats = {}>><</if>>
-<<if ndef $cats.muscleCat>>
-	<!-- This only gets set once, skipping much of the code evaluation, and can be set outside of the code in an "init" passage for further optimization -->
-	<<set $cats.muscleCat = new Categorizer([96, 'Musc++'], [31, 'Musc+'], [6, 'Toned'], [-5, ''], [-30, '<span class="red">weak</span>'], [-95, '<span class="red">weak+</span>'], [-Infinity, '<span class="red">weak++</span>'])>>
-<</if>>
-<<print $cats.muscleCat.cat(_Slave.muscles)>>
+ * A categorizer is used to "slice" a value range into distinct categories in an efficient manner.
+ *
+ * If the values are objects their property named 'value' will be set to whatever
+ * the value used for the choice was. This is important for getters, where it can be accessed
+ * via this.value.
+ *
+ * @example Plain if
+ * let r = "";
+ * if (slave.muscles > 95) {
+ *     r = "Musc++";
+ * } else if (slave.muscles > 30) {
+ *     r = "Musc+";
+ * } else if (slave.muscles > 5) {
+ *     r = "Toned";
+ * } else if (slave.muscles > -6) {
+ * } elseif (slave.muscles > -31) {
+ *     r = "weak";
+ * } else if (slave.muscles > -96) {
+ *     r = "weak+";
+ * } else {
+ * 	   r = "weak++";
+ * }
+ *
+ * @example As a categorizer
+ * // Can be defined globally.
+ * const muscleCat = new Categorizer([96, "Musc++"], [31, "Musc+"], [6, "Toned"], [-5, ""], [-30, "weak"], [-95, "weak+"], [-Infinity, "weak++"])
+ *
+ * r = muscleCat.cat(slave.muscles);
  */
 globalThis.Categorizer = class {
 	/**
diff --git a/src/js/utilsSlave.js b/src/js/utilsSlave.js
index 2de656292f6..53b660dfcb4 100644
--- a/src/js/utilsSlave.js
+++ b/src/js/utilsSlave.js
@@ -1,4 +1,4 @@
-/*
+/**
  * Height.mean(nationality, race, genes, age) - returns the mean height for the given combination and age in years (>=2)
  * Height.mean(nationality, race, genes) - returns the mean adult height for the given combination
  * Height.mean(slave) - returns the mean (expected) height for the given slave
diff --git a/src/js/utilsSlaves.js b/src/js/utilsSlaves.js
index ef20527d6ef..2c4f199ae36 100644
--- a/src/js/utilsSlaves.js
+++ b/src/js/utilsSlaves.js
@@ -154,7 +154,10 @@ globalThis.getBestSlavesIDs = function(info) {
  * @returns {Object.<number, number>}
  */
 globalThis.slaves2indices = function(slaves = V.slaves) {
-	return slaves.reduce((acc, slave, i) => { acc[slave.ID] = i; return acc; }, {});
+	return slaves.reduce((acc, slave, i) => {
+		acc[slave.ID] = i;
+		return acc;
+	}, {});
 };
 
 /** Calculate various averages for the master suite slaves
@@ -175,7 +178,7 @@ App.Utils.masterSuiteAverages = (function() {
 		const msSlaves = App.Entity.facilities.masterSuite.employees();
 		return {
 			energy: _.mean(msSlaves.map(s => s.energy)),
-			milk: _.mean(msSlaves.map(s => s.lactation*(s.boobs-s.boobsImplant))),
+			milk: _.mean(msSlaves.map(s => s.lactation * (s.boobs - s.boobsImplant))),
 			cum: _.mean(msSlaves.map(s => canAchieveErection(s) ? s.balls : 0)),
 			dick: _.mean(msSlaves.map(s => canAchieveErection(s) ? s.dick : 0)),
 			preg: _.mean(msSlaves.map(s => s.preg)),
@@ -232,7 +235,8 @@ App.Utils.countFacilityWorkers = function(facilities = null, mapping = {}) {
 	/** @type {App.Entity.Facilities.Facility[]} */
 	const fObjects = facilities.map(f => typeof f === "string" ? App.Entity.facilities[f] : f);
 	return fObjects.reduce((acc, cur) => {
-		acc[mapping[cur.desc.baseName] || cur.desc.baseName] = cur.employeesIDs().size; return acc;
+		acc[mapping[cur.desc.baseName] || cur.desc.baseName] = cur.employeesIDs().size;
+		return acc;
 	}, {});
 };
 
@@ -242,5 +246,8 @@ App.Utils.countFacilityWorkers = function(facilities = null, mapping = {}) {
  */
 App.Utils.countAssignmentWorkers = function(assignments) {
 	assignments = assignments || Object.values(Job);
-	return assignments.reduce((acc, cur) => { acc[cur] = V.JobIDMap[cur].size; return acc; }, {});
+	return assignments.reduce((acc, cur) => {
+		acc[cur] = V.JobIDMap[cur].size;
+		return acc;
+	}, {});
 };
diff --git a/src/js/wombJS.js b/src/js/wombJS.js
index 5374dc38709..3a4fc61ea6d 100644
--- a/src/js/wombJS.js
+++ b/src/js/wombJS.js
@@ -373,7 +373,6 @@ globalThis.WombGetVolume = function(actor) { // most legacy code from pregJS.tw
 		return wombSize;
 	}
 
-
 	function getVolByWeight(actor) {
 		let targetData;
 		let wombSize = 0;
@@ -392,7 +391,6 @@ globalThis.WombGetVolume = function(actor) { // most legacy code from pregJS.tw
 		return wombSize;
 	}
 
-
 	function getVolByRaw(actor) {
 		let targetData;
 		let wombSize = 0;
-- 
GitLab