code:
App.SlaveAssignment.workAGloryHole = (function() {
	"use strict";

	let T;
	let r;
	let beauty;
	let FResult;
	/* eslint-disable no-unused-vars*/
	let he;
	let him;
	let his;
	let hers;
	let himself;
	let boy;
	let He;
	let His;
	/* eslint-enable */

	return saWorkAGloryHole;

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string}
	 */
	function saWorkAGloryHole(slave) {
		T = State.temporary;
		r = ``;
		({
			// eslint-disable-next-line no-unused-vars
			he, him, his, hers, himself, boy, He, His
		} = getPronouns(slave));
		beauty = slave.sexAmount; /* This gets calculated during slaveAssignmentReport and stored on the slave for later use */
		FResult = V.arcadePrice; /* This gets calculated during slaveAssignmentReport after we know the total 'arcade' sex slave supply */

		gatherStatistics(slave);
		jobPreface(slave);
		physicalEffects(slave);
		mentalEffects(slave);
		jobBody(slave);
		applyFSDecoration(slave);
		sexCounts(slave);
		profitReport(slave);

		return r;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function gatherStatistics(slave) {
		/* Statistics gathering */
		const facility = slave.assignment === window.Job.ARCADE ? V.facility.arcade : undefined;
		T.incomeStats = getSlaveStatisticData(slave, facility);
		T.incomeStats.customers = beauty;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function jobPreface(slave) {
		r += ` is `;
		if (slave.fuckdoll === 0) {
			r += `restrained in a glory hole.`;
		} else {
			r += `set out for use.`;
		}
		r += ` ${beauty} customers (${Math.trunc(beauty/7)} a day) `;
		if (V.policies.publicFuckdolls === 1) {
			r += `enjoyed ${his} holes free of charge thanks to your gracious policies.`;
		} else {
			r += `paid `;
			// is this right? This really doesn't feel right. < 1 credit?
			if (FResult === 3) {
				r += `${cashFormat(3)}`;
			} else if (FResult >= 2.5) {
				r += `a little under ${cashFormat(3)}`;
			} else if (FResult >= 2) {
				r += `a little over ${cashFormat(2)}`;
			} else if (FResult >= 1.5) {
				r += `a little under ${cashFormat(2)}`;
			} else if (FResult >= 1) {
				r += `a little over ${cashFormat(1)}`;
			} else {
				r += `less than ${cashFormat(1)}`;
			}
			r += ` to use ${his} holes.`;
		}
		if (V.arcologies[0].FSDegradationist > 0) {
			r += ` Demand for ${his} holes is strong due to the appetite for degradation rampant in ${V.arcologies[0].name}.`;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function physicalEffects(slave) {
		// check usage counts for these — more fucks should be more damaging
		if (slave.curatives > 0 || slave.inflationType === "curative") {
			r += ` The drugs ${he}'s `;
			if (slave.inflationType === "curative") {
				r += `harboring inside ${his} guts`;
			} else {
				r += `on`;
			}
			r += ` protect ${his} health from the stress of being used as a sexual appliance.`;
		} else if (slave.health.condition < -50) {
			r += ` The stress of being used while very in terrible condition <span class="red">damaged ${his} health.</span>`;
			healthDamage(slave, Math.max(Math.trunc((slave.sexAmount - 400) / 25) + jsRandom(-2, 2), 1));
		} else if (slave.health.condition < -10) {
			if (jsRandom(1, 100) < 10) {
				r += ` The stress of being used while weak has <span class="red">damaged ${his} health.</span>`;
				healthDamage(slave, Math.max(Math.trunc((slave.sexAmount - 400) / 25) + jsRandom(-2, 2), 1));
			}
		} else if (!canDoVaginal(slave) && !canDoAnal(slave)) {
			if (jsRandom(1, 100) < 75) {
				r += ` The stress of being used repeatedly in only one hole has <span class="red">damaged ${his} health.</span>`;
				healthDamage(slave, Math.max(Math.trunc((slave.sexAmount - 400) / 25) + jsRandom(-2, 2), 1));
			}
		} else if (!canDoVaginal(slave)) {
			if (jsRandom(1, 100) < 50) {
				r += ` The stress of being used in only two holes has <span class="red">damaged ${his} health.</span>`;
				healthDamage(slave, Math.max(Math.trunc((slave.sexAmount - 400) / 25) + jsRandom(-2, 2), 1));
			}
		} else if (jsRandom(1, 100) < 25) {
			r += ` The stress of being used has <span class="red">damaged ${his} health.</span>`;
			healthDamage(slave, Math.max(Math.trunc((slave.sexAmount - 400) / 25) + jsRandom(-2, 2), 1));
		}

		if (slave.health.illness > 0 || slave.health.tired > 60) {
			r += ` ${He} is<span class="red">`;
			if (slave.health.illness === 1) {
				r += ` feeling under the weather`;
			} else if (slave.health.illness === 2) {
				r += ` somewhat ill`;
			} else if (slave.health.illness === 3) {
				r += ` sick`;
			} else if (slave.health.illness === 4) {
				r += ` very sick`;
			} else if (slave.health.illness === 5) {
				r += ` terribly ill`;
			}
			if (slave.health.illness > 0 && slave.health.tired > 90) {
				r += ` and`;
			}
			if (slave.health.tired > 90) {
				r += ` exhausted`;
			} else if (slave.health.tired > 60) {
				r += ` fatigued`;
			}
			r += `,</span> but no one cared.`;
		}
		if (slave.assignment === Job.ARCADE) {
			if (!slave.fuckdoll) {
				r += ` ${He} spends ${his} working hours constrained to a box, and ${his} time outside preparing for ${his} next shift; <span class="red">an exhausting life for even the healthiest of slaves.</span>`;
				if (V.arcadeUpgradeHealth > 0) {
					r += ` The curative cocktail pumped into ${him} is laced with `;
					if (V.arcadeUpgradeHealth === 2) {
						r += `sedatives and painkillers to keep ${him} in a <span class="green">state of forced rest.</span>`;
					} else {
						r += `painkillers and mild muscle relaxants; Not enough to ruin a customer's fun, but enough to keep ${him} in a <span class="green">state of pseudo-rest.</span>`;
					}
				} else {
					r += ` If ${he} needs to rest, however, ${he} can always just pass out in ${his} restraints.`;
				}
			}
			tired(slave);
		} else if (slave.assignment === Job.GLORYHOLE) {
			if (!slave.fuckdoll) {
				if (slaveResting(slave)) {
					r += ` ${He} spends reduced hours serving ${his} glory hole in order to <span class="green">offset ${his} lack of rest.</span>`;
				} else if (slave.health.tired + 20 >= 90 && !willWorkToDeath(slave)) {
					r += ` ${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting severe punishment. ${He} purposefully underperforms, choosing ${his} overall well-being over the consequences, aggravating customers and damaging the establishment's image.`;
					slave.devotion -= 10;
					slave.trust -= 5;
					repX(forceNeg(50), "disobedience", slave);
				} else {
					r += ` ${He} spends long hours cooped up in a small box with nothing to rest on. Even if ${he} where to try to lean against its side, it won't be long before another dick pokes through the hole demanding service. By the time ${he} is released, ${he} is utterly exhausted.`;
				}
			}
			tired(slave);
		}

		if (slave.vagina === 0 && canDoVaginal(slave)) {
			r += ` A `;
			if (slave.fuckdoll === 0) {
				r += `glory hole`;
			} else {
				r += `Fuckdoll`;
			}
			r += ` user takes ${his} virginity. ${He} does not notice or care. ${His} pussy has been broken in in a painful and degrading way.`;
			slave.devotion -= 10;
			slave.trust -= 10;
			slave.vagina = 1;
		} else if (slave.vagina < 3 && canDoVaginal(slave) && jsRandom(1, 100) > ((310 - beauty) + (slave.vagina * 10))) {
			r += ` <span class="lime">${His} pussy gets stretched out by the use.</span>`;
			slave.vagina += 1;
		}

		if (slave.anus === 0 && canDoAnal(slave)) {
			r += ` ${His} anal virginity goes to a `;
			if (slave.fuckdoll === 0) {
				r += `glory hole`;
			} else {
				r += `Fuckdoll`;
			}
			r += ` user, who doesn't understand why this particular run at `;
			if (slave.fuckdoll === 0) {
				r += `the glory hole`;
			} else {
				r += `a Fuckdoll`;
			}
			r += ` is so great. <span class="lime">${His} ass has been broken in</span> in a <span class="trust dec">painful</span> and <span class="devotion dec">degrading</span> way.`;
			slave.devotion -= 5;
			slave.trust -= 5;
			slave.anus = 1;
		} else if (slave.anus < 3 && canDoAnal(slave) && jsRandom(1, 100) > ((290 - beauty) + (slave.anus * 10))) {
			r += ` <span class="lime">${His} asshole sees constant use and loosens.</span>`;
			slave.anus += 1;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function mentalEffects(slave) {
		if (slave.fetish === "mindbroken") {
			r += ` ${He} serves ${his} role as a mindless set of holes to perfection.`;
		} else {
			if (slave.skill.oral <= 10) {
				r += ` With ${his} throat being brutally used, ${his} gag reflex is suppressed and ${his} oral skills improve.`;
				r += ` ${SkillIncrease.Oral(slave, 5)}`;
			} else if (slave.skill.vaginal <= 10 && canDoVaginal(slave)) {
				r += ` With ${his} pussy being harshly used, ${his} vaginal skills improve.`;
				r += ` ${SkillIncrease.Vaginal(slave, 5)}`;
			} else if (slave.skill.anal <= 10 && canDoAnal(slave)) {
				r += ` With ${his} butt being mercilessly fucked, ${his} anal skills improve.`;
				r += ` ${SkillIncrease.Anal(slave, 5)}`;
			}
			let acceptance = 0;
			acceptance += Math.trunc(slave.energy / 10);
			acceptance -= Math.trunc((slave.intelligence + slave.intelligenceImplant) / 10);
			if (slave.fetish === "masochist" || slave.fetish === "humiliation") {
				acceptance += Math.trunc(slave.fetishStrength / 10);
			}
			if (slave.sexualFlaw === "self hating") {
				r += ` ${His} self hatred is so deep that ${he} believes ${he} deserves to serve in a glory hole, and even gets off on the degradation.`;
			} else if (acceptance > 20 && slave.devotion > 20) {
				r += ` ${He} gets off on the constant degrading sexual use and does not consider what this means for ${his} future as a slave.`;
			} else if (slave.sentence > 0) {
				if (slave.behavioralFlaw !== "odd" && jsRandom(1, 100) > (100 + (slave.devotion / 5))) {
					r += ` Constant confinement coupled with brutal use has left ${him} with involuntary nervous tics.`;
					slave.behavioralFlaw = "odd";
				}
				if (slave.devotion > 50) {
					r += ` ${He} does ${his} best to tolerate ${his} sentence to the glory hole, but ${his} devotion is hurt and ${he} is filled with fear ${he} won't be let out.`;
				} else if (slave.devotion > 20) {
					r += ` ${He} does not understand why ${his} obedience has earned ${him} a sentence to this torture. ${His} obedience is hurt and ${he} is filled with fear ${he} won't be let out.`;
				} else if (slave.devotion >= -20) {
					r += ` ${His} fear of you turns to desperation during ${his} sentence. ${His} obedience is reduced and ${he} is filled with fear ${he} won't be let out.`;
				} else if (slave.devotion >= -50) {
					r += ` Though ${he} is only temporarily sentenced to suffer, ${his} resistance is increased and ${he} is filled with fear ${he} won't be let out.`;
				} else {
					r += ` ${He} has hope ${he}'ll be released after ${his} sentence, but ${his} hatred of you is increased and ${he} is filled with fear ${he} won't be let out.`;
				}
				slave.devotion -= 5;
				slave.trust -= 5;
			} else {
				if (slave.behavioralFlaw !== "odd" && jsRandom(1, 100) > (70 + (slave.devotion / 5))) {
					r += ` Constant confinement coupled with brutal use has left ${him} with involuntary nervous tics.`;
					slave.behavioralFlaw = "odd";
				}
				if (slave.devotion > 50) {
					r += ` ${He} feels starved of personal contact. <span class="devotion dec">${His} devotion is hurt</span> and ${he} is <span class="trust dec">filled with fear</span> ${he} won't be let out.`;
				} else if (slave.devotion > 20) {
					r += ` ${He} does not understand why ${his} obedience has earned ${him} this immurement. ${His} obedience is hurt and ${he} is filled with fear ${he} won't be let out.`;
				} else if (slave.devotion >= -20) {
					r += ` ${His} fear of you has increased into something like a pathology. ${His} obedience is reduced and ${he} is filled with fear ${he} won't be let out.`;
				} else if (slave.devotion >= -50) {
					r += ` ${His} resistance is deepening into hatred. <span class="devotion dec">${His} resistance is increased</span> and ${he} is <span class="trust dec">filled with fear</span> ${he} won't be let out.`;
				} else {
					r += ` <span class="devotion dec">${His} helpless hatred of you is increased</span> and ${he} is <span class="trust dec">filled with fear</span> ${he} won't be let out.`;
				}
				slave.devotion -= 10;
				slave.trust -= 10;
			}
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function jobBody(slave) {
		r += ` ${His} feelings, skills, and appearance do not matter. ${He} is condemned to a world that consists of a tiny cell, featureless except for the never-ending dicks ${he} is required to service. You `;
		if (V.policies.publicFuckdolls === 0) {
			r += `were paid <span class="cash inc">${cashFormat((Math.trunc(beauty * FResult)))}</span>`;
		} else {
			r += `<span class="reputation inc">gained reputation</span>`;
		}
		r += ` for the use of ${slave.slaveName}'s holes this week.`;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function applyFSDecoration(slave) {
		/* FACILITY DECORATION IMPACTS */
		if (slave.assignment === window.Job.ARCADE && V.arcadeDecoration !== "standard") {
			const impact = (0.0001 * V.FSSingleSlaveRep * beauty);
			switch (V.arcadeDecoration) {
				case "Roman Revivalist":
					V.arcologies[0].FSRomanRevivalist += impact;
					break;
				case "Aztec Revivalist":
					V.arcologies[0].FSAztecRevivalist += impact;
					break;
				case "Egyptian Revivalist":
					V.arcologies[0].FSEgyptianRevivalist += impact;
					break;
				case "Edo Revivalist":
					V.arcologies[0].FSEdoRevivalist += impact;
					break;
				case "Arabian Revivalist":
					V.arcologies[0].FSArabianRevivalist += impact;
					break;
				case "Chinese Revivalist":
					V.arcologies[0].FSChineseRevivalist += impact;
					break;
				case "Repopulation Focus":
					V.arcologies[0].FSRepopulationFocus += impact;
					break;
				case "Eugenics":
					V.arcologies[0].FSRestart += impact;
					break;
				case "Chattel Religionist":
					V.arcologies[0].FSChattelReligionist += impact;
					break;
				case "Degradationist":
					V.arcologies[0].FSDegradationist += impact;
					break;
				case "Asset Expansionist":
					V.arcologies[0].FSAssetExpansionist += impact;
					break;
				case "Transformation Fetishist":
					V.arcologies[0].FSTransformationFetishist += impact;
					break;
				case "Gender Radicalist":
					V.arcologies[0].FSGenderRadicalist += impact;
					break;
				case "Gender Fundamentalist":
					V.arcologies[0].FSGenderFundamentalist += impact;
					break;
				case "Physical Idealist":
					V.arcologies[0].FSPhysicalIdealist += impact;
					break;
				case "Hedonistic":
					V.arcologies[0].FSHedonisticDecadence += impact;
					break;
				case "Supremacist":
					V.arcologies[0].FSSupremacist += impact;
					break;
				case "Subjugationist":
					V.arcologies[0].FSSubjugationist += impact;
					break;
				case "Paternalist":
					V.arcologies[0].FSPaternalist += impact;
					break;
				case "Pastoralist":
					V.arcologies[0].FSPastoralist += impact;
					break;
				case "Maturity Preferentialist":
					V.arcologies[0].FSMaturityPreferentialist += impact;
					break;
				case "Youth Preferentialist":
					V.arcologies[0].FSYouthPreferentialist += impact;
					break;
				case "Body Purist":
					V.arcologies[0].FSBodyPurist += impact;
					break;
				case "Slimness Enthusiast":
					V.arcologies[0].FSSlimnessEnthusiast += impact;
					break;
				case "Slave Professionalism":
					V.arcologies[0].FSSlaveProfessionalism += impact;
					break;
				case "Intellectual Dependency":
					V.arcologies[0].FSIntellectualDependency += impact;
					break;
				case "Petite Admiration":
					V.arcologies[0].FSPetiteAdmiration += impact;
					break;
				case "Statuesque Glorification":
					V.arcologies[0].FSStatuesqueGlorification += impact;
					break;
			}
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function sexCounts(slave) {
		/* SEX ACT COUNTS AND SEXUAL SATISFACTION */

		let oralUse = (V.oralUseWeight + (slave.lips / 20));
		let analUse = 0;
		if (canDoAnal(slave)) {
			analUse = V.analUseWeight - slave.anus;
			if (analUse < 0) {
				analUse = 0;
			}
		}
		let vaginalUse = 0;
		if (canDoVaginal(slave)) {
			vaginalUse = V.vaginalUseWeight - slave.vagina;
			if (vaginalUse < 0) {
				vaginalUse = 0;
			}
		}

		const demand = (oralUse + analUse + vaginalUse);
		let cervixPump = 0;

		oralUse = Math.trunc((oralUse / demand) * beauty);
		analUse = Math.trunc((analUse / demand) * beauty);
		vaginalUse = Math.trunc((vaginalUse / demand) * beauty);

		slave.need -= ((analUse + vaginalUse) / 4);

		seX(slave, "oral", "public", "penetrative", oralUse);
		seX(slave, "anal", "public", "penetrative", analUse);
		seX(slave, "vaginal", "public", "penetrative", vaginalUse);

		if (slave.cervixImplant === 1 || slave.cervixImplant === 3) {
			cervixPump += (20 * vaginalUse);
		}
		if (slave.cervixImplant === 2 || slave.cervixImplant === 3) {
			cervixPump += (20 * analUse);
		}

		// this may need improvement with the new system
		if (slave.need) {
			if (slave.fetishKnown) {
				switch (slave.fetish) {
					case "submissive":
					case "masochist":
						if ((analUse + vaginalUse) > 0) {
							r += ` ${He} enjoys being used, and got sexual satisfaction from the ${analUse + vaginalUse} dicks stuck inside ${him} this week.`;
							slave.need -= (analUse + vaginalUse);
						}
						break;
					case "dom":
					case "sadist":
						break;
					case "cumslut":
						if (oralUse > 0) {
							r += ` ${He} enjoys being facefucked, and got sexual satisfaction from the ${oralUse} dicks shoved inside ${his} throat this week.`;
							slave.need -= oralUse;
						}
						break;
					case "buttslut":
						if (analUse > 0) {
							r += ` ${He} enjoys getting buttfucked, and got sexual satisfaction from the ${analUse} times ${he} was sodomized this week.`;
							slave.need -= analUse;
						}
						break;
					case "pregnancy":
						if (canGetPregnant(slave)) {
							if (slave.mpreg === 0) {
								if (vaginalUse > 0) {
									r += ` ${He} enjoys having ${his} pussy fucked, and got sexual satisfaction from the ${vaginalUse} loads ${he} received this week.`;
									slave.need -= vaginalUse;
								}
							} else {
								if (analUse > 0) {
									r += ` ${He} enjoys having ${his} ass fucked, and got sexual satisfaction from the ${analUse} loads ${he} received this week.`;
									slave.need -= analUse;
								}
							}
						}
						break;
					case "humiliation":
						r += ` ${He} enjoys the humiliation of having ${his} most intimate parts presented for public use, and got a bit of sexual satisfaction from every sex act ${he} performed this week.`;
						slave.need -= beauty;
						break;
				}
			}
		}

		if (cervixPump > 0) {
			r += ` ${He} notices ${his} <span class="change positive">belly has swollen</span> from all the `;
			if (slave.cervixImplant === 1) {
				r += `vaginal `;
			} else if (slave.cervixImplant === 2) {
				r += `anal `;
			}
			r += `sex ${he} had throughout the week.`;
			slave.bellyImplant += cervixPump;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function profitReport(slave) {
		let cash = 0;
		if (V.policies.publicFuckdolls === 0) {
			cash = Math.trunc(beauty * FResult);
		} else {
			cash = Math.trunc(beauty * FResult / 5);
		}

		if (slave.assignment === window.Job.GLORYHOLE) {
			cashX(cash, "slaveAssignmentGloryhole", slave);
		} else if (slave.assignment === window.Job.ARCADE) {
			cashX(cash, "slaveAssignmentArcade", slave);
		} else {
			cashX(cash, "income for working a gloryhole in an unregistered building", slave);
		}

		T.profits += cash;
		T.incomeStats.income += cash;
	}
})();


code:
/**
 * @param {App.Entity.SlaveState} slave
 * @returns {string}
 */
App.SlaveAssignment.workTheFarm = function(slave) {
	const arcology = V.arcologies[0];
	const {
			he, him, his, He, His
		} = getPronouns(slave),
		incomeStats = getSlaveStatisticData(slave, V.facility.farmyard);

	let food = Math.trunc(App.Facilities.Farmyard.foodAmount(slave));
	let t = `works as a farmhand this week. `;

	const foodTotal = (slave, food) => {
		t += foodFarmer();
		t += foodDevotion(slave);
		t += foodMuscles(slave);
		t += foodWeight(slave);
		t += foodHealth(slave);
		t += foodSight(slave);
		t += foodHearing(slave);

		t += V.foodMarket ? `As a result, ${he} produces <span class="chocolate">${massFormat(food)}</span> of food over the week. ` : ``;
	};

	const foodFarmer = () => {
		if (V.Farmer) {
			return `${V.Farmer.slaveName} watches over ${him}, making sure that ${he} doesn't slack off and works as hard as ${he} should. `;
		}
		return ``;
	};

	const foodDevotion = slave => {
		if (slave.devotion > 50) {
			return `${He}'s so devoted to you that ${he} works harder and produces more food. `;
		} else if (slave.devotion < -50) {
			return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food. `;
		} else {
			return ``; // TODO: third case for neutral?
		}
	};

	const foodHealth = slave => {
		return foodHealthCondition(slave) + foodHealthIllness(slave);
	};

	const foodHealthCondition = slave => {
		if (slave.health.condition > 50) {
			return `${His} shining health helps ${him} work harder and longer. `;
		} else if (slave.health.condition < -50) {
			return `${His} poor health impedes ${his} ability to work efficiently. `;
		} else {
			return ``; // TODO: third case?
		}
	};

	const foodHealthIllness = slave => {
		let t = ``;
		if (slave.health.illness > 0 || slave.health.tired > 60) {
			t += ` ${He} performed worse this week due to<span class="red">`;
			if (slave.health.illness === 1) {
				t += ` feeling under the weather`;
			} else if (slave.health.illness === 2) {
				t += ` a minor illness`;
			} else if (slave.health.illness === 3) {
				t += ` being sick`;
			} else if (slave.health.illness === 4) {
				t += ` being very sick`;
			} else if (slave.health.illness === 5) {
				t += ` a terrible illness`;
			}
			if (slave.health.illness > 0 && slave.health.tired > 60) {
				t += ` and`;
				foodHealthTired(slave);
			}

			t += `.</span> `;
			t += foodTired(slave);
		}
		return t;
	};

	const foodHealthTired = slave => {
		if (slave.health.tired > 90) {
			return ` exhaustion`;
		} else if (slave.health.tired > 60) {
			return ` being tired`;
		}
		return ``;
	};

	const foodTired = slave => {
		let t = ``;
		if (!slave.fuckdoll) {
			if (slaveResting(slave)) {
				t = ` ${He} spends reduced hours working the soil in order to <span class="green">offset ${his} lack of rest.</span>`;
			} else if (slave.health.tired + 20 >= 90 && !willWorkToDeath(slave)) {
				t = ` ${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting severe punishment. ${He} purposefully underperforms, choosing ${his} overall well-being over the consequences, greatly reducing yields.`;
				slave.devotion -= 10;
				slave.trust -= 5;
			} else {
				t = ` Hours of manual labor quickly add up, leaving ${him} <span class="red">physically drained</span> by the end of the day.`;
			}
		}
		tired(slave);

		return t;
	};

	const foodMuscles = slave => {
		if (slave.muscles > 50) {
			return `${His} muscular form helps ${him} work better, increasing ${his} productivity. `;
		} else if (slave.muscles < -50) {
			return `${He} is so weak that ${he} is not able to work effectively. `;
		} else {
			return ``; // TODO: third case?
		}
	};

	const foodWeight = slave => {
		return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : ``;
	};

	const foodSight = slave => {
		if (!canSee(slave)) {
			return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `;
		} else if (!canSeePerfectly(slave)) {
			return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `;
		} else {
			return ``; // TODO: third case?
		}
	};

	const foodHearing = slave => {
		if (slave.hears === -1) {
			return `${He} is hard-of-hearing, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `;
		} else if (slave.hears < -1) {
			return `${He} is deaf, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `;
		} else {
			return ``; // TODO: third case?
		}
	};

	if (V.Farmer) {
		// TODO: keep oral check? replace with something else?
		t += `While there, ${he} benefits from ${V.Farmer.slaveName}'s ${V.Farmer.physicalAge < 21 ? `youthful energy` : `care`} ${V.Farmer.skill.oral ? ` and talented tongue` : ``}.`;
		if (slave.devotion < V.FarmerDevotionThreshold) {
			slave.devotion += V.FarmerDevotionBonus;
		}
		if (slave.devotion < V.FarmerTrustThreshold) {
			slave.trust += V.FarmerTrustBonus;
		}
		if (slave.health.condition < 100) {
			improveCondition(slave, V.FarmerHealthBonus);
		}
	}

	// Open Food Production

	if (V.foodMarket) {
		if (food < 1) {
			food = 1;
		}
		V.food += food;
		V.foodTotal += food;
		incomeStats.food += food;

		foodTotal(slave, food);
	}

	// Close Food Production

	// Open Shows

	incomeStats.income += App.Facilities.Farmyard.farmShowsIncome(slave);

	if (V.farmyardShows) {
		t += `${He} also puts on shows with animals this week. `;

		// Open FS Subsection

		if (arcology.FSSupremacist !== "unset") {
			if (slave.race === arcology.FSSupremacistRace) {
				t += `Society <span class="red">disapproves</span> of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much. `;
			}
		}
		if (arcology.FSSubjugationist !== "unset") {
			if (slave.race === arcology.FSSubjugationistRace) {
				t += `Society <span class="green">approves</span> of the degradation you submit your ${arcology.FSSubjugationistRace} slaves to, and so ${he} earns you a bit more. `;
			} else {
				t += `Society doesn't disapprove of ${him} not being ${arcology.FSSubjugationistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was. `;
			}
		}
		if (arcology.FSRepopulationFocus !== "unset") {
			if (slave.pregWeek > 16) {
				if (slave.eggType !== "human") {
					t += `Society is <span class="red">disgusted</span> by ${his} pregnancy when they realize that what it is in ${his} womb is not human. `;
				} else {
					t += `Society <span class="green">greatly approves</span> of your having pregnant slaves ${V.seeBestiality ? `have sex` : `put on shows`} with animals. `;
				}
			}
		}
		if (arcology.FSRestart !== "unset") {
			if (slave.pregWeek > 16) {
				if (slave.eggType !== "human") {
					t += `Society is disgusted by ${his} pregnancy until they learn that what is in ${his} womb is not human. `;
				} else {
					t += `Society is <span class="red">extremely disgusted</span> by ${his} pregnancy and the fact that you would have ${him} ${V.seeBestiality ? `have sex` : `put on shows`} with animals while sporting a baby bump. `;
				}
			}
		}
		if (arcology.FSGenderRadicalist !== "unset") {
			if (slave.dick > 0) {
				t += `${His} patrons <span class="green">approve</span> of the fact that ${he} has a dick. `;
			} else {
				t += `${His} patrons <span class="red">are disappointed</span> that ${he} doesn't have a dick. `;
			}
		}
		if (arcology.FSGenderFundamentalist !== "unset") {
			if (slave.pregWeek > 16) {
				t += `${His} viewers <span class="green">approve</span> of the fact that ${he} is sporting a baby bump. `;
			} else {
				t += `${His} viewers <span class="red">are disappointed</span> that ${he} isn't pregnant. `;
			}
			if (slave.dick > 0) {
				// TODO: something here?
			}
		}
		if (arcology.FSPaternalist !== "unset") {
			if (V.seeBestiality && V.farmyardBreeding) {
				t += `Your citizens are <span class="red">very disapproving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts. `;
			} else {
				t += `Your citizens <span class="red">disapprove</span> of the fact that you would allow your slaves to be degraded in such a manner. `;
			}
		}
		if (arcology.FSDegradationist !== "unset") {
			if (V.seeBestiality && V.farmyardBreeding) {
				t += `Your citizens are <span class="green">very approving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts. `;
			} else {
				t += `Your citizens <span class="green">approve</span> of the fact that you would allow your slaves to be degraded in such a manner. `;
			}
		}
		if (arcology.FSBodyPurist !== "unset") {
			/* TODO: requirements for these might change */
			if (slave.boobsImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.buttImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.faceImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.lipsImplant > 0) {
				// TODO: add stuff here
			}
		}
		if (arcology.FSTransformationFetishist !== "unset") {
			/* TODO: requirements for these might change */
			if (slave.boobsImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.buttImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.faceImplant > 0) {
				// TODO: add stuff here
			}
			if (slave.lipsImplant > 0) {
				// TODO: add stuff here
			}
		}
		if (arcology.FSYouthPreferentialist !== "unset") {
			if (slave.visualAge > 25) { // TODO: not sure about this age
				t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such old slaves to put on shows. `;
			} else {
				t += `${arcology.name}'s citizens <span class="green">approve</span> of your using young slaves to put on shows. `;
			}
		}
		if (arcology.FSMaturityPreferentialist !== "unset") {
			if (slave.visualAge > 25) { // TODO: not sure about this age
				t += `${arcology.name}'s citizens <span class="green">approve</span> of your using mature slaves to put on shows. `;
			} else {
				t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such young slaves to put on shows. `;
			}
		}
		if (arcology.FSSlimnessEnthusiast !== "unset") {
			if (slave.weight > 10) {
				t += `Society finds your using a slave with such a flabby body <span class="red">absolutely disgusting.</span> `;
			}
			if (slave.boobs > 799) {
				t += `Your citizens ${slave.weight > 10 ? `also ` : ``} don't approve of you using a slave with such large tits as a showgirl. `;
			}
			if (slave.butt > 3) {
				// TODO: write this
			}
		}
		if (arcology.FSAssetExpansionist !== "unset") {
			if (slave.weight > 10) {
				// TODO: should weight be in here?
			}
			if (slave.boobs > 799) {
				// TODO: write this
			}
			if (slave.butt > 3) {
				// TODO: write this
			}
		}
		if (arcology.FSPastoralist !== "unset") {
			if (slave.boobs > 799) {
				// TODO: does this make sense?
			}
			if (slave.lactation > 0) {
				// TODO: write this
			}
		}
		if (arcology.FSPhysicalIdealist !== "unset") {
			if (slave.height > 169) {
				// TODO: write this
			} else {
				// TODO: write this
			}
		}
		if (arcology.FSHedonisticDecadence !== "unset") {
			if (slave.weight > 10) {
				// TODO: write this
			} else {
				// TODO: write this
			}
		}
		if (arcology.FSChattelReligionist !== "unset") {
			if (slave.devotion <= 20) {
				// TODO: write this
			} else {
				// TODO: write this
			}
		}

		// Close FS Subsection

		if (setup.entertainmentCareers.includes(slave.career)) {
			t += ` ${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows. `;
		}
		if (setup.farmerCareers.includes(slave.career)) { // TODO: does this even make sense to include?
			// TODO: write this
		}
		if (slave.prestige === 1) {
			t += `Because some of your citizens already know of ${him}, ${he} earns more. `;
		} else if (slave.prestige === 2) {
			t += `Because a lot of your citizens already know of ${him}, ${he} earns quite a bit more. `;
		} else if (slave.prestige === 3) {
			t += `Because ${he} is so famous, ${he} earns a lot more then ${he} would otherwise. `;
		}
		if (slave.porn.prestige === 1) { // TODO: are prestige and pornPrestige mutually exclusive?
			t += `${He} earns a bit more because some of your citizens already know ${him} from porn. `;
		} else if (slave.porn.prestige === 2) {
			t += `${He} earns quite a bit more because a lot of your citizens already know ${him} from porn. `;
		} else if (slave.porn.prestige === 3) {
			t += `${He} earns a lot more because ${he} is so famous from porn. `;
		}
		if (slave.health.condition > 20) {
			t += `${He} is in such excellent health that ${he} is able to put on longer and more energetic shows, earning you more. `;
		} else if (slave.health.condition < -20) {
			t += `${His} poor health negatively affects ${his} ability to put on good shows, cutting into your profits. `;
		}
		if (slave.face > 40) {
			t += `${He} is so ${slave.genes === "XY" ? `handsome` : `beautiful`} that ${his} audience is willing to pay more to watch ${him} put on shows. `;
		} else if (slave.face > 10) {
			t += `${He} is so ${slave.genes === "XY" ? `good-looking` : `pretty`} that ${his} audience is willing to pay more to watch ${him} put on shows. `;
		} else if (slave.face < -10) {
			t += `${His} audience isn't willing to pay as much because of how unattractive ${his} face is. `;
		} else if (slave.face < -40) {
			t += `${His} audience isn't willing to pay as much because of how hard ${his} face is to look at. `;
		}
		// TODO: write this block with different combinations of trust / devotion
		if (slave.devotion > 50) {
			// TODO: write this
		} else if (slave.devotion < -50) {
			// TODO: write this
		}
		if (slave.trust > 50) {
			// TODO: write this
		} else if (slave.trust < -50) {
			// TODO: write this
		}
		if (slave.weight > 30 && arcology.FSHedonisticDecadence === "unset") {
			t += `Your citizens are not willing to pay as much to see such a fat slave put on shows, so ${he} loses some income. `;
		} else if (slave.weight < -30) {
			t += `Your citizens don't like watching such a sickly-looking slaves put on shows, so ${he} loses some income. `;
		}
		if (slave.muscles > 30) {
			// TODO: write this - do we want something for muscles?
		} else if (slave.muscles < -30) {
			// TODO: write this - maybe something about the slave's ability to handle the animal?
		}
		if (!canSeePerfectly(slave)) {
			t += `${His} ${!canSee(slave) ? `blindness makes it impossible` : `nearsightedness makes it harder`}} for ${him} to see what ${he}'s doing, affecting ${his} ability to put on a good show. `;
		}
		if (slave.hears < 0) {
			t += `${His} ${slave.hears < -1 ? `lack of` : `poor`} hearing makes it difficult for ${him} to do a good job of putting on a show. `;
		}
		if (slave.boobs > 800) {
			// TODO: write this
		}
		if (slave.butt > 4) {
			// TODO: write this
		}
		if (slave.preg > 10) {
			// TODO: write this
		}
		if (slave.health.tired > 60) {
			t += `${He} is so tired that the energy in ${his} shows is basically nonexistent, affecting ${his} profits. `;
		}
		if (slave.chem > 10) {
			// TODO: write this - would this make sense to include?
		}
		if (slave.intelligence > 50) {
			// TODO: write this - include something about .intelligenceImplant?
		} else if (slave.intelligence < -50) {
			// TODO: write this
		}
		if (slave.energy <= 20) {
			// TODO: write this
		} else if (slave.energy <= 40) {
			// TODO: write this
		} else if (slave.energy <= 60) {
			// TODO: write this
		} else if (slave.energy <= 80) {
			// TODO: write this
		} else if (slave.energy <= 95) {
			// TODO: write this
		} else {
			// TODO: write this
		}
		if (slave.fetish === "submissive") {
			// TODO: write this
		} else if (slave.fetish === "humiliation") {
			// TODO: write this
		} else if (slave.fetish === "masochist") {
			// TODO: write this
		} // TODO: incorporate quirks
	}

	// Close Shows

	// Open Long-Term Effects

	if (slave.fetishKnown && (slave.fetish === "submissive" || slave.fetish === "humiliation" || slave.fetish === "masochist") || slave.energy > 95) {
		if (V.farmyardShows) {
			if (V.seeBestiality) {
				t += `Getting fucked by animals is the perfect job for ${him}, as far as ${he} can tell. <span class="devotion inc">${He} is happy</span> to spend ${his} days being utterly degraded. `;
			} else {
				t += `${He} loves putting on shows with animals, and as far as ${he} can tell, it's the perfect job for ${him}. ${He} is happy to spend ${his} days doing something so degrading. `; // TODO: not sure how degrading putting on shows is
			}
		}
		slave.devotion += 1;
		if (slave.need) {
			slave.need = 0;
		}
	}
	if (slave.behavioralQuirk === "fitness") {
		t += `${slave.slaveName} <span class="devotion inc">privately enjoys</span> the exercise ${he} receives while working in ${V.farmyardName}. `;
		slave.devotion += 1;
	}

	// Close Long-Term Effects

	// Open Vignettes

	if (V.showVignettes) {
		const vignette = GetVignette(slave);
		t += `<span class="story-label">This week</span> ${vignette.text}`;
		if (vignette.type === "cash") {
			let FResultNumber = FResult(slave);
			const cashVign = Math.trunc(FResultNumber * vignette.effect);
			if (vignette.effect > 0) {
				t += ` <span class="yellowgreen">making you an extra ${cashFormat(cashVign)}.</span> `;
				cashX(cashVign, "slaveAssignmentFarmyardVign", slave);
			} else if (vignette.effect < 0) {
				t += ` <span class="red">losing you ${cashFormat(Math.abs(cashVign))}.</span> `;
				cashX(forceNeg(cashVign), "slaveAssignmentFarmyardVign", slave);
			} else {
				t += ` an incident without lasting effect. `;
			}
			incomeStats.income += cashVign;
		} else if (vignette.type === "devotion") {
			if (vignette.effect > 0) {
				if (slave.devotion > 50) {
					t += ` <span class="devotion inc">increasing ${his} devotion to you.</span> `;
				} else if (slave.devotion >= 20) {
					t += ` <span class="devotion inc">increasing ${his} acceptance of you.</span> `;
				} else if (slave.devotion >= -20) {
					t += ` <span class="devotion inc">reducing ${his} dislike of you.</span> `;
				} else {
					t += ` <span class="devotion inc">reducing ${his} hatred of you.</span> `;
				}
			} else if (vignette.effect < 0) {
				if (slave.devotion > 50) {
					t += ` <span class="devotion dec">reducing ${his} devotion to you.</span> `;
				} else if (slave.devotion >= 20) {
					t += ` <span class="devotion dec">reducing ${his} acceptance of you.</span> `;
				} else if (slave.devotion >= -20) {
					t += ` <span class="devotion dec">increasing ${his} dislike of you.</span> `;
				} else {
					t += ` <span class="devotion dec">increasing ${his} hatred of you.</span> `;
				}
			} else {
				t += ` an incident without lasting effect. `;
			}
			slave.devotion += 1 * vignette.effect;
		} else if (vignette.type === "trust") {
			if (vignette.effect > 0) {
				if (slave.trust > 20) {
					t += ` <span class="trust inc">increasing ${his} trust in you.</span> `;
				} else if (slave.trust >= -20) {
					t += ` <span class="trust inc">reducing ${his} fear of you.</span> `;
				} else {
					t += ` <span class="trust inc">reducing ${his} terror of you.</span> `;
				}
			} else if (vignette.effect < 0) {
				if (slave.trust > 20) {
					t += ` <span class="trust dec">reducing ${his} trust in you.</span> `;
				} else if (slave.trust >= -20) {
					t += ` <span class="trust dec">increasing ${his} fear of you.</span> `;
				} else {
					t += ` <span class="trust dec">increasing ${his} terror of you.</span> `;
				}
			} else {
				t += ` an incident without lasting effect. `;
			}
			slave.trust += 1 * vignette.effect;
		} else if (vignette.type === "health") {
			if (vignette.effect > 0) {
				t += ` <span class="green">improving ${his} health.</span> `;
				improveCondition(slave, 2 * vignette.effect);
			} else if (vignette.effect < 0) {
				t += ` <span class="red">affecting ${his} health.</span> `;
				healthDamage(slave, 2 * vignette.effect);
			} else {
				t += ` an incident without lasting effect. `;
			}
		} else {
			let FResultNumber = FResult(slave);
			if (vignette.effect > 0) {
				t += ` <span class="green">gaining you a bit of reputation.</span> `;
			} else if (vignette.effect < 0) {
				t += ` <span class="red">losing you a bit of reputation.</span> `;
			} else {
				t += ` an incident without lasting effect. `;
			}
			repX(Math.trunc(FResultNumber * vignette.effect * 0.1), "vignette", slave);
			incomeStats.rep += Math.trunc(FResultNumber * vignette.effect * 0.1);
		}
	}

	// Close Vignettes

	// Open Facility Decorations

	if (V.farmyardDecoration !== "standard") {
		const fsGain = Math.min(0.0001 * V.FSSingleSlaveRep * (food), 1);
		switch (V.farmyardDecoration) {
			case "Roman Revivalist":
				arcology.FSRomanRevivalist = Math.clamp(arcology.FSRomanRevivalist += fsGain, 0, 100);
				break;
			case "Aztec Revivalist":
				arcology.FSAztecRevivalist = Math.clamp(arcology.FSAztecRevivalist += fsGain, 0, 100);
				break;
			case "Egyptian Revivalist":
				arcology.FSEgyptianRevivalist = Math.clamp(arcology.FSEgyptianRevivalist += fsGain, 0, 100);
				break;
			case "Edo Revivalist":
				arcology.FSEdoRevivalist = Math.clamp(arcology.FSEdoRevivalist += fsGain, 0, 100);
				break;
			case "Arabian Revivalist":
				arcology.FSArabianRevivalist = Math.clamp(arcology.FSArabianRevivalist += fsGain, 0, 100);
				break;
			case "Chinese Revivalist":
				arcology.FSChineseRevivalist = Math.clamp(arcology.FSChineseRevivalist += fsGain, 0, 100);
				break;
			case "Chattel Religionist":
				arcology.FSChattelReligionist = Math.clamp(arcology.FSChattelReligionist += fsGain, 0, 100);
				break;
			case "Degradationist":
				arcology.FSDegradationist = Math.clamp(arcology.FSDegradationist += fsGain, 0, 100);
				break;
			case "Repopulation Focus":
				arcology.FSRepopulationFocus = Math.clamp(arcology.FSRepopulationFocus += fsGain, 0, 100);
				break;
			case "Eugenics":
				arcology.FSRestart = Math.clamp(arcology.FSRestart += fsGain, 0, 100);
				break;
			case "Asset Expansionist":
				arcology.FSAssetExpansionist = Math.clamp(arcology.FSAssetExpansionist += fsGain, 0, 100);
				break;
			case "Transformation Fetishist":
				arcology.FSTransformationFetishist = Math.clamp(arcology.FSTransformationFetishist += fsGain, 0, 100);
				break;
			case "Gender Radicalist":
				arcology.FSGenderRadicalist = Math.clamp(arcology.FSGenderRadicalist += fsGain, 0, 100);
				break;
			case "Gender Fundamentalist":
				arcology.FSGenderFundamentalist = Math.clamp(arcology.FSGenderFundamentalist += fsGain, 0, 100);
				break;
			case "Physical Idealist":
				arcology.FSPhysicalIdealist = Math.clamp(arcology.FSPhysicalIdealist += fsGain, 0, 100);
				break;
			case "Hedonistic":
				arcology.FSHedonisticDecadence = Math.clamp(arcology.FSHedonisticDecadence += fsGain, 0, 100);
				break;
			case "Supremacist":
				arcology.FSSupremacist = Math.clamp(arcology.FSSupremacist += fsGain, 0, 100);
				break;
			case "Subjugationist":
				arcology.FSSubjugationist = Math.clamp(arcology.FSSubjugationist += fsGain, 0, 100);
				break;
			case "Paternalist":
				arcology.FSPaternalist = Math.clamp(arcology.FSPaternalist += fsGain, 0, 100);
				break;
			case "Pastoralist":
				arcology.FSPastoralist = Math.clamp(arcology.FSPastoralist += fsGain, 0, 100);
				break;
			case "Maturity Preferentialist":
				arcology.FSMaturityPreferentialist = Math.clamp(arcology.FSMaturityPreferentialist += fsGain, 0, 100);
				break;
			case "Youth Preferentialist":
				arcology.FSYouthPreferentialist = Math.clamp(arcology.FSYouthPreferentialist += fsGain, 0, 100);
				break;
			case "Body Purist":
				arcology.FSBodyPurist = Math.clamp(arcology.FSBodyPurist += fsGain, 0, 100);
				break;
			case "Slimness Enthusiast":
				arcology.FSSlimnessEnthusiast = Math.clamp(arcology.FSSlimnessEnthusiast += fsGain, 0, 100);
				break;
			case "Slave Professionalism":
				arcology.FSSlaveProfessionalism = Math.clamp(arcology.FSSlaveProfessionalism += fsGain, 0, 100);
				break;
			case "Intellectual Dependency":
				arcology.FSIntellectualDependency = Math.clamp(arcology.FSIntellectualDependency += fsGain, 0, 100);
				break;
			case "Petite Admiration":
				arcology.FSPetiteAdmiration = Math.clamp(arcology.FSPetiteAdmiration += fsGain, 0, 100);
				break;
			case "Statuesque Glorification":
				arcology.FSStatuesqueGlorification = Math.clamp(arcology.FSStatuesqueGlorification += fsGain, 0, 100);
				break;
		}
	}
	return t;
};

repo_name: KnightBoulegard/fc

license: mit


code:
App.EndWeek.servantsQuartersReport = function() {
	let frag = document.createDocumentFragment();

	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.servantsQuarters);
	const devBonus = (V.servantsQuartersDecoration !== "standard") ? 1 : 0;
	let stewardessBonus = 0;

	function stewardessText() {
		let r = [];
		let FLsFetish = 0;
		let stewardessImpregnated = 0;

		if (S.Stewardess) {
			S.Stewardess.devotion += devBonus;
			if (S.Stewardess.health.condition < -80) {
				improveCondition(S.Stewardess, 20);
			} else if ((S.Stewardess.health.condition < -40)) {
				improveCondition(S.Stewardess, 15);
			} else if ((S.Stewardess.health.condition < 0)) {
				improveCondition(S.Stewardess, 10);
			} else if ((S.Stewardess.health.condition < 90)) {
				improveCondition(S.Stewardess, 7);
			}
			if (S.Stewardess.devotion <= 60) {
				S.Stewardess.devotion++;
			}
			if (S.Stewardess.trust < 60) {
				S.Stewardess.trust++;
			}
			if (S.Stewardess.fetishStrength <= 95) {
				if (S.Stewardess.fetish !== "dom") {
					if (fetishChangeChance(S.Stewardess) > jsRandom(0, 100)) {
						FLsFetish = 1;
						S.Stewardess.fetishKnown = 1;
						S.Stewardess.fetish = "dom";
					}
				} else if (S.Stewardess.fetishKnown === 0) {
					FLsFetish = 1;
					S.Stewardess.fetishKnown = 1;
				} else {
					FLsFetish = 2;
					S.Stewardess.fetishStrength += 4;
				}
			}
			if (S.Stewardess.rules.living !== "luxurious") {
				S.Stewardess.rules.living = "luxurious";
			}

			const {He, he, His, his, him, wife} = getPronouns(S.Stewardess);
			r.push(`${SlaveFullName(S.Stewardess)} is serving as your Stewardess.`);
			if (S.Stewardess.relationship === -3 && S.Stewardess.devotion > 50) {
				r.push(`${He} does ${his} best to be your perfect lovely house${wife}.`);
			}
			if (V.stewardessImpregnates === 1 && canPenetrate(S.Stewardess) && S.Stewardess.pubertyXY === 1) {
				for (const slave of slaves) {
					if (canImpreg(slave, S.Stewardess)) { // FIXME: assumes vaginal pregnancy without check
						seX(S.Stewardess, "penetrative", slave, "vaginal", 10);
						r.push(knockMeUp(slave, 100, 2, S.Stewardess.ID));
						if (slave.vagina === 0) {
							slave.vagina = 1; // FIXME: silent virginity loss?
						}
						stewardessImpregnated++;
						slave.need = 0;
					}
				}
				if (stewardessImpregnated > 0) {
					r.push(`It's ${his} responsibility to keep ${his} charges pregnant, so`);
					if (stewardessImpregnated === 1) {
						r.push(`${he} cums in the only fertile slave's pussy all week.`);
					} else {
						r.push(`${he} ensures the ${stewardessImpregnated} fertile servants are full of ${his} cum at all times.`);
					}
					if (S.Stewardess.career === "a breeding bull") {
						r.push(`${He} was conditioned to fill empty wombs, so ${he} takes a <span class="hotpink">deep pleasure</span> in ${his} job.`);
						S.Stewardess.devotion++;
					}
					S.Stewardess.need = 0;
				}
			}
			if (FLsFetish === 1) {
				r.push(`${He}'s allowed and even expected to use ${his} charges for ${his} own gratification, and sometimes they'll even instigate submissive sex with ${him} just to ingratiate themselves. ${He} becomes comfortable with the role of a sexual dominant.`);
			} else if (FLsFetish === 2) {
				r.push(`Having a legion of servants jumping to obey ${his} daily commands <span class="lightsalmon">makes ${him} more dominant.</span>`);
			}
			if (S.Stewardess.health.condition < 10) {
				r.push(`Though ${he} tries to watch the servants, ${his} lack of good health inhibits ${him}.`);
			} else if (S.Stewardess.health.condition < 80) {
				stewardessBonus += 50;
				r.push(`${His} good health allows ${him} to work long hours and <span class="yellowgreen">drive</span> the servants hard.`);
			} else {
				stewardessBonus += 75;
				r.push(`${His} perfect health allows ${him} to work exhaustive hours and <span class="yellowgreen">drive</span> the servants very hard.`);
			}
			if (setup.stewardessCareers.includes(S.Stewardess.career)) {
				stewardessBonus += 25;
				r.push(`${He} has applicable experience with daily sums and organizational trifles from ${his} life before ${he} was a slave.`);
			} else if (S.Stewardess.skill.stewardess >= V.masteredXP) {
				stewardessBonus += 25;
				r.push(`${He} has applicable experience with daily sums and organizational trifles from working for you.`);
			} else {
				S.Stewardess.skill.stewardess += jsRandom(1, Math.ceil((S.Stewardess.intelligence + S.Stewardess.intelligenceImplant) / 15) + 8);
			}
			if (S.Stewardess.actualAge > 35) {
				stewardessBonus += 25;
				r.push(`${His} age and experience give ${him} added effectiveness.`);
			} else if (V.AgePenalty === 0) {
				stewardessBonus +=25;
			}
			if (S.Stewardess.intelligence + S.Stewardess.intelligenceImplant > 15) {
				stewardessBonus += S.Stewardess.intelligence + S.Stewardess.intelligenceImplant;
				r.push(`${He}'s smart enough that ${he} misses very little.`);
			}
			const bonusToggle = S.Stewardess.energy > 95 || (S.Stewardess.fetishKnown === 1 && S.Stewardess.fetish === "dom");
			for (const slave of slaves) {
				const {he2, him2, his2} = getPronouns(slave).appendSuffix('2');
				if (S.Stewardess.rivalryTarget === slave.ID) {
					r.push(`${He} bears down on ${his} ${rivalryTerm(S.Stewardess)}, ${slave.slaveName}, forcing ${him2} to work extra hard or suffer punishment.`);
					slave.devotion--;
					slave.trust--;
					if (jsRandom(1, 100) > 65) {
						S.Stewardess.rivalry++;
						slave.rivalry++;
					}
				} else if (S.Stewardess.relationshipTarget === slave.ID) {
					r.push(`${He} dotes over ${his} ${relationshipTerm(S.Stewardess)}}, _${slave.slaveName}, making sure ${he2} knows how to do a good job and keeping ${him2} well stocked with everything ${he2} needs.`);
					slave.devotion++;
				} else if (areRelated(S.Stewardess, slave)) {
					r.push(`${He} pays special attention to ${his} ${relativeTerm(S.Stewardess, slave)}, ${slave.slaveName}, making sure ${he2} doesn't slack off just because they are related.`);
					slave.trust++;
				}
				switch (slave.prestigeDesc) {
					case "$He is a famed Free Cities whore, and commands top prices.":
						r.push(`${He} does ${his} best to motivate the famous whore, ${slave.slaveName}, though ${he} is uncertain why ${he2} is here.`);
						break;
					case "$He is a famed Free Cities slut, and can please anyone.":
						r.push(`${He} ignores ${his} duties in order the fawn over the famous entertainer, ${slave.slaveName}.`);
						break;
					case "$He is remembered for winning best in show as a cockmilker.":
						if ((slave.dick !== 0) && (slave.balls !== 0) && (slave.prostate > 1)) {
							r.push(`${slave.slaveName} leaves a trail of cum wherever ${he2} goes and frequently stops to masturbate, greatly annoying ${S.Stewardess.slaveName}.`);
							if (jsRandom(1, 100) > 90 && S.Stewardess.rivalry === 0 && slave.rivalry === 0) {
								S.Stewardess.rivalryTarget = slave.ID;
								S.Stewardess.rivalry++;
								slave.rivalryTarget = S.Stewardess.ID;
								slave.rivalry++;
							}
						}
						break;
					case "$He is remembered for winning best in show as a dairy cow.":
						if ((slave.lactation > 0) && ((slave.boobs-slave.boobsImplant) > 6000)) {
							r.push(`${slave.slaveName}'s huge breasts frequently get in the way of ${his2} work and ${he2} leaks milk everywhere, greatly annoying ${S.Stewardess.slaveName}.`);
							if (jsRandom(1, 100) > 90 && S.Stewardess.rivalry === 0 && slave.rivalry === 0) {
								S.Stewardess.rivalryTarget = slave.ID;
								S.Stewardess.rivalry++;
								slave.rivalryTarget = S.Stewardess.ID;
								slave.rivalry++;
							}
						}
						break;
					case "$He is remembered for winning best in show as a breeder.":
						if (slave.bellyPreg >= 10000) {
							r.push(`${slave.slaveName}'s big pregnant belly frequently gets in the way of ${his2} work. However, ${S.Stewardess.slaveName} is willing to overlook it, as well as allow ${him2} easy jobs, due to how valuable ${his2} womb is.`);
						}
						break;
				}
				if (bonusToggle && slave.devotion < 45) {
					slave.devotion += 5;
				}
			}
			if (slaves.length > 0) {
				if (S.Stewardess.fetishKnown === 1 && S.Stewardess.fetish === "dom") {
					r.push(`${He} walks among the cowering servants as a queen among peasants, playing the role of a dominant to perfection and increasing ${his} charges' <span class="hotpink">obedience.</span>`);
				} else if (S.Stewardess.energy > 95) {
					r.push(`${He} walks among the cowering servants looking for an excuse to extract sex from shirkers as <span class="hotpink">punishment.</span>`);
				}
				cashX(stewardessBonus * slaves.length, "servantsQuarters", S.Stewardess);
			}
			if (V.arcologies[0].FSRestart !== "unset" && stewardessImpregnated > 0 && V.eugenicsFullControl !== 1) {
				r.push(`<br>The Societal Elite know you've ordered ${S.Stewardess.slaveName} to impregnate your maids. <span class="red">They are not amused by your disinterest in eugenics.</span>`);
				V.failedElite += 10;
			}
		}
		return r.join(' ');
	}

	/** Generate (and return, if not silent) the "standard" part of the slave report
	 * @param {App.Entity.SlaveState} slave
	 * @param {boolean} silent
	 * @returns {HTMLElement|null}
	 */
	function standardSlaveReport(slave, silent) {
		const clothes = App.SlaveAssignment.choosesOwnClothes(slave);
		tired(slave);
		const rules = App.UI.DOM.renderPassage("SA rules");
		const diet = App.UI.DOM.renderPassage("SA diet");
		const ltEffects = App.UI.DOM.renderPassage("SA long term effects");
		const drugs = App.SlaveAssignment.drugs(slave);
		const relationships = App.UI.DOM.renderPassage("SA relationships");
		const rivalries = App.UI.DOM.renderPassage("SA rivalries");
		const devotion = App.UI.DOM.renderPassage("SA devotion");
		if (!silent) {
			const content = App.UI.DOM.makeElement("div", '', "indent");
			$(content).append(clothes, rules, diet, ltEffects, drugs, relationships, rivalries, document.createElement('br'), devotion);
			return content;
		}
	}

	const stewardessEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent");
	$(stewardessEffects).append(stewardessText());

	if (slaves.length > 0) {
		const intro = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		let r = [];
		if (slaves.length > 1) {
			r.push(`<strong>There are ${slaves.length} slaves working out of the servants' quarters.</strong> They work to`);
		} else {
			const {He} = getPronouns(slaves[0]);
			r.push(`<strong>There is one slave working out of the servants' quarters.</strong> ${He} works to`);
		}
		r.push(`<span class="yellowgreen">reduce</span> your household expenses; having a well-staffed house slightly <span class="green">increases</span> your reputation.`);
		$(intro).append(r.join(' '));
	}

	if (S.Stewardess) {
		/** @type {App.Entity.SlaveState} */
		const slave = S.Stewardess;
		V.i = V.slaveIndices[slave.ID];
		App.Utils.setLocalPronouns(slave); // need this for the includes
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0) {
			const stewardessEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			if (V.seeImages && V.seeReportImages) {
				App.UI.DOM.appendNewElement("div", stewardessEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]);
			}
			$(stewardessEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Stewardess.`);
			$(stewardessEntry).append(standardSlaveReport(slave, false));
		} else {
			standardSlaveReport(slave, true);
		}
	}

	V.servantMilkersMultiplier = 0.5;
	let SQMilk = 0;
	let SQMilkSale = 0;

	for (const slave of slaves) {
		V.i = V.slaveIndices[slave.ID];
		slave.devotion += devBonus;
		if (slave.devotion <= 20 && slave.trust >= -20) {
			slave.devotion -= 5;
			slave.trust -= 5;
		} else if (slave.devotion <= 10) {
			slave.devotion += 2;
		} else if (slave.devotion >= 80) {
			slave.devotion -= 2;
		}
		if (slave.devotion < -20) {
			slave.trust += 3;
		} else if (slave.trust < -50) {
			slave.trust += 2;
		} else if (slave.trust < -30) {
			slave.trust += 1;
		}
		if (slave.health.condition < -80) {
			improveCondition(slave, 20);
		} else if (slave.health.condition < -40) {
			improveCondition(slave, 10);
		} else if (slave.health.condition < 0) {
			improveCondition(slave, 7);
		} else if (slave.health.condition < 90) {
			improveCondition(slave, 3);
		}
		switch (V.servantsQuartersDecoration) {
			case "Arabian Revivalist":
			case "Aztec Revivalist":
			case "Chattel Religionist":
			case "Chinese Revivalist":
			case "Degradationist":
			case "Edo Revivalist":
			case "Egyptian Revivalist":
			case "Roman Revivalist":
			case "Subjugationist":
			case "Supremacist":
				slave.rules.living = "spare";
				break;
			case "Slave Professionalism":
				if (slave.intelligence+slave.intelligenceImplant > 15) {
					slave.rules.living = "normal";
				} else {
					slave.rules.living = "spare";
				}
				break;
			case "Petite Admiration":
			case "Statuesque Glorification":
				if (heightPass(slave)) {
					slave.rules.living = "normal";
				} else {
					slave.rules.living = "spare";
				}
				break;
			default:
				slave.rules.living = "normal";
		}

		App.Utils.setLocalPronouns(slave); // need this for the includes
		if (V.showEWD !== 0) {
			const {He} = getPronouns(slave);
			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			if (V.seeImages && V.seeReportImages) {
				App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]);
			}
			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
			if (slave.choosesOwnAssignment === 2) {
				$(slaveEntry).append(App.UI.DOM.renderPassage("SA chooses own job"));
			} else {
				$(slaveEntry).append(`is working out of ${V.servantsQuartersName}.`);
			}
			const servantContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
			$(servantContent).append(`${He} ${App.SlaveAssignment.servant(slave, stewardessBonus)}`);
			if ((V.servantMilkers === 1) && (slave.lactation > 0)) {
				const milkContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
				$(milkContent).append(`${He} ${App.SlaveAssignment.getMilked(slave)}`);
				SQMilk += V.milk;
				SQMilkSale += V.milkSale;
			}
			$(slaveEntry).append(standardSlaveReport(slave, false));
		} else {
			// discard return values silently
			App.SlaveAssignment.servant(slave, stewardessBonus);
			if ((V.servantMilkers === 1) && (slave.lactation > 0)) {
				App.SlaveAssignment.getMilked(slave);
				SQMilk += V.milk;
				SQMilkSale += V.milkSale;
			}
			standardSlaveReport(slave, true);
		}
	}

	if (SQMilk > 0) {
		const milkEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		$(milkEffects).append(`Since your lactating servants spend most of their time working in the penthouse, they use the milkers there, giving ${SQMilk} liters of milk over the week, which is sold for ${cashFormat(SQMilkSale)}.`);
	}

	if (V.servantsQuartersDecoration !== "standard") {
		const decorationEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		$(decorationEffects).append(`${V.servantsQuartersNameCaps}'s ${V.servantsQuartersDecoration} atmosphere <span class="hotpink">has a minor impact on your servants.</span>`);
	}

	V.servantMilkersMultiplier = 1;
	repX(slaves.length * 20, "servantsQuarters");

	return frag;
};


code:
/**
 * @param {ParentNode} renderContainer
 */
App.EndWeek.computeSexualServicesModel = function(renderContainer) {
	const arcology = V.arcologies[0];

	/* Sexual services demand per class */
	/* We can add milk etc. to this as well, though this is a good that can be traded beyond the arcology and also needs its own market much like the slavemarket. TODO */
	/* In the default scenario these numbers indicate the amount of money each individual citizen of a particular class is looking to spend on sex (and milk) every week
	Depending on the conditions they may derive more or less 'utility' out of their credits spent
	i.e. a highly paternalist arcology with little choice for its lower class but Fuckdolls may still put money into them but not get the same satisfaction out of it*/
	/* Low rent increases demand/available money for sexual services, high rent decreases it */
	if (V.brothelBoost.selected > 0 && V.rep < V.brothelBoost.selected * 500 + 2000) {
		V.brothelBoost.eligible = Math.trunc((V.rep - 2000) / 500);
		if (V.brothelBoost.eligible < 0) {
			V.brothelBoost.eligible = 0;
		}
	} else {
		V.brothelBoost.eligible = V.brothelBoost.selected;
	}
	repX(forceNeg(50 * V.brothelBoost.eligible), "brothel");

	let lowerClassSexDemand = Math.trunc(V.lowerClass * V.whoreBudget.lowerClass) * 2,
		lowerClassSexDemandRef = Math.max(lowerClassSexDemand, 1),
		visitorsSexDemand = Math.trunc(V.visitors) * 40,
		middleClassSexDemand = Math.trunc(V.middleClass * V.whoreBudget.middleClass + visitorsSexDemand * 0.5) * 2,
		middleClassSexDemandRef = Math.max(middleClassSexDemand, 1),
		upperClassSexDemand = Math.trunc(V.upperClass * V.whoreBudget.upperClass + visitorsSexDemand * 0.5) * 2,
		upperClassSexDemandRef = Math.max(upperClassSexDemand, 1),
		topClassSexDemand = Math.trunc(V.topClass * V.whoreBudget.topClass) * 2,
		topClassSexDemandRef = Math.max(topClassSexDemand, 1),
		arcadeSupply = {lowerClass: 0, middleClass: 0, upperClass: 0},
		clubSupply = {lowerClass: 0, middleClass: 0};

	V.whorePriceAdjustment = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0};
	V.NPCMarketShare = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0};
	V.sexDemandResult = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0};
	V.slaveJobValues = slaveJobValues(lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef);

	let lowerClassArcadeSexDemand = 0;
	let middleClassArcadeSexDemand = 0;
	let upperClassArcadeSexDemand = 0;
	let arcadeDemand = 0;
	let arcadeDemandDeg = 0;
	// Arcade Specific Demand for Degradationists to give it higher priority
	if (arcology.FSDegradationist !== "unset") {
		lowerClassArcadeSexDemand = Math.trunc(lowerClassSexDemand * arcology.FSDegradationist * 0.0015);
		middleClassArcadeSexDemand = Math.trunc(middleClassSexDemand * arcology.FSDegradationist * 0.0002);
		upperClassArcadeSexDemand = Math.trunc(upperClassSexDemand * arcology.FSDegradationist * 0.000025);
		arcadeDemandDeg = lowerClassArcadeSexDemand + middleClassArcadeSexDemand + upperClassArcadeSexDemand;
		if (arcology.FSDegradationistLaw === 1) {
			arcadeDemandDeg += V.ASlaves * 3;
		}
		if (V.slaveJobValues.arcade < arcadeDemandDeg) {
			if (arcadeDemandDeg > 20000 || arcology.FSDegradationist > 50) {
				const degradationistPenalty = ((arcadeDemandDeg - V.slaveJobValues.arcade) / arcadeDemandDeg);
				arcology.FSDegradationist -= Math.trunc(5 * degradationistPenalty);
				repX(forceNeg(100 * degradationistPenalty), "futureSocieties");
				V.arcadeDemandDegResult = degradationistPenalty > 0.5 ? 1 : 2;
			} else {
				V.arcadeDemandDegResult = 3;
			}
			arcadeSupply.lowerClass += Math.trunc(1.15 * V.slaveJobValues.arcade * (lowerClassArcadeSexDemand / arcadeDemandDeg));
			lowerClassSexDemand -= arcadeSupply.lowerClass;
			arcadeSupply.middleClass += Math.trunc(1.15 * V.slaveJobValues.arcade * (middleClassArcadeSexDemand / arcadeDemandDeg));
			middleClassSexDemand -= arcadeSupply.middleClass;
			arcadeSupply.upperClass += Math.trunc(1.15 * V.slaveJobValues.arcade * (upperClassArcadeSexDemand / arcadeDemandDeg));
			upperClassSexDemand -= arcadeSupply.upperClass; // There's a 15% satisfaction bonus from getting release in a societally approved way
		} else {
			if (V.slaveJobValues.arcade >= arcadeDemandDeg * 1.5) {
				arcology.FSDegradationist += 2;
				V.arcadeDemandDegResult = 4;
				repX(500, "futureSocieties");
			} else {
				V.arcadeDemandDegResult = 5;
			}
			arcadeSupply.lowerClass += Math.trunc(1.15 * lowerClassArcadeSexDemand);
			lowerClassSexDemand -= arcadeSupply.lowerClass;
			arcadeSupply.middleClass += Math.trunc(1.15 * middleClassArcadeSexDemand);
			middleClassSexDemand -= arcadeSupply.middleClass;
			arcadeSupply.upperClass += Math.trunc(1.15 * upperClassArcadeSexDemand);
			upperClassSexDemand -= arcadeSupply.upperClass;
		}
	} else {
		arcadeDemandDeg = 0;
	}

	// Public slut sex supply. Top and upper class won't partake
	let clubDemand = lowerClassSexDemand + middleClassSexDemand;
	let lowerClassClubRatio = lowerClassSexDemand / clubDemand;
	let middleClassClubRatio = middleClassSexDemand / clubDemand;

	if (V.slaveJobValues.club * V.slaveJobValues.clubSP < clubDemand) {
		lowerClassSexDemand -= Math.trunc(V.slaveJobValues.club * V.slaveJobValues.clubSP * lowerClassClubRatio);
		middleClassSexDemand -= Math.trunc(V.slaveJobValues.club * V.slaveJobValues.clubSP * middleClassClubRatio);
	} else {
		lowerClassSexDemand = 0;
		middleClassSexDemand = 0;
	}

	clubSupply.lowerClass = Math.trunc(V.slaveJobValues.club * V.slaveJobValues.clubSP * lowerClassClubRatio);
	clubSupply.middleClass = Math.trunc(V.slaveJobValues.club * V.slaveJobValues.clubSP * middleClassClubRatio);

	// Brothel or street whore sex supply
	if (lowerClassSexDemand < V.slaveJobValues.brothel.lowerClass) {
		V.whorePriceAdjustment.lowerClass = Math.max(Math.pow(lowerClassSexDemand / (V.slaveJobValues.brothel.lowerClass + V.NPCSexSupply.lowerClass), 1.513), 0.3);
		lowerClassSexDemand = 0; // This accounts for people having too much choice and getting more picky how they spend their money
	} else {
		V.whorePriceAdjustment.lowerClass = Math.pow(lowerClassSexDemand / (V.slaveJobValues.brothel.lowerClass + V.NPCSexSupply.lowerClass), 0.5);
		lowerClassSexDemand -= V.slaveJobValues.brothel.lowerClass; // People are willing to pay more for a scarce good, but within reason
	}
	if (middleClassSexDemand < V.slaveJobValues.brothel.middleClass) {
		V.whorePriceAdjustment.middleClass = Math.max(Math.pow((middleClassSexDemand * 1.1) / (V.slaveJobValues.brothel.middleClass + V.NPCSexSupply.middleClass), 1.513), 0.33);
		middleClassSexDemand = 0;
	} else {
		V.whorePriceAdjustment.middleClass = Math.pow((middleClassSexDemand * 1.1) / (V.slaveJobValues.brothel.middleClass + V.NPCSexSupply.middleClass), 0.5);
		middleClassSexDemand -= V.slaveJobValues.brothel.middleClass;
	}
	if (upperClassSexDemand < V.slaveJobValues.brothel.upperClass) {
		V.whorePriceAdjustment.upperClass = Math.max(Math.pow((upperClassSexDemand * 1.21) / (V.slaveJobValues.brothel.upperClass + V.NPCSexSupply.upperClass), 1.513), 0.363);
		upperClassSexDemand = 0;
	} else {
		V.whorePriceAdjustment.upperClass = Math.pow((upperClassSexDemand * 1.21) / (V.slaveJobValues.brothel.upperClass + V.NPCSexSupply.upperClass), 0.5);
		upperClassSexDemand -= V.slaveJobValues.brothel.upperClass;
	}
	if (topClassSexDemand < V.slaveJobValues.brothel.topClass) {
		V.whorePriceAdjustment.topClass = Math.max(Math.pow((topClassSexDemand * 1.331) / (V.slaveJobValues.brothel.topClass + V.NPCSexSupply.topClass), 1.513), 0.3993);
		topClassSexDemand = 0;
	} else {
		V.whorePriceAdjustment.topClass = Math.pow((topClassSexDemand * 1.331) / (V.slaveJobValues.brothel.topClass + V.NPCSexSupply.topClass), 0.5);
		topClassSexDemand -= V.slaveJobValues.brothel.topClass;
	}

	// Price for sex in the arcade or at a glory hole
	if (arcology.FSPaternalist !== "unset") {
		arcadeDemand = Math.max((arcadeDemandDeg + lowerClassSexDemand) * (1 - arcology.FSPaternalist / 50), 0); // Paternalists sap demand for the arcade
	} else {
		arcadeDemand = arcadeDemandDeg + lowerClassSexDemand;
	}
	if (V.slaveJobValues.arcade + V.NPCSexSupply.lowerClass > 0) {
		V.arcadePrice = Math.clamp(Math.pow((arcadeDemand / (V.slaveJobValues.arcade + V.NPCSexSupply.lowerClass)), 0.5), 0.5, 3); // This calculates the price charged per fuck
	} else {
		V.arcadePrice = 0.5; // minimum price no matter what
	}

	// Arcade usage beyond degradationist demand
	if (arcology.FSDegradationist !== "unset") {
		if (V.slaveJobValues.arcade > arcadeDemandDeg) {
			V.slaveJobValues.arcade -= arcadeDemandDeg;
		} else {
			V.slaveJobValues.arcade = 0;
		}
	}
	if (V.slaveJobValues.arcade > lowerClassSexDemand) {
		lowerClassSexDemand = 0;
	} else {
		lowerClassSexDemand -= V.slaveJobValues.arcade;
	}
	arcadeSupply.lowerClass += V.slaveJobValues.arcade;

	// NPC sex supply
	V.NPCSexSupply = NPCSexSupply(lowerClassSexDemand, lowerClassSexDemandRef, middleClassSexDemand, middleClassSexDemandRef, upperClassSexDemand, upperClassSexDemandRef, topClassSexDemand, topClassSexDemandRef);
	V.NPCMarketShare.lowerClass = Math.trunc((V.NPCSexSupply.lowerClass * 1000) / lowerClassSexDemandRef);
	V.NPCMarketShare.middleClass = Math.trunc((V.NPCSexSupply.middleClass * 1000) / middleClassSexDemandRef);
	V.NPCMarketShare.upperClass = Math.trunc((V.NPCSexSupply.upperClass * 1000) / upperClassSexDemandRef);
	V.NPCMarketShare.topClass = Math.trunc((V.NPCSexSupply.topClass * 1000) / topClassSexDemandRef);
	if (lowerClassSexDemand < V.NPCSexSupply.lowerClass) {
		lowerClassSexDemand = 0;
	} else {
		lowerClassSexDemand -= V.NPCSexSupply.lowerClass;
	}

	if (middleClassSexDemand < V.NPCSexSupply.middleClass) {
		middleClassSexDemand = 0;
	} else {
		middleClassSexDemand -= V.NPCSexSupply.middleClass;
	}

	if (upperClassSexDemand < V.NPCSexSupply.upperClass) {
		upperClassSexDemand = 0;
	} else {
		upperClassSexDemand -= V.NPCSexSupply.upperClass;
	}

	if (topClassSexDemand < V.NPCSexSupply.topClass) {
		topClassSexDemand = 0;
	} else {
		topClassSexDemand -= V.NPCSexSupply.topClass;
	}

	if ((V.cheatMode === 1) || (V.debugMode === 1)) {
		_printDebugInfo(renderContainer);
	}

	// Sexual satisfaction effects
	V.sexDemandResult.lowerClass = Math.trunc(((V.NPCSexSupply.lowerClass + V.slaveJobValues.brothel.lowerClass + clubSupply.lowerClass + arcadeSupply.lowerClass) * 1000) / lowerClassSexDemandRef);
	V.sexDemandResult.middleClass = Math.trunc(((V.NPCSexSupply.middleClass + V.slaveJobValues.brothel.middleClass + clubSupply.middleClass + arcadeSupply.middleClass) * 1000) / middleClassSexDemandRef);
	V.sexDemandResult.upperClass = Math.trunc(((V.NPCSexSupply.upperClass + V.slaveJobValues.brothel.upperClass + arcadeSupply.upperClass) * 1000) / upperClassSexDemandRef);
	V.sexDemandResult.topClass = Math.trunc(((V.NPCSexSupply.topClass + V.slaveJobValues.brothel.topClass) * 1000) / topClassSexDemandRef);

	if (V.sexDemandResult.lowerClass < 400) { // You are providing < 40% of their desired amount of sex
		if (V.week <= 30) {
			V.classSatisfied.lowerClass = 0;
		} else {
			V.classSatisfied.lowerClass = -1;
		}
	} else if (V.sexDemandResult.lowerClass < 600) { // You are providing between 40 and 60% of their desired amount of sex
		if (V.week <= 40) {
			V.classSatisfied.lowerClass = 1;
		} else if (V.week <= 60) {
			V.classSatisfied.lowerClass = 0;
		} else {
			V.classSatisfied.lowerClass = -1;
		}
	} else if (V.sexDemandResult.lowerClass < 800) { // You are providing between 60 and 80% of their desired amount of sex
		if (V.week <= 50) {
			V.classSatisfied.lowerClass = 1;
		} else {
			V.classSatisfied.lowerClass = 0;
		}
	} else if (V.sexDemandResult.lowerClass === 1000) { // You are providing 100% or more of their desired amount of sex
		V.classSatisfied.lowerClass = 2;
	} else { // You are providing > 80% of their desired amount of sex
		V.classSatisfied.lowerClass = 1;
	}

	if (V.sexDemandResult.middleClass < 400) { // You are providing < 40% of their desired amount of sex
		if (V.week <= 30) {
			V.classSatisfied.middleClass = 0;
		} else {
			V.classSatisfied.middleClass = -1;
		}
	} else if (V.sexDemandResult.middleClass < 600) { // You are providing between 40 and 60% of their desired amount of sex
		if (V.week <= 40) {
			V.classSatisfied.middleClass = 1;
		} else if (V.week <= 60) {
			V.classSatisfied.middleClass = 0;
		} else {
			V.classSatisfied.middleClass = -1;
		}
	} else if (V.sexDemandResult.middleClass < 800) { // You are providing between 60 and 80% of their desired amount of sex
		if (V.week <= 50) {
			V.classSatisfied.middleClass = 1;
		} else {
			V.classSatisfied.middleClass = 0;
		}
	} else if (V.sexDemandResult.middleClass === 1000) { // You are providing 100% or more of their desired amount of sex
		V.classSatisfied.middleClass = 2;
	} else { // You are providing > 80% of their desired amount of sex
		V.classSatisfied.middleClass = 1;
	}

	if (V.sexDemandResult.upperClass < 400) { // You are providing < 40% of their desired amount of sex
		if (V.week <= 30) {
			V.classSatisfied.upperClass = 0;
		} else {
			V.classSatisfied.upperClass = -1;
		}
	} else if (V.sexDemandResult.upperClass < 600) { // You are providing between 40 and 60% of their desired amount of sex
		if (V.week <= 40) {
			V.classSatisfied.upperClass = 1;
		} else if (V.week <= 60) {
			V.classSatisfied.upperClass = 0;
		} else {
			V.classSatisfied.upperClass = -1;
		}
	} else if (V.sexDemandResult.upperClass < 800) { // You are providing between 60 and 80% of their desired amount of sex
		if (V.week <= 50) {
			V.classSatisfied.upperClass = 1;
		} else {
			V.classSatisfied.upperClass = 0;
		}
	} else if (V.sexDemandResult.upperClass === 1000) { // You are providing 100% or more of their desired amount of sex
		V.classSatisfied.upperClass = 2;
	} else { // You are providing > 80% of their desired amount of sex
		V.classSatisfied.upperClass = 1;
	}

	if (V.sexDemandResult.topClass < 400) { // You are providing < 40% of their desired amount of sex
		if (V.week <= 30) {
			V.classSatisfied.topClass = 0;
		} else {
			V.classSatisfied.topClass = -1;
		}
	} else if (V.sexDemandResult.topClass < 600) { // You are providing between 40 and 60% of their desired amount of sex
		if (V.week <= 40) {
			V.classSatisfied.topClass = 1;
		} else if (V.week <= 60) {
			V.classSatisfied.topClass = 0;
		} else {
			V.classSatisfied.topClass = -1;
		}
	} else if (V.sexDemandResult.topClass < 800) { // You are providing between 60 and 80% of their desired amount of sex
		if (V.week <= 50) {
			V.classSatisfied.topClass = 1;
		} else {
			V.classSatisfied.topClass = 0;
		}
	} else if (V.sexDemandResult.topClass === 1000) { // You are providing 100% or more of their desired amount of sex
		V.classSatisfied.topClass = 2;
	} else { // You are providing > 80% of their desired amount of sex
		V.classSatisfied.topClass = 1;
	}

	/**
	 * @param {ParentNode} c
	 */
	function _printDebugInfo(c) {
		c.append(document.createElement("br"));
		c.append("Slave services supply and demand this week:");

		const table = App.UI.DOM.appendNewElement("table", c, null, "finance");
		table.border = "1";
		const titleRow = App.UI.DOM.appendNewElement("tr", table);
		titleRow.align = "center";
		const tcl = App.UI.DOM.appendNewElement("th", titleRow, "Client's class");
		tcl.align = "right";
		App.UI.DOM.appendNewElement("th", titleRow, "Lower");
		App.UI.DOM.appendNewElement("th", titleRow, "Middle");
		App.UI.DOM.appendNewElement("th", titleRow, "Upper");
		App.UI.DOM.appendNewElement("th", titleRow, "Top");

		/**
		 *
		 * @param {string} caption
		 * @param {number} [lower]
		 * @param {number} [middle]
		 * @param {number} [upper]
		 * @param {number} [top]
		 */
		function numericRow(caption, lower, middle, upper, top) {
			const row = App.UI.DOM.appendNewElement("tr", table);
			row.align = "right";
			App.UI.DOM.appendNewElement("td", row, caption);
			App.UI.DOM.appendNewElement("td", row, lower == null ? "N/A" : commaNum(lower));
			App.UI.DOM.appendNewElement("td", row, middle == null ? "N/A" : commaNum(middle));
			App.UI.DOM.appendNewElement("td", row, upper == null ? "N/A" : commaNum(upper));
			App.UI.DOM.appendNewElement("td", row, top == null ? "N/A" : commaNum(top));
		}

		numericRow("Demand", lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef);
		numericRow("Brothel Supply", V.slaveJobValues.brothel.lowerClass, V.slaveJobValues.brothel.middleClass, V.slaveJobValues.brothel.upperClass, V.slaveJobValues.brothel.topClass);
		if (clubSupply.lowerClass || clubSupply.middleClass) {
			numericRow("Club Supply", clubSupply.lowerClass, clubSupply.middleClass);
		}
		if (arcadeSupply.lowerClass || arcadeSupply.middleClass || arcadeSupply.upperClass) {
			numericRow("Arcade Supply", arcadeSupply.lowerClass, arcadeSupply.middleClass, arcadeSupply.upperClass);
		}
		numericRow("NPC Supply", V.NPCSexSupply.lowerClass, V.NPCSexSupply.middleClass, V.NPCSexSupply.upperClass, V.NPCSexSupply.topClass);
		numericRow("Unsatisfied", lowerClassSexDemand, middleClassSexDemand, upperClassSexDemand, topClassSexDemand);
	}
};