From 5e93d94a92fb436b68af724a82c166d43fbe14ea Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Sat, 6 Jun 2020 15:20:43 -0700
Subject: [PATCH] Migrate from $Stewardess to $StewardessID, and fix the
 stewardess bonus.

---
 js/003-data/gameVariableData.js               |  3 +--
 src/004-base/specialSlavesProxy.js            |  2 +-
 .../backwardsCompatibility/datatypeCleanup.js |  2 +-
 src/endWeek/endWeek.js                        |  1 -
 src/endWeek/saServant.js                      | 27 ++++++++++---------
 src/endWeek/servantsQuartersReport.js         |  6 ++---
 src/endWeek/slaveAssignmentReport.js          | 17 ++++++------
 src/js/assayJS.js                             |  2 +-
 src/js/assignJS.js                            |  4 +--
 src/npc/descriptions/style/clothing.js        |  8 +++---
 src/pregmod/widgets/pregmodBirthWidgets.tw    | 14 +++++-----
 src/uncategorized/PETS.tw                     |  2 +-
 src/uncategorized/randomNonindividualEvent.tw |  2 +-
 src/uncategorized/reNickname.tw               |  2 +-
 src/uncategorized/saRelationships.tw          |  2 +-
 src/uncategorized/servantsQuarters.tw         | 10 +++----
 src/uncategorized/stewardessSelect.tw         |  9 +++----
 src/utility/birthWidgets.tw                   |  8 +++---
 18 files changed, 59 insertions(+), 62 deletions(-)

diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js
index 46bb53da708..d21532d3622 100644
--- a/js/003-data/gameVariableData.js
+++ b/js/003-data/gameVariableData.js
@@ -1104,8 +1104,7 @@ App.Data.resetOnNGPlus = {
 	milkmaidImpregnates: 0,
 	/** @type {FC.SlaveStateOrZero} */
 	Farmer: 0,
-	/** @type {FC.SlaveStateOrZero} */
-	Stewardess: 0,
+	StewardessID: 0,
 	stewardessImpregnates: 0,
 	/** @type {FC.SlaveStateOrZero} */
 	Schoolteacher: 0,
diff --git a/src/004-base/specialSlavesProxy.js b/src/004-base/specialSlavesProxy.js
index 36ca1085ab4..07e27ee0402 100644
--- a/src/004-base/specialSlavesProxy.js
+++ b/src/004-base/specialSlavesProxy.js
@@ -42,7 +42,7 @@ App.SpecialSlavesProxy = class SpecialSlavesProxy {
 		return V.Schoolteacher;
 	}
 	get Stewardess() {
-		return V.Stewardess;
+		return slaveStateById(V.StewardessID);
 	}
 	get Stud() {
 		return slaveStateById(V.StudID);
diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js
index 3ce6a3b7a02..15c76b0794d 100644
--- a/src/data/backwardsCompatibility/datatypeCleanup.js
+++ b/src/data/backwardsCompatibility/datatypeCleanup.js
@@ -2152,7 +2152,7 @@ globalThis.FacilityDatatypeCleanup = (function() {
 		V.servantsQuarters = Math.max(+V.servantsQuarters, 0) || 0;
 		V.servantsQuartersUpgradeMonitoring = Math.clamp(+V.servantsQuartersUpgradeMonitoring, 0, 1) || 0;
 		/* stewardess */
-		V.Stewardess = V.slaves.find(s => s.assignment === Job.STEWARD) || 0;
+		V.StewardessID = findSlaveId(s => s.assignment === Job.STEWARD);
 		V.stewardessImpregnates = Math.clamp(+V.stewardessImpregnates, 0, 1) || 0;
 	}
 
diff --git a/src/endWeek/endWeek.js b/src/endWeek/endWeek.js
index 56c114d32c7..6fdeb9f6070 100644
--- a/src/endWeek/endWeek.js
+++ b/src/endWeek/endWeek.js
@@ -297,7 +297,6 @@ globalThis.endWeek = (function() {
 		V.DJRepBonus = 0;
 		V.Milkmaid = 0;
 		V.Farmer = 0;
-		V.Stewardess = 0;
 		V.Schoolteacher = 0;
 		V.Wardeness = 0;
 		V.Concubine = 0;
diff --git a/src/endWeek/saServant.js b/src/endWeek/saServant.js
index 7f9538f7eea..7aee822d5cb 100644
--- a/src/endWeek/saServant.js
+++ b/src/endWeek/saServant.js
@@ -8,15 +8,18 @@ App.SlaveAssignment.servant = (function() {
 
 	let cash;
 	let oralUse;
+	let stewardessBonus;
 
 	return saServant;
 
 	/**
 	 * @param {App.Entity.SlaveState} slave
+	 * @param {number} [bonus=0] - bonus from facility leader effects
 	 * @returns {string}
 	 */
-	function saServant(slave) {
+	function saServant(slave, bonus=0) {
 		r = [];
+		stewardessBonus = bonus;
 
 		({
 			// eslint-disable-next-line no-unused-vars
@@ -59,8 +62,8 @@ App.SlaveAssignment.servant = (function() {
 			r.push(`Since there's extra space in the servants' quarters, ${V.assistant.name} attaches ${him} to the cadre of maids there.`);
 			V.servantsQuartersSpots--;
 		}
-		if (V.Stewardess !== 0) {
-			r.push(`This brings ${him} under ${V.Stewardess.slaveName}'s supervision. The Stewardess`);
+		if (S.Stewardess) {
+			r.push(`This brings ${him} under ${S.Stewardess.slaveName}'s supervision. The Stewardess`);
 			if (slave.devotion < -20) {
 				r.push(`subjects ${him} to <span class="trust dec">corrective rape</span> when ${his} service is imperfect, <span class="devotion inc">when ${he} steps out of line,</span> or when the Stewardess just feels like raping ${him}, forcing the poor slave to <span class="yellowgreen">find refuge in work.</span>`);
 				slave.devotion += 2;
@@ -74,13 +77,13 @@ App.SlaveAssignment.servant = (function() {
 			}
 			// Portion that calculates upkeep reduction, we call it income
 			if (!(canHear(slave))) {
-				r.push(`However, ${his} inability to hear often leaves ${him} oblivious to ${V.Stewardess.slaveName}'s orders, limiting their meaningful interactions.`);
-				cash = V.stewardessBonus / 4 * healthPenalty(slave);
+				r.push(`However, ${his} inability to hear often leaves ${him} oblivious to ${S.Stewardess.slaveName}'s orders, limiting their meaningful interactions.`);
+				cash = stewardessBonus / 4 * healthPenalty(slave);
 			} else if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs")) {
-				r.push(`However, ${he} often doesn't catch what ${V.Stewardess.slaveName} says, leading to frustration, confusion and less work done.`);
-				cash = V.stewardessBonus / 2 * healthPenalty(slave);
+				r.push(`However, ${he} often doesn't catch what ${S.Stewardess.slaveName} says, leading to frustration, confusion and less work done.`);
+				cash = stewardessBonus / 2 * healthPenalty(slave);
 			} else {
-				cash = V.stewardessBonus * healthPenalty(slave);
+				cash = stewardessBonus * healthPenalty(slave);
 			}
 			if (slave.assignment === window.Job.HOUSE) {
 				cashX(cash, "slaveAssignmentHouse", slave);
@@ -222,8 +225,8 @@ App.SlaveAssignment.servant = (function() {
 				r.push(`${He} is assigned easy tasks <span class="green">so ${he} may rest</span> while still being productive.`);
 			} else if (slave.health.tired + 11 >= 90 && !willWorkToDeath(slave)) {
 				r.push(`${He} attempts to refuse to work due to ${his} exhaustion, but can do little to avoid it or the resulting`);
-				if (V.Stewardess !== 0) {
-					r.push(`<span class="trust dec">severe punishment</span> by ${V.Stewardess.slaveName}. ${His} slacking is kept in check by your watchful Stewardess keeping ${him} on task, but by the end of ${his} shift, <span class="devotion dec">${his} thoughts are made clear in the poor job ${he} did.</span>`);
+				if (S.Stewardess) {
+					r.push(`<span class="trust dec">severe punishment</span> by ${S.Stewardess.slaveName}. ${His} slacking is kept in check by your watchful Stewardess keeping ${him} on task, but by the end of ${his} shift, <span class="devotion dec">${his} thoughts are made clear in the poor job ${he} did.</span>`);
 				} else {
 					r.push(`<span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">accomplishes little,</span> having chosen ${his} overall well-being over the consequences.`);
 				}
@@ -243,8 +246,8 @@ App.SlaveAssignment.servant = (function() {
 				r.push(`${He} is assigned easy tasks <span class="green">so ${he} may rest</span> while still being productive.`);
 			} else if (slave.health.tired + 11 >= 90 && !willWorkToDeath(slave)) {
 				r.push(`${He} attempts to refuse to work due to ${his} exhaustion, but can do little to avoid it or the resulting`);
-				if (V.servantsQuarters > 0 && V.universalRulesFacilityWork === 1 && V.servantsQuartersSpots > 0 && V.Stewardess !== 0) {
-					r.push(`<span class="trust dec">severe punishment</span> by ${V.Stewardess.slaveName}. ${His} slacking is kept in check by your watchful Stewardess keeping ${him} on task, but by the end of ${his} shift, <span class="devotion dec">${his} thoughts are made clear in the poor job ${he} did.</span>`);
+				if (V.servantsQuarters > 0 && V.universalRulesFacilityWork === 1 && V.servantsQuartersSpots > 0 && S.Stewardess) {
+					r.push(`<span class="trust dec">severe punishment</span> by ${S.Stewardess.slaveName}. ${His} slacking is kept in check by your watchful Stewardess keeping ${him} on task, but by the end of ${his} shift, <span class="devotion dec">${his} thoughts are made clear in the poor job ${he} did.</span>`);
 				} else {
 					r.push(`<span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">accomplishes little,</span> having chosen ${his} overall well-being over the consequences.`);
 				}
diff --git a/src/endWeek/servantsQuartersReport.js b/src/endWeek/servantsQuartersReport.js
index e2358d84f88..8d4355f1dbf 100644
--- a/src/endWeek/servantsQuartersReport.js
+++ b/src/endWeek/servantsQuartersReport.js
@@ -45,7 +45,6 @@ App.EndWeek.servantsQuartersReport = function() {
 			if (S.Stewardess.rules.living !== "luxurious") {
 				S.Stewardess.rules.living = "luxurious";
 			}
-			V.Stewardess = S.Stewardess; // FIXME: #1717 Stewardess subtask
 
 			const {He, he, His, his, him, wife} = getPronouns(S.Stewardess);
 			r.push(`${SlaveFullName(S.Stewardess)} is serving as your Stewardess.`);
@@ -238,7 +237,6 @@ App.EndWeek.servantsQuartersReport = function() {
 		} else {
 			standardSlaveReport(slave, true);
 		}
-		V.Stewardess = S.Stewardess; // FIXME: #1717 Stewardess subtask
 	}
 
 	V.servantMilkersMultiplier = 0.5;
@@ -318,7 +316,7 @@ App.EndWeek.servantsQuartersReport = function() {
 				$(slaveEntry).append(`is working out of ${V.servantsQuartersName}.`);
 			}
 			const servantContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
-			$(servantContent).append(`${He} ${App.SlaveAssignment.servant(slave)}`);
+			$(servantContent).append(`${He} ${App.SlaveAssignment.servant(slave, stewardessBonus)}`);
 			if ((V.servantMilkers === 1) && (slave.lactation > 0)) {
 				const milkContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
 				$(milkContent).append(`${He} ${App.SlaveAssignment.getMilked(slave)}`);
@@ -328,7 +326,7 @@ App.EndWeek.servantsQuartersReport = function() {
 			$(slaveEntry).append(standardSlaveReport(slave, false));
 		} else {
 			// discard return values silently
-			App.SlaveAssignment.servant(slave);
+			App.SlaveAssignment.servant(slave, stewardessBonus);
 			if ((V.servantMilkers === 1) && (slave.lactation > 0)) {
 				App.SlaveAssignment.getMilked(slave);
 				SQMilk += V.milk;
diff --git a/src/endWeek/slaveAssignmentReport.js b/src/endWeek/slaveAssignmentReport.js
index 64bfb6ffd7c..de174c7a7da 100644
--- a/src/endWeek/slaveAssignmentReport.js
+++ b/src/endWeek/slaveAssignmentReport.js
@@ -561,30 +561,29 @@ App.EndWeek.slaveAssignmentReport = function() {
 				}
 				break;
 			case Job.STEWARD:
-				V.Stewardess = slave;
 				if (!canTalk(slave)) {
 					_printSlaveUnassignedNote(slave, "can't give servants verbal orders");
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (slave.preg > 37 && slave.broodmother === 2) {
 					_printSlaveUnassignedNote(slave, "spends so much time giving birth and laboring that", `${getPronouns(slave).he} cannot effectively serve as your Stewardess any longer`);
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (slave.fetish === "mindbroken") {
 					_printSlaveUnassignedNote(slave, "is mindbroken");
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (!canWalk(slave)) {
 					_printSlaveUnassignedNote(slave, "is no longer independently mobile");
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (!canHold(slave)) {
 					_printSlaveUnassignedNote(slave, `can no longer handle ${getPronouns(slave).his} underlings nor effectively clean`);
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (!canSee(slave)) {
 					_printSlaveUnassignedNote(slave, "can no longer see");
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				} else if (!canHear(slave)) {
 					_printSlaveUnassignedNote(slave, "can no longer hear");
-					V.Stewardess = 0;
+					V.StewardessID = 0;
 				}
-				if (V.Stewardess === 0) {
+				if (V.StewardessID === 0) {
 					removeJob(slave, Job.STEWARD);
 				}
 				break;
diff --git a/src/js/assayJS.js b/src/js/assayJS.js
index 0f5cdb5ce5f..e2082d7c3c4 100644
--- a/src/js/assayJS.js
+++ b/src/js/assayJS.js
@@ -78,7 +78,7 @@ globalThis.inferiorRaceP = function(slave) {
  */
 globalThis.isLeaderP = function(slave) {
 	/** @type {FC.SlaveStateOrZero[]} */
-	const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, S.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V.Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness];
+	const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, S.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V.Farmer, S.Stewardess, V.Schoolteacher, V.Wardeness];
 
 	return leaders.some(leader => leader && leader.ID && leader.ID === slave.ID);
 };
diff --git a/src/js/assignJS.js b/src/js/assignJS.js
index e40f3e6136f..a79213523ca 100644
--- a/src/js/assignJS.js
+++ b/src/js/assignJS.js
@@ -506,8 +506,8 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) {
 			V.Matron = 0;
 		} else if (V.Nurse !== 0 && slave.ID === V.Nurse.ID) {
 			V.Nurse = 0;
-		} else if (V.Stewardess !== 0 && slave.ID === V.Stewardess.ID) {
-			V.Stewardess = 0;
+		} else if (V.StewardessID === slave.ID) {
+			V.StewardessID = 0;
 		} else if (V.Wardeness !== 0 && slave.ID === V.Wardeness.ID) {
 			V.Wardeness = 0;
 		} else if (V.Concubine !== 0 && slave.ID === V.Concubine.ID) {
diff --git a/src/npc/descriptions/style/clothing.js b/src/npc/descriptions/style/clothing.js
index a909cb30896..13405c87e77 100644
--- a/src/npc/descriptions/style/clothing.js
+++ b/src/npc/descriptions/style/clothing.js
@@ -824,7 +824,7 @@ App.Desc.clothing = function(slave) {
 				r.push(`${His} uniform is pinned with the`);
 				if (slave.ID === V.Bodyguard.ID || slave.ID === V.HeadGirl.ID || slave.ID === V.Recruiter.ID || slave.ID === V.Concubine.ID) {
 					r.push(`golden whip and manacles insignia of a senior slave officer,`);
-				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.Stewardess.ID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
+				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.StewardessID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
 					r.push(`golden manacles insignia of a junior slave officer,`);
 				} else if ((slave.skill.combat > 0) && getLimbCount(slave, 105) > 0) {
 					r.push(`silver spear and manacles insignia of an augmented slave soldier,`);
@@ -846,7 +846,7 @@ App.Desc.clothing = function(slave) {
 				r.push(`${His} uniform is pinned with the`);
 				if (slave.ID === V.Bodyguard.ID || slave.ID === V.HeadGirl.ID || slave.ID === V.Recruiter.ID || slave.ID === V.Concubine.ID) {
 					r.push(`golden whip and manacles insignia of a senior slave officer,`);
-				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.Stewardess.ID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
+				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.StewardessID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
 					r.push(`golden manacles insignia of a junior slave officer,`);
 				} else if ((slave.skill.combat > 0) && getLimbCount(slave, 105)) {
 					r.push(`silver spear and manacles insignia of an augmented slave soldier,`);
@@ -868,7 +868,7 @@ App.Desc.clothing = function(slave) {
 				r.push(`${His} uniform is pinned with the`);
 				if ((slave.ID === V.Bodyguard.ID) || (slave.ID === V.HeadGirl.ID) || (slave.ID === V.Recruiter.ID) || (slave.ID === V.Concubine.ID)) {
 					r.push(`golden whip and manacles insignia of a senior slave officer,`);
-				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.Stewardess.ID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
+				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.StewardessID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
 					r.push(`golden manacles insignia of a junior slave officer,`);
 				} else if ((slave.skill.combat > 0) && getLimbCount(slave, 105)) {
 					r.push(`silver spear and manacles insignia of an augmented slave soldier,`);
@@ -890,7 +890,7 @@ App.Desc.clothing = function(slave) {
 				r.push(`${His} uniform is pinned with the`);
 				if ((slave.ID === V.Bodyguard.ID) || (slave.ID === V.HeadGirl.ID) || (slave.ID === V.Recruiter.ID) || (slave.ID === V.Concubine.ID)) {
 					r.push(`golden whip and manacles insignia of a senior slave officer,`);
-				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.Stewardess.ID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
+				} else if ((slave.ID === V.Madam.ID) || (slave.ID === V.Nurse.ID) || (slave.ID === V.AttendantID) || (slave.ID === V.Matron.ID) || (slave.ID === V.DJ.ID) || (slave.ID === V.Milkmaid.ID) || (slave.ID === V.Farmer.ID) || (slave.ID === V.StewardessID) || (slave.ID === V.Schoolteacher.ID) || (slave.ID === V.Wardeness.ID)) {
 					r.push(`golden manacles insignia of a junior slave officer,`);
 				} else if ((slave.skill.combat > 0) && getLimbCount(slave, 105)) {
 					r.push(`silver spear and manacles insignia of an augmented slave soldier,`);
diff --git a/src/pregmod/widgets/pregmodBirthWidgets.tw b/src/pregmod/widgets/pregmodBirthWidgets.tw
index 16eb04389ce..17602dd1738 100644
--- a/src/pregmod/widgets/pregmodBirthWidgets.tw
+++ b/src/pregmod/widgets/pregmodBirthWidgets.tw
@@ -381,11 +381,11 @@
 			<<if _birthScene > 50>>
 				While giving a slave oral service, $slaves[$i].slaveName's water breaks. $He disregards this development and continues working.
 				<<ClothingBirth>>
-				The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he draws <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child to $his breast until <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him to move $his useless pregnant ass.
+				The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he draws <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child to $his breast until <<if _S.Stewardess>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him to move $his useless pregnant ass.
 			<<else>>
 				While scrubbing the penthouse floor, $slaves[$i].slaveName's water breaks. $He turns to clean this new spill, disregarding what it means.
 				<<ClothingBirth>>
-				Instead of cleaning the fresh mess $he made, $he draws <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child to $his breast until <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him to move $his useless pregnant ass.
+				Instead of cleaning the fresh mess $he made, $he draws <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child to $his breast until <<if _S.Stewardess>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him to move $his useless pregnant ass.
 			<</if>>
 		<</if>>
 	<<else>>
@@ -396,11 +396,11 @@
 				While giving a slave oral service, $slaves[$i].slaveName's water breaks. $He desperately tries to pull away but they grab $his head and force $him back to their crotch.
 				<<set $humiliation = 1>>
 				<<ClothingBirth>>
-				The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. $He hurriedly tries to mop up the mess and collect <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child before <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>><</if>> shouts at $him for dragging $his pregnant ass.
+				The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. $He hurriedly tries to mop up the mess and collect <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child before <<if _S.Stewardess>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>><</if>> shouts at $him for dragging $his pregnant ass.
 			<<else>>
 				While scrubbing the penthouse floor, $slaves[$i].slaveName's water breaks. $He panics at the thought of not cleaning up $his spill but $his worsening contractions force $him to find a secluded place to give birth.
 				<<ClothingBirth>>
-				Collecting <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child, $he carefully exits $his hiding place before coming under the eye of <<if $Stewardess != 0>>the glaring $Stewardess.slaveName. $His child is promptly taken<<elseif $HeadGirl != 0>>the glaring $HeadGirl.slaveName. $His child is promptly taken <<else>>. $His child is promptly taken by other servants<</if>> following a lecture about priorities and time management given $his constant pregnancy and predictable birth cycle.
+				Collecting <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> child, $he carefully exits $his hiding place before coming under the eye of <<if _S.Stewardess>>the glaring _S.Stewardess.slaveName. $His child is promptly taken<<elseif $HeadGirl != 0>>the glaring $HeadGirl.slaveName. $His child is promptly taken <<else>>. $His child is promptly taken by other servants<</if>> following a lecture about priorities and time management given $his constant pregnancy and predictable birth cycle.
 			<</if>>
 		<</if>>
 	<</if>>
@@ -1490,18 +1490,18 @@
 		<<if random(0,1) == 1>>
 			While giving a slave oral service, $slaves[$i].slaveName's body begins to birth another of $his brood. $He disregards this development and continues working.
 			<<ClothingBirth>>
-			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he struggles to bring $his child to $his breast until <<if $Stewardess != 0>>$Stewardess.slaveName shouts at $him to move $his useless ass<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him to move $his useless ass<<else>>shouts at $him to move $his useless ass<</if>>.
+			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he struggles to bring $his child to $his breast until <<if _S.Stewardess>>_S.Stewardess.slaveName shouts at $him to move $his useless ass<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him to move $his useless ass<<else>>shouts at $him to move $his useless ass<</if>>.
 		<<else>>
 			While struggling to scrub the penthouse floor, $slaves[$i].slaveName's body begins to birth another of $his brood. $He carries on trying to clean as $he drags $his belly along the floor.
 			<<ClothingBirth>>
-			Instead of carrying on $his task, $he draws $his child to $his breast until <<if $Stewardess != 0>>$Stewardess.slaveName shouts at $him to move $his useless ass<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him to move $his useless ass<<else>>shouts at $him to move $his useless ass<</if>>.
+			Instead of carrying on $his task, $he draws $his child to $his breast until <<if _S.Stewardess>>_S.Stewardess.slaveName shouts at $him to move $his useless ass<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him to move $his useless ass<<else>>shouts at $him to move $his useless ass<</if>>.
 		<</if>>
 	<<else>>
 		<<if random(0,1) == 1>>
 			While giving a slave oral service, $slaves[$i].slaveName's body begins to birth another of $his brood. $He desperately tries to pull away but they grab $his head and force $him back to their crotch.
 			<<set $humiliation = 1>>
 			<<ClothingBirth>>
-			The slave gets off quite strongly to the show and shoves $him to the ground, leaving $him struggling to get up before <<if $Stewardess != 0>>$Stewardess.slaveName shouts at $him<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him <<else>>shouts at $him<</if>>.
+			The slave gets off quite strongly to the show and shoves $him to the ground, leaving $him struggling to get up before <<if _S.Stewardess>>_S.Stewardess.slaveName shouts at $him<<elseif $HeadGirl != 0>>$HeadGirl.slaveName shouts at $him <<else>>shouts at $him<</if>>.
 		<<else>>
 			While using $his bloated belly to scrub the penthouse floor, $slaves[$i].slaveName's body begins to birth another of $his brood. Since this isn't the first time this week this happened, $he readies $himself for the coming birth.
 			<<ClothingBirth>>
diff --git a/src/uncategorized/PETS.tw b/src/uncategorized/PETS.tw
index b36ce153d9b..b66d64bbf25 100644
--- a/src/uncategorized/PETS.tw
+++ b/src/uncategorized/PETS.tw
@@ -45,7 +45,7 @@
 	<<case "nurse molestation">>
 		<<set $activeSlave = $Nurse, $subSlave = $slaves.find(function(s) { return s.anus != 0 && s.assignment == "get treatment in the clinic"; })>>
 	<<case "stewardess beating">>
-		<<set $activeSlave = $Stewardess, $subSlave = $slaves.find(function(s) { return s.assignment == "work as a servant"; })>>
+		<<set $activeSlave = _S.Stewardess, $subSlave = $slaves.find(function(s) { return s.assignment == "work as a servant"; })>>
 	<<case "aggressive schoolteacher">>
 		<<set $activeSlave = $Schoolteacher, $subSlave = $slaves.find(function(s) { return s.assignment == "learn in the schoolroom"; })>>
 	<<case "abusive wardeness">>
diff --git a/src/uncategorized/randomNonindividualEvent.tw b/src/uncategorized/randomNonindividualEvent.tw
index 8293e062363..5d762d66439 100644
--- a/src/uncategorized/randomNonindividualEvent.tw
+++ b/src/uncategorized/randomNonindividualEvent.tw
@@ -415,7 +415,7 @@
 		<</if>>
 	<</if>>
 
-	<<if ($Stewardess != 0) && (_L.servantsQuarters > 0) && ($Stewardess.actualAge >= 35 || $AgePenalty == 0)>>
+	<<if (_S.Stewardess) && (_L.servantsQuarters > 0) && (_S.Stewardess.actualAge >= 35 || $AgePenalty == 0)>>
 		<<set $PETSevent.push("stewardess beating")>>
 	<</if>>
 
diff --git a/src/uncategorized/reNickname.tw b/src/uncategorized/reNickname.tw
index 01775d78605..dc47c42182a 100644
--- a/src/uncategorized/reNickname.tw
+++ b/src/uncategorized/reNickname.tw
@@ -140,7 +140,7 @@
 <<if ($activeSlave.ID == $Milkmaid.ID) && $activeSlave.dick > 5 && canPenetrate($activeSlave) && $cumSlaves > 3>>
 	<<set _qualifiedNicknames.push("Collectrix")>>
 <</if>>
-<<if ($activeSlave.ID == $Stewardess.ID)>>
+<<if ($activeSlave.ID == $StewardessID)>>
 	<<set _qualifiedNicknames.push("Stewardess")>>
 <</if>>
 <<if ($activeSlave.ID == $Schoolteacher.ID)>>
diff --git a/src/uncategorized/saRelationships.tw b/src/uncategorized/saRelationships.tw
index a6d00acccdd..e6968eeabed 100644
--- a/src/uncategorized/saRelationships.tw
+++ b/src/uncategorized/saRelationships.tw
@@ -141,7 +141,7 @@
 							<<set _SlaveI.devotion += 1>>
 						<</if>>
 					<</if>>
-				<<elseif (_SlaveJ.ID == $Stewardess.ID) && (_SlaveI.assignment == "work as a servant")>>
+				<<elseif (_SlaveJ.ID == $StewardessID) && (_SlaveI.assignment == "work as a servant")>>
 					<<if _SlaveJ.rules.relationship != "restrictive">>
 						_SlaveI.slaveName manages to ingratiate $himself with the Stewardess, _SlaveJ.slaveName. The two slaves have @@.lightgreen;struck up a friendship.@@
 						<<set _SlaveJ.relationship = 1, _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveI.relationship = 1, _SlaveI.relationshipTarget = _SlaveJ.ID>>
diff --git a/src/uncategorized/servantsQuarters.tw b/src/uncategorized/servantsQuarters.tw
index 1d14602cf0d..1c1d71e93e4 100644
--- a/src/uncategorized/servantsQuarters.tw
+++ b/src/uncategorized/servantsQuarters.tw
@@ -72,8 +72,8 @@
 		$servantsQuartersNameCaps are busy with hurrying slaves. One shift of servants is eating, cleaning the quarters, and bathing. The second is sleeping, and the third is out in the penthouse cleaning and serving.
 	<<elseif _DL > 0>>
 		A few slaves are working out of the servants' quarters. They must split their scant time between looking after their own needs and the superior needs of everyone else.
-	<<elseif $Stewardess != 0>>
-		$Stewardess.slaveName is alone, and seems rather bereft without anyone to order around.
+	<<elseif _S.Stewardess>>
+		_S.Stewardess.slaveName is alone, and seems rather bereft without anyone to order around.
 	<<else>>
 		None of your slaves are working out of the servants' quarters.
 		<div class="choices" style="font-style:normal">
@@ -124,10 +124,10 @@
 
 <p>
 	<<set _facility = App.Entity.facilities.servantsQuarters>>
-	<<if $Stewardess != 0>>
-		<<setLocalPronouns $Stewardess>>
+	<<if _S.Stewardess>>
+		<<setLocalPronouns _S.Stewardess>>
 		<<print App.UI.SlaveList.displayManager(_facility)>>
-		<<if canAchieveErection($Stewardess) && $Stewardess.pubertyXY == 1>>
+		<<if canAchieveErection(_S.Stewardess) && _S.Stewardess.pubertyXY == 1>>
 			<<if $stewardessImpregnates == 1>>
 				Keeping the maids pregnant is part of $his job.
 				<div class="choices">
diff --git a/src/uncategorized/stewardessSelect.tw b/src/uncategorized/stewardessSelect.tw
index 1c5c4f97b7c..dfac601f9c9 100644
--- a/src/uncategorized/stewardessSelect.tw
+++ b/src/uncategorized/stewardessSelect.tw
@@ -1,15 +1,14 @@
 :: Stewardess Select [nobr jump-to-safe jump-hidden jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Servants' Quarters", $encyclopedia = "Stewardess">>
-<<if ($Stewardess != 0)>>
-	<<set $Stewardess = getSlave($Stewardess.ID)>>
-	<<setLocalPronouns $Stewardess>>
-	<span class='slave-name'><<= SlaveFullName($Stewardess)>></span> is serving as your Stewardess.<br><br>$He will manage the Servants' Quarters.
+<<if (_S.Stewardess)>>
+	<<setLocalPronouns _S.Stewardess>>
+	<span class='slave-name'><<= SlaveFullName(_S.Stewardess)>></span> is serving as your Stewardess.<br><br>$He will manage the Servants' Quarters.
 <<else>>
 	You have not selected a Stewardess.
 <</if>>
 
 <br><br>''Appoint a Stewardess from your devoted slaves:''
-<br><br>[[None|Servants' Quarters][removeJob($Stewardess, "be the Stewardess")]]
+<br><br>[[None|Servants' Quarters][removeJob(_S.Stewardess, Job.STEWARD)]]
 <br><br>
 <<print App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.servantsQuarters, "Servants' Quarters")>>
diff --git a/src/utility/birthWidgets.tw b/src/utility/birthWidgets.tw
index e20b372baeb..c2567c6909d 100644
--- a/src/utility/birthWidgets.tw
+++ b/src/utility/birthWidgets.tw
@@ -861,22 +861,22 @@
 		<<if _birthScene > 50>>
 			While giving a slave oral service, $slaves[$i].slaveName's water breaks. $He disregards this development and continues working.
 			<<ClothingBirth>>
-			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he draws $his child<<if $slaves[$i].pregType > 1>>ren<</if>> to $his breast<<if $slaves[$i].pregType > 1>>s<</if>> until <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>>shouts at $him to move $his useless ass.
+			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. Instead, $he draws $his child<<if $slaves[$i].pregType > 1>>ren<</if>> to $his breast<<if $slaves[$i].pregType > 1>>s<</if>> until <<if _S.Stewardess>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>>shouts at $him to move $his useless ass.
 		<<else>>
 			While scrubbing the penthouse floor, $slaves[$i].slaveName's water breaks. $He turns to clean this new spill, disregarding what it means.
 			<<ClothingBirth>>
-			Instead of cleaning the fresh mess $he made, $he draws $his child<<if $slaves[$i].pregType > 1>>ren<</if>> to $his breast<<if $slaves[$i].pregType > 1>>s<</if>> until <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>>shouts at $him to move $his useless ass.
+			Instead of cleaning the fresh mess $he made, $he draws $his child<<if $slaves[$i].pregType > 1>>ren<</if>> to $his breast<<if $slaves[$i].pregType > 1>>s<</if>> until <<if _S.Stewardess>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>>shouts at $him to move $his useless ass.
 		<</if>>
 	<<else>>
 		<<if _birthScene > 50>>
 			While giving a slave oral service, $slaves[$i].slaveName's water breaks. $He desperately tries to pull away but they grab $his head and force $him back to their crotch.
 			<<set $humiliation = 1>>
 			<<ClothingBirth>>
-			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. $He hurriedly tries to mop up the mess and collect $his child<<if $slaves[$i].pregType > 1>>ren<</if>> before <<if $Stewardess != 0>>$Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him.
+			The slave gets off quite strongly to the show and shoves $him out of the way, leaving $him to clean up $his mess. $He hurriedly tries to mop up the mess and collect $his child<<if $slaves[$i].pregType > 1>>ren<</if>> before <<if _S.Stewardess != 0>>_S.Stewardess.slaveName<<elseif $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistant.name<</if>> shouts at $him.
 		<<else>>
 			While scrubbing the penthouse floor, $slaves[$i].slaveName's water breaks. $He panics at the thought of not cleaning up $his spill but $his worsening contractions force $him to find a secluded place to give birth.
 			<<ClothingBirth>>
-			Collecting $his child<<if $slaves[$i].pregType > 1>>ren<</if>>, $he exits $his hiding place before coming under the eye of <<if $Stewardess != 0>>the glaring $Stewardess.slaveName<<elseif $HeadGirl != 0>>the glaring $HeadGirl.slaveName<<else>>$assistant.name<</if>>. $His child<<if $slaves[$i].pregType > 1>>ren<</if>> are promptly taken by other servants following a lecture about priorities and time management.
+			Collecting $his child<<if $slaves[$i].pregType > 1>>ren<</if>>, $he exits $his hiding place before coming under the eye of <<if _S.Stewardess != 0>>the glaring _S.Stewardess.slaveName<<elseif $HeadGirl != 0>>the glaring $HeadGirl.slaveName<<else>>$assistant.name<</if>>. $His child<<if $slaves[$i].pregType > 1>>ren<</if>> are promptly taken by other servants following a lecture about priorities and time management.
 		<</if>>
 	<</if>>
 
-- 
GitLab