From 6c1f110544232267d60278e8ce74b915b043e843 Mon Sep 17 00:00:00 2001
From: Jones <Jones>
Date: Fri, 22 Nov 2019 12:40:07 +0100
Subject: [PATCH] more work

New systems completed and briefly tested
---
 src/endWeek/saWhore.js                      |  14 +-
 src/init/storyInit.tw                       |  17 +-
 src/js/datatypeCleanupJS.js                 |  19 +-
 src/js/economyJS.js                         |  50 +++--
 src/uncategorized/BackwardsCompatibility.tw |  35 ++--
 src/uncategorized/arcmgmt.tw                | 194 ++++++++++++++++++--
 src/uncategorized/endWeek.tw                |   2 +-
 src/uncategorized/manageArcology.tw         | 112 +++++++++--
 src/uncategorized/slaveAssignmentsReport.tw | 162 ++++++++--------
 9 files changed, 432 insertions(+), 173 deletions(-)

diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js
index 0dc511e0aa3..4f7bd716bcf 100644
--- a/src/endWeek/saWhore.js
+++ b/src/endWeek/saWhore.js
@@ -1258,15 +1258,15 @@ window.saWhore = (function saWhore() {
 	 * @param {App.Entity.SlaveState} slave
 	 */
 	function addCash(slave) {
-		let whoreScore = s.sexAmount * s.sexQuality; // The standard amount of money the whore is expected to make in a week
-		if (whoreScore > 9600 && s.skill.whore > 80) { // whoreScore threshold updated to reflect tier specific bonus/penalty
-			cash = whoreScore * V.whorePriceAdjustment[3]; // final price adjustment for supply and demand
-		} else if (whoreScore > 5250 && s.skill.whore > 50) {
-			cash = whoreScore * V.whorePriceAdjustment[2];
+		let whoreScore = slave.sexAmount * slave.sexQuality; // The standard amount of money the whore is expected to make in a week
+		if (whoreScore > 9600 && slave.skill.whore > 80) { // whoreScore threshold updated to reflect tier specific bonus/penalty
+			cash = Math.trunc(whoreScore * V.whorePriceAdjustment.topClass); // final price adjustment for supply and demand
+		} else if (whoreScore > 5250 && slave.skill.whore > 50) {
+			cash = Math.trunc(whoreScore * V.whorePriceAdjustment.upperClass);
 		} else if (whoreScore > 1800) {
-			cash = whoreScore * V.whorePriceAdjustment[1];
+			cash = Math.trunc(whoreScore * V.whorePriceAdjustment.middleClass);
 		} else {
-			cash = whoreScore * V.whorePriceAdjustment[0];
+			cash = Math.trunc(whoreScore * V.whorePriceAdjustment.lowerClass);
 		}
 		if (slave.assignment === "work in the brothel") {
 			cashX(cash, "whoreBrothel", slave);
diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 1c3bda72e96..726ad15e090 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -825,11 +825,7 @@ You should have received a copy of the GNU General Public License along with thi
 
 /* Slave sexual services and goods variables */
 <<set $publicFuckdolls = 0>>
-<<set $lowerClassSexDemand = 15600>>
-<<set $lowerClassSatisfied = 0>>
-<<set $middleClassSexDemand = 10780>>
-<<set $upperClassSexDemand = 8000>>
-<<set $topClassSexDemand = 8000>>
+<<set $classSatisfied = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0}>>
 <<set $arcadePrice = 2>>
 <<set $clubSlaveSexAmount = 0>>
 
@@ -1129,14 +1125,9 @@ You should have received a copy of the GNU General Public License along with thi
 <<set $deltaDemand = 0>>
 <<set $deltaSupply = 0>>
 <<set $NPCSexSupply = {lowerClass: 3000, middleClass: 3000, upperClass: 3000, topClass: 3000}>>
-<<set $sexSubsidiesLC = 0>>
-<<set $sexSubsidiesMC = 0>>
-<<set $sexSubsidiesUC = 0>>
-<<set $sexSubsidiesTC = 0>>
-<<set $sexSupplyBarriersLC = 0>>
-<<set $sexSupplyBarriersMC = 0>>
-<<set $sexSupplyBarriersUC = 0>>
-<<set $sexSupplyBarriersTC = 0>>
+<<set $NPCMarketShare = {lowerClass: 1000, middleClass: 1000, upperClass: 1000, topClass: 1000}>>
+<<set $sexSubsidies = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0}>>
+<<set $sexSupplyBarriers = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0}>>
 <<set $minimumSlaveCost = 2500>>
 <<set $facilityCost = 100>>
 <<set $enduringRep = 1000>>
diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js
index 5a0079a59db..b89cb9910b2 100644
--- a/src/js/datatypeCleanupJS.js
+++ b/src/js/datatypeCleanupJS.js
@@ -1644,9 +1644,22 @@ window.EconomyDatatypeCleanup = function EconomyDatatypeCleanup() {
 	V.elapsedSupplyTimer = Math.max(+V.elapsedSupplyTimer, 0) || 0;
 	V.deltaSupply = Math.clamp(+V.deltaSupply, -3000, 3000) || 0;
 	V.deltaDemand = Math.clamp(+V.deltaDemand, -3000, 3000) || 0;
-	V.NPCSexSupply.lowerClass = Math.max(+V.NPCSexSupply.lowerClass, 0) || 3000;
-	V.sexSubsidiesLC = Math.clamp(+V.sexSubsidiesLC, 0, 4) || 0;
-	V.sexSupplyBarriersLC = Math.clamp(+V.sexSupplyBarriersLC, 0, 4) || 0;
+	V.sexSubsidies.lowerClass = Math.clamp(+V.sexSubsidies.lowerClass, 0, 4) || 0;
+	V.sexSubsidies.middleClass = Math.clamp(+V.sexSubsidies.middleClass, 0, 4) || 0;
+	V.sexSubsidies.upperClass = Math.clamp(+V.sexSubsidies.upperClass, 0, 4) || 0;
+	V.sexSubsidies.topClass = Math.clamp(+V.sexSubsidies.topClass, 0, 4) || 0;
+	V.sexSupplyBarriers.lowerClass = Math.clamp(+V.sexSupplyBarriers.lowerClass, 0, 4) || 0;
+	V.sexSupplyBarriers.middleClass = Math.clamp(+V.sexSupplyBarriers.middleClass, 0, 4) || 0;
+	V.sexSupplyBarriers.upperClass = Math.clamp(+V.sexSupplyBarriers.upperClass, 0, 4) || 0;
+	V.sexSupplyBarriers.topClass = Math.clamp(+V.sexSupplyBarriers.topClass, 0, 4) || 0;
+	V.NPCSexSupply.lowerClass = Math.max(+V.NPCSexSupply.lowerClass, 0) || 0;
+	V.NPCSexSupply.middleClass = Math.max(+V.NPCSexSupply.middleClass, 0) || 0;
+	V.NPCSexSupply.upperClass = Math.max(+V.NPCSexSupply.upperClass, 0) || 0;
+	V.NPCSexSupply.topClass = Math.max(+V.NPCSexSupply.topClass, 0) || 0;
+	V.NPCMarketShare.lowerClass = Math.clamp(+V.NPCMarketShare.lowerClass, 0, 1000) || 0;
+	V.NPCMarketShare.middleClass = Math.clamp(+V.NPCMarketShare.middleClass, 0, 1000) || 0;
+	V.NPCMarketShare.upperClass = Math.clamp(+V.NPCMarketShare.upperClass, 0, 1000) || 0;
+	V.NPCMarketShare.topClass = Math.clamp(+V.NPCMarketShare.topClass, 0, 1000) || 0;
 	V.econWeatherDamage = Math.max(+V.econWeatherDamage, 0) || 0;
 	V.disasterResponse = Math.clamp(+V.disasterResponse, 0, 2) || 0;
 	V.antiWeatherFreeze = Math.clamp(+V.antiWeatherFreeze, 0, 2) || 0;
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index f1bab4aa9c5..47f93edc307 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -879,44 +879,49 @@ window.menialSlaveCost = function(q = 0) {
 };
 
 window.NPCSexSupply = function(LC, MC, UC, TC) {
-	const NPCSexSupply = {lowerClass: V.NPCSexSupply.lowerClass, middleClass: V.NPCSexSupply.middleClass, upperClass: V.NPCSexSupply.upperClass, topClass: V.NPCSexSupply.topClass};
+	const NPCSexSupply = {
+		lowerClass: V.NPCSexSupply.lowerClass,
+		middleClass: V.NPCSexSupply.middleClass,
+		upperClass: V.NPCSexSupply.upperClass,
+		topClass: V.NPCSexSupply.topClass
+	};
 
 	// Lower class calculations
-	LC += V.sexSubsidiesLC / 10 - V.sexSupplyBarriersLC / 20;
+	LC += V.sexSubsidies.lowerClass / 10 - V.sexSupplyBarriers.lowerClass / 20;
 	if (LC >= 0.5) {
-		NPCSexSupply.lowerClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((LC - 0.5) * (0.2 - V.sexSupplyBarriersLC / 25))), (50 * (1 - V.sexSupplyBarriersLC / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
+		NPCSexSupply.lowerClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((LC - 0.5) * (0.2 - V.sexSupplyBarriers.lowerClass / 25))), (50 * (1 - V.sexSupplyBarriers.lowerClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
 	} else if (LC < 0.5) {
-		if (NPCSexSupply.lowerClass > V.lowerClass * (3 - V.sexSupplyBarriersLC / 2)) { // Natural market share of competitors is at least 30%
+		if (NPCSexSupply.lowerClass > V.lowerClass * (3 - V.sexSupplyBarriers.lowerClass / 2)) { // Natural market share of competitors is at least 30%
 			NPCSexSupply.lowerClass -= Math.trunc(NPCSexSupply.lowerClass * ((0.5 - LC) / 5)); // Max reduction of 10% per week
 		}
 	}
 
 	// Middle class calculations
-	MC += V.sexSubsidiesMC / 10 - V.sexSupplyBarriersMC / 20;
+	MC += V.sexSubsidies.middleClass / 10 - V.sexSupplyBarriers.middleClass / 20;
 	if (MC >= 0.5) {
-		NPCSexSupply.middleClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((MC - 0.5) * (0.2 - V.sexSupplyBarriersMC / 25))), (50 * (1 - V.sexSupplyBarriersMC / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
+		NPCSexSupply.middleClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((MC - 0.5) * (0.2 - V.sexSupplyBarriers.middleClass / 25))), (50 * (1 - V.sexSupplyBarriers.middleClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
 	} else if (MC < 0.5) {
-		if (NPCSexSupply.middleClass > V.middleClass * (3 - V.sexSupplyBarriersMC / 2)) { // Natural market share of competitors is at least 30%
+		if (NPCSexSupply.middleClass > V.middleClass * (15 - V.sexSupplyBarriers.middleClass / 0.4)) { // Natural market share of competitors is at least 30%
 			NPCSexSupply.middleClass -= Math.trunc(NPCSexSupply.middleClass * ((0.5 - MC) / 5)); // Max reduction of 10% per week
 		}
 	}
 
 	// upper class calculations
-	UC += V.sexSubsidiesUC / 10 - V.sexSupplyBarriersUC / 20;
+	UC += V.sexSubsidies.upperClass / 10 - V.sexSupplyBarriers.upperClass / 20;
 	if (UC >= 0.5) {
-		NPCSexSupply.upperClass += Math.max(Math.trunc(NPCSexSupply.upperClass * ((UC - 0.5) * (0.2 - V.sexSupplyBarriersUC / 25))), (50 * (1 - V.sexSupplyBarriersUC / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
+		NPCSexSupply.upperClass += Math.max(Math.trunc(NPCSexSupply.upperClass * ((UC - 0.5) * (0.2 - V.sexSupplyBarriers.upperClass / 25))), (50 * (1 - V.sexSupplyBarriers.upperClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
 	} else if (UC < 0.5) {
-		if (NPCSexSupply.upperClass > V.upperClass * (3 - V.sexSupplyBarriersUC / 2)) { // Natural market share of competitors is at least 30%
+		if (NPCSexSupply.upperClass > V.upperClass * (120 - V.sexSupplyBarriers.upperClass / 0.05)) { // Natural market share of competitors is at least 30%
 			NPCSexSupply.upperClass -= Math.trunc(NPCSexSupply.upperClass * ((0.5 - UC) / 5)); // Max reduction of 10% per week
 		}
 	}
 
 	// top class calculations
-	TC += V.sexSubsidiesTC / 10 - V.sexSupplyBarriersTC / 20;
+	TC += V.sexSubsidies.topClass / 10 - V.sexSupplyBarriers.topClass / 20;
 	if (TC >= 0.5) {
-		NPCSexSupply.topClass += Math.max(Math.trunc(NPCSexSupply.topClass * ((TC - 0.5) * (0.2 - V.sexSupplyBarriersTC / 25))), (50 * (1 - V.sexSupplyBarriersTC / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
+		NPCSexSupply.topClass += Math.max(Math.trunc(NPCSexSupply.topClass * ((TC - 0.5) * (0.2 - V.sexSupplyBarriers.topClass / 25))), (50 * (1 - V.sexSupplyBarriers.topClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50
 	} else if (TC < 0.5) {
-		if (NPCSexSupply.topClass > V.topClass * (3 - V.sexSupplyBarriersTC / 2)) { // Natural market share of competitors is at least 30%
+		if (NPCSexSupply.topClass > V.topClass * (1200 - V.sexSupplyBarriers.topClass / 0.005)) { // Natural market share of competitors is at least 30%
 			NPCSexSupply.topClass -= Math.trunc(NPCSexSupply.topClass * ((0.5 - TC) / 5)); // Max reduction of 10% per week
 		}
 	}
@@ -930,7 +935,12 @@ window.slaveJobValues = function() {
 		arcade: 0,
 		club: 0,
 		clubSP: 0,
-		brothel: [0, 0, 0, 0] // A list of values for each tier of whore (low, middle, upper, top)
+		brothel: {
+			lowerClass: 0,
+			middleClass: 0,
+			upperClass: 0,
+			topClass: 0
+		} // A list of values for each tier of whore (low, middle, upper, top)
 	};
 	let clubSpots;
 	let brothelSpots;
@@ -1373,8 +1383,8 @@ window.slaveJobValues = function() {
 		if (s.sexualFlaw === "neglectful") {
 			beautyMultiplier += 0.1;
 		}
-		if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs") ||(slave.hears === -2)) {
-			if (!canHear(slave)) {
+		if ((s.hears === -1 && s.earwear !== "hearing aids") || (s.hears === 0 && s.earwear === "muffling ear plugs") ||(s.hears === -2)) {
+			if (!canHear(s)) {
 				beautyMultiplier -= 0.25;
 			} else {
 				beautyMultiplier -= 0.10;
@@ -1551,22 +1561,22 @@ window.slaveJobValues = function() {
 			whoreScore = Math.trunc(whoreScore * 1.2); //  20% bonus to score for being of the heighest tier
 			s.sexAmount = jsRandom(30, 40); // Bringing sex amount into the desired range
 			s.sexQuality = Math.trunc(whoreScore / s.sexAmount); // Adjusting the price to the correct sex amount
-			slaveJobValues.brothel[3] += whoreScore; // Registering the job value in the right slot
+			slaveJobValues.brothel.topClass += whoreScore; // Registering the job value in the right slot
 		} else if (whoreScore > 5000 && s.skill.whore > 50) {
 			whoreScore = Math.trunc(whoreScore * 1.05);
 			s.sexAmount = jsRandom(40, 55);
 			s.sexQuality = Math.trunc(whoreScore / s.sexAmount);
-			slaveJobValues.brothel[2] += whoreScore;
+			slaveJobValues.brothel.upperClass += whoreScore;
 		} else if (whoreScore > 2000) {
 			whoreScore = Math.trunc(whoreScore * 0.9);
 			s.sexAmount = jsRandom(55, 75);
 			s.sexQuality = Math.trunc(whoreScore / s.sexAmount);
-			slaveJobValues.brothel[1] += whoreScore;
+			slaveJobValues.brothel.middleClass += whoreScore;
 		} else {
 			whoreScore = Math.trunc(whoreScore * 0.75);
 			s.sexAmount = jsRandom(75, 100);
 			s.sexQuality = Math.trunc(whoreScore / s.sexAmount);
-			slaveJobValues.brothel[0] += whoreScore;
+			slaveJobValues.brothel.lowerClass += whoreScore;
 		}
 	}
 	// Saturation penalty for public servants. Even the most beautiful slaves lose some of their shine if they have too much competition.
diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw
index a7fdce1b387..5e8cdc951d2 100644
--- a/src/uncategorized/BackwardsCompatibility.tw
+++ b/src/uncategorized/BackwardsCompatibility.tw
@@ -536,12 +536,6 @@
 <<if ndef $PCWounded>>
 	<<set $PCWounded = 0>>
 <</if>>
-<<if ndef $NPCSexSupply>>
-	<<set $NPCSexSupply = {lowerClass: 3000}>>
-<</if>>
-<<if ndef $NPCSexSupply.lowerClass>>
-	<<set $NPCSexSupply.lowerClass = 3000>>
-<</if>>
 <<run PCDatatypeCleanup()>>
 <<run BCReserveInit()>>
 
@@ -2804,20 +2798,29 @@ Setting missing global variables:
 <<if ndef $publicFuckdolls>>
 	<<set $publicFuckdolls = 0>>
 <</if>>
-<<if ndef $lowerClassSexDemand>>
-	<<set $lowerClassSexDemand = 15600>>
+<<if def $lowerClassSexDemand>>
+	<<set $lowerClassSexDemand = null>>
+<</if>>
+<<if def $lowerClassSatisfied>>
+	<<set $classSatisfied.lowerClass = $lowerClassSatisfied,
+	$lowerClassSatisfied = null>>
+<</if>>
+<<if def $middleClassSexDemand>>
+	<<set $middleClassSexDemand = null>>
 <</if>>
-<<if ndef $lowerClassSatisfied>>
-	<<set $lowerClassSatisfied = 0>>
+<<if def $upperClassSexDemand>>
+	<<set $upperClassSexDemand = null>>
 <</if>>
-<<if ndef $middleClassSexDemand>>
-	<<set $middleClassSexDemand = 10780>>
+<<if def $topClassSexDemand>>
+	<<set $topClassSexDemand = null>>
 <</if>>
-<<if ndef $upperClassSexDemand>>
-	<<set $upperClassSexDemand = 8000>>
+<<if def $sexSubsidiesLC>>
+	<<set $sexSubsidies.lowerClass = $sexSubsidiesLC,
+	$sexSubsidiesLC = null>>
 <</if>>
-<<if ndef $topClassSexDemand>>
-	<<set $topClassSexDemand = 8000>>
+<<if def $sexSupplyBarriersLC>>
+	<<set $sexSupplyBarriers.lowerClass = $sexSupplyBarriersLC,
+	$sexSupplyBarriersLC = null>>
 <</if>>
 <<if ndef $arcadePrice>>
 	<<set $arcadePrice = 2>>
diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw
index 7d5299673ee..7b960b39f54 100644
--- a/src/uncategorized/arcmgmt.tw
+++ b/src/uncategorized/arcmgmt.tw
@@ -18,47 +18,176 @@
 		You are providing your citizens with an adequate amount of slaves to be used as sexual objects, as is expected in your degradationist society.<br>
 	<</if>>
 <</if>>
-<<if $lowerClassSexDemandResult == 1>>
+<<if $sexDemandResult.lowerClass == 1>>
 	Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology.
-	<<if $lowerClassSatisfied == 0>>
+	<<if $classSatisfied.lowerClass == 0>>
 		They trust you will take care of this issue as soon as you are settled in.<br>
 	<<else>>
 		It is @@.red;causing dissatisfaction@@ among your lower class.<br>
 	<</if>>
-<<elseif $lowerClassSexDemandResult == 2>>
+<<elseif $sexDemandResult.lowerClass == 2>>
 	Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology.
-	<<if $lowerClassSatisfied == 1>>
+	<<if $classSatisfied.lowerClass == 1>>
 		They see @@.green;you are on the right track@@ and anticipate further improvements.<br>
-	<<elseif $lowerClassSatisfied == 0>>
+	<<elseif $classSatisfied.lowerClass == 0>>
 		Their patience is being tested.<br>
 	<<else>>
 		It is @@.red;causing dissatisfaction@@ among your lower class.
 	<</if>>
-<<elseif $lowerClassSexDemandResult == 3>>
+<<elseif $sexDemandResult.lowerClass == 3>>
 	Your lower class citizens have no issue finding the sexual relief they need inside your arcology.
-	<<if $lowerClassSatisfied == 1>>
+	<<if $classSatisfied.lowerClass == 1>>
 		They are @@.green;delighted@@ with how quickly you've provided for them.<br>
 	<<else>>
 		<br>
 	<</if>>
-<<elseif $lowerClassSexDemandResult == 4>>
+<<elseif $sexDemandResult.lowerClass == 4>>
 	Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br>
-<<elseif $lowerClassSexDemandResult == 5>>
+<<elseif $sexDemandResult.lowerClass == 5>>
 	Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br>
 <</if>>
-<<print $NPCMarketShareLC/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br>
+<<print $NPCMarketShare.lowerClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br>
 
-<<if $sexSupplyBarriersLC == 1>>
+<<if $sexSupplyBarriers.lowerClass == 1>>
 	<<run cashX(1000, "policies")>>
-<<elseif $sexSupplyBarriersLC == 2>>
+<<elseif $sexSupplyBarriers.lowerClass == 2>>
 	<<run cashX(5000, "policies")>>
-<<elseif $sexSupplyBarriersLC == 3>>
+<<elseif $sexSupplyBarriers.lowerClass == 3>>
 	<<run cashX(20000, "policies")>>
-<<elseif $sexSupplyBarriersLC == 4>>
+<<elseif $sexSupplyBarriers.lowerClass == 4>>
 	<<run cashX(60000, "policies")>>
 <</if>>
 <<if $sexSubsidiesLC > 0>>
-	<<run cashX($NPCSlaves.lowerClass * Math.pow($sexSubsidiesLC, 2) * 0.25, "policies")>>
+	<<run cashX($NPCSlaves.lowerClass * Math.pow($sexSubsidies.lowerClass, 2) * 0.25, "policies")>>
+<</if>>
+
+<<if $sexDemandResult.middleClass == 1>>
+	Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology.
+	<<if $classSatisfied.middleClass == 0>>
+		They trust you will take care of this issue as soon as you are settled in.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.<br>
+	<</if>>
+<<elseif $sexDemandResult.middleClass == 2>>
+	Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology.
+	<<if $classSatisfied.middleClass == 1>>
+		They see @@.green;you are on the right track@@ and anticipate further improvements.<br>
+	<<elseif $classSatisfied.middleClass == 0>>
+		Their patience is being tested.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.
+	<</if>>
+<<elseif $sexDemandResult.middleClass == 3>>
+	Your lower class citizens have no issue finding the sexual relief they need inside your arcology.
+	<<if $classSatisfied.middleClass == 1>>
+		They are @@.green;delighted@@ with how quickly you've provided for them.<br>
+	<<else>>
+		<br>
+	<</if>>
+<<elseif $sexDemandResult.middleClass == 4>>
+	Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br>
+<<elseif $sexDemandResult.middleClass == 5>>
+	Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br>
+<</if>>
+<<print $NPCMarketShare.middleClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br>
+
+<<if $sexSupplyBarriers.middleClass == 1>>
+	<<run cashX(1000, "policies")>>
+<<elseif $sexSupplyBarriers.middleClass == 2>>
+	<<run cashX(5000, "policies")>>
+<<elseif $sexSupplyBarriers.middleClass == 3>>
+	<<run cashX(20000, "policies")>>
+<<elseif $sexSupplyBarriers.middleClass == 4>>
+	<<run cashX(60000, "policies")>>
+<</if>>
+<<if $sexSubsidiesLC > 0>>
+	<<run cashX($NPCSlaves.middleClass * Math.pow($sexSubsidies.middleClass, 2) * 0.25, "policies")>>
+<</if>>
+
+<<if $sexDemandResult.upperClass == 1>>
+	Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology.
+	<<if $classSatisfied.upperClass == 0>>
+		They trust you will take care of this issue as soon as you are settled in.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.<br>
+	<</if>>
+<<elseif $sexDemandResult.upperClass == 2>>
+	Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology.
+	<<if $classSatisfied.upperClass == 1>>
+		They see @@.green;you are on the right track@@ and anticipate further improvements.<br>
+	<<elseif $classSatisfied.upperClass == 0>>
+		Their patience is being tested.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.
+	<</if>>
+<<elseif $sexDemandResult.upperClass == 3>>
+	Your lower class citizens have no issue finding the sexual relief they need inside your arcology.
+	<<if $classSatisfied.upperClass == 1>>
+		They are @@.green;delighted@@ with how quickly you've provided for them.<br>
+	<<else>>
+		<br>
+	<</if>>
+<<elseif $sexDemandResult.upperClass == 4>>
+	Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br>
+<<elseif $sexDemandResult.upperClass == 5>>
+	Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br>
+<</if>>
+<<print $NPCMarketShare.upperClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br>
+
+<<if $sexSupplyBarriers.upperClass == 1>>
+	<<run cashX(1000, "policies")>>
+<<elseif $sexSupplyBarriers.upperClass == 2>>
+	<<run cashX(5000, "policies")>>
+<<elseif $sexSupplyBarriers.upperClass == 3>>
+	<<run cashX(20000, "policies")>>
+<<elseif $sexSupplyBarriers.upperClass == 4>>
+	<<run cashX(60000, "policies")>>
+<</if>>
+<<if $sexSubsidiesLC > 0>>
+	<<run cashX($NPCSlaves.upperClass * Math.pow($sexSubsidies.upperClass, 2) * 0.25, "policies")>>
+<</if>>
+
+<<if $topClassSexDemandResult == 1>>
+	Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology.
+	<<if $topClassSatisfied == 0>>
+		They trust you will take care of this issue as soon as you are settled in.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.<br>
+	<</if>>
+<<elseif $topClassSexDemandResult == 2>>
+	Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology.
+	<<if $topClassSatisfied == 1>>
+		They see @@.green;you are on the right track@@ and anticipate further improvements.<br>
+	<<elseif $topClassSatisfied == 0>>
+		Their patience is being tested.<br>
+	<<else>>
+		It is @@.red;causing dissatisfaction@@ among your lower class.
+	<</if>>
+<<elseif $topClassSexDemandResult == 3>>
+	Your lower class citizens have no issue finding the sexual relief they need inside your arcology.
+	<<if $topClassSatisfied == 1>>
+		They are @@.green;delighted@@ with how quickly you've provided for them.<br>
+	<<else>>
+		<br>
+	<</if>>
+<<elseif $topClassSexDemandResult == 4>>
+	Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br>
+<<elseif $topClassSexDemandResult == 5>>
+	Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br>
+<</if>>
+<<print $NPCMarketShare.topClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br>
+
+<<if $sexSupplyBarriers.topClass == 1>>
+	<<run cashX(1000, "policies")>>
+<<elseif $sexSupplyBarriers.topClass == 2>>
+	<<run cashX(5000, "policies")>>
+<<elseif $sexSupplyBarriers.topClass == 3>>
+	<<run cashX(20000, "policies")>>
+<<elseif $sexSupplyBarriers.topClass == 4>>
+	<<run cashX(60000, "policies")>>
+<</if>>
+<<if $sexSubsidiesLC > 0>>
+	<<run cashX($NPCSlaves.topClass * Math.pow($sexSubsidies.topClass, 2) * 0.25, "policies")>>
 <</if>>
 
 <br>
@@ -962,8 +1091,8 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 /*Lower Class Citizens*/
 /*Work left for lower class citizens*/
 <<set _LCD = Math.trunc((($LSCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 4) + _lowerClass + (($middleClass + $visitors * 0.6) * 1.5) + (($upperClass + $visitors * 0.2) * 3.5) + ($topClass * 18) - ($NPCSlaves + $menials) * _slaveProductivity) * $rentEffectL * _lowerClassP)>>
-<<if $lowerClassSatisfied != 0>>
-	<<set _LCD *= 1 + $lowerClassSatisfied * 0.06>>
+<<if $classSatisfied.lowerClass != 0>>
+	<<set _LCD *= 1 + $classSatisfied.lowerClass * 0.06>>
 <</if>>
 <<if _LCD < 0>>
 	<<set _LCD = 0>>
@@ -972,9 +1101,9 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 	<br>@@.red;LCD is NaN, report this issue!@@
 <<else>>/*Changing population depending on work available*/
 	<br>
-	<<if $lowerClassSatisfied < 0>>
+	<<if $classSatisfied.lowerClass < 0>>
 		Your lower class is @@.red;sexually frustrated@@ and would rather live elsewhere.
-	<<elseif $lowerClassSatisfied > 0>>
+	<<elseif $classSatisfied.lowerClass > 0>>
 		Your lower class is @@.green;sexually satiated@@ and their happiness attracts others.
 	<</if>>
 	<<if $lowerClass < _LCD>>
@@ -1038,9 +1167,17 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 /*Middle Class Citizens*/
 /*Demand for Middle Class*/
 <<set _MCD = Math.trunc((($MCBase * ($localEcon / 100)) + $arcologies[0].prosperity + _middleClass + ($NPCSlaves * 0.15) + ($lowerClass * 0.1) + (($upperClass + $visitors * 0.2) * 0.5) + ($topClass * 2.5)) * $rentEffectM * _middleClassP)>>
+<<if $classSatisfied.middleClass != 0>>
+	<<set _MCD *= 1 + $classSatisfied.middleClass * 0.06>>
+<</if>>
 <<if isNaN(_MCD)>>
 	<br>@@.red;MCD is NaN, report this issue!@@
 <<else>> /*Middle Class Citizens immigrating*/
+	<<if $classSatisfied.middleClass < 0>>
+		Your middle class is @@.red;sexually frustrated@@ and would rather live elsewhere.
+	<<elseif $classSatisfied.middleClass > 0>>
+		Your middle class is @@.green;sexually satiated@@ and their happiness attracts others.
+	<</if>>
 	<<if $middleClass < _MCD>>
 		<<set _MCImmigration = Math.trunc((_MCD - $middleClass) * (0.3 * _terrain)) + 1,
 		$middleClass += _MCImmigration>>
@@ -1064,9 +1201,17 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 /*Upper Class Citizens*/
 /*Demand for Upper Class*/
 <<set _UCD = Math.trunc((($UCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 0.2) + _upperClass + ($NPCSlaves * 0.02) + ($lowerClass * 0.025) + (($middleClass + $visitors * 0.6) * 0.05) + ($topClass * 0.3)) * $rentEffectU * _upperClassP)>>
+<<if $classSatisfied.upperClass != 0>>
+	<<set _UCD *= 1 + $classSatisfied.upperClass * 0.06>>
+<</if>>
 <<if isNaN(_UCD)>>
 	<br>@@.red;UCD is NaN, report this issue!@@
 <<else>> /*Upper Class Citizens immigrating*/
+	<<if $classSatisfied.upperClass < 0>>
+		Your upper class is @@.red;sexually frustrated@@ and would rather live elsewhere.
+	<<elseif $classSatisfied.upperClass > 0>>
+		Your upper class is @@.green;sexually satiated@@ and their happiness attracts others.
+	<</if>>
 	<<if $upperClass < _UCD>>
 		<<set _UCImmigration = Math.trunc((_UCD - $upperClass) * (0.3 * _terrain)) + 1,
 		$upperClass += _UCImmigration>>
@@ -1094,8 +1239,14 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 <<if $eliteFailTimer > 0>> /*when you fail the eugenics Elite and they leave this triggers*/
 	<<set _TCD = Math.trunc(($GDP / 15 + _topClass) * $rentEffectT * _topClassP + $TCBase - ($eliteFail / 15 * $eliteFailTimer)),
 	$eliteFailTimer -= 1>>
+	<<if $classSatisfied.topClass != 0>>
+		<<set _TCD *= 1 + $classSatisfied.topClass * 0.06>>
+	<</if>>
 <<else>>
 	<<set _TCD = Math.trunc(($GDP / 15 + _topClass) * $rentEffectT * _topClassP + $TCBase)>>
+	<<if $classSatisfied.topClass != 0>>
+		<<set _TCD *= 1 + $classSatisfied.topClass * 0.06>>
+	<</if>>
 <</if>>
 <<if _TCD < 15>>
 	<<set _TCD = 15>>
@@ -1103,6 +1254,11 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav
 <<if isNaN(_TCD)>>
 	<br>@@.red;TCD is NaN, report this issue!@@
 <<else>> /*Top Class Citizens immigrating*/
+	<<if $classSatisfied.topClass < 0>>
+		Your millionaires are @@.red;sexually frustrated@@ and would rather live elsewhere.
+	<<elseif $classSatisfied.topClass > 0>>
+		Your millionaires are @@.green;sexually satiated@@ and their happiness attracts others.
+	<</if>>
 	<<if $topClass < _TCD>>
 		<<set _TCImmigration = Math.trunc((_TCD - $topClass) * (0.3 * _terrain)) + 1,
 		$topClass += _TCImmigration>>
diff --git a/src/uncategorized/endWeek.tw b/src/uncategorized/endWeek.tw
index 0f52a3cd9ec..92cdcf8e8a6 100644
--- a/src/uncategorized/endWeek.tw
+++ b/src/uncategorized/endWeek.tw
@@ -253,7 +253,7 @@
 	<<set $PC.pregWeek++>>
 <</if>>
 
-<<set $HGEnergy = 0, $HGCum = 0, $HGSlaveSuccess = 0, $HeadGirl = 0, $Recruiter = 0, $Madam = 0, $unMadam = 0, $madamCashBonus = 0, $DJ = 0, $unDJ = 0, $DJRepBonus = 0, $Milkmaid = 0, $Farmer = 0, $Collectrix = 0, $Stewardess = 0, $Schoolteacher = 0, $Wardeness = 0, $Concubine = 0, $Attendant = 0, $Matron = 0, $Nurse = 0, $Bodyguard = 0, $fuckSlaves = 0, $freeSexualEnergy = 0, $publicServants = 0, $cumSlaves = 0, $averageDick = 0, $slavesWithWorkingDicks = 0, $slaveJobValues = {}>>
+<<set $HGEnergy = 0, $HGCum = 0, $HGSlaveSuccess = 0, $HeadGirl = 0, $Recruiter = 0, $Madam = 0, $unMadam = 0, $madamCashBonus = 0, $whorePriceAdjustment = {}, $DJ = 0, $unDJ = 0, $DJRepBonus = 0, $Milkmaid = 0, $Farmer = 0, $Collectrix = 0, $Stewardess = 0, $Schoolteacher = 0, $Wardeness = 0, $Concubine = 0, $Attendant = 0, $Matron = 0, $Nurse = 0, $Bodyguard = 0, $fuckSlaves = 0, $freeSexualEnergy = 0, $publicServants = 0, $cumSlaves = 0, $averageDick = 0, $slavesWithWorkingDicks = 0, $slaveJobValues = {}>>
 
 /* GAMEOVERS */
 <<if $slaves.length < 1>>
diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw
index b6e2c24f28a..b34d8772898 100644
--- a/src/uncategorized/manageArcology.tw
+++ b/src/uncategorized/manageArcology.tw
@@ -174,28 +174,102 @@ __Construction__
 
 __Sexual Service Policies__<br>
 If so desired, your assistant can help you manipulate the business environment within your arcology.<br>
-Currently outside parties are providing <<print $NPCMarketShareLC/10>>% of the sexual services.<br>
-<<if $NPCSexSubsidiesLC == 0>>
-	You can provide a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 1]]<br>
-<<elseif $NPCSexSubsidiesLC == 1>>
-	You are providing a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 0]] | [[Moderate Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 2]]<br>
-<<elseif $NPCSexSubsidiesLC == 2>>
-	You are providing a moderate subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 1]] | [[Substantial Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 3]]<br>
-<<elseif $NPCSexSubsidiesLC == 3>>
-	You are providing a substantial subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 2]] | [[Gratuitous Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 4]]<br>
+Currently outside parties are providing <<print $NPCMarketShare.lowerClass/10>>%, <<print $NPCMarketShare.middleClass/10>>%, <<print $NPCMarketShare.upperClass/10>> and <<print $NPCMarketShare.topClass/10>>% of the sexual services for the lower, middle, upper and top class respectively.
+<br><br>
+
+<<if $sexSubsidies.lowerClass == 0>>
+	You can provide a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 1]]<br>
+<<elseif $sexSubsidies.lowerClass == 1>>
+	You are providing a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 0]] | [[Moderate Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 2]]<br>
+<<elseif $sexSubsidies.lowerClass == 2>>
+	You are providing a moderate subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 1]] | [[Substantial Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 3]]<br>
+<<elseif $sexSubsidies.lowerClass == 3>>
+	You are providing a substantial subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 2]] | [[Gratuitous Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 4]]<br>
+<<else>>
+	You are providing a gratuitous subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$sexSubsidies.lowerClass = 3]]<br>
+<</if>>
+<<if $sexSupplyBarriers.lowerClass == 0>>
+	You can make things more difficult for those supplying sexual services in the lower class segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.lowerClass == 1>>
+	You have forced some unneeded bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 0, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.lowerClass == 2>>
+	You have forced considerable bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 1, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.lowerClass == 3>>
+	You have forced stifling bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 2, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<else>>
+	You have forced suffocating bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.lowerClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<</if>>
+<br><br>
+
+<<if $sexSubsidies.middleClass == 0>>
+	You can provide a minor subsidy for those selling sexual services to the middle class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.middleClass = 1]]<br>
+<<elseif $sexSubsidies.middleClass == 1>>
+	You are providing a minor subsidy for those selling sexual services to the middle class. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$sexSubsidies.middleClass = 0]] | [[Moderate Subsidy|Manage Arcology][$sexSubsidies.middleClass = 2]]<br>
+<<elseif $sexSubsidies.middleClass == 2>>
+	You are providing a moderate subsidy for those selling sexual services to the middle class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.middleClass = 1]] | [[Substantial Subsidy|Manage Arcology][$sexSubsidies.middleClass = 3]]<br>
+<<elseif $sexSubsidies.middleClass == 3>>
+	You are providing a substantial subsidy for those selling sexual services to the middle class. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$sexSubsidies.middleClass = 2]] | [[Gratuitous Subsidy|Manage Arcology][$sexSubsidies.middleClass = 4]]<br>
+<<else>>
+	You are providing a gratuitous subsidy for those selling sexual services to the middle class. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$sexSubsidies.middleClass = 3]]<br>
+<</if>>
+<<if $sexSupplyBarriers.middleClass == 0>>
+	You can make things more difficult for those supplying sexual services in the middle class segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.middleClass == 1>>
+	You have forced some unneeded bureaucracy on those selling sexual services to the middle class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 0, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.middleClass == 2>>
+	You have forced considerable bureaucracy on those selling sexual services to the middle class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 1, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.middleClass == 3>>
+	You have forced stifling bureaucracy on those selling sexual services to the middle class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 2, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<else>>
+	You have forced suffocating bureaucracy on those selling sexual services to the middle class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.middleClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<</if>>
+<br><br>
+
+<<if $sexSubsidies.upperClass == 0>>
+	You can provide a minor subsidy for those selling sexual services to the upper class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.upperClass = 1]]<br>
+<<elseif $sexSubsidies.upperClass == 1>>
+	You are providing a minor subsidy for those selling sexual services to the upper class. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$sexSubsidies.upperClass = 0]] | [[Moderate Subsidy|Manage Arcology][$sexSubsidies.upperClass = 2]]<br>
+<<elseif $sexSubsidies.upperClass == 2>>
+	You are providing a moderate subsidy for those selling sexual services to the upper class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.upperClass = 1]] | [[Substantial Subsidy|Manage Arcology][$sexSubsidies.upperClass = 3]]<br>
+<<elseif $sexSubsidies.upperClass == 3>>
+	You are providing a substantial subsidy for those selling sexual services to the upper class. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$sexSubsidies.upperClass = 2]] | [[Gratuitous Subsidy|Manage Arcology][$sexSubsidies.upperClass = 4]]<br>
+<<else>>
+	You are providing a gratuitous subsidy for those selling sexual services to the upper class. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$sexSubsidies.upperClass = 3]]<br>
+<</if>>
+<<if $sexSupplyBarriers.upperClass == 0>>
+	You can make things more difficult for those supplying sexual services in the upper class segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.upperClass == 1>>
+	You have forced some unneeded bureaucracy on those selling sexual services to the upper class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 0, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.upperClass == 2>>
+	You have forced considerable bureaucracy on those selling sexual services to the upper class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 1, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.upperClass == 3>>
+	You have forced stifling bureaucracy on those selling sexual services to the upper class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 2, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<else>>
+	You have forced suffocating bureaucracy on those selling sexual services to the upper class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.upperClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<</if>>
+<br><br>
+
+<<if $sexSubsidies.topClass == 0>>
+	You can provide a minor subsidy for those selling sexual services to the millionaires. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.topClass = 1]]<br>
+<<elseif $sexSubsidies.topClass == 1>>
+	You are providing a minor subsidy for those selling sexual services to the millionaires. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$sexSubsidies.topClass = 0]] | [[Moderate Subsidy|Manage Arcology][$sexSubsidies.topClass = 2]]<br>
+<<elseif $sexSubsidies.topClass == 2>>
+	You are providing a moderate subsidy for those selling sexual services to the millionaires. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$sexSubsidies.topClass = 1]] | [[Substantial Subsidy|Manage Arcology][$sexSubsidies.topClass = 3]]<br>
+<<elseif $sexSubsidies.topClass == 3>>
+	You are providing a substantial subsidy for those selling sexual services to the millionaires. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$sexSubsidies.topClass = 2]] | [[Gratuitous Subsidy|Manage Arcology][$sexSubsidies.topClass = 4]]<br>
 <<else>>
-	You are providing a gratuitous subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 3]]<br>
+	You are providing a gratuitous subsidy for those selling sexual services to the millionaires. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$sexSubsidies.topClass = 3]]<br>
 <</if>>
-<<if $sexSupplyBarriersLC == 0>>
-	You can make things more difficult for those supplying sexual services in the lower class segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
-<<elseif $sexSupplyBarriersLC == 1>>
-	You have forced some unneeded bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 0, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
-<<elseif $sexSupplyBarriersLC == 2>>
-	You have forced considerable bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 1, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
-<<elseif $sexSupplyBarriersLC == 3>>
-	You have forced stifling bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 2, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<if $sexSupplyBarriers.topClass == 0>>
+	You can make things more difficult for those supplying sexual services in the millionaires segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.topClass == 1>>
+	You have forced some unneeded bureaucracy on those selling sexual services to the millionaires making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 0, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.topClass == 2>>
+	You have forced considerable bureaucracy on those selling sexual services to the millionaires making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 1, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+<<elseif $sexSupplyBarriers.topClass == 3>>
+	You have forced stifling bureaucracy on those selling sexual services to the millionaires making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the bureaucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 2, repX(-1000, "policies")]] | [[Increase Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
 <<else>>
-	You have forced suffocating bureaucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriersLC = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
+	You have forced suffocating bureaucracy on those selling sexual services to the millionaires making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Bureaucracy|Manage Arcology][$sexSupplyBarriers.topClass = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
 <</if>>
 
 <br><br>
diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw
index 252eed33363..fc3fcaec190 100644
--- a/src/uncategorized/slaveAssignmentsReport.tw
+++ b/src/uncategorized/slaveAssignmentsReport.tw
@@ -21,23 +21,31 @@ i.e. a highly paternalist arcology with little choice for its lower class but Fu
 /*Low rent increases demand/available money for sexual services, high rent decreases it*/
 <<set _LCRent = 1 + (20 - $LCRent) / 100,
 _lowerClassSexDemand = Math.trunc($lowerClass * _LCRent) * 10,
-_lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1);
+_lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1),
 _MCRent = 1 + (50 - $MCRent) / 250,
 _middleClassSexDemand = Math.trunc($middleClass * _MCRent) * 50,
+_middleClassSexDemandRef = Math.max(_lowerClassSexDemand, 1),
 _UCRent = 1 + (180 - $UCRent) / 900,
 _upperClassSexDemand = Math.trunc($upperClass * _UCRent) * 400,
+_upperClassSexDemandRef = Math.max(_upperClassSexDemand, 1),
 _TCRent = 1 + (650 - $TCRent) / 3250,
 _topClassSexDemand = Math.trunc($topClass * _TCRent) * 4000,
+_topClassSexDemandRef = Math.max(_upperClassSexDemand, 1),
 _visitorsSexDemand = Math.trunc($visitors) * 40,
-$whorePriceAdjustment = [0, 0, 0, 0],
+$whorePriceAdjustment = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0},
+$NPCMarketShare = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0},
+$sexDemandResult = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0},
 $slaveJobValues = slaveJobValues()>>
 
 /*Supply of sexual services*/
 <<if ($cheatMode == 1) || ($debugMode == 1)>>
 	<br>Lower Class SD: <<print _lowerClassSexDemand>>
+	<br>Middle Class SD: <<print _middleClassSexDemand>>
+	<br>Upper Class SD: <<print _upperClassSexDemand>>
+	<br>Top Class SD: <<print _topClassSexDemand>>
 	<br>Club SP: <<print Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP)>>
 	<br>Arcade SP: <<print $slaveJobValues.arcade>>
-	<br>Brothel SP: <<print $slaveJobValues.brothel>>
+	<br>Brothel SP: <<print $slaveJobValues.brothel.lowerClass>>, <<print $slaveJobValues.brothel.middleClass>>, <<print $slaveJobValues.brothel.upperClass>>, <<print $slaveJobValues.brothel.topClass>>
 <</if>>
 
 /*Arcade Specific Demand for Degradationists to give it higher priority*/
@@ -86,7 +94,8 @@ $slaveJobValues = slaveJobValues()>>
 
 /*Public slut sex supply. Top and upper class won't partake*/
 <<set _clubDemand = _lowerClassSexDemand + _middleClassSexDemand + _visitorsSexDemand,
-_lowerClassClubRatio = _lowerClassSexDemand / _clubDemand>>
+_lowerClassClubRatio = _lowerClassSexDemand / _clubDemand,
+_middleClassClubRatio = (_middleClassSexDemand + _visitorsSexDemand) / _clubDemand>>
 <<if $slaveJobValues.club * $slaveJobValues.clubSP < _clubDemand>>
 	<<set _lowerClassSexDemand -= Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * (_lowerClassSexDemand / _clubDemand)),
 	_middleClassSexDemand -= Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * (_middleClassSexDemand / _clubDemand)),
@@ -98,33 +107,33 @@ _lowerClassClubRatio = _lowerClassSexDemand / _clubDemand>>
 <</if>>
 
 /*Brothel or street whore sex supply*/
-<<if _lowerClassSexDemand < $slaveJobValues.brothel[0]>>
-	<<set $whorePriceAdjustment[0] = Math.pow(_lowerClassSexDemand / $slaveJobValues.brothel[0], 1.5),
+<<if _lowerClassSexDemand < $slaveJobValues.brothel.lowerClass>>
+	<<set $whorePriceAdjustment.lowerClass = Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 2),
 	_lowerClassSexDemand = 0>> /*This accounts for people having too much choice and getting more picky how they spend their money*/
 <<else>>
-	<<set $whorePriceAdjustment[0] = Math.pow(_lowerClassSexDemand / $slaveJobValues.brothel[0], 0.5),
-	_lowerClassSexDemand -= $slaveJobValues.brothel[0]>>
+	<<set $whorePriceAdjustment.lowerClass = Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 0.25),
+	_lowerClassSexDemand -= $slaveJobValues.brothel.lowerClass>> /* People are willing to pay more for a scarce good, but within reason */
 <</if>>
-<<if _middleClassSexDemand < $slaveJobValues.brothel[1]>>
-	<<set $whorePriceAdjustment[1] = Math.pow(_middleClassSexDemand / $slaveJobValues.brothel[1], 1.5),
+<<if _middleClassSexDemand < $slaveJobValues.brothel.middleClass>>
+	<<set $whorePriceAdjustment.middleClass = Math.pow(_middleClassSexDemand / ($slaveJobValues.brothel.middleClass + $NPCSexSupply.middleClass), 2),
 	_middleClassSexDemand = 0>>
 <<else>>
-	<<set $whorePriceAdjustment[1] = Math.pow(_middleClassSexDemand / $slaveJobValues.brothel[1], 0.5),
-	_middleClassSexDemand -= $slaveJobValues.brothel[1]>>
+	<<set $whorePriceAdjustment.middleClass = Math.pow(_middleClassSexDemand / ($slaveJobValues.brothel.middleClass + $NPCSexSupply.middleClass), 0.25),
+	_middleClassSexDemand -= $slaveJobValues.brothel.middleClass>>
 <</if>>
-<<if _upperClassSexDemand < $slaveJobValues.brothel[2]>>
-	<<set $whorePriceAdjustment[2] = Math.pow(_upperClassSexDemand / $slaveJobValues.brothel[2], 1.5),
+<<if _upperClassSexDemand < $slaveJobValues.brothel.upperClass>>
+	<<set $whorePriceAdjustment.upperClass = Math.pow(_upperClassSexDemand / ($slaveJobValues.brothel.upperClass + $NPCSexSupply.upperClass), 2),
 	_upperClassSexDemand = 0>>
 <<else>>
-	<<set $whorePriceAdjustment[2] = Math.pow(_upperClassSexDemand / $slaveJobValues.brothel[2], 0.5),
-	_upperClassSexDemand -= $slaveJobValues.brothel[2]>>
+	<<set $whorePriceAdjustment.upperClass = Math.pow(_upperClassSexDemand / ($slaveJobValues.brothel.upperClass + $NPCSexSupply.upperClass), 0.25),
+	_upperClassSexDemand -= $slaveJobValues.brothel.upperClass>>
 <</if>>
-<<if _topClassSexDemand < $slaveJobValues.brothel[3]>>
-	<<set $whorePriceAdjustment[3] = Math.pow(_topClassSexDemand / $slaveJobValues.brothel[3], 1.5),
+<<if _topClassSexDemand < $slaveJobValues.brothel.topClass>>
+	<<set $whorePriceAdjustment.topClass = Math.pow(_topClassSexDemand / ($slaveJobValues.brothel.topClass + $NPCSexSupply.topClass), 2),
 	_topClassSexDemand = 0>>
 <<else>>
-	<<set $whorePriceAdjustment[4] = Math.pow(_topClassSexDemand / $slaveJobValues.brothel[3], 0.5),
-	_topClassSexDemand -= $slaveJobValues.brothel[3]>>
+	<<set $whorePriceAdjustment.topClass = Math.pow(_topClassSexDemand / ($slaveJobValues.brothel.topClass + $NPCSexSupply.topClass), 0.25),
+	_topClassSexDemand -= $slaveJobValues.brothel.topClass>>
 <</if>>
 
 /*Price for sex in the arcade or at a glory hole*/
@@ -155,7 +164,10 @@ _lowerClassClubRatio = _lowerClassSexDemand / _clubDemand>>
 
 /*NPC sex supply*/
 <<set $NPCSexSupply = NPCSexSupply(_lowerClassSexDemand/_lowerClassSexDemandRef, _middleClassSexDemand/_middleClassSexDemandRef, _upperClassSexDemand/_upperClassSexDemandRef, _topClassSexDemand/_topClassSexDemandRef),
-$NPCMarketShareLC = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSupply.lowerClass + $slaveJobValues.arcade + Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _lowerClassClubRatio)))>>
+$NPCMarketShare.lowerClass = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSupply.lowerClass + $slaveJobValues.arcade +_arcadeDemandDeg + $slaveJobValues.brothel.lowerClass + Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _lowerClassClubRatio))),
+$NPCMarketShare.middleClass = Math.trunc(($NPCSexSupply.middleClass * 1000) / ($NPCSexSupply.middleClass + $slaveJobValues.brothel.middleClass + Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _middleClassClubRatio))),
+$NPCMarketShare.upperClass = Math.trunc(($NPCSexSupply.upperClass * 1000) / ($NPCSexSupply.upperClass + $slaveJobValues.brothel.upperClass)),
+$NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSexSupply.topClass + $slaveJobValues.brothel.topClass))>>
 <<if _lowerClassSexDemand < $NPCSexSupply.lowerClass>>
 	<<set _lowerClassSexDemand = 0>>
 <<else>>
@@ -205,107 +217,107 @@ $NPCMarketShareLC = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSuppl
 <</if>>
 
 /*Sexual satisfaction effects*/
-<<if _lowerClassSexDemand > $lowerClass * _LCRent * 3>> /*You are providing < 40% of their desired amount of sex*/
-	<<set $lowerClassSexDemandResult = 1>>
+<<if _lowerClassSexDemand > $lowerClass * _LCRent * 6>> /*You are providing < 40% of their desired amount of sex*/
+	<<set $sexDemandResult.lowerClass = 1>>
 	<<if $week <= 30>>
-		<<set $lowerClassSatisfied = 0>>
+		<<set $classSatisfied.lowerClass = 0>>
 	<<else>>
-		<<set $lowerClassSatisfied = -1>>
+		<<set $classSatisfied.lowerClass = -1>>
 	<</if>>
-<<elseif _lowerClassSexDemand > $lowerClass * _LCRent * 2>> /*You are providing between 40 and 60% of their desired amount of sex*/
-	<<set $lowerClassSexDemandResult = 2>>
+<<elseif _lowerClassSexDemand > $lowerClass * _LCRent * 4>> /*You are providing between 40 and 60% of their desired amount of sex*/
+	<<set $sexDemandResult.lowerClass = 2>>
 	<<if $week <= 40>>
-		<<set $lowerClassSatisfied = 1>>
+		<<set $classSatisfied.lowerClass = 1>>
 	<<elseif $week <= 60>>
-		<<set $lowerClassSatisfied = 0>>
+		<<set $classSatisfied.lowerClass = 0>>
 	<<else>>
-		<<set $lowerClassSatisfied = -1>>
+		<<set $classSatisfied.lowerClass = -1>>
 	<</if>>
-<<elseif _lowerClassSexDemand > $lowerClass * _LCRent>> /*You are providing between 60 and 80% of their desired amount of sex*/
-	<<set $lowerClassSexDemandResult = 3>>
+<<elseif _lowerClassSexDemand > $lowerClass * _LCRent * 2>> /*You are providing between 60 and 80% of their desired amount of sex*/
+	<<set $sexDemandResult.lowerClass = 3>>
 	<<if $week <= 50>>
-		<<set $lowerClassSatisfied = 1>>
+		<<set $classSatisfied.lowerClass = 1>>
 	<<else>>
-		<<set $lowerClassSatisfied = 0>>
+		<<set $classSatisfied.lowerClass = 0>>
 	<</if>>
 <<elseif _lowerClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/
-	<<set $lowerClassSexDemandResult = 5,
-	$lowerClassSatisfied = 2>>
+	<<set $sexDemandResult.lowerClass = 5,
+	$classSatisfied.lowerClass = 2>>
 <<else>> /*You are providing > 80% of their desired amount of sex*/
-	<<set $lowerClassSexDemandResult = 4,
-	$lowerClassSatisfied = 1>>
+	<<set $sexDemandResult.lowerClass = 4,
+	$classSatisfied.lowerClass = 1>>
 <</if>>
 
-<<if _middleClassSexDemand > $middleClass * _MCRent * 3>> /*You are providing < 40% of their desired amount of sex*/
-	<<set $middleClassSexDemandResult = 1>>
+<<if _middleClassSexDemand > $middleClass * _MCRent * 30>> /*You are providing < 40% of their desired amount of sex*/
+	<<set $sexDemandResult.middleClass = 1>>
 	<<if $week <= 30>>
-		<<set $middleClassSatisfied = 0>>
+		<<set $classSatisfied.middleClass = 0>>
 	<<else>>
-		<<set $middleClassSatisfied = -1>>
+		<<set $classSatisfied.middleClass = -1>>
 	<</if>>
-<<elseif _middleClassSexDemand > $middleClass * _MCRent * 2>> /*You are providing between 40 and 60% of their desired amount of sex*/
-	<<set $middleClassSexDemandResult = 2>>
+<<elseif _middleClassSexDemand > $middleClass * _MCRent * 20>> /*You are providing between 40 and 60% of their desired amount of sex*/
+	<<set $sexDemandResult.middleClass = 2>>
 	<<if $week <= 40>>
-		<<set $middleClassSatisfied = 1>>
+		<<set $classSatisfied.middleClass = 1>>
 	<<elseif $week <= 60>>
-		<<set $middleClassSatisfied = 0>>
+		<<set $classSatisfied.middleClass = 0>>
 	<<else>>
-		<<set $middleClassSatisfied = -1>>
+		<<set $classSatisfied.middleClass = -1>>
 	<</if>>
-<<elseif _middleClassSexDemand > $middleClass * _MCRent>> /*You are providing between 60 and 80% of their desired amount of sex*/
-	<<set $middleClassSexDemandResult = 3>>
+<<elseif _middleClassSexDemand > $middleClass * _MCRent * 10>> /*You are providing between 60 and 80% of their desired amount of sex*/
+	<<set $sexDemandResult.middleClass = 3>>
 	<<if $week <= 50>>
-		<<set $middleClassSatisfied = 1>>
+		<<set $classSatisfied.middleClass = 1>>
 	<<else>>
-		<<set $middleClassSatisfied = 0>>
+		<<set $classSatisfied.middleClass = 0>>
 	<</if>>
 <<elseif _middleClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/
-	<<set $middleClassSexDemandResult = 5,
-	$middleClassSatisfied = 2>>
+	<<set $sexDemandResult.middleClass = 5,
+	$classSatisfied.middleClass = 2>>
 <<else>> /*You are providing > 80% of their desired amount of sex*/
-	<<set $middleClassSexDemandResult = 4,
-	$middleClassSatisfied = 1>>
+	<<set $sexDemandResult.middleClass = 4,
+	$classSatisfied.middleClass = 1>>
 <</if>>
 
-<<if _upperClassSexDemand > $upperClass * _UCRent * 3>> /*You are providing < 40% of their desired amount of sex*/
-	<<set $upperClassSexDemandResult = 1>>
+<<if _upperClassSexDemand > $upperClass * _UCRent * 240>> /*You are providing < 40% of their desired amount of sex*/
+	<<set $sexDemandResult.upperClass = 1>>
 	<<if $week <= 30>>
-		<<set $upperClassSatisfied = 0>>
+		<<set $classSatisfied.upperClass = 0>>
 	<<else>>
-		<<set $upperClassSatisfied = -1>>
+		<<set $classSatisfied.upperClass = -1>>
 	<</if>>
-<<elseif _upperClassSexDemand > $upperClass * _UCRent * 2>> /*You are providing between 40 and 60% of their desired amount of sex*/
-	<<set $upperClassSexDemandResult = 2>>
+<<elseif _upperClassSexDemand > $upperClass * _UCRent * 160>> /*You are providing between 40 and 60% of their desired amount of sex*/
+	<<set $sexDemandResult.upperClass = 2>>
 	<<if $week <= 40>>
-		<<set $upperClassSatisfied = 1>>
+		<<set $classSatisfied.upperClass = 1>>
 	<<elseif $week <= 60>>
-		<<set $upperClassSatisfied = 0>>
+		<<set $classSatisfied.upperClass = 0>>
 	<<else>>
-		<<set $upperClassSatisfied = -1>>
+		<<set $classSatisfied.upperClass = -1>>
 	<</if>>
-<<elseif _upperClassSexDemand > $upperClass * _UCRent>> /*You are providing between 60 and 80% of their desired amount of sex*/
-	<<set $upperClassSexDemandResult = 3>>
+<<elseif _upperClassSexDemand > $upperClass * _UCRent * 80>> /*You are providing between 60 and 80% of their desired amount of sex*/
+	<<set $sexDemandResult.upperClass = 3>>
 	<<if $week <= 50>>
-		<<set $upperClassSatisfied = 1>>
+		<<set $classSatisfied.upperClass = 1>>
 	<<else>>
-		<<set $upperClassSatisfied = 0>>
+		<<set $classSatisfied.upperClass = 0>>
 	<</if>>
 <<elseif _upperClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/
-	<<set $upperClassSexDemandResult = 5,
-	$upperClassSatisfied = 2>>
+	<<set $sexDemandResult.upperClass = 5,
+	$classSatisfied.upperClass = 2>>
 <<else>> /*You are providing > 80% of their desired amount of sex*/
-	<<set $upperClassSexDemandResult = 4,
-	$upperClassSatisfied = 1>>
+	<<set $sexDemandResult.upperClass = 4,
+	$classSatisfied.upperClass = 1>>
 <</if>>
 
-<<if _topClassSexDemand > $topClass * _TCRent * 3>> /*You are providing < 40% of their desired amount of sex*/
+<<if _topClassSexDemand > $topClass * _TCRent * 2400>> /*You are providing < 40% of their desired amount of sex*/
 	<<set $topClassSexDemandResult = 1>>
 	<<if $week <= 30>>
 		<<set $topClassSatisfied = 0>>
 	<<else>>
 		<<set $topClassSatisfied = -1>>
 	<</if>>
-<<elseif _topClassSexDemand > $topClass * _TCRent * 2>> /*You are providing between 40 and 60% of their desired amount of sex*/
+<<elseif _topClassSexDemand > $topClass * _TCRent * 1600>> /*You are providing between 40 and 60% of their desired amount of sex*/
 	<<set $topClassSexDemandResult = 2>>
 	<<if $week <= 40>>
 		<<set $topClassSatisfied = 1>>
@@ -314,7 +326,7 @@ $NPCMarketShareLC = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSuppl
 	<<else>>
 		<<set $topClassSatisfied = -1>>
 	<</if>>
-<<elseif _topClassSexDemand > $topClass * _TCRent>> /*You are providing between 60 and 80% of their desired amount of sex*/
+<<elseif _topClassSexDemand > $topClass * _TCRent * 800>> /*You are providing between 60 and 80% of their desired amount of sex*/
 	<<set $topClassSexDemandResult = 3>>
 	<<if $week <= 50>>
 		<<set $topClassSatisfied = 1>>
-- 
GitLab