code:
App.EndWeek.rulesAssistantReport = function() {
	const frag = $(document.createDocumentFragment());
	for (const slave of V.slaves) {
		if (slave.useRulesAssistant === 1) {
			try {
				frag.append(DefaultRules(slave));
			} catch (e) {
				console.log("Exception thrown in rule evaluation:", slave, e);
				frag.append(`<p><span class="error">Exception thrown executing Rules Assistant for ${SlaveFullName(slave)}: "${e.message}". One of your rules is probably broken.</span></p>`);
			}
		}
	}
	return frag[0];
};


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

	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.schoolroom);
	const devBonus = (V.schoolroomDecoration !== "standard") ? 1 : 0;
	App.EndWeek.saVars.flSex = App.EndWeek.getFLSex(App.Entity.facilities.schoolroom);

	function schoolteacherText() {
		let r = [];
		let FLsFetish = 0;
		let idleBonus = 0;

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

			const {He, he, His, his, him, himself, wife} = getPronouns(S.Schoolteacher);
			r.push(`${SlaveFullName(S.Schoolteacher)} is serving as your Schoolteacher.`);
			if (S.Schoolteacher.relationship === -3 && S.Schoolteacher.devotion > 50) {
				r.push(`As your loving ${wife}, ${he} tries ${his} best to teach ${his} pupils how to please you.`);
			}
			if (FLsFetish === 1) {
				r.push(`${He}'s allowed and even expected to use ${his} students for ${his} own sexual gratification, and in their own way ${his} students are complicit, offering sexual favors for an easier time in the classroom. Before long, ${he}'s running a hungry eye over the tits and asses of new trainees; ${he} is now more dominant.`);
			} else if (FLsFetish === 2) {
				r.push(`Every new student in class is a new target for ${his} personal educational attention. <span class="lightsalmon">${He} becomes more dominant.</span>`);
			}
			if (App.Data.Careers.Leader.schoolteacher.includes(S.Schoolteacher.career)) {
				r.push(`${He} has experience with students and learning from ${his} life before ${he} was a slave, making ${him} more effective.`);
				idleBonus++;
			} else if (S.Schoolteacher.skill.teacher >= V.masteredXP) {
				r.push(`${He} has experience with students and learning from working for you, making ${him} more effective.`);
				idleBonus++;
			} else {
				const skillIncrease = jsRandom(1, Math.ceil((S.Schoolteacher.intelligence + S.Schoolteacher.intelligenceImplant) / 15) + 8);
				r.push(slaveSkillIncrease('teacher', S.Schoolteacher, skillIncrease));
			}
			if (S.Schoolteacher.visualAge > 35) {
				r.push(`${His} age earns ${him} the respect of ${his} students.`);
				idleBonus++;
			}
			if (S.Schoolteacher.intelligence > 15) {
				r.push(`${He}'s intelligent enough to be a good teacher.`);
				idleBonus++;
			}
			if (S.Schoolteacher.intelligenceImplant >= 15) {
				r.push(`Since ${he}'s educated ${himself}, ${he} understands`);
				if (V.schoolroomRemodelBimbo !== 0) {
					r.push(`how best to apply the new lesson plan.`);
				} else {
					r.push(`${his} students.`);
				}
				idleBonus++;
			}
			if (S.Schoolteacher.face > 40) {
				r.push(`${His} students want to be just like their beautiful teacher.`);
				idleBonus++;
			}
			if (S.Schoolteacher.accent >= 2) { // really accent === 2, because accent > 2 can't teach anyway
				r.push(`${He}'s been tasked with teaching ${V.language}, but ${he}'s barely understandable ${himself}.`);
				r.push(`This <span class="warning">slows ${his} students' progress</span> with the language.`);
				if (S.Schoolteacher.devotion > 50) {
					r.push(`${He} wants to do better, and devotes any extra time ${he} can find to improving ${his} own competency in ${V.language}.`);
					idleBonus--;
					if (S.Schoolteacher.intelligence + S.Schoolteacher.intelligenceImplant > random(-110, 110)) { // similar chances to saTakeClasses.speechLessons
						r.push(`This week, ${he} makes a breakthrough, <span class="improvement">reducing ${his} accent</span> to a clear, pleasant, exoticism.`);
						S.Schoolteacher.accent--;
					}
				}
			}

			for (const slave of slaves) {
				const {he2} = getPronouns(slave).appendSuffix('2');
				if (S.Schoolteacher.rivalryTarget === slave.ID) {
					r.push(`Ever since ${his} ${rivalryTerm(S.Schoolteacher)} was enrolled, ${he} began stalking the classroom carrying a large paddle, much to ${slave.slaveName}'s terror.`);
					slave.devotion -= 4;
					slave.trust -= 4;
					if (jsRandom(1, 100) > 35) {
						S.Schoolteacher.rivalry++;
						slave.rivalry++;
					}
				} else if (S.Schoolteacher.relationshipTarget === slave.ID) {
					r.push(`${He} dedicates most of ${his} attention to ${his} ${relationshipTerm(S.Schoolteacher)}, ${slave.slaveName}, making sure ${he2} understands that day's lesson.`);
					slave.devotion += 2;
					slave.trust += 2;
				} else if (areRelated(S.Schoolteacher, slave)) {
					r.push(`${He} makes sure to spend extra time teaching ${his} ${relativeTerm(S.Schoolteacher, slave)}, ${slave.slaveName}.`);
					slave.trust++;
				}
			}

			if (slaves.length < V.schoolroom && !slaveResting(S.Schoolteacher)) {
				const idlePay = jsRandom(1, 10) + ((V.schoolroom - slaves.length) * (jsRandom(150, 170) + (idleBonus * 10)));
				cashX(idlePay, "school", S.Schoolteacher);
				r.push(`
Since ${he} doesn't have enough students to occupy all of ${his} time, ${V.schoolroomName} takes in citizens' slaves on a contract basis and ${he} teaches them too, earning ${cashFormat(idlePay)}.
`);
			}

			return r.join(" ");
		}
	}

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

	if (slaves.length > 0) {
		const intro = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		if (slaves.length > 1) {
			$(intro).append(`<strong>There are ${slaves.length} slaves studying in ${V.schoolroomName}.</strong>`);
		} else {
			$(intro).append(`<strong>There is one slave studying in ${V.schoolroomName}.</strong>`);
		}
	}

	if (S.Schoolteacher) {
		const slave = App.SlaveAssignment.reportSlave(S.Schoolteacher);
		tired(slave);
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0) {
			const schoolteacherEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", schoolteacherEntry);
			App.SlaveAssignment.appendSlaveLinks(schoolteacherEntry, slave);
			$(schoolteacherEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Schoolteacher.`);
			schoolteacherEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	let restedSlaves = 0;
	for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
		slave.devotion += devBonus;
		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);
		}
		if (slave.rules.living !== "normal") {
			slave.rules.living = "normal";
		}
		/* Education done? Has to be here before we run the standard slave report or there will be double entries for slave */
		if (slave.fetish === "mindbroken") {
			if (V.assignmentRecords[slave.ID]) {
				assignJobSafely(slave, V.assignmentRecords[slave.ID]);
			} else {
				removeJob(slave, "learn in the schoolroom");
			}
			restedSlaves++;
			continue;
		} else if (	((slave.intelligenceImplant >= 30 && V.schoolroomRemodelBimbo !== 1) || (slave.intelligenceImplant <= -15 && V.schoolroomRemodelBimbo === 1)) &&
					((slave.voice === 0) || (slave.accent <= 1) || ((V.schoolroomUpgradeLanguage === 0) && (slave.accent <= 2))) &&
					((slave.skill.oral > 30) || ((V.schoolroomUpgradeSkills === 0) && (slave.skill.oral > 10))) &&
					((slave.skill.whoring > 30) || ((V.schoolroomUpgradeSkills === 0) && (slave.skill.whoring > 10))) &&
					((slave.skill.entertainment > 30) || ((V.schoolroomUpgradeSkills === 0) && (slave.skill.entertainment > 10))) &&
					((slave.skill.anal > 30) || ((V.schoolroomUpgradeSkills === 0) && (slave.skill.anal > 10))) &&
					((slave.skill.vaginal > 30) || ((V.schoolroomUpgradeSkills === 0) && (slave.skill.vaginal > 10)) || (slave.vagina < 0)) &&
					(!needsTutoring(slave))) {
			const reassignment = App.UI.DOM.appendNewElement("p", frag, '');
			const {he, his} = getPronouns(slave);
			let r = [];
			r.push(`<span class="slave-name">${slave.slaveName}</span> can learn little from further classes,`);
			r.push(`<span class="noteworthy">`);
			if (V.assignmentRecords[slave.ID]) {
				const oldJob = V.assignmentRecords[slave.ID];
				assignJobSafely(slave, oldJob);
				if (slave.choosesOwnAssignment === 1) {
					r.push(`and ${he} is resting before choosing another task.`);
				} else if (slave.assignment === Job.REST) {
					if (oldJob !== Job.REST) {
						r.push(`and since ${he} was unable to return to ${his} old task to ${oldJob}, ${his} assignment has defaulted to rest.`);
					} else {
						r.push(`so ${he} has returned to rest.`);
					}
				} else {
					// This needs to be set here or else it freaks out and returns errors. It also can't be defaulted without hiding issues, so we set something here.
					if (slave.assignment === Job.WHORE || slave.assignment === Job.BROTHEL) {
						slave.sexAmount = Math.trunc(Beauty(slave) / 5);
						slave.sexQuality = FResult(slave);
						slave.effectiveWhoreClass = effectiveWhoreClass(slave);
					}
					r.push(`so ${he} goes back to ${slave.assignment}.`);
				}
			} else {
				r.push(`so ${his} assignment has defaulted to rest.`);
				removeJob(slave, "learn in the schoolroom");
			}
			r.push(`</span>`);
			restedSlaves++;
			$(reassignment).append(r.join(" "));
			continue;
		}

		if (V.showEWD !== 0) {
			const {He} = getPronouns(slave);
			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
			if (slave.choosesOwnAssignment === 2) {
				$(slaveEntry).append(App.SlaveAssignment.choosesOwnJob(slave));
			} else {
				let leaderTraining = '';
				for (const role of Object.keys(V.slaveTutor)) {
					if (V.slaveTutor[role].contains(slave.ID)) {
						leaderTraining = ` on being a ${role}`; break;
					}
				}
				$(slaveEntry).append(`is studying in ${V.schoolroomName}${leaderTraining}.`);
			}
			const studentContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
			$(studentContent).append(`${He} ${App.SlaveAssignment.takeClasses(slave)}`);
			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			// discard return values silently
			App.SlaveAssignment.choosesOwnJob(slave);
			App.SlaveAssignment.takeClasses(slave);
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	if (restedSlaves > 0) {
		const rested = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		rested.append((restedSlaves === 1) ? `One slave has ` : `${restedSlaves} slaves have `);
		App.UI.DOM.appendNewElement("span", rested, "learned", "green");
		rested.append(` all they can, and will be released from the schoolroom before the end of the week.`);
	}

	if (V.schoolroomDecoration !== "standard") {
		const decorationEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent");
		$(decorationEffects).append(`${capFirstChar(V.schoolroomName)}'s ${V.schoolroomDecoration} atmosphere <span class="hotpink">has a minor impact on the students.</span>`);
		if (App.Entity.facilities.schoolroom.revivalistLanguageDecorationBonus()) {
			$(decorationEffects).append(` They also <span class="positive">learn ${V.language} more quickly</span> in this environment.`);
		}
	}

	return frag;
};

repo_name: Fanatey/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;
		let stewardessTookVirginity = 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";
						S.Stewardess.fetishStrength = 10;
					}
				} 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";
			}
			if (S.Stewardess.rules.rest !== "restrictive") {
				S.Stewardess.rules.rest = "restrictive";
			}

			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 && !slaveResting(S.Stewardess)) {
				for (const slave of slaves) {
					if (canImpreg(slave, S.Stewardess) && slave.pregKnown === 0) {
						knockMeUp(slave, 100, 2, S.Stewardess.ID);
						if (slave.mpreg === 1) {
							seX(S.Stewardess, "penetrative", slave, "anal", 10);
							if (slave.anus === 0) {
								slave.anus = 1;
								stewardessTookVirginity++;
							}
						} else {
							seX(S.Stewardess, "penetrative", slave, "vaginal", 10);
							if (slave.vagina === 0) {
								slave.vagina = 1;
								stewardessTookVirginity++;
							}
						}
						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="devotion inc">deep pleasure</span> in ${his} job.`);
						S.Stewardess.devotion++;
					}
					if (stewardessTookVirginity > 0) {
						r.push(`${He} needed to break in`);
						if (stewardessImpregnated === 1) {
							r.push(`their hole`);
						} else {
							r.push(`several holes`);
						}
						r.push(`to be certain ${his} seed took root; a treat ${he} <span class="devotion inc">quite enjoyed.</span>`);
						S.Stewardess.devotion += stewardessTookVirginity;
					}
					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 (App.Data.Careers.Leader.stewardess.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 if (S.Stewardess.skill.stewardess > 120) {
				stewardessBonus += 15;
				r.push(`${He} has picked up the skills needed to keep your servants working efficiently.`);
			} else if (S.Stewardess.skill.stewardess > 60) {
				stewardessBonus += 10;
				r.push(`${He} understands what it takes to keep your servants in line.`);
			} else if (S.Stewardess.skill.stewardess > 20) {
				stewardessBonus += 5;
				r.push(`${He} understands the basics of what it takes to keep your penthouse operational.`);
			}
			if (S.Stewardess.skill.stewardess < V.masteredXP) {
				const skillIncrease = jsRandom(1, Math.ceil((S.Stewardess.intelligence + S.Stewardess.intelligenceImplant) / 15) + 8);
				r.push(slaveSkillIncrease('stewardess', S.Stewardess, skillIncrease));
			}
			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.`);
			}
			stewardessBonus *= restEffects(S.Stewardess);
			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(' ');
	}

	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) {
		const slave = App.SlaveAssignment.reportSlave(S.Stewardess);
		tired(slave);
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0) {
			const stewardessEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", stewardessEntry);
			App.SlaveAssignment.appendSlaveLinks(stewardessEntry, slave);
			$(stewardessEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Stewardess.`);
			stewardessEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	let SQMilk = 0;
	let SQMilkSale = 0;

	for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
		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";
		}

		if (V.showEWD !== 0) {
			const {He} = getPronouns(slave);
			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
			if (slave.choosesOwnAssignment === 2) {
				$(slaveEntry).append(App.SlaveAssignment.choosesOwnJob(slave));
			} 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");
				const milkResults = App.SlaveAssignment.getMilked(slave, 0.5);
				$(milkContent).append(`${He} ${milkResults.text}`);
				SQMilk += milkResults.milk;
				SQMilkSale += milkResults.milkSale;
			}
			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			// discard return values silently
			App.SlaveAssignment.choosesOwnJob(slave);
			App.SlaveAssignment.servant(slave, stewardessBonus);
			if (V.servantMilkers === 1 && slave.lactation > 0) {
				const milkResults = App.SlaveAssignment.getMilked(slave, 0.5);
				SQMilk += milkResults.milk;
				SQMilkSale += milkResults.milkSale;
			}
			App.SlaveAssignment.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(`${capFirstChar(V.servantsQuartersName)}'s ${V.servantsQuartersDecoration} atmosphere <span class="hotpink">has a minor impact on your servants.</span>`);
	}

	repX(slaves.length * 20, "servantsQuarters");

	return frag;
};


code:
/**
 * @returns {DocumentFragment}
 */
App.EndWeek.spaReport = function() {
	const el = new DocumentFragment();
	let r;

	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa);
	let healthBonus = 0;
	let restedSlaves = 0;
	let restedSlave;
	let devBonus = (V.spaDecoration !== "standard") ? 1 : 0;

	App.EndWeek.saVars.flSex = App.EndWeek.getFLSex(App.Entity.facilities.spa);

	if (S.Attendant) {
		let idleBonus = 0;
		let bonusToggle = 0;
		let FLsFetish = 0;
		r = [];

		if (S.Attendant.health.condition < 100) {
			improveCondition(S.Attendant, normalRandInt(20));
		}
		if (S.Attendant.devotion <= 60) {
			S.Attendant.devotion++;
		}
		if (S.Attendant.trust < 60) {
			S.Attendant.trust++;
		}
		if (S.Attendant.rules.living !== "luxurious") {
			S.Attendant.rules.living = "luxurious";
		}
		if (S.Attendant.fetishStrength <= 95) {
			if (S.Attendant.fetish !== "submissive") {
				if (fetishChangeChance(S.Attendant) > random(0, 100)) {
					FLsFetish = 1;
					S.Attendant.fetishKnown = 1;
					S.Attendant.fetish = "submissive";
					S.Attendant.fetishStrength = 10;
				}
			} else if (S.Attendant.fetishKnown === 0) {
				FLsFetish = 1;
				S.Attendant.fetishKnown = 1;
			} else {
				FLsFetish = 2;
				S.Attendant.fetishStrength += 4;
			}
		}
		if (S.Attendant.fetish === "none" || S.Attendant.fetish === "submissive") {
			devBonus++;
		}
		S.Attendant.devotion += devBonus;
		const {
			He, His,
			he, his, him, himself, wife
		} = getPronouns(S.Attendant);
		r.push(`${SlaveFullName(S.Attendant)} is serving as the spa attendant.`);
		if (S.Attendant.relationship === -3 && S.Attendant.devotion > 50) {
			r.push(`${He} tries ${his} best to be your perfect attentive, caring and loving ${wife}.`);
		}
		if (FLsFetish === 1) {
			r.push(`When ${he} is paid a visit by a slave with sexual issues to work out, ${he} provides them with an understanding, willing, giving partner. ${He} finds real satisfaction in helping your slaves find sexual gratification, and becomes a submissive.`);
		} else if (FLsFetish === 2) {
			r.push(`Every new slave in the spa is a new person ${he} gets to connect with and serve. Sexually. <span class="lightsalmon">${He} becomes more submissive.</span>`);
		}
		if (App.Data.Careers.Leader.attendant.includes(S.Attendant.career)) {
			r.push(`${He} has experience with counseling from ${his} life before ${he} was a slave, making ${him} better at building rapport with troubled slaves, and giving ${him} a better chance of softening flaws into beneficial quirks.`);
			bonusToggle = 1;
			idleBonus++;
		} else if (S.Attendant.skill.attendant >= V.masteredXP) {
			r.push(`${He} has experience with counseling from working for you, making ${him} better at building rapport with troubled slaves, and giving ${him} a better chance of softening flaws into beneficial quirks.`);
			bonusToggle = 1;
			idleBonus++;
		} else {
			const skillIncrease = random(1, Math.ceil((S.Attendant.intelligence + S.Attendant.intelligenceImplant) / 15) + 8);
			r.push(slaveSkillIncrease('attendant', S.Attendant, skillIncrease));
		}
		if (!canSee(S.Attendant)) {
			r.push(`${His} blindness allows ${him} to deeply connect with ${his} charges.`);
			idleBonus++;
		}
		if (S.Attendant.fetish === "none") {
			r.push(`${S.Attendant.slaveName} respects the slaves lounging in the spa, allowing them to relax completely.`);
			idleBonus++;
		} else if (S.Attendant.fetish === "submissive") {
			r.push(`${S.Attendant.slaveName} lets the slaves resting in the spa take the lead sexually, doing ${his} best to please them.`);
			idleBonus++;
		} else if (S.Attendant.fetishKnown === 1) {
			r.push(`${S.Attendant.slaveName} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} to ${himself}, preventing the slaves in the spa from relaxing completely.`);
		}
		if (S.Attendant.visualAge > 35) {
			r.push(`${His} apparent maturity encourages the slaves in the spa to relax and pour out their troubles to ${him}.`);
			healthBonus++;
			idleBonus++;
		}
		if (S.Attendant.intelligence + S.Attendant.intelligenceImplant > 15) {
			r.push(`${He}'s so intelligent ${he} can suss out the cause of slaves' emotional issues and counsel them effectively.`);
			idleBonus++;
		}
		if (isFertile(S.Attendant) || (S.Attendant.bellyPreg >= 1500) || (S.Attendant.counter.birthsTotal > 0) || (S.Attendant.bellyImplant >= 1500)) {
			r.push(`${He} has a natural mothering instinct and really makes ${his} charges feel at home.`);
			idleBonus++;
			healthBonus++;
		}
		let attendantUsedCure = false;
		App.Events.addNode(el, r, "div", "indent");
		const softenFlawBonus = bonusToggle ? 10 : 0;
		for (const slave of slaves) {
			const {he2, his2, him2} = getPronouns(slave).appendSuffix("2");
			r = [];
			if (slave.fetish === "mindbroken" && slave.health.condition > 20 && !attendantUsedCure && V.spaFix !== 2) {
				attendantUsedCure = true;
				if (random(1, 100) > 90 - S.Attendant.devotion) {
					const curedSlave = App.UI.DOM.makeElement("div", null, "indent");
					const curedArray = [`Something almost miraculous has happened. ${S.Attendant.slaveName} has always refused to believe that ${slave.slaveName} could not be reached, and has lavished patient tenderness on ${him2} in ${V.spaName}. ${slave.slaveName} has begun to respond, and is stirring from ${his2} mental torpor.`];
					slave.devotion = -15;
					slave.sexualFlaw = "apathetic";
					slave.behavioralFlaw = either("hates men", "odd");
					slave.fetish = "none";
					slave.fetishKnown = 1;
					const gp = V.genePool.find(s => s.ID === slave.ID);
					if (gp.intelligence >= -95) {
						slave.intelligence = gp.intelligence - 30;
					}
					if (V.arcologies[0].FSPaternalist !== "unset" && V.arcologies[0].FSPaternalist > 0) {
						curedArray.push(`Society <span class="green">strongly approves</span> of ${slave.slaveName} being restored to sanity, which advances ideals about enlightened slaveownership.`);
						V.arcologies[0].FSPaternalist += 0.01 * V.FSSingleSlaveRep;
						repX(2 * V.FSSingleSlaveRep * (V.arcologies[0].FSPaternalist / V.FSLockinLevel), "spa", slave);
					}
					App.Events.addNode(curedSlave, curedArray);
					r.push(curedSlave);
				}
			}
			if (bonusToggle === 1 && slave.trust < 60) {
				slave.trust++;
			}
			if (S.Attendant.rivalryTarget === slave.ID) {
				r.push(`${He} constantly harasses ${his} ${rivalryTerm(S.Attendant)}, ${slave.slaveName}, preventing ${him2} from getting comfortable and forcing ${him2} to keep ${his2} guard up.`);
				slave.devotion -= 4;
				slave.trust -= 4;
				if (random(1, 100) > 35) {
					S.Attendant.rivalry++;
					slave.rivalry++;
				}
			} else if (S.Attendant.relationshipTarget === slave.ID) {
				r.push(`${He} dedicates most of ${his} attention to ${his} ${relationshipTerm(S.Attendant)}, ${slave.slaveName}, making ${his2} stress, both physical and mental, wash away.`);
				slave.devotion += 3;
				slave.trust += 3;
			} else if (areRelated(S.Attendant, slave)) {
				r.push(`${He} makes sure to spend extra time caring for ${his} ${relativeTerm(S.Attendant, slave)}, ${slave.slaveName}.`);
				slave.trust++;
				improveCondition(slave, 1);
			}
			switch (slave.prestigeDesc) {
				case "$He is a famed Free Cities whore, and commands top prices.":
					r.push(`${He} does ${his} best to relax the famous whore,${slave.slaveName}, making sure to`);
					if (slave.vagina > 2 || slave.anus > 2) {
						r.push(`pay special attention to ${his2} worn holes.`);
					} else {
						r.push(`get ${him2} clean and relaxed for ${his2} next usage.`);
					}
					slave.devotion += 3;
					slave.trust += 3;
					break;
				case "$He is a famed Free Cities slut, and can please anyone.":
					r.push(`${He} does ${his} best to soothe the famous entertainer, ${slave.slaveName}, letting ${him2} relax in blissful peace.`);
					slave.devotion += 3;
					slave.trust += 3;
					break;
				case "$He is remembered for winning best in show as a cockmilker.":
					if (slave.balls > 6 && slave.dick !== 0) {
						if (S.Attendant.fetish === "cumslut") {
							r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${slave.slaveName}'s cock and balls, but ${he2} doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath.`);
							S.Attendant.fetishStrength += 4;
						} else {
							r.push(`${He} does ${his} best to accommodate ${slave.slaveName}'s massive genitals and tends to ${him2} whenever ${he2} feels a need for release.`);
							if (random(1, 100) > 65 && S.Attendant.fetish === "none") {
								r.push(`After taking several massive loads to the face, ${S.Attendant.slaveName} begins to find satisfaction in being coated in cum.`);
								S.Attendant.fetish = "cumslut";
							}
						}
					}
					slave.devotion += 3;
					slave.trust += 3;
					break;
				case "$He is remembered for winning best in show as a dairy cow.":
					if (slave.lactation > 0 && (slave.boobs - slave.boobsImplant) > 6000) {
						if (S.Attendant.fetish === "boobs") {
							r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${slave.slaveName}'s huge breasts, but ${he2} doesn't mind being milked constantly. Before long the bath gains a white tint.`);
							S.Attendant.fetishStrength += 4;
							S.Attendant.fetishStrength += 4;
						} else {
							r.push(`${He} does ${his} best to accommodate ${slave.slaveName}'s massive breasts and tends to ${him2} whenever ${he2} feels a need for release.`);
							if (random(1, 100) > 65 && S.Attendant.fetish === "none") {
								r.push(`After multiple milking sessions, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about having giant milky breasts too.`);
								S.Attendant.fetish = "boobs";
							}
						}
						slave.devotion += 3;
						slave.trust += 3;
						slave.lactationDuration = 2;
						slave.boobs -= slave.boobsMilk;
						slave.boobsMilk = 0;
					}
					break;
				case "$He is remembered for winning best in show as a breeder.":
					if (slave.bellyPreg >= 5000) {
						if (S.Attendant.fetish === "pregnancy") {
							r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${slave.slaveName}'s pregnancy, but ${he2} doesn't mind ${his2} full belly being fondled.`);
							S.Attendant.fetishStrength += 4;
							S.Attendant.fetishStrength += 4;
						} else {
							r.push(`${He} does ${his} best to accommodate ${slave.slaveName}'s pregnancy and to make sure the mother-to-be is happy and comfortable.`);
							if (random(1, 100) > 65 && S.Attendant.fetish === "none") {
								r.push(`After massaging ${slave.slaveName}'s growing belly multiple times, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about being swollen with life too.`);
								S.Attendant.fetish = "pregnancy";
							}
						}
						slave.devotion += 3;
						slave.trust += 3;
					} else {
						if (S.Attendant.fetish === "pregnancy") {
							r.push(`${He} can't help but pester ${slave.slaveName} with questions about ${his2} famous pregnancy, limiting ${his2} ability to truly relax.`);
							slave.devotion += 1;
							slave.trust += 1;
						} else if (canGetPregnant(slave)) {
							r.push(`${He} does ${his} best to encourage ${slave.slaveName}'s fertilization by performing any fertility boosting actions ${he} can.`);
							slave.devotion += 3;
							slave.trust += 3;
						}
					}
			}
			if (
				!attendantUsedCure &&
				(S.Attendant.intelligence + S.Attendant.intelligenceImplant > 15) &&
				(S.Attendant.intelligence + S.Attendant.intelligenceImplant + softenFlawBonus) > random(1, 200) &&
				(V.spaFix === 0)
			) {
				if (slave.behavioralFlaw !== "none") {
					SoftenBehavioralFlaw(slave);
					attendantUsedCure = true;
					r.push(`${S.Attendant.slaveName} works carefully with ${slave.slaveName}, and successfully`);
					r.push(App.UI.DOM.makeElement("span", `softens ${his2} behavioral flaw`, "green"));
					r.push(`into an appealing quirk.`);
				} else if (slave.sexualFlaw !== "none") {
					SoftenSexualFlaw(slave);
					attendantUsedCure = true;
					r.push(`${S.Attendant.slaveName} works carefully with ${slave.slaveName}, and successfully`);
					r.push(App.UI.DOM.makeElement("span", `softens ${his2} sexual flaw`, "green"));
					r.push(`into an appealing quirk.`);
				}
			}
			if (slave.lactation > 0) {
				r.push(`${S.Attendant.slaveName} takes care to keep ${slave.slaveName}'s breasts comfortably drained.`);
				slave.lactationDuration = 2;
				slave.boobs -= slave.boobsMilk;
				slave.boobsMilk = 0;
			}
			App.Events.addNode(el, r, "div", "indent");
		}

		if (slaves.length < V.spa) {
			const seed = random(1, 10) + ((V.spa - slaves.length) * (random(150, 170) + (idleBonus * 10)));
			cashX(seed, "spa", S.Attendant);
			r = [];
			r.push(`Since ${he} doesn't have enough slaves to occupy all ${his} time, the spa takes in citizens' slaves on a contract basis and ${he} helps them too, earning  ${cashFormat(seed)}.`);
			if (V.arcologies[0].FSHedonisticDecadence > 0 && slaves.length === 0) {
				r.push(`Society <span class="green">loves</span> being allowed to lounge in your spa, greatly advancing your laid back culture.`);
				FutureSocieties.Change("Hedonistic", 2);
			}
			App.Events.addNode(el, r, "div", "indent");
		}
	}

	if (slaves.length > 0) {
		r = [];
		if (slaves.length > 1) {
			r.push(`There are ${slaves.length} slaves`);
		} else {
			r.push(`There is one slave`);
		}
		r.push(`resting and recuperating in the spa.`);
		App.Events.addNode(el, r, "p", ["indent", "bold"]);
	}

	if (S.Attendant) {
		const slave = App.SlaveAssignment.reportSlave(S.Attendant);
		tired(slave);
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0) {
			const attendantEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", attendantEntry);
			App.SlaveAssignment.appendSlaveLinks(attendantEntry, slave);
			App.Events.addNode(
				attendantEntry,
				[
					App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"),
					`is serving as the Attendant in ${V.spaName}.`,
					App.SlaveAssignment.standardSlaveReport(slave, false),
				]
			);
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
		const {He, he, his} = getPronouns(slave);
		slave.devotion += devBonus;
		improveCondition(slave, 5 + healthBonus);
		if (slave.health.condition < -80) {
			improveCondition(slave, 15);
		} else if (slave.health.condition < -40) {
			improveCondition(slave, 10);
		} else if (slave.health.condition < 0) {
			improveCondition(slave, 5);
		}
		if (V.spaUpgrade === 1 && slave.health.condition < 100) {
			improveCondition(slave, normalRandInt(8));
		}
		if (slave.devotion < 60 && slave.trust < 60) {
			slave.devotion++;
			slave.trust++;
		} else if (slave.trust < 40) {
			slave.trust += 10;
		} else if (slave.devotion < 40) {
			slave.devotion += 10;
		}
		switch (V.spaDecoration) {
			case "Chattel Religionist":
			case "Chinese Revivalist":
				slave.rules.living = "normal";
				break;
			case "Degradationist":
				slave.rules.living = "spare";
				break;
			default:
				slave.rules.living = "luxurious";
		}
		if (slave.health.condition >= 20 && slave.health.tired <= 30 && slave.trust > 60 && slave.devotion > 60 && slave.fetish !== "mindbroken" && slave.sexualFlaw === "none" && slave.behavioralFlaw === "none") {
			const slaveFixed = App.UI.DOM.makeElement("p");
			App.Events.addNode(
				slaveFixed,
				[
					App.UI.DOM.makeElement("span", slave.slaveName, "slave-name"),
					`is feeling well enough to leave ${V.spaName}, `
				]
			);
			r = [];
			if (V.assignmentRecords[slave.ID]) {
				const oldJob = V.assignmentRecords[slave.ID];
				assignJobSafely(slave, oldJob);
				if (slave.choosesOwnAssignment === 1) {
					r.push(`and ${he} is resting before choosing another task.`);
				} else if (slave.assignment === Job.REST) {
					if (oldJob !== Job.REST) {
						r.push(`and since ${he} was unable to return to ${his} old task to ${oldJob}, ${his} assignment has defaulted to rest.`);
					} else {
						r.push(`so ${he} has returned to rest.`);
					}
				} else {
					r.push(`so ${he} goes back to ${slave.assignment}.`);
				}
			} else {
				r.push(`so ${his} assignment has defaulted to rest.`);
				removeJob(slave, "rest in the spa");
			}
			App.Events.addNode(slaveFixed, r, "span", "noteworthy");
			el.append(slaveFixed);
			restedSlaves++;
			restedSlave = slave;
			continue;
		}

		if (V.showEWD !== 0) {
			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
			r = [];
			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
			if (slave.choosesOwnAssignment === 2) {
				r.push(App.SlaveAssignment.choosesOwnJob(slave));
			} else {
				r.push(`is resting in ${V.spaName}.`);
			}
			App.Events.addNode(slaveEntry, r);

			r = [];
			r.push(He);
			r.push(App.SlaveAssignment.rest(slave));

			if (slave.fetish === "mindbroken") {
				r.push(`${He} remains in the Spa, completely mindbroken.`);
			} else if (slave.sexualFlaw !== "none" || slave.behavioralFlaw !== "none") {
				r.push(`${He} remains in the Spa, stubborn in ${his} flaw.`);
			} else if (slave.trust < 60 || slave.devotion < 60) {
				r.push(`${He} remains in the Spa, as ${he} is still learning to accept life as a slave.`);
			} else if (slave.health.condition < 20) {
				r.push(`${He} remains in the Spa, as ${he} is benefiting from its healing properties.`);
			} else if (slave.health.tired > 30) {
				r.push(`${He} remains in the Spa, continuing to soak away ${his} fatigue.`);
			}
			App.Events.addNode(slaveEntry, r, "div", "indent");
			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			// discard return values silently
			App.SlaveAssignment.choosesOwnJob(slave);
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	if (restedSlaves > 0) {
		const {he, him} = getPronouns(restedSlave);
		r = [];
		if (restedSlaves === 1) {
			r.push(`One slave has rested until ${he} reached a state of <span class="hotpink">devotion</span> and <span class="mediumaquamarine">trust</span> and will leave the spa before the end of the week.`);
		} else {
			r.push(`${restedSlaves} slaves have rested until they reached a state of devotion and trust and will leave the spa before the end of the week.`);
		}
		App.Events.addNode(el, r, "p", "indent");
		if (V.spaDecoration !== "standard") {
			r = [];
			r.push(`${capFirstChar(V.spaName)}'s ${V.spaDecoration} atmosphere <span class="hotpink">had an impact on`);
			if (restedSlaves === 1) {
				r.push(`${him} while ${he} was`);
			} else {
				r.push(`them while they were`);
			}
			r.push(`</span> resting.`);
			App.Events.addNode(el, r, "p", "indent");
		}
	}

	return el;
};


code:
/**
 * @param {App.Entity.SlaveState} slave
 */
App.SlaveAssignment.agent = function(slave) {
	const gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;

	if (slave.boobsImplantType === "string") {
		slave.boobsImplant += 50;
		slave.boobs += 50;
		if (slave.boobs > 50000) {
			slave.boobs -= 100;
			slave.boobsImplant -= 100;
			if (slave.geneMods.NCS === 1) {
				slave.boobs -= 100;
				slave.boobsImplant -= 100;
			}
		}
	}

	if (slave.geneMods.NCS === 1) { /* NCS is blocking boob expansion. */
		if (slave.boobsImplant > 1000) {
			if ((slave.boobs - slave.boobsImplant < 1000) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		} else if (slave.boobsImplant > 600) {
			if ((slave.boobs - slave.boobsImplant < 500) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		} else if (slave.boobsImplant > 0) {
			if ((slave.boobs - slave.boobsImplant < 300) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		}
	}
	if (slave.geneticQuirks.macromastia === 2 && slave.geneticQuirks.gigantomastia === 2) {
		if (slave.boobs < 100000 && slave.weight >= -95) {
			slave.boobs += 30;
		}
	} else if (slave.geneticQuirks.gigantomastia === 2) {
		if (slave.boobs < 25000 && slave.weight >= -95) {
			slave.boobs += 20;
		}
	} else if (slave.geneticQuirks.macromastia === 2) {
		if (slave.boobs < 5000 && slave.weight >= -95) {
			slave.boobs += 10;
		}
	}
	if (slave.breastMesh !== 1) {
		if (slave.boobs - (slave.muscles * 30) > 5000 && slave.boobs <= 8000 && slave.boobsImplant / slave.boobs < .50) {
			if (slave.physicalAge < random(10, 200)) {
				if (slave.boobShape === "perky") {
					slave.boobShape = "torpedo-shaped";
				} else if (slave.boobShape !== "saggy") {
					slave.boobShape = "saggy";
				}
			}
		} else if (slave.boobsImplant / slave.boobs >= .90 && slave.boobs > 2000 && !["saggy", "downward-facing", "spherical"].includes(slave.boobShape) && random(1, 100) > 70) {
			slave.boobShape = "spherical";
		}
	}
	if (slave.buttImplantType === "string") {
		slave.buttImplant += 0.25;
		slave.butt += 0.25;
		if (slave.butt > 10) {
			slave.butt -= 1;
			slave.buttImplant -= 1;
			if (slave.geneMods.NCS === 1) {
				slave.butt -= 1;
				slave.buttImplant -= 1;
			}
		}
	}
	if (slave.geneticQuirks.rearLipedema === 2 && slave.butt < 20) {
		slave.butt += 0.1;
	}

	if (slave.genes === "XX") {
		if (slave.ovaries === 1 || slave.mpreg === 1) {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 60) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 60) {
					slave.hormoneBalance += 1;
				}
			}
		} else {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > -20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < -20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			}
		}
	} else if (slave.genes === "XY") {
		if (slave.ovaries === 1 || slave.mpreg === 1) {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 40) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 40) {
					slave.hormoneBalance += 1;
				}
			}
		} else {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > -40) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < -40) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			}
		}
	}

	/* puberty - not announced for allowing surprise pregnancy */
	if (slave.ovaries === 1 || slave.mpreg === 1) {
		if (slave.pubertyXX === 0) {
			if (slave.physicalAge >= slave.pubertyAgeXX) {
				slave.pubertyXX = 1;
				if (slave.geneticQuirks.gigantomastia === 3 && random(1, 100) < slave.hormoneBalance) {
					slave.geneticQuirks.gigantomastia = 2;
				}
				if (slave.geneticQuirks.macromastia === 3 && random(1, 100) < slave.hormoneBalance) {
					slave.geneticQuirks.macromastia = 2;
				}
				if (slave.geneticQuirks.galactorrhea === 3) {
					slave.geneticQuirks.galactorrhea = 2;
					if (random(1, 100) < slave.hormoneBalance && slave.lactation === 0) {
						slave.lactationDuration = 2;
						slave.lactation = 1;
					}
				}
			}
		}
	}
	if (slave.balls > 0 && slave.ballType !== "sterile") {
		if (slave.pubertyXY === 0) {
			if (slave.physicalAge >= slave.pubertyAgeXY) {
				slave.pubertyXY = 1;
				if (slave.geneticQuirks.galactorrhea === 3) {
					slave.geneticQuirks.galactorrhea = 2;
					if (random(1, 100) < slave.hormoneBalance && slave.lactation === 0) {
						slave.lactationDuration = 2;
						slave.lactation = 1;
					}
				}
			}
		}
	}

	if (slave.inflation > 0) {
		deflate(slave);
	}

	if (slave.preg > 0) { // EFFECTS OF PREGNANCY
		if (slave.preg === slave.pregData.normalBirth / 8) { /* !!! Very bad condition logic - with pregnancy control drugs can be not triggered. Or may be trigged by broodmother several times. Need to be reworked. !!! */
			if (slave.pregSource === -1) {
				V.PC.counter.slavesKnockedUp++;
			} else if (slave.pregSource > 0) {
				const babyDaddy = findFather(slave.pregSource);
				if (babyDaddy) {
					babyDaddy.counter.slavesKnockedUp++;
				}
			}
		}
		if (slave.preg >= slave.pregData.normalBirth / 4) {
			if (slave.geneticQuirks.gigantomastia === 3 && random(1, 200) < slave.hormoneBalance) {
				slave.geneticQuirks.gigantomastia = 2;
			}
			if (slave.geneticQuirks.macromastia === 3 && random(1, 200) < slave.hormoneBalance) {
				slave.geneticQuirks.macromastia = 2;
			}
			let boobTarget = 0;
			if (slave.geneMods.NCS === 1) {
				/* Sort-of No-op, NCS prevents boob growth */
			} else if (slave.physicalAge >= 18) {
				if (slave.pregType >= 50) {
					boobTarget = 10000;
				} else if (slave.pregType >= 30) {
					boobTarget = 5000;
				} else if (slave.pregType >= 10) {
					boobTarget = 2000;
				} else {
					boobTarget = 1000;
				}
			} else if (slave.physicalAge >= 13) {
				if (slave.pregType >= 50) {
					boobTarget = 5000;
				} else if (slave.pregType >= 30) {
					boobTarget = 3200;
				} else if (slave.pregType >= 10) {
					boobTarget = 1800;
				} else {
					boobTarget = 800;
				}
			} else if (slave.physicalAge >= 8) {
				if (slave.pregType >= 50) {
					boobTarget = 1800;
				} else if (slave.pregType >= 30) {
					boobTarget = 1400;
				} else if (slave.pregType >= 10) {
					boobTarget = 1000;
				} else {
					boobTarget = 600;
				}
			} else {
				if (slave.pregType >= 50) {
					boobTarget = 1000;
				} else if (slave.pregType >= 30) {
					boobTarget = 800;
				} else if (slave.pregType >= 10) {
					boobTarget = 600;
				} else {
					boobTarget = 400;
				}
			}
			boobTarget *= gigantomastiaMod;
			if (slave.pregType >= 30) {
				if (slave.weight <= 65) {
					slave.weight += 1;
				}
				if (slave.geneMods.NCS === 0 && random(1, 100) > 60) {
					if ((slave.boobs - slave.boobsImplant) < boobTarget) {
						slave.boobs += 200;
						if (slave.boobShape !== "saggy" && slave.preg > slave.pregData.normalBirth / 1.25 && (slave.boobsImplant / slave.boobs < 0.5) && (slave.breastMesh !== 1)) {
							slave.boobShape = "saggy";
						}
					}
					if (slave.hips < 2) {
						slave.hips += 1;
					}
					if (slave.butt < 14) {
						slave.butt += 1;
					}
				}
			} else if (slave.geneMods.NCS === 0 && slave.pregType >= 10) {
				if (random(1, 100) > 80 && ((slave.boobs - slave.boobsImplant) < boobTarget)) {
					slave.boobs += 100;
					if (slave.boobShape !== "saggy" && (slave.boobsImplant / slave.boobs < 0.5) && (slave.breastMesh !== 1)) {
						if (slave.preg > random(slave.pregData.normalBirth / 1.25, slave.pregData.normalBirth * 2)) {
							slave.boobShape = "saggy";
						}
					}
				}
			} else if (slave.geneMods.NCS === 0 && ((slave.boobs - slave.boobsImplant) < boobTarget)) {
				if (random(1, 100) > 80) {
					slave.boobs += 50;
					if (slave.boobShape !== "saggy" && slave.preg > random(slave.pregData.normalBirth / 1.25, slave.pregData.normalBirth * 2.5) && (slave.boobsImplant / slave.boobs < 0.5) && (slave.breastMesh !== 1)) {
						slave.boobShape = "saggy";
					}
				}
			}
			if (slave.geneMods.NCS === 1) {
				/* No-op, we don't grow hips on NCS */
			} else if (slave.preg > slave.pregData.normalBirth / 1.25 && slave.physicalAge >= 18 && slave.hips === 1 && slave.hipsImplant === 0 && random(1, 100) > 90) {
				slave.hips += 1;
			} else if (slave.preg > slave.pregData.normalBirth / 1.42 && slave.physicalAge >= 18 && slave.hips === 0 && slave.hipsImplant === 0 && random(1, 100) > 70) {
				slave.hips += 1;
			}
			if (slave.bellyPreg >= 1500) {
				if (App.Data.misc.fakeBellies.includes(slave.bellyAccessory)) {
					slave.bellyAccessory = "none";
				}
				if ((slave.preg > slave.pregData.normalBirth / 2) && (slave.lactation === 0) && slave.health.condition >= -20 && slave.weight > -30) {
					if (slave.preg > random(slave.pregData.normalBirth / 2.22, slave.pregData.normalBirth / 1.33)) {
						slave.lactation = 1;
					}
				}
				if (slave.lactation === 1) {
					slave.lactationDuration = 2;
				}
			}
		}
	}

	if (slave.belly >= 1000000) {
		if (slave.bellySag < 50) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 20) {
			slave.bellySagPreg += 1;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 5;
			slave.bellySagPreg += 5;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 3;
			}
		}
	} else if (slave.belly >= 750000) {
		if (slave.bellySag < 30) {
			slave.bellySag += 0.7;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.7;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 30) {
			slave.bellySagPreg += 0.7;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 2;
			slave.bellySagPreg += 2;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		}
	} else if (slave.belly >= 600000) {
		if (slave.bellySag < 20) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 20) {
			slave.bellySagPreg += 0.5;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 1;
			slave.bellySagPreg += 1;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		}
	} else if (slave.belly >= 450000) {
		if (slave.bellySag < 15) {
			slave.bellySag += 0.4;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.4;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 15) {
			slave.bellySagPreg += 0.4;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.6;
			slave.bellySagPreg += 0.6;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		}
	} else if (slave.belly >= 300000) {
		if (slave.bellySag < 10) {
			slave.bellySag += 0.3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.3;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 10) {
			slave.bellySagPreg += 0.3;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.5;
			slave.bellySagPreg += 0.5;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		}
	} else if (slave.belly >= 100000) {
		if (slave.bellySag < 10) {
			slave.bellySag += 0.2;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.2;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 10) {
			slave.bellySagPreg += 0.2;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.3;
			slave.bellySagPreg += 0.3;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.3;
			}
		}
	} else if (slave.bellyPreg >= 10000 || slave.bellyImplant >= 10000) {
		if (slave.bellySag < 5) {
			slave.bellySag += 0.1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.1;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 5) {
			slave.bellySagPreg += 0.1;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.2;
			slave.bellySagPreg += 0.2;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.2;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.2;
			}
		}
	}
	if (slave.bellySagPreg > slave.bellySag) {
		slave.bellySagPreg = slave.bellySag;
	}

	if (slave.bellySag > 0 && slave.belly < 1500 && slave.geneMods.rapidCellGrowth !== 1) {
		if (slave.muscles > 95) {
			if (random(1, 100) > 1) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.5;
					slave.bellySagPreg -= 0.5;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.5;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else if (slave.muscles >= 30) {
			if (random(1, 100) > 20) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.4;
					slave.bellySagPreg -= 0.4;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.4;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else if (slave.muscles >= 5) {
			if (random(1, 100) > 40) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.3;
					slave.bellySagPreg -= 0.3;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.3;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else {
			if (random(1, 100) > 60) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.2;
					slave.bellySagPreg -= 0.2;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.2;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		}
	}

	if ((slave.preg > slave.pregData.minLiveBirth) && slave.broodmother === 0 && random(1, 100) < 90) {
		slave.counter.birthsTotal += WombBirthReady(slave, slave.pregData.minLiveBirth);
		WombBirth(slave, slave.pregData.minLiveBirth);
		WombFlush(slave);
		if (slave.geneticQuirks.fertility + slave.geneticQuirks.hyperFertility >= 4) {
			slave.pregWeek = -2;
		} else if (slave.geneticQuirks.hyperFertility > 1) {
			slave.pregWeek = -3;
		} else {
			slave.pregWeek = -4;
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	} else if ((slave.preg > slave.pregData.normalBirth) && (slave.broodmother === 0)) {
		slave.counter.birthsTotal += WombBirthReady(slave, slave.pregData.minLiveBirth);
		WombBirth(slave, slave.pregData.minLiveBirth);
		WombFlush(slave);
		if (slave.geneticQuirks.fertility + slave.geneticQuirks.hyperFertility >= 4) {
			slave.pregWeek = -2;
		} else if (slave.geneticQuirks.hyperFertility > 1) {
			slave.pregWeek = -3;
		} else {
			slave.pregWeek = -4;
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	} else if ((slave.preg > 37) && (slave.broodmother > 0)) {
		if (slave.broodmother > 0) {
			slave.counter.birthsTotal += WombBirthReady(slave, 37);
			WombBirth(slave, 37);
			slave.preg = WombMaxPreg(slave);
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	}

	SetBellySize(slave); // Actually it's now better to set belly size without checking of any conditions. Just to be sure. Should correct forgotten variables too.

	if (slave.lactation === 1) {
		if (slave.fetish !== "boobs") {
			if (slave.lactationDuration === 0) {
				slave.boobs -= slave.boobsMilk;
				slave.boobsMilk = 0;
				slave.lactation = 0;
			} else if (slave.lactationDuration === 1) {
				// handled in nextWeek?
				// slave.boobsMilk = Math.round(10 * slave.lactationAdaptation);
				// slave.boobs += slave.boobsMilk;
			}
		} else {
			slave.lactationDuration = 2;
		}
	} else if (slave.lactation === 2) {
		slave.lactationDuration = 2;
	} else if (slave.fetish === "boobs" && slave.boobs - slave.boobsImplant >= 2000) {
		slave.induceLactation += 2;
		if (slave.lactationDuration >= 20) {
			slave.induceLactation = 0;
			slave.lactationDuration = 2;
			slave.lactation = 1;
		}
	}
	if (slave.lactation === 0 && slave.geneticQuirks.galactorrhea === 2 && random(1, 100) <= slave.hormoneBalance) {
		slave.lactationDuration = 2;
		slave.lactation = 1;
	}

	if (slave.geneticQuirks.neoteny === 3 && slave.physicalAge >= 12) {
		slave.geneticQuirks.neoteny = 2;
	}
	if (slave.geneticQuirks.progeria === 3 && slave.physicalAge >= 3) {
		slave.geneticQuirks.progeria = 2;
	}
	if (slave.geneticQuirks.gigantomastia === 3 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance) {
		slave.geneticQuirks.gigantomastia = 2;
	}
	if (slave.geneticQuirks.macromastia === 3 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance) {
		slave.geneticQuirks.macromastia = 2;
	}

	if (slave.geneticQuirks.uterineHypersensitivity === 2) {
		if (slave.vaginaLube < 2 && slave.vagina > 0 && random(70 - slave.physicalAge, 200) < slave.hormoneBalance) {
			slave.vaginaLube += 1;
		}
		if (slave.geneMods.NCS === 0) {
			if (slave.hips < 2 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance && slave.physicalAge.isBetween(9, 20)) {
				slave.hips += 1;
			}
		}
	}

	if (slave.geneMods.immortality === 1) {
		if (slave.physicalAge > 26) {
			slave.physicalAge--;
		}
		if (slave.visualAge > 26) {
			slave.visualAge--;
		}
	}
	if (slave.geneticQuirks.progeria === 2 && slave.birthWeek > 2) {
		if (((slave.birthWeek - 2) % 5) === 0) {
			slave.physicalAge++;
			slave.visualAge++;
			slave.ovaryAge += 5;
		}
	}

	if ((slave.hStyle !== "shaved" && slave.bald !== 1 && slave.haircuts === 0) && (slave.hLength < 150)) {
		slave.hLength += 1;
	}

	slave.health.illness = 0;
};


code:
/**
 * @param {FC.ReportSlave} slave
 * @returns {string}
 */
App.SlaveAssignment.beYourHeadGirl = function saBeYourHeadGirl(slave) {
	/** @type {string[]} */
	const r = [];

	const arcology = V.arcologies[0];

	const {
		he, him, his, himself, He, His,
	} = getPronouns(slave);

	updateHGState(slave);
	jobPreface(slave);
	theHGLife(slave);
	if (V.personalAttention.task === PersonalAttention.SUPPORTHG) {
		playerHelpsHG(slave);
	}
	if (V.HGFormality === 0) {
		HGFormality(slave);
	}
	jobEffects(slave);
	if (slave.prestige === 0) {
		prestigeGain(slave);
	}
	cleanupVars(slave);

	return r.join(" ");

	/**
	 * @param {FC.ReportSlave} slave
	 *
	 */
	function updateHGState(slave) {
		V.HGTimeInGrade += 1;
		if (V.HGSuite === 1) {
			slave.rules.living = "luxurious";
		}
		slave.rules.rest = "restrictive";
		tired(slave);
	}

	/**
	 * @param {FC.ReportSlave} slave
	 * */
	function jobPreface(slave) {
		if (arcology.FSEgyptianRevivalistLaw === 0) {
			r.push(`helps manage your other slaves. ${He} helps them when they try and fail, and punishes them when they fail to try.`);
		} else {
			r.push(`serves as your Consort. Though ${he} is still your slave, ${his} status is scarcely below that of a citizen. ${He} contributes to your reputation just like a Concubine, and ${he} is conscious of the trust you place in ${him}.`);
			slave.devotion += 1;
			slave.trust += 1;
			App.SlaveAssignment.pleaseYou(slave);
			if (slave.relationship > 4) {
				if (slave.relationshipTarget === V.ConcubineID) {
					const concubine = S.Concubine;
					if (areRelated(concubine, slave)) {
						const concubinePronouns = getPronouns(concubine);
						if (concubine.mother === slave.ID || concubine.father === slave.ID) {
							r.push(`Your Concubine is your Consort's ${concubinePronouns.daughter}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else if (slave.mother === V.ConcubineID) {
							r.push(`Your Concubine is your Consort's mother-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else if (slave.father === V.ConcubineID) {
							r.push(`Your Concubine is your Consort's father-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else {
							switch (areSisters(slave, concubine)) {
								case 1:
									r.push(`Your Concubine is your Consort's twin-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								case 2:
									r.push(`Your Concubine is your Consort's ${concubinePronouns.sister}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								case 3:
									r.push(`Your Concubine is your Consort's half-${concubinePronouns.sister}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								default:
									r.push(`<span style="bold">Shit went wrong! Post this in a bug report!</span> This is <span class="red">NOT as it should be.</span>`);
									repX(500, "headGirl", slave);
							}
						}
					}
				} else {
					if (totalRelatives(slave) > 0) {
						let relation = getSlave(slave.relationshipTarget);
						const relationPronouns = getPronouns(relation);
						if (relation.mother === slave.ID || relation.father === slave.ID) {
							r.push(`Your Consort has a ${relationPronouns.daughter}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else if (slave.mother === relation.ID) {
							r.push(`Your Consort has a mother-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else if (slave.father === relation.ID) {
							r.push(`Your Consort has a father-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else {
							switch (areSisters(slave, relation)) {
								case 1:
									r.push(`Your Consort has a twin-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
								case 2:
									r.push(`Your Consort has a ${relationPronouns.sister}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
								case 3:
									r.push(`Your Consort has a half-${relationPronouns.sister}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
							}
						}
					}
				}
			}
		}
		if (App.EndWeek.saVars.HGEnergy === 0) {
			r.push(`${He} notices ${his} fatigue getting in the way of training your slaves, so ${he} focuses ${his} attention on ${himself} this week to rectify this.`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * */
	function theHGLife(slave) {
		if (V.HGTimeInGrade > 12) {
			if (V.HGSuite === 1) {
				r.push(`Being continually trusted with this position increases ${his} devotion to you, and encourages ${him} to trust you in turn; ${he}'s also grateful for ${his} nice suite, which makes ${him} one of the best provided for slaves in the Free Cities.`);
				slave.devotion += 4;
				slave.trust += 4;
			} else if (slave.rules.living === "luxurious") {
				r.push(`Being continually trusted with this position <span class="hotpink">increases ${his} devotion to you</span> and encourages ${him} to <span class="mediumaquamarine">trust you in turn.</span>`);
				slave.devotion += 4;
				slave.trust += 4;
			} else {
				r.push(`Being continually trusted with this position slightly increases ${his} devotion to you, though ${he} harbors some doubts because ${he} isn't allowed a room of ${his} own to set ${him} apart from the other slaves.`);
				slave.devotion += 1;
			}
		} else {
			if (V.HGSuite === 1) {
				r.push(`${He}'s <span class="mediumaquamarine">grateful</span> for ${his} nice suite, which makes ${him} one of the best provided for slaves in the Free Cities.`);
				slave.trust += 4;
			} else if (slave.rules.living !== "luxurious" && slave.devotion <= 50) {
				r.push(`Given ${his} lofty position, ${he} harbors some doubts in ${his} value to you since ${he} isn't allowed a room of ${his} own to set ${him} apart from the other slaves.`);
				slave.devotion -= 2;
			}
		}
		if (slave.rules.living !== "luxurious") {
			r.push(`${His} duties are <span class="red">physically and mentally taxing,</span> especially with nothing more than a`);
			if (slave.rules.living === "normal") {
				r.push(`bed`);
			} else {
				r.push(`cot`);
			}
			r.push(`waiting for ${him} in the slave dormitory.`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function playerHelpsHG(slave) {
		r.push(`You're cooperating with ${him} this week, working with ${V.assistant.name} to free up some of ${his} time so ${he} can target more slaves in need of individual attention.`);
		if (slave.trust > 95) {
			r.push(`${He} is so trusting of you that ${he} can act as your own right hand, allowing ${him} to oversee your slaves with remarkable efficiency.`);
		} else {
			r.push(`This arrangement <span class="mediumaquamarine">builds trust</span> between you.`);
			slave.trust += 2;
		}
		if (slave.health.tired > 30) {
			r.push(`It also takes a load off ${his} tired shoulders.`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function HGFormality(slave) {
		if (slave.trust > 95) {
			r.push(`Every so often, when you're alone, ${he} calls you ${properTitle()}. ${He} treats your permission to do this as a sacred thing, and <span class="hotpink">loves you for it.</span>`);
			slave.devotion += 1;
		} else {
			r.push(`Your permission to be informal in private <span class="mediumorchid">confuses ${him}</span> a little, since ${he} isn't perfectly confident enough to be comfortable with the idea.`);
			slave.devotion -= 1;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function jobEffects(slave) {
		if (slave.fetishKnown === 1) {
			if (slave.fetish === "dom") {
				if (slave.fetishKnown === 1 && slave.fetishStrength <= 95) {
					r.push(`Having all the slaves look up to and obey ${him} advances ${his} <span class="lightcoral">dominant tendencies.</span>`);
					slave.fetishStrength += 4;
				}
			} else if (fetishChangeChance(slave) > jsRandom(0, 100)) {
				r.push(`Having all the slaves look up to and obey ${him} affects ${his} sexuality, turning ${him} into a <span class="lightcoral">bit of a dominatrix.</span>`);
				slave.fetish = "dom";
				slave.fetishStrength = 20;
				slave.fetishKnown = 1;
			} else if (slave.fetishStrength <= jsRandom(20, 60)) {
				r.push(`The sheer variety of sexual situations ${he} sees and participates in <span class="pink">broaden ${his} sexual interests</span> and incline ${him} to take a dominant sexual role.`);
				slave.fetishStrength -= 4;
			}
		} else {
			if (slave.fetish === "dom") {
				r.push(`Having all the slaves look up to and obey ${him} clearly excites ${him}; <span class="lightcoral">${he}'s a natural dom!</span>`);
				slave.fetishKnown = 1;
			} else if (fetishChangeChance(slave) > jsRandom(0, 100)) {
				r.push(`Having all the slaves look up to and obey ${him} affects ${his} sexuality, turning ${him} into a <span class="lightcoral">bit of a dominatrix.</span>`);
				slave.fetish = "dom";
				slave.fetishStrength = 20;
				slave.fetishKnown = 1;
			}
		}

		if (slave.rules.lactation === "induce") {
			r.push(`${He} works mammary stimulation into ${his} slave training regimen in an effort to bring in ${his} milk for you.`);
			r.push(induceLactation(slave, 3));
			if (slave.lactation === 1) {
				slave.rules.lactation = "maintain";
			}
		} else if (slave.rules.lactation === "maintain") {
			r.push(`Proper nursing and milking technique is a strong aspect of ${his} slave training regimen, both to keep ${his} milk flowing and to prevent the mounting pressure from distracting from ${his} work.`);
			slave.lactationDuration = 2;
			slave.boobs -= slave.boobsMilk;
			slave.boobsMilk = 0;
		}

		if (slave.dick > 0 && V.universalRulesImpregnation === "HG" && canPenetrate(slave)) {
			r.push(`${He} finds ${his} duty to impregnate slaves at will sexually satisfying.`);
			slave.need = 0;
		} else if (V.slaves.length > 5) {
			r.push(`Seldom a day goes by without ${him} finding an outlet among your slaves for ${his} sexual desires.`);
			slave.need = 0;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function prestigeGain(slave) {
		if (V.HGTimeInGrade + ((slave.intelligence + slave.intelligenceImplant) / 10) + (slave.devotion / 10) + (slave.trust / 10) > 50) {
			r.push(`${slave.slaveName} has rendered such long and competent service as your Head Girl that many of your citizens have come to rely on ${his} word as an extension of yours, trusting that if ${he} does something, it's because you trust ${him} to. ${He} has become prestigious on ${his} own merits, a remarkable achievement for a slave!`);
			slave.prestige += 1;
			slave.prestigeDesc = `Many citizens respect $his long and able service as your Head Girl.`;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function cleanupVars(slave) {
		if (!App.Data.Careers.Leader.HG.includes(slave.career) && slave.skill.headGirl < V.masteredXP) {
			const skillIncrease = jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 15) + 8);
			r.push(slaveSkillIncrease('headGirl', slave, skillIncrease));
		}
		slave.health.tired = Math.clamp(slave.health.tired, 0, 1000);
	}
};