code:
/** @returns {FC.Facilities.Decoration} */
App.Facilities.Farmyard.getDecoration = function() {
	// both shows and food (ranch)
	// TODO: go through these descriptions and rewrite any that need to be rewritten
	if (V.farmyardShows === 1) {
		return {
			"Roman Revivalist": `Its red tiles and white stone walls are the very picture of a Roman villa's construction, as are the marble statues and reliefs. ${V.seeBestiality ? `Mercury watches over the health of the animals, and Feronia ensures strong litters in your slaves.` : `Mercury watches over the health of the animals.`} The slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
			"Neo-Imperialist": `Its high-tech, sleek black design invocates an embracement of the future, tempered by the hanging banners displaying your family crest as the rightful lord and master of this ranch. Serf-like peasants work tirelessly in the stables and pens, making sure one of the most important sources of food and entertainment in ${V.arcologies[0].name} is well-maintained. Despite the sometimes harsh nature of ranching, the slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
			"Aztec Revivalist": `It features a large, open ranch, with shallow canals snaking throughout to provide constant fresh water for the livestock in the pens. Large stone sacrificial altars are featured prominently in the middle, and large stone murals depicting warfare between Huitzilopochtli and the forces of darkness line the entire perimeter of the space.`,
			"Egyptian Revivalist": `It does its best to capture the wide open nature of ancient Egyptian farms, including mimicking the irrigation systems fed by the Nile. The stone walls are decorated with murals detailing its construction and your prowess in general, ${V.seeBestiality ? `with animal-bloated slaves featured prominently.` : `hieroglyphs spelling out volumes of praise.`}`,
			"Edo Revivalist": `It does its best to mimic the rice patties and thatch roofed buildings of the Edo period despite the wide variety of crops tended by various slaves. Not every crop can thrive in flooded fields, but the ones that can take advantage of your attention to detail.`,
			"Arabian Revivalist": `Large plots of olive trees and date palms line the outer edges of the main crop area, while a combination of wheat, flax, and barley occupies the interior space. Irrigation canals snake through the area, ensuring every inch of cropland is well-watered.`,
			"Chinese Revivalist": `It does its best to capture the terraces that covered the ancient Chinese hills and mountains, turning every floor into ribbons of fields following a slight incline. Slaves wade through crops that can handle flooding and splash through the irrigation of the others when they aren't tending to${V.seeBestiality ? ` or breeding with` : ``} your animals.`,
			"Chattel Religionist": `It runs like a well oiled machine, slaves bent in humble service as they tend crops grown on the Prophet's command, or see to the animals' needs. Their clothing is tucked up and out of the way as they see to their tasks, keeping them clean as they work ${V.seeBestiality ? `around animal-bloated bellies ` : ``}as divine will dictates.`,
			"Degradationist": `It is constructed less as a converted warehouse and more as something to visit, allowing guests to enjoy the spectacle of slaves ${V.seeBestiality ? `being pounded by eager animals` : `elbow deep in scrubbing animal waste`} to their satisfaction.`,
			"Repopulationist": `It teems with life, both in the belly of every animal and the belly of every slave, though the latter makes tending the fields difficult. They're ordered to take care, as they carry the future ${V.seeBestiality ? `of this farm` : `of the arcology`} in their bellies.`,
			"Eugenics": `It holds a wide variety of crops and animals, but the best of the best is easy to find. They're set apart from the others, given only the best care and supplies${V.seeBestiality ? ` and bred with only the highest quality slaves` : ``}, while the sub-par stock is neglected off to the side.`,
			"Asset Expansionist": `It is not easy to look after animals and till fields with such enormous body parts, but your slaves are diligent regardless, working hard to provide food and livestock for the arcology.`,
			"Transformation Fetishist": `The plants and animals here all look slightly unnatural, as though they were engineered in a lab to be stronger or larger – which, of course, they were.`,
			"Gender Radicalist": `The plants and animals here all look slightly unnatural, as though they were treated with hormones to be stronger or larger – which, of course, they were.`,
			"Gender Fundamentalist": `The majority of the population of ${V.farmyardName} is pregnant, and the space is outfitted with childbearing in mind.`,
			"Physical Idealist": `Its animals are in exceptional shape, their coats unable to hide how muscular they are, requiring your slaves to be equally toned to control them. There's plenty of space for their exercise as well${V.seeBestiality ? ` and an abundance of curatives for the slaves full of their fierce, kicking offspring` : ``}.`,
			"Supremacist": `It is a clean and orderly operation, stables and cages mucked by a multitude of inferior slaves, along with grooming your animals and harvesting your crops.`,
			"Subjugationist": `It is a clean and orderly operation, stables and cages mucked by a multitude of ${V.arcologies[0].FSSubjugationistRace} slaves, while the others are tasked with grooming your animals and harvesting your crops.`,
			"Paternalist": `It's full of healthy animals, crops, and slaves, the former's every need diligently looked after by the latter. The fields flourish to capacity under such care, and the animals give the distinct impression of happiness${V.seeBestiality ? ` — some more than others if the growing bellies of your slaves are anything to go by, the only indication that such rutting takes place` : ``}.`,
			"Pastoralist": `The space is outfitted with milkers every so often so that lactating farmhands don't have to travel far to relieve themselves of their milk, and the animals are milked of what they can be as well.`,
			"Maturity Preferentialist": `The majority of the population here is older and wiser, and the older animals are all treated with a bit more luxury than the younger ones.`,
			"Youth Preferentialist": `The majority of the population here is full of youth and more energetic, and the younger animals are all treated with a bit more luxury than the older ones.`,
			"Body Purist": `Organic crops and animals are the main feature here, and the animal manure is used as a natural fertilizer for the different plants.`,
			"Slimness Enthusiast": `It features trim animals and slaves alike, not a pound of excess among them. The feed for both livestock and crops are carefully maintained to ensure optimal growth without waste, letting them flourish without being weighed down.`,
			"Hedonistic": `It features wider gates and stalls, for both the humans visiting or tending the occupants, and the animals starting to mimic their handlers${V.seeBestiality ? ` and company` : ``}, with plenty of seats along the way.`,
			"Intellectual Dependency": `Large signs covered in cartoonish illustrations dot the pens, illustrating how to take care of the needs of the occupant within.${V.seeBestiality ? ` There is a strong emphasis on proper breeding positions for your slaves, with step by step instructions.` : ``}`,
			"Slave Professionalism": `Despite the surroundings, those of your slaves that are allowed to wear clothes are dressed in clean outfits.${V.seeBestiality ? ` Those bearing litters walk with practiced care, protecting their young.` : ``} They go about their tasks methodically and with care, with ${S.Farmer ? S.Farmer.slaveName : `senior farmhands`} watching carefully to correct any lax behavior.`,
			"Petite Admiration": `The buildings are squat, one story affairs that allow those of smaller stature easier access. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
			"Statuesque Glorification": `Those workers who are smaller and less fit have been given the worst jobs, mucking out the pens and stables. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
			"standard": `It is very much a converted warehouse still, sectioned off into various different areas for the various types of livestock ${V.arcologies[0].name} eats.`,
		};
	}

	// shows only (zoo)
	if (V.farmyardShows === 2) {
		return {
			"Roman Revivalist": `Its red tiles and white stone walls are the very picture of a Roman farm villa's construction, as are the marble statues and reliefs. Saturn and Ceres look over the prosperity of the fields${V.seeBestiality ? `. Mercury watches over the health of the animals, and Feronia ensures strong litters in your slaves.` : `, and Mercury watches over the health of the animals.`} The slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
			"Neo-Imperialist": `Its high-tech, sleek black design invocates an embracement of the future, tempered by the hanging banners displaying your family crest as the rightful lord and master of these farms. Serf-like peasants work tirelessly in the fields, both to grow crops and oversee the slaves beneath them. Despite the harsh nature of the fieldwork, the slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
			"Aztec Revivalist": `It can't completely recreate the floating farms in the ancient Aztec fashion, but it comes as close as it can, shallow pseudo-canals dividing each field into multiple sections. Smooth stone and colorful murals cover the walls, depicting bloody stories of gods and mortals alike.`,
			"Egyptian Revivalist": `It does its best to capture the wide open nature of ancient Egyptian farms, including mimicking the irrigation systems fed by the Nile. The stone walls are decorated with murals detailing its construction and your prowess in general, ${V.seeBestiality ? `with animal-bloated slaves featured prominently.` : `hieroglyphs spelling out volumes of praise.`}`,
			"Edo Revivalist": `It does its best to mimic the rice patties and thatch roofed buildings of the Edo period despite the wide variety of crops tended by various slaves. Not every crop can thrive in flooded fields, but the ones that can take advantage of your attention to detail.`,
			"Arabian Revivalist": `Large plots of olive trees and date palms line the outer edges of the main crop area, while a combination of wheat, flax, and barley occupies the interior space. Irrigation canals snake through the area, ensuring every inch of cropland is well-watered.`,
			"Chinese Revivalist": `It does its best to capture the terraces that covered the ancient Chinese hills and mountains, turning every floor into ribbons of fields following a slight incline. Slaves wade through crops that can handle flooding and splash through the irrigation of the others when they aren't tending to${V.seeBestiality ? ` or breeding with` : ``} your animals.`,
			"Chattel Religionist": `It runs like a well oiled machine, slaves bent in humble service as they tend crops grown on the Prophet's command, or see to the animals' needs. Their clothing is tucked up and out of the way as they see to their tasks, keeping them clean as they work ${V.seeBestiality ? `around animal-bloated bellies ` : ``}as divine will dictates.`,
			"Degradationist": `It is constructed less as a converted warehouse and more as something to visit, allowing guests to enjoy the spectacle of slaves ${V.seeBestiality ? `being pounded by eager animals` : `elbow deep in scrubbing animal waste`} to their satisfaction.`,
			"Repopulationist": `It teems with life, both in the belly of every animal and the belly of every slave, though the latter makes tending the fields difficult. They're ordered to take care, as they carry the future ${V.seeBestiality ? `of this farm` : `of the arcology`} in their bellies.`,
			"Eugenics": `It holds a wide variety of crops and animals, but the best of the best is easy to find. They're set apart from the others, given only the best care and supplies${V.seeBestiality ? ` and bred with only the highest quality slaves` : ``}, while the sub-par stock is neglected off to the side.`,
			"Asset Expansionist": `It is not easy to look after animals and till fields with such enormous body parts, but your slaves are diligent regardless, working hard to provide food and livestock for the arcology.`,
			"Transformation Fetishist": `The plants and animals here all look slightly unnatural, as though they were engineered in a lab to be stronger or larger – which, of course, they were.`,
			"Gender Radicalist": `The plants and animals here all look slightly unnatural, as though they were treated with hormones to be stronger or larger – which, of course, they were.`,
			"Gender Fundamentalist": `The majority of the population of ${V.farmyardName} is pregnant, and the space is outfitted with childbearing in mind.`,
			"Physical Idealist": `Its animals are in exceptional shape, their coats unable to hide how muscular they are, requiring your slaves to be equally toned to control them. There's plenty of space for their exercise as well${V.seeBestiality ? ` and an abundance of curatives for the slaves full of their fierce, kicking offspring` : ``}.`,
			"Supremacist": `It is a clean and orderly operation, stables and cages mucked by a multitude of inferior slaves, along with grooming your animals and harvesting your crops.`,
			"Subjugationist": `It is a clean and orderly operation, stables and cages mucked by a multitude of ${V.arcologies[0].FSSubjugationistRace} slaves, while the others are tasked with grooming your animals and harvesting your crops.`,
			"Paternalist": `It's full of healthy animals, crops, and slaves, the former's every need diligently looked after by the latter. The fields flourish to capacity under such care, and the animals give the distinct impression of happiness${V.seeBestiality ? ` — some more than others if the growing bellies of your slaves are anything to go by, the only indication that such rutting takes place` : ``}.`,
			"Pastoralist": `The space is outfitted with milkers every so often so that lactating farmhands don't have to travel far to relieve themselves of their milk, and the animals are milked of what they can be as well.`,
			"Maturity Preferentialist": `The majority of the population here is older and wiser, and the older animals are all treated with a bit more luxury than the younger ones.`,
			"Youth Preferentialist": `The majority of the population here is full of youth and more energetic, and the younger animals are all treated with a bit more luxury than the older ones.`,
			"Body Purist": `Organic crops and animals are the main feature here, and the animal manure is used as a natural fertilizer for the different plants.`,
			"Slimness Enthusiast": `It features trim animals and slaves alike, not a pound of excess among them. The feed for both livestock and crops are carefully maintained to ensure optimal growth without waste, letting them flourish without being weighed down.`,
			"Hedonistic": `It features wider gates and stalls, for both the humans visiting or tending the occupants, and the animals starting to mimic their handlers${V.seeBestiality ? ` and company` : ``}, with plenty of seats along the way.`,
			"Intellectual Dependency": `Large signs covered in cartoonish illustrations dot the pens, illustrating how to take care of the needs of the occupant within.${V.seeBestiality ? ` There is a strong emphasis on proper breeding positions for your slaves, with step by step instructions.` : ``}`,
			"Slave Professionalism": `Despite the surroundings, those of your slaves that are allowed to wear clothes are dressed in clean outfits.${V.seeBestiality ? ` Those bearing litters walk with practiced care, protecting their young.` : ``} They go about their tasks methodically and with care, with ${S.Farmer ? S.Farmer.slaveName : `senior farmhands`} watching carefully to correct any lax behavior.`,
			"Petite Admiration": `The buildings are squat, one story affairs that allow those of smaller stature easier access. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
			"Statuesque Glorification": `Those workers who are smaller and less fit have been given the worst jobs, mucking out the pens and stables. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
			"standard": `It is very much a converted warehouse still, with basic cages for the animals and a noticeable lack of flair to the various types of equipment used to take care of them – everything is expected to remain clean and functional, but not necessarily pretty.`,
		};
	}

	// food only (farm)
	return {
		"Roman Revivalist": `Its red tiles and white stone walls are the very picture of a Roman farm villa's construction, as are the marble statues and reliefs. Saturn and Ceres look over the prosperity of the fields${V.seeBestiality ? `. Mercury watches over the health of the animals, and Feronia ensures strong litters in your slaves.` : `, and Mercury watches over the health of the animals.`} The slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
		"Neo-Imperialist": `Its high-tech, sleek black design invocates an embracement of the future, tempered by the hanging banners displaying your family crest as the rightful lord and master of these farms. Serf-like peasants work tirelessly in the fields, both to grow crops and oversee the slaves beneath them. Despite the harsh nature of the fieldwork, the slaves here are all looked after well, as they have one of the most important jobs in ${V.arcologies[0].name}.`,
		"Aztec Revivalist": `It can't completely recreate the floating farms in the ancient Aztec fashion, but it comes as close as it can, shallow pseudo-canals dividing each field into multiple sections. Smooth stone and colorful murals cover the walls, depicting bloody stories of gods and mortals alike.`,
		"Egyptian Revivalist": `It does its best to capture the wide open nature of ancient Egyptian farms, including mimicking the irrigation systems fed by the Nile. The stone walls are decorated with murals detailing its construction and your prowess in general, ${V.seeBestiality ? `with animal-bloated slaves featured prominently.` : `hieroglyphs spelling out volumes of praise.`}`,
		"Edo Revivalist": `It does its best to mimic the rice patties and thatch roofed buildings of the Edo period despite the wide variety of crops tended by various slaves. Not every crop can thrive in flooded fields, but the ones that can take advantage of your attention to detail.`,
		"Arabian Revivalist": `Large plots of olive trees and date palms line the outer edges of the main crop area, while a combination of wheat, flax, and barley occupies the interior space. Irrigation canals snake through the area, ensuring every inch of cropland is well-watered.`,
		"Chinese Revivalist": `It does its best to capture the terraces that covered the ancient Chinese hills and mountains, turning every floor into ribbons of fields following a slight incline. Slaves wade through crops that can handle flooding and splash through the irrigation of the others when they aren't tending to${V.seeBestiality ? ` or breeding with` : ``} your animals.`,
		"Chattel Religionist": `It runs like a well oiled machine, slaves bent in humble service as they tend crops grown on the Prophet's command, or see to the animals' needs. Their clothing is tucked up and out of the way as they see to their tasks, keeping them clean as they work ${V.seeBestiality ? `around animal-bloated bellies ` : ``}as divine will dictates.`,
		"Degradationist": `It is constructed less as a converted warehouse and more as something to visit, allowing guests to enjoy the spectacle of slaves ${V.seeBestiality ? `being pounded by eager animals` : `elbow deep in scrubbing animal waste`} to their satisfaction.`,
		"Repopulationist": `It teems with life, both in the belly of every animal and the belly of every slave, though the latter makes tending the fields difficult. They're ordered to take care, as they carry the future ${V.seeBestiality ? `of this farm` : `of the arcology`} in their bellies.`,
		"Eugenics": `It holds a wide variety of crops and animals, but the best of the best is easy to find. They're set apart from the others, given only the best care and supplies${V.seeBestiality ? ` and bred with only the highest quality slaves` : ``}, while the sub-par stock is neglected off to the side.`,
		"Asset Expansionist": `It is not easy to look after animals and till fields with such enormous body parts, but your slaves are diligent regardless, working hard to provide food and livestock for the arcology.`,
		"Transformation Fetishist": `The plants and animals here all look slightly unnatural, as though they were engineered in a lab to be stronger or larger – which, of course, they were.`,
		"Gender Radicalist": `The plants and animals here all look slightly unnatural, as though they were treated with hormones to be stronger or larger – which, of course, they were.`,
		"Gender Fundamentalist": `The majority of the population of ${V.farmyardName} is pregnant, and the space is outfitted with childbearing in mind.`,
		"Physical Idealist": `Its animals are in exceptional shape, their coats unable to hide how muscular they are, requiring your slaves to be equally toned to control them. There's plenty of space for their exercise as well${V.seeBestiality ? ` and an abundance of curatives for the slaves full of their fierce, kicking offspring` : ``}.`,
		"Supremacist": `It is a clean and orderly operation, stables and cages mucked by a multitude of inferior slaves, along with grooming your animals and harvesting your crops.`,
		"Subjugationist": `It is a clean and orderly operation, stables and cages mucked by a multitude of ${V.arcologies[0].FSSubjugationistRace} slaves, while the others are tasked with grooming your animals and harvesting your crops.`,
		"Paternalist": `It's full of healthy animals, crops, and slaves, the former's every need diligently looked after by the latter. The fields flourish to capacity under such care, and the animals give the distinct impression of happiness${V.seeBestiality ? ` — some more than others if the growing bellies of your slaves are anything to go by, the only indication that such rutting takes place` : ``}.`,
		"Pastoralist": `The space is outfitted with milkers every so often so that lactating farmhands don't have to travel far to relieve themselves of their milk, and the animals are milked of what they can be as well.`,
		"Maturity Preferentialist": `The majority of the population here is older and wiser, and the older animals are all treated with a bit more luxury than the younger ones.`,
		"Youth Preferentialist": `The majority of the population here is full of youth and more energetic, and the younger animals are all treated with a bit more luxury than the older ones.`,
		"Body Purist": `Organic crops and animals are the main feature here, and the animal manure is used as a natural fertilizer for the different plants.`,
		"Slimness Enthusiast": `It features trim animals and slaves alike, not a pound of excess among them. The feed for both livestock and crops are carefully maintained to ensure optimal growth without waste, letting them flourish without being weighed down.`,
		"Hedonistic": `It features wider gates and stalls, for both the humans visiting or tending the occupants, and the animals starting to mimic their handlers${V.seeBestiality ? ` and company` : ``}, with plenty of seats along the way.`,
		"Intellectual Dependency": `Large signs covered in cartoonish illustrations dot the pens, illustrating how to take care of the needs of the occupant within.${V.seeBestiality ? ` There is a strong emphasis on proper breeding positions for your slaves, with step by step instructions.` : ``}`,
		"Slave Professionalism": `Despite the surroundings, those of your slaves that are allowed to wear clothes are dressed in clean outfits.${V.seeBestiality ? ` Those bearing litters walk with practiced care, protecting their young.` : ``} They go about their tasks methodically and with care, with ${S.Farmer ? S.Farmer.slaveName : `senior farmhands`} watching carefully to correct any lax behavior.`,
		"Petite Admiration": `The buildings are squat, one story affairs that allow those of smaller stature easier access. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
		"Statuesque Glorification": `Those workers who are smaller and less fit have been given the worst jobs, mucking out the pens and stables. ${V.seeBestiality ? ` Those closer to physical perfection bear the cum stains of their recent breedings.` : ``}`,
		"standard": `It is very much a converted warehouse still, sectioned off into various "departments"${V.farmyardUpgrades.machinery ? ` with machinery placed where it can be` : V.farmyardUpgrades.hydroponics ? ` and plumbing for the hydroponics system running every which way` : ``}.`,
	};
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.farmyard = {
	baseName: "farmyard",
	genericName: null,
	jobs: {
		farmhand: {
			position: "farmhand",
			assignment: Job.FARMYARD,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "farmhand",
	manager: {
		position: "farmer",
		assignment: Job.FARMER,
		careers: App.Data.Careers.Leader.farmer,
		skill: "farmer",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: false,
		shouldThink: true,
		requiredDevotion: 51
	},
	decorated: true
};

App.Entity.Facilities.FarmHandJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @override
	 */
	get assignment() {
		return `work in ${this.facility.name}`;
	}
};

App.Entity.facilities.farmyard = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.farmyard, {
		farmhand: new App.Entity.Facilities.FarmHandJob()
	}
);

repo_name: Fanatey/fc

license: mit


code:
/**
 * The amount of food a given slave produces in a week.
 *
 * Defaults to a menial slave if one is not provided.
 * @param {App.Entity.SlaveState} [slave]
 * @returns {number}
 */
App.Facilities.Farmyard.foodAmount = function(slave) {
	if (slave && V.farmyardShows === 2) { return 0; }

	let food = 100;

	if (V.farmyardUpgrades.pump) {
		food += 25;
	}

	if (V.farmyardUpgrades.fertilizer) {
		food += 50;
	}

	if (V.farmyardUpgrades.seeds) {
		food += 75;
	}

	if (V.farmyardUpgrades.machinery) {
		food += 100;
	}

	if (S.Farmer) {
		food *= 1.1;

		if (S.Farmer.skill.farmer >= V.masteredXP) {
			food *= 1.3;
		}

		if (App.Data.Careers.Leader.farmer.includes(S.Farmer.career)) {
			food *= 1.2;
		}
	}

	if (slave) {
		food += slaveProduction(slave);

		if (V.farmyardShows === 1) {
			food *= 0.5;
		} else if (V.farmyardShows === 2) {
			return 0;
		}
	} else {
		food += menialProduction();
	}

	food = Math.trunc(Math.max(food, 0));

	return food;

	function slaveProduction(slave) {
		let food = 100;

		if (slave.devotion > 50) {
			food *= 1.1;
		} else if (slave.devotion < -50) {
			food *= 0.8;
		}

		if (slaveResting(slave)) {
			food *= 0.9;
		} else if (slave.health.tired + 20 >= 90 && !willWorkToDeath(slave)) {
			slave.devotion -= 10;
			slave.trust -= 5;
			food *= 0.5;
		}

		if (slave.muscles > 30) {
			food *= 1.1;
		} else if (slave.muscles <= -6) {
			food *= 0.8;
		}

		if (slave.weight > 95) {
			food *= 0.9;
		} else if (slave.weight > 130) {
			food *= 0.8;
		} else if (slave.weight > 160) {
			food *= 0.7;
		} else if (slave.weight > 190) {
			food *= 0.6;
		}

		if (!canSee(slave)) {
			food *= 0.6;
		} else if (!canSeePerfectly(slave)) {
			food *= 0.8;
		}

		if (slave.hears === -1) {
			food *= 0.8;
		} else if (slave.hears < -1) {
			food *= 0.6;
		}

		food *= restEffects(slave, 20);

		return food;
	}

	function menialProduction() {
		return food * 0.85;
	}
};

/**
 * The total amount of food produced in a given week.
 *
 * @param {'menials'|'slaves'|'both'} [target] Whose production to target.
 */
App.Facilities.Farmyard.foodProduction = function(target='both') {
	function menialProduction() {
		return V.farmMenials * App.Facilities.Farmyard.foodAmount();
	}

	function slaveProduction() {
		return App.Entity.facilities.farmyard.employees().reduce((acc, cur) => acc + App.Facilities.Farmyard.foodAmount(cur), 0);
	}

	if (target === 'menials') { return menialProduction(); }
	if (target === 'slaves') { return slaveProduction(); }

	return menialProduction() + slaveProduction();
};

/**
 * The total amount of food consumed in a given week.
 *
 * @param {'citizens'|'slaves'|'both'} target Whose consumption to target.
 */
App.Facilities.Farmyard.foodConsumption = function(target = 'both') {
	function citizenConsumption() {
		return (
			(V.lowerClass * V.mods.food.rate.lower) +
			(V.middleClass * V.mods.food.rate.middle) +
			(V.upperClass * V.mods.food.rate.upper) +
			(V.topClass * V.mods.food.rate.top)
		);
	}

	function slaveConsumption() {
		let total = 0;

		for (const slave of V.slaves) {
			let amount = 8;

			if (slave.diet === "restricted") {
				amount = 6;
			} else if (slave.diet === "slimming") {
				amount = 7;
			} else if (slave.diet === "muscle building") {
				amount = 9;
			} else if (slave.diet === "fattening") {
				amount = 10;
			}

			total += amount;
		}

		return total;
	}

	if (target === 'citizens') { return citizenConsumption(); }
	if (target === 'slaves') { return slaveConsumption(); }

	return citizenConsumption() + slaveConsumption();
};


code:
App.UI.foodMarket = function() {
	const frag = new DocumentFragment();
	const quantities = new Set([1, 10, 100, 1000, 10000, 100000]);

	const maxFood = Math.trunc(V.cash / V.mods.food.cost);

	frag.append(
		overview(),
		buy(),
		// sell(),	// TODO: temporarily disabled for balancing
		remove(),
	);

	return frag;

	function overview() {
		const div = document.createElement("div");
		const text = new SpacedTextAccumulator(div);

		const consumption = App.Facilities.Farmyard.foodConsumption();
		const foodValue = Math.trunc(V.mods.food.amount * V.mods.food.cost);
		const citizens = V.lowerClass + V.middleClass + V.upperClass + V.topClass;

		if (V.useTabs === 0) {
			App.UI.DOM.appendNewElement("h2", div, "The Food Market");
		}

		text.push(`The food market has <span class="food">${massFormat(V.mods.food.amount)}</span> in storage, valued at a total of ${cashFormat(foodValue)}.`);

		if (V.mods.food.amount > consumption) {
			text.push(`This is enough to provide for ${numberWithPluralOne(V.slaves.length, `slave`)} and ${numberWithPluralOne(citizens, `citizen`)} for about ${years(Math.trunc(V.mods.food.amount / consumption))}.`);
		} else if (V.mods.food.amount < consumption) {
			text.push(`You will need an additional ${massFormat(consumption - V.mods.food.amount)} to provide for ${numberWithPluralOne(V.slaves.length, `slave`)} and ${numberWithPluralOne(citizens, `citizen`)} during the upcoming week.`);
		}

		text.toChildren();

		return div;
	}

	function buy() {
		const div = App.UI.DOM.makeElement("div", null, ['indent']);
		const links = [];

		div.append(`Buy `);

		for (const q of quantities) {
			links.push(App.UI.DOM.link(
				massFormat(q),
				() => {
					cashX(forceNeg(V.mods.food.cost * q), "farmyard");
					V.mods.food.amount += q;
					App.UI.reload();
				}
			));
		}
		links.push(App.UI.DOM.link(
			"max",
			() => {
				cashX(forceNeg(maxFood * V.mods.food.cost), "farmyard");
				V.mods.food.amount += maxFood;
				App.UI.reload();
			}
		));

		div.append(App.UI.DOM.generateLinksStrip(links));

		return div;
	}

	function sell() {
		const div = App.UI.DOM.makeElement("div", null, ['indent']);
		const links = [];

		div.append(`Sell `);

		if (V.mods.food.amount > 0) {
			for (const q of quantities) {
				links.push(App.UI.DOM.link(
					massFormat(q),
					() => {
						cashX(V.mods.food.cost * q, "farmyard");
						V.mods.food.amount -= q;
						App.UI.reload();
					}
				));
			}
			links.push(App.UI.DOM.link(
				"max",
				() => {
					cashX((V.mods.food.cost * V.mods.food.amount), "farmyard");
					V.mods.food.amount = 0;
					App.UI.reload();
				}
			));
		}

		div.append(App.UI.DOM.generateLinksStrip(links));

		return div;
	}

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

		div.append(
			`You can remove the food market entirely and let your citizens fend for themselves, if you wish.`,
			App.UI.DOM.makeElement("div", App.UI.DOM.link(`Dismantle`, () => {
				V.mods.food.market = false;
				repX(forceNeg(8500), "food");
				App.UI.reload();
			}, [], '', `Your citizens WILL hate you for this.`), ['indent']),
		);

		return div;
	}
};


code:
App.UI.foodReport = function() {
	const text = [];

	text.push(
		production(),
		consumption(),
	);

	return text.join(' ');

	function production() {
		const text = [];
		const production = App.Facilities.Farmyard.foodProduction();
		const farmhands = App.Entity.facilities.farmyard.hostedSlaves;
		const slaveAmount = App.Entity.facilities.farmyard.employees()
			.reduce((acc, cur) => acc + App.Facilities.Farmyard.foodAmount(cur), 0);
		const menialAmount = V.farmMenials * App.Facilities.Farmyard.foodAmount();

		text.push(`${V.arcologies[0].name} produced ${massFormat(production)} of food this week.`);

		if (slaveAmount > 0) {
			text.push(`${V.farmMenials ? capFirstChar(massFormat(slaveAmount)) : `All of it`} was produced by your ${num(farmhands)} farmhands`);
		}
		if (menialAmount > 0) {
			text.push(`${slaveAmount > 0 ? text.pop() + `, and ${massFormat(production - slaveAmount)}` : `All of it`} was produced by ${num(V.farmMenials)} menial slaves`);
		}

		text.push(text.pop() + `.`);

		return text.join(' ');
	}

	function consumption() {
		const text = [];
		const production = App.Facilities.Farmyard.foodProduction();
		const consumption = App.Facilities.Farmyard.foodConsumption();
		const deficit = Math.abs(consumption - production);
		const cost = deficit * V.mods.food.cost;
		const storage = V.mods.food.amount;

		if (production > consumption) {
			text.push(`${capFirstChar(massFormat(consumption))} of it was consumed, with a spare ${massFormat(production - consumption)} moved into long-term storage.`);
		} else {
			if (storage > deficit) {
				text.push(`Unfortunately, this wasn't enough to cover needs of your hungry arcology, and ${massFormat(deficit)} had to be brought up from storage.`);
			} else if (V.cash > cost) {
				text.push(`Unfortunately, this wasn't enough to cover needs of your hungry arcology, and because you didn't have enough food in storage, you has to purchase and additional ${massFormat(deficit - storage)} for ${cashFormat()}.`);
			}
		}

		return text.join(' ');
	}
};


code:
/**
 * Returns a string describing the effects of the slave working to produce food.
 * To see full effects, see farmyardShows.js
 * @param {App.Entity.SlaveState} slave
 * @returns {string}
 */
App.Facilities.Farmyard.produceFood = function(slave) {
	const {he, him, his, He, His} = getPronouns(slave);

	const text = [];

	text.push(
		devotion(),
		muscles(),
		weight(),
		health(),
		sight(),
		hearing(),
		shows(),
	);

	return text.join(' ');

	function devotion() {
		if (slave.devotion > 50) {
			return `${He}'s so devoted to you that ${he} works harder and produces more food.`;
		} else if (slave.devotion < -50) {
			return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food.`;
		} else {
			return `${He} doesn't feel particularly compelled to work hard or slack off and produces an average amount of food.`;
		}
	}

	function health() {
		const text = [];

		text.push(
			healthCondition(),
			healthIllness(),
		);

		return text.join(' ');
	}

	function healthCondition() {
		if (slave.health.condition > 50) {
			return `${His} shining health helps ${him} work harder and longer.`;
		} else if (slave.health.condition < -50) {
			return `${His} poor health impedes ${his} ability to work efficiently.`;
		}
	}

	function healthIllness() {
		const text = [];
		let health = ``;
		let exhaustion = ``;

		if (slave.health.illness > 0 || slave.health.tired > 60) {
			if (slave.health.illness === 1) {
				health = `feeling under the weather`;
			} else if (slave.health.illness === 2) {
				health = `a minor illness`;
			} else if (slave.health.illness === 3) {
				health = `being sick`;
			} else if (slave.health.illness === 4) {
				health = `being very sick`;
			} else if (slave.health.illness === 5) {
				health = `a terrible illness`;
			}

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

			text.push(`${He} performed worse this week due to <span class="health dec">${health}${slave.health.illness > 0 && slave.health.tired > 60 ? ` and ` : ``}${exhaustion}.`);

			text.push(tired());
		}

		return text;
	}

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

	function muscles() {
		if (slave.muscles > 50) {
			return `${His} muscular form helps ${him} work better, increasing ${his} productivity.`;
		} else if (slave.muscles < -50) {
			return `${He} is so weak that ${he} is not able to work effectively.`;
		}
	}

	function weight() {
		if (slave.weight > 95) {
			return `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. `;
		}
	}

	function sight() {
		if (!canSee(slave)) {
			return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production.`;
		} else if (!canSeePerfectly(slave)) {
			return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would.`;
		}
	}

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

	function shows() {
		if (V.farmyardShows === 1) {
			return `Since ${he} also has to put on shows for your citizens, ${he} can only work on food production for half of ${his} shift, cutting down on the amount of food ${he} would have otherwise produced.`;
		}
	}
};


code:
/**
 * @param {App.Entity.SlaveState} slave
 * @returns {number}
 */
App.Facilities.Farmyard.farmShowsIncome = function(slave) {
	const arcology = V.arcologies[0];
	const heavyMods = SlaveStatsChecker.modScore(slave).total > 20;

	const sexualQuirks = ["perverted", "unflinching"];
	const behavioralQuirks = ["sinful"];
	const fetishes = ["humiliation", "masochist"];

	let cash = 25;

	if (!slave) {
		return null;
	} else {
		if (S.Farmer) {
			cash *= 1.1;
			if (S.Farmer.skill.farmer >= V.masteredXP) {
				cash *= 1.1;
			}
		}

		// FS Effects

		if (arcology.FSSupremacist !== "unset") {
			if (isSuperiorRace(slave)) {
				if (V.seeBestiality) {
					cash *= 0.8;
					repX(-10, "shows");
				} else {
					cash *= 1.2;
				}
			} else {
				cash *= 0.9;
			}
		}

		if (arcology.FSSubjugationist !== "unset") {
			if (isInferiorRace(slave)) {
				if (V.seeBestiality) {
					cash *= 1.2;
					repX(10, "shows");
				} else {
					cash *= 0.8;
				}
			} else {
				cash *= 0.9;
			}
		}

		if (arcology.FSRepopulationFocus !== "unset") {
			if (isPreg(slave)) {
				if (slave.eggType === "human") {
					cash *= 1.2;
					repX(15, "shows");
				} else {
					cash *= 0.8;
					repX(-15, "shows");
				}
			}
		}

		if (arcology.FSRestart !== "unset") {
			if (isPreg(slave)) {
				if (isEliteBreeder(slave)) {
					if (slave.eggType === "human") {
						cash *= 0.7;
						repX(-20, "shows");
					} else {
						cash *= 0.6;
						repX(-25, "shows");
					}
				} else {
					if (slave.eggType === "human") {
						cash *= 0.8;
						repX(-15, "shows");
					} else {
						cash += 0.9;
						repX(-10, "shows");
					}
				}
			} else {
				if (V.seeBestiality && isEliteBreeder(slave)) {
					cash *= 0.7;
					repX(-10, "shows");
				}
			}
		}

		if (arcology.FSGenderRadicalist !== "unset") {
			if (slave.genes === "XX") {
				if (slave.dick > 0) {
					cash *= 1.2;
					repX(10, "shows");
				} else {
					cash *= 0.9;
					repX(-5, "shows");
				}
			}
		}

		if (arcology.FSGenderFundamentalist !== "unset") {
			if (isPreg(slave) || App.Data.misc.fakeBellies.includes(slave.bellyAccessory)) {
				cash *= 1.1;
				repX(10, "shows");
			} else {
				cash *= 0.9;
				repX(-5, "shows");
			}

			// FIXME: keep this? not sure it makes sense
			if (slave.genes === "XX") {
				if (slave.dick > 0) {
					cash *= 0.8;
				} else {
					cash *= 1.1;
				}
			}
		}

		if (arcology.FSPaternalist !== "unset") {
			if (V.seeBestiality) {
				if (!V.policies.bestialityOpenness) {
					if (V.farmyardBreeding) {
						if (V.farmyardRestraints) {
							cash *= 0.5;
						} else {
							cash *= 0.7;
						}
					} else {
						if (V.farmyardRestraints) {
							cash *= 0.8;
						} else {
							cash *= 0.9;
						}
					}
				}
			}
		}

		if (arcology.FSDegradationist !== "unset") {
			if (V.seeBestiality) {
				if (V.farmyardBreeding) {
					if (V.farmyardRestraints) {
						cash *= 1.5;
					} else {
						cash *= 1.3;
					}
				} else {
					if (V.farmyardRestraints) {
						cash *= 1.2;
					} else {
						cash *= 1.1;
					}
				}
			}
		}

		if (arcology.FSBodyPurist !== "unset") {
			if (SlaveStatsChecker.isModded(slave)) {
				if (heavyMods) {
					cash *= 0.7;
					repX(-15, "shows");
				} else {
					cash *= 0.8;
					repX(-10, "shows");
				}
			}
		}

		if (arcology.FSTransformationFetishist !== "unset") {
			if (SlaveStatsChecker.isModded(slave)) {
				if (heavyMods) {
					cash *= 1.3;
					repX(15, "shows");
				} else {
					cash *= 1.2;
					repX(10, "shows");
				}
			}
		}

		if (arcology.FSYouthPreferentialist !== "unset") {
			if (isYoung(slave)) {
				cash *= 1.2;
				repX(10, "shows");
			} else {
				cash *= 0.8;
				repX(-5, "shows");
			}
		}

		if (arcology.FSMaturityPreferentialist !== "unset") {
			if (!isYoung(slave)) {
				cash *= 1.2;
				repX(10, "shows");
			} else {
				cash *= 0.8;
				repX(-5, "shows");
			}
		}

		if (arcology.FSSlimnessEnthusiast !== "unset") {
			if (slimLawPass(slave)) {
				cash *= 1.1;
				repX(10, "shows");
			} else {
				cash *= 0.9;
				repX(-5, "shows");
			}
		}

		// FIXME: marked for possible rewrite
		if (arcology.FSAssetExpansionist !== "unset") {
			if (isStacked(slave)) {
				cash *= 1.1;
				repX(10, "shows");
			}
		}

		if (arcology.FSPastoralist !== "unset") {
			if (slave.boobs >= 1000) {
				cash *= 1.2;
				repX(10, "shows");
			}

			if (slave.lactation > 0) {
				cash *= 1.1;
				repX(5, "shows");
			}
		}

		// FIXME: marked for review
		if (arcology.FSPhysicalIdealist !== "unset") {
			if (genderLawPass(slave)) {
				cash *= 1.1;
				repX(10, "shows");
			} else {
				cash *= 0.9;
				repX(-5, "shows");
			}

			if (slave.muscles > 30) {
				cash *= 1.1;
			} else {
				cash *= 0.9;
			}
		}

		if (arcology.FSHedonisticDecadence !== "unset") {
			if (slave.weight > 10) {
				cash *= 1.1;
			} else {
				cash *= 0.9;
			}
		}

		if (arcology.FSPetiteAdmiration !== "unset") {
			if (heightPass(slave)) {
				cash *= 1.1;
				repX(10, "shows");
			} else {
				cash *= 0.9;
				repX(-5, "shows");
			}
		}

		if (arcology.FSStatuesqueGlorification !== "unset") {
			if (heightPass(slave)) {
				cash *= 1.1;
				repX(10, "shows");
			} else {
				cash *= 0.9;
				repX(-5, "shows");
			}
		}

		// Virginity

		if (V.seeBestiality) {
			if (slave.devotion > 50 &&
				(slave.vagina === 0 && canDoVaginal(slave)) ||
				(slave.anus === 0 && canDoAnal(slave))) {
				cash *= 2.5;

				if (slave.vagina === 0) {
					slave.vagina = 1;
				} else {
					slave.anus = 1;
				}
			}
		}

		// Careers

		if (App.Data.Careers.General.entertainment.includes(slave.career)) {
			cash *= 1.1;
		}

		if (App.Data.Careers.Leader.farmer.includes(slave.career)) {
			cash *= 1.1;
		}

		if (slave.prestige === 1) {
			cash *= 1.2;
		} else if (slave.prestige === 2) {
			cash *= 1.6;
		} else if (slave.prestige === 3) {
			cash *= 2.1;
		}

		if (slave.porn.prestige === 1) {
			cash *= 1.1;
		} else if (slave.porn.prestige === 2) {
			cash *= 1.4;
		} else if (slave.porn.prestige === 3) {
			cash *= 1.8;
		}

		if (slave.health.condition > 50) {
			cash *= 1.2;
		} else if (slave.health.condition < -20) {
			cash *= 0.9;
		}

		// TODO: add checks for family and relationships

		if (slave.face > 40) {
			cash *= 1.4;
		} else if (slave.face > 10) {
			cash *= 1.1;
		} else if (slave.face < -10) {
			cash *= 0.9;
		} else if (slave.face < -40) {
			cash *= 0.7;
		}

		cash *= devotion(cash);

		if (slave.weight > 30) {
			if (arcology.FSHedonisticDecadence !== "unset") {
				cash *= 0.8;
			}
			// TODO: put this on a scale
		} else if (slave.weight < -30) {
			cash *= 0.8;
		}

		// FIXME: marked for rewrite
		if (slave.muscles > 30) {
			cash *= 0.9;
		} else if (slave.muscles < -30) {
			cash *= 0.6;
		}

		if (!canSeePerfectly(slave)) {
			if (canSee(slave)) {
				cash *= 0.8;
			} else {
				cash *= 0.6;
			}
		}

		if (!canHear(slave)) {
			cash *= 0.8;
		}

		if (isPreg(slave)) {
			cash *= 0.8;
		}
		// TODO: incorporate skills
		cash *= healthPenalty(slave);

		if (slave.intelligence > 50) {
			cash *= 1.4;
		} else if (slave.intelligence < -50) {
			cash *= 0.6;
		}

		if (slave.energy > 95) {
			cash *= 1.5;
		} else if (slave.energy > 80) {
			cash *= 1.3;
		} else if (slave.energy > 60) {
			cash *= 1.1;
		} else if (slave.energy > 40) {
			cash *= 0.9;
		} else if (slave.energy > 20) {
			cash *= 0.8;
		} else {
			cash *= 0.6;
		}

		switch (slave.fetish) {
			case "submissive":
			case "humiliation":
				if (V.seeBestiality) {
					if (slave.fetishKnown) {
						cash *= 1.1;
					} else {
						slave.fetishKnown = random(1, 100) > 80 ? 1 : 0;
					}
				} else {
					if (slave.fetishKnown) {
						cash *= 0.9;
					} else {
						slave.fetishKnown = random(1, 100) > 80 ? 1 : 0;
					}
				}
				break;

			default:
				break;
		}

		switch (slave.behavioralFlaw) {
			case "devout":
			case "arrogant":
				cash *= 0.9;
				break;

			default:
				break;
		}

		switch (slave.behavioralQuirk) {
			case "sinful":
				cash *= 1.1;
				break;

			default:
				break;
		}

		switch (slave.sexualFlaw) {
			case "shamefast":
				cash *= 1.1;
				break;

			default:
				break;
		}

		switch (slave.sexualQuirk) {
			case "perverted":
				cash *= 1.1;
				break;

			default:
				break;
		}

		if (V.policies.bestialityOpenness > 0) {
			cash *= 1.75;
		}

		if (V.farmyardShows < 2) {
			cash *= 0.5;
		}

		// Multipliers

		if (V.animals.canine.length > 0) {
			cash *= (1 + (V.animals.canine.length * 0.05));
		}
		if (V.animals.hooved.length > 0) {
			cash *= (1 + (V.animals.hooved.length * 0.05));
		}
		if (V.animals.feline.length > 0) {
			cash *= (1 + (V.animals.feline.length * 0.05));
		}

		setSlaveDevotion();
		setSlaveTrust();

		return Math.max(cash, 0);
	}

	function devotion(amount) {
		if (slave.devotion > 50) {
			amount *= 1.4;
		} else if (slave.devotion < -50) {
			amount *= 0.6;
		}

		return amount;
	}

	function setSlaveDevotion() {
		const slaveApproves =
			sexualQuirks.includes(slave.sexualQuirk) ||
			behavioralQuirks.includes(slave.behavioralQuirk) ||
			fetishes.includes(slave.fetish);

		if (slave.devotion > 50) {
			if (V.seeBestiality) {
				if (slaveApproves) {
					slave.devotion += 2;
				} else {
					slave.devotion--;
				}
			}

			if (V.farmyardBreeding) {
				if (slaveApproves) {
					slave.devotion += 2;
				} else {
					slave.devotion--;
				}
			}

			if (V.farmyardRestraints) {
				if (slaveApproves) {
					slave.devotion += 3;
				} else {
					slave.devotion -= 2;
				}
			}
		} else if (slave.devotion < -50) {
			if (V.seeBestiality) {
				if (slaveApproves) {
					slave.devotion++;
				} else {
					slave.devotion -= 2;
				}
			}

			if (V.farmyardBreeding) {
				if (slaveApproves) {
					slave.devotion++;
				} else {
					slave.devotion -= 2;
				}
			}

			if (V.farmyardRestraints) {
				if (slaveApproves) {
					slave.devotion += 2;
				} else {
					slave.devotion -= 3;
				}
			}
		}
	}

	function setSlaveTrust() {
		const slaveApproves =
			sexualQuirks.includes(slave.sexualQuirk) ||
			behavioralQuirks.includes(slave.behavioralQuirk) ||
			fetishes.includes(slave.fetish);

		if (slave.trust > 50) {
			if (V.seeBestiality) {
				if (slaveApproves) {
					slave.trust += 2;
				} else {
					slave.trust--;
				}
			}

			if (V.farmyardBreeding) {
				if (slaveApproves) {
					slave.trust += 2;
				} else {
					slave.trust--;
				}
			}

			if (V.farmyardRestraints) {
				if (slaveApproves) {
					slave.trust += 3;
				} else {
					slave.trust -= 2;
				}
			}
		} else if (slave.trust < -50) {
			if (V.seeBestiality) {
				if (slaveApproves) {
					slave.trust++;
				} else {
					slave.trust -= 2;
				}
			}

			if (V.farmyardBreeding) {
				if (slaveApproves) {
					slave.trust++;
				} else {
					slave.trust -= 2;
				}
			}

			if (V.farmyardRestraints) {
				if (slaveApproves) {
					slave.trust += 2;
				} else {
					slave.trust -= 3;
				}
			}
		}
	}
};


code:
/**
 * Returns a string describing the effects of the slave putting on shows.
 * To see full effects, see farmyardShows.js
 * @param {App.Entity.SlaveState} slave
 * @returns {string}
 */
App.Facilities.Farmyard.putOnShows = function(slave) {
	const {he, him, his, hers, He, His} = getPronouns(slave);
	const incomeStats = getSlaveStatisticData(slave, V.facility.farmyard);
	const arcology = V.arcologies[0];
	const beautyString = beautiful(slave);
	const prettyString = pretty(slave);

	const heavyMods = SlaveStatsChecker.modScore(slave).total > 20;

	const text = [];

	if (V.seeBestiality) {
		seX(slave, "bestiality", "animal", "bestiality", random(35, 65));
	}

	text.push(
		`${He} ${V.farmyardShows < 2 ? `also ` : ``}puts on shows with animals this week.`,
		FSEffects(),
		virginity(),
		careers(),
		prestige(),
		health(),
		face(),
		devotion(),
		weight(),
		muscles(),
		eyesight(),
		hearing(),
		pregnancy(),
		tiredness(),
		intelligence(),
		energy(),
		fetish(),
		behavioralFlaw(),
		behavioralQuirk(),
		sexualFlaw(),
		sexualQuirk(),
		openness(),
		rival(),
	);

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

	return text.join(' ');

	function FSEffects() {
		const text = [];

		if (arcology.FSSupremacist !== "unset") {
			if (isSuperiorRace(slave)) {
				if (V.seeBestiality) {
					text.push(`Society <span class="reputation dec">disapproves</span> of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much.`);
				} else {
					text.push(`Since ${arcology.FSSupremacistRace} slaves are in fashion, ${he} attracts a little more attention than if ${he} wasn't ${arcology.FSSupremacistRace}.`);
				}
			} else {
				text.push(`Society doesn't disapprove of ${him} not being ${arcology.FSSupremacistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was.`);
			}
		}

		if (arcology.FSSubjugationist !== "unset") {
			if (isInferiorRace(slave)) {
				if (V.seeBestiality) {
					text.push(`Society <span class="reputation inc">approves</span> of the degradation you submit your ${arcology.FSSubjugationistRace} slaves to, and so ${he} earns you a bit more.`);
				} else {
					// FIXME: Type 'FC.NoObject' is not assignable to type 'string'.
					text.push(`Fewer people want to go see ${addA(arcology.FSSubjugationistRace)} slave put on a show, and so ${he} doesn't earn as much as ${he} otherwise could.`);
				}
			} else {
				if (V.seeBestiality) {
					text.push(`Society doesn't disapprove of ${him} not being ${arcology.FSSubjugationistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was.`);
				}
			}
		}

		if (arcology.FSRepopulationFocus !== "unset") {
			if (isPreg(slave)) {
				if (slave.eggType === "human") {
					text.push(`Society <span class="reputation inc">greatly approves</span> of your having pregnant slaves ${V.seeBestiality ? `have sex` : `put on shows`} with animals.`);
				} else {
					text.push(`Society is <span class="reputation dec">disgusted</span> by ${his} pregnancy when they realize that what it is in ${his} womb is not human.`);
				}
			}
		}

		if (arcology.FSRestart !== "unset") {
			if (isPreg(slave)) {
				if (isEliteBreeder(slave)) {
					if (slave.eggType === "human") {
						text.push(`Society is horrified by the fact that you would dare defile a slave deemed fit for humanity's revival in such a manner, especially one that is carrying the future of the planet.`);
					} else {
						text.push(`Society is absolutely repulsed by the fact that you would dare defile a slave deemed fit for humanity's revival in such a manner, especially when they learn that what is in ${his} womb is not even human.`);
					}
				} else {
					if (slave.eggType === "human") {
						text.push(`Society is <span class="reputation dec">extremely disgusted</span> by ${his} pregnancy and the fact that you would have ${him} ${V.seeBestiality ? `have sex` : `put on shows`} with animals while sporting a baby bump.`);
					} else {
						text.push(`Society is disgusted by ${his} pregnancy until they learn that what is in ${his} womb is not human.`);
					}
				}
			} else {
				if (V.seeBestiality && isEliteBreeder(slave)) {
					text.push(`Society is <span class="reputation dec">heavily disapproving</span> of the fact that you would dare defile a slave deemed fit for humanity's revival in such a manner.`);
				}
			}
		}

		if (arcology.FSGenderRadicalist !== "unset") {
			if (slave.dick > 0) {
				text.push(`${His} patrons <span class="reputation inc">approve</span> of the fact that ${he} has a dick.`);
			} else {
				text.push(`${His} patrons <span class="reputation dec">are disappointed</span> that ${he} doesn't have a dick.`);
			}
		}

		if (arcology.FSGenderFundamentalist !== "unset") {
			if (isPreg(slave) || App.Data.misc.fakeBellies.includes(slave.bellyAccessory)) {
				text.push(`${His} viewers <span class="reputation inc">approve</span> of the fact that ${he} is sporting a baby bump${App.Data.misc.fakeBellies.includes(slave.bellyAccessory) ? `, even though ${hers} isn't real` : ``}.`);
			} else {
				text.push(`${His} viewers <span class="reputation dec">are disappointed</span> that ${he} isn't pregnant.`);
			}
		}

		if (arcology.FSPaternalist !== "unset") {
			if (V.seeBestiality) {
				if (V.policies.bestialityOpenness) {
					text.push(`Your citizens would normally disapprove of your using slaves as toys for your animals, but the policy you enacted encouraging bestiality, combined with some clever, subtle advertising, leads them to see nothing wrong with it.`);
				} else {
					if (V.farmyardBreeding) {
						if (V.farmyardRestraints) {
							text.push(`Your citizens are <span class="reputation dec">extremely disapproving</span> of the fact that you would allow your slaves to be treated as nothing more than a bound breeding toy for your animals.`);
						} else {
							text.push(`Your citizens are <span class="reputation dec">highly disapproving</span> of the fact that you would allow your slaves to be treated as nothing more than a breeding toy for your animals.`);
						}
					} else {
						if (V.farmyardRestraints) {
							text.push(`Your citizens are <span class="reputation dec">very disapproving</span> of the fact that you would allow your slaves to be treated as nothing more than a bound toy for your animals.`);
						} else {
							text.push(`Your citizens are <span class="reputation dec">disapproving</span> of the fact that you would allow your slaves to be treated as nothing more than a toy for your animals.`);
						}
					}
				}
			}
		}

		if (arcology.FSDegradationist !== "unset") {
			if (V.seeBestiality) {
				if (V.farmyardBreeding) {
					if (V.farmyardRestraints) {
						text.push(`Your citizens are <span class="reputation dec">extremely approving</span> of the fact that you would allow your slaves to be treated as nothing more than a bound breeding toy for your animals.`);
					} else {
						text.push(`Your citizens are <span class="reputation dec">highly approving</span> of the fact that you would allow your slaves to be treated as nothing more than a breeding toy for your animals.`);
					}
				} else {
					if (V.farmyardRestraints) {
						text.push(`Your citizens are <span class="reputation dec">very approving</span> of the fact that you would allow your slaves to be treated as nothing more than a bound toy for your animals.`);
					} else {
						text.push(`Your citizens are <span class="reputation dec">approving</span> of the fact that you would allow your slaves to be treated as nothing more than a toy for your animals.`);
					}
				}
			}
		}

		if (arcology.FSBodyPurist !== "unset") {
			if (SlaveStatsChecker.isModded(slave)) {
				text.push(`The members of the audience <span class="reputation dec">disapprove</span> that you would use a slave with ${heavyMods ? `such heavy` : ``} modifications to put on shows.`);
			}
		}

		if (arcology.FSTransformationFetishist !== "unset") {
			if (SlaveStatsChecker.isModded(slave)) {
				text.push(`The members of the audience <span class="reputation inc">approve</span> that you would use a slave with ${heavyMods ? `such heavy` : ``} modifications to put on shows.`);
			}
		}

		if (arcology.FSYouthPreferentialist !== "unset") {
			if (isYoung(slave)) {
				text.push(`${arcology.name}'s citizens <span class="reputation inc">approve</span> of your using young slaves to put on shows.`);
			} else {
				text.push(`${arcology.name}'s citizens <span class="reputation dec">disapprove</span> of your using such old slaves to put on shows.`);
			}
		}

		if (arcology.FSMaturityPreferentialist !== "unset") {
			if (isYoung(slave)) {
				text.push(`${arcology.name}'s citizens <span class="reputation inc">approve</span> of your using mature slaves to put on shows.`);
			} else {
				text.push(`${arcology.name}'s citizens <span class="reputation dec">disapprove</span> of your using such young slaves to put on shows.`);
			}
		}

		if (arcology.FSSlimnessEnthusiast !== "unset") {
			if (isSlim(slave)) {
				text.push(`${His} slim body <span class="reputation inc">attracts a wider audience.</span>`);
			} else {
				text.push(`Society finds your using a slave with such a flabby body <span class="reputation dec">disgusting.</span>`);
			}
		}

		if (arcology.FSAssetExpansionist !== "unset") {
			if (isStacked(slave)) {
				text.push(`Society <span class="reputation inc">approves</span> of the fact that you respect their ideals in using a slave with larger assets.`);
			}
		}

		if (arcology.FSPastoralist !== "unset") {
			if (slave.boobs >= 1000) {
				text.push(`The fact that ${slave.slaveName} has such large udders <span class="reputation inc">pleases your citizens.</span>`);
			}

			if (slave.lactation > 0) {
				text.push(`Your citizens ${slave.boobs >= 1000 ? `also ` : ``}approve of the fact that ${he} is visibly lactating.`);
			}
		}

		if (arcology.FSPhysicalIdealist !== "unset") {
			if (genderLawPass(slave)) {
				text.push(`The fact that ${slave.slaveName} has what is considered the ideal form also <span class="reputation inc">helps ${him} attract attention,</span> and so ${he} earns a bit more.`);
			} else {
				text.push(`${His} form isn't exactly what ${arcology.name}'s citizens consider ideal, and so ${he} doesn't <span class="reputation dec">earn as much</span> as ${he} could have otherwise.`);
			}
		}

		if (arcology.FSHedonisticDecadence !== "unset") {
			if (slave.weight > 10) {
				text.push(`Since ${slave.slaveName} is large enough to please ${arcology.name}'s citizens, ${he} earns slightly more.`);
			} else {
				text.push(`${He} doesn't earn quite as much ${he} would have if ${he} was a bit larger in size.`);
			}
		}

		if (arcology.FSPetiteAdmiration !== "unset") {
			if (heightPass(slave)) {
				text.push(`The fact that you are using such small slaves <span class="reputation inc">pleases your citizens.</span>`);
			} else {
				text.push(`The fact that you are using such small slaves <span class="reputation dec">displeases your citizens.</span>`);
			}
		}

		if (arcology.FSStatuesqueGlorification !== "unset") {
			if (heightPass(slave)) {
				text.push(`Your citizens <span class="reputation inc">approve</span> of your using such statuesque slaves for putting on shows.`);
			} else {
				text.push(`Your citizens <span class="reputation dec">disapprove</span> of your not using taller slaves for putting on shows.`);
			}
		}

		return text.join(' ');
	}

	function virginity() {
		if (V.seeBestiality) {
			if (slave.devotion > 50 && canBeDeflowered(slave)) {
				return `${slave.slaveName} promised the crowd ${he} would allow one of your animals to deflower ${him} onstage if they all donated enough ¤, and ${he} stayed true to ${his} word – ${his} tight little ${slave.vagina === 0 ? `pussy` : `ass`} has been broken in.`;
			}
		}
	}

	function careers() {
		const text = [];

		if (App.Data.Careers.General.entertainment.includes(slave.career)) {
			text.push(`${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows.`);
		}

		if (App.Data.Careers.Leader.farmer.includes(slave.career)) {
			text.push(`${He} ${App.Data.Careers.General.entertainment.includes(slave.career) ? `also` : ``} has experience in working with animals from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows.`);
		}

		return text.join(' ');
	}

	function prestige() {
		const text = [];

		if (slave.prestige === 1) {
			text.push(`Your citizens are so eager to see someone they recognize ${V.seeBestiality ? `be ${V.farmyardBreeding ? `bred` : `rutted`} by an animal` : `put on shows with an animal`} that they are willing to pay a bit more.`);
		} else if (slave.prestige === 2) {
			text.push(`Your citizens are so eager to see someone well-known ${V.seeBestiality ? `be ${V.farmyardBreeding ? `bred` : `rutted`} by an animal` : `put on shows with an animal`} that they are willing to pay a fair bit more.`);
		} else if (slave.prestige === 3) {
			text.push(`Your citizens are so eager to see someone so famous ${V.seeBestiality ? `be ${V.farmyardBreeding ? `bred` : `rutted`} by an animal` : `put on shows with an animal`} that they are willing to pay much more.`);
		}

		if (slave.porn.prestige === 1) {
			text.push(`${He} earns a bit more because some of your citizens already know ${him} from porn.`);
		} else if (slave.porn.prestige === 2) {
			text.push(`${He} earns quite a bit more because a lot of your citizens already know ${him} from porn.`);
		} else if (slave.porn.prestige === 3) {
			text.push(`${He} earns a lot more because ${he} is so famous from porn.`);
		}

		return text.join(' ');
	}

	function health() {
		if (slave.health.condition > 50) {
			return `${He} is in such excellent health that ${he} is able to put on longer and more energetic shows, earning you more.`;
		} else if (slave.health.condition < -20) {
			return `${His} poor health negatively affects ${his} ability to put on good shows, cutting into your profits.`;
		}
	}

	// TODO: add checks for family and relationships
	function face() {
		if (slave.face > 40) {
			return `${He} is so ${beautyString} that ${his} audience is willing to pay more to watch ${him} put on shows.`;
		} else if (slave.face > 10) {
			return `${He} is so ${prettyString} that ${his} audience is willing to pay more to watch ${him} put on shows.`;
		} else if (slave.face < -10) {
			return `${His} audience isn't willing to pay as much because of how unattractive ${his} face is.`;
		} else if (slave.face < -40) {
			return `${His} audience isn't willing to pay as much because of how hard ${his} face is to look at.`;
		}
	}

	// TODO: incorporate seeBestiality, breeding, and restraints
	function devotion() {
		if (slave.devotion > 50) {
			if (slave.trust > 50) {
				return `${He} is so devoted that ${he} works ${his} hardest to make ${his} show a good one.`;
			} else if (slave.trust < -50) {
				return `${He} is both devoted to you and terrified of you, so ${he} tries ${his} best to make ${his} show a good one.`;
			}
		} else if (slave.devotion < -50) {
			if (slave.trust > 50) {
				return `${slave.slaveName} purposefully does the bare minimum ${he} can get away with to spite you.`;
			} else if (slave.trust < -50) {
				return `${slave.slaveName} refuses to do anything without punishment, which is evident from ${his} meager earnings.`;
			}
		}
	}

	function weight() {
		if (slave.weight > 30) {
			if (arcology.FSHedonisticDecadence === "unset") {
				return `Your citizens are not willing to pay as much to see such a fat slave put on shows, so ${he} loses some income.`;
			}
		} else if (slave.weight < -30) {
			return `Your citizens don't like watching such a sickly-looking slaves put on shows, so ${he} loses some income.`;
		}
	}

	function muscles() {
		if (slave.muscles < -30) {
			return `${slave.slaveName} is so weak that ${he} cannot even properly handle the animals ${he}'s assigned to ${V.seeBestiality ? `fuck` : `work with`}, and isn't able to put on any sort of meaningful show.`;
		}
	}

	function eyesight() {
		if (!canSeePerfectly(slave)) {
			return `${His} ${!canSee(slave) ? `blindness makes it impossible` : `nearsightedness makes it harder`} for ${him} to see what ${he}'s doing, affecting ${his} ability to put on a good show.`;
		}
	}

	function hearing() {
		if (slave.hears < 0) {
			return `${His} ${slave.hears < -1 ? `lack of` : `poor`} hearing makes it difficult for ${him} to hear what ${his} audience wants from ${him}, which really affects ${his} earnings.`;
		}
	}

	function pregnancy() {
		if (isPreg(slave)) {
			return `${His}${slave.bellyPreg > 100000 ? ` advanced` : ``} pregnancy makes it more difficult for him to effectively put on a good show.`;
		}
	}

	function tiredness() {
		if (slave.health.tired > 60) {
			return `${He} is so tired that the energy in ${his} shows is basically nonexistent, affecting ${his} profits.`;
		}
	}

	function intelligence() {
		if (slave.intelligence > 50) {
			return `Because ${he} is so intelligent, ${he} is able to tailor ${his} shows to ${his} audience, helping ${him} bring in more in profits.`;
		} else if (slave.intelligence < -50) {
			return `${He} is so slow that all ${he} can really do is just ${V.seeBestiality ? `lie there and take it` : `put on the most basic of moves`}, which your audience finds dull and uninteresting.`;
		}
	}

	function energy() {
		if (V.seeBestiality) {
			if (slave.energy > 95) {
				return `The fact that ${he} is a nymphomaniac helps ${him} to go for longer, allowing ${him} to really put on an amazing show.`;
			} else if (slave.energy > 80) {
				return `The fact that ${his} sex drive is so powerful helps ${him} to really put on good shows.`;
			} else if (slave.energy > 60) {
				return `The fact that ${his} sex drive is so good helps ${him} to put on good shows.`;
			} else if (slave.energy > 40) {
				return `${His} average sex drive allows ${him} to put on a decent show.`;
			} else if (slave.energy > 20) {
				return `The fact that ${his} sex drive is so poor affects ${his} performance.`;
			} else {
				return `The fact that ${his} sex drive is nonexistent really hinders ${his} ability to put on a decent show.`;
			}
		}
	}

	function fetish() {
		switch (slave.fetish) {
			case "submissive":
				if (V.seeBestiality) {
					if (slave.fetishKnown) {
						return `${He} is so submissive that ${he} willingly accepts ${his} position as an animal's fucktoy and <span class="reputation inc">is able to put on a decent show.</span>`;
					} else {
						return `${S.HeadGirl ? `${S.HeadGirl.slaveName} notices` : `You notice`} that ${slave.slaveName} seems to have really taken to ${his} position as a fucktoy for animals. <span class="lightcoral">${He}'s a submissive!</span>`;
					}
				} else {
					if (slave.fetishKnown) {
						return `Being a submissive, ${he} <span class="reputation dec">doesn't have the confidence required</span> to really put on a good show.`;
					} else {
						return `${slave.slaveName} doesn't seem to have the type of fortitude needed to put on a show, and after some probing, you discover why - it turns out <span class="lightcoral">${he}'s a submissive!</span>`;
					}
				}
			case "humiliation":
				if (V.seeBestiality) {
					if (slave.fetishKnown) {
						return `${slave.slaveName} uses the most of this humiliating experience to really put on a show, to <span class="reputation inc">the approval of ${his} audience.</span>`;
					}
				}
		}
	}

	function behavioralFlaw() {
		switch (slave.behavioralFlaw) {
			case "arrogant":
				return `${He} tries ${his} hardest to avoid ${V.seeBestiality ? `fucking animals` : `putting on shows`} because of ${his} arrogance, <span class="cash dec">which affects ${his} profits</span> and <span class="reputation dec">your reputation.</span>`;

			case "devout":
				return `${He} often prays ${V.seeBestiality ? ` while getting fucked by animals` : ` during ${his} shows`}, which your citizens <span class="reputation dec">find off-putting.</span>`;
		}
	}

	function behavioralQuirk() {
		switch (slave.behavioralQuirk) {
			case "sinful":
				return `${He} relishes in ${his} ability to do something so sinful and depraved, and <span class="reputation inc">really puts on a show.</span>`;
		}
	}

	function sexualFlaw() {
		switch (slave.sexualFlaw) {
			case "shamefast":
				return `${His} crippling shamefastness <span class="reputation dec">limits ${his} ability</span> to put on a decent show.`;
		}
	}

	function sexualQuirk() {
		switch (slave.sexualQuirk) {
			case "perverted":
				return `${His} shows are a <span class="reputation inc">real spectacle,</span> since ${he} is so perverted that ${he} is willing to go far beyond the bare minimum.`;
		}
	}

	function openness() {
		if (V.policies.bestialityOpenness > 0) {
			return `Society's acceptance of and enthusiasm towards bestiality earns ${him} quite a bit more than ${he} would have made otherwise.`;
		}
	}

	function rival() {
		if (slave.rivalry > 0 && V.seeBestiality) {
			return `${getSlave(slave.rivalryTarget).slaveName} hates ${him} and is glad to see that ${he}'s been assigned to fuck animals all day.`;
		}
	}
};


code:
App.UI.geneLab = function() {
	const node = new DocumentFragment();
	const PCSkillCheck = Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier);

	App.UI.DOM.appendNewElement("h1", node, `The Gene Lab`);

	if (V.geneticMappingUpgrade === 1) {
		App.UI.DOM.appendNewElement("div", node, `The gene lab is fully operational. It is capable of mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to modify a slave's genome should you obtain the data necessary to adjust it.`, "note");
		const cost = Math.trunc(500000 * V.upgradeMultiplierArcology);
		App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
			"Upgrade the genome mapper",
			() => {
				cashX(forceNeg(cost), "capEx");
				V.geneticMappingUpgrade = 2;
				App.UI.reload();
			}, [], "",
			`Costs ${cashFormat(cost)}`
		));
	} else if (V.geneticMappingUpgrade === 2) {
		App.UI.DOM.appendNewElement("div", node, `The gene lab is fully operational. It is capable of fully mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to correct (or flaw) a slave's genome, as well as modify it should you obtain the data necessary to adjust it.`, "note");
	}

	App.UI.DOM.appendNewElement("h2", node, `Genetic Modification`);
	const immortalityCost = 50000000;
	const flavoringCost = 150000;
	if (V.dispensaryUpgrade === 0) {
		App.UI.DOM.appendNewElement("div", node, `The fabricator must be upgraded before it can produce treatments to alter genes`, "note");
	} else {
		App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to alter a slave's genetic code.`);
		if (V.arcologies[0].childhoodFertilityInducedNCSResearch === 1) {
			App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to induce NCS.`);
		}
		if (V.RapidCellGrowthFormula === 1) {
			App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to accelerate cellular reproduction.`);
		}
		if (V.immortalityFormula === 1) {
			App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to permanently reverse aging.`);
		} else if (V.cash >= immortalityCost) {
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Fund the immortality project",
				() => {
					cashX(forceNeg(immortalityCost), "capEx");
					V.immortalityFormula = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(immortalityCost)}. Will keep a slave at their prime physical age`
			));
		}
		if (V.geneticMappingUpgrade >= 2) {
			if (V.geneticFlawLibrary !== 1) {
				const anomaliesCost = 100000 * PCSkillCheck;
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Purchase designs for inducing genetic anomalies",
					() => {
						cashX(forceNeg(anomaliesCost), "capEx");
						V.geneticFlawLibrary = 1;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(anomaliesCost)}. Will allow genetic flaws and quirks to be injected into a slave's genome`
				));
			} else {
				App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to induce various genetic anomalies.`);
			}

			if (V.bioEngineeredFlavoringResearch === 1) {
				App.UI.DOM.appendNewElement("div", node, `The fabricator is capable of producing treatments to change the flavor of a slave's milk.`);
			} else if (V.cash >= flavoringCost) {
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Fund research into bio-engineered human milk flavoring",
					() => {
						cashX(forceNeg(flavoringCost), "capEx");
						V.bioEngineeredFlavoringResearch = 1;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(flavoringCost)}. This will allow changing the flavor of a slave's milk`
				));
			}
		}
		if (V.seeCats === 1) {
			let r = [];
			if (V.geneticMappingUpgrade >= 2 && V.projectN.status === 0) {
				const catCost = 150000 * PCSkillCheck;
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Hire a team of renowned bioengineers and geneticists to splice the human genome with cat DNA and fulfill the destiny of mankind - creating catgirls",
					() => {
						cashX(forceNeg(catCost), "capEx");
						V.projectN.status = 1;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(catCost)}. Will begin a long-term project to push the boundaries of science and genetically engineer the world's first catgirl`
				));
			} else if (V.projectN.status === 1) {
				App.UI.DOM.appendNewElement("div", node, `You've started to get into contact with a number of renowned old-world biologists and genetic engineers to pursue the creation of a biological catgirl. They should be arriving soon.`);
			} else if (V.projectN.status === 2) {
				App.UI.DOM.appendNewElement("div", node, `You've gathered together a team of some of the old world's foremost scientific minds in the fields of genetic engineering, who've turned your gene lab into a workplace for what they've dubbed "Project N", or the "Cat Project". One white-bearded man looks up from a large computer screen showing a series of complicated genetic sequences as you enter.`);
			} else if (V.projectN.status === 3) {
				App.UI.DOM.appendNewElement("div", node, `The geneticist team has started to make serious progress on project N. In a central tube filled with thick green liquid, a small mass of pinkish material floats in suspended animation, referred to by the biologists as "Subject Delta". A series of screens next to the tube read out low-functioning vitals and other essential information.`);
			} else if (V.projectN.status === 4) {
				App.UI.DOM.appendNewElement("div", node, `The pinkish blob of flesh has become a small, hairless humanoid body with twitchy cat ears atop its head, unconsciously floating while suspended in the green tube. You've tentatively named the growing catgirl ${V.subjectDeltaName}, and she occasionally kicks around slightly in the tube, producing a little stream of floating bubbles. The Project N bioengineers carefully monitor her vitals at all times, aided by the lab's integrated AI.`);
			} else if (V.projectN.status === 5) {
				App.UI.DOM.appendNewElement("div", node, `${V.subjectDeltaName} looks like an almost fully grown catgirl now, complete with a thin but soft layer of pure white fur that puffs up in the thick green liquid of her tube. The Project N geneticists seem a little rattled after the attack by the Sons of Sekhmet, but they're more determined than ever to finish their job and ensure that subject Delta makes it out of this tube and into the real world, a possibility that looks closer day by day.`);
			} else if (V.projectN.status === 6) {
				App.UI.DOM.appendNewElement("div", node, `Project N is complete. Dr. Nieskowitz and his team are currently monitoring various functions of the genetic laboratory, though you could set them to work engineering another catgirl if you give them the funding to do so. It will take approximately a month to create another catgirl. The genetic engineering tube is currently empty.`);
				const engineerCatCost = 20000 * PCSkillCheck;
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Engineer me a Catgirl",
					() => {
						cashX(forceNeg(engineerCatCost), "capEx");
						V.projectN.status = 7;
						V.growingNewCat = 4;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(engineerCatCost)}`
				));
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Engineer me a Catboy",
					() => {
						cashX(forceNeg(engineerCatCost), "capEx");
						V.projectN.status = 8;
						V.growingNewCat = 4;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(engineerCatCost)}`
				));
			} else if (V.projectN.status === 7) {
				r.push(`Dr. Nieskowitz and his team are currently hard at working growing you another catgirl, who rapidly develops in the central tube of thick green liquid you once used to create ${V.subjectDeltaName}. Nieskowitz assures you that he'll have your new catgirl finished`);
				if (V.growingNewCat >= 2) {
					r.push(`in ${V.growingNewCat} weeks.`);
				}
				if (V.growingNewCat <= 1) {
					r.push(`by next week.`);
				}
			} else if (V.projectN.status === 8) {
				r.push(`Dr. Nieskowitz and his team are currently hard at working growing you another catboy, who rapidly develops in the central tube of thick green liquid you once used to create ${V.subjectDeltaName}. Nieskowitz assures you that he'll have your new catboy finished`);
				if (V.growingNewCat >= 2) {
					r.push(`in ${V.growingNewCat} weeks.`);
				}
				if (V.growingNewCat <= 1) {
					r.push(`by next week.`);
				}
			} else if (V.projectN.status === 9) {
				r.push(`The bomb set by the Sons of Sekhmet destroyed large parts of the gene lab and killed most of the personnel, including ${V.subjectDeltaName}'s tube. After the death of Doctor Nieskowitz, you haven't just lost ${V.subjectDeltaName} herself, but also the knowledge used to create her. It's doubtful that there's anyone left in the world who can finish what he started.`);
			}
			App.Events.addParagraph(node, r);
		}
	}

	App.UI.DOM.appendNewElement("h2", node, `Genetic Harvesting`);

	const humanCloning = 100000 * PCSkillCheck;
	if (V.cloningSystem !== 1 && V.rep <= 18000 * PCSkillCheck) {
		App.UI.DOM.appendNewElement("div", node, `You lack the reputation needed to access methods for human cloning`, "note");
	} else if ((V.cloningSystem !== 1) && (V.rep > 18000 * PCSkillCheck)) {
		if (V.organFarmUpgrade === 0) {
			App.UI.DOM.appendNewElement("div", node, `An organ farm is needed to grow the blank embryo to serve as a clone base`, "note");
		} else {
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Purchase methods for human cloning",
				() => {
					cashX(forceNeg(humanCloning), "capEx");
					V.cloningSystem = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(humanCloning)}. Will allow children to be created with identical base genetics as the source DNA`
			));
		}
	} else if (V.cloningSystem > 0) {
		App.UI.DOM.appendNewElement("div", node, `The gene lab is capable of implanting a slave's genetic sequence into a blank embryo to produce a basic clone.`);
		App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
			"Make a clone",
			() => {
				V.donatrix = "undecided";
				V.receptrix = "undecided";
			}, [], "Cloning Workaround",
		));
	}
	return node;
};


code:
App.Facilities.HGSuite.headGirlSuite = class HeadGirlSuite extends App.Facilities.Facility {
	constructor() {
		const headGirlSuite = App.Entity.facilities.headGirlSuite;
		const decommissionHandler = () => {
			V.HGSuite = 0;
		};

		super(
			headGirlSuite,
			decommissionHandler,
		);

		V.nextButton = "Back to Main";
		V.nextLink = "Main";
		V.encyclopedia = "Head Girl Suite";

		this.subSlave = this.facility.employees()[0];
	}

	/** @returns {string} */
	get intro() {
		const text = [];

		if (!S.HeadGirl) {
			text.push(`You have no Head Girl appointed to live in ${V.HGSuiteName}.`);
		} else {
			const {him, his} = getPronouns(S.HeadGirl);

			if (this.facility.hasEmployees) {
				text.push(`Your Head Girl ${S.HeadGirl.slaveName} has ${this.subSlave.slaveName} living in ${V.HGSuiteName} with ${him}, as ${his} servant, assistant, and sexual appliance.`);
			} else {
				text.push(`Your Head Girl ${S.HeadGirl.slaveName} lives alone in ${his} handsome suite.`);
			}

			text.push(`Any slave assigned to live with your Head Girl will become, for all intents and purposes, ${his} slave.`);
		}

		return text.join(' ');
	}

	/** @returns {FC.Facilities.Expand} */
	get expand() {
		return {
			maximum: 1,
			unexpandable: true,
		};
	}

	/** @returns {FC.Facilities.Rule[]} */
	get rules() {
		if (S.HeadGirl) {	// only display rules if a Headgirl is assigned
			const {He, his} = getPronouns(S.HeadGirl);

			return [
				{
					property: "HGSuiteEquality",
					prereqs: [],
					options: [
						{
							get text() { return `The current Head Girl will remain Head Girl.`; },
							link: `Don't alternate`,
							value: 0,
						},
						{
							get text() { return `The two slaves living in ${V.HGSuiteName} are equals, and will alternate weeks as Head Girl and Head Girl's bitch.`; },
							link: `Have them alternate`,
							value: 1,
							handler: () => {
								V.HGSuiteSurgery = 0;
								V.HGSuiteDrugs = 0;
								V.HGSuiteAbortion = 0;
								V.HGSuiteHormones = 0;
							},
							note: `This will only take effect if the other slave is an appropriate candidate.`,
						},
					],
				},
				{
					property: "HGSuiteSurgery",
					prereqs: [
						!V.HGSuiteEquality,
					],
					options: [
						{
							get text() { return `${He} is not allowed to use surgical modification on ${his} slave.`; },
							link: `Forbid`,
							value: 0,
						},
						{
							get text() { return `${He} is allowed to use surgical modification on ${his} slave.`; },
							link: `Allow`,
							value: 1,
						},
					],
				},
				{
					property: "HGSuiteAbortion",
					prereqs: [
						!V.HGSuiteEquality,
					],
					options: [
						{
							get text() { return `${He} is not allowed to terminate unwanted pregnancies in ${his} slave.`; },
							link: `Forbid`,
							value: 0,
						},
						{
							get text() { return `${He} is allowed to terminate unwanted pregnancies in ${his} slave.`; },
							link: `Allow`,
							value: 1,
						},
					],
				},
				{
					property: "HGSuiteDrugs",
					prereqs: [
						!V.HGSuiteEquality,
					],
					options: [
						{
							get text() { return `${He} is not allowed to use growth hormones on ${his} slave.`; },
							link: `Forbid`,
							value: 0,
						},
						{
							get text() { return `${He} is allowed to use growth hormones on ${his} slave.`; },
							link: `Allow`,
							value: 1,
						},
					],
				},
				{
					property: "HGSuiteHormones",
					prereqs: [
						!V.HGSuiteEquality,
					],
					options: [
						{
							get text() { return `${He} is not allowed to customize ${his} slave with hormone treatments.`; },
							link: `Forbid`,
							value: 0,
						},
						{
							get text() { return `${He} is allowed to customize ${his} slave with hormone treatments.`; },
							link: `Allow`,
							value: 1,
						},
					],
				},
			];
		}

		return [];
	}
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.headGirlSuite = {
	baseName: "HGSuite",
	genericName: null,
	jobs: {
		HGToy: {
			position: "Head Girl's toy",
			assignment: Job.HEADGIRLSUITE,
			publicSexUse: true,
			fuckdollAccepted: false
		}
	},
	defaultJob: "HGToy",
	manager: {
		position: "Head Girl",
		assignment: Job.HEADGIRL,
		careers: App.Data.Careers.Leader.HG,
		skill: "headGirl",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	},
	decorated: false
};

App.Entity.Facilities.HeadGirlSuite = class extends App.Entity.Facilities.SingleJobFacility {
	constructor() {
		super(App.Data.Facilities.headGirlSuite);
	}

	/** @override */
	occupancyReport(long) {
		return this.manager.currentEmployee
			? `HG${this.hostedSlaves ? long
				? ` and ${getPronouns(this.manager.currentEmployee).his} slave`
				: ", 1" : ""}`
			: "";
	}
};

App.Entity.facilities.headGirlSuite = new App.Entity.Facilities.HeadGirlSuite();


code:
App.UI.implantManufactory = function() {
	const node = new DocumentFragment();

	const PCSkillCheck = Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier);

	App.UI.DOM.appendNewElement("h1", node, "The Implant Manufactory");

	App.UI.DOM.appendNewElement("p", node, `The implant manufactory is running smoothly. It can cheaply produce advanced implants and has freed you from relying on outside sources for specialty implants. It can easily produce more complex implants should you obtain the schematics necessary to build them.`, "scene-intro");

	App.UI.DOM.appendNewElement("h2", node, "Implant Production");

	App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of producing customized fillable implants.");

	if (V.meshImplants > 0) {
		App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of producing supportive mesh breast implants.");
	} else {
		if (V.rep <= 10000 * PCSkillCheck) {
			App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access plans for supportive breast implants.", "note");
		} else {
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Purchase plans for supportive mesh breast implants",
				() => {
					cashX(forceNeg(40000 * PCSkillCheck), "capEx");
					V.meshImplants = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(40000 * PCSkillCheck)}. Will allow the construction of organic and supportive mesh breast implants.`
			));
		}
	}

	if (V.UterineRestraintMesh === 1) {
		App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of producing supportive mesh uterine implants.");
	}

	if (V.bellyImplants === 0) {
		if (V.rep <= 2000 * PCSkillCheck) {
			App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access experimental fillable abdominal implants.", "note");
		} else {
			const cost = 30000 * PCSkillCheck;
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Purchase schematics for fillable abdominal implants",
				() => {
					cashX(forceNeg(cost), "capEx");
					V.bellyImplants = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(cost)}. Will allow the construction of fillable abdominal implants for the autosurgery.`
			));
		}
	} else if (V.bellyImplants > 0) {
		App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting fillable abdominal implants.");
		if (V.bellyImplants === 1 && V.cervixImplants === 0) { /* show only after belly implants already researched */
			if (V.rep <= 6000 * PCSkillCheck) { /* nanotech like technology much more impressive and costly than simple implant */
				App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access experimental cervix filter micropumps schematics for abdominal implants.", "note");
			} else {
				const cost = 70000 * PCSkillCheck;
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Purchase schematics for cervix filter micropumps",
					() => {
						cashX(forceNeg(cost), "capEx");
						V.cervixImplants = 1;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(cost)}. Will allow the construction of cervix filter micropumps for fillable abdominal implants using the autosurgery.`
				));
			}
		} else if (V.cervixImplants === 1) {
			App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting cervix filter micropumps for fillable abdominal implants.");
			if (V.rep <= 8000 * PCSkillCheck) {
				App.UI.DOM.appendNewElement("div", node, "You lack the reputation to obtain conversion kits for rectal filter micropumps.", "note");
			} else {
				const cost = 60000 * PCSkillCheck;
				App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
					"Purchase conversion kits for rectal filter micropumps",
					() => {
						cashX(forceNeg(cost), "capEx");
						V.cervixImplants = 2;
						App.UI.reload();
					}, [], "",
					`Costs ${cashFormat(cost)}. Will allow the construction of the anal equivalent of the cervix micropumps using the autosurgery.`
				));
			}
		} else if (V.cervixImplants > 1) {
			App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting cervix and rectal filter micropumps for fillable abdominal implants.");
		}
	}

	if (V.seePreg !== 0) {
		App.UI.DOM.appendNewElement("h2", node, "Fertility Implants");

		if (V.fertilityImplant === 1) {
			App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting fertility enhancing implants for ovaries.");
		} else if (V.fertilityImplant === 0 && (V.rep <= 3000 * PCSkillCheck)) {
			App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access fertility boosting ovarian implants.", "note");
		} else {
			const cost = 10000 * PCSkillCheck;
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Purchase schematics for fertility enhancing ovarian implants",
				() => {
					cashX(forceNeg(cost), "capEx");
					V.fertilityImplant = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(cost)}. Will allow the construction of implants that encourage multiple eggs being released during ovulation.`
			));
		}

		if (V.sympatheticOvaries === 1) {
			App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting implants that synchronize ovum release.");
		}

		if (V.seeHyperPreg === 1 && V.seeExtreme === 1) {
			if (V.permaPregImplant === 0) {
				if (V.rep <= 4000 * PCSkillCheck) {
					App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access experimental pregnancy generator schematics.", "note");
				} else {
					const cost = 40000 * PCSkillCheck;
					App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
						"Purchase schematics for an experimental implantable pregnancy generator",
						() => {
							cashX(forceNeg(cost), "capEx");
							V.permaPregImplant = 1;
							App.UI.reload();
						}, [], "",
						`Costs ${cashFormat(cost)}. Will allow the construction of implants that force perpetual pregnancy.`
					));
				}
			} else if (V.permaPregImplant > 0) {
				App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of crafting pregnancy generators.");
			}
			if (V.PGHack === 1) {
				App.UI.DOM.appendNewElement("div", node, "The tools required to hack the firmware of basic pregnancy generator implants have been produced by the manufactory for use in the remote surgery.");
			}
		}
	}

	App.UI.DOM.appendNewElement("h2", node, "Fluid Production Implants");

	if (V.prostateImplants !== 1) {
		if (V.rep <= 3000 * PCSkillCheck) {
			App.UI.DOM.appendNewElement("div", node, "You lack the reputation to access plans for prostate implants.", "note");
		} else {
			const cost = 30000 * PCSkillCheck;
			App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link(
				"Purchase plans for ejaculation enhancing prostate implants",
				() => {
					cashX(forceNeg(cost), "capEx");
					V.prostateImplants = 1;
					App.UI.reload();
				}, [], "",
				`Costs ${cashFormat(cost)}. Will allow the construction of a prostate implant designed to stimulate fluid production for massive ejaculations. Beware of leaking and dehydration.`
			));
		}
	} else if (V.prostateImplants > 0) {
		App.UI.DOM.appendNewElement("div", node, "The manufactory is capable of producing ejaculation enhancing prostate implants.");
	}
	return node;
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.incubator = {
	baseName: "incubator",
	genericName: null,
	jobs: {
		tank: {
			position: "tank",
			assignment: Job.TANK,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "tank",
	manager: null,
	decorated: false
};

App.Entity.Facilities.IncubatorTankJob = class extends App.Entity.Facilities.Job {
	/**
	 * @override
	 * @returns {App.Entity.SlaveState[]}
	 */
	employees() {
		return V.incubator.tanks;
	}

	/** @override */
	employeesIDs() {
		return new Set(this.employees().map(s => s.ID));
	}
};

App.Entity.Facilities.Incubator = class extends App.Entity.Facilities.Facility {
	constructor() {
		super(App.Data.Facilities.incubator, {
			tank: new App.Entity.Facilities.IncubatorTankJob()
		});
	}
};

App.Entity.facilities.incubator = new App.Entity.Facilities.Incubator();