From b5e5abcaeca0ada88ea5326679b104a151560e97 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Tue, 27 Aug 2019 19:38:56 -0400
Subject: [PATCH] mastSuite

---
 src/init/storyInit.tw                         |  1 -
 src/js/DefaultRules.js                        |  2 +-
 src/js/assignJS.js                            |  2 -
 src/pregmod/seFCTVshows.tw                    | 10 ++---
 src/uncategorized/buildingWidgets.tw          |  2 +-
 src/uncategorized/costsBudget.tw              |  2 +-
 src/uncategorized/masterSuite.tw              | 40 +++++++++----------
 src/uncategorized/masterSuiteReport.tw        |  2 +-
 src/uncategorized/randomNonindividualEvent.tw |  2 +-
 src/uncategorized/saChoosesOwnJob.tw          | 18 ++++-----
 src/uncategorized/saRecruitGirls.tw           |  4 +-
 src/uncategorized/slaveAssignmentsReport.tw   |  2 +-
 src/uncategorized/storyCaption.tw             |  4 +-
 13 files changed, 44 insertions(+), 47 deletions(-)

diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 0d308d82d4e..f4f8bcbf001 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -601,7 +601,6 @@ You should have received a copy of the GNU General Public License along with thi
 <<set $cellblockName = "the Cellblock">>
 <<set $cellblockNameCaps = "The Cellblock">>
 <<set $cellblockWardenCumsInside = 1>>
-<<set $masterSuiteSlaves = 0>>
 <<set $masterSuiteDecoration = "standard">>
 <<set $masterSuiteUpgradeLuxury = 0>>
 <<set $masterSuiteUpgradePregnancy = 0>>				/* Is the upgrade active? */
diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js
index 1c63c978986..3cdb0a1514d 100644
--- a/src/js/DefaultRules.js
+++ b/src/js/DefaultRules.js
@@ -126,7 +126,7 @@ window.DefaultRules = (function() {
 				break;
 
 			case "serve in the master suite":
-				if ((V.masterSuiteSlaves < V.masterSuite && (slave.devotion > 20 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)))) {
+				if ((V.MastSiIDs.length < V.masterSuite && (slave.devotion > 20 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)))) {
 					break;
 				} else {
 					RAFacilityRemove(slave, rule); // before deleting rule.setAssignment
diff --git a/src/js/assignJS.js b/src/js/assignJS.js
index df85e3966b0..52199feee1d 100644
--- a/src/js/assignJS.js
+++ b/src/js/assignJS.js
@@ -163,7 +163,6 @@ window.assignJob = function assignJob(slave, job) {
 		case "mastersuite":
 			slave.assignment = "serve in the master suite";
 			slave.assignmentVisible = 0;
-			V.masterSuiteSlaves++;
 			V.MastSiIDs.push(slave.ID);
 			if (V.masterSuiteUpgradeLuxury > 0) {
 				slave.livingRules = "luxurious";
@@ -464,7 +463,6 @@ window.removeJob = function removeJob(slave, assignment) {
 			case "mastersuite":
 				slave.assignment = "please you";
 				V.MastSiIDs.delete(slave.ID);
-				V.masterSuiteSlaves--;
 				break;
 
 			case "live with your head girl":
diff --git a/src/pregmod/seFCTVshows.tw b/src/pregmod/seFCTVshows.tw
index 61d13ba7d9d..23df37e2cfd 100644
--- a/src/pregmod/seFCTVshows.tw
+++ b/src/pregmod/seFCTVshows.tw
@@ -224,18 +224,18 @@
 	<</if>>
 	to play <<if $showTwo < 12>>the newest episode of a<<else>>a repeat of the<</if>> popular competitive reality show<<if $showTwo > 0>>: Next Top Breeder.<<else>> where several female citizens are competing for something.<</if>> The intro sequence shows a succession of beautiful ladies either participating in a mixture of contrived competitions, or talking and going about their lives in a sorority-like setting. The montage is overlaid with a narrator's voice: "12 of Canadia Arcology's most attractive women are all competing for the privilege of having the arcology owner's children. Clint Miles has desirable genes, and these ladies are determined to prove their worth as gestators. And here in Canadia, there are no restrictions on fertility drugs for the winner, so the competition this season is fierce! <<if $showTwo < 12>>_rerun<<else>>$showTwo<</if>> lad<<if $showTwo > 0>>ies have<<else>>y has<</if>> already been sent packing, who will be Canadia's... Next Top Breeder!?" The title finally pops up, redundantly labeling the show as 'Next Top Breeder: Canadia'.
 	<br><br>
-	<<if $masterSuiteSlaves > 1 && $Concubine != 0>>
+	<<if $MastSiIDs.length > 1 && $Concubine != 0>>
 		<<setLocalPronouns $Concubine 2>>
 		You don't spend very much time actually watching the show; the randy opening, perverted competitions, and constant talk of creampies quickly has @@.pink;$Concubine.slaveName@@ eager for some attention from _his2 own arcology owner. Of course, the same could be said for the other eager slaves living in your bedroom, and the situation quickly devolves into a lust-filled orgy.
-	<<elseif $masterSuiteSlaves > 0 && $Concubine != 0>>
+	<<elseif $MastSiIDs.length > 0 && $Concubine != 0>>
 		<<setLocalPronouns $Concubine 2>>
 		You don't spend very much time actually watching the show; the randy opening, perverted competitions, and constant talk of creampies quickly has @@.pink;$Concubine.slaveName@@ eager for some attention from _his2 own arcology owner. Of course, the same could be said for the other eager slave living in your bedroom, and the situation quickly devolves into a lust-filled threesome.
-	<<elseif $masterSuiteSlaves == 0 && $Concubine != 0>>
+	<<elseif $MastSiIDs.length == 0 && $Concubine != 0>>
 		<<setLocalPronouns $Concubine 2>>
 		You don't spend very much time actually watching the show; the randy opening, perverted competitions, and constant talk of creampies quickly has @@.pink;$Concubine.slaveName@@ eager for some attention from _his2 own arcology owner. You've trained _him2 well, and _he2 knows exactly how to please you. You spend the rest of the evening doing something a lot more fun than watching reality TV.
-	<<elseif $masterSuiteSlaves > 1 && $Concubine == 0>>
+	<<elseif $MastSiIDs.length > 1 && $Concubine == 0>>
 		You don't spend very much time actually watching the show; the randy opening, perverted competitions, and constant talk of creampies quickly has the pleasure slaves in your bed eager for some attention from their own arcology owner. You spend the rest of the evening doing something a lot more fun than watching reality TV.
-	<<elseif $masterSuiteSlaves > 0>>
+	<<elseif $MastSiIDs.length > 0>>
 		You don't spend very much time actually watching the show; the randy opening, perverted competitions, and constant talk of creampies quickly has the pleasure slave in your bed eager for some attention from her own arcology owner. You spend the rest of the evening doing something a lot more fun than watching reality TV.
 	<</if>>
 <<case 2>>
diff --git a/src/uncategorized/buildingWidgets.tw b/src/uncategorized/buildingWidgets.tw
index ac60d2a4423..b1dc99d3d48 100644
--- a/src/uncategorized/buildingWidgets.tw
+++ b/src/uncategorized/buildingWidgets.tw
@@ -143,7 +143,7 @@ if(!Macro.has('sectorblock')) {
 			<<link "Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>> @@.cyan;[P]@@
 			<<if $masterSuite||$HGSuite||$dojo||$servantsQuarters||$spa||$nursery||$clinic||$schoolroom||$cellblock||$incubator||$researchLab.level > 0>>
 				<br>
-				<<if $masterSuite>> <<print MasterSuiteUIName()>> ($masterSuiteSlaves/$masterSuite<<if $Concubine>>, C<</if>>)<</if>>
+				<<if $masterSuite>> <<print MasterSuiteUIName()>> ($MastSiIDs.length/$masterSuite<<if $Concubine>>, C<</if>>)<</if>>
 				<<if $HGSuite>> <<print HeadGirlSuiteUIName()>> <<if $HeadGirl != 0>>(HG<<if $HGSuiteiIDs.length > 0>>, 1)<<else>>)<</if>><</if>><</if>>
 				<<if $dojo > 1>>[[Armory|BG Select]] <<if $Bodyguard != 0>>(BG)<</if>> <</if>>
 				<<if $servantsQuarters>> <<print ServantQuartersUIName()>> ($servantsQuartersSlaves/$servantsQuarters<<if $Stewardess>>, L<</if>>)<</if>>
diff --git a/src/uncategorized/costsBudget.tw b/src/uncategorized/costsBudget.tw
index 261ae393d62..62010c74a4f 100644
--- a/src/uncategorized/costsBudget.tw
+++ b/src/uncategorized/costsBudget.tw
@@ -159,7 +159,7 @@ for (var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 
 	<<print budgetLine("servantsQuarters", "<<if $servantsQuarters>>[[Servants' Quarters][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Servants' Quarters<</if>> ($servantsQuartersSlaves slaves)")>>
 
-	<<print budgetLine("masterSuite", "<<if $masterSuite>>[[Master Suite][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Master Suite<</if>> ($masterSuiteSlaves slaves)")>>
+	<<print budgetLine("masterSuite", "<<if $masterSuite>>[[Master Suite][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Master Suite<</if>> ($MastSiIDs.length slaves)")>>
 
 	<<print budgetLine("school", "<<if $schoolroom>>[[$schoolroomNameCaps|Schoolroom][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$schoolroomNameCaps<</if>> ($schoolroomSlaves slaves)")>>
 
diff --git a/src/uncategorized/masterSuite.tw b/src/uncategorized/masterSuite.tw
index fc3a1701ad7..b4269c5b4f4 100644
--- a/src/uncategorized/masterSuite.tw
+++ b/src/uncategorized/masterSuite.tw
@@ -3,7 +3,7 @@
 <<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Master Suite", $showEncyclopedia = 1, $encyclopedia = "Master Suite", _SL = $slaves.length>>
 
 <<SlaveIDSort $MastSiIDs>>
-<<set _DL = $MastSiIDs.length, $masterSuiteSlaves = _DL>>
+<<set _DL = $MastSiIDs.length>>
 
 <<if $masterSuiteName != "the Master Suite">>
 	<<set $masterSuiteNameCaps = $masterSuiteName.replace("the ", "The ")>>
@@ -18,7 +18,7 @@
 	<</if>>
 <</if>>
 
-<<if $masterSuiteSlaves > 0>>
+<<if $MastSiIDs.length > 0>>
 <<for _dI = 0; _dI < _DL; _dI++>>
 	<<set _i = $slaveIndices[$MastSiIDs[_dI]]>>
 	<<set _Slave = $slaves[_i]>>
@@ -45,13 +45,13 @@
 		<</if>>
 	<</if>>
 <</for>>
-	<<set $masterSuiteAverageEnergy = $masterSuiteAverageEnergy/$masterSuiteSlaves>>
-	<<set _masterSuiteAverageMilk = _masterSuiteAverageMilk/$masterSuiteSlaves>>
-	<<set _masterSuiteAverageCum = _masterSuiteAverageCum/$masterSuiteSlaves>>
-	<<set _masterSuiteAverageDick = _masterSuiteAverageDick/$masterSuiteSlaves>>
-	<<set _masterSuiteAveragePreg = _masterSuiteAveragePreg/$masterSuiteSlaves>>
-	<<set _masterSuiteAverageDom = _masterSuiteAverageDom/$masterSuiteSlaves>>
-	<<set _masterSuiteAverageSadism = _masterSuiteAverageSadism/$masterSuiteSlaves>>
+	<<set $masterSuiteAverageEnergy = $masterSuiteAverageEnergy/$MastSiIDs.length>>
+	<<set _masterSuiteAverageMilk = _masterSuiteAverageMilk/$MastSiIDs.length>>
+	<<set _masterSuiteAverageCum = _masterSuiteAverageCum/$MastSiIDs.length>>
+	<<set _masterSuiteAverageDick = _masterSuiteAverageDick/$MastSiIDs.length>>
+	<<set _masterSuiteAveragePreg = _masterSuiteAveragePreg/$MastSiIDs.length>>
+	<<set _masterSuiteAverageDom = _masterSuiteAverageDom/$MastSiIDs.length>>
+	<<set _masterSuiteAverageSadism = _masterSuiteAverageSadism/$MastSiIDs.length>>
 <</if>>
 
 <<set _Tmult1 = Math.trunc(10000*$upgradeMultiplierArcology)>>
@@ -120,7 +120,7 @@ $masterSuiteNameCaps is furnished
 <</switch>>
 
 It is full of luxuries of all kinds. The slaves here live free of want or worry, and have everything except their freedom. Their only duties are to please you and look after the suite and one another.
-<<if $masterSuiteSlaves > 2>>
+<<if $MastSiIDs.length > 2>>
 	It's busy with slaves, so many that they are able to rotate through keeping themselves perfect and ready for your pleasure. The slaves not on call at the moment are beautifying themselves, cleaning, or serving others.
 	<<if (_masterSuitePregnantSlaves > 2) && (_masterSuitePregnantSlavesMultiple < 2)>>
 	Many of the slaves are pregnant, and they walk around proudly displaying their bellies and the new slaves growing inside them.<br>
@@ -129,7 +129,7 @@ It is full of luxuries of all kinds. The slaves here live free of want or worry,
 	<<elseif (_masterSuitePregnantSlaves > 2) && (_masterSuitePregnantSlavesMultiple > 2)>>
 	Many of the slaves are pregnant with multiple children, and they walk around proudly displaying their distended bellies and the next generation of slaves growing within them.<br>
 	<</if>>
-<<elseif $masterSuiteSlaves > 0>>
+<<elseif $MastSiIDs.length > 0>>
 	It's sparsely populated, so that the few slaves here have to work hard and quickly to ensure that an assortment of sex slaves is perfect and ready for your pleasure at any given moment.
 <<else>>
 	None of your slaves are serving here.
@@ -200,7 +200,7 @@ $masterSuiteNameCaps is furnished
 <</switch>>
 
 The true focus of the suite is, however, the fuckpit. This stepped depression in the middle of the floor
-<<if $masterSuiteSlaves > 3>>
+<<if $MastSiIDs.length > 3>>
 	is filled by cushions and every slave in the suite who isn't sleeping, eating, or bathing.
 	<<if $masterSuiteAverageEnergy > 90>>
 		They're having energetic group sex; most of them are fucking and being fucked at the same time.
@@ -228,7 +228,7 @@ The true focus of the suite is, however, the fuckpit. This stepped depression in
 	<<elseif (_masterSuitePregnantSlaves > 2) && (_masterSuitePregnantSlavesMultiple > 2)>>
 		Many of the slaves are pregnant with multiple children, and more than one has her face buried in the cunt directly below a grossly swollen belly while she lovingly massages her own distended stomach.<br>
 	<</if>>
-<<elseif $masterSuiteSlaves > 0>>
+<<elseif $MastSiIDs.length > 0>>
 	has a few lonely-looking fucktoys in it, badly outnumbered by the cushions.
 <<else>>
 	is desolate and unpopulated.
@@ -298,7 +298,7 @@ $masterSuiteNameCaps is furnished
 	comfortably, as a fairly normal luxury suite. It is unusually large, to accommodate as large a stable of sex slaves as strikes your fancy.
 <</switch>>
 
-<<if $masterSuiteSlaves > 2>>
+<<if $MastSiIDs.length > 2>>
 	It's busy with slaves, so many that they are able to rotate through keeping themselves perfect and ready for your pleasure. The slaves not on call at the moment are beautifying themselves, cleaning, or serving others.
 	<<if (_masterSuitePregnantSlaves > 2) && (_masterSuitePregnantSlavesMultiple < 2)>>
 	Many of the slaves are pregnant, and they walk around proudly displaying their bellies and the new slaves growing inside them.<br>
@@ -307,7 +307,7 @@ $masterSuiteNameCaps is furnished
 	<<elseif (_masterSuitePregnantSlaves > 2) && (_masterSuitePregnantSlavesMultiple > 2)>>
 	Many of the slaves are pregnant with multiple children, and they walk around proudly displaying their distended bellies and the next generation of slaves growing within them.<br>
 	<</if>>
-<<elseif $masterSuiteSlaves > 0>>
+<<elseif $MastSiIDs.length > 0>>
 	It's sparsely populated, so that the few slaves here have to work hard and quickly to ensure that an assortment of sex slaves is perfect and ready for your pleasure at any given moment.
 <<else>>
 	None of your slaves are serving here.
@@ -317,21 +317,21 @@ $masterSuiteNameCaps is furnished
 
 <</if>>
 
-<br>$masterSuiteNameCaps has room for $masterSuite slaves to live comfortably<<if $masterSuiteUpgradeLuxury == 2>> in the moments when they're not in the fuckpit<<elseif $masterSuiteUpgradeLuxury == 1>> on its huge bed<</if>>. There <<if $masterSuiteSlaves == 1>>is<<else>>are<</if>> currently $masterSuiteSlaves slave<<if $masterSuiteSlaves != 1>>s<</if>> in $masterSuiteName.
+<br>$masterSuiteNameCaps has room for $masterSuite slaves to live comfortably<<if $masterSuiteUpgradeLuxury == 2>> in the moments when they're not in the fuckpit<<elseif $masterSuiteUpgradeLuxury == 1>> on its huge bed<</if>>. There <<if $MastSiIDs.length == 1>>is<<else>>are<</if>> currently $MastSiIDs.length slave<<if $MastSiIDs.length != 1>>s<</if>> in $masterSuiteName.
 <<set _Tmult0 = Math.trunc($masterSuite*1000*$upgradeMultiplierArcology)>>
 [[Expand the Master Suite|Master Suite][cashX(forceNeg(_Tmult0), "capEx"), $masterSuite += 2, $PC.engineering += .1]] //Costs <<print cashFormat(_Tmult0)>>//
-<<if $Concubine == 0 && $masterSuiteSlaves == 0>>
+<<if $Concubine == 0 && $MastSiIDs.length == 0>>
 	| [[Decommission the Master Suite|Main][$masterSuite = 0, $masterSuiteUpgradeLuxury = 0, $masterSuitePregnancySlaveLuxuries = 0, $masterSuiteDecoration = "standard", $masterSuitePregnancyFertilityDrugs = 0, $masterSuitePregnancyFertilitySupplements = 0, $masterSuiteUpgradePregnancy = 0, $masterSuiteHyperPregnancy = 0]]
 <</if>>
 
-<<if $masterSuiteSlaves > 0>>
+<<if $MastSiIDs.length > 0>>
 	<<if $Concubine != 0>><<set _X = 1>><<else>><<set _X = 0>><</if>>
-	<<set _NewPop = $masterSuiteSlaves+$dormitoryPopulation+_X>>
+	<<set _NewPop = $MastSiIDs.length+$dormitoryPopulation+_X>>
 	<<link "Remove all slaves" "Master Suite">>
 		<<if $Concubine != 0>>
 			<<= assignJob($Concubine, "rest")>>
 		<</if>>
-		<<for $masterSuiteSlaves > 0>>
+		<<for $MastSiIDs.length > 0>>
 			<<= assignJob($slaves[$slaveIndices[$MastSiIDs[0]]], "please you")>>
 		<</for>>
 	<</link>>
diff --git a/src/uncategorized/masterSuiteReport.tw b/src/uncategorized/masterSuiteReport.tw
index 6572a48ac01..bccf5f5b7c8 100644
--- a/src/uncategorized/masterSuiteReport.tw
+++ b/src/uncategorized/masterSuiteReport.tw
@@ -1,7 +1,7 @@
 :: Master Suite Report [nobr]
 
 <<SlaveIDSort $MastSiIDs>>
-<<set _DL = $MastSiIDs.length, $masterSuiteSlaves = _DL, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>>
+<<set _DL = $MastSiIDs.length, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>>
 <<if $Concubine != 0>>
 	<<set _FLs = $slaveIndices[$Concubine.ID]>>
 
diff --git a/src/uncategorized/randomNonindividualEvent.tw b/src/uncategorized/randomNonindividualEvent.tw
index b5591d97939..7b8d6bfdd0b 100644
--- a/src/uncategorized/randomNonindividualEvent.tw
+++ b/src/uncategorized/randomNonindividualEvent.tw
@@ -392,7 +392,7 @@
 	<<if $ArcadeiIDs.length > 3>>
 		<<set $events.push("RE busy arcade")>>
 	<</if>>
-	<<if $masterSuiteSlaves > 3>>
+	<<if $MastSiIDs.length > 3>>
 		<<if $Concubine != 0>>
 			<<set $events.push("RE busy master suite")>>
 		<</if>>
diff --git a/src/uncategorized/saChoosesOwnJob.tw b/src/uncategorized/saChoosesOwnJob.tw
index 9f0e380d6b2..2a0ce13cf9b 100644
--- a/src/uncategorized/saChoosesOwnJob.tw
+++ b/src/uncategorized/saChoosesOwnJob.tw
@@ -109,7 +109,7 @@
 			<<set $slaves[$i].sexAmount = 10>>
 		<<elseif ($slaves[$i].energy > 60)>>
 			<<set $slaves[$i].choosesOwnAssignmentText += " and $he thinks of little but sex with you,">>
-			<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+			<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " so $he heads straight to $masterSuiteName.">>
 				<<= assignJob($slaves[$i], "serve in the master suite")>>
 			<<else>>
@@ -128,7 +128,7 @@
 			<<set $slaves[$i].choosesOwnAssignmentText += " to make your penthouse as clean and homelike as possible.">>
 		<<else>>
 			<<set $slaves[$i].choosesOwnAssignmentText += " but unable to do much on $his own,">>
-			<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+			<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " so $he heads straight to $masterSuiteName to await your caress.">>
 				<<= assignJob($slaves[$i], "serve in the master suite")>>
 			<<else>>
@@ -150,7 +150,7 @@
 		<<if $slaves[$i].devotion > 50>>
 			<<if ($slaves[$i].energy > 60)>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " and $he thinks of little but sex with you,">>
-				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " so $he heads straight to $masterSuiteName.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -169,7 +169,7 @@
 				<<set $slaves[$i].choosesOwnAssignmentText += " to make your penthouse as clean and homelike as possible.">>
 			<<else>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " but unable to do much on $his own">>
-				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " so $he heads straight to $masterSuiteName to await your caress.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -192,7 +192,7 @@
 		<<else>>
 			<<if ($slaves[$i].energy > 60)>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " and $he thinks of little but sex,">>
-				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " so $he heads straight to $masterSuiteName.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -285,7 +285,7 @@
 					<<= assignJob($slaves[$i], "get milked")>>
 				<</if>>
 			<<elseif ($PC.dick == 1) && isFertile($slaves[$i])>>
-				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " decides to serve you in $masterSuiteName, hoping that you'll get $him pregnant.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -320,7 +320,7 @@
 						<</if>>
 						<<set $slaves[$i].sexAmount = 10>>
 					<</if>>
-				<<elseif $masterSuite > $masterSuiteSlaves && $universalRulesAssignsSelfFacility == 1>>
+				<<elseif $masterSuite > $MastSiIDs.length && $universalRulesAssignsSelfFacility == 1>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " heads straight to $masterSuiteName to share the intimacy of $his pregnant body with you.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -328,7 +328,7 @@
 					<<= assignJob($slaves[$i], "please you")>>
 				<</if>>
 			<<elseif ($slaves[$i].pregKnown == 1)>>
-				<<if $masterSuite > $masterSuiteSlaves && $universalRulesAssignsSelfFacility == 1>>
+				<<if $masterSuite > $MastSiIDs.length && $universalRulesAssignsSelfFacility == 1>>
 					<<set $slaves[$i].choosesOwnAssignmentText += " heads straight to $masterSuiteName so you may watch for the day that $he finally starts to show.">>
 					<<= assignJob($slaves[$i], "serve in the master suite")>>
 				<<else>>
@@ -399,7 +399,7 @@
 				<<= assignJob($slaves[$i], "whore")>>
 			<</if>>
 		<<elseif ($arcologies[0].FSEgyptianRevivalist > 0)>>
-				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $masterSuiteSlaves)>>
+				<<if ($universalRulesAssignsSelfFacility == 1) && ($masterSuite > $MastSiIDs.length)>>
 				<<set $slaves[$i].choosesOwnAssignmentText += " is a devoted slave, so $he immediately joins your harem.">>
 				<<= assignJob($slaves[$i], "serve in the master suite")>>
 			<<else>>
diff --git a/src/uncategorized/saRecruitGirls.tw b/src/uncategorized/saRecruitGirls.tw
index b3f11995746..502ef1ba4c7 100644
--- a/src/uncategorized/saRecruitGirls.tw
+++ b/src/uncategorized/saRecruitGirls.tw
@@ -674,7 +674,7 @@
 			<</if>>
 		<</if>>
 	<<elseif $arcologies[0].FSArabianRevivalist != "unset">>
-		<<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60 && $masterSuiteSlaves >= 3>>
+		<<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60 && $MastSiIDs.length >= 3>>
 			<<set _seed += 6, _FSmatch++, $arcologies[0].FSArabianRevivalist += 0.02*$FSSingleSlaveRep>>
 		<</if>>
 	<<elseif $arcologies[0].FSChineseRevivalist != "unset">>
@@ -1050,7 +1050,7 @@
 			<</if>>
 		<<elseif $arcologies[0].FSArabianRevivalist != "unset">>
 			<<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60>>
-				<<if $masterSuiteSlaves >= 3>>
+				<<if $MastSiIDs.length >= 3>>
 					An exposé that "pulls back the curtain" on your elaborate master bedroom goes viral after several harem slaves drag $him into <<if $masterSuiteUpgradeLuxury == 1>>four-way action with their <<= properMaster()>><<else>>a fuckpit daisy chain<</if>> and another takes over the filming.
 				<<else>>
 					$He makes a short video essay about your elaborate master suite, but the empty space unfilled by luscious slave bodies fails to impress.
diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw
index a0d01bcd815..18a6cd4a330 100644
--- a/src/uncategorized/slaveAssignmentsReport.tw
+++ b/src/uncategorized/slaveAssignmentsReport.tw
@@ -739,7 +739,7 @@ $NPCMarketShareLC = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSuppl
 	["Servants' Quarters Report", $servantsQuartersNameCaps, $servantsQuarters, $servantsQuartersSlaves, $Stewardess, "Stewardess"],
 	["Children Report", "Nursery Children", $nursery, $nurseryBabies, -1, -1],
 	["Incubator Report", $incubatorNameCaps, $incubator, $incubatorSlaves, -1, -1],
-	["Master Suite Report", $masterSuiteNameCaps, $masterSuite, $masterSuiteSlaves, $Concubine, "Concubine"],
+	["Master Suite Report", $masterSuiteNameCaps, $masterSuite, $MastSiIDs.length, $Concubine, "Concubine"],
 	["Penthouse Report", "The Penthouse", 1, $slavesVisible, -1, -1],
 	["Rules Assistant Report", "Rules Assistant", $rulesAssistantAuto, 1, -1, -1] /** should be last — may reassign slaves **/
 ]>>
diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw
index fe22cea4874..0d3cd1590db 100644
--- a/src/uncategorized/storyCaption.tw
+++ b/src/uncategorized/storyCaption.tw
@@ -625,9 +625,9 @@
 				<<if ($masterSuite)>>
 					<br> <<link "$masterSuiteNameCaps""Master Suite">><</link>>
 					<<if $abbreviateSidebar == 2>>
-						($masterSuiteSlaves/$masterSuite <<if $masterSuiteSlaves != 1>>fucktoys<<else>>fucktoy<</if>><<if $Concubine>>, Concubine<</if>>)
+						($MastSiIDs.length/$masterSuite <<if $MastSiIDs.length != 1>>fucktoys<<else>>fucktoy<</if>><<if $Concubine>>, Concubine<</if>>)
 					<<else>>
-						($masterSuiteSlaves/$masterSuite<<if $Concubine>>, C<</if>>)
+						($MastSiIDs.length/$masterSuite<<if $Concubine>>, C<</if>>)
 					<</if>>
 				<</if>>
 				<<if ($schoolroom)>>
-- 
GitLab