From bd930a3be97d9d36b7cde14e77e9ac4f474b688c Mon Sep 17 00:00:00 2001
From: svornost <11434-svornost@users.noreply.gitgud.io>
Date: Tue, 10 Dec 2019 12:10:27 -0800
Subject: [PATCH] Remove assignmentVisible from the slave object and add a
 helper function to determine whether a slave's current assignment should be
 visible

---
 slave variables documentation - Pregmod.txt   |  6 --
 .../DinnerParty/dinnerPartyPreparations.tw    |  2 +-
 src/endWeek/saRules_old.js                    | 12 +--
 src/facilities/nursery/nurseryWidgets.js      |  2 -
 .../penthouse/penthouseFramework.js           |  6 +-
 src/init/storyInit.tw                         |  1 -
 src/js/SlaveState.js                          |  2 -
 src/js/assignJS.js                            | 78 +++++++++++++------
 src/js/datatypeCleanupJS.js                   |  6 +-
 src/js/economyJS.js                           |  2 +-
 src/js/slaveListing.js                        |  2 +-
 src/npc/acquisition.tw                        |  2 +-
 src/npc/slaveStats.tw                         |  1 -
 src/player/js/enslavePlayer.js                |  1 -
 src/pregmod/newChildIntro.tw                  |  1 -
 src/pregmod/widgets/seBirthWidgets.tw         |  2 +-
 src/uncategorized/PESS.tw                     |  6 +-
 src/uncategorized/costsReport.tw              |  2 +-
 src/uncategorized/main.tw                     |  4 +-
 src/uncategorized/newSlaveIntro.tw            |  1 -
 src/uncategorized/nextWeek.tw                 |  2 +-
 src/uncategorized/pCoupAttempt.tw             |  3 -
 src/uncategorized/pCoupBetrayal.tw            |  1 -
 src/uncategorized/penthouseReport.tw          |  2 +-
 src/uncategorized/personalAttentionSelect.tw  |  2 +-
 src/uncategorized/placeInLine.tw              |  6 +-
 src/uncategorized/randomIndividualEvent.tw    |  2 +-
 src/uncategorized/reRelativeRecruiter.tw      |  2 -
 src/uncategorized/rieEligibilityCheck.tw      |  2 +-
 src/uncategorized/saDevotion.tw               | 12 +--
 src/uncategorized/saGuardsYou.tw              |  2 +-
 src/uncategorized/saLongTermEffects.tw        |  2 +-
 src/uncategorized/slaveAssignmentsReport.tw   |  2 +-
 src/uncategorized/slaveInteract.tw            |  4 +-
 src/utility/saRulesWidgets.tw                 | 12 +--
 35 files changed, 106 insertions(+), 89 deletions(-)

diff --git a/slave variables documentation - Pregmod.txt b/slave variables documentation - Pregmod.txt
index 30050c33160..e0382601747 100644
--- a/slave variables documentation - Pregmod.txt	
+++ b/slave variables documentation - Pregmod.txt	
@@ -901,12 +901,6 @@ slave's assignment
 		"guard you"
 		"recruit girls"
 
-assignmentVisible:
-
-shows assignment in descriptions
-0 - yes
-1 - no
-
 sentence:
 
 how many weeks a slave is sentenced to work a job
diff --git a/src/Mods/DinnerParty/dinnerPartyPreparations.tw b/src/Mods/DinnerParty/dinnerPartyPreparations.tw
index 9efe0608713..230af2a4411 100644
--- a/src/Mods/DinnerParty/dinnerPartyPreparations.tw
+++ b/src/Mods/DinnerParty/dinnerPartyPreparations.tw
@@ -30,7 +30,7 @@ Your assistant will take care of the invitations and all the arrangements; all y
 __Select Your Meat:__
 <br><br>
 <<= App.UI.SlaveList.slaveSelectionList(
-		s => s.assignmentVisible === 1 && s.fuckdoll === 0,
+		s => assignmentVisible(s) && s.fuckdoll === 0,
 		App.UI.SlaveList.SlaveInteract.stdInteract,
 		null,
 		(s, i) => {
diff --git a/src/endWeek/saRules_old.js b/src/endWeek/saRules_old.js
index 384ca2a3738..8d16716be1a 100644
--- a/src/endWeek/saRules_old.js
+++ b/src/endWeek/saRules_old.js
@@ -1006,7 +1006,7 @@
 					break;
 				case "humiliation":
 					r += `demand that other slaves let ${him} fuck them in public. `;
-					if (slave.assignmentVisible) {
+					if (assignmentVisible(slave)) {
 						if (!slave.rivalry) {
 							SlaveSort.IDs(V.RapeableIDs);
 							for (let dI = 0; dI < V.RapeableIDs.length; dI++) {
@@ -1015,7 +1015,7 @@
 									rival = slaves[j];
 
 								if (!rival.rivalry) {
-									if (rival.assignmentVisible || rival.assignment === slave.assignment) {
+									if (assignmentVisible(rival) || rival.assignment === slave.assignment) {
 										if (rival.devotion <= 20 && rival.trust < -20) {
 											r += `Craving a rush, ${he} repeatedly forces a reluctant <<= SlaveFullName($slaves[_j])>> to have sex with ${him} in public. $slaves[_j].slaveName resents this, and $slaves[$i].slaveName's ongoing sexual abuse <span class="lightsalmon">starts a rivalry</span> between them. `;
 											slave.rivalry = 1;
@@ -1070,7 +1070,7 @@
 					break;
 				case "sadist":
 					r += `force the most reluctant slaves to let ${him} fuck them. `;
-					if (slave.assignmentVisible) {
+					if (assignmentVisible(slave)) {
 						if (!slave.rivalry) {
 							SlaveSort.IDs(V.RapeableIDs);
 							for (let dI = 0; dI < V.RapeableIDs.length; dI++) {
@@ -1084,7 +1084,7 @@
 								} = getPronouns(rival).appendSuffix('2');
 
 								if (!rival.rivalry) {
-									if (rival.assignmentVisible || rival.assignment === slave.assignment) {
+									if (assignmentVisible(rival) || rival.assignment === slave.assignment) {
 										if (rival.devotion <= 50) {
 											if (rival.sexualFlaw !== "none") {
 												r += `${He} focuses on ${SlaveFullName(rival)}, who has a sexual flaw ${slave.slaveName} can exploit. ${He} sadistically`;
@@ -1162,7 +1162,7 @@
 					break;
 				case "dom":
 					r += `force other slaves to submit to ${him}. `;
-					if (slave.assignmentVisible) {
+					if (assignmentVisible(slave)) {
 						if (!slave.rivalry) {
 							SlaveSort.IDs(V.RapeableIDs);
 							for (let dI = 0; dI < V.RapeableIDs.length; dI++) {
@@ -1171,7 +1171,7 @@
 									rival = slaves[j];
 
 								if (!rival.rivalry) {
-									if (rival.assignmentVisible || rival.assignment === slave.assignment) {
+									if (assignmentVisible(rival) || rival.assignment === slave.assignment) {
 										if (rival.devotion <= 20 && rival.trust < -20) {
 											r += `${He} repeatedly rapes a reluctant <<= SlaveFullName($slaves[_j])>>; ${he} can't seem to keep ${his} hands off the poor slave, who can't avoid ${him}. Not surprisingly, $slaves[_j].slaveName resents this, and $slaves[$i].slaveName's ongoing sexual abuse <span class="lightsalmon">starts a rivalry</span> between them. `;
 											slave.rivalry = 1;
diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js
index 5dd5ff352ce..8b118d48505 100644
--- a/src/facilities/nursery/nurseryWidgets.js
+++ b/src/facilities/nursery/nurseryWidgets.js
@@ -16710,8 +16710,6 @@ App.Facilities.Nursery.ChildState = class ChildState {
 		 * TODO:
 		*/
 		this.assignment = "rest";
-		/** Shows assignment in descriptions */
-		this.assignmentVisible = 1;
 		/** How far along slave is with being trained (skills, flaws, quirks)
 		 * TODO:
 		*/
diff --git a/src/facilities/penthouse/penthouseFramework.js b/src/facilities/penthouse/penthouseFramework.js
index 25c49c1bb56..7b06d4880fd 100644
--- a/src/facilities/penthouse/penthouseFramework.js
+++ b/src/facilities/penthouse/penthouseFramework.js
@@ -201,7 +201,7 @@ App.Entity.Facilities.Penthouse = class extends App.Entity.Facilities.Facility {
 	 * @returns {boolean}
 	 */
 	isHosted(slave) {
-		return slave.assignmentVisible === 1;
+		return assignmentVisible(slave);
 	}
 
 	/**
@@ -209,7 +209,7 @@ App.Entity.Facilities.Penthouse = class extends App.Entity.Facilities.Facility {
 	 * @returns {App.Entity.SlaveState[]}
 	 */
 	employees() {
-		return State.variables.slaves.filter( s => s.assignmentVisible === 1);
+		return State.variables.slaves.filter( s => assignmentVisible(s));
 	}
 
 	/**
@@ -218,7 +218,7 @@ App.Entity.Facilities.Penthouse = class extends App.Entity.Facilities.Facility {
 	 */
 	employeesIndices() {
 		return State.variables.slaves.reduce(
-			(acc, cur, idx) => { if (cur.assignmentVisible === 1) { acc.push(idx); } return acc; }, []);
+			(acc, cur, idx) => { if (assignmentVisible(cur)) { acc.push(idx); } return acc; }, []);
 	}
 
 	_createJob() {
diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index dd729bd8ab4..0be51d02bdc 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -31,7 +31,6 @@ You should have received a copy of the GNU General Public License along with thi
 		<<if $slaves[_i].assignment == "be imported">>
 			<<set $slaves[_i].ID += _NGPOffset>>
 			<<set $slaves[_i].assignment = "rest">>
-			<<set $slaves[_i].assignmentVisible = 1>>
 			<<set $slaves[_i].weekAcquired = 0>>
 			<<set $slaves[_i].newGamePlus = 1>>
 			<<PMODinit $slaves[_i]>>
diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js
index 70977fae5f1..3f8b33fd5af 100644
--- a/src/js/SlaveState.js
+++ b/src/js/SlaveState.js
@@ -559,8 +559,6 @@ App.Entity.SlaveState = class SlaveState {
 		this.choosesOwnAssignment = 0;
 		/** slave's assignment */
 		this.assignment = "rest";
-		/** shows assignment in descriptions */
-		this.assignmentVisible = 1;
 		/** how many weeks a slave is sentenced to work a job */
 		this.sentence = 0;
 		/** how far along slave is with being trained (skills, flaws, quirks) */
diff --git a/src/js/assignJS.js b/src/js/assignJS.js
index c58a4b82045..6a7cfa5bf44 100644
--- a/src/js/assignJS.js
+++ b/src/js/assignJS.js
@@ -13,7 +13,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "be confined in the arcade":
 		case "arcade":
 			slave.assignment = "be confined in the arcade";
-			slave.assignmentVisible = 0;
 			V.ArcadeiIDs.push(slave.ID);
 			slave.clothes = "no clothing";
 			slave.shoes = "none";
@@ -24,7 +23,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "work in the brothel":
 		case "brothel":
 			slave.assignment = "work in the brothel";
-			slave.assignmentVisible = 0;
 			V.BrothiIDs.push(slave.ID);
 			switch (V.brothelDecoration) {
 				case "Degradationist":
@@ -40,7 +38,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "be confined in the cellblock":
 		case "cellblock":
 			slave.assignment = "be confined in the cellblock";
-			slave.assignmentVisible = 0;
 			V.CellBiIDs.push(slave.ID);
 			switch (V.cellblockDecoration) {
 				case "Paternalist":
@@ -55,7 +52,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "get treatment in the clinic":
 		case "clinic":
 			slave.assignment = "get treatment in the clinic";
-			slave.assignmentVisible = 0;
 			V.CliniciIDs.push(slave.ID);
 			switch (V.clinicDecoration) {
 				case "Repopulation Focus":
@@ -92,7 +88,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "serve in the club":
 		case "club":
 			slave.assignment = "serve in the club";
-			slave.assignmentVisible = 0;
 			V.ClubiIDs.push(slave.ID);
 			slave.rules.living = "normal";
 			break;
@@ -100,7 +95,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "work in the dairy":
 		case "dairy":
 			slave.assignment = "work in the dairy";
-			slave.assignmentVisible = 0;
 			V.DairyiIDs.push(slave.ID);
 			switch (V.dairyDecoration) {
 				case "Roman Revivalist":
@@ -124,7 +118,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "work as a farmhand":
 		case "farmyard":
 			slave.assignment = "work as a farmhand";
-			slave.assignmentVisible = 0;
 			V.FarmyardiIDs.push(slave.ID);
 			switch (V.farmyardDecoration) {
 				case "Aztec Revivalist":
@@ -151,7 +144,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "head girl suite":
 		case "hgsuite":
 			slave.assignment = "live with your Head Girl";
-			slave.assignmentVisible = 0;
 			V.HGSuiteiIDs.push(slave.ID);
 			slave.rules.living = "luxurious";
 			break;
@@ -160,7 +152,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "master suite":
 		case "mastersuite":
 			slave.assignment = "serve in the master suite";
-			slave.assignmentVisible = 0;
 			V.MastSiIDs.push(slave.ID);
 			if (V.masterSuiteUpgradeLuxury > 0) {
 				slave.rules.living = "luxurious";
@@ -172,7 +163,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "learn in the schoolroom":
 		case "schoolroom":
 			slave.assignment = "learn in the schoolroom";
-			slave.assignmentVisible = 0;
 			V.SchlRiIDs.push(slave.ID);
 			slave.rules.living = "normal";
 			break;
@@ -181,7 +171,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "servants' quarters":
 		case "servantsquarters":
 			slave.assignment = "work as a servant";
-			slave.assignmentVisible = 0;
 			V.ServQiIDs.push(slave.ID);
 			switch (V.servantsQuartersDecoration) {
 				case "Roman Revivalist":
@@ -226,7 +215,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "rest in the spa":
 		case "spa":
 			slave.assignment = "rest in the spa";
-			slave.assignmentVisible = 0;
 			V.SpaiIDs.push(slave.ID);
 			switch (V.spaDecoration) {
 				case "Chattel Religionist":
@@ -245,7 +233,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "work as a nanny":
 		case "nursery":
 			slave.assignment = "work as a nanny";
-			slave.assignmentVisible = 0;
 			V.NurseryiIDs.push(slave.ID);
 			slave.rules.living = "normal";
 			break;
@@ -261,13 +248,11 @@ window.assignJob = function assignJob(slave, job) {
 		case "be the stewardess":
 		case "be the wardeness":
 			slave.assignment = job;
-			slave.assignmentVisible = 0; /* non-visible leadership roles */
 			slave.rules.living = "luxurious";
 			break;
 
 		case "be your concubine":
 			slave.assignment = job;
-			slave.assignmentVisible = 0; /* non-visible leadership roles */
 			if (V.masterSuiteUpgradeLuxury > 0) {
 				slave.rules.living = "luxurious";
 			} else {
@@ -293,7 +278,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "be your agent":
 		case "live with your agent":
 			slave.assignment = job;
-			slave.assignmentVisible = 0;
 			slave.useRulesAssistant = 0; /* non-visible roles exempt from Rules Assistant */
 			WombCleanGenericReserve(slave, 'incubator', 9999);
 			WombCleanGenericReserve(slave, 'nursery', 9999);
@@ -306,15 +290,15 @@ window.assignJob = function assignJob(slave, job) {
 
 		case "choose her own job":
 			slave.assignment = job;
-			slave.choosesOwnAssignment = 1; /* removeJob already set assignmentVisible = 1 */
+			slave.choosesOwnAssignment = 1;
 			break;
 
 		default:
-			slave.assignment = job; /* removeJob already set assignmentVisible = 1 and choosesOwnAssignment = 0 */
+			slave.assignment = job; /* removeJob already set choosesOwnAssignment = 0 */
 			break;
 	}
 
-	if (slave.assignmentVisible === 0 && Array.isArray(V.personalAttention)) {
+	if (!assignmentVisible(slave) && Array.isArray(V.personalAttention)) {
 		if (V.personalAttention.deleteWith(s => s.ID === slave.ID).length > 0) {
 			if (V.personalAttention.length === 0) {
 				if (V.PC.career === "escort") {
@@ -513,7 +497,6 @@ window.removeJob = function removeJob(slave, assignment) {
 					const _lover = V.slaves.findIndex(s => haveRelationshipP(s, slave) && s.assignment === "live with your agent");
 					if (_lover !== -1) {
 						V.slaves[_lover].assignment = "rest";
-						V.slaves[_lover].assignmentVisible = 1;
 					}
 				}
 				break;
@@ -523,11 +506,10 @@ window.removeJob = function removeJob(slave, assignment) {
 				break;
 		}
 
-		if (slave.rules.living === "luxurious" && slave.assignmentVisible !== 1) {
+		if (slave.rules.living === "luxurious" && !assignmentVisible(slave)) {
 			slave.rules.living = "normal";
 		}
 
-		slave.assignmentVisible = 1;
 		slave.choosesOwnAssignment = 0;
 		slave.sentence = 0;
 	}
@@ -539,6 +521,58 @@ window.removeJob = function removeJob(slave, assignment) {
 	return r;
 };
 
+/**
+ * Indicate whether a slave's current assignment is shown in Main
+ * Often used as a proxy for "penthouse slave"
+ * @param {App.Entity.SlaveState} slave
+ * @return {boolean}
+ */
+window.assignmentVisible = function assignmentVisible(slave) {
+	switch (slave.assignment) {
+		/* normal out-of-penthouse jobs */
+		case "be confined in the arcade":
+		case "work in the brothel":
+		case "be confined in the cellblock":
+		case "get treatment in the clinic":
+		case "serve in the club":
+		case "work in the dairy":
+		case "work as a farmhand":
+		case "live with your Head Girl":
+		case "serve in the master suite":
+		case "learn in the schoolroom":
+		case "work as a servant":
+		case "rest in the spa":
+		case "work as a nanny":
+			return 0;
+
+		/* outside leadership jobs */
+		case "be the Attendant":
+		case "be the Matron":
+		case "be the DJ":
+		case "be the Madam":
+		case "be the Milkmaid":
+		case "be the Farmer":
+		case "be the Nurse":
+		case "be the Schoolteacher":
+		case "be the Stewardess":
+		case "be the Wardeness":
+		case "be your Concubine":
+			return 0;
+
+		/* agents are not in the arcology at all */
+		case "be your agent":
+		case "live with your agent":
+			return 0;
+
+		/* transition state */
+		case "choose her own job":
+			return 1; // show
+	}
+
+	/* all other jobs are shown in penthouse */
+	return 1;
+};
+
 window.resetJobIDArray = function resetJobIDArray() {
 	/* todo: expand to all assignments */
 	const slaves = State.variables.slaves;
diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js
index 6545021cee0..d94ae4e8eb1 100644
--- a/src/js/datatypeCleanupJS.js
+++ b/src/js/datatypeCleanupJS.js
@@ -21,6 +21,10 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() {
 		migrateBrand(slave);
 		migrateScars(slave);
 		App.Entity.Utils.migratePronouns(slave);
+
+		if (slave.hasOwnProperty("assignmentVisible")) {
+			delete slave.assignmentVisible;
+		}
 	}
 
 	/**
@@ -2165,7 +2169,7 @@ App.Entity.Utils.GenePoolRecordCleanup = (function() {
 			"weekAcquired", "HGExclude",
 			"daughters", "origin",
 			"canRecruit",
-			"choosesOwnAssignment", "assignment", "assignmentVisible",
+			"choosesOwnAssignment", "assignment",
 			"sentence", "training", "toyHole",
 			"indenture", "indentureRestrictions",
 			"minorInjury",
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index f4200b264b1..b8511cfc245 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -840,7 +840,7 @@ window.getSlaveCost = function(s) {
 			cost += drugsCost * 2;
 			break;
 	}
-	if (s.curatives > 0 && s.assignmentVisible === 1) {
+	if (s.curatives > 0 && assignmentVisible(s)) {
 		cost += drugsCost * s.curatives;
 	}
 	if (s.aphrodisiacs !== 0) {
diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js
index 98c4333ebc8..ca8b29aa9a9 100644
--- a/src/js/slaveListing.js
+++ b/src/js/slaveListing.js
@@ -617,7 +617,7 @@ App.UI.SlaveList.listSJFacilitySlaves = function(facility, facilityPassage, show
 		if (facility.hasFreeSpace) {
 			// slaves from other facilities can be transferred here
 			const transferableIndices = V.slaves.reduce((acc, slave, ind) => {
-				if (slave.assignmentVisible === 0 && !facility.isHosted(slave)) {
+				if (!assignmentVisible(slave) && !facility.isHosted(slave)) {
 					acc.push(ind);
 				}
 				return acc;
diff --git a/src/npc/acquisition.tw b/src/npc/acquisition.tw
index ec593ad42e2..729de669a66 100644
--- a/src/npc/acquisition.tw
+++ b/src/npc/acquisition.tw
@@ -807,7 +807,7 @@ The previous owner seems to have left in something of a hurry.
 	<<set $slaves[$i].oldDevotion = $slaves[$i].devotion>>
 	<<set $slaves[$i].oldTrust = $slaves[$i].trust>>
 	/* AVERAGE VALUES UPDATE */
-	<<if $slaves[$i].assignmentVisible == 1>>
+	<<if assignmentVisible($slaves[$i])>>
 		<<set $averageTrust += $slaves[$i].trust, $averageDevotion += $slaves[$i].devotion, _slavesContributing += 1>>
 	<<else>>
 		<<if $slaves[$i].assignment != "be confined in the cellblock">>
diff --git a/src/npc/slaveStats.tw b/src/npc/slaveStats.tw
index 4cf2b2e9497..697fa3a58dc 100644
--- a/src/npc/slaveStats.tw
+++ b/src/npc/slaveStats.tw
@@ -33,7 +33,6 @@ Training: $activeSlave.training
 
 <br>BreedingMark: $activeSlave.breedingMark
 <br>Assignment: $activeSlave.assignment,
-Visible: $activeSlave.assignmentVisible,
 choosesOwn: $activeSlave.choosesOwnAssignment
 
 <br>Title:
diff --git a/src/player/js/enslavePlayer.js b/src/player/js/enslavePlayer.js
index da512ca553f..2fba484bc00 100644
--- a/src/player/js/enslavePlayer.js
+++ b/src/player/js/enslavePlayer.js
@@ -72,7 +72,6 @@ window.convertPlayerToSlave = function(slave, badEnd = "boring") {
 	slave.canRecruit = 0;
 	slave.choosesOwnAssignment = 0;
 	slave.assignment = "rest";
-	slave.assignmentVisible = 1;
 	slave.sentence = 0;
 	slave.training = 0;
 	slave.toyHole = "all her holes";
diff --git a/src/pregmod/newChildIntro.tw b/src/pregmod/newChildIntro.tw
index f0259aa9e67..358a8498d2f 100644
--- a/src/pregmod/newChildIntro.tw
+++ b/src/pregmod/newChildIntro.tw
@@ -1124,7 +1124,6 @@ You slowly strip down, gauging $his reactions to your show, until you are fully
 	<<if ($arcade > $ArcadeiIDs.length) || ($arcadeUpgradeFuckdolls == 2)>>
 		<br><<link "Send $him straight to the Arcade">>
 		<<= assignJob($activeSlave, "be confined in the arcade")>>
-		<<set $activeSlave.assignmentVisible = 0>>
 		<<set $activeSlave.choosesOwnAssignment = 0>>
 		<<replace "#result">>
 			You order <<if $HeadGirl == 0>>another slave<<else>>$HeadGirl.slaveName<</if>> to get $activeSlave.slaveName set up in $arcadeName. The new slave does not know what $arcadeName is, not really, and $he doesn't know what being set up there means, either. $He'll be confined inside a small space, not too different from the tube $he was grown in. It's only when the restraints lock into place that $he'll understand $his doom. $His mouth will be forced open and presented at one wall of $arcadeName, and $his ass will protrude from its other side, $his holes available for public relief at both ends. $He'll probably refuse to believe the truth, until the first cockhead enters $his mouth<<if $activeSlave.vagina > -1>>, parts $his pussylips,<</if>> or presses against $his poor anus.
diff --git a/src/pregmod/widgets/seBirthWidgets.tw b/src/pregmod/widgets/seBirthWidgets.tw
index 550234fbcb9..c1c3b22db9f 100644
--- a/src/pregmod/widgets/seBirthWidgets.tw
+++ b/src/pregmod/widgets/seBirthWidgets.tw
@@ -1172,7 +1172,7 @@ All in all,
 	<<set $slaves[$i].pregSource = $slaves[$i].womb[0].fatherID>> /*in such case it's good chance that there is different father also.*/
 <<else>>
 	<<set _tmp = lastPregRule($slaves[$i], $defaultRules)>>
-	<<if ($slaves[$i].assignmentVisible == 0) && (_tmp != null)>>
+	<<if (!assignmentVisible($slaves[$i])) && (_tmp != null)>>
 		<<set $slaves[$i].preg = -1>>
 	<<else>>
 		<<set $slaves[$i].preg = 0>>
diff --git a/src/uncategorized/PESS.tw b/src/uncategorized/PESS.tw
index ec315f0b81a..185afec5379 100644
--- a/src/uncategorized/PESS.tw
+++ b/src/uncategorized/PESS.tw
@@ -599,7 +599,7 @@ $He sees you examining at $him, and looks back at you submissively, too tired to
 	<<set $slaves[$j].counter.oral += 1>>
 	<<set $oralTotal += 1>>
 	<<for $i = 0; $i < _SL; $i++>>
-		<<if $slaves[$i].assignmentVisible == 1>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<set $slaves[$i].devotion += 2>>
 		<</if>>
 	<</for>>
@@ -641,7 +641,7 @@ $He sees you examining at $him, and looks back at you submissively, too tired to
 	<</if>>
 	<<set $activeSlave.devotion += 5>>
 	<<for $i = 0; $i < _SL; $i++>>
-		<<if $slaves[$i].assignmentVisible == 1>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<set $slaves[$i].devotion += 2>>
 		<</if>>
 	<</for>>
@@ -653,7 +653,7 @@ $He sees you examining at $him, and looks back at you submissively, too tired to
 	You stand up, give $him a kiss, and sit down on the couch, pulling $him into your lap. $His <<if $activeSlave.butt > 8>>monstrous ass rests heavily on<<elseif $activeSlave.muscles > 30>>heavily muscled ass is hard against<<elseif $activeSlave.weight > 10>>plush bottom is soft against<<elseif $activeSlave.muscles > 10>>toned butt is firm against<<elseif $activeSlave.butt > 3>>healthy butt is soft against<<else>>cute bottom is firm against<</if>> your toned thighs. $He wiggles $himself against you briefly, as though to gently remind you $he's available without demanding anything, and then snuggles $his $activeSlave.skin face into your neck. You run a hand <<if $activeSlave.hLength == 0>>across $his bald head<<elseif $activeSlave.hLength < 10>>through $his short hair<<else>>through $his $activeSlave.hColor hair<</if>>, producing a shiver of pleasure as your fingers massage $his scalp. As you cuddle with your Head Girl, you praise $his hard work, and tell $him that the next generation of sex slaves in the Free Cities will owe a lot to $him. They'll learn from $his leadership, of course, but they'll also have $his genes. $He stiffens a little, and there's a slight moisture against your skin as tears begin to run down $his cheeks. $He cranes $his neck up and @@.hotpink;kisses you rapturously.@@ $He seems to have absorbed a bit of your vision for the future, and over the next couple of days $he takes special care to make sure the slaves in your penthouse @@.mediumaquamarine;know their place in the new world you're building.@@
 	<<set $activeSlave.devotion += 5>>
 	<<for $i = 0; $i < _SL; $i++>>
-		<<if $slaves[$i].assignmentVisible == 1>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<set $slaves[$i].trust += 2>>
 		<</if>>
 	<</for>>
diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw
index 27e5e66774f..6f1b0fdcab8 100644
--- a/src/uncategorized/costsReport.tw
+++ b/src/uncategorized/costsReport.tw
@@ -835,7 +835,7 @@ $researchLab.level > 0>>
 		@@.yellowgreen;<<print cashFormat(($drugsCost*2))>>@@
 		<<set _individualCosts += ($drugsCost*2)>>
 	<</switch>>
-	<<if $slaves[$i].curatives == 1 && $slaves[$i].assignmentVisible != 1>>
+	<<if $slaves[$i].curatives == 1 && !assignmentVisible($slaves[$i])>>
 	<<elseif $slaves[$i].curatives > 0>>
 		<br>&nbsp;&nbsp;&nbsp;&nbsp;<i>Health drugs:</i>
 		@@.yellowgreen;<<print cashFormat($drugsCost+($slaves[$i].curatives*$drugsCost))>>@@
diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw
index 481b4988cf4..b9fc571e147 100644
--- a/src/uncategorized/main.tw
+++ b/src/uncategorized/main.tw
@@ -60,7 +60,7 @@
 	<br><br>@@.red;Duplicate slave ID _i at indices
 	<<= _($slaves).map((s, idx) => ({ID: s.ID, idx: idx, name: s.slaveName, assignment: s.assignment})).filter(s => s.ID === _i).map(s => s.idx + ' - ' + s.name + ' (' + s.assignment + ')').join(', ')>>@@
 <</for>>
-<<set _visibleSlaves = $slaves.filter(s => s.assignmentVisible == 1 && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)),
+<<set _visibleSlaves = $slaves.filter(s => assignmentVisible(s) && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)),
 	$slavesVisible = _visibleSlaves.length,
 	$dormitoryPopulation = _visibleSlaves.filter(s => s.rules.living != "luxurious").length,
 	$roomsPopulation = $slavesVisible - $dormitoryPopulation - _visibleSlaves.filter(s => s.rules.living == "luxurious" && s.relationship >= 4).length * 0.5,
@@ -104,7 +104,7 @@ __''MAIN MENU''__&nbsp;&nbsp;&nbsp;&nbsp;//[[Summary Options]]//
 	<<else>>
 		| //<<link "Stop applying Rules Assistant at week end" "Main">><<set $rulesAssistantAuto = 0>><</link>>//
 	<</if>>
-	| //<<if DefaultRulesError()>>@@.yellow; WARNING: One or more rules' custom conditions has errors! @@<</if>><<link "Re-apply Rules Assistant now (this will only check slaves in the Penthouse)" "Main">><<for _i = 0;_i < _SL;_i++>><<if $slaves[_i].assignmentVisible == 1 && $slaves[_i].useRulesAssistant == 1>><<= DefaultRules($slaves[_i])>><</if>><</for>><</link>>//
+	| //<<if DefaultRulesError()>>@@.yellow; WARNING: One or more rules' custom conditions has errors! @@<</if>><<link "Re-apply Rules Assistant now (this will only check slaves in the Penthouse)" "Main">><<for _i = 0;_i < _SL;_i++>><<if assignmentVisible($slaves[_i]) && $slaves[_i].useRulesAssistant == 1>><<= DefaultRules($slaves[_i])>><</if>><</for>><</link>>//
 <</if>>
 
 <<print App.UI.SlaveList.penthousePage()>>
diff --git a/src/uncategorized/newSlaveIntro.tw b/src/uncategorized/newSlaveIntro.tw
index f70c859d19e..0454b9b18e3 100644
--- a/src/uncategorized/newSlaveIntro.tw
+++ b/src/uncategorized/newSlaveIntro.tw
@@ -2320,7 +2320,6 @@ The legalities completed, ''__@@.pink;<<= SlaveFullName($activeSlave)>>@@__'' <<
 	<<if ($arcade > $ArcadeiIDs.length) || ($arcadeUpgradeFuckdolls == 2)>>
 		| <<link "Send $him straight to the Arcade">>
 			<<set $activeSlave.assignment = "be confined in the arcade">>
-			<<set $activeSlave.assignmentVisible = 0>>
 			<<set $activeSlave.choosesOwnAssignment = 0>>
 			<<replace "#introResult">>
 				You order <<if $HeadGirl == 0>>another slave<<else>>$HeadGirl.slaveName<</if>> to get $activeSlave.slaveName set up in $arcadeName. The new slave does not know what $arcadeName is, not really, and $he doesn't know what being set up there means, either. $He'll be confined inside a small space, not too different from the indignities $he's suffered already. It's only when the restraints lock into place that $he'll understand $his doom. $His mouth will be forced open and presented at one wall of $arcadeName, and $his ass will protrude from its other side, $his holes available for public relief at both ends. $He'll probably refuse to believe the truth, until the first cockhead enters $his mouth<<if $activeSlave.vagina > -1>>, parts $his pussylips,<</if>> or presses against $his poor anus.
diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw
index 75b7a0a3049..6a68dae6b83 100644
--- a/src/uncategorized/nextWeek.tw
+++ b/src/uncategorized/nextWeek.tw
@@ -225,7 +225,7 @@
 		<</if>>
 	<</if>>
 	/* AVERAGE VALUES UPDATE */
-	<<if $slaves[_i].assignmentVisible == 1>>
+	<<if assignmentVisible($slaves[_i])>>
 		<<set $averageTrust += $slaves[_i].trust, $averageDevotion += $slaves[_i].devotion, _slavesContributing++>>
 	<<elseif ($slaves[_i].assignment != "be confined in the cellblock") && ($slaves[_i].assignment != "be confined in the arcade") && (($slaves[_i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)) && $slaves[_i].assignment != "labor in the production line">>
 		<<set $averageTrust += $slaves[_i].trust*0.5, $averageDevotion += $slaves[_i].devotion*0.5, _slavesContributing += 0.5>>
diff --git a/src/uncategorized/pCoupAttempt.tw b/src/uncategorized/pCoupAttempt.tw
index a6ef97a42c0..8bec16865b5 100644
--- a/src/uncategorized/pCoupAttempt.tw
+++ b/src/uncategorized/pCoupAttempt.tw
@@ -221,16 +221,13 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 	<<setLocalPronouns $traitor>>
 	<<if ["agent", "trapper"].includes($traitorType)>>
 		$traitor.slaveName returns to your service having completed the task assigned to $him.
-		<<set $traitor.assignmentVisible = 1>>
 		<<set $traitor.assignment = "rest">>
 	<<elseif $traitorType == "hostage">>
 		$traitor.slaveName wanders back to the penthouse, battered and bloody, but alive.
-		<<set $traitor.assignmentVisible = 1>>
 		<<set $traitor.assignment = "rest">>
 		<<set $traitor.health = random(-80,-60)>>
 	<<else>>
 		$traitor.slaveName was captured and has been returned to you.
-		<<set $traitor.assignmentVisible = 1>>
 		<<set $traitor.assignment = "stay confined">>
 		<<set $traitor.health = random(-80,-60)>>
 		<<set $traitor.origin = "$He was your slave, but you freed $him, which $he repaid by participating in a coup attempt against you. It failed, and $he is again your chattel.">>
diff --git a/src/uncategorized/pCoupBetrayal.tw b/src/uncategorized/pCoupBetrayal.tw
index 49f62cdab06..d73b9abaa5c 100644
--- a/src/uncategorized/pCoupBetrayal.tw
+++ b/src/uncategorized/pCoupBetrayal.tw
@@ -56,7 +56,6 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 <<setLocalPronouns $traitor>>
 When $traitor.slaveName finally manages to return to you, $he explains what happened. $He caught wind of the military contractors working in the area and succeeded in goading the Daughters of Liberty into attacking the supposed slaver troop. Once it became clear that the untrained ex-slaves and their saviors stood no chance against a coordinated force, they beat a hasty retreat for your arcology under the assumption that the codes you gave them would allow them a fortifiable position. But alas, they found nothing more than their demise.
 
-<<set $traitor.assignmentVisible = 1>>
 <<set $traitor.assignment = "rest">>
 <<if $familyTesting == 1>>
 	<<if $traitorStats.PCpregSource > 0 && $PC.preg > 0 && $PC.pregSource == 0>>
diff --git a/src/uncategorized/penthouseReport.tw b/src/uncategorized/penthouseReport.tw
index 1e73f8fb794..f6c9ac868b3 100644
--- a/src/uncategorized/penthouseReport.tw
+++ b/src/uncategorized/penthouseReport.tw
@@ -4,7 +4,7 @@
 <<set _SL = $slaves.length>>
 
 <<for $i = 0; $i < _SL; $i++>>
-	<<if $slaves[$i].assignmentVisible == 1>>
+	<<if assignmentVisible($slaves[$i])>>
 		<div>''__@@.pink;<<= SlaveFullName($slaves[$i])>>@@__''
 		<<if $slaves[$i].choosesOwnAssignment == 2>>
 			<<include "SA chooses own job">>
diff --git a/src/uncategorized/personalAttentionSelect.tw b/src/uncategorized/personalAttentionSelect.tw
index 94ac8c8af61..1fc20102c1b 100644
--- a/src/uncategorized/personalAttentionSelect.tw
+++ b/src/uncategorized/personalAttentionSelect.tw
@@ -344,6 +344,6 @@
 
 <br><br>__Select a slave to train:__ <<if $PC.skill.slaving >= 100>>//Your @@.springgreen;slaving experience@@ allows you to divide your attention between more than one slave each week, with slightly reduced efficiency//<</if>>
 <<= App.UI.SlaveList.slaveSelectionList(
-		s => s.assignmentVisible === 1 && s.fuckdoll === 0,
+		s => assignmentVisible(s) && s.fuckdoll === 0,
 		s => App.UI.DOM.link(SlaveFullName(s), (id) => {App.UI.selectSlaveForPersonalAttention(id); }, s.ID)
 	)>>
\ No newline at end of file
diff --git a/src/uncategorized/placeInLine.tw b/src/uncategorized/placeInLine.tw
index 99c31edbc45..ed792a20c50 100644
--- a/src/uncategorized/placeInLine.tw
+++ b/src/uncategorized/placeInLine.tw
@@ -6,13 +6,13 @@
 <<set _activeSlaveIndex = $slaveIndices[$activeSlave.ID]>>
 <<set _SL = $slaves.length>>
 
-<<if ($activeSlave.assignmentVisible == 1)>>
+<<if assignmentVisible($activeSlave)>>
 	<<for _pil = _activeSlaveIndex - 1; _pil != _activeSlaveIndex; _pil-->> /* loops backwards through the $slaves array */
 		<<if _pil < 0>>
 			<<set _pil = _SL>>
 			<<continue>>
 		<</if>>
-		<<if $slaves[_pil].assignmentVisible == 1>>
+		<<if assignmentVisible($slaves[_pil])>>
 			<<set $slavesInLine.push(_pil)>> /* index of the previous slave in line */
 			<<break>>
 		<</if>>
@@ -22,7 +22,7 @@
 			<<set _pil = -1>>
 			<<continue>>
 		<</if>>
-		<<if $slaves[_pil].assignmentVisible == 1>>
+		<<if assignmentVisible($slaves[_pil])>>
 			<<set $slavesInLine.push(_pil)>> /* index of the next slave in line */
 			<<break>>
 		<</if>>
diff --git a/src/uncategorized/randomIndividualEvent.tw b/src/uncategorized/randomIndividualEvent.tw
index e663baa3ff0..80bc6c194dc 100644
--- a/src/uncategorized/randomIndividualEvent.tw
+++ b/src/uncategorized/randomIndividualEvent.tw
@@ -85,7 +85,7 @@
 							<</if>>
 						<</if>>
 					<</if>>
-					<<if $slaves[$i].assignmentVisible == 1>>
+					<<if assignmentVisible($slaves[$i])>>
 						<<if $slaves[$i].rules.living == "luxurious">>
 							<<if $slaves[$i].devotion >= -20>>
 								<<if $slaves[$i].anus != 0>>
diff --git a/src/uncategorized/reRelativeRecruiter.tw b/src/uncategorized/reRelativeRecruiter.tw
index 239aa809df5..6d0a17b58a6 100644
--- a/src/uncategorized/reRelativeRecruiter.tw
+++ b/src/uncategorized/reRelativeRecruiter.tw
@@ -482,7 +482,6 @@
 <<set $activeSlave.custom.title = "">>
 <<set $activeSlave.custom.titleLisp = "">>
 <<set $activeSlave.assignment = "rest">>
-<<set $activeSlave.assignmentVisible = 1>>
 <<set $activeSlave.choosesOwnAssignment = 0>>
 <<set $activeSlave.fetishStrength = random(0,90)>>
 <<set $activeSlave.fetish = either("boobs", "buttslut", "cumslut", "humiliation", "none", "none", "none", "none", "none", "none", "pregnancy", "submissive")>>
@@ -1017,7 +1016,6 @@ You look up the _relationType. _He2 costs <<print cashFormat($slaveCost)>>, a ba
 <<set $activeSlave.clothes = "no clothing">>
 <<set $activeSlave.hormones = 0>>
 <<set $activeSlave.assignment = "rest">>
-<<set $activeSlave.assignmentVisible = 1>>
 <<set $activeSlave.choosesOwnAssignment = 0>>
 <<set $activeSlave.fetishStrength = random(0,90)>>
 <<set $activeSlave.fetish = either("boobs", "buttslut", "cumslut", "humiliation", "none", "none", "none", "none", "none", "none", "pregnancy", "submissive")>>
diff --git a/src/uncategorized/rieEligibilityCheck.tw b/src/uncategorized/rieEligibilityCheck.tw
index 3289e54276e..21e47a71f33 100644
--- a/src/uncategorized/rieEligibilityCheck.tw
+++ b/src/uncategorized/rieEligibilityCheck.tw
@@ -5,7 +5,7 @@
 <<set $eventSlave = 0, $eligibleSlaves = []>>
 
 <<for $i = 0; $i < $slaves.length; $i++>>
-	<<if $slaves[$i].assignmentVisible == 1 || $slaves[$i].assignment == "serve in the master suite" || $slaves[$i].assignment == "be your Concubine" || $slaves[$i].assignment == "work as a servant">>
+	<<if assignmentVisible($slaves[$i]) || $slaves[$i].assignment == "serve in the master suite" || $slaves[$i].assignment == "be your Concubine" || $slaves[$i].assignment == "work as a servant">>
 		<<if $slaves[$i].fuckdoll == 0>>
 			<<set $eligibleSlaves.push($slaves[$i].ID)>>
 		<</if>>
diff --git a/src/uncategorized/saDevotion.tw b/src/uncategorized/saDevotion.tw
index 7b302266d1b..161619709c0 100644
--- a/src/uncategorized/saDevotion.tw
+++ b/src/uncategorized/saDevotion.tw
@@ -497,7 +497,7 @@
 
 <</if>> /* CLOSES RETIREMENT */
 
-<<if $slaves[$i].assignmentVisible == 1>>
+<<if assignmentVisible($slaves[$i])>>
 	<<if $personalAttention == "sex">>
 		<<if $freeSexualEnergy > 0>>
 			<<if $freeSexualEnergy == 3>>
@@ -545,26 +545,26 @@
 		<<if $slaves[$i].devotion >= -20>>
 			<<if $slaves[$i].devotion <= 20>>
 				<<set _collectiveDevotionEffect = 1, $slaves[$i].devotion += 1>>
-				<<if $slaves[$i].assignmentVisible == 1>><<set $slaves[$i].devotion += 1>><</if>>
+				<<if assignmentVisible($slaves[$i])>><<set $slaves[$i].devotion += 1>><</if>>
 			<</if>>
 		<</if>>
 	<<elseif $enduringDevotion <= 0>>
 		<<if $slaves[$i].devotion <= 20>>
 			<<set _collectiveDevotionEffect = -1, $slaves[$i].devotion -= 1>>
-			<<if $slaves[$i].assignmentVisible == 1>><<set $slaves[$i].devotion -= 1>><</if>>
+			<<if assignmentVisible($slaves[$i])>><<set $slaves[$i].devotion -= 1>><</if>>
 		<</if>>
 	<</if>>
 	<<if $enduringTrust > 50>>
 		<<if $slaves[$i].trust >= -20>>
 			<<if $slaves[$i].trust <= 20>>
 				<<set _collectiveTrustEffect = 1, $slaves[$i].trust += 1>>
-				<<if $slaves[$i].assignmentVisible == 1>><<set $slaves[$i].trust += 1>><</if>>
+				<<if assignmentVisible($slaves[$i])>><<set $slaves[$i].trust += 1>><</if>>
 			<</if>>
 		<</if>>
 	<<elseif $enduringTrust <= 0>>
 		<<if $slaves[$i].trust <= 20>>
 			<<set _collectiveTrustEffect = -1, $slaves[$i].trust -= 1>>
-			<<if $slaves[$i].assignmentVisible == 1>><<set $slaves[$i].trust -= 1>><</if>>
+			<<if assignmentVisible($slaves[$i])>><<set $slaves[$i].trust -= 1>><</if>>
 		<</if>>
 	<</if>>
 	<<if _collectiveDevotionEffect == 1>>
@@ -592,7 +592,7 @@
 	<</if>>
 <</if>>
 
-<<if $slaves[$i].assignmentVisible == 1>>
+<<if assignmentVisible($slaves[$i])>>
 	<<if ($arcade != 0) || (($dairy != 0) && ($dairyRestraintsSetting >= 2))>>
 		<<if $slaves[$i].devotion <= 95>>
 			$He knows about <<if $arcade != 0>>$arcadeName<<if ($dairy != 0) && ($dairyRestraintsSetting >= 2)>> and $dairyName<</if>><<else>>$dairyName<</if>>, and @@.gold;fears@@ that you might send $him there.
diff --git a/src/uncategorized/saGuardsYou.tw b/src/uncategorized/saGuardsYou.tw
index 3a77c1b06ed..3bb46e6dde8 100644
--- a/src/uncategorized/saGuardsYou.tw
+++ b/src/uncategorized/saGuardsYou.tw
@@ -180,7 +180,7 @@ Being continually trusted with your life @@.hotpink;increases $his devotion to y
 
 <<if $bodyguardTrains == 1 && $slaves[$i].devotion > 95 && $slaves[$i].trust > 50 && $slaves[$i].skill.combat > 0 && $slaves[$i].intelligence+$slaves[$i].intelligenceImplant > 15>>
 	$He's confident in $his martial skills, but smart enough to know that $he isn't immortal, and devoted enough to worry about who will protect you should $he die.
-	<<set _successorCandidates = $slaves.filter( function(s) { return (s.assignmentVisible == 1 || s.assignment == "be your Concubine" || s.assignment == "be the Wardeness" || s.assignment == "be your Head Girl" || s.assignment == "work as a servant" || s.assignment == "serve in the master suite") && bodyguardSuccessorEligible(s); } )>>
+	<<set _successorCandidates = $slaves.filter( function(s) { return (assignmentVisible(s) || s.assignment == "be your Concubine" || s.assignment == "be the Wardeness" || s.assignment == "be your Head Girl" || s.assignment == "work as a servant" || s.assignment == "serve in the master suite") && bodyguardSuccessorEligible(s); } )>>
 	<<set _combatSkilled = _successorCandidates.filter( function(s) { return s.skill.combat > 0; })>>
 	<<if _combatSkilled.length < 2>>
 		<<unset $subSlave>>
diff --git a/src/uncategorized/saLongTermEffects.tw b/src/uncategorized/saLongTermEffects.tw
index c78a3366ce2..4efa182534b 100644
--- a/src/uncategorized/saLongTermEffects.tw
+++ b/src/uncategorized/saLongTermEffects.tw
@@ -114,7 +114,7 @@
 	<</if>>
 <</if>>
 
-<<if $slaves[$i].assignmentVisible == 1 && ($slaves[$i].assignment !== "live with your Head Girl" || $HGSuiteSurgery === 0)>> /* OPENS AUTOSURGERY, CLOTHES, AND ACCESSORIES */
+<<if assignmentVisible($slaves[$i]) && ($slaves[$i].assignment !== "live with your Head Girl" || $HGSuiteSurgery === 0)>> /* OPENS AUTOSURGERY, CLOTHES, AND ACCESSORIES */
 	<<if hasSurgeryRule($slaves[$i], $defaultRules) && $slaves[$i].useRulesAssistant == 1 && $slaves[$i].indentureRestrictions < 2 && $cash > 0>>
 		<<= rulesAutosurgery($slaves[$i])>>
 	<</if>>
diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw
index 999c467f355..613c679aa22 100644
--- a/src/uncategorized/slaveAssignmentsReport.tw
+++ b/src/uncategorized/slaveAssignmentsReport.tw
@@ -791,7 +791,7 @@ $sexDemandResult.topClass = Math.trunc(((_topClassSexDemandRef - _topClassSexDem
 	<<set _HGPossibleSlaves = [[], [], [], [], [], []]>>
 	<<for $i = 0; $i < _SL; $i++>>
 		<<set _Slave = $slaves[$i]>>
-		<<if _Slave.assignmentVisible == 0 || _Slave.fuckdoll == 1 || _Slave.ID == $Bodyguard.ID || _Slave.ID == $HeadGirl.ID || _Slave.fetish == "mindbroken">>
+		<<if !assignmentVisible(_Slave) || _Slave.fuckdoll == 1 || _Slave.ID == $Bodyguard.ID || _Slave.ID == $HeadGirl.ID || _Slave.fetish == "mindbroken">>
 			<<continue>>
 		<<elseif Array.isArray($personalAttention) && $personalAttention.findIndex(function(s) { return s.ID == _Slave.ID; }) != -1>>
 			<<continue>>
diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw
index 587b7fb41cc..fd4155235d3 100644
--- a/src/uncategorized/slaveInteract.tw
+++ b/src/uncategorized/slaveInteract.tw
@@ -8,7 +8,7 @@
 <<setLocalPronouns $activeSlave>>
 <<run Enunciate($activeSlave)>>
 
-<<if ($activeSlave.assignmentVisible == 0)>>
+<<if !assignmentVisible($activeSlave)>>
 	<<switch $activeSlave.assignment>>
 	<<case "work in the brothel" "be the Madam">>
 		<<set $returnTo = "Brothel">>
@@ -1508,7 +1508,7 @@ Hormones: <strong><span id="hormones">
 <<if $activeSlave.fuckdoll > 0>>
 	//Rules have little meaning for living sex toys//
 <<else>>
-	<<set _visibleSlaves = $slaves.filter(s => s.assignmentVisible == 1 && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)),
+	<<set _visibleSlaves = $slaves.filter(s => assignmentVisible(s) && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)),
 		$dormitoryPopulation = _visibleSlaves.filter(s => s.rules.living != "luxurious").length,
 		$roomsPopulation = $slavesVisible - $dormitoryPopulation - _visibleSlaves.filter(s => s.rules.living == "luxurious" && s.relationship >= 4).length * 0.5>>
 
diff --git a/src/utility/saRulesWidgets.tw b/src/utility/saRulesWidgets.tw
index 396500dbccc..5ee00e65d1b 100644
--- a/src/utility/saRulesWidgets.tw
+++ b/src/utility/saRulesWidgets.tw
@@ -437,13 +437,13 @@ and
 		<<set $slaves[$i].counter.oral += _fuckCount, $oralTotal += _fuckCount>>
 	<<elseif ($slaves[$i].fetish == "humiliation")>>
 		demand that other slaves let $him fuck them in public.
-		<<if $slaves[$i].assignmentVisible>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<if !$slaves[$i].rivalry>>
 				<<SlaveIDSort $RapeableIDs>>
 				<<for _dI = 0; _dI < $RapeableIDs.length; _dI++>>
 					<<set _j = $slaveIndices[$RapeableIDs[_dI]]>>
 					<<if !$slaves[_j].rivalry>>
-						<<if $slaves[_j].assignmentVisible || $slaves[_j].assignment == $slaves[$i].assignment>>
+						<<if assignmentVisible($slaves[_j]) || $slaves[_j].assignment == $slaves[$i].assignment>>
 							<<if $slaves[_j].devotion <= 20>>
 								<<if $slaves[_j].trust < -20>>
 									Craving a rush, $he repeatedly forces a reluctant <<= SlaveFullName($slaves[_j])>> to have sex with $him in public. $slaves[_j].slaveName resents this, and $slaves[$i].slaveName's ongoing sexual abuse @@.lightsalmon;starts a rivalry@@ between them.
@@ -490,14 +490,14 @@ and
 		<<set $slaves[$i].counter.mammary += _fuckCount, $mammaryTotal += _fuckCount>>
 	<<elseif ($slaves[$i].fetish == "sadist")>>
 		force the most reluctant slaves to let $him fuck them.
-		<<if $slaves[$i].assignmentVisible>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<if !$slaves[$i].rivalry>>
 				<<SlaveIDSort $RapeableIDs>>
 				<<for _dI = 0; _dI < $RapeableIDs.length; _dI++>>
 					<<set _j = $slaveIndices[$RapeableIDs[_dI]]>>
 					<<setLocalPronouns $slaves[_j] 2>>
 					<<if !$slaves[_j].rivalry>>
-						<<if $slaves[_j].assignmentVisible || $slaves[_j].assignment == $slaves[$i].assignment>>
+						<<if assignmentVisible($slaves[_j]) || $slaves[_j].assignment == $slaves[$i].assignment>>
 							<<if $slaves[_j].devotion <= 50>>
 								<<if $slaves[_j].sexualFlaw != "none">>
 									$He focuses on <<= SlaveFullName($slaves[_j])>>, who has a sexual flaw $slaves[$i].slaveName can exploit. $He sadistically
@@ -557,13 +557,13 @@ and
 		<<run SimpleSexAct.Slave($slaves[$i], 12)>>
 	<<elseif ($slaves[$i].fetish == "dom")>>
 		force other slaves to submit to $him.
-		<<if $slaves[$i].assignmentVisible>>
+		<<if assignmentVisible($slaves[$i])>>
 			<<if !$slaves[$i].rivalry>>
 				<<SlaveIDSort $RapeableIDs>>
 				<<for _dI = 0; _dI < $RapeableIDs.length; _dI++>>
 					<<set _j = $slaveIndices[$RapeableIDs[_dI]]>>
 					<<if !$slaves[_j].rivalry>>
-						<<if $slaves[_j].assignmentVisible || $slaves[_j].assignment == $slaves[$i].assignment>>
+						<<if assignmentVisible($slaves[_j]) || $slaves[_j].assignment == $slaves[$i].assignment>>
 							<<if $slaves[_j].devotion <= 20>>
 								<<if $slaves[_j].trust < -20>>
 									$He repeatedly rapes a reluctant <<= SlaveFullName($slaves[_j])>>; $he can't seem to keep $his hand<<if (hasBothArms($slaves[$i]) || !hasAnyArms($slaves[$i]))>>s<</if>><<if (!hasAnyArms($slaves[$i]))>> (so to speak)<</if>> off the poor slave, who can't avoid $him. Not surprisingly, $slaves[_j].slaveName resents this, and $slaves[$i].slaveName's ongoing sexual abuse @@.lightsalmon;starts a rivalry@@ between them.
-- 
GitLab