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

<<includeDOM App.Facilities.Pit.pit()>>

/*
	<<if $activeCanine != 0 || $activeHooved != 0 || $activeFeline != 0>>

	<<switch $activeCanine.breed>>
	<<case "Beagle" "French Bulldog" "Poodle" "Yorkshire Terrier">>
		<<set _animalEligible = 0>>
	<<default>>
		<<set _animalEligible = 1>>
	<</switch>>

	<<if $pit.animalFights == 1>>
		<br>
		<<if $pit.lethal == 1>>
			<<if $pit.animalType == $activeCanine.type>>
				<<if $activeCanine.species != "dog">>
					Your slave will fight a ''$activeCanine.species''.
					$activeCanine.speciesCap
					<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
					<<if _FL > 0>> |
						<<if $activeFeline.species != "cat">>
							[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
						<<else>>
							//House cats are too small for your slave to fight//
						<</if>>
					<</if>>
				<<else>>
					<<if _animalEligible == 1>>
						Your slave will fight a ''$activeCanine.breed''.
						$activeCanine.breed
						<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
						<<if _FL > 0>> |
							<<if $activeFeline.species != "cat">>
								[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
							<<else>>
								//House cats are too small for your slave to fight//
							<</if>>
						<</if>>
					<<else>>
						//<<print $activeCanine.breed>>s are too small for your slave to fight//
						<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
						<<if _FL > 0>> |
							<<if $activeFeline.species != "cat">>
								[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
							<<else>>
								//House cats are too small for your slave to fight//
							<</if>>
						<</if>>
					<</if>>
				<</if>>
			<<elseif $pit.animalType == $activeHooved.type>>
				Your slave will fight a ''$activeHooved.species''.
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]] |
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]] |
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight// |
						<</if>>
					<</if>>
				<</if>>
				$activeHooved.speciesCap
				<<if _FL > 0>> |
					<<if $activeFeline.species != "cat">>
						[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
					<<else>>
						//House cats are too small for your slave to fight//
					<</if>>
				<</if>>
			<<elseif $pit.animalType == $activeFeline.type>>
				<<if $activeFeline.species != "cat">>
					Your slave will fight a ''$activeFeline.species''.
			<<else>>
					//House cats are too small for your slave to fight//
			<</if>>
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]]
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]]
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight//
						<</if>>
					<</if>>
				<</if>>
				<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]] | <</if>>
				<<if $activeFeline.species != "cat">>
					$activeFeline.speciesCap
				<<else>>
					//House cats are too small for your slave to fight//
				<</if>>
			<<else>>
				Select an animal for your slave to fight.
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]]
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]]
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight//
						<</if>>
					<</if>>
				<</if>>
				<<if (_CL > 0 && _HL > 0) || (_CL > 0 && _FL > 0) || (_HL > 0 && _FL > 0)>> | <</if>>
				<<if _HL > 0>>
					[["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]
				<</if>>
				<<if (_HL > 0 && _FL > 0)>> | <</if>>
				<<if _FL > 0>>
					<<if $activeFeline.species != "cat">>
						[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
					<<else>>
						//House cats are too small for your slave to fight//
					<</if>>
				<</if>>

			<</if>>
		<<elseif $pit.lethal == 0>>
			<<if $pit.animalType == $activeCanine.type>>
				<<if $activeCanine.species != "dog">>
					Your slave will try to avoid being used by a ''$activeCanine.species''.
					$activeCanine.speciesCap
				<<else>>
					<<if _animalEligible == 1>>
						Your slave will try to avoid being used by a ''$activeCanine.breed''.
						$activeCanine.breed
						<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
						<<if _FL > 0>> |
							<<if $activeFeline.species != "cat">>
								[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
							<<else>>
								//House cats are too small to use your slave//
							<</if>>
						<</if>>
					<<else>>
						//<<print $activeCanine.breed>>s are too small to use your slave//
						<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
						<<if _FL > 0>> |
							<<if $activeFeline.species != "cat">>
								[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
							<<else>>
								//House cats are too small to use your slave//
							<</if>>
						<</if>>
					<</if>>
				<</if>>
				<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]<</if>>
				<<if _FL > 0>> |
					<<if $activeFeline.species != "cat">>
						[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
					<<else>>
						//House cats are too small to use your slave//
					<</if>>
				<</if>>
			<<elseif $pit.animalType == $activeHooved.type>>
				Your slave will try to avoid being used by a ''$activeHooved.species''.
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]] |
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]] |
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight// |
						<</if>>
					<</if>>
				<</if>>
				$activeHooved.speciesCap
				<<if _FL > 0>> |
					<<if $activeFeline.species != "cat">>
						[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
					<<else>>
						//House cats are too small to use your slave//
					<</if>>
				<</if>>
			<<elseif $pit.animalType == $activeFeline.type>>
				<<if $activeFeline.species != "cat">>
					Your slave will try to avoid being used by a ''$activeFeline.species''.
			<<else>>
					//House cats are too small to use your slave//
			<</if>>
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]]
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]]
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight//
						<</if>>
					<</if>>
				<</if>>
				<<if _HL > 0>> | [["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]] | <</if>>
				<<if $activeFeline.species != "cat">>
					$activeFeline.speciesCap
				<<else>>
					//House cats are too small to use your slave//
				<</if>>
			<<else>>
				Select an animal for your slave to try to avoid.
				<<if _CL > 0>>
					<<if $activeCanine.species != "dog">>
						[["" + $activeCanine.speciesCap + ""|Pit][$pit.animalType = "canine"]]
					<<else>>
						<<if _animalEligible == 1>>
							[["" + $activeCanine.breed + ""|Pit][$pit.animalType = "canine"]]
						<<else>>
							//<<print $activeCanine.breed>>s are too small for your slave to fight//
						<</if>>
					<</if>>
				<</if>>
				<<if (_CL > 0 && _HL > 0) || (_CL > 0 && _FL > 0) || (_HL > 0 && _FL > 0)>> | <</if>>
				<<if _HL > 0>>
					[["" + $activeHooved.speciesCap + ""|Pit][$pit.animalType = "hooved"]]
				<</if>>
				<<if (_HL > 0 && _FL > 0)>> | <</if>>
				<<if _FL > 0>>
					<<if $activeFeline.species != "cat">>
						[["" + $activeFeline.speciesCap + ""|Pit][$pit.animalType = "feline"]]
					<<else>>
						//House cats are too small to use your slave//
					<</if>>
				<</if>>
			<</if>>
		<</if>>
	<<else>>
		<<set $pit.animalType = 0>>
	<</if>>
	<</if>>
*/


code:
App.Data.Facilities.pit = {
	baseName: "pit",
	genericName: null,
	jobs: {
		fighter: {
			position: "fighter",
			assignment: Job.PIT, /* pseudo-assignment for assignmentTransition/assignJob/removeJob */
			publicSexUse: false,
			fuckdollAccepted: false,
			partTime: true
		}
	},
	defaultJob: "fighter",
	manager: null
};

App.Entity.Facilities.PitFighterJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (slave.breedingMark === 1 && V.propOutcome === 1 && V.eugenicsFullControl !== 1 && V.arcologies[0].FSRestart !== "unset") {
			r.push(`${slave.slaveName} may not participate in combat.`);
		}
		if (slave.indentureRestrictions > 1) {
			r.push(`${slave.slaveName}'s indenture forbids fighting.`);
		}
		if ((slave.indentureRestrictions > 0) && (this.facility.option("lethal"))) {
			r.push(`${slave.slaveName}'s indenture forbids lethal fights.`);
		}
		return r;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		if (this.isEmployed(slave)) {
			return [`${slave.slaveName} is already assigned to fight in ${this.facility.name}.`];
		}
		if (!this._facilityHasFreeSpace) {
			return [`Capacity of ${this.facility.name} exceeded.`];
		}

		return this.checkRequirements(slave);
	}
};

App.Entity.Facilities.Pit = class extends App.Entity.Facilities.SingleJobFacility {
	constructor() {
		super(App.Data.Facilities.pit,
			{
				fighter: new App.Entity.Facilities.PitFighterJob()
			});
	}

	get capacity() {
		return V.pit ? Number.MAX_VALUE : null;
	}

	/** @override */
	occupancyReport(long) {
		return `${this.hostedSlaves}${long ? ` ${this.job().desc.position}s` : ""}`;
	}
};

App.Entity.facilities.pit = new App.Entity.Facilities.Pit();

repo_name: Welptard/fc

license: mit


code:
App.Data.Facilities.schoolroom = {
	baseName: "schoolroom",
	genericName: null,
	jobs: {
		student: {
			position: "student",
			assignment: Job.SCHOOL,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "student",
	manager: {
		position: "schoolteacher",
		assignment: Job.TEACHER,
		careers: App.Data.misc.schoolteacherCareers,
		skill: "teacher",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: false,
		shouldHold: false,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.SchoolroomStudentJob = 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, -50, -20, -51)) {
			r.push(`${slave.slaveName} is too resistant to learn.`);
		}

		const maxSkill = 10 + this.facility.upgrade("Skills") * 20; // maximal skill value the school can teach
		if (((slave.intelligenceImplant >= 30 && V.schoolroomRemodelBimbo !== 1) || (slave.intelligenceImplant <= -15 && V.schoolroomRemodelBimbo === 1)) &&
			(slave.voice === 0 || slave.accent + this.facility.upgrade("Language") <= 2) &&
			(slave.skill.oral > maxSkill) && (slave.skill.whoring > maxSkill) && (slave.skill.entertainment > maxSkill) &&
			(slave.skill.anal > maxSkill) && ((slave.vagina < 0) || (slave.skill.vaginal > maxSkill)) &&
			((tutorForSlave(slave) === null) || (V.tutorGraduate.includes(slave.ID)))) {
			r.push(`${slave.slaveName} has nothing left to learn.`);
		}

		if (slave.fetish === "mindbroken") {
			r.push(`${slave.slaveName}'s mind is fundamentally broken and can't learn`);
		}

		return r;
	}

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

App.Entity.Facilities.Schoolroom = class extends App.Entity.Facilities.SingleJobFacility {
	constructor() {
		super(App.Data.Facilities.schoolroom, {
			student: new App.Entity.Facilities.SchoolroomStudentJob()
		});
	}

	/** Does the schoolroom decoration impart a language-learning bonus?
	 * @returns {boolean}
	 */
	revivalistLanguageDecorationBonus() {
		const decorationBonus = {
			"Latin": "Roman Revivalist",
			"Nahuatl": "Aztec Revivalist",
			"Ancient Egyptian": "Egyptian Revivalist",
			"Japanese": "Edo Revivalist",
			"Arabic": "Arabian Revivalist",
			"Chinese": "Chinese Revivalist"
		};
		const bonusDeco = decorationBonus[V.language];
		return bonusDeco && V.schoolroomDecoration === bonusDeco;
	}
};

App.Entity.facilities.schoolroom = new App.Entity.Facilities.Schoolroom();


code:
App.Data.Facilities.servantsQuarters = {
	baseName: "servantsQuarters",
	genericName: "Servants' Quarters",
	jobs: {
		servant: {
			position: "servant",
			assignment: Job.QUARTER,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "servant",
	manager: {
		position: "stewardess",
		assignment: Job.STEWARD,
		careers: App.Data.misc.stewardessCareers,
		skill: "stewardess",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.ServantsQuartersServantJob = 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, -50, 20, -21)) {
			r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
		}
		if (!canWalk(slave)) {
			r.push(`${slave.slaveName} can't walk and would be unable to properly clean.`);
		}
		if (!canSee(slave)) {
			r.push(`${slave.slaveName} is blind and would be unable to properly clean.`);
		}
		return r;
	}

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

App.Entity.Facilities.ServantsQuartersStewardessJob = class extends App.Entity.Facilities.ManagingJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (slave.intelligence + slave.intelligenceImplant < -50) {
			r.push(`${slave.slaveName} is not intelligent enough.`);
		}
		return r;
	}
};

App.Entity.facilities.servantsQuarters = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.servantsQuarters,
	{
		servant: new App.Entity.Facilities.ServantsQuartersServantJob()
	},
	new App.Entity.Facilities.ServantsQuartersStewardessJob()
);


code:
App.Data.Facilities.spa = {
	baseName: "spa",
	genericName: null,
	jobs: {
		assignee: {
			position: "bather",
			assignment: Job.SPA,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "assignee",
	manager: {
		position: "attendant",
		assignment: Job.ATTENDANT,
		careers: App.Data.misc.attendantCareers,
		skill: "attendant",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: false,
		shouldHear: true,
		shouldTalk: false,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.SpaAssigneeJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);

		if (
			slave.fetish !== "mindbroken" &&
			(
				slave.devotion < -20 ||
				(
					slave.health.tired <= 30 &&
					slave.trust > 60 &&
					slave.devotion > 60 &&
					slave.sexualFlaw === "none" &&
					slave.behavioralFlaw === "none"
				)
			)
		) {
			r.push(`${slave.slaveName} will not benefit from time at ${this.facility.name}.`);
		}

		return r;
	}
};

App.Entity.facilities.spa = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.spa,
	{
		assignee: new App.Entity.Facilities.SpaAssigneeJob()
	}
);


code:
table.stats {
	width: 100%;
	padding-left: 20px;
	padding-right: 20px;
}

table.stats > tr.header {
	border-bottom: 2px solid white;
}

table.stats > tr.total {
	border-top: 1px solid white;
}

table.stats > tr > th.narrow {
	width: 10em;
	text-align: right;
}

table.stats > tr > th.wide {
	width: 20em;
	text-align: right;
}

table.stats-slave {
	width: 100%;
	font-size: 90%;
	line-height: 110%;
}

table.stats-slave > tr {
	border-bottom: 1px solid #aaa;
	border-left: none;
	border-right: none;
	border-top: none
}

table.stats-slave > tr > th.narrow {
	width: 11em;
	text-align: right;
}

table.stats-slave > tr > th.wide {
	width: 22em;
	text-align: right;
}

td.value {
	padding-right: 3px;
	text-align: right;
}

.decimalZero {
	opacity: 0.3;
}


code:
App.Facilities.StatsHelper = class {
	/** Make a statistics table with given column labels
	 * @param {string[]} columns - Array of four labels for data columns.  The first is wider than the others (typically used for facility revenue).
	 * @returns {HTMLTableElement}
	 */
	makeStatsTable(columns) {
		const table = document.createElement("table");
		table.border = "1";
		table.className = "stats";
		const header = App.UI.DOM.appendNewElement("tr", table, "", "header");
		App.UI.DOM.appendNewElement("th", header, "Items"); // first column, flexible width
		App.UI.DOM.appendNewElement("th", header, columns[0], "wide"); // "revenue" column, wider
		for (let i = 1; i < 4; ++i) {
			App.UI.DOM.appendNewElement("th", header, columns[i], "narrow"); // three additional narrow columns
		}
		return table;
	}

	/** Adds a value row to a stats table, with the given label and value cells
	 * @param {HTMLTableElement} table
	 * @param {string|Node} label
	 * @param {HTMLTableCellElement[]} valueCells
	 * @param {boolean} [totals]
	 */
	addValueRow(table, label, valueCells, totals) {
		const row = App.UI.DOM.appendNewElement("tr", table, undefined, totals ? "total" : undefined);
		const labelCell = App.UI.DOM.appendNewElement("td", row, label);
		if (totals) {
			labelCell.style.fontWeight = "bold";
		}
		for (const cell of valueCells) {
			row.appendChild(cell);
		}
	}

	/** Makes a slave label
	 * @param {string} slaveName
	 * @param {string} customLabel
	 * @returns {Node}
	 */
	makeSlaveLabel(slaveName, customLabel) {
		if (!customLabel) {
			return document.createTextNode(slaveName);
		} else {
			const frag = document.createDocumentFragment();
			const label = App.UI.DOM.appendNewElement("span", frag, `(${customLabel}) `, "custom-label");
			frag.appendChild(label);
			frag.appendChild(document.createTextNode(slaveName));
			return frag;
		}
	}

	/** Makes a value cell
	 * @param {string} type - "reputation" or "cash"
	 * @param {number} value - numeric value
	 * @param {object} [flags]
	 * @param {boolean} [flags.forceNeg] - treat nonzero positive values as negative
	 * @param {boolean} [flags.showSign] - display the sign
	 * @param {boolean} [flags.showZero] - show the value, even if it's zero
	 * @param {boolean} [flags.bold] - style in bold
	 * @returns {HTMLTableCellElement}
	 */
	makeValueCell(type, value, flags = {}) {
		const cell = document.createElement("td");
		cell.classList.add("value");

		if (value !== 0 || flags.showZero) {
			// style appropriately
			if (value < 0 || flags.forceNeg) {
				cell.classList.add(type); // reputation or cash
				cell.classList.add("dec"); // loss
			} else if (value > 0) {
				cell.classList.add(type); // reputation or cash
				cell.classList.add("inc"); // gain
			}
			if (flags.bold) {
				cell.style.fontWeight = "bold";
			}

			// set contents
			let prefix = '';
			if (type === "cash") {
				prefix += '¤';
			}
			if (flags.showSign) {
				if (flags.forceNeg) { // if the real value is negative, - sign will come from value.toFixed
					prefix += '-';
				} else if (value > 0) {
					prefix += '+';
				} else if (value === 0) {
					prefix += '±';
				}
			}
			const fixedPrecision = type === "cash" ? 2 : 1;
			const parts = value.toFixed(fixedPrecision).split('.');
			cell.appendChild(document.createTextNode(prefix + parts[0]));
			App.UI.DOM.appendNewElement("span", cell, '.' + parts[1], /^0+$/.test(parts[1]) ? "decimalZero" : undefined);
		}

		return cell;
	}

	/** Make an empty cell (for parity)
	 * @returns {HTMLTableCellElement}
	 */
	makeEmptyCell() {
		return document.createElement("td");
	}

	/** Make the customer cell (for the facility-specific slave details column)
	 * @param {number} value
	 * @returns {HTMLTableCellElement}
	 */
	makeCustomersCell(value) {
		const cell = document.createElement("td");
		cell.classList.add("value");
		if (value <= 0) {
			cell.textContent = "none";
			cell.classList.add("red");
		} else {
			cell.textContent = value.toString();
		}
		return cell;
	}

	/** Make the production cell (for the facility-specific slave details column)
	 * @param {number} milk
	 * @param {number} cum
	 * @param {number} fluid
	 * @returns {HTMLTableCellElement}
	 */
	makeProductionCell(milk, cum, fluid) {
		const cell = document.createElement("td");
		cell.classList.add("value");
		if (milk || cum || fluid) {
			cell.textContent = `${milk}/${cum}/${fluid}`;
		} else {
			cell.textContent = `0/0/0`;
		}
		return cell;
	}

	/** Appends the slave stats row to the main stats table, and returns a reference to the slave stats table for later use.
	 * @param {HTMLTableElement} statsTable
	 * @param {string} caption
	 * @param {string[]} columns - six column labels - slave type, facility-specific output details column, wide column, then three narrow columns
	 * @returns {HTMLTableElement}
	 */
	makeSlaveStatsTable(statsTable, caption, columns) {
		const row = App.UI.DOM.appendNewElement("tr", statsTable);
		const bigCell = document.createElement("td");
		bigCell.colSpan = 5;
		const label = App.UI.DOM.appendNewElement("span", bigCell, caption);
		label.style.fontWeight = "bold";
		row.appendChild(bigCell);

		const table = document.createElement("table");
		table.className = "stats-slave";
		const header = App.UI.DOM.appendNewElement("tr", table, "", "header");
		App.UI.DOM.appendNewElement("th", header, columns[0]); // first column, flexible width
		App.UI.DOM.appendNewElement("th", header, columns[1], "narrow"); // facility-specific output details
		App.UI.DOM.appendNewElement("th", header, columns[2], "wide"); // "revenue" column, wider
		for (let i = 3; i < 6; ++i) {
			App.UI.DOM.appendNewElement("th", header, columns[i], "narrow"); // three additional narrow columns
		}
		bigCell.appendChild(table);
		statsTable.appendChild(bigCell);
		return table;
	}
};

App.Facilities.Brothel.Stats = (function() {
	const H = new App.Facilities.StatsHelper();
	const assureList = [ "whoreIncome", "rep", "whoreCosts", "adsIncome", "maintenance", "adsCosts", "totalIncome", "totalExpenses", "profit" ];

	/** Make the brothel slave revenue cell
	 * @param {number} revenue
	 * @param {number} adsIncome
	 * @returns {HTMLTableCellElement}
	 */
	function makeRevenueCell(revenue, adsIncome) {
		function printCash(value, cell) {
			const parts = value.toFixed(2).split('.');
			App.UI.DOM.appendNewElement("span", cell, '¤' + parts[0], ["cash", "inc"]);
			App.UI.DOM.appendNewElement("span", cell, '.' + parts[1], ["cash", "inc", "decimalPart"]);
		}
		const cell = document.createElement("td");
		cell.classList.add("value");
		printCash(revenue, cell);
		if (adsIncome > 0) {
			cell.appendChild(document.createTextNode(" ("));
			printCash(adsIncome, cell);
			cell.appendChild(document.createTextNode(" due to advertising)"));
		}
		return cell;
	}

	/** Generate the brothel statistics table
	 * @param {boolean} showDetails
	 * @returns {HTMLElement|DocumentFragment}
	 */
	function output(showDetails) {
		if (!V.showEconomicDetails) {
			return document.createDocumentFragment();
		} else if (!V.facility || !V.facility.brothel) {
			return App.UI.DOM.makeElement("h4", `- No statistics for ${V.brothelName} gathered this week -`);
		}

		const b = V.facility.brothel;
		for (const prop of assureList) {
			b[prop] = b[prop] || 0;
		}

		const stats = H.makeStatsTable(["Revenue", "Expenses", "Net Income", "Rep. Change"]);
		H.addValueRow(stats, "Total whoring income", [
			H.makeValueCell("cash", b.whoreIncome),
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreIncome),
			H.makeValueCell("reputation", b.rep, {showSign: true})
		]);
		H.addValueRow(stats, "Total whore living costs", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true}),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		if (showDetails) {
			const slaveStats = H.makeSlaveStatsTable(stats, "Whore details", ["Whore", "Customers", "Revenue", "Expenses", "Net Income", "Rep. Change"]);
			for (const record of b.income.values()) {
				const revenue = record.income + record.adsIncome;
				const netIncome = revenue - record.cost;
				H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [
					H.makeCustomersCell(record.customers),
					makeRevenueCell(revenue, record.adsIncome),
					H.makeValueCell("cash", record.cost, {forceNeg: true}),
					H.makeValueCell("cash", netIncome),
					H.makeValueCell("reputation", record.rep, {showSign: true})
				]);
			}
		}
		if (b.adsIncome > 0) {
			H.addValueRow(stats, "Additional income", [
				H.makeValueCell("cash", b.adsIncome),
				H.makeEmptyCell(),
				H.makeValueCell("cash", b.adsIncome),
				H.makeEmptyCell()
			]);
		}
		H.addValueRow(stats, "Brothel maintenance", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true}),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		if (b.adsCosts > 0) {
			H.addValueRow(stats, "Advertising program", [
				H.makeEmptyCell(),
				H.makeValueCell("cash", b.adsCosts, {forceNeg: true}),
				H.makeValueCell("cash", b.adsCosts, {forceNeg: true, showSign: true}),
				H.makeEmptyCell()
			]);
		}
		H.addValueRow(stats, "Total", [
			H.makeValueCell("cash", b.totalIncome),
			H.makeValueCell("cash", b.totalExpenses, {forceNeg: true}),
			H.makeValueCell("cash", b.profit, {bold: true}),
			H.makeValueCell("reputation", b.rep, {showSign: true, bold: true})
		], true);

		return stats;
	}

	return output;
})();

App.Facilities.Club.Stats = (function() {
	const H = new App.Facilities.StatsHelper();
	const assureList = [ "whoreIncome", "rep", "whoreCosts", "adsIncome", "maintenance", "adsCosts", "totalIncome", "totalExpenses", "profit" ];

	/** Make the slut efficiency cell
	 * @param {number} efficiency
	 * @param {boolean} [bold]
	 * @returns {HTMLTableCellElement}
	 */
	function makeEfficiencyCell(efficiency, bold) {
		const cell = document.createElement("td");
		cell.classList.add("value");
		if (bold) {
			cell.style.fontWeight = "bold";
		}
		const parts = efficiency.toFixed(2).split('.');
		const val = App.UI.DOM.appendNewElement("span", cell, parts[0], ["reputation", "inc"]);
		App.UI.DOM.appendNewElement("span", val, '.' + parts[1], /^0+$/.test(parts[1]) ? "decimalZero" : undefined);
		cell.appendChild(document.createTextNode(" rep/¤"));
		return cell;
	}

	/** Generate the Club statistics table
	 * @param {boolean} showDetails
	 * @returns {HTMLElement|DocumentFragment}
	 */
	function output(showDetails) {
		if (!V.showEconomicDetails) {
			return document.createDocumentFragment();
		} else if (!V.facility || !V.facility.club) {
			return App.UI.DOM.makeElement("h4", `- No statistics for ${V.clubName} gathered this week -`);
		}

		const b = V.facility.club;
		for (const prop of assureList) {
			b[prop] = b[prop] || 0;
		}

		const stats = H.makeStatsTable(["Rep. Gain", "Expenses", "Rep/Expenses", "Extra Income"]);
		H.addValueRow(stats, "Total slut rep gain", [
			H.makeValueCell("reputation", b.whoreIncome, {showSign: true}),
			H.makeEmptyCell(),
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.rep)
		]);
		H.addValueRow(stats, "Total slut living costs", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true}),
			H.makeEmptyCell(),
			H.makeEmptyCell()
		]);
		if (showDetails) {
			const slaveStats = H.makeSlaveStatsTable(stats, "Public slut details", ["Slut", "Customers", "Rep. Gain", "Expenses", "Rep/Expenses", "Extra Income"]);
			for (const record of b.income.values()) {
				const netIncome = record.income / record.cost;
				H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [
					H.makeCustomersCell(record.customers),
					H.makeValueCell("reputation", record.income, {showSign: true, showZero: true}),
					H.makeValueCell("cash", record.cost, {forceNeg: true}),
					makeEfficiencyCell(netIncome),
					H.makeValueCell("cash", record.rep, {showZero: true})
				]);
			}
		}
		if (b.adsIncome > 0) {
			H.addValueRow(stats, "Additional rep gain", [
				H.makeValueCell("reputation", b.adsIncome),
				H.makeEmptyCell(),
				H.makeEmptyCell(),
				H.makeEmptyCell()
			]);
		}
		H.addValueRow(stats, "Club maintenance", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true}),
			H.makeEmptyCell(),
			H.makeEmptyCell()
		]);
		if (b.adsCosts > 0) {
			H.addValueRow(stats, "Advertising program", [
				H.makeEmptyCell(),
				H.makeValueCell("cash", b.adsCosts, {forceNeg: true}),
				H.makeEmptyCell(),
				H.makeEmptyCell()
			]);
		}
		H.addValueRow(stats, "Total", [
			H.makeValueCell("reputation", b.totalIncome, {showSign: true}),
			H.makeValueCell("cash", b.totalExpenses, {forceNeg: true}),
			makeEfficiencyCell(b.profit, true),
			H.makeValueCell("cash", b.rep, {bold: true, showZero: true})
		], true);

		return stats;
	}

	return output;
})();

App.Facilities.Arcade.Stats = (function() {
	const H = new App.Facilities.StatsHelper();
	const assureList = [ "whoreIncome", "rep", "whoreCosts", "maintenance", "totalIncome", "totalExpenses", "profit" ];

	/** Generate the arcade statistics table
	 * @param {boolean} showDetails
	 * @returns {HTMLElement|DocumentFragment}
	 */
	function output(showDetails) {
		if (!V.showEconomicDetails) {
			return document.createDocumentFragment();
		} else if (!V.facility || !V.facility.arcade) {
			return App.UI.DOM.makeElement("h4", `- No statistics for ${V.arcadeName} gathered this week -`);
		}

		const b = V.facility.arcade;
		for (const prop of assureList) {
			b[prop] = b[prop] || 0;
		}

		const stats = H.makeStatsTable(["Revenue", "Expenses", "Net Income", "Rep. Change"]);
		H.addValueRow(stats, "Total arcade income", [
			H.makeValueCell("cash", b.whoreIncome),
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreIncome),
			H.makeValueCell("reputation", b.rep, {showSign: true})
		]);
		H.addValueRow(stats, "Total fuckmeat living costs", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true}),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		if (showDetails) {
			const slaveStats = H.makeSlaveStatsTable(stats, "Fuckmeat details", ["Fuckmeat", "Customers", "Revenue", "Expenses", "Net Income", "Rep. Change"]);
			for (const record of b.income.values()) {
				const revenue = record.income + record.adsIncome;
				const netIncome = revenue - record.cost;
				H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [
					H.makeCustomersCell(record.customers),
					H.makeValueCell("cash", revenue),
					H.makeValueCell("cash", record.cost, {forceNeg: true}),
					H.makeValueCell("cash", netIncome),
					H.makeValueCell("reputation", record.rep, {showSign: true})
				]);
			}
		}
		H.addValueRow(stats, "Arcade maintenance", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true}),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		H.addValueRow(stats, "Total", [
			H.makeValueCell("cash", b.totalIncome),
			H.makeValueCell("cash", b.totalExpenses, {forceNeg: true}),
			H.makeValueCell("cash", b.profit, {bold: true}),
			H.makeValueCell("reputation", b.rep, {showSign: true, bold: true})
		], true);

		return stats;
	}

	return output;
})();

App.Facilities.Dairy.Stats = (function() {
	const H = new App.Facilities.StatsHelper();
	const assureList = [ "whoreIncome", "whoreCosts", "maintenance", "totalIncome", "totalExpenses", "profit" ];

	/** Generate the arcade statistics table
	 * @param {boolean} showDetails
	 * @returns {HTMLElement|DocumentFragment}
	 */
	function output(showDetails) {
		if (!V.showEconomicDetails) {
			return document.createDocumentFragment();
		} else if (!V.facility || !V.facility.dairy) {
			return App.UI.DOM.makeElement("h4", `- No statistics for ${V.dairyName} gathered this week -`);
		}

		const b = V.facility.dairy;
		for (const prop of assureList) {
			b[prop] = b[prop] || 0;
		}

		const stats = H.makeStatsTable(["Revenue", "Expenses", "Net Income", "Rep. Change"]);
		H.addValueRow(stats, "Total cow income", [
			H.makeValueCell("cash", b.whoreIncome),
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreIncome),
			H.makeEmptyCell(),
		]);
		H.addValueRow(stats, "Total cow living costs", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true}),
			H.makeValueCell("cash", b.whoreCosts, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		if (showDetails) {
			const slaveStats = H.makeSlaveStatsTable(stats, "Cow details", ["Cow", "Milk/Cum/Fluids", "Revenue", "Expenses", "Net Income", "Rep. Change"]);
			for (const record of b.income.values()) {
				const netIncome = record.income - record.cost;
				H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [
					H.makeProductionCell(record.milk, record.cum, record.fluid),
					H.makeValueCell("cash", record.income),
					H.makeValueCell("cash", record.cost, {forceNeg: true}),
					H.makeValueCell("cash", netIncome),
					H.makeEmptyCell()
				]);
			}
		}
		H.addValueRow(stats, "Dairy maintenance", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true}),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		H.addValueRow(stats, "Total", [
			H.makeValueCell("cash", b.totalIncome),
			H.makeValueCell("cash", b.totalExpenses, {forceNeg: true}),
			H.makeValueCell("cash", b.profit, {bold: true}),
			H.makeEmptyCell()
		], true);

		return stats;
	}

	return output;
})();

App.Facilities.Farmyard.Stats = (function() {
	const H = new App.Facilities.StatsHelper();
	const assureList = [ "farmhandIncome", "farmhandCosts", "maintenance", "totalIncome", "totalExpenses", "food", "profit" ];

	/** Generate the Farmyard statistics table
	 * @param {boolean} showDetails
	 * @returns {HTMLElement|DocumentFragment}
	 */
	function output(showDetails) {
		if (!V.showEconomicDetails) {
			return document.createDocumentFragment();
		} else if (!V.facility || !V.facility.farmyard) {
			return App.UI.DOM.makeElement("h4", `- No statistics for ${V.farmyardName} gathered this week -`);
		}

		const b = V.facility.farmyard;
		for (const prop of assureList) {
			b[prop] = b[prop] || 0;
		}

		const stats = H.makeStatsTable(["Revenue", "Expenses", "Net Income", "Rep. Change"]);
		H.addValueRow(stats, "Total farmhand income", [
			H.makeValueCell("cash", b.farmhandIncome),
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.farmhandIncome),
			H.makeEmptyCell(),
		]);
		H.addValueRow(stats, "Total farmhand living costs", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.farmhandCosts, {forceNeg: true}),
			H.makeValueCell("cash", b.farmhandCosts, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		if (showDetails) {
			const slaveStats = H.makeSlaveStatsTable(stats, "Farmhand details", ["Farmhand", "Milk/Cum/Fluids", "Revenue", "Expenses", "Net Income", "Rep. Change"]);
			for (const record of b.income.values()) {
				const netIncome = record.income - record.cost;
				H.addValueRow(slaveStats, H.makeSlaveLabel(record.slaveName, record.customLabel), [
					H.makeProductionCell(record.milk, record.cum, record.fluid),
					H.makeValueCell("cash", record.income),
					H.makeValueCell("cash", record.cost, {forceNeg: true}),
					H.makeValueCell("cash", netIncome),
					H.makeEmptyCell()
				]);
			}
		}
		H.addValueRow(stats, "Farmyard maintenance", [
			H.makeEmptyCell(),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true}),
			H.makeValueCell("cash", b.maintenance, {forceNeg: true, showSign: true}),
			H.makeEmptyCell()
		]);
		H.addValueRow(stats, "Total", [
			H.makeValueCell("cash", b.totalIncome),
			H.makeValueCell("cash", b.totalExpenses, {forceNeg: true}),
			H.makeValueCell("cash", b.profit, {bold: true}),
			H.makeEmptyCell()
		], true);

		return stats;
	}

	return output;
})();


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

<<set $nextButton = "Back", $nextLink = "Manage Penthouse">>

<<includeDOM App.UI.WardrobeShopping("FS")>>


code:
.wardrobe-shopping-block {
    display: flex;
    flex-wrap: wrap;
}

.wardrobe-shopping-cell {
    display: inline-block;
    width: 20em;
	border: 1px solid var(--button-border-color);
}

.wardrobe-shopping-cell:hover { background: var(--button-hover-color) }


code:
App.UI.WardrobeShopping = function() {
	const el = document.createElement("p");
	let p;
	el.id = "wardrobe-shopping";

	App.UI.DOM.appendNewElement("h1", el, `Slave Wardrobe`);

	let r = [];
	r.push(`The room containing all the clothes and accessories you have available to dress your slaves in, as well as the supplies and tools your tailor needs to resize them to better fit your slaves. Several mirrors are set up for a slave to try on outfits should they be allowed to dress themselves. The selection includes`);
	const ownItAll = (
		App.Data.slaveWear.niceClothes.every((i) => isItemAccessible.entry(i.value, "clothing")) &&
		App.Data.slaveWear.harshClothes.every((i) => isItemAccessible.entry(i.value, "clothing"))
	);
	if (ownItAll) {
		r.push(`outfits from all manner of cultures and societies; not a single style eludes you.`);
	} else {
		r.push(`many styles of clothing ranging from exciting to mundane and sexy to practical.`);
	}
	if (V.boughtItem.shoes.heels === 1) {
		r.push(`A large variety of shoes are available to select from.`);
	}
	if (V.boughtItem.clothing.dildos === 1 && V.boughtItem.toys.gags === 1 && V.boughtItem.clothing.buttPlugs === 1) {
		r.push(`Sex toys of all kinds and shapes line the shelves.`);
	} else if (V.boughtItem.clothing.dildos === 1 || V.boughtItem.toys.gags === 1 || V.boughtItem.clothing.buttPlugs === 1 || V.boughtItem.clothing.buttPlugTails === 1 || V.boughtItem.clothing.vaginalAttachments === 1) {
		r.push(`Some sex toys line the shelves.`);
	}
	if (V.boughtItem.toys.buckets === 1) {
		r.push(`Several buckets of various sizes and a sturdy cup have been set aside for you in feeding slaves to their limit.`);
	}
	if (V.boughtItem.toys.enema === 1) {
		r.push(`A number of drums of specially formulated water for use in enemas line one of the walls.`);
	}
	if (V.boughtItem.toys.medicalEnema === 1) {
		r.push(`Alongside them, multiple drums of mixtures for use in medical enemas.`);
	}
	App.UI.DOM.appendNewElement("p", el, r.join(" "), "scene-intro");

	App.UI.DOM.appendNewElement("h2", el, `Future Society styles`);

	el.append(categoryBlock("FS"));

	App.UI.DOM.appendNewElement("h2", el, `Future Society Revivalist styles`);

	el.append(categoryBlock("FSrevivalist"));

	App.UI.DOM.appendNewElement("h2", el, `Other`);

	el.append(categoryBlock("other"));

	App.UI.DOM.appendNewElement("h2", el, `Accessories`);

	p = document.createElement("p");
	p.id = "accessory-block";
	p.append(accessoryBlock());
	el.append(p);

	return el;

	/**
	 *
	 * @param {*} category FS, FSrevivalist, or "other"
	 */

	function categoryBlock(category) {
		const data = App.Data.WardrobeShopping.Clothing[category];
		const model = (V.seeDicks === 100) ? GenerateNewSlave("XY") : GenerateNewSlave("XX");

		const el = document.createElement("p");
		el.classList.add("wardrobe-shopping-block");
		el.id = `id${category}`;
		Object.keys(data).forEach(
			(clothing) => {
				const cell = document.createElement("span");
				cell.id = clothing;
				cell.append(createCell(clothing));
				el.append(cell);
			});
		return el;

		/**
		 * Create individual cell for a piece of clothing, including the display model
		 * @param {string} clothing
		 * @param {string} oldOutfit The outfit last worn by the slave. This means that on cycling outfits, we won't immediately repeat
		 */
		function createCell(clothing, oldOutfit = "") {
			const el = document.createElement("div");
			el.classList.add("wardrobe-shopping-cell");
			el.onclick = () => {
				// Randomize devotion and trust a bit, so the model moves their arms and "poses" for the player.
				model.devotion = random(-10, 70);
				model.trust = random(30, 100);
				jQuery(`#${clothing}`).empty().append(createCell(clothing, model.clothes));
			};
			/** @type {wardrobeItem} */
			const clothingObj = App.Data.WardrobeShopping.Clothing[category][clothing];
			const cost = Math.trunc(clothingObj.cost * V.upgradeMultiplierTrade);
			let div;

			// If we have more than one possible outfit to showcase, make sure not to show the outfit we did last time.
			const clothesArray = clothingObj.contains.length > 1 ? clothingObj.contains.filter(item => item !== oldOutfit) : clothingObj.contains;

			// Get a randomly chosen piece of clothing from the set to display
			// This piece will also later be checked to see if we can purchase it or not.
			model.clothes = clothesArray[Math.floor(Math.random() * clothesArray.length)];

			if (V.seeImages === 1) {
				// Some clothing is weird (looking at you, Egyptian necklace)
				if (clothingObj.hasOwnProperty("modelUpdate")) {
					Object.assign(model, clothingObj.modelUpdate);
				}

				App.UI.DOM.appendNewElement("div", el, App.Art.SlaveArtElement(model, 1, 0), ["imageRef", "smlImg"]);

				// Clean up our model. Fuck you, Egypt.
				if (clothingObj.hasOwnProperty("modelUpdate")) {
					for (const prop in clothingObj.modelUpdate) {
						model[prop] = "none";
					}
				}
			}
			if (clothing !== "egypt" && !isItemAccessible.entry(model.clothes, "clothing") ||
				(clothing === "egypt" && !isItemAccessible.entry("ancient Egyptian", "collar")) // Fuck Egypt
			) {
				if (cost < V.cash) {
					App.UI.DOM.appendNewElement(
						"div",
						el,
						App.UI.DOM.link(
							`Order ${clothingObj.title}`,
							() => {
								if (cost < V.cash) { // Check again on click in case the link has become stale
									cashX(forceNeg(cost), "capEx");
									V.boughtItem.clothing[clothing] = 1;
								}
							}
						)
					);
					App.UI.DOM.appendNewElement("div", el, ` Costs ¤${cost}`, "detail");
				} else {
					div = App.UI.DOM.disabledLink(
						`Order ${clothingObj.title}`,
						[`Cannot afford ¤${cost}`]
					);
					div.style.display = "inline"; // Fixes disabledLink
					el.append(div);
					App.UI.DOM.appendNewElement("div", el, `Costs ¤${cost}`, ["red", "detail"]);
				}
			} else {
				App.UI.DOM.appendNewElement("div", el, clothingObj.owned);
			}

			return el;
		}
	}

	function accessoryBlock() {
		const el = document.createElement("p");

		for (const name in App.Data.WardrobeShopping.Accessories) {
			el.append(createLine(name));
		}
		return el;

		function createLine(name) {
			const line = document.createElement("div");
			const purchased = _.get(V.boughtItem, name);
			const obj = (App.Data.WardrobeShopping.Accessories[name]);
			const cost = Math.trunc(obj.cost * V.upgradeMultiplierTrade);
			let div = document.createElement("div");

			if (purchased !== 0 && purchased !== 1) {
				throw `${name} set incorrectly or not found`;
			}

			if (obj.hasOwnProperty("requirements") && obj.requirements !== true) {
				return line;
			}

			if (!purchased) {
				if (cost < V.cash) {
					div.append(
						App.UI.DOM.link(
							`Order ${obj.title}`,
							() => {
								if (cost < V.cash) { // Check again on click in case the link has become stale
									cashX(forceNeg(cost), "capEx");
									_.set(V.boughtItem, name, 1);
								}
								jQuery(`#accessory-block`).empty().append(accessoryBlock());
							}
						)
					);
					if (cost > 0) {
						App.UI.DOM.appendNewElement("span", div, ` Costs ¤${cost}`, "detail");
					}
				} else {
					div.append(
						App.UI.DOM.disabledLink(
							`Order ${obj.title}`,
							[`Cannot afford ¤${cost}`]
						)
					);
					App.UI.DOM.appendNewElement("span", div, ` Costs ¤${cost}`, ["red", "detail"]);
				}
				if (obj.hasOwnProperty("note")) {
					App.UI.DOM.appendNewElement("span", div, ` ${obj.note}`, "note");
				}
			} else {
				div.append(obj.owned);
			}
			line.append(div);

			return line;
		}
	}
};


code:
App.Data.WardrobeShopping = {};

App.Data.WardrobeShopping.Clothing = {
	/**
	 * @typedef {object} wardrobeItem
	 * @property {string} title
	 * @property {number} cost
	 * @property {string} [note] italicize note about a purchase
	 * @property {string[]} contains
	 * @property {string} owned
	 * @property {object} [modelUpdate]
	 * @property {boolean} [requirements] requirements met
	 */

	/**
	 *  @type {Object.<string, wardrobeItem>} String will be the property checked to see if the item is owned.  So for "bunny", it will check V.boughtItem.clothing["bunny"].
	 */
	FS: {
		"bunny": {
			title: "a shipment of bunny suits",
			cost: 7500,
			contains: ["a bunny outfit"],
			owned: "You are well stocked with classic bunny suits and bowties.",
		},
		"conservative": {
			title: "a shipment of conservative clothes",
			cost: 7500,
			contains: ["conservative clothing"],
			owned: "You are well stocked with modest outfits.",
		},
		"bimbo": {
			title: "a shipment of outfits suitable for bimbos",
			cost: 7500,
			contains: ["a bimbo outfit"],
			owned: "You are well stocked with bimbo attire.",
		},
		"courtesan": {
			title: "a shipment of courtesan dresses",
			cost: 7500,
			contains: ["a courtesan dress"],
			owned: "You are well stocked with courtesan dresses.",
		},
		"chains": {
			title: "a shipment of chains",
			cost: 7500,
			contains: ["chains"],
			owned: "You are well stocked with various lengths of binding chains.",
		},
		"western": {
			title: "a shipment of western outfits",
			cost: 7500,
			contains: ["Western clothing"],
			owned: "You are well stocked with cowgirl outfits.",
		},
		"oil": {
			title: "a shipment of body oil",
			cost: 7500,
			contains: ["body oil"],
			owned: "You are well stocked with various body oils.",
		},
		"lazyClothes": {
			title: "a shipment of comfortable, rather stretchy, clothes",
			cost: 7500,
			contains: ["stretch pants and a crop-top"],
			owned: "You are well stocked with various comfy pants and rather tight crop-tops.",
		},
		"habit": {
			title: "a shipment of chattel habits",
			cost: 7500,
			contains: ["a chattel habit"],
			owned: "You are well stocked with habits from the chattel religion.",
		},
		"maternityDress": {
			title: "a shipment of maternity dresses",
			cost: 7500,
			contains: ["a maternity dress"],
			owned: "You are well stocked with dresses specially tailored for pregnant women.",
		},
		"maternityLingerie": {
			title: "a shipment of maternity lingerie",
			cost: 7500,
			contains: ["attractive lingerie for a pregnant woman"],
			owned: "You are well stocked with sexy silken lingerie designed for pregnant women.",
		},
	},
	FSrevivalist: {
		"egypt": {
			title: "a shipment of Egyptian necklaces",
			cost: 7500,
			contains: ["no clothing"],
			owned: "You are well stocked with ancient Egyptian necklaces.",
			modelUpdate: {collar: "ancient Egyptian"}
		},
		"toga": {
			title: "a shipment of togas and stolas",
			cost: 7500,
			contains: ["a toga"],
			owned: "You are well stocked with fine roman-styled togas and stolas.",
		},
		"huipil": {
			title: "a shipment of huipil",
			cost: 7500,
			contains: ["a huipil"],
			owned: "You are well stocked with exquisite Aztec huipils.",
		},
		"kimono": {
			title: "a shipment of kimonos",
			cost: 7500,
			contains: ["a kimono"],
			owned: "You are well stocked with elegant Japanese kimonos.",
		},
		"harem": {
			title: "a shipment of harem outfits",
			cost: 7500,
			contains: ["harem gauze"],
			owned: "You are well stocked with Arabic harem garb made from the finest available silks.",
		},
		"qipao": {
			title: "a shipment of qipaos",
			cost: 7500,
			contains: ["a slutty qipao"],
			owned: "You are well stocked with slutty Chinese qipaos.",
		},
		"imperialarmor": {
			title: "a shipment of bulky Imperial armor",
			cost: 12500,
			contains: ["Imperial Plate"],
			owned: "You are well stocked with spare sets of bulky powered armor of the same kind worn by your Imperial Knights.",
		},
		"imperialsuit": {
			title: "a shipment of tight Imperial bodysuits",
			cost: 7500,
			contains: ["a tight Imperial bodysuit"],
			owned: "You are well stocked with tight-fitting cybernetic bodysuits clearly bearing your family crest.",
		},
	},
	other: {
		"military": {
			title: "a shipment of military themed clothing",
			cost: 5000,
			contains: ["a military uniform", "a red army uniform", "battlearmor", "battledress"],
			owned: "You are well stocked with a variety of military themed garb.",
		},
		"cultural": {
			title: "a shipment of cultural outfits",
			cost: 15000,
			contains: ["a biyelgee costume", "a dirndl", "a hanbok", "a mounty outfit", "lederhosen"],
			owned: "You are well stocked with a variety of signature outfits from a variety of countries.",
		},
		"middleEastern": {
			title: "a shipment of burqas and similar garb",
			cost: 5000,
			contains: ["a burqa", "a niqab and abaya"],
			owned: "You are well stocked with a number of burqas and similar clothing.",
		},
		"casual": {
			title: "an extra large shipment of casual clothing",
			cost: 5000,
			contains: ["a button-up shirt and panties", "a button-up shirt", "a sweater and cutoffs", "a sweater and panties", "a sweater", "a t-shirt and jeans", "a t-shirt and panties", "a t-shirt", "a tank-top and panties", "a tank-top", "a tube top", "an oversized t-shirt", "cutoffs", "jeans", "leather pants and a tube top", "leather pants"],
			owned: "You are well stocked with casual clothing.",
		},
		"career": {
			title: "a shipment of professional garments",
			cost: 2500,
			contains: ["a nice nurse outfit", "a police uniform", "nice business attire"],
			owned: "You are well stocked with a selection of professional outfits.",
		},
		"dresses": {
			title: "a shipment of professionally tailored dresses",
			cost: 15000,
			contains: ["a ball gown", "a gothic lolita dress"],
			owned: "You are well stocked with a selection of fine dresses.",
		},
		"bodysuits": {
			title: "a shipment of exotic bodysuits",
			cost: 7500,
			contains: ["a cybersuit", "a latex catsuit"],
			owned: "You are well stocked with a selection of bodysuits.",
		},
		"underwear": {
			title: "a shipment of undergarments",
			cost: 5000,
			contains: ["a bra", "a skimpy loincloth", "a thong", "boyshorts", "kitty lingerie", "panties and pasties", "pasties"],
			owned: "You are well stocked with underwear.",
		},
		"sports": {
			title: "a shipment of exercise wear",
			cost: 2500,
			contains: ["a sports bra", "sport shorts and a sports bra", "sport shorts"],
			owned: "You are well stocked with exercise wear.",
		},
		"swimwear": {
			title: "a shipment of swimwear",
			cost: 3500,
			contains: ["a monokini", "a one-piece swimsuit"],
			owned: "You are well stocked with swimwear.",
		},
		"pony": {
			title: "a shipment of specialized latex ponygirl outfits",
			cost: 10000,
			contains: ["a nice pony outfit", "a slutty pony outfit"],
			owned: "You are well stocked with ponygirl bodysuits.",
		},
		"pol": {
			title: "a shipment of politically incorrect clothing",
			cost: 15000,
			contains: ["a klan robe", "a schutzstaffel uniform", "a slutty klan robe", "a slutty schutzstaffel uniform"],
			owned: "You are well stocked with a selection of outfits once considered distasteful.",
		},
		"costume": {
			title: "a shipment of colorful and revealing costumes",
			cost: 15000,
			contains: ["a Santa dress"],
			owned: "You are well stocked with a variety of costume party supplies.",
		},
		"pantsu": {
			title: "a large crate of panties from Japan",
			cost: 2500,
			contains: ["a striped bra", "striped panties", "striped underwear"],
			owned: "You have an impressive stash of panties and other striped underwear that may or may not be have at one point been used.",
		},
	}
};
/**
 *  @type {Object.<string, wardrobeItem>} String will be the property checked to see if the item is owned.  So for "bunny", it will check V.boughtItem.clothing["bunny"].
 */
App.Data.WardrobeShopping.Accessories = {
	"shoes.heels": {
		title: "a shipment of platform shoes",
		cost: 7500,
		contains: ["platform heels"],
		owned: "You have shelves dedicated to your collection of platform shoes.",
	},
	"clothing.belly": {
		title: "a shipment of fake pregnancy bellies",
		cost: 15000,
		contains: ["a small empathy belly"],
		owned: "You are well stocked with silicone pregnancy bellies modeled after variously sized women.",
	},
	"toys.dildos": {
		title: "a shipment of extra long dildos and bullet vibes",
		cost: 10000,
		contains: ["long dildo"],
		owned: "You are well stocked with extra long dildos in a variety of sizes, as well as a good amount of bullet vibrators.",
	},
	"toys.smartVibes": {
		title: `the "smart" variant of the bullet vibrators`,
		cost: 5000,
		contains: ["long dildo"],
		get requirements() { return V.boughtItem.toys.dildos !== 0; },
		owned: `Some of the bullet vibes are of the "smart" variety, interfaced to the arcology's systems.`,
	},
	"toys.vaginalAttachments": {
		title: "a shipment of vibrating dildo attachments",
		cost: 10000,
		contains: [],
		owned: "You are well stocked with attachments that allow dildos to vibrate.",
	},
	"toys.smartVaginalAttachments": {
		title: `the "smart" variant of the vibrating dildo attachments`,
		cost: 5000,
		contains: [],
		get requirements() { return V.boughtItem.toys.vaginalAttachments !== 0; },
		owned: `Some of the vibrating dildo attachments are of the "smart" variety, interfaced to the arcology's systems.`,
	},
	"toys.buttPlugs": {
		title: "a shipment of extra long buttplugs",
		cost: 10000,
		contains: [],
		owned: "You are well stocked with extra long buttplugs in a variety of sizes.",
	},
	"toys.buttPlugTails": {
		title: "a shipment of attachable tails",
		cost: 5000,
		contains: [],
		owned: "You are well stocked with tails to attach to your buttplugs.",
	},
	"toys.gags": {
		title: "a shipment of massive dildo gags",
		cost: 5000,
		contains: [],
		owned: "You are well stocked with massive dildo gags.",
	},
	"toys.buckets": {
		title: "everything you need to force-feed slaves",
		note: `Some supplies from the cafeteria and a slight adjustment to the feeder settings is all it would take.`,
		cost: 0,
		contains: [],
		owned: "You have everything you need in one place to force-feed slaves. You've also adjusted the feeders to cheaply produce filler food to save on money. However, said food is just empty calories and probably bad for a slave's waistline.",
	},
	"toys.enema": {
		title: "enema supplies",
		cost: 5000,
		contains: [],
		owned: "You are well stocked with specially formulated liquids to be used safely for long term enemas along with the tools needed to keep a slave bloated for extended periods of time",
	},
	"toys.medicalEnema": {
		title: `medical enema supplies`,
		cost: 5000,
		contains: [],
		get requirements() { return (V.boughtItem.toys.enema !== 0); },
		owned: "You are also well stocked with drugs to be mixed with the enema water for use in medical enemas.",
	},
};


code:
.encyclopedia.topic {
	font-weight: bold;
}


code:
App.Encyclopedia.Dialog = (function() {
	/** Create a link to an encyclopedia dialog for a given article with the given text
	 * @param {string} text Text for link
	 * @param {string} article Encyclopedia article to link to
	 * @returns {string} SugarCube link markup
	 */
	function makeLinkSC(text, article) {
		return App.UI.link(text, () => showArticleInDialog(article));
	}

	/** Create a link to an encyclopedia dialog for a given article with the given text
	 * @param {string} text Text for link
	 * @param {string} article Encyclopedia article to link to
	 * @returns {HTMLElement} DOM link element
	 */
	function makeLinkDOM(text, article) {
		return App.UI.DOM.link(text, () => showArticleInDialog(article));
	}

	/** Show a given encyclopedia article in the encyclopedia dialog
	 * @param {string} article
	 */
	function showArticleInDialog(article) {
		let origEncyclopedia = V.encyclopedia;
		if (Dialog.isOpen()) {
			Dialog.close();
		}
		Dialog.setup("Encyclopedia", "encyclopedia");
		V.encyclopedia = article;
		$(Dialog.body()).empty().wiki(jsInclude("Encyclopedia"));
		Dialog.open();
		V.encyclopedia = origEncyclopedia;
	}

	return {
		linkSC: makeLinkSC,
		linkDOM: makeLinkDOM
	};
})();


code:
/* TODO: add entries for Nursery */

App.Encyclopedia.Entries = (function() {
	/**
	 * @param {string} topic
	 * @returns {HTMLElement}
	 */
	function topic(topic) {
		return App.UI.DOM.makeElement("span", topic, ["encyclopedia", "topic"]);
	}

	/**
	 * @param {string} linkText
	 * @param {string} topic
	 * @returns {HTMLElement}
	 */
	function encyLink(linkText, topic) {
		return App.Encyclopedia.Dialog.linkDOM(linkText, topic);
	}

	const entries = {};

	entries.attendingClasses = () =>
		App.UI.DOM.combineNodes(topic("Attending classes"),
			" is an assignment which educates the slave, raising intelligence if possible. Being educated raises value and is useful for some jobs and leadership positions.");

	entries.confinement = () =>
		App.UI.DOM.combineNodes(topic("Confinement"),
			" is an assignment which accelerates breaking for disobedient slaves. If a slave isn't obedient enough to work and isn't ",
			encyLink("unhealthy", "Health"), " enough to need rest, this will make them useful sooner.");

	entries.fucktoy = () =>
		App.UI.DOM.combineNodes(topic("Fucktoy service"),
			" is an assignment which keeps the slave close and under the player's eye. It's mostly just for fun, but fucktoys can improve reputation based on their beauty, and the player character's attention can be targeted to areas of the slave's body with possible fetish effects on happy slaves.");

	entries.gloryHole = () =>
		App.UI.DOM.combineNodes(topic("Occupying a glory hole"),
			" is an assignment which makes money off of slaves regardless of their beauty, skills, or feelings; it's not fun or ",
			encyLink("healthy", "Health"), " but very powerful for extracting ¤ out of otherwise useless slaves.");

	entries.milking = () => {
		const fragment = document.createDocumentFragment();

		fragment.append(topic("Getting milked"),
			" is an assignment which makes money from lactation based on a slave's breasts, ", encyLink("health", "Health"),
			" and hormonal status.");
		if (V.seeDicks > 0) {
			fragment.append(" Cows with balls will also give semen.");
		}
		fragment.append(` Creates profit quickly from slaves with big tits${V.seeDicks ? " or balls" : ""}.`);

		return fragment;
	};

	entries.farming = function() {
		const fragment = document.createDocumentFragment();
		fragment.append(topic("Farming"), " is an assignment which produces ", encyLink("food", "Food"),
			" from your slaves' hard work");
		if (V.seeBestiality) {
			fragment.append(" and allows you to breed slaves with animals");
		}
		fragment.append(". Can also reduce arcology upkeep with upgrades in the ",
			encyLink("Farmyard", "Farmyard"));
		return fragment;
	};

	entries.publicService = () =>
		App.UI.DOM.combineNodes(topic("Public Service"),
			" is an assignment which increases reputation based on a slave's beauty, sexual appeal, and skills. Very similar to whoring, but for reputation rather than money.");

	entries.rest = () =>
		App.UI.DOM.combineNodes(topic("Rest"), " is an assignment mostly used to improve ", encyLink("health", "Health"),
			". It can be useful to order slaves you wish to intensively modify to rest, since most modifications damage health. It will synergize with curative treatments, providing bonus healing when both are simultaneously applied.");

	entries.sexualServitude = () =>
		App.UI.DOM.combineNodes(topic("Sexual servitude"),
			" is an assignment which pleases other slaves by forcing the slave to service them sexually. Useful for driving the targeted slave's ",
			encyLink("devotion", "Devotion"), " up quickly.");

	entries.servitude = () =>
		App.UI.DOM.combineNodes(topic("Servitude"), " is an assignment which reduces your upkeep based on the slave's ",
			encyLink("devotion", "Devotion"),
			" Available at lower obedience than other jobs, is insensitive to the quality of a slave's body, and doesn't require skills; a good transitional assignment. Unusually, low sex drive is advantageous as a servant, since it reduces distraction. Lactating slaves are slightly better at this job, since they can contribute to their fellow slaves' nutrition.");

	entries.whoring = () =>
		App.UI.DOM.combineNodes(topic("Whoring"), " is an assignment which makes money based on a slave's beauty, sexual appeal, and skills. Good whores take a long time to train and beautify but become very profitable.");

	return entries;
})();


code:
:: Related Links [nobr]

/* pages asking the player to click a link for more information have no section heading */
<<if !["Being in Charge", "Body", "Fetishes", "Game Mods", "Inflation", "Leadership Positions", "Lolimod", "Lore", "Obtaining Slaves", "Paraphilias", "Playing Free Cities", "Skills", "Slave Assignments", "Slave Modification", "Slaves", "Terrain Types", "The X-Series Arcology"].includes($encyclopedia)>>

Related Links

<</if>>

<<switch $encyclopedia>>

/**********
PLAYING FREE CITIES
**********/
<<case "Design Your Master" "First Game Guide" "How to Play" "Keyboard Shortcuts" "Playing Free Cities" "The Arcology Interface" "Tips and Tricks">>
	<<= App.Encyclopedia.Dialog.linkSC("First Game Guide", "First Game Guide")>>
	| <<= App.Encyclopedia.Dialog.linkSC("How to Play", "How to Play")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Keyboard Shortcuts", "Keyboard Shortcuts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Arcology Interface", "The Arcology Interface")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Tips and Tricks", "Tips and Tricks")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Design Your Master", "Design Your Master")>>

/**********
BEING IN CHARGE
**********/
<<case "Arcologies and Reputation" "Being in Charge" "Costs Summary" "PC Skills" "Random Events" "Rules Assistant" "Sexual Energy" "The Corporation">>
	<<= App.Encyclopedia.Dialog.linkSC("Arcologies and Reputation", "Arcologies and Reputation")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Random Events", "Random Events")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Costs Summary", "Costs Summary")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Rules Assistant", "Rules Assistant")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Corporation", "The Corporation")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Sexual Energy", "Sexual Energy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("PC Skills", "PC Skills")>>

/**********
SLAVES
**********/
<<case "Demand for Sex" "Devotion" "Drugs and Their Effects" "Enslaving People" "From Rebellious to Devoted" "Fuckdolls" "Gender" "Health" "Indentured Servants" "Lingua Franca" "Living Conditions" "Menial Slaves" "Nymphomania" "Slave Score (Attractiveness)" "Slave Score (Sexual)" "Slaves" "Trust">>
	<<= App.Encyclopedia.Dialog.linkSC("Enslaving People", "Enslaving People")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Living Conditions", "Living Conditions")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Health", "Health")>>
	| @@.hotpink;<<= App.Encyclopedia.Dialog.linkSC("Devotion", "From Rebellious to Devoted")>>@@
	| @@.mediumaquamarine;<<= App.Encyclopedia.Dialog.linkSC("Trust", "Trust")>>@@
	| <<= App.Encyclopedia.Dialog.linkSC("Drugs and Their Effects", "Drugs and Their Effects")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gender", "Gender")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Nymphomania", "Nymphomania")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Indentured Servants", "Indentured Servants")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Menial Slaves", "Menial Slaves")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fuckdolls", "Fuckdolls")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Lingua Franca", "Lingua Franca")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Score (Attractiveness)", "Slave Score (Attractiveness)")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Score (Sexual)", "Slave Score (Sexual)")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Demand for Sex", "Demand for Sex")>>

/**********
OBTAINING SLAVES
**********/
<<case "Direct Sales" "Household Liquidations" "Kidnapped Slaves" "Obtaining Slaves" "Pre-Owned Slaves" "Slave Schools" "Stables" "The Flesh Heap" "The Job Fulfillment Center">>
	<<= App.Encyclopedia.Dialog.linkSC("Kidnapped Slaves", "Kidnapped Slaves")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Schools", "Slave Schools")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Stables", "Stables")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Household Liquidations", "Household Liquidations")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Direct Sales", "Direct Sales")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pre-Owned Slaves", "Pre-Owned Slaves")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Random Events", "Random Events")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Flesh Heap", "The Flesh Heap")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Job Fulfillment Center", "The Job Fulfillment Center")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Wetware CPUs", "Wetware CPUs")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Corporation", "The Corporation")>>

/**********
SLAVE LEADERS:
**********/
<<case "Attendant" "Bodyguard" "Career Experience" "Concubine" "DJ" "Farmer" "Head Girl" "Leadership Positions" "Madam" "Matron" "Milkmaid" "Nurse" "Recruiter" "Schoolteacher" "Stewardess" "Wardeness">>
	<<= App.Encyclopedia.Dialog.linkSC("Leadership Positions", "Leadership Positions")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Career Experience", "Career Experience")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Attendant", "Attendant")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Bodyguard", "Bodyguard")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Concubine", "Concubine")>>
	| <<= App.Encyclopedia.Dialog.linkSC("DJ", "DJ")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Farmer", "Farmer")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Head Girl", "Head Girl")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Madam", "Madam")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Matron", "Matron")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Milkmaid", "Milkmaid")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Nurse", "Nurse")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Recruiter", "Recruiter")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Schoolteacher", "Schoolteacher")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Stewardess", "Stewardess")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Wardeness", "Wardeness")>>

/**********
SLAVE ASSIGNMENTS (COMMON):
**********/
<<case "Attending Classes" "Confinement" "Fucktoy" "Glory Hole" "Milking" "Farming" "Public Service" "Rest" "Sexual Servitude" "Servitude" "Slave Assignments" "Whoring">>
	<<= App.Encyclopedia.Dialog.linkSC("Common Assignments", "Slave Assignments")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Career Experience", "Career Experience")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Attending Classes", "Attending Classes")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Confinement", "Confinement")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Farming", "Farming")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fucktoy", "Fucktoy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Glory Hole", "Glory Hole")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Milking", "Milking")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Public Service", "Public Service")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Rest", "Rest")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Servitude, Sexual", "Sexual Servitude")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Servitude", "Servitude")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Whoring", "Whoring")>>

/**********
SLAVE BODY:
**********/
<<case "Anuses" "Areolae" "Body" "Breasts" "Butts" "Clits" "Dicks" "Ethnicity" "Faces" "Height" "Hips" "Lactation" "Lips" "Musculature" "Nipples" "Ovaries" "Skin Distinctions" "Teeth" "Testicles" "Vaginas" "Waist" "Weight" "Hormones (XX)" "Hormones (XY)">>
	<<= App.Encyclopedia.Dialog.linkSC("Anuses", "Anuses")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Areolae", "Areolae")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Breasts", "Breasts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Butts", "Butts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Clits", "Clits")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Dicks", "Dicks")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Ethnicity", "Ethnicity")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Faces", "Faces")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Height", "Height")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hips", "Hips")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Lactation", "Lactation")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Lips", "Lips")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Musculature", "Musculature")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Nipples", "Nipples")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Ovaries", "Ovaries")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pregnancy", "Pregnancy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Skin Distinctions", "Skin Distinctions")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Teeth", "Teeth")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Testicles", "Testicles")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Vaginas", "Vaginas")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Waist", "Waist")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Weight", "Weight")>>
	| <<= App.Encyclopedia.Dialog.linkSC("XX", "Hormones (XX)")>>
	| <<= App.Encyclopedia.Dialog.linkSC("XY", "Hormones (XY)")>>

/**********
SLAVE SKILLS
**********/
<<case "Anal Skill" "Combat Skill" "Entertainment Skill" "Oral Skill" "Skills" "Vaginal Skill" "Whoring Skill">>
	<<= App.Encyclopedia.Dialog.linkSC("Anal Skill", "Anal Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Combat Skill", "Combat Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Entertainment Skill", "Entertainment Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Oral Skill", "Oral Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Vaginal Skill", "Vaginal Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Whoring Skill", "Whoring Skill")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Career Experience", "Career Experience")>>

/**********
SLAVE FETISHES:
**********/
<<case "Boob Fetishists" "Buttsluts" "Cumsluts" "Doms" "Fetishes" "Humiliation Fetishists" "Masochists" "Pregnancy Fetishists" "Sadists" "Submissives">>
	<<= App.Encyclopedia.Dialog.linkSC("Boob Fetishists", "Boob Fetishists")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Buttsluts", "Buttsluts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cumsluts", "Cumsluts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Doms", "Doms")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Humiliation Fetishists", "Humiliation Fetishists")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Masochists", "Masochists")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pregnancy Fetishists", "Pregnancy Fetishists")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Sadists", "Sadists")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Submissives", "Submissives")>>

/**********
SLAVE PARAPHILIAS
**********/
<<case "Abusiveness" "Anal Addicts" "Attention Whores" "Breast Obsession" "Breeding Obsession" "Cum Addicts" "Maliciousness" "Paraphilias" "Self Hatred" "Self Neglect">>
	<<= App.Encyclopedia.Dialog.linkSC("Abusiveness", "Abusiveness")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Anal Addicts", "Anal Addicts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Attention Whores", "Attention Whores")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Breast Obsession", "Breast Obsession")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Breeding Obsession", "Breeding Obsession")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cum Addicts", "Cum Addicts")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Maliciousness", "Maliciousness")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Self Hatred", "Self Hatred")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Self Neglect", "Self Neglect")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fetishes", "Fetishes")>>

/**********
SLAVE QUIRKS
**********/
<<case "Adores Men" "Adores Women" "Advocate" "Confident" "Cutting" "Fitness" "Funny" "Insecure" "Sinful" "Caring" "Gagfuck Queen" "Painal Queen" "Perverted" "Quirks" "Romantic" "Size Queen" "Strugglefuck Queen" "Tease" "Unflinching">>
	//Behavioral <<= App.Encyclopedia.Dialog.linkSC("Quirks", "Quirks")>>://
	<<= App.Encyclopedia.Dialog.linkSC("Adores men", "Adores Men")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Adores women", "Adores Women")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Advocate", "Advocate")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Confident", "Confident")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cutting", "Cutting")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fitness", "Fitness")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Funny", "Funny")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Insecure", "Insecure")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Sinful", "Sinful")>>

	//Sexual <<= App.Encyclopedia.Dialog.linkSC("Quirks", "Quirks")>>://
	<<= App.Encyclopedia.Dialog.linkSC("Caring", "Caring")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gagfuck Queen", "Gagfuck Queen")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Painal Queen", "Painal Queen")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Perverted", "Perverted")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Romantic", "Romantic")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Size Queen", "Size Queen")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Strugglefuck Queen", "Strugglefuck Queen")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Tease", "Tease")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Unflinching", "Unflinching")>>

/**********
SLAVE FLAWS
**********/
<<case "Anorexic" "Arrogant" "Bitchy" "Devout" "Flaws" "Gluttonous" "Hates Men" "Hates Women" "Liberated" "Odd" "Apathetic" "Crude" "Hates Anal" "Hates Oral" "Hates Penetration" "Idealistic" "Judgemental" "Repressed" "Shamefast">>
	//Behavioral <<= App.Encyclopedia.Dialog.linkSC("Flaws", "Flaws")>>://
	<<= App.Encyclopedia.Dialog.linkSC("Anorexic", "Anorexic")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Arrogant", "Arrogant")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Bitchy", "Bitchy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Devout", "Devout")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gluttonous", "Gluttonous")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hates men", "Hates Men")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hates women", "Hates Women")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Liberated", "Liberated")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Odd", "Odd")>>

	//Sexual <<= App.Encyclopedia.Dialog.linkSC("Flaws", "Flaws")>>://
	<<= App.Encyclopedia.Dialog.linkSC("Apathetic", "Apathetic")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Crude", "Crude")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hates anal", "Hates Anal")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hates oral", "Hates Oral")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hates penetration", "Hates Penetration")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Idealistic", "Idealistic")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Judgemental", "Judgemental")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Repressed", "Repressed")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Shamefast", "Shamefast")>>

/**********
SLAVE RELATIONSHIPS
**********/
<<case "Emotional Slut" "Emotionally Bonded" "Relationships" "Rivalries" "Romances" "Slave Marriages" "Slaveowner Marriages">>
	<<= App.Encyclopedia.Dialog.linkSC("Relationships", "Relationships")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Rivalries", "Rivalries")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Romances", "Romances")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Emotionally Bonded", "Emotionally Bonded")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Emotional Slut", "Emotional Slut")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Marriages", "Slave Marriages")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slaveowner Marriages", "Slaveowner Marriages")>>

/**********
PREGNANCY
**********/
<<case "Artificial Insemination" "Breeders Dietary Blend" "Childbirth and C-Secs" "Cloning" "Fertility Mix" "Gestation Drugs and Labor Suppressants" "Hyper-Pregnancy" "Ova Transplantation" "Player Pregnancy" "Pregnancy" "Pregnancy Generator" "Slave Fertility" "Super Fertility Drugs" "Surrogacy" "Inbreeding">>
	<<= App.Encyclopedia.Dialog.linkSC("Pregnancy", "Pregnancy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Fertility", "Slave Fertility")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Player Pregnancy", "Player Pregnancy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hyper-Pregnancy", "Hyper-Pregnancy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Super Fertility Drugs", "Super Fertility Drugs")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fertility Mix", "Fertility Mix")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Breeders Dietary Blend", "Breeders Dietary Blend")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pregnancy Generator", "Pregnancy Generator")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Childbirth and C-Secs", "Childbirth and C-Secs")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gestation Drugs and Labor Suppressants", "Gestation Drugs and Labor Suppressants")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Artificial Insemination", "Artificial Insemination")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Surrogacy", "Surrogacy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cloning", "Cloning")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Ova Transplantation", "Ova Transplantation")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Eugenics Breeding Proposal", "Eugenics Breeding Proposal")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Repopulationist Breeding School", "Repopulationist Breeding School")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Inbreeding", "Inbreeding")>>

/**********
INFLATION
**********/
<<case "Belly Implants" "Cervix Micropump Filter" "Enemas and Force-Feeding" "Inflation" "Organic Mesh Breast Implant">>
	<<= App.Encyclopedia.Dialog.linkSC("Inflation", "Inflation")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Enemas and Force-Feeding", "Enemas and Force-Feeding")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Belly Implants", "Belly Implants")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cervix Micropump Filter", "Cervix Micropump Filter")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Organic Mesh Breast Implant", "Organic Mesh Breast Implant")>>

/**********
SLAVE MODIFICATION
**********/
<<case "Slave Modification">>
	<<= App.Encyclopedia.Dialog.linkSC("Slave Modification", "Slave Modification")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Corrective Diet", "Corrective Diet")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Nipple Conversion — Penetratable", "Nipple Conversion — Penetratable")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Ejaculation Boosting Prostate Implant", "Ejaculation Boosting Prostate Implant")>>

/**********
THE X-SERIES ARCOLOGY
**********/
<<case "Personal Assistant" "Security Drones" "Slave Nutrition" "The Auto Salon" "The Pharmaceutical Fab." "The Remote Surgery" "The Studio" "The Wardrobe" "The X-Series Arcology" "Water Filtration" "What the Upgrades Do">>
	<<= App.Encyclopedia.Dialog.linkSC("What the Upgrades Do", "What the Upgrades Do")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Personal Assistant", "Personal Assistant")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Wardrobe", "The Wardrobe")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Auto Salon", "The Auto Salon")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Body Mod Studio", "The Studio")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Remote Surgery", "The Remote Surgery")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Pharmaceutical Fab.", "The Pharmaceutical Fab.")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Security Drones", "Security Drones")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Water Filtration", "Water Filtration")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Nutrition", "Slave Nutrition")>>

/**********
ARCOLOGY FACILITIES
**********/
<<case "Advertising" "Arcade" "Brothel" "Cellblock" "Clinic" "Club" "Dairy" "Facilities" "Farmyard" "Head Girl Suite" "Master Suite" "Nursery" "Pit" "Schoolroom" "Servants' Quarters" "Spa" "The Incubation Facility" "Variety">>
	//Arcology <<= App.Encyclopedia.Dialog.linkSC("Facilities", "Facilities")>>://
	<<= App.Encyclopedia.Dialog.linkSC("Arcade", "Arcade")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Brothel", "Brothel")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cellblock", "Cellblock")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Clinic", "Clinic")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Club", "Club")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Dairy", "Dairy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Head Girl Suite", "Head Girl Suite")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Master Suite", "Master Suite")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pit", "Pit")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Schoolroom", "Schoolroom")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Servants' Quarters", "Servants' Quarters")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Spa", "Spa")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Nursery", "Nursery")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Farmyard", "Farmyard")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Incubation Facility ", "The Incubation Facility")>>

	//Facility Bonuses://
	<<= App.Encyclopedia.Dialog.linkSC("Advertising", "Advertising")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Variety", "Variety")>>

/**********
TERRAIN TYPES
**********/
<<case "Terrain Types" "Urban Terrain" "Rural Terrain" "Marine Terrain" "Oceanic Terrain">>
	<<= App.Encyclopedia.Dialog.linkSC("Urban", "Urban Terrain")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Rural", "Rural Terrain")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Marine", "Marine Terrain")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Oceanic", "Oceanic Terrain")>>

/**********
FUTURE SOCIETIES
**********/
<<case "Arabian Revivalism" "Asset Expansionism" "Aztec Revivalism" "Body Purism" "Chattel Religionism" "Chinese Revivalism" "Degradationism" "Edo Revivalism" "Egyptian Revivalism" "Ethnic Subjugationism" "Ethnic Supremacy" "Eugenics Focus" "Future Societies" "Gender Fundamentalism" "Gender Radicalism" "Hedonistic Decadence" "Intellectual Dependency" "Maturity Preferentialism" "Multiculturalism" "Pastoralism" "Paternalism" "Petite Admiration" "Physical Idealism" "Repopulationism" "Roman Revivalism" "Slave Professionalism" "Slimness Enthusiasm" "Statuesque Glorification" "Transformation Fetishism" "Youth Preferentialism" "Neo-Imperialism">>
	//Vanilla Future Societies://
	<<= App.Encyclopedia.Dialog.linkSC("Ethnic Supremacy", "Ethnic Supremacy")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Ethnic Subjugationism", "Ethnic Subjugationism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gender Radicalism", "Gender Radicalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gender Fundamentalism", "Gender Fundamentalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Paternalism", "Paternalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Degradationism", "Degradationism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Body Purism", "Body Purism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Transformation Fetishism", "Transformation Fetishism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Maturity Preferentialism", "Maturity Preferentialism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Youth Preferentialism", "Youth Preferentialism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slimness Enthusiasm", "Slimness Enthusiasm")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Asset Expansionism", "Asset Expansionism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Pastoralism", "Pastoralism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Physical Idealism", "Physical Idealism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Chattel Religionism", "Chattel Religionism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Multiculturalism", "Multiculturalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Roman Revivalism", "Roman Revivalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Egyptian Revivalism", "Egyptian Revivalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Edo Revivalism", "Edo Revivalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Arabian Revivalism", "Arabian Revivalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Chinese Revivalism", "Chinese Revivalism")>>

	//Modded Future Societies://
	<<= App.Encyclopedia.Dialog.linkSC("Repopulationism", "Repopulationism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Eugenics Focus", "Eugenics Focus")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Professionalism", "Slave Professionalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Intellectual Dependency", "Intellectual Dependency")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Petite Admiration", "Petite Admiration")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Statuesque Glorification", "Statuesque Glorification")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hedonistic Decadence", "Hedonistic Decadence")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Aztec Revivalism", "Aztec Revivalism")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Neo-Imperialism", "Neo-Imperialism")>>

/**********
LORE: THE FREE CITIES TODAY
**********/
<<case "Lore" "Money" "Food" "Disease in the Free Cities" "Free Cities Justice" "Modern Anal" "Slave Couture" "Slave Marriage" "The Ejaculate Market" "Gingering" "Dyes"
/**********
LORE: FREE CITIES CULTURE TOMORROW
**********/
"The New Rome" "The Return of Feudalism" "Naked, Barefoot, and Pregnant" "The Top" "The Bottom" "The Purity of the Human Form" "A World Built on Implants" "Slaves as Stock" "Slavery and the Physical Ideal" "Faith in the Free Cities"
/**********
LORE: INTERVIEWS
**********/
"Slave Whore, Arcology K-2" "Slave Acolyte, Arcology V-7" "Public Slave, Arcology A-3" "Mercenary, Arcology B-2" "Slave Trainer, Arcology D-10" "Monarch, Arcology F-8">>
	//The Free Cities today://
	@@.yellowgreen; <<= App.Encyclopedia.Dialog.linkSC("Money", "Money")>>@@
	| <<= App.Encyclopedia.Dialog.linkSC("Disease in the Free Cities", "Disease in the Free Cities")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Free Cities Justice", "Free Cities Justice")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Modern Anal", "Modern Anal")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Couture", "Slave Couture")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Marriage", "Slave Marriage")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Ejaculate Market", "The Ejaculate Market")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gingering", "Gingering")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Dyes", "Dyes")>>

//Free Cities culture tomorrow://
	<<= App.Encyclopedia.Dialog.linkSC("The New Rome", "The New Rome")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Return of Feudalism", "The Return of Feudalism")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Naked, Barefoot, and Pregnant", "Naked, Barefoot, and Pregnant")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Top", "The Top")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Bottom", "The Bottom")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Purity of the Human Form", "The Purity of the Human Form")>>
	| <<= App.Encyclopedia.Dialog.linkSC("A World Built on Implants", "A World Built on Implants")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slaves as Stock", "Slaves as Stock")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slavery and the Physical Ideal", "Slavery and the Physical Ideal")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Faith in the Free Cities", "Faith in the Free Cities")>>

//Interviews://
	<<= App.Encyclopedia.Dialog.linkSC("Slave Whore, Arcology K-2", "Slave Whore, Arcology K-2")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Acolyte, Arcology V-7", "Slave Acolyte, Arcology V-7")>>
	<<if $seeExtreme != 0>>
		| <<= App.Encyclopedia.Dialog.linkSC("Public Slave, Arcology A-3", "Public Slave, Arcology A-3")>>
	<</if>>
	| <<= App.Encyclopedia.Dialog.linkSC("Mercenary, Arcology B-2", "Mercenary, Arcology B-2")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Trainer, Arcology D-10", "Slave Trainer, Arcology D-10")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Monarch, Arcology F-8", "Monarch, Arcology F-8")>>

/**********
BLACK MARKET
**********/
<<case "The Black Market" "Contraband and Illegal Goods" "Gender Radicalism Research" "Slave Professionalism Research" "Transformation Fetishism Research" "Asset Expansionist Research" "Slimness Enthusiast Research" "Hedonistic Decadence Research" "Eugenics Breeding Proposal" "Youth Preferentialism Research" "Repopulationist Breeding School">>
	<<= App.Encyclopedia.Dialog.linkSC("The Black Market", "The Black Market")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Contraband and Illegal Goods", "Contraband and Illegal Goods")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Gender Radicalism Research", "Gender Radicalism Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slave Professionalism Research", "Slave Professionalism Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Transformation Fetishism Research", "Transformation Fetishism Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Asset Expansionist Research", "Asset Expansionist Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Slimness Enthusiast Research", "Slimness Enthusiast Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Youth Preferentialism Research", "Youth Preferentialism Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Hedonistic Decadence Research", "Hedonistic Decadence Research")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Childhood Fertility Induced NCS", "Childhood Fertility Induced NCS")>>

/**********
MODS
**********/
<<case "Game Mods">>
	<<= App.Encyclopedia.Dialog.linkSC("Lolimod", "Lolimod")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Special Force Mod", "Special Force")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Security Expansion Mod", "Security Expansion")>>
	| <<= App.Encyclopedia.Dialog.linkSC("FCTV", "FCTV")>>

<<case "Lolimod" "Lolis and the Free Cities" "Fertility Age" "Male Fertility" "Cradle Robbers" "Precocious Puberty" "Childhood Fertility Induced NCS">>
	<<= App.Encyclopedia.Dialog.linkSC("Lolis and the Free Cities", "Lolis and the Free Cities")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Fertility Age", "Fertility Age")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Male Fertility", "Male Fertility")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Precocious Puberty", "Precocious Puberty")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Cradle Robbers", "Cradle Robbers")>>
	| <<= App.Encyclopedia.Dialog.linkSC("The Incubation Facility", "The Incubation Facility")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Childhood Fertility Induced NCS", "Childhood Fertility Induced NCS")>>

<<case "Security Expansion" "Battles">>
	<<= App.Encyclopedia.Dialog.linkSC("The Security Expansion Mod", "Security Expansion")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Battles", "Battles")>>

<<case "FCTV" "FCTVReceiver">>
	<<= App.Encyclopedia.Dialog.linkSC("FCTV", "FCTV")>>
	| <<= App.Encyclopedia.Dialog.linkSC("FCTVReceiver", "FCTVReceiver")>>

<</switch>>


code:
:: PassageDone

<<if window.savedColorMap>>
	<<addclass "body" "lightTheme">>
<</if>>


code:
/* --- base functionality --- */

.accordion-content.hidden {
	display: none;
}

/* --- no button case --- */

:not(button).accordion {
	cursor: pointer;
}

/* --- button/div case --- */

/* style button */
button.accordion {
	width: 100%;
	margin: 5px 0;
	border: 2px solid var(--button-border-color);
	padding: 10px;
	padding-left: 2.2em;
	background-color: var(--button-selected-color);
	/* to position the open/close symbol */
	position: relative;
}

button.accordion.closed {
	background-color: var(--button-color);
}

button.accordion.empty {
	background-color: var(--button-disabled-color);
	cursor: default;
}

button.accordion:hover:not(.empty) {
	background-color: var(--button-hover-color);
}

/* open/close symbol */
button.accordion::before {
	font-family: "tme-fa-icons";
	position: absolute;
	left: 10px;
	content: "\e81c";
}

button.accordion.closed::before {
	content: "\e81e";
}

button.accordion.empty::before {
	content: none;
}

/* hide content */
div.accordion-content {
	margin: 0 15px;
}

/* modifiers for the toggle button */
button.accordion span.title {
	float: left;
}

button.accordion span.info {
	float: right;
}


code:
#graph .linage {
	fill: none;
	stroke: white;
}
#graph .marriage {
	fill: none;
	stroke: white;
}
#graph .node {
	background-color: lightblue;
	border-style: solid;
	border-width: 1px;
}
#graph .nodeText{
	font: 10px sans-serif;
	margin: 0;
	padding: 0;
	color: black;
}
#graph {
	font: 10px sans-serif;
	margin: -20px 0;
	padding: 0;
	color: black;
}

#graph div {
	border-style: solid;
	border-width: 1px;
}

#graph .XY {
	background-color: lightblue;
}

#graph div.XX {
	background-color: pink;
}

#graph div.unknown {
	background-color: gray;
}

#graph div.unknownXY {
	background-color: #808080;
}

#graph div.unknownXX {
	background-color: #808080;
}

#graph .you {
	background-color: red;
}

#graph .emphasis {
	font-style: italic;
	font-weight: bold;
	margin: 0;
	background: #ffffff88;
	border: 2px solid Gold;
	white-space: nowrap;
}

#edit-family {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

#edit-family #family-table {
}