code:
/**
 * Details week-to-week changes in children in the Nursery
 * @returns {DocumentFragment}
 */
App.Facilities.Nursery.childrenReport = function childrenReport() {
	const frag = new DocumentFragment();

	const Matron = S.Matron;
	const nannies = App.Utils.sortedEmployees(App.Entity.facilities.nursery);
	const NL = App.Entity.facilities.nursery.employeesIDs().size;
	const CL = V.cribs.length;

	const medianNannyIntelligence = NL ? findMedianNannyIntelligence() : null;
	const medianNannyIntelligenceImplant = NL ? findMedianNannyIntelligenceImplant() : null;

	for (const child of V.cribs) {
		const childDiv = App.UI.DOM.appendNewElement("div", frag, '', ["child-section"]);

		childDiv.append(childGrowTime(child));

		if (child.actualAge >= 3) {
			if (Matron) {
				if (Matron.fetish !== Fetish.NONE) {
					childDiv.append(matronFetishEffects(child));
				}

				childDiv.append(matronEducationEffects(child));
			}

			if (NL > 0) {
				const randomNanny = NL > 1 ? jsRandom(0, nannies.length - 1) : 0;
				const nanny = nannies[randomNanny];

				if (nanny.fetish !== Fetish.NONE) {
					childDiv.append(nannyFetishEffects(child, nanny));
				}

				childDiv.append(nannyEducationEffects(child));
			}

			if (multipleChildrenOverTargetAge(V.cribs.findIndex(c => c.ID === child.ID))) {
				childDiv.append(childFriendshipRivalries(child));
			}

			// TODO: rework these entirely
			if (Matron || nannies) {
				childDiv.appendChild(weightRulesEffects(child));
				childDiv.appendChild(musclesRulesEffects(child));
			}
		} else {
			// TODO:
		}
	}

	function matronFetishEffects(child) {
		const chance = jsRandom(1, 100);

		if ((chance > 90 && child.fetish === Fetish.NONE) || chance > 95) {
			child.fetish = Matron.fetish;

			return `${child.slaveName} has taken a few cues from ${Matron.slaveName}, and ${newChildFetish(child.fetish)}. `;
		}
	}

	function matronEducationEffects(child) {
		// TODO: expand this
		const {he, him, his} = getPronouns(Matron);

		const theChildren = CL > 1 ? `the children` : `${child.slaveName}`;

		if (Matron.intelligence + Matron.intelligenceImplant > 65) {
			child.intelligenceImplant += 3;

			return `${Matron.slaveName} is so intelligent and well-educated that ${he} is able to teach ${theChildren} very effectively, and so ${CL > 1 ? `they gradually grow` : `${child.slaveName} gradually grows`} smarter. `;
		} else if (Matron.intelligenceImplant > 20) {
			child.intelligenceImplant += 2;

			return `${Matron.slaveName}'s education makes up for the fact that ${he} isn't the brightest and allows ${him} to teach ${theChildren} quite effectively, and so ${CL > 1 ? `they grow` : `${child.slaveName} grows`} a bit smarter. `;
		} else if (Matron.intelligence > 50) {
			child.intelligenceImplant += 2;

			return `Though ${Matron.slaveName} has had little to no formal education, ${his} natural brilliance allows ${him} to teach ${theChildren} quite effectively, and so ${CL > 1 ? `they grow` : `${child.slaveName} grows`} a bit smarter. `;
		} else {
			const totalSpan = App.UI.DOM.makeElement("span", `${Matron.slaveName} isn't the brightest and not well educated, `);
			const damageSpan = App.UI.DOM.makeElement("span", `damaging the amount of real education ${theChildren} receive. `, ["red"]);

			child.intelligenceImplant--;

			totalSpan.appendChild(damageSpan);

			return totalSpan;
		}
	}

	function nannyFetishEffects(child, slave) {
		const {he} = getPronouns(child);
		const chance = jsRandom(1, 100);

		if (chance > 85) {
			if (child.fetish === Fetish.NONE) {
				child.fetish = slave.fetish;

				return `${slave.slaveName} has left quite an impression on ${child.slaveName}, and ${he} ${newChildFetish(child.fetish)}. `;
			} else {
				if (chance > 90) {
					child.fetish = slave.fetish;

					return `${child.slaveName} seems to have taken to ${slave.slaveName}'s example, and ${newChildFetish(child.fetish)}. `;
				}
			}
		}
	}

	function nannyEducationEffects(child) {
		// TODO: redo this entire section
		// TODO: expand this
		const firstNanny = nannies[0];
		const theNanniesAre = NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`;
		const theChildren = CL > 1 ? `the children` : child.slaveName;

		if (medianNannyIntelligence + medianNannyIntelligenceImplant > 65) {
			child.intelligenceImplant += 3;

			return `${theNanniesAre} very intelligent and well educated and are able to teach ${theChildren} very effectively. `;
		} else if (medianNannyIntelligence > 50) {
			child.intelligenceImplant += 2;

			return `${theNanniesAre} very intelligent and able to teach ${theChildren} quite effectively. `;
		} else if (medianNannyIntelligenceImplant > 25) {
			child.intelligenceImplant += 2;

			return `${theNanniesAre} very well educated and able to teach ${theChildren} quite effectively. `;
		} else if (medianNannyIntelligenceImplant > 15) {
			child.intelligenceImplant++;

			return `${theNanniesAre} well educated and able to teach ${theChildren} fairly effectively. `;
		}
	}

	function weightRulesEffects(child) {
		// TODO: redo this entire section
		// TODO: double check these classes, make sure they make sense
		const span = document.createElement("span");
		const {he, He, His} = getPronouns(child);

		if (V.nurseryWeight) {
			const firstNanny = NL > 0 ? nannies[0] : null;
			const caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName;

			if (V.nurseryWeightSetting === 1) {
				const weightSpan = App.UI.DOM.makeElement("span", 'rapid weight gain.', ["health", "dec"]);

				if (child.weight < 200) {
					child.weight += 5;
				}

				span.append(`${He} is being fed an excessive amount of food, causing`, weightSpan);
			} else if (V.nurseryWeightSetting === 2) {
				const weightSpan = App.UI.DOM.makeElement("span", `decreases the amount of food ${he} eats. `, ["improvement"]);

				if (child.weight > 10) {
					child.weight--;

					span.append(`${caretaker} notices ${he} is overweight and `, weightSpan);
				} else if (child.weight <= -10) {
					const weightSpan = App.UI.DOM.makeElement("span", `increases the amount of food ${he} eats. `, ["improvement"]);

					child.weight++;

					span.append(`${caretaker} notices ${he} is underweight and `, weightSpan);
				} else {
					const weightSpan = App.UI.DOM.makeElement("span", 'currently a healthy weight;', ["change", "positive"]);

					span.append(`${He} is `, weightSpan, ` efforts will be made to maintain it. `);
				}
			} else if (V.nurseryWeightSetting === 0) {
				if (child.weight > -20) {
					const weightSpan = App.UI.DOM.makeElement("span", 'quickly sheds its gained weight.', ["health", "dec"]);

					child.weight -= 40;

					span.append(`${His} developing body `, weightSpan);
				}
			}
		} else {
			if (child.weight > -20) {
				const weightSpan = App.UI.DOM.makeElement("span", 'quickly sheds its gained weight. ', ["health", "dec"]);

				child.weight -= 40;

				span.append(`${His} developing body `, weightSpan);
			}
		}

		return span;
	}

	function musclesRulesEffects(child) {
		const div = document.createElement("div");

		// TODO: rewrite these
		// FIXME: this entire section needs a rewrite - numbers and text don't line up at all
		if (V.nurseryMuscles) {
			const firstNanny = NL > 0 ? nannies[0] : null;
			const caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName;
			const {His, He, he} = getPronouns(child);

			const muscleSpan = App.UI.DOM.makeElement("div", 'rapid muscle development.', ["improvement"]);

			div.append(`${He} is being worked out as often as possible, resulting in `, muscleSpan);

			if (V.nurseryMusclesSetting === 2) {
				const muscleSpan = App.UI.DOM.makeElement("span", `decreases the amount of exercise ${he} receives. `, ["improvement"]);

				if (child.muscles > 100) {
					child.muscles -= 5;
				}

				div.append(`${caretaker} notices ${he} is overly muscular and `, muscleSpan);
			} else if (V.nurseryMusclesSetting === 1) {
				if (child.muscles < -10) {
					const muscleSpan = App.UI.DOM.makeElement("span", `increases the amount of exercise ${he} receives. `, ["improvement"]);

					child.muscles--;

					div.append(`${caretaker} notices ${he} is weak and `, muscleSpan);
				} else if (child.muscles > 10) {
					const muscleSpan = App.UI.DOM.makeElement("span", 'a healthy musculature;', ["change", "positive"]);

					child.muscles++;

					div.append(`${He} has `, muscleSpan, ` efforts will be made to maintain it. `);
				} else {
					const muscleSpan = App.UI.DOM.makeElement("span", 'quickly loses its gained muscle.', ["health", "dec"]);

					div.append(`${His} developing body `, muscleSpan);
				}
			} else if (V.nurseryMusclesSetting === 0) {
				const muscleSpan = App.UI.DOM.makeElement("span", 'quickly loses its gained muscle.', ["health", "dec"]);

				if (child.muscles > 100) {
					child.muscles -= 40;
					div.append(`${His} developing body `, muscleSpan);
				}
			}
		}

		return div;
	}

	function childFriendshipRivalries(child) {
		const el = new DocumentFragment();
		const cribsCopy = Array.from(V.cribs);

		cribsCopy.splice(V.cribs.findIndex(c => c.ID === child.ID));

		for (const target of cribsCopy) {
			const becomeFriends = () => `${child.slaveName} and ${target.slaveName} have realized that they have more in common that they originally thought, and have become friends. `;
			const becomeRivals = () => `${child.slaveName} and ${target.slaveName} have more differences between them than they could put aside and have become rivals. `;
			const haveSameFetish = () => child.fetish === target.fetish && child.fetish !== Fetish.NONE;
			const haveSameBehavioralQuirk = () => child.behavioralQuirk && child.behavioralQuirk === target.behavioralQuirk && child.behavioralQuirk !== BehavioralQuirk.NONE;
			const haveSameSexualQuirk = () => child.sexualQuirk && child.sexualQuirk === target.sexualQuirk && child.sexualQuirk !== SexualQuirk.NONE;

			const div = document.createElement("div");

			const {his} = getPronouns(target);
			const chance = jsRandom(1, 100);

			let friend = 0;
			let rival = 0;

			if (target.actualAge >= 3) {
				if (haveSameFetish()) {
					div.append(`${sameFetish(child, target)}, a fact over which they bond. `);

					friend++;
				}

				if (haveSameBehavioralQuirk()) {	// TODO:
					div.append(`Since ${sameBehavioralQuirk(child, target)}, they learn to get along a bit better. `);

					friend++;
				}

				if (haveSameSexualQuirk()) {
					div.append(`Because ${sameSexualQuirk(child, target, haveSameBehavioralQuirk())}, the two grow a bit closer. `);

					friend++;
				}

				if (target.fetish === Fetish.SADIST || target.fetish === Fetish.DOM) {
					div.append(`${target.slaveName} is a ${target.fetish}, and ${child.slaveName} is often ${his} target, which ${child.slaveName} doesn't particularly like. `);

					rival++;
				} else if (child.fetish === Fetish.SADIST || child.fetish === Fetish.DOM) {
					div.append(`${child.slaveName} is a ${child.fetish}, and ${target.slaveName} is often ${his} target, which ${target.slaveName} doesn't particularly like. `);

					rival++;
				}

				if (areRelated(child, target) || areCousins(child, target)) {
					if (areRelated(child, target)) {
						if (rival) {
							div.append(`${child.slaveName} and ${target.slaveName} are siblings, and find it difficult to really stay mad at each other, and they make up their differences somewhat. `);

							friend += 2;
						} else {
							div.append(`${child.slaveName} and ${target.slaveName} are siblings, a fact that draws them closer together. `);

							friend += 2;
						}
					} else {
						if (rival) {
							div.append(`${child.slaveName} and ${target.slaveName} are cousins, and find it difficult to really stay mad at each other, and they make up their differences somewhat. `);

							friend++;
						} else {
							div.append(`${child.slaveName} and ${target.slaveName} are cousins, a fact that draws them closer together. `);

							friend++;
						}
					}
				}

				if (friend) {
					if (rival) {
						if (friend > rival && child.relationshipTarget !== target.ID) {
							if (chance > 75) {
								div.append(becomeFriends());

								child.relationship = 1;
								child.relationshipTarget = target.ID;

								target.relationship = 1;
								target.relationshipTarget = child.ID;
							}
						}
					} else {
						if (chance > 60) {
							div.append(becomeRivals());

							child.relationship = 1;
							child.relationshipTarget = target.ID;

							target.relationship = 1;
							target.relationshipTarget = child.ID;
						}
					}
				}

				if (rival) {
					if (friend) {
						if (rival > friend) {
							if (chance > 75) {
								div.append(becomeRivals());
							}
						}
					} else {
						if (chance > 60) {
							div.append(becomeFriends());
						}
					}
				}
			}

			el.append(div);
		}
		return el;

		function sameFetish(child, target) {
			switch (child.fetish) {
				case Fetish.SUBMISSIVE:
					return `${child.slaveName} and ${target.slaveName} are both sexually submissive`;
				case Fetish.CUMSLUT:
					return `Neither ${child.slaveName} nor ${target.slaveName} can get enough cum`;
				case Fetish.HUMILIATION:
					return `Both ${child.slaveName} and ${target.slaveName} have a fetish for humiliation`;
				case Fetish.BUTTSLUT:
					return `Neither ${child.slaveName} nor ${target.slaveName} can get enough assplay`;
				case Fetish.BOOBS:
					return `${child.slaveName} and ${target.slaveName} both love breastplay`;
				case Fetish.SADIST:
					return `Both ${child.slaveName} are ${target.slaveName} are sadists`;
				case Fetish.MASOCHIST:
					return `${child.slaveName} and ${target.slaveName} are both masochists`;
				case Fetish.DOM:
					return `Both ${child.slaveName} and ${target.slaveName} are sexually dominant`;
				case Fetish.PREGNANCY:
					return `The idea of pregnancy titillates both ${child.slaveName} and ${target.slaveName}`;
				default:
					throw Error(`Unexpected .fetish value of "${child.fetish}" in sameFetish(). Please report this.`);
			}
		}

		function sameBehavioralQuirk(child, target) {
			switch (child.behavioralQuirk) {
				case BehavioralQuirk.CONFIDENT:
					return `${child.slaveName} and ${target.slaveName} are both naturally confident`;
				case BehavioralQuirk.CUTTING:
					return `both ${child.slaveName} and ${target.slaveName} have a cutting wit about them`;
				case BehavioralQuirk.FUNNY:
					return `${child.slaveName} and ${target.slaveName} can both make the other laugh`;
				case BehavioralQuirk.FITNESS:
					return `${child.slaveName} and ${target.slaveName} both love to try to stay in shape`;
				case BehavioralQuirk.ADORESWOMEN:
					return `${child.slaveName} and ${target.slaveName} both adore women`;
				case BehavioralQuirk.ADORESMEN:
					return `both ${child.slaveName} are ${target.slaveName} adore men`;
				case BehavioralQuirk.INSECURE:
					return `${child.slaveName} and ${target.slaveName} are both equally insecure`;
				case BehavioralQuirk.SINFUL:
					return `both ${child.slaveName} and ${target.slaveName} love breaking cultural and religious mores`;
				case BehavioralQuirk.ADVOCATE:
					return `${child.slaveName} and ${target.slaveName} can both make a strong case for slavery`;
				default:
					throw Error(`Unexpected .behavioralQuirk value of "${child.behavioralQuirk}" in sameBehavioralQuirk(). Please report this.`);
			}
		}

		// TODO: incorporate minimumSlaveAge
		function sameSexualQuirk(child, target, sameQuirk = false) {
			switch (child.sexualQuirk) {
				case SexualQuirk.GAGFUCK:
					return `${sameQuirk ? `the two also` : `${child.slaveName} and ${target.slaveName} both`} love having their little throats fucked`;
				case SexualQuirk.PAINAL:
					return `${sameQuirk ? `neither` : `neither ${child.slaveName} nor ${target.slaveName}`} can get enough painal`;
				case SexualQuirk.STRUGGLE:
					return `${sameQuirk ? `the two also` : `${child.slaveName} and ${target.slaveName} both`} love to put up a struggle during sex`;
				case SexualQuirk.TEASE:
					return `${sameQuirk ? `the two are also both teases` : `${child.slaveName} and ${target.slaveName} are both teases`}`;
				case SexualQuirk.ROMANTIC:
					return `${sameQuirk ? `the two also` : `${child.slaveName} and ${target.slaveName} both`} see the world from under a romantic lens`;
				case SexualQuirk.PERVERT:
					return `${sameQuirk ? `the two are also` : `${child.slaveName} and ${target.slaveName} are both`} big-time perverts`;
				case SexualQuirk.CARING:
					return `${sameQuirk ? `the two also` : `${child.slaveName} and ${target.slaveName} both`} care about their partners`;
				case SexualQuirk.UNFLINCHING:
					return `${sameQuirk ? `the two can also` : `${child.slaveName} and ${target.slaveName} can both`} take whatever their partner might throw at them `;
				case SexualQuirk.SIZEQUEEN:
					return `${sameQuirk ? `the two also` : `${child.slaveName} and ${target.slaveName} both`} have a love for huge cock`;
				default:
					throw Error(`Unexpected .sexualQuirk value of "${child.sexualQuirk}" in sameSexualQuirk(). Please report this.`);
			}
		}
	}

	function newChildFetish(fetish = "none") {
		switch (fetish) {
			case Fetish.SUBMISSIVE:
				return `is now sexually submissive`;
			case Fetish.CUMSLUT:
				return `is now a cumslut`;
			case Fetish.HUMILIATION:
				return `now has a fetish for humiliation`;
			case Fetish.BUTTSLUT:
				return `is now a buttslut`;
			case Fetish.BOOBS:
				return `now has a fetish for all things breast-related`;
			case Fetish.SADIST:
				return `now gets off on causing pain`;
			case Fetish.MASOCHIST:
				return `now gets off on pain`;
			case Fetish.DOM:
				return `is now very sexually dominant`;
			case Fetish.PREGNANCY:
				return `has developed a fascination for all things pregnancy-related`;
			default:
				throw Error(`Unexpected .fetish value of "${fetish}" in newChildFetish(). Please report this.`);
		}
	}

	function childGrowTime(child) {
		const nameSpan = App.UI.DOM.makeElement("span", child.slaveName, ["pink"]);
		const limeSpan = App.UI.DOM.makeElement("span", 'ready for release.', ["lime"]);
		const mainSpan = document.createElement("span");

		const {He} = getPronouns(child);

		if (child.growTime > 0) {
			mainSpan.append(nameSpan, ` is growing steadily. ${He} will be ready for release in about ${years(child.growTime)}. `);
		} else {
			mainSpan.append(nameSpan, ' is ', limeSpan, ` ${He} will be removed from ${V.nurseryName} upon your approach. `);
		}

		return mainSpan;
	}

	function findMedianNannyIntelligence() {
		return median(nannies.map(n => n.intelligence));
	}

	function findMedianNannyIntelligenceImplant() {
		return median(nannies.map(n => n.intelligenceImplant));
	}

	/**
	 * Checks if there are more than one children over the target age in the Nursery
	 * @param {number} index
	 * @param {number} [age=3]
	 */
	function multipleChildrenOverTargetAge(index, age = 3) {
		const cribsCopy = Array.from(V.cribs);

		cribsCopy.splice(index, 1);

		return V.cribs.length > 1 && cribsCopy.some(c => c.actualAge >= age);
	}

	return frag;
};


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

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

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

		if (S.Nurse) {
			if (S.Nurse.health.condition < 100) {
				improveCondition(S.Nurse, 20);
			}
			if (S.Nurse.devotion <= 60) {
				S.Nurse.devotion++;
			}
			if (S.Nurse.trust < 60) {
				S.Nurse.trust++;
			}

			if (S.Nurse.rules.living !== "luxurious") {
				S.Nurse.rules.living = "luxurious";
			}
			if (S.Nurse.rules.rest !== "restrictive") {
				S.Nurse.rules.rest = "restrictive";
			}

			S.Nurse.devotion += devBonus;
			if (S.Nurse.fetishStrength <= 95) {
				if (S.Nurse.fetish !== Fetish.DOM) {
					if (fetishChangeChance(S.Nurse) > jsRandom(0, 100)) {
						FLsFetish = 1;
						S.Nurse.fetishKnown = 1;
						S.Nurse.fetish = Fetish.DOM;
						S.Nurse.fetishStrength = 10;
					}
				} else if (S.Nurse.fetishKnown === 0) {
					FLsFetish = 1;
					S.Nurse.fetishKnown = 1;
				} else {
					FLsFetish = 2;
					S.Nurse.fetishStrength += 4;
				}
			}
			const {He, he, His, his, him, himself, wife} = getPronouns(S.Nurse);
			r.push(`${SlaveFullName(S.Nurse)} is serving as the clinical nurse.`);
			if (S.Nurse.relationship === -3 && S.Nurse.devotion > 50) {
				r.push(`${He} does ${his} best to be a caring and nurturing ${wife}.`);
				healthBonus += 2;
			}
			if (FLsFetish === 1) {
				r.push(`${His} job involves giving naked sex slaves orders for their own good. Even though most of these commands are medical rather than sexual, ${he} can be forgiven for not always seeing the difference, and becomes more dominant.`);
			} else if (FLsFetish === 2) {
				r.push(`Every new patient in the clinic is a new target for ${his} authority. <span class="fetish inc">${He} becomes more dominant.</span>`);
			}
			if (App.Data.Careers.Leader.nurse.includes(S.Nurse.career)) {
				r.push(`${He} has experience with medicine from ${his} life before ${he} was a slave, and can often recognize conditions before even the medical scanners can.`);
				idleBonus++;
				healthBonus++;
			} else if (S.Nurse.skill.nurse >= Constant.MASTERED_XP) {
				r.push(`${He} has experience with medicine from working for you, and can often recognize conditions before even the medical scanners can.`);
				idleBonus++;
				healthBonus++;
			} else {
				const skillIncrease = jsRandom(1, Math.ceil((S.Nurse.intelligence + S.Nurse.intelligenceImplant) / 15) + 8);
				r.push(slaveSkillIncrease('nurse', S.Nurse, skillIncrease));
			}
			if (S.Nurse.fetish === Fetish.DOM) {
				r.push(`${He} raps out commands with the confidence of long and partly sexual experience, so patients are inclined to follow even unpleasant medical instructions.`);
				idleBonus++;
				healthBonus++;
			}
			if (S.Nurse.muscles > 5) {
				r.push(`${He}'s strong enough to gently but firmly restrain resistant slaves, allowing ${him} to be sparing with the inescapable but less healthy restraints.`);
				idleBonus++;
				healthBonus++;
			}
			if (S.Nurse.intelligence + S.Nurse.intelligenceImplant > 50) {
				r.push(`The diagnostic equipment is state-of-the-art, but ${he}'s smart and perceptive enough that on occasion, ${he} can add meaningfully to its medical scans.`);
				idleBonus++;
				healthBonus++;
			}
			if (S.Nurse.face > 40) {
				r.push(`Patients rarely object to seeing ${his} gorgeous face hovering over them.`);
				idleBonus++;
				devBonus++;
			}
			if (S.Nurse.devotion >= 60) {
				healthBonus++;
			}
			for (const slave of slaves) {
				const {He2, His2, he2, his2, him2} = getPronouns(slave).appendSuffix('2');
				if (S.Nurse.rivalryTarget === slave.ID) {
					r.push(`${He} purposefully neglects the needs of ${his} ${rivalryTerm(S.Nurse)}, ${slave.slaveName}, <span class="health dec">hindering ${his2} recovery</span> and deepening their dislike for each other.`);
					slave.devotion--;
					slave.trust--;
					healthDamage(slave, 3);
					if (jsRandom(1, 100) > 65) {
						S.Nurse.rivalry++;
						slave.rivalry++;
					}
				} else if (S.Nurse.relationshipTarget === slave.ID) {
					r.push(`${He} dedicates most of ${his} attention to ${his} ${relationshipTerm(S.Nurse)}, ${slave.slaveName}, making sure ${he2} has everything ${he2} needs and more. This lavish attention detracts from ${his} overall effectiveness.`);
					idleBonus -= 3;
					slave.devotion++;
					slave.trust++;
					improveCondition(slave, 3);
				} else if (areRelated(S.Nurse, slave)) {
					r.push(`${He} makes sure to spend extra time caring for ${his} ${relativeTerm(S.Nurse, 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 aid the famous whore, ${slave.slaveName}, making sure to pay special attention to ${his2} worn holes.`);
						improveCondition(slave, 2);
						break;
					case "$He is a famed Free Cities slut, and can please anyone.":
						r.push(`${He} does ${his} best to aid the famous entertainer, ${slave.slaveName}, making sure ${he2} can show off as soon as possible.`);
						improveCondition(slave, 2);
						break;
					case "$He is remembered for winning best in show as a cockmilker.":
						if (slave.balls > 4 && slave.dick !== 0) {
							r.push(`${He} does ${his} best to aid the dribbling ${slave.slaveName}, paying special attention to ${his2} huge cock and balls as well as making sure to milk ${his2}`);
							if (canAchieveErection(slave)) {
								r.push(`erect`);
							}
							r.push(`dick hourly.`);
							improveCondition(slave, 4);
							if (jsRandom(1, 100) > 65 && canTaste(S.Nurse)) {
								if (S.Nurse.fetish === Fetish.NONE) {
									r.push(`It's not uncommon for ${him} to receive a load to the face; before long, <span class="fetish gain">${he} starts to enjoy the taste.</span>`);
									S.Nurse.fetish = Fetish.CUMSLUT;
								} else if (S.Nurse.fetish === Fetish.CUMSLUT) {
									r.push(`${canSmell(S.Nurse) ? `The smell of ${his2}` : `${His2}`} semen is irresistible to ${him} and sometimes ${he} can't help but`);
									if (slave.chastityPenis === 0 && slave.rules.release.facilityLeader === 1) {
										r.push(`wrap ${his} lips around ${him2} and sample the stuff directly,`);
										seX(S.Nurse, "oral", slave, "penetrative");
									} else {
										r.push(`catch a little of it in a cup for further "analysis",`);
									}
									r.push(`<span class="fetish inc">further feeding ${his} cum fetishism.</span>`);
									S.Nurse.fetishStrength = Math.clamp(S.Nurse.fetishStrength + 4, 0, 100);
								}
							}
						}
						break;
					case "$He is remembered for winning best in show as a dairy cow.":
						if (slave.lactation > 0 && App.Medicine.fleshSize(slave, 'boobs') > 6000) {
							r.push(`${He} does ${his} best to aid the leaking ${slave.slaveName}, paying special attention to ${his2} huge breasts as well as making sure to milk ${him2} hourly.`);
							improveCondition(slave, 4);
							slave.lactationDuration = 2;
							if (jsRandom(1, 100) > 65 && canTaste(S.Nurse)) {
								if (S.Nurse.fetish === Fetish.NONE) {
									r.push(`Those lovely globes are just too tantalizing for ${him} to resist, <span class="fetish gain">${he} can't help but take a drink ${himself}.</span>`);
									S.Nurse.fetish = Fetish.BOOBS;
								} else if (S.Nurse.fetish === Fetish.BOOBS) {
									r.push(`${He} takes the opportunity to <span class="fetish gain">feed ${his} breast fetishism</span> by getting up close and personal with ${his2} prized udders.`);
									S.Nurse.fetishStrength = Math.clamp(S.Nurse.fetishStrength + 4, 0, 100);
								}
							}
						}
						break;
					case "$He is remembered for winning best in show as a breeder.":
						if (slave.bellyPreg >= 1500) {
							r.push(`${He} does ${his} best to aid the pregnant ${slave.slaveName}, paying special attention to ${his2} swollen belly and the welfare of the life within.`);
							improveCondition(slave, 6);
						} else if (slave.ovaries === 1 || slave.mpreg === 1) {
							r.push(`${He} does ${his} best to aid the breeder ${slave.slaveName}, paying special attention to ${his2} fertility and reproductive organs.`);
							improveCondition(slave, 4);
						} else {
							r.push(`${He} lays out plans on how to restore the breeder ${slave.slaveName} to ${his2} former gravid glory.`);
						}
						break;
				}
				if (slave.bellyImplant > -1 && V.clinicInflateBelly === 1) {
					r.push(`
${slave.slaveName} spent a lot of time during the week under IV-like stands with bags of inert filler steadily flowing into ${his2} belly implant, slowly pushing ${his2} belly further and further out. Careful attention, along with several drug injections, were used to make sure ${his2} body was able to safely adjust to the implant's rapid growth.`);
					healthDamage(slave, 10);
					slave.bellyImplant += 5000;
					if (slave.devotion > 50) {
						slave.devotion += 4;
						slave.trust += 3;
					} else if (slave.devotion >= -20) {
						slave.trust -= 5;
					} else {
						slave.devotion -= 5;
						slave.trust -= 10;
					}
					if (slave.bellyImplant > (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000)) {
						slave.bellyImplant = (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000);
						r.push(`${He2} is filled to the maximum that ${his2} implant can stand.`);
					}
					r.push(`</div>`);
				}
				if (slave.pregKnown === 1 && slave.preg < slave.pregData.normalBirth && slave.pregControl === GestationDrug.FAST) {
					r.push(`<div class="indent"><span class="slave-name">${slave.slaveName}</span> spends most of ${his2} time on bedrest being filled with rapid gestation agents and concentrated slave food. All ${he2} can do is`);
					if (hasAnyArms(slave) && canSee(slave)) {
						r.push(`watch and feel ${his2} belly pushing further and further out with life.`);
					} else if (canSee(slave)) {
						r.push(`watch ${his2} belly bulging further and further out with life.`);
					} else if (hasAnyArms(slave)) {
						r.push(`feel ${his2} belly pushing further and further out with life beneath ${his2} fingers.`);
					} else {
						r.push(`feel the ever-growing pressure inside ${his2} abdomen.`);
					}
					r.push(`Careful attention, along with numerous drug injections, are used to make sure ${his2} body is able to safely adjust to ${his2} pregnancy's rapid growth.`);
					healthDamage(slave, 10);
					if (slave.devotion > 50) {
						slave.devotion += 2;
						slave.trust += 1;
					} else if (slave.devotion >= -20) {
						slave.trust -= 5;
					} else {
						slave.devotion -= 5;
						slave.trust -= 10;
					}
					if (slave.preg >= slave.pregData.normalBirth && slave.pregControl === GestationDrug.FAST) {
						slave.pregControl = "none";
						r.push(`${His2} child is ready to pop out of ${his2} womb; <span class="yellow">${his2} course of rapid gestation agents is finished.</span>`);
					}
					r.push(`</div>`);
				} else if (slave.preg > 2 && slave.pregKnown === 0) {
					r.push(`During ${his} tests, ${he} discovers that ${slave.slaveName} <span class="lime">is pregnant.</span>`);
					slave.pregKnown = 1;
				}
			}

			const pMod = App.SlaveAssignment.PartTime.efficiencyModifier(S.Nurse);
			healthBonus *= pMod;
			idleBonus *= pMod;
			if (pMod < 1) {
				r.push(`Some part of ${his} day is taken up by ${his} part-time job, making ${him} less effective.`);
			}

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

		return r.join(" ");
	}

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

	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 receiving treatment in the clinic.</strong>`);
		} else {
			$(intro).append(`<strong>There is one slave receiving treatment in the clinic.</strong>`);
		}
	}

	if (S.Nurse) {
		const slave = App.SlaveAssignment.reportSlave(S.Nurse);
		tired(slave);
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0 || (V.experimental.favSeparateReport === 1 && V.favorites.includes(slave.ID))) {
			const nurseEntry = App.UI.DOM.appendNewElement("div", frag, '', ["slave-report"]);
			const artSpan = App.UI.DOM.appendNewElement("span", nurseEntry);
			nurseEntry.append(App.SlaveAssignment.saSlaveIntro(slave, `is serving as the clinical nurse.`));
			nurseEntry.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)) {
		if (slave.devotion < 45) {
			slave.devotion += 4;
		}
		slave.devotion += devBonus;

		if (slave.health.condition < -80) {
			improveCondition(slave, 20 + (V.curativeUpgrade * 10) + healthBonus);
		} else if (slave.health.condition < -40) {
			improveCondition(slave, 10 + (V.curativeUpgrade * 10) + healthBonus);
		} else if (slave.health.condition < 0) {
			improveCondition(slave, 7 + (V.curativeUpgrade * 10) + healthBonus);
		} else if (slave.health.condition < 90) {
			improveCondition(slave, 3 + (V.curativeUpgrade * 10) + healthBonus);
		}

		/* the clinic is a well-equipped medical facility and can allow the Nurse or player to
		* directly cure serious wounds caused by injury and surgery with minimal side effects */
		if (slave.health.shortDamage >= 10) {
			if (S.Nurse) {
				healthCure(slave, 5 + healthBonus);
			} else {
				healthCure(slave, V.PC.skill.medicine / 15); /* maximum of 6...even a bad full-time nurse will be better than a player doctor */
			}
		}

		switch (V.clinicDecoration) {
			case "Eugenics":
			case "Gender Fundamentalist":
			case "Gender Radicalist":
			case "Hedonistic":
			case "Intellectual Dependency":
			case "Maturity Preferentialist":
			case "Paternalist":
			case "Petite Admiration":
			case "Repopulationist":
			case "Slimness Enthusiast":
			case "Statuesque Glorification":
			case "Youth Preferentialist":
				slave.rules.living = "luxurious";
				break;
			case "Arabian Revivalist":
			case "Aztec Revivalist":
			case "Chattel Religionist":
			case "Chinese Revivalist":
			case "Edo Revivalist":
			case "Egyptian Revivalist":
			case "Roman Revivalist":
			case "Antebellum Revivalist":
				slave.rules.living = "normal";
				break;
			default:
				slave.rules.living = "spare";
		}

		if (S.Nurse) {
			if (V.clinicSpeedGestation === 1 && slave.pregKnown === 1) {
				slave.pregControl = GestationDrug.FAST;
			}
			if (slave.chem > 10 && V.clinicUpgradeFilters >= 1) {
				if (slave.health.health > -50 && (V.clinicUpgradePurge > 0)) {
					slave.chem -= 100 * V.clinicUpgradePurge;
					healthDamage(slave, 15);
				}
				slave.chem = Math.max(slave.chem - 5, 0);
			}
			if (slave.lactation > 0) {
				slave.boobs -= slave.boobsMilk;
				slave.boobsMilk = 0;
			}
		}

		/* Evaluate why the slave even needs to be here, and eject her if she doesn't */
		const {He, he, his} = getPronouns(slave);
		const remainReasons = [];
		if (slave.health.illness > 0) {
			remainReasons.push(`since ${he} is still sick`);
		}
		if (slave.health.shortDamage >= 20) {
			remainReasons.push(`to recover from ${his} injuries`);
		}
		if (slave.health.condition < -20) {
			remainReasons.push(`since ${his} health is still poor`);
		} else if (slave.health.condition <= 40) {
			remainReasons.push(`since ${his} health could be better`);
		}
		if (S.Nurse) {
			if (slave.chem > 15 && V.clinicUpgradeFilters === 1) {
				remainReasons.push(`to have unhealthy chemicals flushed from ${his} system`);
			}
			if (slave.pregKnown === 1 && (V.clinicSpeedGestation > 0 || slave.pregControl === GestationDrug.FAST)) {
				remainReasons.push(`to hurry ${his} pregnancy along safely`);
			}
			if (V.clinicObservePregnancy !== 0) {
				const highRisk = (slave.pregAdaptation * 1000 < slave.bellyPreg && slave.geneMods.progenitor !== 1) || (slave.geneMods.rapidCellGrowth !== 1 && slave.bellyPreg >= 100000 && slave.belly > (slave.pregAdaptation * 3200) && (slave.bellyPreg >= 500000 || slave.wombImplant !== "restraint"));
				const closeToGivingBirth = slave.preg > slave.pregData.normalBirth / 1.33;
				if (highRisk || (V.clinicObservePregnancy === 1 && closeToGivingBirth)) {
					remainReasons.push(`to wait for childbirth`);
				}
			}
			if (V.clinicInflateBelly > 0 && slave.bellyImplant >= 0 && (slave.bellyImplant <= (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))) {
				remainReasons.push(`as ${his} implants can still receive more filling`);
			}
		}

		if (remainReasons.length === 0) {
			const reassignment = App.UI.DOM.appendNewElement("p", frag, '');
			let r = [];
			r.push(`<span class="slave-name">${slave.slaveName}</span> has been cured${(S.Nurse && V.clinicUpgradeFilters > 0) ? ' and purified' : ''},`);
			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 {
					r.push(`so ${he} goes back to ${slave.assignment}.`);
				}
			} else {
				r.push(`so ${his} assignment has defaulted to rest.`);
				removeJob(slave, Job.CLINIC);
			}
			r.push(`</span>`);
			restedSlaves++;
			$(reassignment).append(r.join(" "));
			continue;
		}

		if (V.showEWD !== 0 || (V.experimental.favSeparateReport === 1 && V.favorites.includes(slave.ID))) {
			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', ["slave-report"]);
			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
			slaveEntry.append(App.SlaveAssignment.saSlaveIntro(slave, `is receiving treatment in ${V.clinicName}.`));

			let r = [];
			r.push(He, App.SlaveAssignment.rest(slave));
			if (remainReasons.length > 0) {
				r.push(`${He} stays in the clinic ${toSentence(remainReasons)}.`);
			}
			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.rest(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`, " been returned to ");
		App.UI.DOM.appendNewElement("span", rested, `health${(S.Nurse && V.clinicUpgradeFilters > 0) ? ' and purity' : ''}`, "green");
		rested.append(` and will be released from the clinic before the end of the week.`);

		if (V.clinicDecoration !== "standard") {
			const decorationEffects = App.UI.DOM.appendNewElement("p", frag, '', ["indent"]);
			$(decorationEffects).append(`${capFirstChar(V.clinicName)}'s ${V.clinicDecoration} atmosphere <span class="hotpink">had an impact on them</span> while they were getting treatment.`);
		}
	}

	App.EndWeek.saVars.flSex = new Set();

	return frag;
};

repo_name: Arkerthan/fc

license: mit


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

	const dj = S.DJ ? App.SlaveAssignment.reportSlave(S.DJ) : undefined;
	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.club);

	// Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep
	V.facility = V.facility || {};
	V.facility.club = initFacilityStatistics(V.facility.club);
	const clubStats = document.createElement("div");
	el.append(clubStats);

	if (S.DJ) {
		let FLsFetish = 0;
		r = [];
		if (S.DJ.health.condition < -80) {
			improveCondition(S.DJ, 20);
		} else if (S.DJ.health.condition < -40) {
			improveCondition(S.DJ, 15);
		} else if (S.DJ.health.condition < 0) {
			improveCondition(S.DJ, 10);
		} else if (S.DJ.health.condition < 90) {
			improveCondition(S.DJ, 7);
		}
		if (S.DJ.devotion <= 60) {
			S.DJ.devotion += 5;
		}
		if (S.DJ.trust < 60) {
			S.DJ.trust += 3;
		}
		if (S.DJ.fetishStrength <= 95) {
			if (S.DJ.fetish !== Fetish.HUMILIATION) {
				if (fetishChangeChance(S.DJ) > random(0, 100)) {
					FLsFetish = 1;
					S.DJ.fetishKnown = 1;
					S.DJ.fetish = Fetish.HUMILIATION;
					S.DJ.fetishStrength = 10;
				}
			} else if (S.DJ.fetishKnown === 0) {
				FLsFetish = 1;
				S.DJ.fetishKnown = 1;
			} else {
				FLsFetish = 2;
				S.DJ.fetishStrength += 4;
			}
		}
		if (S.DJ.rules.living !== "luxurious") {
			S.DJ.rules.living = "luxurious";
		}
		if (S.DJ.rules.rest !== "restrictive") {
			S.DJ.rules.rest = "restrictive";
		}
		/* Make sure we have registered living expenses as for any other slave */
		getSlaveStatisticData(S.DJ, V.facility.club);
		const {
			he, him, his, He, His, wife, himself
		} = getPronouns(S.DJ);
		r.push(`${SlaveFullName(S.DJ)} is performing as the DJ.`);
		if (S.DJ.relationship === -3 && S.DJ.devotion > 50) {
			r.push(`${He} tries ${his} best to be your energetic, cheerful ${wife}.`);
		}
		if (FLsFetish === 1) {
			r.push(`${He}'s expected to be the innovative, beautiful DJ spinning beats one minute, and come out of ${his} booth to grind on the floor the next; ${he} enjoys the interplay, and finds greater pleasure in exhibitionism.`);
		} else if (FLsFetish === 2) {
			r.push(`Every day ${he} gets to enjoy hundreds of stares on ${his} skin, and <span class="lightsalmon">becomes more of an exhibitionist.</span>`);
		}
		if (getBestVision(S.DJ) === 0) {
			r.push(`${His} lack of eyesight doesn't slow ${him} down; rather, it strengthens ${his} other senses. ${His} tracks have a distinct sound, since ${he} experiences noise as ${his} sight.`);
		}
		if (S.DJ.skill.entertainment <= 10) {
			r.push(`Though ${S.DJ.slaveName} does ${his} best to lead on the club, with ${his} lack of skill ${he} can do little.`);
		} else if (S.DJ.skill.entertainment <= 30) {
			r.push(`${S.DJ.slaveName}'s basic skills marginally <span class="green">improve</span> the atmosphere in ${V.clubName}.`);
		} else if (S.DJ.skill.entertainment <= 60) {
			r.push(`${S.DJ.slaveName}'s skills <span class="green">improve</span> the atmosphere in ${V.clubName}.`);
		} else if (S.DJ.skill.entertainment < 100) {
			r.push(`${S.DJ.slaveName}'s skills greatly <span class="green">improve</span> the atmosphere in ${V.clubName}.`);
		} else if (S.DJ.skill.entertainment >= 100) {
			r.push(`${S.DJ.slaveName}'s mastery immensely <span class="green">improves</span> the atmosphere in ${V.clubName}.`);
		}
		if (S.DJ.muscles > 5 && S.DJ.muscles <= 95) {
			r.push(`${His} toned body helps ${him} lead ${his} fellow club sluts by letting ${him} dance all night.`);
		}
		if (S.DJ.intelligence + S.DJ.intelligenceImplant > 15) {
			r.push(`${He}'s smart enough to make an actual contribution to the music, greatly enhancing the entire experience.`);
		}
		if (S.DJ.face > 95) {
			r.push(`${His} great beauty is a further draw, even when ${he}'s in ${his} DJ booth, but especially when ${he} comes out to dance.`);
		}
		if (App.Data.Careers.Leader.DJ.includes(S.DJ.career)) {
			r.push(`${He} has musical experience from ${his} life before ${he} was a slave, a grounding that gives ${his} tracks actual depth.`);
		} else if (S.DJ.skill.DJ >= Constant.MASTERED_XP) {
			r.push(`${He} has musical experience from working for you, giving ${his} tracks actual depth.`);
		} else if (S.DJ.skill.DJ > 120) {
			r.push(`${He} understands what tracks pair well with each other and how to tailor them to ${his} audience.`);
		} else if (S.DJ.skill.DJ > 60) {
			r.push(`${He} knows how to properly manage a playlist, allowing ${him} more time on the dance floor.`);
		} else if (S.DJ.skill.DJ > 20) {
			r.push(`${He} has basic musical knowledge and can keep the party going.`);
		}
		if (S.DJ.skill.DJ < Constant.MASTERED_XP) {
			const skillIncrease = random(1, Math.ceil((S.DJ.intelligence + S.DJ.intelligenceImplant) / 15) + 8);
			r.push(slaveSkillIncrease('DJ', S.DJ, skillIncrease));
		}
		App.Events.addNode(el, r, "p", "indent");

		if (slaves.length + V.clubSlavesGettingHelp < 10 * App.SlaveAssignment.PartTime.efficiencyModifier(dj) &&
			V.DJnoSex !== 1 && !slaveResting(S.DJ)) {
			App.Events.addNode(
				el,
				[`Since ${he} doesn't have enough sluts in ${V.clubName} to make it worthwhile for ${him} to be on stage 24/7, ${he} spends ${his} extra time slutting it up ${himself}. ${He} has sex with ${S.DJ.sexAmount} citizens, pleasing them immensely, since it's more appealing to fuck the DJ than some club slut.`],
				"div",
				"indent"
			);
			if ((V.experimental.favSeparateReport === 1 && V.favorites.includes(dj.ID)) || V.showEWD !== 0) {
				App.Events.addNode(
					el,
					[
						He,
						App.SlaveAssignment.serveThePublic(dj)
					],
					"div",
					"indent"
				);
			} else {
				App.SlaveAssignment.serveThePublic(dj);
			}
		}
	}

	if (slaves.length > 0) {
		r = [];
		if (slaves.length !== 1) {
			r.push(App.UI.DOM.makeElement("span", `The ${slaves.length} slaves pleasing citizens in ${V.clubName}`, "bold"));
		} else {
			r.push(App.UI.DOM.makeElement("span", `The one slave pleasing citizens in ${V.clubName}`, "bold"));
		}
		r.push(`worked hard to <span class="green">increase your reputation</span> this week.`);
		App.Events.addNode(el, r, "p", "indent");
	}

	if (S.DJ) {
		tired(dj);
		/* apply following SA passages to facility leader */
		if ((V.experimental.favSeparateReport === 1 && V.favorites.includes(dj.ID)) || V.showEWD !== 0) {
			const DJEntry = App.UI.DOM.appendNewElement("div", el, '', ["slave-report"]);
			const artSpan = App.UI.DOM.appendNewElement("span", DJEntry);
			DJEntry.append(App.SlaveAssignment.saSlaveIntro(dj, `is performing as the DJ in ${V.clubName}.`));
			DJEntry.append(App.SlaveAssignment.standardSlaveReport(dj, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, dj);
		} else {
			App.SlaveAssignment.standardSlaveReport(dj, true);
		}
	}

	if (slaves.length > 0) {
		for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
			if (slave.devotion <= 20 && slave.trust >= -20) {
				slave.devotion -= 5;
				slave.trust -= 5;
			} else if (slave.devotion < 45) {
				slave.devotion += 4;
			} else if (slave.devotion > 50) {
				slave.devotion -= 4;
			}

			if (slave.trust < 30) {
				slave.trust += 5;
			}

			if (slave.health.condition < -80) {
				improveCondition(slave, 20);
			} else if (slave.health.condition < -40) {
				improveCondition(slave, 15);
			} else if (slave.health.condition < 0) {
				improveCondition(slave, 10);
			} else if (slave.health.condition < 90) {
				improveCondition(slave, 7);
			}

			if (slave.rules.living !== "normal") {
				slave.rules.living = "normal";
			}

			if (V.showEWD || (V.experimental.favSeparateReport === 1 && V.favorites.includes(slave.ID))) {
				const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', ["slave-report"]);
				const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
				slaveEntry.append(App.SlaveAssignment.saSlaveIntro(slave, `is serving in ${V.clubName}.`));

				const {He} = getPronouns(slave);
				App.Events.addNode(
					slaveEntry,
					[
						He,
						App.SlaveAssignment.serveThePublic(slave),
					],
					"div",
					"indent"
				);
				slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
				App.SlaveAssignment.appendSlaveArt(artSpan, slave);
			} else {
				// discard return values silently
				App.SlaveAssignment.serveThePublic(slave);
				App.SlaveAssignment.standardSlaveReport(slave, true);
			}
		}

		App.Events.addNode(el, [App.Ads.report("club")], "p", "indent");

		// Record statistics gathering
		const b = V.facility.club;
		b.whoreIncome = 0;
		b.customers = 0;
		b.whoreCosts = 0;
		b.rep = 0;
		for (const si of b.income.values()) {
			b.whoreIncome += si.income;
			b.customers += si.customers;
			b.whoreCosts += si.cost;
			b.rep += si.rep;
		}
		b.adsCosts = V.clubAdsSpending;
		b.maintenance = V.club * V.facilityCost * (1.0 + 0.2 * V.clubUpgradePDAs);
		b.totalIncome = b.whoreIncome + b.adsIncome;
		b.totalExpenses = b.whoreCosts + b.adsCosts + b.maintenance;
		b.profit = b.totalIncome / b.totalExpenses;
		if (V.clubDecoration !== "standard") {
			App.Events.addNode(
				el,
				[
					`${capFirstChar(V.clubName)}'s customers enjoy <span class="green">having sex in ${V.clubDecoration} surroundings.</span>`
				],
				"p",
				"indent"
			);
		}

		// Club stats
		el.append(App.Facilities.Club.Stats(false));
		clubStats.append(App.Facilities.Club.Stats(true));
	}
	return el;
};


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

	let MMWorkout = 0;
	const BF = App.Data.misc.bioreactorFluids;
	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy);
	const DL = slaves.length;
	const balltacular = [];
	const careerForgotten = [];
	const desterilized = [];
	const hateFilled = [];
	const horrified = [];
	const skillsLost = [];
	const stupidified = [];
	const chemMinor = [];
	let anusesStretched = 0;
	let cumWeek = 0;
	let femCumWeek = 0;
	let milkWeek = 0;
	let boobtacular = 0;
	let chemSevere = 0;
	let intelligenceLost = 0;
	let mindbroken = 0;
	let vaginasStretched = 0;
	const inflatedSlaves = App.Facilities.Dairy.inflation();
	const dairySettings = V.dairyStimulatorsSetting + V.dairyFeedersSetting + V.dairyPregSetting;
	const restrainedInjected = V.dairyRestraintsSetting + V.injectionUpgrade;
	const boobsMultiplier = Math.trunc(V.injectionUpgrade * 2) + V.dairyRestraintsSetting + V.dairyFeedersSetting;
	V.bioreactorPerfectedID = 0;
	V.milkmaidDevotionBonus = 1;
	V.milkmaidHealthBonus = 0;
	V.milkmaidTrustBonus = 1;
	V.milkmaidDevotionThreshold = 45;
	V.milkmaidTrustThreshold = 35;
	let growth;
	let cashValue;
	let outputMilk;
	let outputCum;
	const dairyNameCaps = capFirstChar(V.dairyName);

	// Statistics gathering
	V.facility = V.facility || {};
	V.facility.dairy = initFacilityStatistics(V.facility.dairy);
	const dairyStats = document.createElement("div");
	el.append(dairyStats);

	if (V.MilkmaidID !== 0) {
		r = [];
		let milkmaidImpregnated = 0;
		let milkers = 0;
		let cummers = 0;
		let breeders = 0;
		let prostateStim = 0;

		for (const slave of slaves) {
			if (slave.lactation > 0) {
				milkers++;
			}
			if (slave.balls > 0 && slave.ballType === "human") {
				cummers++;
			}
			if (slave.bellyPreg >= 500 && V.dairyPregSetting > 0) {
				breeders++;
			}
			if (V.milkmaidImpregnates === 1 && canPenetrate(S.Milkmaid) && S.Milkmaid.pubertyXY === 1 && !slaveResting(S.Milkmaid)) {
				if (canImpreg(slave, S.Milkmaid) && slave.pregKnown === 0) {
					milkmaidImpregnated++;
					if (slave.mpreg === 1) {
						seX(slave, "anal", S.Milkmaid, "penetrative", 10);
					} else {
						seX(slave, "vaginal", S.Milkmaid, "penetrative", 10);
					}
					knockMeUp(slave, 100, 2, V.MilkmaidID);
				}
			}
			/* how much effort the MM must take to force a slave into a stall */
			if (slave.devotion <= 20) {
				MMWorkout++;
			}
			if (slave.trust < 20) {
				MMWorkout++;
			}
			if (slave.muscles >= 30 || slave.muscles < -30) {
				MMWorkout++;
			}
			let workoutEffect = 1;
			if (!canMove(slave)) { // big bonus if they can't move themselves and are fat as cows
				workoutEffect += 2;
			} else if (!canWalk(slave)) { // smaller bonus if they are fat as cows and need assistance with moving
				workoutEffect += 1;
			}
			if (slave.weight >= 70) {
				MMWorkout += workoutEffect;
			}
			if (slave.weight >= 160) {
				MMWorkout += workoutEffect;
			}
			if (slave.boobs >= 20000) {
				MMWorkout += workoutEffect;
			}
			if (slave.balls >= 30) {
				MMWorkout += workoutEffect;
			}
			if (slave.belly >= 5000) {
				MMWorkout += workoutEffect;
			}
			if (V.dairyStimulatorsSetting < 2 && S.Milkmaid.dick > 4 && canPenetrate(S.Milkmaid) && prostateStim !== 1) {
				if (slave.balls > 0 && slave.prostate > 0) {
					prostateStim = 1;
				}
			}
		}

		if (S.Milkmaid.health.condition < 90) {
			S.Milkmaid.curatives = 2;
		} else {
			S.Milkmaid.curatives = 0;
		}
		if (S.Milkmaid.diet !== Diet.HEALTHY) {
			(S.Milkmaid.diet = Diet.HEALTHY);
		}
		if (S.Milkmaid.devotion <= 60) {
			S.Milkmaid.devotion += 5;
		}
		if (S.Milkmaid.trust < 60) {
			S.Milkmaid.trust += 5;
		}
		if (S.Milkmaid.skill.oral > 0) {
			V.milkmaidDevotionBonus += Math.trunc(S.Milkmaid.skill.oral / 30);
		}
		if (S.Milkmaid.health.condition >= 80) {
			V.milkmaidHealthBonus++;
		}
		if (S.Milkmaid.rules.living !== "luxurious") {
			S.Milkmaid.rules.living = "luxurious";
		}
		if (S.Milkmaid.rules.rest !== "restrictive") {
			S.Milkmaid.rules.rest = "restrictive";
		}
		let FLsFetish = 0;
		if (S.Milkmaid.fetishStrength <= 95) {
			if (milkers >= cummers && milkers >= breeders) {
				if (S.Milkmaid.fetish !== Fetish.BOOBS) {
					if (fetishChangeChance(S.Milkmaid) > random(0, 100)) {
						FLsFetish = 1;
						S.Milkmaid.fetishKnown = 1;
						S.Milkmaid.fetish = Fetish.BOOBS;
						S.Milkmaid.fetishStrength = 10;
					}
				} else if (S.Milkmaid.fetishKnown === 0) {
					FLsFetish = 1;
					S.Milkmaid.fetishKnown = 1;
				} else {
					FLsFetish = 2;
					S.Milkmaid.fetishStrength += 4;
				}
			} else if (cummers >= breeders) {
				if (S.Milkmaid.fetish !== Fetish.CUMSLUT) {
					if (fetishChangeChance(S.Milkmaid) > random(0, 100)) {
						FLsFetish = 3;
						S.Milkmaid.fetishKnown = 1;
						S.Milkmaid.fetish = Fetish.CUMSLUT;
						S.Milkmaid.fetishStrength = 10;
					}
				} else if (S.Milkmaid.fetishKnown === 0) {
					FLsFetish = 3;
					S.Milkmaid.fetishKnown = 1;
				} else {
					FLsFetish = 4;
					S.Milkmaid.fetishStrength += 4;
				}
			} else {
				if (S.Milkmaid.fetish !== Fetish.PREGNANCY) {
					if (fetishChangeChance(S.Milkmaid) > random(0, 100)) {
						FLsFetish = 5;
						S.Milkmaid.fetishKnown = 1;
						S.Milkmaid.fetish = Fetish.PREGNANCY;
						S.Milkmaid.fetishStrength = 10;
					}
				} else if (S.Milkmaid.fetishKnown === 0) {
					FLsFetish = 5;
					S.Milkmaid.fetishKnown = 1;
				} else {
					FLsFetish = 6;
					S.Milkmaid.fetishStrength += 4;
				}
			}
		}
		getSlaveStatisticData(S.Milkmaid, V.facility.dairy);
		const {
			he, him, his, He, His, wife, girl
		} = getPronouns(S.Milkmaid);
		r.push(`${SlaveFullName(S.Milkmaid)} is serving as your Milkmaid.`);
		if (S.Milkmaid.relationship === -3 && S.Milkmaid.devotion > 50) {
			V.milkmaidDevotionBonus += 2;
			V.milkmaidTrustBonus += 2;
			r.push(`${He} tries ${his} best to be your perfect farm${wife}.`);
		}
		if (milkmaidImpregnated > 0) {
			r.push(`It's ${his} responsibility to keep ${his} charges pregnant, and ${he} constantly`);
			if (milkmaidImpregnated === 1) {
				r.push(`breeds the one fertile cow.`);
			} else {
				r.push(`fills the ${milkmaidImpregnated} cows' cunts with ${his} cum.`);
			}
			if (S.Milkmaid.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.Milkmaid.devotion++;
			} else if (S.Milkmaid.fetish === Fetish.PREGNANCY && S.Milkmaid.fetishKnown === 1) {
				r.push(`${He} has a pregnancy fetish, so ${he} finds ${his} job <span class="hotpink">quite enjoyable,</span> especially when ${he} gets to watch the cows swell with ${his} children.`);
				S.Milkmaid.devotion += Math.ceil(S.Milkmaid.fetishStrength / 25);
				S.Milkmaid.fetishStrength += 2;
			}
			actX(S.Milkmaid, "penetrative", (milkmaidImpregnated * 10));
			S.Milkmaid.need = 0;
		}
		switch (FLsFetish) {
			case 1:
				r.push(`In ${his} line of work, ${he} touches more breasts than even you do. ${He} lives in an atmosphere of quivering, heaving, milky breastflesh; of girls who shudder and moan when ${he} touches their creamy nipples. ${He} has become more of a breast ${girl}.`);
				break;
			case 2:
				r.push(`It's a hard life, pulling teats and washing cows, but it does <span class="lightsalmon">make ${him} more of a breast fetishist.</span>`);
				break;
			case 3:
				r.push(`In ${his} line of work, ${he} touches more dicks and balls than most sluts. ${He} lives in an atmosphere of constant orgasm and ejaculation; of girls who shudder and moan when ${he} touches their engorged members. ${He} has become more of a cum ${girl}.`);
				break;
			case 4:
				r.push(`It's a hard life, cupping balls, cleaning dicks, and observing semen quality, but it does <span class="lightsalmon">make ${him} more of a cum fetishist.</span>`);
				break;
			case 5:
				r.push(`In ${his} line of work, ${he} fondles more pregnancies than most clinics. ${He} lives in an atmosphere of swollen, hanging, baby-filled bellies; of girls who shudder and moan when ${he} runs ${his} hands across their bellies. ${He} has grown a taste for girls laden with child.`);
				break;
			case 6:
				r.push(`It's a hard life, washing bellies and inspecting pussies, but it does <span class="lightsalmon">make ${him} more of a pregnancy fetishist.</span>`);
				break;
		}
		if (S.Milkmaid.muscles > 30) {
			V.milkmaidHealthBonus++;
			r.push(`${His} muscles help ${him} handle the fattest or most reluctant cow.`);
		}
		if (MMWorkout > random(1, 30 - S.Milkmaid.geneticQuirks.mLoss + S.Milkmaid.geneticQuirks.mGain) && S.Milkmaid.muscles < 60) {
			r.push(`Constantly having to wrestle unruly or aiding heavy cows into their stalls forces ${him} to <span class="lime">build muscle.</span>`);
			S.Milkmaid.muscles++;
		}
		if (S.Milkmaid.skill.oral > 30) {
			r.push(`${His} skilled tongue helps ${him} keep ${his} cattle happy.`);
		}
		if (S.Milkmaid.skill.oral < 90) {
			slaveSkillIncrease('oral', S.Milkmaid, 3);
		}
		if (S.Milkmaid.sexualQuirk === SexualQuirk.CARING) {
			V.milkmaidTrustBonus++;
			r.push(`${He}'s very caring, and does ${his} best to get the cows to trust ${him}.`);
		}
		if (S.Milkmaid.behavioralQuirk === BehavioralQuirk.FUNNY) {
			V.milkmaidTrustBonus++;
			r.push(`${He}'s funny, and does ${his} best to get the cows to trust ${him} by keeping them laughing.`);
		}
		if (App.Data.Careers.Leader.milkmaid.includes(S.Milkmaid.career)) {
			V.milkmaidHealthBonus++;
			r.push(`${He} has career experience dealing with milk animals.`);
		} else if (S.Milkmaid.skill.milkmaid >= Constant.MASTERED_XP) {
			V.milkmaidHealthBonus++;
			r.push(`${He} has experience harvesting slave products from working for you.`);
		} else {
			const skillIncrease = random(1, Math.ceil((S.Milkmaid.intelligence + S.Milkmaid.intelligenceImplant) / 15) + 8);
			r.push(slaveSkillIncrease('milkmaid', S.Milkmaid, skillIncrease));
		}
		if (prostateStim === 1) {
			if (S.Milkmaid.skill.penetrative > 90) {
				r.push(`${He} uses ${his} turgid cock and masterful technique to milk each slave's prostate dry.`);
			} else if (S.Milkmaid.skill.penetrative > 10) {
				r.push(`${He} uses ${his} turgid cock to give prostate stimulation to slaves that need help ejaculating.`);
			} else {
				r.push(`${He} tries to use ${his} turgid cock to give prostate stimulation and help slaves ejaculate, but has no idea where ${he} needs to aim to do so.`);
			}
			S.Milkmaid.need -= 50;
		}
		if (milkmaidImpregnated || prostateStim) {
			slaveSkillIncrease('penetrative', S.Milkmaid, 2);
		}
		V.milkmaidDevotionThreshold += (5 * V.milkmaidDevotionBonus);
		V.milkmaidTrustThreshold += (5 * V.milkmaidTrustBonus);
		for (const slave of slaves) {
			if (S.Milkmaid.rivalryTarget === slave.ID) {
				const {he2} = getPronouns(slave).appendSuffix("2");
				r.push(`${He} either neglects or harasses ${his} ${rivalryTerm(S.Milkmaid)}, ${slave.slaveName}, making sure ${he2} is unhappy and uncomfortable.`);
				slave.devotion -= 3;
				slave.trust -= 3;
				if (random(1, 100) > 65) {
					S.Milkmaid.rivalry++;
					slave.rivalry++;
				}
			} else if (S.Milkmaid.relationshipTarget === slave.ID) {
				const {he2} = getPronouns(slave).appendSuffix("2");
				r.push(`${He} dotes over ${his} ${relationshipTerm(S.Milkmaid)}, ${slave.slaveName}, making sure ${he2} is happy and comfortable.`);
				slave.devotion++;
				slave.trust++;
			} else if (areRelated(S.Milkmaid, slave)) {
				const {he2} = getPronouns(slave).appendSuffix("2");
				r.push(`${He} pays special attention to ${his} ${relativeTerm(S.Milkmaid, slave)}, ${slave.slaveName}, making sure ${he2} is well kept and happy.`);
				slave.trust++;
			}
			if (slave.prestigeDesc === "$He is remembered for winning best in show as a dairy cow.") {
				if (slave.lactation > 0 && (slave.boobs - slave.boobsImplant) > 6000) {
					r.push(`${He} spends extra time with ${slave.slaveName}, the well-known cow. ${He} is fascinated by ${slave.slaveName}'s massive ${commaNum(slave.boobs)}cc breasts and spends extra time massaging and kneading them to maximize production.`);
					slave.devotion += 3;
					slave.trust += 3;
				} else {
					r.push(`${He} is disappointed that the well-known cow ${slave.slaveName}${(slave.lactation === 0) ? ` isn't producing milk anymore` : `'s breasts have shrunken considerably from their heyday`}.`);
				}
			}
			if (slave.prestigeDesc === "$He is remembered for winning best in show as a cockmilker.") {
				if ((slave.balls > 6 && slave.dick !== 0) || (slave.balls > 4 && slave.dick !== 0 && slave.prostate > 1)) {
					r.push(`${He} spends extra time with ${slave.slaveName}, the massive ejaculating cow. ${He} can't help but massage the cow's dick and testes to stimulate them further and coax more from them.`);
					slave.devotion += 3;
					slave.trust += 3;
				} else {
					r.push(`${He} is disappointed that the (formerly) massive ejaculating cow`);
					if (slave.balls === 0 || slave.dick === 0) {
						r.push(`${slave.slaveName} is incapable of giving cum.`);
					} else if (slave.prostate < 2) {
						r.push(`${slave.slaveName} no longer possesses a hyperactive prostate.`);
					} else {
						r.push(`${slave.slaveName}'s balls are considerably smaller than at their heyday.`);
					}
				}
			}
			if (slave.prestigeDesc === "$He is remembered for winning best in show as a breeder." && slave.bellyPreg >= 1500) {
				const {his2} = getPronouns(slave).appendSuffix("2");
				r.push(`${He} spends extra time with ${slave.slaveName}, the well-known breeder. ${S.Milkmaid.slaveName} is fascinated by ${his2} growing pregnancy and popular womb. ${He} makes sure ${his2} belly and its occupants are nice and comfortable.`);
				slave.devotion += 3;
				slave.trust += 3;
			}
		}
		App.Events.addNode(el, r, "p", "indent");
	}

	const bioreactors = App.Entity.facilities.dairy.nonEmployeeOccupantsCount;
	if (DL + bioreactors > 0) {
		r = [];
		if (DL !== 1) {
			r.push(App.UI.DOM.makeElement("span", `There are ${DL} cows in ${V.dairyName}.`, "bold"));
		} else {
			r.push(App.UI.DOM.makeElement("span", `There is one cow in ${V.dairyName}.`, "bold"));
		}
		if (V.dairyRestraintsSetting > 1) {
			r.push(`The facility functions as an industrial slave products factory.`);
		}
		if (bioreactors > 0) {
			r.push(`${bioreactors} milking machines have permanent biological components, making a total of ${bioreactors + DL} milk-producing bodies.`);
		}
		App.Events.addNode(el, r, "div");
	}

	if (S.Milkmaid) {
		const slave = App.SlaveAssignment.reportSlave(S.Milkmaid);
		tired(slave);
		/* apply following SA passages to facility leader */
		if (V.showEWD !== 0 || (V.experimental.favSeparateReport === 1 && V.favorites.includes(slave.ID))) {
			const milkMaidEntry = App.UI.DOM.appendNewElement("div", el, '', ["slave-report"]);
			const artSpan = App.UI.DOM.appendNewElement("span", milkMaidEntry);
			milkMaidEntry.append(App.SlaveAssignment.saSlaveIntro(slave, `is serving as your Milkmaid.`));
			milkMaidEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}
	}

	const oldCash = V.cash;
	for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
		/* Perform facility based rule changes */

		// Set diet
		if (V.dairySlimMaintain === 0 || V.dairySlimMaintainUpgrade === 0) {
			if (V.dairyWeightSetting === 0) {
				if (slave.weight <= 30) {
					slave.diet = Diet.FATTEN;
				} else {
					slave.diet = Diet.HEALTHY;
				}
			} else if (V.dairyWeightSetting === 1) {
				if (slave.weight <= 95) {
					slave.diet = Diet.FATTEN;
				} else {
					slave.diet = Diet.HEALTHY;
				}
			} else if (V.dairyWeightSetting === 2) {
				if (slave.weight <= 130) {
					slave.diet = Diet.FATTEN;
				} else {
					slave.diet = Diet.HEALTHY;
				}
			} else if (V.dairyWeightSetting === 3) {
				if (slave.weight <= 160) {
					slave.diet = Diet.FATTEN;
				} else {
					slave.diet = Diet.HEALTHY;
				}
			} else if (V.dairyWeightSetting === 4) {
				if (slave.weight <= 195) {
					slave.diet = Diet.FATTEN;
				} else {
					slave.diet = Diet.HEALTHY;
				}
			} else if (V.dairyRestraintsSetting > 1) {
				slave.diet = Diet.HEALTHY;
			}
		} else if (slave.weight > 10) {
			slave.diet = Diet.RESTRICTED;
		} else if (slave.diet === Diet.FATTEN || slave.diet === Diet.HEALTHY || V.dairyRestraintsSetting > 1) {
			slave.diet = Diet.HEALTHY;
		}

		// Set clothing and accessories
		if (V.dairyRestraintsSetting > 1) {
			slave.collar = "none";
			slave.faceAccessory = "none";
			slave.mouthAccessory = "none";
			slave.choosesOwnClothes = 0;
			slave.clothes = "no clothing";
			slave.vaginalAccessory = "none";
			slave.vaginalAttachment = "none";
			slave.dickAccessory = "none";
			slave.buttplug = "none";
			slave.chastityAnus = 0;
			slave.chastityPenis = 0;
			slave.chastityVagina = 0;
		}

		// Set living standard
		switch (V.dairyDecoration) {
			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;
			default:
				slave.rules.living = "normal";
		}

		// Set child destination
		if (V.dairyPregSetting > 0) {
			WombCleanGenericReserve(slave, "incubator", 9999);
			WombCleanGenericReserve(slave, "nursery", 9999);
		}

		/* General End of Week effects */
		const milkResults = App.SlaveAssignment.getMilked(slave);
		milkWeek += milkResults.milk;
		cumWeek += milkResults.cum;
		if (V.showEWD !== 0 || (V.experimental.favSeparateReport === 1 && V.favorites.includes(slave.ID))) {
			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', ["slave-report"]);
			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
			slaveEntry.append(App.SlaveAssignment.saSlaveIntro(slave, `is serving as a cow in ${V.dairyName}.`));

			const {He} = getPronouns(slave);
			App.Events.addNode(
				slaveEntry,
				[
					He,
					milkResults.text,
				],
				"div",
				"indent"
			);
			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
		} else {
			// discard return values silently
			App.SlaveAssignment.standardSlaveReport(slave, true);
		}

		/* Facility Specific End of Week effects */
		if (slave.devotion <= 20 && slave.trust >= -20) {
			slave.devotion -= 5;
			slave.trust -= 5;
		}

		// Heal
		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);
		}

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

		// Boobs grow
		const gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;
		if (slave.lactation > 0 && (V.dairySlimMaintain === 0 || slave.boobs > 700)) {
			if (slave.boobs < 2000) {
				growth = 100;
			} else if (slave.boobs < 5000 * gigantomastiaMod) {
				growth = 50;
			} else if (slave.boobs < 10000 * gigantomastiaMod) {
				growth = 25;
			} else {
				growth = 0;
			}
			if (slave.geneMods.NCS === 1) {
				growth = Math.trunc(growth / 2);
			}
			slave.boobs += growth;
		}

		// Prostate growth
		if (slave.prostate === 1 && V.dairyImplantsSetting <= 1) {
			slave.prostate = 2;
			cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			surgeryDamage(slave, 10);
		}

		// Undo Vasectomy
		if (slave.vasectomy === 1) {
			slave.vasectomy = 0;
			cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			surgeryDamage(slave, 10);
		}

		// Force lactation
		if (V.dairySlimMaintain === 0) {
			if (V.dairyImplantsSetting <= 1) {
				if (slave.lactation < 2 && (slave.boobs > 300 || slave.balls === 0 || slave.lactation === 1 || V.dairyImplantsSetting === 1)) {
					slave.lactation = 2;
					slave.lactationDuration = 2;
					cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
					surgeryDamage(slave, 10);
				}
			} else if (V.dairyImplantsSetting === 3) {
				if (slave.lactation < 1 && (slave.boobs > 300 || slave.balls === 0)) {
					induceLactation(slave, 9);
				}
			}
		}

		// Hormones
		if (V.dairyHormonesSetting >= 0) {
			if (slave.lactation > 0) {
				slave.hormones = V.dairyHormonesSetting;
			} else if (slave.balls > 0) {
				slave.hormones = -1 * V.dairyHormonesSetting;
			} else {
				slave.hormones = V.dairyHormonesSetting;
			}
		}

		// Feeders
		if (V.dairyFeedersUpgrade === 1 && V.dairyFeedersSetting > 0) {
			if (V.dairySlimMaintain === 0 && slave.diet === Diet.FATTEN) {
				slave.weight += 2;
				if (slave.weightDirection === 1) {
					slave.weight += 2;
				}
			}
			if (slave.health.condition < 75) {
				improveCondition(slave, 25);
			} else {
				if (V.dairySlimMaintain === 0 && slave.lactation > 0) {
					if (V.dairyStimulatorsSetting > 0) {
						if (V.dairyFeedersSetting > 1) {
							if (slave.boobs < 50000) {
								if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
									if (slave.boobs < 2000) {
										growth = 75 * boobsMultiplier + (50 / 4);
									} else if (slave.boobs < 5000 * gigantomastiaMod) {
										growth = 50 * boobsMultiplier + (50 / 4);
									} else {
										growth = 25 * boobsMultiplier + (50 / 4);
									}
								} else {
									growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
								}
								if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
									boobtacular++;
								}
								if (slave.geneMods.NCS === 1) {
									growth = Math.trunc(growth / 2);
								}
								slave.boobs += growth;
							} else {
								/* slave.boobs = 50000;*/
							}
						} else {
							if (slave.boobs < 25000) {
								if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
									if (slave.boobs < 2000) {
										growth = 75 * boobsMultiplier + (50 / 4);
									} else if (slave.boobs < 5000 * gigantomastiaMod) {
										growth = 50 * boobsMultiplier + (50 / 4);
									} else {
										growth = 25 * boobsMultiplier + (50 / 4);
									}
								} else {
									growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
								}
								if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
									boobtacular++;
								}
								if (slave.geneMods.NCS === 1) {
									growth = Math.trunc(growth / 2);
								}
								slave.boobs += growth;
							}
						}
					} else if (V.dairyFeedersSetting > 1) {
						if (slave.boobs < 10000) {
							if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
								if (slave.boobs < 2000) {
									growth = 75 * boobsMultiplier + (50 / 4);
								} else if (slave.boobs < 5000 * gigantomastiaMod) {
									growth = 50 * boobsMultiplier + (50 / 4);
								} else {
									growth = 25 * boobsMultiplier + (50 / 4);
								}
							} else {
								growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
							}
							if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
								boobtacular++;
							}
							if (slave.geneMods.NCS === 1) {
								growth = Math.trunc(growth / 2);
							}
							slave.boobs += growth;
						}
					} else {
						if (slave.boobs < 5000) {
							if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
								if (slave.boobs < 2000) {
									growth = 75 * boobsMultiplier + (50 / 4);
								} else if (slave.boobs < 5000 * gigantomastiaMod) {
									growth = 50 * boobsMultiplier + (50 / 4);
								} else {
									growth = 25 * boobsMultiplier + (50 / 4);
								}
							} else {
								growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
							}
							if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
								boobtacular++;
							}
							if (slave.geneMods.NCS === 1) {
								growth = Math.trunc(growth / 2);
							}
							slave.boobs += growth;
						}
					}
				}
				if (slave.balls > 0) {
					const ballFormula = 10 * (slave.balls - restrainedInjected);
					if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
						if (slave.geneMods.NCS === 0 && slave.balls < 125) {
							slave.balls++;
						} else if (
							slave.geneMods.NCS === 1 && slave.balls < 125 &&
							random(1, 600) > (30 + ballFormula)
						) {
							slave.balls++;
						}
						if (slave.balls >= 125) {
							balltacular.push(slave);
						}
					} else if (slave.balls < 10) {
						if (slave.geneMods.NCS === 0 && random(1, 100) > (40 + ballFormula)) {
							slave.balls++;
						} else if (
							slave.geneMods.NCS === 1 && slave.balls < 125 && random(1, 50) > (40 + ballFormula)) {
							slave.balls++;
						}
						if (slave.balls >= 10) {
							balltacular.push(slave);
						}
					}
					if (slave.dick > 0) {
						const dickFormula = 10 * (4 + slave.dick - restrainedInjected);
						if (slave.dick < 10) {
							if (slave.geneMods.NCS === 0 && random(1, 100) > dickFormula) {
								slave.dick++;
							} else if (slave.geneMods.NCS === 1 && random(1, 50) > dickFormula) {
								slave.dick++;
							}
						}
					}
				}
			}
		}

		// Stimulators
		if (V.dairyStimulatorsUpgrade === 1 && V.dairyStimulatorsSetting > 0) {
			if (V.seeStretching === 1 && V.dairyStimulatorsSetting > 1 && slave.anus < 4) {
				slave.anus++;
				if (slave.anus >= 4) {
					anusesStretched++;
				}
			} else if (V.seeStretching === 1 && slave.anus < 3) {
				slave.anus++;
			}
			if (slave.health.condition < 60) {
				improveCondition(slave, 20);
			} else if (V.dairySlimMaintain === 0 && slave.lactation > 0) {
				if (V.dairyFeedersSetting > 1) {
					if (slave.boobs < 50000) {
						if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
							if (slave.boobs < 2000) {
								growth = 75 * boobsMultiplier + (50 / 4);
							} else if (slave.boobs < 5000 * gigantomastiaMod) {
								growth = 50 * boobsMultiplier + (50 / 4);
							} else {
								growth = 25 * boobsMultiplier + (50 / 4);
							}
						} else {
							growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
						}
						if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
							boobtacular++;
						}
						if (slave.geneMods.NCS === 1) {
							growth = Math.trunc(growth / 2);
						}
						slave.boobs += growth;
					}
				} else if (V.dairyFeedersSetting > 0) {
					if (slave.boobs < 25000) {
						if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
							if (slave.boobs < 2000) {
								growth = 75 * boobsMultiplier + (50 / 4);
							} else if (slave.boobs < 5000 * gigantomastiaMod) {
								growth = 50 * boobsMultiplier + (50 / 4);
							} else {
								growth = 25 * boobsMultiplier + (50 / 4);
							}
						} else {
							growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
						}
						if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
							boobtacular++;
						}
						if (slave.geneMods.NCS === 1) {
							growth = Math.trunc(growth / 2);
						}
						slave.boobs += growth;
					}
				} else {
					if (slave.boobs < 10000) {
						if (V.arcologies[0].FSAssetExpansionistResearch === 1) {
							if (slave.boobs < 2000) {
								growth = 75 * boobsMultiplier + (50 / 4);
							} else if (slave.boobs < 5000 * gigantomastiaMod) {
								growth = 50 * boobsMultiplier + (50 / 4);
							} else {
								growth = 25 * boobsMultiplier + (50 / 4);
							}
						} else {
							growth = 25 * boobsMultiplier + ((50 - slave.physicalAge) / 4);
						}
						if (slave.boobs <= 20000 && slave.boobs + growth > 20000) {
							boobtacular++;
						}
						if (slave.geneMods.NCS === 1) {
							growth = Math.trunc(growth / 2);
						}
						slave.boobs += growth;
					}
				}
			}
		}

		// Restraints
		if (V.dairyRestraintsSetting > 1) {
			if (slave.lactation > 0) {
				slave.lactationAdaptation += 1;
			}
			if (slave.muscles > -100) {
				slave.muscles -= 1 + slave.geneticQuirks.mLoss;
			}
			if (slave.fetish === Fetish.MINDBROKEN) {
				if (slave.boobs > 48000 && (slave.balls >= 10 || slave.balls === 0)) {
					V.bioreactorPerfectedID = slave.ID;
				}
			} else {
				if (slave.sexualFlaw !== SexualFlaw.SELFHATING) {
					if (slave.sexualFlaw !== SexualFlaw.CUMADDICT || V.dairyFeedersSetting === 0) {
						if (slave.sexualFlaw !== SexualFlaw.ANALADDICT || V.dairyStimulatorsSetting === 0) {
							if (slave.sexualFlaw !== SexualFlaw.BREEDER || slave.preg < 0 || V.dairyPregSetting === 0) {
								if (V.dairyStimulatorsSetting > 1) {
									if (slave.sexualFlaw !== SexualFlaw.HATESANAL && slave.sexualQuirk !== SexualQuirk.PAINAL) {
										slave.sexualFlaw = SexualFlaw.HATESANAL;
									}
								}
								if (V.dairyPregSetting > 1) {
									if (slave.sexualFlaw !== SexualFlaw.HATESPEN && slave.sexualQuirk !== SexualQuirk.STRUGGLE) {
										slave.sexualFlaw = SexualFlaw.HATESPEN;
									}
								}
								if (V.dairyFeedersSetting > 1) {
									if (slave.sexualFlaw !== SexualFlaw.HATESORAL && slave.sexualQuirk !== SexualQuirk.GAGFUCK) {
										slave.sexualFlaw = SexualFlaw.HATESORAL;
									}
								}
							}
						}
					}
				}
			}
			if (slave.chem > 250) {
				chemSevere++;
			} else if (slave.chem > 100) {
				chemMinor.push(slave);
			}
		}

		// Stimulator + Feeders + Pregnancy
		if (dairySettings > 5) {
			if (slave.devotion <= 95 && slave.sexualFlaw !== SexualFlaw.SELFHATING) {
				if (slave.sexualFlaw !== SexualFlaw.BREEDER || slave.preg < 0) {
					if (slave.devotion > -75) {
						slave.devotion -= 10;
						if (slave.devotion < -65) {
							hateFilled.push(slave);
						}
					} else if (slave.trust > -75) {
						slave.trust -= 10;
						if (slave.trust < -65) {
							horrified.push(slave);
						}
					} else if (slave.skill.oral > 0) {
						slave.skill.oral -= 10;
						skillsLost.push(slave);
					} else if (slave.skill.anal > 0) {
						slave.skill.anal -= 10;
						skillsLost.push(slave);
					} else if (slave.skill.vaginal > 0) {
						slave.skill.vaginal -= 10;
						skillsLost.push(slave);
					} else if (slave.skill.penetrative > 0) {
						slave.skill.penetrative -= 10;
						skillsLost.push(slave);
					} else if (slave.career !== "a bioreactor") {
						slave.career = "a bioreactor";
						careerForgotten.push(slave);
					} else if (slave.intelligenceImplant > 0) {
						slave.intelligenceImplant = Math.clamp(slave.intelligenceImplant - 5, 0, 30);
						skillsLost.push(slave);
					} else if (slave.intelligence >= -15) {
						slave.intelligence -= 5;
						intelligenceLost++;
					} else if (slave.devotion >= -20) {
						slave.devotion -= 10;
					} else if (slave.trust >= -20) {
						slave.trust -= 10;
					} else if (slave.skill.whoring > 0) {
						slave.skill.whoring -= 10;
						skillsLost.push(slave);
					} else if (slave.skill.entertainment > 0) {
						slave.skill.entertainment -= 10;
						skillsLost.push(slave);
					} else if (slave.intelligence >= -50) {
						slave.intelligence -= 5;
						if (slave.intelligence < -50) {
							stupidified.push(slave);
						}
					} else if (slave.fetish !== Fetish.MINDBROKEN) {
						applyMindbroken(slave);
						mindbroken++;
					}
				}
			}
			if (slave.career !== "a bioreactor" &&
				(
					(slave.counter.milk > 1000 && slave.boobs > 12000) ||
					(slave.counter.cum > 1000 && slave.balls >= 10)
				)
			) {
				slave.career = "a bioreactor";
				careerForgotten.push(slave);
			}
			if (V.arcologies[0].FSBodyPuristLaw === 0 && V.healthyDrugsUpgrade === 0) {
				slave.chem += 5;
			} else {
				slave.chem += 2;
			}
		} else if (dairySettings > 3) {
			if (slave.devotion < 75) {
				if (slave.devotion > -75) {
					slave.devotion -= 5;
					if (slave.devotion < -70) {
						hateFilled.push(slave);
					}
				} else if (slave.trust > -75) {
					slave.trust -= 5;
					if (slave.trust < -70) {
						horrified.push(slave);
					}
				} else if (slave.skill.oral >= 20) {
					slave.skill.oral -= 10;
					skillsLost.push(slave);
				} else if (slave.skill.anal >= 20) {
					slave.skill.anal -= 10;
					skillsLost.push(slave);
				} else if (slave.skill.vaginal >= 20) {
					slave.skill.vaginal -= 10;
					skillsLost.push(slave);
				} else if (slave.skill.penetrative >= 20) {
					slave.skill.penetrative -= 10;
					skillsLost.push(slave);
				} else if (slave.career !== "a bioreactor") {
					slave.career = "a bioreactor";
					careerForgotten.push(slave);
				} else if (slave.intelligenceImplant > 0) {
					slave.intelligenceImplant = Math.clamp(slave.intelligenceImplant - 5, 0, 30);
					skillsLost.push(slave);
				} else if (slave.intelligence >= -15) {
					slave.intelligence -= 5;
					intelligenceLost++;
				} else if (slave.devotion >= -20) {
					slave.devotion -= 8;
				} else if (slave.trust >= -20) {
					slave.trust -= 8;
				} else if (slave.skill.whoring >= 20) {
					slave.skill.whoring -= 10;
					skillsLost.push(slave);
				} else if (slave.skill.entertainment >= 20) {
					slave.skill.entertainment -= 10;
					skillsLost.push(slave);
				} else if (slave.intelligence >= -50) {
					slave.intelligence -= 5;
					if (slave.intelligence < -50) {
						stupidified.push(slave);
					}
				} else if (slave.fetish !== Fetish.MINDBROKEN) {
					applyMindbroken(slave);
					mindbroken++;
				}
			} else if (slave.career !== "a bioreactor" &&
				(
					(slave.counter.milk > 1000 && slave.boobs > 12000) ||
					(slave.counter.cum > 1000 && slave.balls >= 10)
				)
			) {
				slave.career = "a bioreactor";
				careerForgotten.push(slave);
			}
			if (V.arcologies[0].FSBodyPuristLaw === 0 && V.healthyDrugsUpgrade === 0) {
				slave.chem += 2;
			} else {
				slave.chem++;
			}
		}

		// Pregnancy
		if (V.dairyPregUpgrade === 1 && V.dairyPregSetting > 0) {
			if (slave.ovaries === 1 && slave.vagina > -1) {
				femCumWeek += girlCumAmount(slave);
				if (slave.preg === -2) {
					slave.preg = 0;
					desterilized.push(slave);
				}
				if (isFertile(slave)) {
					if (slave.eggType === "human") {
						slave.preg = 1;
						slave.pregWeek = 1;
						slave.pregKnown = 1;
						if (V.dairyPregSetting > 2) {
							slave.pregType = random(10, 29);
						} else if (V.dairyPregSetting > 1) {
							slave.pregType = random(3, 6);
						} else {
							slave.pregType = either(1, 1, 1, 1, 2, 2, 2, 3, 3, 4);
						}
						slave.pregSource = -2;
						WombImpregnate(slave, slave.pregType, -2, 1);
					} /* closes eggType */
					if (slave.vagina === 0) {
						slave.vagina++;
					}
				} else if (slave.pregKnown === 1) {
					if (V.dairyPregSetting > 2) {
						cashValue = 100;
					} else if (V.dairyPregSetting > 1) {
						cashValue = 50;
					} else {
						cashValue = 25;
					}
					cashX(cashValue, "slaveAssignmentDairy", slave);
					if (V.seeStretching === 1 && V.dairyPregSetting > 1 && slave.vagina < 4) {
						slave.vagina++;
						if (slave.vagina === 4) {
							vaginasStretched++;
						}
					} else if (V.seeStretching === 1 && slave.vagina < 3) {
						slave.vagina++;
					}
				}
			}
		}
	} // End slave loop.

	// Inflation
	if (inflatedSlaves.milk > 0) {
		milkWeek -= ((8 * inflatedSlaves.milk * 10) + 8);
	}
	if (inflatedSlaves.cum > 0) {
		cumWeek -= ((80 * inflatedSlaves.cum * 10) + 80);
		if (cumWeek < 0) {
			cumWeek = 0;
		}
	}

	if (bioreactors > 0) {
		r = [];
		const tempCash = V.cash;

		let seed;
		seed = (BF.XY.cum * V.bioreactorsXY) + (BF.herm.cum * V.bioreactorsHerm);
		cumWeek += seed;
		if (V.arcologies[0].FSPastoralistLaw === 1) {
			cashValue = seed * random(40, 50);
		} else if (FutureSocieties.isActive('FSPastoralist')) {
			cashValue = seed * (random(25, 35) + Math.trunc(V.arcologies[0].FSPastoralist / 10));
		} else {
			cashValue = seed * random(25, 35);
		}
		cashX(cashValue, "menialBioreactors");

		seed = (BF.XX.femCum * V.bioreactorsXX) + (BF.herm.femCum * V.bioreactorsHerm);
		femCumWeek += seed;
		if (V.arcologies[0].FSPastoralistLaw === 1) {
			cashValue = seed * random(40, 50);
		} else if (FutureSocieties.isActive('FSPastoralist')) {
			cashValue = seed * (random(25, 35) + Math.trunc(V.arcologies[0].FSPastoralist / 10));
		} else {
			cashValue = seed * random(25, 35);
		}
		cashX(cashValue, "menialBioreactors");

		seed = (BF.XX.milk * V.bioreactorsXX) + (BF.barren.milk * V.bioreactorsBarren) + (BF.XY.milk * V.bioreactorsXY) + (BF.herm.milk * V.bioreactorsHerm);
		milkWeek += seed;
		if (FutureSocieties.isActive('FSPastoralist') && V.arcologies[0].FSPastoralistLaw === 1) {
			cashValue = seed * (13 + Math.trunc(V.arcologies[0].FSPastoralist / 30));
		} else if (FutureSocieties.isActive('FSPastoralist')) {
			cashValue = seed * (8 + Math.trunc(V.arcologies[0].FSPastoralist / 30));
		} else {
			cashValue = seed * 9;
		}
		cashX(cashValue, "menialBioreactors");
		r.push(`${bioreactors} permanently converted biological`);
		if (bioreactors > 1) {
			r.push(`"machines" produce`);
		} else {
			r.push(`"machine" produces`);
		}
		r.push(`<span class="yellowgreen">${cashFormat(V.cash - tempCash)}</span> income.`);
		App.Events.addParagraph(el, r);
	}

	if (inflatedSlaves.milk > 0) {
		cashX(forceNeg(Math.trunc((600 * (inflatedSlaves.milk) + 8) + random(50, 200))), "slaveAssignmentDairy");
	}
	if (inflatedSlaves.cum > 0) {
		cashX(forceNeg(Math.trunc((300 * (inflatedSlaves.cum + 8)) + random(25, 100))), "slaveAssignmentDairy");
	}

	const profits = V.cash - oldCash;
	r = [];

	if (chemSevere > 1) {
		r.push(`${chemSevere} cows' productivity is being reduced by the long term effects of industrial use.`);
	} else if (chemSevere > 0) {
		r.push(`One cow's productivity is being reduced by the long term effects of industrial use.`);
	}

	if (chemMinor.length > 1) {
		r.push(`${chemMinor.length} cows have been drugged and used long enough that they require increased curative doses, slightly reducing their output.`);
	} else if (chemMinor.length > 0) {
		const {he, his} = getPronouns(chemMinor[0]);
		r.push(`One cow has been drugged and used long enough that ${he} requires increased curative doses, slightly reducing ${his} output.`);
	}

	if (desterilized.length > 1) {
		r.push(`${desterilized.length} cows had minor health issues preventing their fertile womb from conceiving; the issues have been resolved and they have been impregnated.`);
	} else if (desterilized.length > 0) {
		const {he, his} = getPronouns(desterilized[0]);
		r.push(`One cow had minor health issues preventing ${his} fertile womb from conceiving; they have been resolved and ${he} has been impregnated.`);
	}

	if (hateFilled.length > 1) {
		r.push(`${hateFilled.length} cows stopped struggling so much when fucked by the machines; it seems they have sunk into a fugue.`);
	} else if (hateFilled.length > 0) {
		const {he} = getPronouns(hateFilled[0]);
		r.push(`One cow stopped struggling so much when fucked by the machines; it seems ${he} has sunk into a fugue.`);
	}

	if (horrified.length > 1) {
		r.push(`${horrified.length} cows' emotional activity dropped significantly; this indicates acceptance that they are not likely to leave ${V.dairyName}, ever again.`);
	} else if (horrified.length > 0) {
		const {he} = getPronouns(horrified[0]);
		r.push(`One cow's emotional activity dropped significantly; this indicates acceptance that ${he} is not likely to leave ${V.dairyName}, ever again.`);
	}

	if (skillsLost.length > 1) {
		r.push(`${skillsLost.length} cows forgot skills due to their inability to focus on anything but machine rape.`);
	} else if (skillsLost.length > 0) {
		const {his} = getPronouns(skillsLost[0]);
		r.push(`One cow forgot skills due to ${his} inability to focus on anything but machine rape.`);
	}

	if (careerForgotten.length > 1) {
		r.push(`${careerForgotten.length} cows forgot the details of their past professional lives; all they can remember now is this.`);
	} else if (careerForgotten.length > 0) {
		const {he, his} = getPronouns(careerForgotten[0]);
		r.push(`One cow forgot the details of ${his} past professional life; all ${he} can remember now is this.`);
	}

	if (vaginasStretched > 1) {
		r.push(`${vaginasStretched} cows' vaginas were broken in for machine use, and are unlikely to be any use for anything other than receiving cum and medication, and giving birth.`);
	} else if (vaginasStretched > 0) {
		r.push(`One cow's vagina was broken in for machine use, and is unlikely to be any use for anything other than receiving cum and medication, and giving birth.`);
	}

	if (anusesStretched > 1) {
		r.push(`${anusesStretched} cows' anuses were loosened by machine sodomy, and are now permanently gaped.`);
	} else if (anusesStretched > 0) {
		r.push(`One cow's anus was loosened by machine sodomy, and is now permanently gaped.`);
	}

	if (intelligenceLost > 1) {
		r.push(`${intelligenceLost} cows suffered some loss of intelligence due to accumulated mental stress from life attached to a milking machine.`);
	} else if (intelligenceLost > 0) {
		r.push(`One cow suffered some loss of intelligence due to accumulated mental stress from life attached to a milking machine.`);
	}

	if (stupidified.length > 1) {
		r.push(`${stupidified.length} cows were so mentally dulled by use as biological factories that they were reduced to a very low level of intelligence.`);
	} else if (stupidified.length > 0) {
		const {he} = getPronouns(stupidified[0]);
		r.push(`One cow was so mentally dulled by use as biological factories that ${he} was reduced to a very low level of intelligence.`);
	}

	if (mindbroken > 1) {
		r.push(`${mindbroken} cows finally lost higher mental function, and are now nothing more than industrial equipment made of meat.`);
	} else if (mindbroken > 0) {
		r.push(`One cow finally lost higher mental function, and is now nothing more than industrial equipment made of meat.`);
	}

	if (boobtacular > 1) {
		r.push(`${boobtacular} cows grew past 30 kilograms of breasts, a remarkable advance in capacity.`);
	} else if (boobtacular > 0) {
		r.push(`One cow grew past 30 kilograms of breasts, a remarkable advance in capacity.`);
	}

	if (balltacular.length > 1) {
		r.push(`${balltacular.length} cows' testicles reached the largest size drug treatments can produce; the machines will now focus on buttfucking them with extra force.`);
	} else if (balltacular.length > 0) {
		const {him} = getPronouns(balltacular[0]);
		r.push(`One cow's testicles reached the largest size drug treatments can produce; the machines will now focus on buttfucking ${him} with extra force.`);
	}

	if (V.dairyPregUpgrade === 1) {
		if (V.dairyPregSetting >= 2) {
			r.push(`Fertile cows make you a significant profit through contract pregnancies.`);
		} else if (V.dairyPregSetting === 1) {
			r.push(`Fertile cows make you a small profit through contract pregnancies.`);
		}
	}
	cumWeek = Math.trunc(cumWeek / 10);
	V.cumPipeline = cumWeek;
	V.milkPipeline = milkWeek;
	if (inflatedSlaves.milk > 0) {
		outputMilk = ((8 * inflatedSlaves.milk * 10) + 8);
	} else {
		outputMilk = 0;
	}
	if (inflatedSlaves.cum > 0) {
		outputCum = (((80 * inflatedSlaves.cum * 10) + 80) / 10);
	} else {
		outputCum = 0;
	}
	r.push(`${dairyNameCaps} produced ${commaNum(milkWeek + outputMilk)} liters of milk`);
	if (cumWeek > 0) {
		r.push(`and ${commaNum(cumWeek + outputCum)} liters of cum`);
	}
	r.push(`this week.`);
	if (inflatedSlaves.milk > 0) {
		r.push(`${commaNum(outputMilk)} liters of milk were pumped into your penthouse for filling slaves this week.`);
	}
	if (inflatedSlaves.cum > 0) {
		if (inflatedSlaves.milk > 0) {
			r.push(`and`);
		}
		r.push(`${commaNum(outputCum)} liters of cum were pumped into your penthouse`);
		if (inflatedSlaves.milk > 0) {
			r.push(`as well.`);
		} else {
			r.push(`this week.`);
		}
	}
	if (femCumWeek > 0) {
		r.push(`The machines also managed to reclaim ${commaNum(femCumWeek)} liters of salable vaginal secretions.`);
	}

	if (FutureSocieties.isActive('FSRestart') && V.eugenicsFullControl !== 1) {
		if (V.dairyPregSetting > 0) {
			r.push(`The Societal Elite know what you are doing with your cows. <span class="red">They do not approve.</span>`);
			V.failedElite += 5;
		}
		if (V.milkmaidImpregnates === 1) {
			r.push(`The Societal Elite know you've ordered ${S.Milkmaid.slaveName} to impregnate your cows. <span class="red">They are not amused by your disinterest in eugenics.</span>`);
			V.failedElite += 10;
		}
	}

	// Record statistics gathering
	let b = State.variables.facility.dairy;
	b.whoreIncome = 0;
	b.whoreCosts = 0;
	b.rep = 0;
	for (let si of b.income.values()) {
		b.whoreIncome += si.income;
		b.whoreCosts += si.cost;
		b.rep += si.rep;
	}
	b.maintenance = (V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren);
	if (b.maintenance > 0) {
		b.maintenance *= 100;
	} else {
		b.maintenance = 0;
	}
	b.maintenance += V.dairy * V.facilityCost * (1.0 + 0.2 * V.dairyFeedersUpgrade + 0.1 * V.dairyPregUpgrade);
	b.totalIncome = b.whoreIncome;
	b.totalExpenses = b.whoreCosts + b.maintenance;
	b.profit = b.totalIncome - b.totalExpenses;
	if (profits > 0) {
		r.push(`The sale of these products makes a profit of <span class="yellowgreen">${cashFormat(profits)}.</span>`);
	} else if (profits < 0) {
		r.push(`Due to`);
		if (V.dairyImplantsSetting !== 3) {
			r.push(`one-off costs of hormonal implants to encourage fluid production,`);
		} else {
			r.push(`the need to induce lactation in some cows,`);
		}
		r.push(`your dairy made a loss of <span class="red">${cashFormat(profits)}.</span>`);
	} else {
		r.push(`Due to`);
		if (V.dairyImplantsSetting !== 3) {
			r.push(`one-off costs of hormonal implants to encourage fluid production`);
		} else {
			r.push(`the need to induce lactation in some cows`);
		}
		r.push(`paired with existing output, your dairy broke even this week.`);
	}

	if (V.arcologies[0].FSPastoralistLaw === 1) {
		r.push(`Slave products have completely replaced traditional dairy, making the facility extremely lucrative.`);
	}
	App.Events.addParagraph(el, r);

	if (V.dairySlimMaintainUpgrade === 1 && V.dairySlimMaintain === 1) {
		r = [];
		if (V.arcologies[0].FSSlimnessEnthusiast > 80) {
			r.push(`Because of your arcology's great enthusiasm for small breasted slaves, the dairy's milking systems have been carefully overhauled and optimized for maximum milk extraction from slaves with smaller endowments — providing a significant boost to their otherwise modest output. This also prevents unfashionable breast expansion of already slim slaves through the milking process.`);
		} else if (V.arcologies[0].FSSlimnessEnthusiast > 20) {
			r.push(`In keeping with your arcology's ideals, ${V.dairyName} has been modified to handle slim slaves with minimal impact to their body shapes. This limits potential profitability, but prevents unfashionable breast expansion of already slim slaves through the milking process.`);
		} else {
			r.push(`Due to your arcology's lack of enthusiasm for small breasted slaves the dairy has discontinued using milking techniques that prevent breast growth through the milking process.`);
			V.dairySlimMaintain = 0;
			V.dairySlimMaintainUpgrade = 0;
		}
		App.Events.addParagraph(el, r);
	}

	if (V.createBioreactors === 1 && V.bioreactorPerfectedID !== 0) {
		const bioreactor = getSlave(V.bioreactorPerfectedID);
		if (bioreactor) {
			let gender;
			if (bioreactor.ovaries === 1) {
				if (bioreactor.balls === 0) {
					V.bioreactorsXX++;
					gender = "XX";
				} else {
					V.bioreactorsHerm++;
					gender = "herm";
				}
			} else {
				if (bioreactor.balls === 0) {
					V.bioreactorsBarren++;
					gender = "barren";
				} else {
					V.bioreactorsXY++;
					gender = "XY";
				}
			}
			const {he, He} = getPronouns(bioreactor);
			const ageInWeeks = 52 * (V.retirementAge - bioreactor.physicalAge);
			r = [];
			r.push(`${SlaveFullName(bioreactor)}'s breasts,`);
			if (bioreactor.balls > 0) {
				r.push(`balls,`);
			}
			if (bioreactor.ovaries === 1) {
				r.push(`belly,`);
			}
			r.push(`body, and mind have been completely adapted to synthesize useful products. ${He} has been reclassified as part of the machine ${he}'s now permanently attached to. This combination is projected to produce approximately`);
			if (bioreactor.balls > 0) {
				r.push(commaNum(1000 * Math.trunc(BF[gender].cum * ageInWeeks) / 1000));
				r.push(`liters of cum,`);
			}
			if (bioreactor.ovaries === 1) {
				r.push(commaNum(100 * Math.trunc(BF[gender].femCum * ageInWeeks) / 100));
				r.push(`liters of vaginal secretions,`);
				if (V.dairyPregSetting === 3) {
					r.push((13 * (V.retirementAge - bioreactor.physicalAge)).toString());
				} else {
					r.push((5 * (V.retirementAge - bioreactor.physicalAge)).toString());
				}
				r.push(`slaves,`);
			}
			r.push(`and`);
			r.push(commaNum(1000 * Math.trunc(BF[gender].milk * ageInWeeks) / 1000));
			r.push(`liters of milk over a ${V.retirementAge - bioreactor.physicalAge} year period before its biological components must be replaced.`);
			App.Events.addParagraph(el, r);
			if (isShelterSlave(bioreactor)) {
				V.shelterAbuse++;
			}
			removeSlave(bioreactor);
		}
	}

	if (V.dairyDecoration !== "standard") {
		r = [];
		r.push(`${dairyNameCaps}'s`);
		r.push(App.UI.DOM.makeElement("span", `${V.dairyDecoration} style is well known.`, "green"));
		App.Events.addParagraph(el, r);
	}

	if (DL > 0) {
		// Dairy stats
		el.append(App.Facilities.Dairy.Stats(false));
		dairyStats.append(App.Facilities.Dairy.Stats(true));
	}
	return el;
};