code:
/**
 * Returns a string describing the effects of the slave putting on shows only
 * 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 _beautiful = beautiful(slave);
	const _pretty = pretty(slave);

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

	let r = [];

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

	r.push(`${He} also puts on shows with animals this week.`);

	// Open FS Subsection

	if (arcology.FSSupremacist !== "unset") {
		if (isSuperiorRace(slave)) {
			if (V.seeBestiality) {
				r.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 {
				r.push(`Since ${arcology.FSSupremacistRace} slaves are in fashion, ${he} attracts a little more attention than if ${he} wasn't ${arcology.FSSupremacistRace}.`);
			}
		} else {
			r.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) {
				r.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 {
				r.push(`Fewer people want to go see a ${arcology.FSSubjugationistRace} slave put on a show, and so ${he} doesn't earn as much as ${he} otherwise could.`);
			}
		} else {
			r.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") {
				r.push(`Society <span class="reputation inc">greatly approves</span> of your having pregnant slaves ${V.seeBestiality ? `have sex` : `put on shows`} with animals.`);
			} else {
				r.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") {
					r.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 {
					r.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") {
					r.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 {
					r.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)) {
				r.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) {
			r.push(`${His} patrons <span class="reputation inc">approve</span> of the fact that ${he} has a dick.`);
		} else {
			r.push(`${His} patrons <span class="reputation dec">are disappointed</span> that ${he} doesn't have a dick.`);
		}
	}

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

	if (arcology.FSPaternalist !== "unset") {
		if (V.seeBestiality) {
			if (V.farmyardBreeding) {
				if (V.farmyardRestraints) {
					r.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 {
					r.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) {
					r.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 {
					r.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.`);
				}
			}
		} else {
			// TODO:
		}
	}

	if (arcology.FSDegradationist !== "unset") {
		if (V.seeBestiality) {
			if (V.farmyardBreeding) {
				if (V.farmyardRestraints) {
					r.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 {
					r.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) {
					r.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 {
					r.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.`);
				}
			}
		} else {
			// TODO:
		}
	}

	if (arcology.FSBodyPurist !== "unset") {
		if (SlaveStatsChecker.isModded(slave)) {
			r.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)) {
			r.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)) {
			r.push(`${arcology.name}'s citizens <span class="reputation dec">disapprove</span> of your using such old slaves to put on shows.`);
		} else {
			r.push(`${arcology.name}'s citizens <span class="reputation inc">approve</span> of your using young slaves to put on shows.`);
		}
	}

	if (arcology.FSMaturityPreferentialist !== "unset") {
		if (isYoung(slave)) {
			r.push(`${arcology.name}'s citizens <span class="reputation inc">approve</span> of your using mature slaves to put on shows.`);
		} else {
			r.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 (slimLawPass(slave)) {
			r.push(`${His} slim body <span class="reputation inc">attracts a wider audience.</span>`);
		} else {
			r.push(`Society finds your using a slave with such a flabby body <span class="reputation dec">disgusting.</span>`);
		}
	}

	// FIXME: marked for possible rewrite
	if (arcology.FSAssetExpansionist !== "unset") {
		if (isStacked(slave)) {
			r.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) {
			r.push(`The fact that ${slave.slaveName} has such large udders <span class="reputation inc">pleases your citizens.</span>`);
		}

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

	// FIXME: marked for review
	if (arcology.FSPhysicalIdealist !== "unset") {
		if (genderLawPass(slave)) {
			r.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 {
			r.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>`);
		}
	}

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

	if (arcology.FSChattelReligionist !== "unset") {
		if (slave.devotion <= 20) {
			// TODO: write this
		} else {
			// TODO: write this
		}
	}

	if (arcology.FSPetiteAdmiration !== "unset") {
		if (heightPass(slave)) {
			r.push(`The fact that you are using such small slaves <span class="reputation inc">pleases your citizens.</span>`);
		} else {
			r.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)) {
			r.push(`Your citizens <span class="reputation inc">approve</span> of your using such statuesque slaves for putting on shows.`);
		} else {
			r.push(`Your citizens <span class="reputation dec">disapprove</span> of your not using taller slaves for putting on shows.`);
		}
	}

	if (arcology.FSRomanRevivalist !== "unset") {
		// TODO:
	}

	if (arcology.FSAztecRevivalist !== "unset") {
		// TODO:
	}

	if (arcology.FSEgyptianRevivalist !== "unset") {
		// TODO:
	}

	if (arcology.FSEdoRevivalist !== "unset") {
		// TODO:
	}

	if (arcology.FSArabianRevivalist !== "unset") {
		// TODO:
	}

	if (arcology.FSChineseRevivalist !== "unset") {
		// TODO:
	}

	// Close FS Subsection

	if (setup.entertainmentCareers.includes(slave.career)) {
		r.push(`${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows.`);
	}

	// FIXME: can slaves' careers overlap categories?
	if (setup.farmerCareers.includes(slave.career)) {
		r.push(`${He} ${setup.entertainmentCareers.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.`);
	}

	if (slave.prestige === 1) {
		r.push(`Because some of your citizens already know of ${him}, ${he} earns more.`);
	} else if (slave.prestige === 2) {
		r.push(`Because a lot of your citizens already know of ${him}, ${he} earns quite a bit more.`);
	} else if (slave.prestige === 3) {
		r.push(`Because ${he} is so famous, ${he} earns a lot more then ${he} would otherwise.`);
	}

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

	if (slave.health.condition > 50) {
		r.push(`${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) {
		r.push(`${His} poor health negatively affects ${his} ability to put on good shows, cutting into your profits.`);
	}

	// TODO: add checks for family and relationships

	if (slave.face > 40) {
		r.push(`${He} is so ${_beautiful} that ${his} audience is willing to pay more to watch ${him} put on shows.`);
	} else if (slave.face > 10) {
		r.push(`${He} is so ${_pretty} that ${his} audience is willing to pay more to watch ${him} put on shows.`);
	} else if (slave.face < -10) {
		r.push(`${His} audience isn't willing to pay as much because of how unattractive ${his} face is.`);
	} else if (slave.face < -40) {
		r.push(`${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
	if (slave.devotion > 50) {
		if (slave.trust > 50) {
			r.push(`${He} is so devoted that ${he} works ${his} hardest to make ${his} show a good one.`);
		} else if (slave.trust < -50) {
			r.push(`${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) {
			r.push(`${slave.slaveName} purposefully does the bare minimum ${he} can get away with to spite you.`);
		} else if (slave.trust < -50) {
			r.push(`${slave.slaveName} refuses to do anything without punishment, which is evident from ${his} meager earnings.`);
		}
	}

	// FIXME: marked for rewrite
	if (slave.weight > 30) {
		if (arcology.FSHedonisticDecadence === "unset") {
			r.push(`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) {
		r.push(`Your citizens don't like watching such a sickly-looking slaves put on shows, so ${he} loses some income.`);
	}

	if (slave.muscles > 30) {
		// TODO: write this - do we want something for muscles?
	} else if (slave.muscles < -30) {
		r.push(`${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.`);
	}

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

	if (slave.hears < 0) {
		r.push(`${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.`);
	}

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

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

	if (slave.intelligence > 50) {
		r.push(`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) {
		r.push(`${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.`);
	}

	if (slave.energy > 95) {
		r.push(`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) {
		r.push(`The fact that ${his} sex drive is so powerful helps ${him} to really put on good shows.`);
	} else if (slave.energy > 60) {
		r.push(`The fact that ${his} sex drive is so good helps ${him} to put on good shows.`);
	} else if (slave.energy > 40) {
		r.push(`${His} average sex drive allows ${him} to put on a decent show.`);
	} else if (slave.energy > 20) {
		r.push(`The fact that ${his} sex drive is so poor affects ${his} performance.`);
	} else {
		r.push(`The fact that ${his} sex drive is nonexistent really hinders ${his} ability to put on a decent show.`);
	}

	// TODO: add more to the fetishes and flaws / quirks
	switch (slave.fetish) {
		case "submissive":
			if (V.seeBestiality) {
				if (slave.fetishKnown) {
					r.push(`${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 {
					r.push(`${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) {
					r.push(`Being a submissive, ${he} <span class="reputation dec">doesn't have the confidence required</span> to really put on a good show.`);
				} else {
					r.push(`${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>`);
				}
			}
			break;

		case "humiliation":
			if (V.seeBestiality) {
				if (slave.fetishKnown) {
					r.push(`${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>.`);
				} else {
					// TODO:
				}
			} else {
				// TODO: not sure about this one
			}
			break;

		default:
			break;
	}

	switch (slave.behavioralFlaw) {
		case "arrogant":
			r.push(`Because ${he} is so arrogant, ${he} tries ${his} hardest to avoid ${V.seeBestiality ? `fucking animals` : `putting on shows`}, <span class="cash dec">which affects ${his} profits</span> and <span class="reputation dec">your reputation.</span>`);
			break;

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

		default:
			break;
	}

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

		default:
			break;
	}

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

		default:
			break;
	}

	switch (slave.sexualQuirk) {
		case "perverted":
			r.push(`${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.`);
			break;

		default:
			break;
	}

	return r.join(' ');
};


code:
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.misc.HGCareers,
		skill: "headGirl",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

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();

repo_name: Welptard/fc

license: mit


code:
.incubator-underscore {
	border-bottom: 1px solid;
}

.incubator-tank {
	border-bottom: 2px solid cyan;
	border-top: 2px solid cyan;
	border-radius: 15px;
	padding: 0.5em;
}


code:
:: Incubator [nobr jump-to-safe jump-from-safe]

<<includeDOM App.UI.incubator()>>


code:
App.Data.Facilities.incubator = {
	baseName: "incubator",
	genericName: null,
	jobs: {
		tank: {
			position: "tank",
			assignment: Job.TANK,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "tank",
	manager: null
};

App.Entity.Facilities.IncubatorTankJob = class extends App.Entity.Facilities.Job {
	/**
	 * @override
	 * @returns {App.Entity.SlaveState[]}
	 */
	employees() {
		return V.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();


code:
App.UI.incubator = function() {
	V.nextButton = "Back to Main";
	V.nextLink = "Main";
	V.returnTo = "Incubator";
	V.encyclopedia = "The Incubation Facility";
	V.readySlaves = 0;
	V.readySlave = 0;

	let tankOrgans = {};
	const el = new DocumentFragment();
	const _SL = V.slaves.length;
	let childrenReserved;
	const _incubatorNameCaps = capFirstChar(V.incubatorName);
	App.UI.tabBar.handlePreSelectedTab(V.tabChoice.Incubator);

	const tabCaptions = {
		mothers: 'Mothers',
		tanks: 'Tanks',
		settings: 'Settings',
		pc: 'You'
	};

	const introSpan = document.createElement("span");
	introSpan.append(makeSpanIded("content-intro", intro()));
	el.append(introSpan);

	const tabBar = App.UI.DOM.appendNewElement("div", el, '', "tab-bar");
	tabBar.append(App.UI.tabBar.tabButton('mothers', tabCaptions.mothers));
	if (V.PC.pregKnown === 1 && (V.arcologies[0].FSRestart === "unset" || V.eugenicsFullControl === 1 || (V.PC.pregSource !== -1 && V.PC.pregSource !== -6))) {
		tabBar.append(App.UI.tabBar.tabButton('pc', tabCaptions.pc));
	}
	tabBar.append(
		App.UI.tabBar.tabButton('tanks', tabCaptions.tanks),
		App.UI.tabBar.tabButton('settings', tabCaptions.settings),
	);

	el.append(App.UI.tabBar.makeTab('mothers', makeSpanIded("content-mothers", mothers())));
	el.append(App.UI.tabBar.makeTab('pc', makeSpanIded("content-pc", PC())));
	el.append(App.UI.tabBar.makeTab('tanks', makeSpanIded("content-tank-babies", tankBabies())));
	el.append(App.UI.tabBar.makeTab('settings', makeSpanIded("content-tank-settings", tankSettings())));
	introSpan.after(release()); // run me late.

	return el;

	function intro() {
		const el = document.createElement("p");
		let r = [];
		const incubatorSlaves = V.tanks.length;
		const freeTanks = V.incubator - incubatorSlaves;
		r.push(`${_incubatorNameCaps} is a clean, cold hall designed to be lined with tanks and their connected monitoring systems.`);

		if (incubatorSlaves > 2) {
			r.push(`It's well used. The hum of active tanks fills the air.`);
		} else if (incubatorSlaves > 0) {
			r.push(`It's barely used; most of the tanks lie dormant.`);
		} else {
			r.push(`It's empty and quiet.`);
			r.push(
				choice(
					"Decommission the incubator",
					() => {
						V.incubator = 0;
						V.incubatorUpgradeSpeed = 5;
						V.incubatorUpgradeWeight = 0;
						V.incubatorUpgradeMuscles = 0;
						V.incubatorUpgradeReproduction = 0;
						V.incubatorUpgradeGrowthStims = 0;
						V.incubatorWeightSetting = 0;
						V.incubatorMusclesSetting = 0;
						V.incubatorReproductionSetting = 0;
						V.incubatorGrowthStimsSetting = 0;
						V.tanks = [];
					}
				)
			);
		}
		App.Events.addNode(el, r, "p");

		r = [];
		r.push(`It can support ${V.incubator}`);
		if (incubatorSlaves === 1) {
			r.push(`child. There is currently ${incubatorSlaves} tank`);
		} else {
			r.push(`children. There are currently ${incubatorSlaves} tanks`);
		}
		r.push(`in use in ${V.incubatorName}.`);
		App.Events.addNode(el, r, "div");

		el.append(
			choice(
				`Add another incubation tank`,
				() => {
					cashX(forceNeg(Math.trunc(60000 * V.upgradeMultiplierArcology)), "capEx");
					V.incubator += 1;
				},
				"Incubator",
				`Costs ${cashFormat(Math.trunc(60000 * V.upgradeMultiplierArcology))} and will increase upkeep costs`
			)
		);
		if (freeTanks === 0) {
			el.append(`All of the tanks are currently occupied by growing children.`);
		}

		return el;
	}

	function mothers() {
		const el = new DocumentFragment();
		let r = [];
		let eligibility = 0;
		let linkArray;
		const reservedChildren = FetusGlobalReserveCount("incubator");
		const incubatorSlaves = V.tanks.length;
		const freeTanks = V.incubator - incubatorSlaves;
		r.push(`Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of ${V.incubator} tanks, ${freeTanks}`);
		if (freeTanks === 1) {
			r.push(`is`);
		} else {
			r.push(`are`);
		}
		r.push(`unoccupied. Of those, ${reservedChildren}`);
		if (reservedChildren === 1) {
			r.push(`tank is`);
		} else {
			r.push(`tanks are`);
		}
		r.push(` reserved.`);
		App.Events.addNode(el, r, "div");
		/*
		** With hundreds of slaves, navigating the Incubator room was giving me as much of a headache as other lists.
		** So, I borrowed the sorting list and dropped a few options here.
		*/
		if (0 < _SL) {
			const sortingBar = document.createElement("div");
			sortingBar.id = "sorting-bar";
			sortingBar.classList.add("incubator-underscore");

			V.sortIncubatorList = V.sortIncubatorList || 'Unsorted';

			linkArray = [];
			const sortingOptions = new Map([
				["Name", sortByName],
				["Reserved Incubator Spots", sortByReservedSpots],
				["Pregnancy Week", sortByPregnancyWeek],
				["Number of Children", sortByPregnancyCount],
			]);
			sortingBar.append(sortingBarFunc(sortingOptions));
			el.append(sortingBar);
		}

		const qlIncubator = document.createElement("div");
		qlIncubator.id = "qlIncubator";
		for (const slave of V.slaves) {
			if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") {
				const {
					His, his
				} = getPronouns(slave);
				const r = [];
				if ((slave.assignment === "work in the dairy" && V.dairyPregSetting > 0) || slave.assignment === "be your agent" || slave.assignment === "live with your agent") {
				} else {
					const freeTanks = V.incubator - incubatorSlaves;
					const _slaveId = "slave-" + slave.ID;
					const _WL = slave.womb.length;
					const _reservedIncubator = WombReserveCount(slave, "incubator");
					const _reservedNursery = WombReserveCount(slave, "nursery");
					const _pregWeek = slave.pregWeek;
					const _slaveName = SlaveFullName(slave);
					const momEl = document.createElement("p");
					momEl.id = _slaveId;
					momEl.classList.add("possible");

					momEl.setAttribute("data-preg-count", slave.womb.length.toString());
					momEl.setAttribute("data-reserved-spots", _reservedIncubator.toString());
					momEl.setAttribute("data-preg-week", _pregWeek.toString());
					momEl.setAttribute("data-name", _slaveName);

					linkArray = [];
					const choices = document.createElement("div");
					choices.classList.add("choices");
					r.push(App.UI.DOM.slaveDescriptionDialog(slave));
					r.push(` is ${slave.pregWeek} ${(slave.pregWeek === 1) ? `week` : `weeks`} pregnant with`);
					if (slave.pregSource === 0 || slave.preg <= 5) {
						r.push(`someone's${(slave.preg <= 5) ? `, though it is too early to tell whose,` : ``}`);
					} else if (slave.pregSource === -1) {
						r.push(`your`);
					} else if (slave.pregSource === -2) {
						r.push(`a citizen's`);
					} else if (slave.pregSource === -3) {
						r.push(`your Master's`);
					} else if (slave.pregSource === -4) {
						r.push(`another arcology owner's`);
					} else if (slave.pregSource === -5) {
						r.push(`your client's`);
					} else if (slave.pregSource === -6) {
						r.push(`the Societal Elite's`);
					} else if (slave.pregSource === -7) {
						r.push(`the lab's`);
					} else if (slave.pregSource === -9) {
						r.push(`the Futanari Sisters'`);
					} else {
						const father = getSlave(slave.pregSource);
						if (father) {
							r.push(`${father.slaveName}'s`);
						}
					}
					if (_WL > 1) {
						r.push(`${_WL} babies.`);
					} else {
						r.push(`baby.`);
					}
					if (_reservedIncubator > 0) {
						childrenReserved = 1;
						if (_WL === 1) {
							r.push(`${His} child will be placed in ${V.incubatorName}.`);
						} else if (_reservedIncubator < _WL) {
							r.push(`${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}.`);
						} else if (_WL === 2) {
							r.push(`Both of ${his} children will be placed in ${V.incubatorName}.`);
						} else {
							r.push(`All ${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}.`);
						}
						if ((_reservedIncubator + _reservedNursery < _WL) && (reservedChildren < freeTanks)) {
							if (V.pregnancyMonitoringUpgrade === 1) {
								linkArray.push(
									App.UI.DOM.link(
										`Inspect pregnancy`,
										() => {
											V.AS = slave.ID;
										},
										[],
										`Analyze Pregnancy`
									)
								);
							}
							linkArray.push(
								App.UI.DOM.link(
									`Keep another child`,
									() => {
										WombAddToGenericReserve(slave, 'incubator', 1);
										refresh();
									}
								)
							);
							if (_reservedIncubator > 0) {
								linkArray.push(
									App.UI.DOM.link(
										`Keep one less child`,
										() => {
											WombCleanGenericReserve(slave, 'incubator', 1);
											refresh();
										}
									)
								);
							}
							if (_reservedIncubator > 1) {
								linkArray.push(
									App.UI.DOM.link(
										`Keep none of ${his} children`,
										() => {
											WombCleanGenericReserve(slave, 'incubator', 9999);
											refresh();
										}
									)
								);
							}
							if ((reservedChildren + _WL - _reservedIncubator) <= freeTanks) {
								linkArray.push(
									App.UI.DOM.link(
										`Keep the rest of ${his} children`,
										() => {
											WombAddToGenericReserve(slave, 'incubator', 9999);
											refresh();
										}
									)
								);
							}
						} else if ((_reservedIncubator === _WL) || (reservedChildren === freeTanks) || (_reservedIncubator + _reservedNursery === _WL)) {
							if (V.pregnancyMonitoringUpgrade === 1) {
								linkArray.push(
									App.UI.DOM.link(
										`Inspect pregnancy`,
										() => {
											V.AS = slave.ID;
										},
										[],
										`Analyze Pregnancy`
									)
								);
							}
							linkArray.push(
								App.UI.DOM.link(
									`Keep one less child`,
									() => {
										WombCleanGenericReserve(slave, 'incubator', 1);
										refresh();
									}
								)
							);
							if (_reservedIncubator > 1) {
								linkArray.push(
									App.UI.DOM.link(
										`Keep none of ${his} children`,
										() => {
											WombCleanGenericReserve(slave, 'incubator', 9999);
											refresh();
										}
									)
								);
							}
						}
					} else if ((reservedChildren < freeTanks)) {
						if (_WL - _reservedNursery === 0) {
							r.push(App.UI.DOM.makeElement("span", `${His} children are already reserved for V.nurseryName`, "note"));
							if (V.pregnancyMonitoringUpgrade === 1) {
								linkArray.push(
									App.UI.DOM.link(
										`Inspect pregnancy`,
										() => {
											V.AS = slave.ID;
										},
										[],
										`Analyze Pregnancy`
									)
								);
							}
							linkArray.push(
								App.UI.DOM.link(
									`Keep ${his} ${((_WL > 1) ? "children" : "child")} here instead`,
									() => {
										WombChangeReserveType(slave, 'nursery', 'incubator');
										refresh();
									}
								)
							);
						} else {
							r.push(`You have`);
							if (freeTanks === 1) {
								r.push(`an <span class="lime"> available aging tank.</span>`);
							} else {
								r.push(`<span class="lime"> available aging tanks.</span>`);
							}
							if (V.pregnancyMonitoringUpgrade === 1) {
								if (V.pregnancyMonitoringUpgrade === 1) {
									linkArray.push(
										App.UI.DOM.link(
											`Inspect pregnancy`,
											() => {
												V.AS = slave.ID;
											},
											[],
											`Analyze Pregnancy`
										)
									);
								}
							}
							linkArray.push(
								App.UI.DOM.link(
									`Keep ${(_WL > 1) ? "a" : "the"} child`,
									() => {
										WombAddToGenericReserve(slave, 'incubator', 1);
										refresh();
									}
								)
							);
							if ((_WL > 1) && (reservedChildren + _WL - _reservedIncubator) <= freeTanks) {
								linkArray.push(
									App.UI.DOM.link(
										`Keep all of ${his} children`,
										() => {
											WombAddToGenericReserve(slave, 'incubator', 9999);
											refresh();
										}
									)
								);
							}
						}
					} else if (reservedChildren === freeTanks) {
						if (V.pregnancyMonitoringUpgrade === 1) {
							linkArray.push(
								App.UI.DOM.link(
									`Inspect pregnancy`,
									() => {
										V.AS = slave.ID;
									},
									[],
									`Analyze Pregnancy`
								)
							);
						}
						const noRoom = new DocumentFragment();
						noRoom.append(`You have `);
						App.UI.DOM.appendNewElement("span", noRoom, `no room for ${his} offspring.`, "red");
						linkArray.push(noRoom);
					}
					eligibility = 1;

					App.Events.addNode(momEl, r, "div");
					choices.append(App.UI.DOM.generateLinksStrip(linkArray));
					momEl.append(choices);
					qlIncubator.append(momEl);
				}
			}
		}
		el.append(qlIncubator);
		$('div#qlIncubator').ready(sortByPreviousSort);
		if (eligibility === 0) {
			App.UI.DOM.appendNewElement("div", el, `You have no pregnant slaves bearing eligible children.`, "note");
		}

		if (reservedChildren !== 0 || childrenReserved === 1) {
			/* the oops I made it go negative somehow button */
			App.UI.DOM.appendNewElement(
				"div",
				el,
				App.UI.DOM.link(
					"Clear all reserved children",
					() => {
						for (const slave of V.slaves) {
							if (WombReserveCount(slave, "incubator") !== 0) {
								WombCleanGenericReserve(slave, 'incubator', 9999);
							}
							WombCleanGenericReserve(V.PC, 'incubator', 9999);
						}
						refresh();
					}
				)
			);
		}
		return el;

		function refresh() {
			jQuery("#content-mothers").empty().append(mothers());
			jQuery("#content-intro").empty().append(intro());
			jQuery("#content-tank-babies").empty().append(tankBabies());
		}

		/**
		 * @returns {DocumentFragment}
		 */
		function sortingBarFunc(sortingOptions) {
			const el = new DocumentFragment();
			App.UI.DOM.appendNewElement("span", el, "Sorting: ", "note");
			const linkArray = [];
			for (const [title, func] of sortingOptions) {
				if (V.sortIncubatorList === title) {
					linkArray.push(App.UI.DOM.makeElement("span", title, "bold"));
				} else {
					linkArray.push(
						App.UI.DOM.link(
							title,
							() => {
								V.sortIncubatorList = title;
								func();
								jQuery("#sorting-bar").empty().append(sortingBarFunc(sortingOptions));
							}
						)
					);
				}
			}
			el.append(App.UI.DOM.generateLinksStrip(linkArray));
			return el;
		}

		function sortByName() {
			let $sortedIncubatorPossibles = $('#qlIncubator p.possible').detach();
			$sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-name');
			$($sortedIncubatorPossibles).appendTo($('#qlIncubator'));
		}

		function sortByPregnancyWeek() {
			let $sortedIncubatorPossibles = $('#qlIncubator p.possible').detach();
			$sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-week');
			$($sortedIncubatorPossibles).appendTo($('#qlIncubator'));
		}

		function sortByPregnancyCount() {
			let $sortedIncubatorPossibles = $('#qlIncubator p.possible').detach();
			$sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-count');
			$($sortedIncubatorPossibles).appendTo($('#qlIncubator'));
		}

		function sortByReservedSpots() {
			let $sortedIncubatorPossibles = $('#qlIncubator p.possible').detach();
			$sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-reserved-spots');
			$($sortedIncubatorPossibles).appendTo($('#qlIncubator'));
		}

		function sortByPreviousSort() {
			let sort = V.sortIncubatorList;
			if (sort !== 'unsorted') {
				if (sort === 'Name') {
					sortByName();
				} else if (sort === 'Reserved Incubator Spots') {
					sortByReservedSpots();
				} else if (sort === 'Pregnancy Week') {
					sortByPregnancyWeek();
				} else if (sort === 'Number of Children') {
					sortByPregnancyCount();
				}
			}
		}
	}

	function PC() {
		const el = new DocumentFragment();
		let r = [];
		let linkArray = [];
		const reservedChildren = FetusGlobalReserveCount("incubator");
		const incubatorSlaves = V.tanks.length;
		const freeTanks = V.incubator - incubatorSlaves;
		const _WL = V.PC.womb.length;
		const _reservedIncubator = WombReserveCount(V.PC, "incubator");
		const _reservedNursery = WombReserveCount(V.PC, "nursery");
		r.push(App.UI.DOM.makeElement("span", `You're ${V.PC.pregWeek} ${(V.PC.pregWeek === 1) ? `week`:`weeks`}pregnant`, ["pink", "bold"]));
		if (_WL === 1) {
			r.push(`a baby.`);
		} else {
			r.push(`${pregNumberName(_WL, 2)}.`);
		}
		const choices = document.createElement("div");
		choices.classList.add("choices");
		if (_reservedIncubator > 0) {
			childrenReserved = 1;
			if (_WL === 1) {
				r.push(`Your child will be placed in ${V.incubatorName}.`);
			} else if (_reservedIncubator < _WL) {
				r.push(`${_reservedIncubator} of your children will be placed in ${V.incubatorName}.`);
			} else if (_WL === 2) {
				r.push(`Both of your children will be placed in ${V.incubatorName}.`);
			} else {
				r.push(`All ${_reservedIncubator} of your children will be placed in ${V.incubatorName}.`);
			}

			if ((_reservedIncubator < _WL) && (reservedChildren < freeTanks) && (_reservedIncubator - _reservedNursery > 0)) {
				if (V.pregnancyMonitoringUpgrade === 1) {
					linkArray.push(
						App.UI.DOM.link(
							`Inspect pregnancy`,
							() => { },
							[],
							`Analyze PC Pregnancy`
						)
					);
				}
				linkArray.push(
					App.UI.DOM.link(
						`Keep another child`,
						() => {
							WombAddToGenericReserve(V.PC, 'incubator', 1);
							refresh();
						}
					)
				);
				if (_reservedIncubator > 0) {
					linkArray.push(
						App.UI.DOM.link(
							`Keep one less child`,
							() => {
								WombCleanGenericReserve(V.PC, 'incubator', 1);
								refresh();
							}
						)
					);
				}
				if (_reservedIncubator > 1) {
					linkArray.push(
						App.UI.DOM.link(
							`Keep none of your children`,
							() => {
								WombCleanGenericReserve(V.PC, 'incubator', 9999);
								refresh();
							}
						)
					);
				}
				if ((reservedChildren + _WL - _reservedIncubator) <= freeTanks) {
					linkArray.push(
						App.UI.DOM.link(
							`Keep the rest of your children`,
							() => {
								WombAddToGenericReserve(V.PC, 'incubator', 9999);
								refresh();
							}
						)
					);
				}
			} else if ((_reservedIncubator === _WL) || (reservedChildren === freeTanks) || (_reservedIncubator - _reservedNursery >= 0)) {
				if (V.pregnancyMonitoringUpgrade === 1) {
					linkArray.push(
						App.UI.DOM.link(
							`Inspect pregnancy`,
							() => { },
							[],
							`Analyze PC Pregnancy`
						)
					);
				}
				linkArray.push(
					App.UI.DOM.link(
						`Keep one less child`,
						() => {
							WombCleanGenericReserve(V.PC, 'incubator', 1);
							refresh();
						}
					)
				);
				if (_reservedIncubator > 1) {
					App.UI.DOM.link(
						`Keep none of your children`,
						() => {
							WombCleanGenericReserve(V.PC, 'incubator', 9999);
							refresh();
						}
					);
				}
			}
		} else if (reservedChildren < freeTanks) {
			if (_WL - _reservedNursery === 0) {
				r.push(
					App.UI.DOM.makeElement(
						"span",
						`Your ${(_WL === 1) ? `child is` : `children are`} already reserved for ${V.nurseryName}`,
						"note"
					)
				);
				App.UI.DOM.link(
					`Keep your ${(_WL === 1) ? `child` : `children`} here instead`,
					() => {
						WombChangeReserveType(V.PC, 'nursery', 'incubator');
						refresh();
					}
				);
			} else {
				r.push(``);
				if (freeTanks === 1) {
					r.push(`You have an <span class="lime"> available aging tank.</span>`);
				} else {
					r.push(`You have <span class="lime"> available aging tanks.</span>`);
				}
				if (V.pregnancyMonitoringUpgrade === 1) {
					linkArray.push(
						App.UI.DOM.link(
							`Inspect pregnancy`,
							() => { },
							[],
							`Analyze PC Pregnancy`
						)
					);
				}
				App.UI.DOM.link(
					`Keep ${(_WL > 1) ? `a` : `your`} child`,
					() => {
						WombAddToGenericReserve(V.PC, 'incubator', 1);
						refresh();
					}
				);
				if ((_WL > 1) && (reservedChildren + _WL - _reservedIncubator) <= freeTanks) {
					App.UI.DOM.link(
						`Keep all of your children|Incubator`,
						() => {
							WombAddToGenericReserve(V.PC, 'incubator', 9999);
							refresh();
						}
					);
				}
			}
		} else if (reservedChildren === freeTanks) {
			if (V.pregnancyMonitoringUpgrade === 1) {
				linkArray.push(
					App.UI.DOM.link(
						`Inspect pregnancy`,
						() => { },
						[],
						`Analyze PC Pregnancy`
					)
				);
			}
			const noRoom = new DocumentFragment();
			noRoom.append(`You have `);
			App.UI.DOM.appendNewElement("span", noRoom, `no room for your offspring.`, "red");
			linkArray.push(noRoom);
		}
		App.Events.addNode(el, r, "div");
		choices.append(App.UI.DOM.generateLinksStrip(linkArray));
		el.append(choices);

		return el;

		function refresh() {
			jQuery("#content-pc").empty().append(PC());
			jQuery("#content-intro").empty().append(intro());
			jQuery("#content-tank-babies").empty().append(tankBabies());
		}
	}

	function tankBabies() {
		const el = new DocumentFragment();
		let row;
		let linkArray;
		const reservedChildren = FetusGlobalReserveCount("incubator");
		const incubatorSlaves = V.tanks.length;
		if (incubatorSlaves > 0) {
			App.UI.DOM.appendNewElement("h2", el, `Children in ${V.incubatorName}`);

			for (let i = 0; i < incubatorSlaves; i++) {
				const p = document.createElement("p");
				p.classList.add("incubator-tank");
				let r = [];
				const {
					He, His,
					he, him, his
				} = getPronouns(V.tanks[i]);
				r.push(App.UI.DOM.makeElement("span", V.tanks[i].slaveName, "pink"));
				r.push(`occupies this tank.`);
				if (V.geneticMappingUpgrade >= 1) {
					r.push(`${He} is a`);
					if (V.tanks[i].genes === "XX") {
						r.push(`female`);
					} else {
						r.push(`male`);
					}
					r.push(`of ${V.tanks[i].race} descent with ${App.Desc.eyesColor(V.tanks[i])}, ${V.tanks[i].hColor} hair and ${V.tanks[i].skin} skin. Given ${his} parentage, ${he} is considered ${V.tanks[i].nationality}.`);
				} else {
					r.push(`${He} appears to be`);
					if (V.tanks[i].genes === "XX") {
						r.push(`a natural girl,`);
					} else {
						r.push(`a natural boy,`);
					}
					r.push(`with ${V.tanks[i].hColor}`);
					if (getBestVision(V.tanks[i]) === 0) {
						r.push(`hair and ${App.Desc.eyesColor(V.tanks[i])}.`);
					} else {
						r.push(`hair. ${He} most likely will be blind.`);
					}
				}
				if (V.tanks[i].preg > 0) {
					r.push(`<span class="red">Warning! Subject may be pregnant! Unanticipated growth may occur!</span>`);
				}
				r.push(`Statistical projections indicates that once released ${he} will be around ${heightToEitherUnit(V.tanks[i].height + random(-5, 5))} tall. Most likely ${he} will be`);
				if (V.tanks[i].weight <= 30 && V.tanks[i].weight >= -30) {
					r.push(`at a healthy weight and`);
				} else if (V.tanks[i].weight >= 31 && V.tanks[i].weight <= 95) {
					r.push(`quite overweight and`);
				} else if (V.tanks[i].weight >= 96) {
					r.push(`very overweight and`);
				} else if (V.tanks[i].weight <= -31 && V.tanks[i].weight >= -95) {
					r.push(`quite thin and`);
				} else if (V.tanks[i].weight <= -96) {
					r.push(`very thin and`);
				}
				if (V.tanks[i].muscles <= 5 && V.tanks[i].muscles >= -5) {
					r.push(`with a normal musculature.`);
				} else if (V.tanks[i].muscles >= 6 && V.tanks[i].muscles <= 30) {
					r.push(`quite toned.`);
				} else if (V.tanks[i].muscles >= 31 && V.tanks[i].muscles <= 95) {
					r.push(`quite muscular.`);
				} else if (V.tanks[i].muscles >= 96) {
					r.push(`with a powerful musculature.`);
				} else if (V.tanks[i].muscles <= -6 && V.tanks[i].muscles >= -30) {
					r.push(`quite weak.`);
				} else if (V.tanks[i].muscles <= -31 && V.tanks[i].muscles >= -95) {
					r.push(`very weak.`);
				} else if (V.tanks[i].muscles <= -96) {
					r.push(`extremely weak.`);
				}
				r.push(`${His} breasts are projected to be`);
				if (V.tanks[i].boobs <= 299) {
					r.push(`of small size,`);
				} else if (V.tanks[i].boobs <= 799) {
					r.push(`of normal size,`);
				} else if (V.tanks[i].boobs <= 1799) {
					r.push(`of generous size,`);
				} else if (V.tanks[i].boobs <= 3249) {
					r.push(`of incredible size,`);
				} else {
					r.push(`of humongous size,`);
				}
				r.push(`while ${his} rear will be`);
				if (V.tanks[i].butt <= 3) {
					r.push(`a healthy size.`);
				} else if (V.tanks[i].butt <= 6) {
					r.push(`quite impressive.`);
				} else if (V.tanks[i].butt <= 9) {
					r.push(`very impressive.`);
				} else {
					r.push(`immense.`);
				}
				if (V.tanks[i].dick > 0) {
					if (V.tanks[i].dick <= 3) {
						r.push(`The latest analysis reported ${his} dick will end up being around the average`);
					} else if (V.tanks[i].dick >= 4 && V.tanks[i].dick <= 6) {
						r.push(`The latest analysis reported ${his} dick will end up being above average`);
					} else if (V.tanks[i].dick >= 7 && V.tanks[i].dick <= 9) {
						r.push(`The latest analysis reported ${his} dick will end up being far above the average`);
					} else {
						r.push(`The latest analysis reported ${his} dick will end up being of monstrous size`);
					}
				}
				if (V.tanks[i].balls > 0) {
					if (V.tanks[i].balls <= 3) {
						r.push(`and ${his} testicles will reach a normal size.`);
					} else if (V.tanks[i].balls >= 4 && V.tanks[i].balls <= 6) {
						r.push(`and ${his} testicles will be of remarkable size.`);
					} else if (V.tanks[i].balls >= 7 && V.tanks[i].balls <= 9) {
						r.push(`and ${his} testicles will reach an impressive size.`);
					} else {
						r.push(`and ${his} testicles will reach a monstrous size.`);
					}
				}
				if (V.tanks[i].pubertyXX === 1 && V.tanks[i].ovaries === 1) {
					r.push(`Scanners report ${his} womb is fertile.`);
				} else {
					r.push(`Scanners report ${he} is not fertile,`);
					if (V.tanks[i].pubertyXX === 0) {
						r.push(`as ${he} has not yet entered puberty.`);
					} else {
						r.push(`as it appears ${his} womb is sterile.`);
					}
				}
				if ((V.incubatorPregAdaptationSetting === 1 && V.tanks[i].genes === "XX") || (V.incubatorPregAdaptationSetting === 2 && V.tanks[i].genes === "XY") || V.incubatorPregAdaptationSetting === 3) {
					r.push(`There are probes and tubes inserted inside ${his} reproductive organs so ${V.incubatorName} may work on them.`);
					const _safeCC = (V.tanks[i].pregAdaptation - 5) * 2000;
					if (_safeCC > 300000) {
						/* Some bigger size descriptions may be unreachable by normal game mechanics, so they are here just in case.*/
						r.push(`${His} bloated form looks more like an overinflated beachball made of the overstretched skin of ${his} belly with ${his} relative tiny body attached to its side. ${He} is completely dominated by it now. The process has gone too far, so ${his} body can't maintain its form with the belly as part of abdominal cavity. Now ${his} skin, tissues and muscles have stretched enough for ${his} belly to expand outside of any physical boundaries and appear more an attachment to ${his} body, rather than part of it.`);
					} else if (_safeCC > 150000) {
						r.push(`${His} body looks almost spherical, having been grotesquely inflated with the stimulator sacks inserted into ${his} internals. The incubator constantly maintains high pressure inside ${him}, forcing the displacement of ${his} organs and stretching skin, tissues, and muscles. Even ${his} chest forced to become a part of the top of ${his} belly, having been pushed forward from the overwhelming volume inside.`);
					} else if (_safeCC > 75000) {
						r.push(`${His} belly has become so huge that can be easily compared with belly of a woman ready to birth quintuplets. It pulses from the pressure applied within by the incubator probes.`);
					} else if (_safeCC > 45000) {
						r.push(`${His} belly, in the current state, would look normal on a woman who was ready to birth triplets. On ${his} still growing form, it's something completely out of the ordinary.`);
					} else if (_safeCC > 30000) {
						r.push(`${His} belly looks like it contains full sized twins, ready to be birthed.`);
					} else if (_safeCC > 15000) {
						r.push(`${His} belly has reached the size of full term pregnancy.`);
					} else if (_safeCC > 10000) {
						r.push(`${His} belly has inflated to the size of late term pregnancy; its skin shines from the tension.`);
					} else if (_safeCC > 5000) {
						r.push(`${His} belly resembles a mid term pregnancy; it pulses slightly from the expansion and contraction of expandable sacks tipping the incubator probes.`);
					} else if (_safeCC > 1500) {
						r.push(`${His} belly slightly bulges and rhythmically expands and contracts to the cycles of ${his} stimulation as the incubator inflates and deflates expandable sacks on its probes within ${his} body cavity. With the correct serums applied, this should allow it to stretch the skin, tissues, and muscles of ${his} belly to better to tolerate the displacement of internal organs caused by fetal growth.`);
					}
				}
				App.Events.addNode(p, r, "div");
				if (V.tanks[i].growTime <= 0) {
					V.readySlaves = 1;
					appendRow(p, `${He} is ready to be released from ${his} tank.`);
				} else {
					const _weekDisplay = Math.round(V.tanks[i].growTime / V.incubatorUpgradeSpeed);
					appendRow(p, `${His} growth is currently being accelerated. ${He} will be ready for release in about ${_weekDisplay}  ${(_weekDisplay > 1) ? `weeks` : `week`}.`);
				}

				if (V.tanks[i].tankBaby !== 3) {
					r = [];
					r.push(`The tank is imprinting ${him} with basic life and sexual skills, though ${he} will still be very naïve and inexperienced on release.`);
					if (V.tanks[i].tankBaby === 2) {
						r.push(`The majority of ${his} indoctrination involves painting the world as a terrible place where only horror awaits ${him} should ${he} not obey ${his} owner.`);
					} else {
						r.push(`The majority of ${his} indoctrination involves painting the world as a wonderful place only if ${he} is unconditionally devoted to, and absolutely trusting of, ${his} owner.`);
					}
					App.Events.addNode(p, r, "div");
				} else {
					appendRow(p, `The tank keeps ${him} a braindead husk on a complete life-support.`);
				}

				if (V.incubatorUpgradeWeight === 1) {
					if (V.incubatorWeightSetting === 1) {
						appendRow(p, `${His} weight is not being properly managed, saving costs but likely causing excessive weight gain.`);
					} else if (V.incubatorWeightSetting === 2) {
						appendRow(p, `${His} weight is being carefully managed; ${he} will be released at a healthy weight.`);
					} else if (V.incubatorWeightSetting === 0) {
						appendRow(p, `Weight management systems are offline; ${he} will likely be malnourished.`);
					}
				}
				if (V.incubatorUpgradeMuscles === 1) {
					if (V.incubatorMusclesSetting === 2) {
						appendRow(p, `${His} strength levels are purposefully set higher than recommended; ${he} is likely to have excessive musculature.`);
					} else if (V.incubatorMusclesSetting === 1) {
						appendRow(p, `${His} musculature is being carefully managed; ${he} will be released with near normal strength.`);
					} else if (V.incubatorMusclesSetting === 0) {
						appendRow(p, `Strength management systems are offline; ${he} will likely be released extremely weak.`);
					}
				}
				if (V.incubatorUpgradeGrowthStims === 1) {
					if (V.incubatorGrowthStimsSetting === 2) {
						appendRow(p, `${He} is being injected with higher than recommended doses of stimulants; ${he} is likely to be much taller than expected.`);
					} else if (V.incubatorGrowthStimsSetting === 1) {
						appendRow(p, `${He} is injected with the recommended dosage of stimulants; ${he} will grow to ${his} full expected height.`);
					} else if (V.incubatorGrowthStimsSetting === 0) {
						appendRow(p, `Growth stimulant injection systems are offline; ${he} will develop normally.`);
					}
				}
				if (V.incubatorUpgradeReproduction === 1) {
					if (V.incubatorReproductionSetting === 2) {
						appendRow(p, `${His} hormone levels are purposefully set higher than recommended; ${his} reproductive systems are likely to be over-active.`);
					} else if (V.incubatorReproductionSetting === 1) {
						appendRow(p, `${His} hormone levels are being carefully managed; ${he} will be released with fully functional reproductive organs.`);
					} else if (V.incubatorReproductionSetting === 0) {
						appendRow(p, `Reproduction management systems are offline; ${he} will undergo normal puberty.`);
					}
					if ((V.incubatorPregAdaptationSetting === 1 && V.tanks[i].genes === "XX") || (V.incubatorPregAdaptationSetting === 2 && V.tanks[i].genes === "XY") || V.incubatorPregAdaptationSetting === 3) {
						/* Should be visible only after incubatorUpgradeReproduction is installed and activated*/
						r = [];
						r.push(`${His} reproductive organs are getting`);
						if (V.tanks[i].incubatorPregAdaptationPower === 1) {
							r.push(`an advanced`);
						} else if (V.tanks[i].incubatorPregAdaptationPower === 2) {
							r.push(`an intensive`);
						} else if (V.tanks[i].incubatorPregAdaptationPower === 3) {
							r.push(`an extreme`);
						} else {
							r.push(`a standard`);
						}
						r.push(` course of mechanical and hormonal therapy to become adapted for future use.`);
						App.Events.addNode(p, r, "div");
					}
				}
				r = [];
				r.push(`Rename ${him}:`);
				r.push(
					App.UI.DOM.makeTextBox(
						V.tanks[i].slaveName,
						(v) => {
							V.tanks[i].slaveName = v;
							refresh();
						}
					)
				);
				r.push(App.UI.DOM.makeElement("span", `Given name only`, `note`));
				App.Events.addNode(p, r, "div");

				if (V.cheatMode === 1) {
					row = document.createElement("div");
					App.UI.DOM.appendNewElement("span", row, `Cheatmode: `, "bold");
					row.append(
						App.UI.DOM.link(
							"Retrieve immediately",
							() => {
								V.readySlave = V.tanks[i];
								V.tanks.splice(i, 1);
							},
							[],
							"Incubator Retrieval Workaround"
						)
					);
					p.append(row);
				}
				if ((V.incubatorUpgradeOrgans === 1) && (V.tanks[i].tankBaby !== 3)) {
					r = [];
					r.push(`You can extract a sample and prepare a new organ for ${him} to be implanted once ${he} exits ${his} tank.`);
					tankOrgans = {
						ovaries: 0,
						penis: 0,
						testicles: 0,
						rightEye: 0,
						leftEye: 0,
						voiceBox: 0
					};
					for (let _i = 0; _i < V.incubatorOrgans.length; _i++) {
						if (V.tanks[i].ID === V.incubatorOrgans[_i].ID) {
							if (V.incubatorOrgans[_i].type === "ovaries") {
								tankOrgans.ovaries = 1;
							}
							if (V.incubatorOrgans[_i].type === "testicles") {
								tankOrgans.testicles = 1;
							}
							if (V.incubatorOrgans[_i].type === "penis") {
								tankOrgans.penis = 1;
							}
							if (V.incubatorOrgans[_i].type === "rightEye") {
								tankOrgans.rightEye = 1;
							}
							if (V.incubatorOrgans[_i].type === "leftEye") {
								tankOrgans.leftEye = 1;
							}
							if (V.incubatorOrgans[_i].type === "voicebox") {
								tankOrgans.voicebox = 1;
							}
						}
					}

					if (V.tanks[i].genes === "XX") {
						r.push(`Being a natural girl, ${he} possesses a functional vagina and ovaries. You can:`);
					} else {
						r.push(`Being a natural boy, ${he} possesses a functional penis and balls. You can:`);
					}
					App.Events.addNode(p, r, "div");

					linkArray = [];
					if (V.tanks[i].ovaries === 0) {
						if (tankOrgans.ovaries !== 1) {
							linkArray.push(
								makeLink(
									"Prepare ovaries",
									() => {
										App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "ovaries");
									},
									refresh
								)
							);
						} else {
							linkArray.push(App.UI.DOM.makeElement("span", `Ovaries are already prepared.`, "detail"));
						}
					}
					if (V.tanks[i].dick === 0) {
						if (tankOrgans.penis !== 1) {
							linkArray.push(
								makeLink("Prepare penis", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "penis"); }, refresh)
							);
						} else {
							linkArray.push(App.UI.DOM.makeElement("span", `A penis is already prepared`, "detail"));
						}
					}
					if (V.tanks[i].balls === 0) {
						if (tankOrgans.testicles !== 1) {
							linkArray.push(makeLink("Prepare testicles", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "testicles"); }, refresh));
						} else {
							linkArray.push(App.UI.DOM.makeElement("span", `Testicles are already prepared.`, "detail"));
						}
					}
					const vision = {
						left: getLeftEyeVision(V.tanks[i]),
						right: getRightEyeVision(V.tanks[i])
					};
					if (vision.left === 0 || vision.right === 0) {
						if (vision.left === 0 && vision.right === 0) {
							linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in both eyes:`));
						} else if (vision.left === 0) {
							linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} left eye:`));
						} else {
							linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} right eye:`));
						}
						if (vision.left === 0 && tankOrgans.leftEye !== 1) {
							linkArray.push(makeLink("Prepare left eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"); }, refresh));
						}
						if (vision.right === 0 && tankOrgans.rightEye !== 1) {
							linkArray.push(makeLink("Prepare right eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); }, refresh));
						}
						if (vision.left === 0 && vision.right === 0 && linkArray.length === 2) {
							linkArray.push(
								makeLink(
									"Prepare right eye",
									() => {
										App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye");
										App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye");
									},
									refresh
								)
							);
						}
						if (vision.left === 0 && vision.right === 0 && linkArray.length === 0) {
							linkArray.push(App.UI.DOM.makeElement("span", `Both eyes are already prepared.`, `detail`));
						} else if (tankOrgans.leftEye === 1) {
							linkArray.push(App.UI.DOM.makeElement("span", `A left eye is already prepared.`, `detail`));
						} else if (tankOrgans.rightEye === 1) {
							linkArray.push(App.UI.DOM.makeElement("span", `A right eye is already prepared.`, `detail`));
						}
					}
					App.UI.DOM.appendNewElement("div", p, App.UI.DOM.generateLinksStrip(linkArray));
					if (V.tanks[i].voice === 0) {
						r = [];
						r.push(`${He} appears to be mute:`);
						if (tankOrgans.voicebox !== 1) {
							r.push(makeLink("Prepare vocal cords", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "voicebox"); }, refresh));
						} else {
							r.push(App.UI.DOM.makeElement("span", `Vocal cords are already prepared.`, `detail`));
						}
						App.Events.addNode(p, r, "div");
					}
				}
				el.append(p);
			}
		}

		for (let i = 0; i < reservedChildren; i++) {
			const empty = document.createElement("div");
			empty.classList.add("incubator-tank");
			empty.append("This tank is currently reserved");
			el.append(empty);
		}
		const freeTanks = V.incubator - incubatorSlaves;
		const empty = freeTanks - reservedChildren;
		if (empty) {
			for (let i = 0; i < empty; i++) {
				const empty = document.createElement("div");
				empty.classList.add("incubator-tank");
				empty.append("This tank is currently empty");
				empty.append(
					choice(
						`Remove incubation tank`,
						() => {
							cashX(forceNeg(Math.trunc(10000 * V.upgradeMultiplierArcology)), "capEx");
							V.incubator -= 1;
							refresh();
						},
						"",
						`Costs ${cashFormat(Math.trunc(10000 * V.upgradeMultiplierArcology))} and will reduce upkeep costs`
					)
				);
				el.append(empty);
			}
		}
		// if (V.incubator > 1 && reservedChildren < freeTanks)

		return el;

		function refresh() {
			jQuery("#content-tank-babies").empty().append(tankBabies());
			jQuery("#content-intro").empty().append(intro());
		}
	}

	function tankSettings() {
		const el = new DocumentFragment();
		let cost;
		let p;
		let r = [];
		let row = document.createElement("div");
		let linkArray;
		r.push("Target age for release:");
		r.push(
			App.UI.DOM.makeTextBox(
				V.targetAge,
				(v) => {
					V.targetAge = v || V.minimumSlaveAge;
					V.targetAge = Math.clamp(V.targetAge, V.minimumSlaveAge, V.retirementAge);
					refresh();
				},
				true
			)
		);
		linkArray = [];
		linkArray.push(
			App.UI.DOM.link(
				`Minimum Legal Age`,
				() => {
					V.targetAge = V.minimumSlaveAge;
					refresh();
				}
			)
		);
		linkArray.push(
			App.UI.DOM.link(
				`Average Age of Fertility`,
				() => {
					V.targetAge = V.fertilityAge;
					refresh();
				}
			)
		);
		linkArray.push(
			App.UI.DOM.link(
				`Average Age of Potency`,
				() => {
					V.targetAge = V.potencyAge;
					refresh();
				}
			)
		);
		linkArray.push(
			App.UI.DOM.link(
				`Legal Adulthood`,
				() => {
					V.targetAge = 18;
					refresh();
				}
			)
		);
		r.push(App.UI.DOM.generateLinksStrip(linkArray));
		r.push(App.UI.DOM.makeElement("span", `Setting will not be applied to tanks in use.`, "note"));
		App.Events.addNode(el, r, "p");

		row = document.createElement("p");
		if (V.incubatorBulkRelease === 1) {
			row.append(`Released children will be handled in bulk and not receive personal attention. `);
			row.append(
				App.UI.DOM.link(
					`Individual release`,
					() => {
						V.incubatorBulkRelease = 0;
						refresh();
					}
				)
			);
		} else {
			row.append(`Released children will be seen to personally. `);
			row.append(
				App.UI.DOM.link(
					`Bulk release`,
					() => {
						V.incubatorBulkRelease = 1;
						refresh();
					}
				)
			);
		}
		el.append(row);

		row = document.createElement("p");

		if (V.incubatorUpgradeSpeed === 52) {
			row.append(`It has been upgraded with perfected growth accelerants; children grow at the rate of 1 week to 1 year.`);
		} else if (V.incubatorUpgradeSpeed === 18) {
			cost = Math.trunc(500000 * V.upgradeMultiplierArcology);
			row.append(`It has been upgraded with advanced experimental growth accelerants; children grow at the rate of 3 weeks to 1 year. `);
			row.append(
				App.UI.DOM.link(
					`Fund speculative research into maximizing growth rate`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeSpeed = 52;
						refresh();
					},
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		} else if (V.incubatorUpgradeSpeed === 9) {
			cost = Math.trunc(75000 * V.upgradeMultiplierArcology);
			row.append(`It has been upgraded with advanced growth accelerants; children grow at the rate of 6 weeks to 1 year. `);
			row.append(
				App.UI.DOM.link(
					`Fund research into increasing growth rate even further`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeSpeed = 18;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		} else if (V.incubatorUpgradeSpeed === 6) {
			cost = Math.trunc(30000 * V.upgradeMultiplierArcology);
			row.append(`It has been upgraded with growth accelerants; children grow at the rate of 9 weeks to 1 year. `);
			row.append(
				App.UI.DOM.link(
					`Further upgrade the incubators with specialized stem cells to speed growth`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeSpeed = 9;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		} else if (V.incubatorUpgradeSpeed === 5) {
			cost = Math.trunc(30000 * V.upgradeMultiplierArcology);
			row.append(`The incubation tanks are basic; children grow at the rate of 12 weeks to 1 year. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the incubators with growth accelerating drugs`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeSpeed = 6;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		}

		el.append(row);

		p = document.createElement("p");
		row = document.createElement("div");
		if (V.incubatorUpgradeWeight === 1) {
			row.append(`Advanced caloric monitoring systems have been installed in the tanks to monitor and maintain a developing child's weight.`);
			p.append(row);
			row = document.createElement("div");
			linkArray = [];
			if (V.incubatorWeightSetting === 1) {
				row.append(`Weight is not being properly managed; excessive weight gain is likely. `);
			} else {
				linkArray.push(makeLink(`Estimate only`, () => { V.incubatorWeightSetting = 1; }, refresh));
			}

			if (V.incubatorWeightSetting === 2) {
				row.append(`Weight is being carefully managed; children will be released at a healthy weight. `);
			} else {
				linkArray.push(makeLink(`Activate`, () => { V.incubatorWeightSetting = 2; }, refresh));
			}

			if (V.incubatorWeightSetting === 0) {
				row.append(`Weight management systems are offline; children will likely be malnourished. `);
			} else {
				linkArray.push(makeLink(`Disable`, () => { V.incubatorWeightSetting = 0; }, refresh));
			}
			row.append(App.UI.DOM.generateLinksStrip(linkArray));
		} else {
			cost = Math.trunc(20000 * V.upgradeMultiplierArcology);
			row.append(`There are no systems in place to control a growing child's weight; they will likely come out emaciated from the rapid growth. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the growth tanks with weight monitoring systems`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeWeight = 1;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		}

		p.append(row);
		el.append(p);

		p = document.createElement("p");
		row = document.createElement("div");

		if (V.incubatorUpgradeMuscles === 1) {
			row.append(`Advanced monitoring and steroid injection systems have been installed in the tanks to monitor and maintain a developing child's musculature.`);
			p.append(row);
			row = document.createElement("div");
			linkArray = [];
			if (V.incubatorMusclesSetting === 2) {
				row.append(`Strength levels are purposefully set higher than recommended; excessive muscle gain is likely. `);
			} else {
				linkArray.push(makeLink(`Overload`, () => { V.incubatorMusclesSetting = 2; }, refresh));
			}

			if (V.incubatorMusclesSetting === 1) {
				row.append(`Musculature is being carefully managed; children will be released with near normal strength. `);
			} else {
				linkArray.push(makeLink(`Activate`, () => { V.incubatorMusclesSetting = 1; }, refresh));
			}

			if (V.incubatorMusclesSetting === 0) {
				row.append(`Strength management systems are offline; children will likely be released extremely weak. `);
			} else {
				linkArray.push(makeLink(`Disable`, () => { V.incubatorMusclesSetting = 0; }, refresh));
			}

			row.append(App.UI.DOM.generateLinksStrip(linkArray));
		} else {
			cost = Math.trunc(20000 * V.upgradeMultiplierArcology);
			row.append(`There are no systems in place to control a growing child's musculature; they will likely come out frail and weak from the rapid growth. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the growth tanks with muscle monitoring systems`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeMuscles = 1;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		}

		p.append(row);
		el.append(p);

		p = document.createElement("p");
		row = document.createElement("div");

		if (V.incubatorUpgradeReproduction === 1) {
			row.append(`Advanced monitoring and hormone injection systems have been installed in the tanks to influence a developing child's reproductive organs.`);
			p.append(row);
			row = document.createElement("div");
			linkArray = [];
			if (V.incubatorReproductionSetting === 2) {
				row.append(`Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. `);
			} else {
				linkArray.push(makeLink(`Overload`, () => { V.incubatorReproductionSetting = 2; }, refresh));
			}

			if (V.incubatorReproductionSetting === 1) {
				row.append(`Hormone levels are being carefully managed; children will be released with fully functional reproductive organs. `);
			} else {
				linkArray.push(makeLink(`Limit`, () => { V.incubatorReproductionSetting = 1; }, refresh));
			}

			if (V.incubatorReproductionSetting === 0) {
				row.append(`Reproduction management systems are offline; children will undergo normal puberty. `);
			} else {
				linkArray.push(makeLink(`Disable`, () => { V.incubatorReproductionSetting = 0; }, refresh));
			}
			row.append(App.UI.DOM.generateLinksStrip(linkArray));

			if (V.incubatorUpgradePregAdaptation === 1) {
				// Should be visible only after incubatorUpgradeReproduction is installed
				p.append(row);
				row = document.createElement("div");
				linkArray = [];
				if (V.incubatorPregAdaptationSetting === 3) {
					row.append(`Pregnancy adaptation system online: All. `);
				} else {
					linkArray.push(makeLink(`All`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh));
				}

				if (V.incubatorPregAdaptationSetting === 2) {
					row.append(`Pregnancy adaptation system online: Males only. `);
				} else {
					linkArray.push(makeLink(`Males`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh));
				}

				if (V.incubatorPregAdaptationSetting === 1) {
					row.append(`Pregnancy adaptation system online: Females only. `);
				} else {
					linkArray.push(makeLink(`Females`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh));
				}

				if (V.incubatorPregAdaptationSetting === 0) {
					row.append(`Pregnancy adaptation system offline. `);
				} else {
					linkArray.push(makeLink(`Disable`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh));
				}
				row.append(App.UI.DOM.generateLinksStrip(linkArray));
			}
			if (V.incubatorUpgradePregAdaptation === 1 && V.incubatorPregAdaptationSetting > 0) {
				// Should be visible only after incubatorUpgradeReproduction is installed and turned on
				p.append(row);
				row = document.createElement("div");
				linkArray = [];
				if (V.incubatorPregAdaptationPower === 1) {
					row.append(`Pregnancy adaptation programmed to advanced procedures. Up to triplet pregnancy should be safe for the subjects.`);
				} else {
					linkArray.push(makeLink(`Advanced`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh));
				}

				if (V.incubatorPregAdaptationPower === 2) {
					row.append(`Pregnancy adaptation programmed to intensive procedures. Up to octuplet pregnancy should be possible for the subjects. Warning! Side effects may occur to health and mental condition.`);
				} else {
					linkArray.push(makeLink(`Intensive`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh));
				}

				if (V.incubatorPregAdaptationPower === 3) {
					row.append(`Pregnancy adaptation programmed to extreme procedures. Normally unsustainable pregnancies may be possible for some subjects. Actual capacity will vary with genetic and other individual conditions. WARNING! Extreme side effects may occur to health and mental condition!`);
				} else {
					linkArray.push(makeLink(`Extreme`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh));
				}

				if (V.incubatorPregAdaptationPower === 0) {
					row.append(`Pregnancy adaptation programmed to standard procedures. Normal pregnancy should be safe for subjects.`);
				} else {
					linkArray.push(makeLink(`Standard`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh));
				}
				row.append(App.UI.DOM.generateLinksStrip(linkArray));
				App.UI.DOM.appendNewElement("span", row, `Due to the high complexity and steep risks of the procedure, settings will not be changed on tanks in use.`, "note");
			}
		} else {
			cost = Math.trunc(50000 * V.upgradeMultiplierArcology);
			row.append(`There are no systems in place to control a growing child's reproductive capability. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the growth tanks with hormone monitoring systems`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeReproduction = 1;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		}

		p.append(row);
		el.append(p);

		p = document.createElement("p");
		row = document.createElement("div");

		if (V.incubatorUpgradeOrgans === 1) {
			row.append(`Surgical tools have been added to the tank to be able to extract tissue samples from the occupant.`);
		} else if (V.organFarmUpgrade >= 1) {
			cost = Math.trunc(10000 * V.upgradeMultiplierArcology);
			row.append(`The tanks lack the ability to extract tissue samples to be used by the organ fabricator. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the growth tanks with surgical extraction tools`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeOrgans = 1;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		} else {
			row.append(`The tanks lack the ability to extract tissue samples and the dispensary lacks the ability to make use of them to fabricate organs.`);
		}

		el.append(row);

		p = document.createElement("p");
		row = document.createElement("div");

		if (V.incubatorUpgradeGrowthStims === 1) {
			row.append(`Advanced monitoring and stimulant injection systems have been installed in the tanks to monitor and maintain a developing child's height.`);
			row = document.createElement("div");
			linkArray = [];
			if (V.incubatorGrowthStimsSetting === 2) {
				row.append(`Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. `);
			} else {
				linkArray.push(makeLink(`Overload`, () => { V.incubatorGrowthStimsSetting = 2; }, refresh));
			}

			if (V.incubatorGrowthStimsSetting === 1) {
				row.append(`Children are injected with the recommended dosage of stimulants; they will grow to their full expected height. `);
			} else {
				linkArray.push(makeLink(`Limit`, () => { V.incubatorGrowthStimsSetting = 1; }, refresh));
			}

			if (V.incubatorGrowthStimsSetting === 0) {
				row.append(`Growth stimulant injection systems are offline; children will develop normally. `);
			} else {
				linkArray.push(makeLink(`Disable`, () => { V.incubatorGrowthStimsSetting = 0; }, refresh));
			}
			row.append(App.UI.DOM.generateLinksStrip(linkArray));
		} else if (V.growthStim === 1) {
			cost = Math.trunc(20000 * V.upgradeMultiplierArcology);
			row.append(`There are no systems in place to control a growing child's height. `);
			row.append(
				App.UI.DOM.link(
					`Upgrade the growth tanks with stimulants injection systems`,
					() => {
						cashX(forceNeg(cost), "capEx");
						V.incubatorUpgradeGrowthStims = 1;
						refresh();
					}
				)
			);
			App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note");
		} else {
			row.append(`There are no systems in place to control a growing child's height and you lack the capability to fabricate growth stimulants.`);
		}
		p.append(row);
		el.append(p);

		if (V.minimumSlaveAge <= 6 && (V.arcologies[0].FSRepopulationFocus >= 60 || V.BlackmarketPregAdaptation === 1)) {
			/* Main prerequisite - stable repopulation FS OR documentation purchased from black market. And age gate. */
			p = document.createElement("p");
			row = document.createElement("div");
			if (V.incubatorUpgradePregAdaptation === 1) {
				row.append(`The incubators have been upgraded with special set of manipulators, probes, nozzles and syringes coupled together with specific programs to take advantage of the accelerated growth to heighten viable reproductive capacity. These include injections of specialized serums and mechanical manipulation of the reproductive system and associated tissues, organs, muscles and bones.`);
			} else {
				row.append(`The highly controlled environment inside incubation tube coupled with the greatly accelerated growth process is the perfect opportunity to push the boundaries of a body's ability to sustain pregnancy. This will include injections of specialized serums and mechanical manipulation of their reproductive system through a special set of manipulators, probes, nozzles and syringes supervised by a powerful monitoring program. Costly to maintain.`);
				p.append(row);

				row = document.createElement("div");
				if (V.incubatorUpgradeReproduction < 1) {
					/* Now with reports - what is lacking for construction */
					row.append(`${_incubatorNameCaps} lacks advanced monitoring and hormone injection systems. Construction not possible.`);
				} else if (V.incubatorUpgradeOrgans < 1) {
					row.append(`${_incubatorNameCaps} lacks the ability to extract tissue samples. Construction not possible.`);
				} else if (V.dispensaryUpgrade < 1) {
					row.append(`${_incubatorNameCaps} lacks a connection to an advanced pharmaceutical fabricator.Cutting - edge targeted serums production needed as integral part. Construction not possible.`);
				} else if (V.bellyImplants < 1) {
					row.append(`${_incubatorNameCaps} lacks a connection with an implant manufacturing to construct fillable abdominal implants to simulate expansion. Construction not possible.`);
				} else if (V.incubatorUpgradeGrowthStims < 1) {
					row.append(`${_incubatorNameCaps} lacks advanced monitoring and stimulant injection systems. Construction not possible.`);
				} else {
					cost = Math.trunc(2000000 * V.upgradeMultiplierArcology);
					row.append(
						choice(
							`Manufacture and install this subsystem`,
							() => {
								cashX(forceNeg(cost), "capEx");
								V.incubatorUpgradePregAdaptation = 1;
								refresh();
							},
							"",
							`Costs ${cashFormat(cost)} and will increase upkeep costs`
						)
					);
				}
			}
			p.append(row);
			el.append(p);
		}

		p = document.createElement("p");
		row = document.createElement("div");
		if (V.incubatorImprintSetting === "terror") {
			row.append(`The imprinting system is currently focused on making them devoted but fearful of you. The imprinting cycle is locked upon incubation start. `);
			App.UI.DOM.appendNewElement("span", row, `Only affects new infants`, "note");
			if (V.bodyswapAnnounced === 1) {
				row.append(
					choice(
						`Switch the system to focus on preparation for body-swapping`,
						() => {
							V.incubatorImprintSetting = "husk";
						}
					)
				);
			}
			row.append(
				choice(
					`Switch the system to focus on attachment`,
					() => {
						V.incubatorImprintSetting = "trust";
					}
				)
			);
		} else if (V.incubatorImprintSetting === "trust") {
			row.append(`The imprinting system is currently focused on making them devoted and trusting of you. The imprinting cycle is locked upon incubation start.`);
			if (V.bodyswapAnnounced === 1) {
				row.append(
					choice(
						`Switch the system to focus preparation for body-swapping`,
						() => {
							V.incubatorImprintSetting = "husk";
						}
					)
				);
			}
			row.append(
				choice(
					`Switch the system to focus on dependence`,
					() => {
						V.incubatorImprintSetting = "terror";
					}
				)
			);
		} else {
			row.append(`The imprinting system is currently focused on producing complete vegetables ready to be used as hosts for body swapping. The imprinting cycle is locked upon incubation start.`);
			row.append(
				choice(
					`Switch the system to focus on dependence`,
					() => {
						V.incubatorImprintSetting = "terror";
					}
				)
			);
			row.append(
				choice(
					`Switch the system to focus on attachment`,
					() => {
						V.incubatorImprintSetting = "trust";
					}
				)
			);
		}
		p.append(row);
		el.append(p);

		row = document.createElement("div");
		row.append(`Rename ${V.incubatorName}: `);
		row.append(
			App.UI.DOM.makeTextBox(
				V.incubatorName,
				(v) => {
					V.incubatorName = v;
					refresh();
				}
			)
		);
		App.UI.DOM.appendNewElement("span", row, ` Use a noun or similar short phrase`, "note");
		el.append(row);

		return el;

		function refresh() {
			jQuery("#content-tank-settings").empty().append(tankSettings());
			jQuery("#content-intro").empty().append(intro());
		}
	}

	function release() {
		const multiple = (V.incubatorBulkRelease === 1) && V.tanks.filter(t => t.growTime <= 0).length > 1;

		const singleRelease = () => {
			const baby = V.tanks.find(t => t.growTime <= 0);
			V.tanks.delete(baby);
			V.readySlave = baby;
		};

		const multipleRelease = () => {
			V.newSlavePool = V.tanks.deleteWith(t => t.growTime <= 0);
		};

		if (V.readySlaves === 1) {
			if (multiple) {
				return App.UI.DOM.passageLink(`Release ready tanks`, "Incubator Retrieval Workaround", multipleRelease);
			} else {
				return App.UI.DOM.passageLink(`Release ready tank`, "Incubator Retrieval Workaround", singleRelease);
			}
		}
		return new DocumentFragment();
	}

	/**
	 *
	 * @param {string} title
	 * @param {function():void} func
	 * @param {function():void} refresh
	 */
	function makeLink(title, func, refresh) {
		return App.UI.DOM.link(
			title,
			() => {
				func();
				refresh();
			}
		);
	}
	/**
	 *
	 * @param {string} title
	 * @param {function():void} func
	 * @param {string} [passage=""]
	 * @param {string} [note]
	 * @returns {HTMLElement}
	 */
	function choice(title, func, passage = "", note = "") {
		const div = document.createElement("div");
		div.classList.add("choices");
		div.append(
			App.UI.DOM.link(
				title,
				func,
				[],
				passage
			)
		);
		if (note) {
			App.UI.DOM.appendNewElement("span", div, ` ${note}`, "note");
		}
		return div;
	}

	function appendRow(node, text) {
		return App.UI.DOM.appendNewElement("div", node, text);
	}

	/**
	 *
	 * @param {string} id
	 * @param {Node} element
	 * @returns {HTMLSpanElement}
	 */
	function makeSpanIded(id, element) {
		const span = document.createElement("span");
		span.id = id;
		span.append(element);
		return span;
	}
};


code:
:: Incubator Retrieval Workaround [nobr]

<<set $returnTo = "Main", $nextLink = "Incubator", $nextButton = "Continue">>

<<if $readySlave != 0>>
	<<setLocalPronouns $readySlave>>
	$readySlave.slaveName has been discharged from $incubatorName and is ready for $his first ever inspection.

	<<includeDOM App.Desc.longSlave($readySlave)>>
	<<if $readySlave.tankBaby != 3>>
		<<if $incubatorOrgans.length > 0>>
			<<for _irw = 0; _irw < $incubatorOrgans.length; _irw++>>
				<<if $incubatorOrgans[_irw].ID == $readySlave.ID>>
					<<set _newOrgan = {type: $incubatorOrgans[_irw].type, weeksToCompletion: $incubatorOrgans[_irw].weeksToCompletion, ID: $readySlave.ID}>>
					<<if _newOrgan.weeksToCompletion <= 0>>
						<<set $completedOrgans.push($incubatorOrgans[_irw])>>
					<<else>>
						<<set $organs.push(_newOrgan)>>
					<</if>>
					<<set $incubatorOrgans.deleteAt(_irw), _irw-->>
				<</if>>
			<</for>>
		<</if>>
		<<includeDOM App.UI.newChildIntro($readySlave)>>
	<<else>>
		<<set $activeSlave = $readySlave>> /* $activeSlave is used by husk Slave Swap Workaround */
		A husk is ready to be used.

		//As expected, $he is a complete vegetable, but that is what you wanted after all. You lack the facilities to care for $him in this state, so you should do what you are planning quickly. Or you could sell $him to the Flesh Heap.//
		<<set _price = Math.trunc(slaveCost($readySlave)/3)>>

		<<if $cash >= $surgeryCost>>

[[Contact the bodyswap surgeon.|husk Slave Swap Workaround]] //Will significantly increase the selected slave's upkeep.//

[[Sell the husk to Flesh Heap.|Main][cashX(_price, "slaveTransfer")]]
			//This body can be bought by the Flesh Heap for <<print cashFormat(_price)>>//.
		<<else>>
			<<run cashX(_price, "slaveTransfer")>>
			//You can't sustain $him and thus must sell $him for <<print cashFormat(_price)>>.//
		<</if>>

	<</if>>
<<else>>
	The following slaves were discharged from $incubatorName:

	<<for _irw = 0; _irw < $newSlavePool.length; _irw++>>

		<<set _newSlave = $newSlavePool[_irw]>>

		Name: <<= SlaveFullName(_newSlave)>>

Mother:
		<<if _newSlave.mother > 0>>
			<<set _tempMom = getSlave(_newSlave.mother)>>
			<<if ndef _tempMom>>
				Unknown.
			<<else>>
				<<= SlaveFullName(_tempMom)>>
			<</if>>
		<<elseif _newSlave.mother == -1>>
			<<= PlayerName()>>.
		<<else>>
			Your former slave, $missingTable[_newSlave.mother].slaveName.
		<</if>>

Father:
		<<if _newSlave.father > 0>>
			<<set _tempDad = getSlave(_newSlave.father)>>
			<<if ndef _tempDad>>
				Unknown.
			<<else>>
				<<= SlaveFullName(_tempDad)>>
			<</if>>
		<<elseif _newSlave.father == -1>>
			<<= PlayerName()>>.
		<<elseif _newSlave.father == -2>>
			Unknown citizen.
		<<elseif _newSlave.father == -3>>
			Your former Master.
		<<elseif _newSlave.father == -4>>
			Another arcology's owner.
		<<elseif _newSlave.father == -5>>
			One of your clients.
		<<elseif _newSlave.father == -6>>
			Societal Elite.
		<<elseif _newSlave.father == -7>>
			Lab crafted.
		<<elseif _newSlave.father == -8>>
			//Error! Animal fathered children shouldn't be here!//
		<<elseif _newSlave.father == -9>>
			Futanari Sister.
		<<else>>
			<<if def $missingTable[_newSlave.father]>>
				Your former slave, $missingTable[_newSlave.father].slaveName.
			<<else>>
				Unknown.
			<</if>>
		<</if>>

		<<run newSlave(_newSlave)>>
		<<if $incubatorOrgans.length > 0>>
			<<for _irw2 = 0; _irw2 < $incubatorOrgans.length; _irw2++>>
				<<if $incubatorOrgans[_irw2].ID == $newSlavePool[_irw].ID>>
					<<set _newOrgan = {type: $incubatorOrgans[_irw2].type, weeksToCompletion: $incubatorOrgans[_irw2].weeksToCompletion, ID: _newSlave.ID}>>
					<<if _newOrgan.weeksToCompletion <= 0>>
						<<set $completedOrgans.push($incubatorOrgans[_irw2])>>
					<<else>>
						<<set $organs.push(_newOrgan)>>
					<</if>>
					<<set $incubatorOrgans.deleteAt(_irw2), _irw2-->>
				<</if>>
			<</for>>
		<</if>>

	<</for>>
	<<set $newSlavePool = 0>>
<</if>>


code:
/**
 * Sends a child to the Incubator if it has room
 * @param {App.Entity.SlaveState|App.Entity.InfantState} child
 */
App.Facilities.Incubator.newChild = function(child) {
	let fullAdapt;
	child.growTime = Math.trunc(V.targetAge * 52);
	child.incubatorPregAdaptationPower = V.incubatorPregAdaptationPower;
	if (V.incubatorPregAdaptationPower === 1) {
		fullAdapt = 45000 / 2000;
	} else if (V.incubatorPregAdaptationPower === 2) {
		fullAdapt = 100000 / 2000;
	} else if (V.incubatorPregAdaptationPower === 3) {
		fullAdapt = 150000 / 2000;
	} else {
		fullAdapt = 15000 / 2000;
	}
	child.incubatorPregAdaptationInWeek = (fullAdapt - child.pregAdaptation) / child.growTime;
	V.tanks.push(child);
};


code:
App.Data.Facilities.masterSuite = {
	baseName: "masterSuite",
	genericName: "Master Suite",
	jobs: {
		fucktoy: {
			position: "fucktoy",
			assignment: Job.MASTERSUITE,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "fucktoy",
	manager: {
		position: "concubine",
		positionAbbreviation: "C",
		assignment: Job.CONCUBINE,
		careers: [],
		skill: null,
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: true,
		shouldWalk: false,
		shouldHold: false,
		shouldSee: false,
		shouldHear: false,
		shouldTalk: false,
		shouldThink: false,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.MasterSuiteFuckToyJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, 20, -51, -21, -50)) {
			r.push(`${slave.slaveName} is not sufficiently broken for ${this.facility.name}.`);
		}

		return r;
	}

	/** @override */
	get assignment() {
		return this.facility.name;
	}
};

App.Entity.Facilities.ConcubineJob = class extends App.Entity.Facilities.ManagingJob {
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (isAmputee(slave)) {
			r.push(`${slave.slaveName} can't serve as your Concubine without limbs.`);
		}
		return r;
	}
};

App.Entity.facilities.masterSuite = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.masterSuite,
	{
		fucktoy: new App.Entity.Facilities.MasterSuiteFuckToyJob()
	},
	new App.Entity.Facilities.ConcubineJob()
);


code:
:: AC Dump

<<if (ndef $activeChild) || ($activeChild == 0)>>

	@@.red;ERROR:@@ AC Dump, activeChild invalid, returnTo is '$returnTo', previous passage was '<<print previous()>>'. Please report this.

	<<link "Continue">><<goto $returnTo>><</link>> | [[Go Back|previous()]]

<<else>>

	<<set _CL = $cribs.length, _ID = $activeChild.ID>>

	<<if $i >= 0 && $i < _CL && $cribs[$i].ID == _ID>> /* shortcut if $i is already pointing to this slave */
		<<set $cribs[$i] = $activeChild>>
	<<else>>
		<<set $i = $cribs.findIndex(function(s) { s.ID === _ID; })>> /* find $i if exists */
		<<if $i != -1>> /* not found, so new slave */
			@@.red;ERROR:@@ $activeChild.slaveName not found! Please report this.
		<<else>>
			<<set $cribs[$i] = $activeChild>>
		<</if>>
	<</if>>

	<<goto $returnTo>>

<</if>>


code:
:: Matron Select [nobr jump-to-safe jump-hidden jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Nursery", $encyclopedia = "Matron">>
<<if ($MatronID != 0)>>
	<<setLocalPronouns _S.Matron>>
	<<= SlaveFullName(_S.Matron)>> is serving as your Matron.

$He will manage the nursery.
<<else>>
	You have not selected a Matron.
<</if>>

''Appoint a Matron from your devoted slaves:''

[[None|Nursery][removeJob(_S.Matron, Job.MATRON)]]

<<includeDOM App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.nursery, "Nursery")>>


code:
:: Next Child In Line

<<silently>>

<<set $i = $cribs.findIndex(function(c) { return c.ID === $activeChild.ID; })>>
<<set $cribs[$i] = $activeChild>> /* save changes before switching */
<<if $i == $cribs.length - 1>>
	<<set $activeChild = $cribs[0]>>
	<<if $activeChild.actualAge < 3>>
		<<goto "Infant Interact">>
	<<else>>
		<<goto "Child Interact">>
	<</if>>
<<else>>
	<<set $activeChild = $cribs[$i+1]>>
	<<if $activeChild.actualAge < 3>>
		<<goto "Infant Interact">>
	<<else>>
		<<goto "Child Interact">>
	<</if>>
<</if>>

<</silently>>


code:
/* FEEL FREE TO MOVE */

.child-section {
	margin-top: 1em;
	margin-bottom: 1em;
}