code:
App.Encyclopedia.addArticle("RA Condition Editor", function() {
	/**
	 * @param {HTMLElement} container
	 * @param {string} col1
	 * @param {string} col2
	 * @param {string} col3
	 */
	function tableHead(container, col1, col2, col3) {
		App.UI.DOM.appendNewElement("div", container, col1, "head");
		App.UI.DOM.appendNewElement("div", container, col2, "head");
		App.UI.DOM.appendNewElement("div", container, col3, "head");
	}

	/**
	 * @param {ReadonlyMap<string, Getter<*>>} getters
	 */
	function getterTable(getters) {
		const container = document.createElement("p");
		container.classList.add("rule-help-table");

		tableHead(container, "Name", "Description", "Requirements");

		for (const getter of getters.values()) {
			if (getter.visible && !getter.visible()) {
				continue;
			}
			App.UI.DOM.appendNewElement("div", container, getter.name);
			App.UI.DOM.appendNewElement("div", container, getter.description);
			const div = document.createElement("div");
			if (getter.requirements) {
				div.append(getter.requirements);
			}
			container.append(div);
		}

		return container;
	}

	/**
	 * @param {HTMLElement} container
	 * @param {string} name
	 * @param {string} description
	 * @param {string} dataTypes
	 */
	function transformerRow(container, name, description, dataTypes) {
		App.UI.DOM.appendNewElement("div", container, name);
		App.UI.DOM.appendNewElement("div", container, description);
		App.UI.DOM.appendNewElement("div", container, dataTypes);
	}

	function transformerTable() {
		const el = document.createElement("p");
		el.classList.add("rule-help-table");

		tableHead(el, "Name", "Description", "Data types");

		transformerRow(el, "And", "True, if all input values are true.", "Boolean");
		transformerRow(el, "Or", "True, if at least one input value is true.", "Boolean");
		transformerRow(el, "Sum all", "Sums up all input values", "Number");
		transformerRow(el, "Multiply all", "Multiplies all input values", "Number");
		transformerRow(el, "Maximum", "Gives the largest input value", "Number");
		transformerRow(el, "Minimum", "Gives the smallest input value", "Number");
		transformerRow(el, "=, ≠", "Compares the input values based on the comparator in " +
			"the middle. Both sides need to have the same data type.", "Boolean, Number, String");
		transformerRow(el, "<, ⩽, >, ⩾", "Compares the input values based on the comparator in " +
			"the middle. Both sides need to have the same data type.", "Boolean, Number");
		transformerRow(el, "-", "Subtracts the second value from the first value", "Number");
		transformerRow(el, "/", "Divides the second value by the first value", "Number");
		transformerRow(el, "Contains", "True, if the second value is somewhere in the first value",
			"String");
		transformerRow(el, "Matches", "True, if the first value matches the regular expression in the second value",
			"String");
		transformerRow(el, "Not …", "Negates the input value.", "Boolean");
		transformerRow(el, "If … Then … Else …",
			"If the first value is true, returns the second value, otherwise the third value. The second " +
			"and third input value have to be the same data type.", "Boolean / Any");

		return el;
	}

	const acc = new SpacedTextAccumulator();

	acc.push("Note: For the simple mode only the section Data getters is relevant.");
	acc.toParagraph();

	acc.push("Rule conditions consist of two types of elements, data getters and data transformers. Data getters can " +
		"read out values from various places, which can then be used to base conditions on. Data transformers " +
		"take one or more elements as input and transform the input values into a single new value. Together they " +
		"can create complex conditions for activating rules.");
	acc.toParagraph();

	acc.push("To build a new condition drag the elements you need from the part browser into the main condition " +
		"field next to it.");
	acc.toParagraph();

	App.UI.DOM.appendNewElement("h2", acc.container(), "Finding errors");
	acc.push("It is possible to create element trees which are invalid, for example because the input value of an " +
		"element has the wrong data type. When this is the case there will be an error message above the rule " +
		"editor and the broken elements are marked. As long as there are errors the rule cannot be saved and will " +
		"revert to it's previous state when leaving the RA or editing another rule. In the error message the first " +
		"error corresponds to the innermost broken element. When solving errors it is advised to work from inside to " +
		"outside, as outer errors are often caused by errors further inside.");
	acc.toParagraph();

	App.UI.DOM.appendNewElement("h2", acc.container(), "Data transformers");
	acc.push("Data transformers can handle 3 different data types: Boolean, Number and String. Not all transformers " +
		"accept all data types. Number and Boolean can be used interchangeably, the conversion is as follows: " +
		"Putting a Number into a boolean transformer will interpret 0 as false and all other values as true. " +
		"Putting a Boolean into a number transformer will interpret false as 0 and true as 1.");
	acc.toParagraph();
	acc.container().append(transformerTable());

	App.UI.DOM.appendNewElement("h2", acc.container(), "Data getters");

	acc.push("There are a number of predefined getters which read values either from a slave or from the global " +
		"state. They always have a predefined data type.");
	acc.toParagraph();

	let c = acc.container();
	App.UI.DOM.appendNewElement("h3", c, "Boolean getters");
	c.append(getterTable(App.RA.Activation.getterManager.booleanGetters));
	App.UI.DOM.appendNewElement("h3", c, "Assignment getters");
	acc.push("A special type of boolean getters checking if the slave has the given assignment");
	acc.toParagraph();
	c = acc.container();
	c.append(getterTable(App.RA.Activation.getterManager.assignmentGetters));
	App.UI.DOM.appendNewElement("h3", c, "Number getters");
	c.append(getterTable(App.RA.Activation.getterManager.numberGetters));
	App.UI.DOM.appendNewElement("h3", c, "String getters");
	c.append(getterTable(App.RA.Activation.getterManager.stringGetters));

	App.UI.DOM.appendNewElement("h3", c, "Custom getters");
	acc.push("If greater freedom is required for the conditions needed, a custom data getter can be used.",
		"It operates on a context object with the following properties:",
		"
",
		"
slave: The slave currently tested against.
",
		"
",
		"It is required to explicitly set the return type. If the set type does not match the actual return type, the condition evaluation will fail!");
	acc.toParagraph();
	acc.push("For example to get the slave name you can use");
	acc.push(App.UI.DOM.makeElement("span", "context => context.slave.slaveName", ["monospace"]));
	acc.push("and set the getter type to string.");
	acc.toParagraph();
	acc.push("Documentation for slave attributes can be found",
		"here.",
		"Alternatively you can look up the properties needed in the", "" +
		"actual definitions.");
	acc.toParagraph();

	return acc.container();
}, "beingInCharge");


code:
App.Encyclopedia.addArticle("Flaws", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Flaws", ["bold"]), "are negative slave qualities.");
	r.push("They decrease slaves' value and performance at sexual assignments, and each flaw also has other, differing effects. Each flaw is associated with a corresponding");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), ","), "and each slave can have two flaws (a sexual flaw and a behavioral flaw), just like quirks. New slaves will often have flaws, and tough experiences can also cause them to appear.");
	r.toParagraph();

	r.push("Flaws can softened or removed either by orders given to the", App.Encyclopedia.link("Head Girl"), "or via personal attention provided by the player character.");
	r.push("Flaws can also be naturally softened or removed by fetishes, and can resolve on their own if a slave is happy.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Anorexic", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Anorexic", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("insecure"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("In addition to the standard penalties to value and performance on sexual assignments, anorexia can cause unexpected weight loss. Anorexics will enjoy dieting but dislike gaining weight, and may bilk attempts to make them fatten up.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Arrogant", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Arrogant", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("confident"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("The", App.Encyclopedia.link("submissive", "Submissives"), "fetish can do this naturally.");
	r.push("In addition to the standard penalties to value and performance on sexual assignments, weekly", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "gains are limited.");
	r.toNode("div");

	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Bitchy", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Bitchy", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("cutting"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("The", App.Encyclopedia.link("humiliation", "Humiliation Fetishists"), "fetish can do this naturally.");
	r.push("In addition to the standard penalties to value and performance on sexual assignments, weekly", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "gains are limited.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Devout", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Devout", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("sinful"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("A very powerful sex drive can do this naturally.");
	r.push("In addition to the standard penalties to value and performance on sexual assignments, weekly", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "gains are limited.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Gluttonous", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Gluttonous", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("fitness"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("In addition to the standard penalties to value and performance on sexual assignments, gluttons will enjoy gaining weight but dislike dieting, and may bilk attempts to make them lose weight.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Hates men", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Hates men", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("adores women"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("boob fetish.", "Boob Fetishists"));
	r.push("Strong attraction to men or the", App.Encyclopedia.link("pregnancy fetish", "Pregnancy Fetishists"), "will soften it so she", App.Encyclopedia.link("adores men"), "instead.");
	r.push("This flaw can also be removed by serving a player character or another slave with a dick.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Hates women", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Hates women", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("adores men"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("cumslut", "Cumsluts"), "fetish.");
	r.push("Strong attraction to women or the", App.Encyclopedia.link("pregnancy fetish", "Pregnancy Fetishists"), "will soften it so she", App.Encyclopedia.link("adores women"), "instead.");
	r.push("This flaw can also be removed by serving a player character or another slave with a vagina.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Liberated", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Liberated", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("advocate"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("The", App.Encyclopedia.link("masochism", "Masochists"), "fetish can do this naturally.");
	r.push("In addition to the standard penalties to value and performance on sexual assignments, weekly", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "gains are limited.");
	r.toNode("div");

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Odd", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Odd", ["bold"]), "is a behavioral", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("funny"), App.UI.DOM.combineNodes(App.Encyclopedia.link("quirk", "Quirks"), "."));
	r.push("In addition to the standard penalties to value and performance on sexual assignments, weekly", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "gains are limited.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Apathetic", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Apathetic", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("caring"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("submissive", "Submissives"), "fetish.");
	r.push("It can also be removed by the", App.Encyclopedia.link("dom", "Doms"), "fetish.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Crude", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Crude", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("unflinching"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("buttslut", "Buttsluts"), "fetish.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Hates anal", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Hates anal", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("painal queen", "Painal Queen"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, anus piercings, or the", App.Encyclopedia.link("buttslut", "Buttsluts"), "fetish.");
	r.push("This flaw can also be removed by serving the player character.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Hates oral", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Hates oral", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("gagfuck queen", "Gagfuck Queen"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, tongue piercings, or the", App.Encyclopedia.link("cumslut", "Cumsluts"), "fetish.");
	r.push("This flaw can also be removed by serving the player character.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Hates penetration", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Hates penetration", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("strugglefuck queen", "Strugglefuck Queen"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, labia piercings, or the", App.Encyclopedia.link("buttslut", "Buttsluts"), "fetish.");
	r.push("This flaw can also be removed by the", App.Encyclopedia.link("pregnancy fetish", "Pregnancy Fetishists"), "or by serving the player character.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Idealistic", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Idealistic", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("romantic"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("submissive", "Submissives"), "fetish.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Judgemental", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Judgemental", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("size queen", "Size Queen"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("submissive", "Submissives"), "fetish.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Repressed", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Repressed", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("perverted"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("cumslut", "Cumsluts"), "or", App.Encyclopedia.link("buttslut", "Buttsluts"), "fetishes.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addArticle("Shamefast", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Shamefast", ["bold"]), "is a sexual", App.Encyclopedia.link("flaw", "Flaws"), "that can be softened into the");
	r.push(App.Encyclopedia.link("tease"), App.Encyclopedia.link("quirk", "Quirks"), "by training,");
	r.push("a good", App.UI.DOM.combineNodes(App.Encyclopedia.link("Attendant"), ","), "a powerful sex drive, or the", App.Encyclopedia.link("humiliation", "Humiliation Fetishists"), "fetish.");
	r.toParagraph();

	return f;
}, "slaveFlaws");

App.Encyclopedia.addCategory("slaveFlaws", function() {
	const f = new DocumentFragment();
	let r = [];
	r.push(App.Encyclopedia.link("Anorexic"));
	r.push(App.Encyclopedia.link("Arrogant"));
	r.push(App.Encyclopedia.link("Bitchy"));
	r.push(App.Encyclopedia.link("Devout"));
	r.push(App.Encyclopedia.link("Gluttonous"));
	r.push(App.Encyclopedia.link("Hates men"));
	r.push(App.Encyclopedia.link("Hates women"));
	r.push(App.Encyclopedia.link("Liberated"));
	r.push(App.Encyclopedia.link("Odd"));
	App.Events.addNode(f, ["Behavioral ", App.UI.DOM.combineNodes(App.Encyclopedia.link("Flaws"), ":"), App.UI.DOM.generateLinksStrip(r)], "div");

	r = [];
	r.push(App.Encyclopedia.link("Apathetic"));
	r.push(App.Encyclopedia.link("Crude"));
	r.push(App.Encyclopedia.link("Hates anal"));
	r.push(App.Encyclopedia.link("Hates oral"));
	r.push(App.Encyclopedia.link("Hates penetration"));
	r.push(App.Encyclopedia.link("Idealistic"));
	r.push(App.Encyclopedia.link("Judgemental"));
	r.push(App.Encyclopedia.link("Repressed"));
	r.push(App.Encyclopedia.link("Shamefast"));
	App.Events.addNode(f, ["Sexual ", App.UI.DOM.combineNodes(App.Encyclopedia.link("Flaws"), ":"), App.UI.DOM.generateLinksStrip(r)], "div");

	return f;
});

repo_name: Ducati/fc

license: mit


code:
App.Encyclopedia.addArticle("Leadership Positions", function() {
	const r = new DocumentFragment();
	App.Events.addParagraph(r, ["Slave assignments are stratified into ordinary", App.Encyclopedia.link("assignments", "Slave Assignments"), "and leadership positions."]);
	App.Events.addParagraph(r, ["Choose a more particular entry below:"]);

	return r;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Career Experience", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion") => link(text, "From Rebellious to Devoted", "hotpink");
	const trust = (text = "trust") => link(text, "Trust", "mediumaquamarine");
	/** @type {[string, HTMLElement, string, string?][]} */
	const careerData = [
		["Grateful", trust(), "grateful"],
		["Menial", devotion(), "menial"],
		["Servant", link("keeping your estate", "Servitude"), "servant"],
		["Entertainment", link("public service", "Public Service"), "entertainment", "If a slave has a lot of entertainment experience, she can qualify for this bonus without career experience."],
		["Sex work", link("whoring"), "entertainment", "If a slave is very sexually experienced, she can qualify for this bonus without career experience."],
		["Leadership", link("Head Girl"), "HG"],
		["Procuring", link("Madam"), "madam"],
		["Musical", link("DJ"), "DJ"],
		["Defensive", link("Bodyguard"), "bodyguard"],
		["Convincing", link("Recruiter"), "recruiter"],
		["Security", link("Wardeness"), "wardeness"],
		["Medical", link("Nurse"), "nurse"],
		["Counseling", link("Attendant"), "attendant"],
		["Nannying", link("Matron"), "matron"],
		["Accounting", link("Stewardess"), "stewardess"],
		["Husbandry", link("Milkmaid"), "milkmaid"],
		["Farming", link("Farmer"), "farmer"],
		["Teaching", link("Schoolteacher"), "schoolteacher"],
	];
	const t = new DocumentFragment();
	const r = [];

	t.append("Slaves may retain useful experience from their lives before enslavement. Freedom and slavery are so different that the bonuses slaves get are minor. Careers fall into categories, each with its own bonus; these are:");
	for (const [boldItem, bonus, career, note] of careerData) {
		App.Events.addParagraph(t, [CareerBonus(boldItem, bonus, career, note)]);
	}
	r.push("Slaves who have been in slavery long enough that it is effectively their career get a bonus to", devotion("devotion."));
	r.push("Slaves can forget their career experience in an industrialized Dairy, but if they do so and remain sane, they will get a special bonus to both", devotion(), "and", trust("trust."));
	App.Events.addParagraph(t, r);

	App.Events.addParagraph(t, ["Facility heads and working slaves can gain work experience to provide the same benefit as having a relevant career. Intelligence is the deciding factor in how long this will take, brilliant slaves can achieve this ideally in about fourteen weeks, while borderline retarded slaves can take up two hundred weeks (Assuming that the slave's intelligence doesn't change at all and the dice roll is consistent)."]);

	return t;

	/**
	 * @param {string} career
	 * @param {HTMLElement} bonus
	 * @param {string} list
	 * @param {string} [note]
	 */
	function CareerBonus(career, bonus, list, note) {
		const r = new SpacedTextAccumulator();
		const notLeader = ["Grateful", "Menial", "Servant", "Entertainment", "Sex work"].includes(career);
		const applicable = notLeader ? App.Data.Careers.General[list] : App.Data.Careers.Leader[list];

		r.push(App.UI.DOM.makeElement("span", career, ["underline"]), `which offers a ${career === "Grateful" || career === "Menial" ? 'potential' : ''} bonus to`, bonus, `includes slaves who were: ${toSentence(applicable)}.`);
		r.toNode("div");
		if (note) {
			r.push(note);
			r.toNode("div");
		}
		return r.container();
	}
}, "slaveLeaders");

App.Encyclopedia.addArticle("Attendant", function() {
	const t = new DocumentFragment();
	const r = [];
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const goodAttendant = [App.UI.DOM.makeElement("span", "intelligent", ["cyan"]), "naturally female", "appear older than 35", "have a calm libido and a motherly air."];

	r.push("An", App.UI.DOM.makeElement("span", "Attendant", ["bold"]), "can be selected once the", link("Spa"), "facility has been built.");
	r.push("Attendants provide emotional help to slaves in the spa, and can also soften flaws and even fix mindbroken slaves.");
	r.push("Good Attendants are", link("submissive", "Submissives"), "or free of", App.UI.DOM.combineNodes(link("fetishes"), ","), App.UI.DOM.toSentence(goodAttendant));
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Matron", function() { // TODO: will still need more updating
	const t = new DocumentFragment();
	const r = [];
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const goodMatron = [link("caring"), link("funny"), link("intelligent", "Intelligence"), "has given birth before."];

	r.push("A", App.UI.DOM.makeElement("span", "Matron", ["bold"]), "can be selected once the", link("Nursery"), "facility has been built.");
	r.push("Matrons oversee the day-to-day activities of the Nursery, and can soften flaws of nannies working under them. A good Matron is:", App.UI.DOM.toSentence(goodMatron));
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Bodyguard", function() {
	const t = new DocumentFragment();
	let r = [];
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const reduceDeadliness = [link("Big breasts", "Breasts"), link("butts"), link("poor health", "Health"), link("excess weight", "Weight"), link("pregnancy")];
	const bodyguardTrainees = ["her lover or wife if she has one", link("the Head Girl", "Head Girl"), link("the Wardeness", "Wardeness"), link("your Concubine.", "Concubine")];

	App.UI.DOM.appendNewElement("div", t, "Slave bodyguards are best understood not as protection for a slaveowner's person, but rather as a projection of their skill at slave breaking.", ["note"]);

	r.push("By giving a slave the means and position to easily kill her master, that master displays their total trust in them. The simple fact that an armed slave is near a slaveowner at all times is proof that that slaveowner has produced at least one slave that never wavers in her");
	r.push(link("devotion.", "From Rebellious to Devoted", "hotpink"));
	r.push("After all, if she ever wavered, the slaveowner would likely be dead.");
	App.Events.addNode(t, r, "p", "note");

	App.UI.DOM.appendNewElement("p", t, "It is obvious to any real security professional that slave bodyguards are mostly for show, from the moment of seeing one. After all, they are not equipped with modern sensors, armor, and weapons; if they were so attired and loaded down it would be quite impossible to tell if they were even female: the huge weight and bulk of modern combat gear gives an androgynous appearance. Instead, they are usually kept scantily clad or even naked, and armed with visually impressive weapons.", ["note"]);

	App.Encyclopedia.addArticleSource(t, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "Bodyguard", ["bold"]));
	r.push("can be selected once the Armory upgrade is purchased. Duties include protection of the player character during violent events; good bodyguards produce some");
	r.push(link("reputation", "Arcologies and Reputation", "green"));
	r.push("as well, based on how deadly they are.", "Toned but not excessive", link("muscles", "Musculature"));
	r.push(link("combat skill", "Combat Skill"), "and", link("height"));
	r.push("contribute to deadliness.");
	r.push(App.UI.DOM.toSentence(reduceDeadliness), "all detract from deadliness.");
	App.Events.addParagraph(t, r);

	r = [];
	r.push("Skilled", App.UI.DOM.makeElement("span", "intelligent", ["cyan"]), "and", link("devoted", "From Rebellious to Devoted", "hotpink"));
	r.push("Bodyguards may become concerned that they have no potential successor if you do not keep several other combat capable slaves in your penthouse.");
	r.push("Such a Bodyguard will do her best to find responsible and physically capable slaves to teach self defense to when she can.");
	r.push("Potential recipients of this training include:", App.UI.DOM.toSentence(bodyguardTrainees));
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Concubine", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	const r = [];

	r.push("A", App.UI.DOM.makeElement("span", "Concubine", ["bold"]));
	r.push("can be selected once the", link("Master Suite"), "facility is built.");
	r.push("Concubines benefit from high beauty and sexual skills in the same way as public servants;");
	r.push("they should also be extremely", link("devoted.", "From Rebellious to Devoted", "hotpink"));
	r.push("Concubines do not apply any bonuses to other slaves in the", link("Master suite"), "rather,");
	r.push("they are the game's single most efficient production of", link("reputation", "Arcologies and Reputation", "green"), "themselves.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("DJ", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	let r = [];

	r.push(`My name is Danni Diemen, and I'm here today to talk about the prettiest girls in the Free Cities. That's right, DJs! When a slave bitch says, "Sweetie, I'm not that kind of girl," she's lying. She's a slave, and she is that kind of girl! So, have your way with her.`);
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("Except if she's a DJ. Then she probably isn't that kind of girl after all! Rare, I know. That's what makes them so hot! Some of the Free Cities' most prominent slaveowners have taken sluttery to the next level. They're building clubs designed around constant beats and constant sex, so it pays to have a hot girl maintain the party, whether it's up on stage, in the DJ booth, or down on the floor!");
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("As for what makes a good DJ, beauty is obvious. But I also I hear the best trend a little older, too. Let's be honest, there's something a high-class woman has that a high-class girl doesn't.");
	App.Events.addNode(t, r, "p", "note");

	App.Encyclopedia.addArticleSource(t, "Free Cities Fashion (FCF), January 2032", "Van Diemen, D. C. G.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "DJ", ["bold"]));
	r.push("can be selected once the", link("Club"), "facility is built.");
	r.push("DJs apply a multiplier to", link("reputation", "Arcologies and Reputation", "green"), "gains from serving in the club.");
	r.push("Entertainment skills, toned but not massive", link("muscles", "Musculature"), App.UI.DOM.makeElement("span", "intelligence", ["cyan"]), "and a pretty face make a good DJ.");
	App.Events.addParagraph(t, r);

	r = [];
	r.push("If a DJ isn't responsible for enough sluts to occupy her full time, she'll spend time fucking citizens herself. This is exactly the same as", link("Public Service"), "out of the Club: she'll benefit from any", link("Advertising"), "or", link("Variety"), "bonuses available, and will even benefit from her own leadership skills.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Farmer", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	let r = [];

	r.push("A", App.UI.DOM.makeElement("span", "Farmer", ["bold"]), "can be selected once the", link("Farmyard"), "facility is built.");
	r.push("Having applicable", link("career experience", "Career Experience"), "and strong", link("muscles", "Musculature"), "allow a Farmer to maintain the different crops and animals.");
	App.Events.addNode(t, r, "div");

	App.Events.addNode(t, ["This description needs to be expanded."], "div", "note");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Head Girl", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion", colour = "hotpink") => link(text, "From Rebellious to Devoted", colour);
	const trust = (text = "trust") => link(text, "Trust", "mediumaquamarine");
	const t = new DocumentFragment();
	let r = [];

	r.push("Most Free Cities slaveowners eventually find it convenient to promote a", trust("trusting"), "slave to a position over others.");
	r.push("The stable of slaves necessary to present a proper public image has become so large that assistance managing and overseeing slaves is quite useful.");
	r.push("In addition, such a slave can be an example to lesser livestock.");
	App.Events.addNode(t, r, "div", "note");

	r = [];
	r.push("A good Head Girl will be", devotion("devoted"), "to her master and sexually skilled.");
	r.push("Experienced slaveowners have also found that an older slave girl is often more effective than a young one.");
	r.push("Since slavery is new, older slave girls will have spent part of their adult lives as free women, and have a deeper body of life experience to draw on.");
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("Naturally, some slaveowners form a strong emotional bond with their Head Girl.");
	r.push(trust("Trusting"), "and relying on a close companion can begin to resemble old world relationships.");
	r.push("It is a paradox of modern Free Cities life that such closeness is strongly frowned upon.");
	r.push("Rumors that a prominent person is emotionally involved with his or her Head Girl can be as socially devastating as rumors of infidelity were a hundred years ago.");
	App.Events.addNode(t, r, "p", "note");

	App.Encyclopedia.addArticleSource(t, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "Head Girl", ["bold"]));
	r.push("can be selected from among your", devotion("devoted"), "slaves immediately.");
	r.push("Duties are numerous, but mostly involve training slaves.");
	r.push("They will generally train whichever girls they think appropriate, but can be given some direction on the same menu used to select one.");
	r.push("Giving your", link("Head Girl a suite", "Head Girl Suite"), "and a personal slave will allow her to train an extra slave each week, an extremely powerful ability.");
	App.Events.addParagraph(t, r);

	r = [];
	r.push(devotion(), App.UI.DOM.makeElement("span", "intelligence", ["cyan"]), "and age over 30 all help Head Girls do well.");
	r.push("Head Girls will do better if they are comfortable with the arcology's", link("lingua franca"), ".");
	r.push("Skills are required when teaching that skill, meaning that slaves without vaginas cannot teach vaginal skills.");
	r.push("Conversely, slaves with functional dicks are better at teaching other sexual skills.");
	r.push("Also having max sex skills, dom as their fetish and being your wife provide more boosts.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Madam", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	let r = [];

	r.push("Prostitution is indeed the oldest profession. It follows that the madam is probably the oldest managerial position.");
	App.Events.addNode(t, r, "div", "note");

	r = [];
	r.push("Free madams are very common in the Free Cities. As free prostitutes are priced out of their profession by slaves, many of the wealthiest are purchasing slaves and setting themselves up as madams. However, slave madams are becoming common as well.");
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("The selling of sex is one of the largest growth markets in the Free Cities. As has been confidently predicted by economists since the first Free City was founded, the near-anarchy of these new polities has accelerated the concentration of wealth that began in the final years of the twentieth century. Thus, the majority of free citizens of the Cities own no slaves, while the majority of slaves are owned by a very few extremely wealthy persons. Extremely large stables of slave whores are becoming common for those in the industry.");
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("Managing this many prostitutes is a science and an art. Naturally, it is not difficult to find slaves that are experienced in the sex trade. Setting slaves over other slaves has been a part of human slavery for all of recorded history; all of the tropes that once applied to the slave overseer in the field or the quarry now apply to the slave Madam in the brothel. The more experience they have in the field, the better they do.");
	App.Events.addNode(t, r, "p", "note");

	App.Encyclopedia.addArticleSource(t, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "Madam", ["bold"]), "can be selected once the", link("Brothel"), "facility is built.");
	r.push("Madams apply a multiplier to", link("income", "Money", "yellowgreen"), "from the brothel.");
	App.Events.addParagraph(t, r);

	r = [];
	r.push("Whoring skills, age over 35", App.UI.DOM.makeElement("span", "intelligence", ["cyan"]), "being your wife and a functional cock help a Madam.");
	App.Events.addParagraph(t, r);

	r = [];
	r.push("If a Madam isn't managing enough whores to occupy her full time, she'll sell herself as much as she has time for.");
	r.push("This is exactly the same as", link("whoring"), "out of the Brothel: she'll benefit from any", link("Advertising"), "or", link("Variety"), "bonuses available, and will even benefit from her own management skills.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Milkmaid", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion", colour = "hotpink") => link(text, "From Rebellious to Devoted", colour);
	const trust = (text = "trust") => link(text, "Trust", "mediumaquamarine");
	const t = new DocumentFragment();
	let r = [];

	r.push("Most slaveowners get into dairy as a hobby. Why not? It's fun, tasty, and sexy. But sooner or later, almost everyone who starts out with a few low-volume milkers hears the call of mass production. After all, if it's hot to have one slave to use as the milking machine holds her down, it's hotter to have a whole row of moaning milkers at your mercy.");
	App.Events.addNode(t, r, "div");

	r = [];
	r.push("Unfortunately, the everyday work of husbandry goes from an amusement to a chore as a herd grows. Helping a tired slave cow with huge tits up from a long milking is fun once a day, but it gets bothersome and backbreaking the tenth time one does it. What's to be done?");
	App.Events.addParagraph(t, r);

	r = [];
	r.push("Train a milkmaid! Any decently obedient slave will do, but the stronger the better. As you probably know by now, just because slave husbandry involves human stock doesn't mean it isn't hard work, just like traditional stock keeping! The traditional image of milkmaids might be girly and innocent, but we're after a good hale bitch that can lift, carry and scrub from dawn to dusk. If you're looking to economize, you can even use a slave too old or ugly to appeal in other, more sexual jobs. After all, when it comes to the third milking of the day, cows don't care how pretty the hands that examine their tits are.");
	App.Events.addParagraph(t, r);

	App.Encyclopedia.addArticleSource(t, "Free Cities Husbandry Weekly, February 16, 2032", "Banaszewski, Valerie P.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "Milkmaid", ["bold"]), "can be selected once the", link("Dairy"), "facility is built.");
	r.push("Having applicable", link("career experience", "Career Experience"), "and strong", link("muscles", "Musculature"), "allow a Milkmaid to help cows maintain their health.");
	r.push("If a Milkmaid is Funny or Caring, she can improve cow's", trust("trusting"), "resting point; if she has oral skills, she can improve their", devotion(), "resting point.");
	if (V.seeDicks !== 0) {
		r.push("If she has a very large dick capable of erection, a Milkmaid can assist cows with ejaculation if the Dairy is not already stimulating prostates.");
	}
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Nurse", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	const r = [];

	r.push("A", App.UI.DOM.makeElement("span", "Nurse", ["bold"]), "can be selected once the", link("Clinic"), "facility is built.");
	r.push("Nurses increase", link("health"), "gains in the Clinic, and play a major role in the prevention and treatment of", "illness among slaves.");
	r.push("Good Nurses are", link("nymphomaniacs", "Nymphomania"), ", highly", App.UI.DOM.makeElement("span", "intelligent,", ["cyan"]), "physically fit, and very beautiful.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Recruiter", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion", colour = "hotpink") => link(text, "From Rebellious to Devoted", colour);
	const rep = (text = "reputation") => link(text, "Arcologies and Reputation", "green");
	const t = new DocumentFragment();
	let r = [];

	r.push("A", App.UI.DOM.makeElement("span", "Recruiter", ["bold"]), "can be selected from among your", devotion("devoted"), "slaves immediately.");
	r.push(App.UI.DOM.makeElement("span", "Intelligence", ["cyan"]), "entertainment skills, and luxurious living standards help a recruiter convince vulnerable people to submit to voluntary enslavement.");
	r.push("Each targetable group is also more sympathetic to an appropriate recruiter.");
	App.Events.addNode(t, r, "div");
	App.Events.addNode(t, ["Desperate whores: a sexual veteran."], "div", ["indent"]);
	App.Events.addNode(t, ["Expectant mothers: visibly pregnant."], "div", ["indent"]);
	App.Events.addNode(t, ["Young migrants:", link("healthy"), "and pretty."], "div", ["indent"]);
	App.Events.addNode(t, ["Dissolute sissies: with a working dick."], "div", ["indent"]);
	App.Events.addNode(t, ["Reassignment candidates: pretty without working female reproductive organs."], "div", ["indent"]);
	App.Events.addNode(t, [], "p");

	r = [];
	r.push("Once your household reaches a significant number of slaves you may direct the Recruiter to do publicity instead of acquisitions, for a boost to");
	r.push(rep());
	r.push("and possibly advancing");
	r.push(link("future societies", "Future Societies"));
	r.push(". Activating this ability does not influence any other means of obtaining new slaves. (Note that 'Facilities & leadership' includes the Recruiter herself and a slot for Head Girl, two positions that do not require a facility.)");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Schoolteacher", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const t = new DocumentFragment();
	const r = [];

	r.push("A", App.UI.DOM.makeElement("span", "schoolteacher", ["bold"]), "can be selected once the", link("Schoolroom"), "facility is built.");
	r.push("Schoolteachers increase the rate at which students in the schoolroom learn.");
	r.push("Good schoolteachers appear older than 35, beautiful,", App.UI.DOM.makeElement("span", "intelligent", ["cyan"]), "and educated.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Stewardess", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion", colour = "hotpink") => link(text, "From Rebellious to Devoted", colour);
	const trust = (text = "trust") => link(text, "Trust", "mediumaquamarine");
	const t = new DocumentFragment();
	let r = [];

	r.push("Throughout recorded history, wherever there have been mature slave societies, there have been slave overseers set over their peers by their masters. Naturally, these individuals have simultaneously been among the most");
	r.push(trust("trusted"));
	r.push("to their masters, and among the most hated to their compatriots in slavery. They have perhaps the greatest interest in preservation of a slave society, since the masters have only the loss of property to fear by abolition; slave overseers would likely be less lucky.");
	App.Events.addNode(t, r, "p", "note");

	r = [];
	r.push("The stewardess is the modern, domestic expression of the old overseer. Many wealthy slaveowners keep an extensive stable of less valuable slaves around their estates to serve as labor, raw material for slave training, and targets for recreational abuse. Successful oversight of this often mulish mass of stock requires a high degree of");
	r.push(devotion());
	r.push("to the master's will, of course. Good health to put in the necessarily long hours also helps. Some slaveowners also find that a functional dick allows a Stewardess to add a useful element of sexual abuse to her ministrations.");
	App.Events.addNode(t, r, "p", "note");

	App.Encyclopedia.addArticleSource(t, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	r = [];
	r.push("A", App.UI.DOM.makeElement("span", "Stewardess", ["bold"]), "can be selected once the", link("Servants' Quarters"), "facility is built.");
	r.push("Stewardesses increase the upkeep reduction effects of servants working out of the servants' quarters. Being older than 35, having good");
	r.push(link("health"), ",");
	r.push(App.UI.DOM.makeElement("span", "intelligence", ["cyan"]), "and");
	r.push(link("nymphomania"), "or");
	r.push(link("dominance", "Doms"));
	r.push("make a good Stewardess.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addArticle("Wardeness", function() {
	const link = (text, article, className) => App.Encyclopedia.link(text, article, className);
	const devotion = (text = "devotion", colour = "hotpink") => link(text, "From Rebellious to Devoted", colour);
	const t = new DocumentFragment();
	const r = [];

	r.push("A", App.UI.DOM.makeElement("span", "Wardeness", ["bold"]), "can be selected once the");
	r.push(link("Cellblock"));
	r.push("facility is built. Wardenesses increase the rate at which slaves in the cellblock are broken. Very high");
	r.push(devotion(), ",", link("nymphomania"), "or");
	r.push(link("sadism", "Sadists"), ", strong");
	r.push(link("muscles", "Musculature"), ", applicable");
	r.push(link("career experience"), ", and a solid dick make a powerful Wardeness.");
	App.Events.addNode(t, r, "div");

	return t;
}, "slaveLeaders");

App.Encyclopedia.addCategory("slaveLeaders", function() {
	const r = [];
	r.push(App.Encyclopedia.link("Leadership Positions"));
	r.push(App.Encyclopedia.link("Career Experience"));
	r.push(App.Encyclopedia.link("Attendant"));
	r.push(App.Encyclopedia.link("Matron"));
	r.push(App.Encyclopedia.link("Bodyguard"));
	r.push(App.Encyclopedia.link("Concubine"));
	r.push(App.Encyclopedia.link("DJ"));
	r.push(App.Encyclopedia.link("Farmer"));
	r.push(App.Encyclopedia.link("Head Girl"));
	r.push(App.Encyclopedia.link("Madam"));
	r.push(App.Encyclopedia.link("Milkmaid"));
	r.push(App.Encyclopedia.link("Nurse"));
	r.push(App.Encyclopedia.link("Recruiter"));
	r.push(App.Encyclopedia.link("Schoolteacher"));
	r.push(App.Encyclopedia.link("Stewardess"));
	r.push(App.Encyclopedia.link("Wardeness"));
	return App.UI.DOM.generateLinksStrip(r);
});


code:
App.Encyclopedia.addArticle("Slave Modification", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push("What would a slaveowner be without the ability to customize their slaves' bodies?");
	r.push("The Free Cities offer a variety of ways to achieve this for an arcology owner.");
	r.push("Choose a more particular entry below:");
	r.toNode("div");
	return t;
}, "slaveModification");

App.Encyclopedia.addArticle("Corrective Diet", function() {
	return App.UI.DOM.makeElement("div", "Using the upgraded kitchen to monitor a slave's caloric intake allows for diets to be tailored to slowly increase or decrease their weight without them realizing.");
}, "slaveModification");

App.Encyclopedia.addArticle("Nipple Conversion — Penetratable", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push("By taking extremely large nipples and inverting them into an adequately sized breast, it is possible to use an advanced surgical suite to create a cavity suitable for penetration.");
	r.push("Early attempts found that the novelty of fucking a tit did not offset the discomfort of ramming one's dick into a solid object and as such, the surgery is only applicable to slaves with at least 500ccs of breast tissue per boob.");
	r.push("Milk production is unhindered by the alterations, though non-machine milking is far more difficult without a nipple to grab and it is unlikely to be able to properly nourish a child.");
	r.push("Arousal is also expressed differently, as the nipple cannot stiffen any longer; instead, engorgement causes the newly crafted passage to tighten, adding to the pleasure of using the unorthodox hole.");
	r.push("While looseness is no issue, and the orifice quite capable of stretching around an intruding shaft, depth can become a problem; even the most average of slaveowners will find themselves bottoming out far sooner than they would like.");
	r.push("Fortunately, this downside is offset by the novelty of the act and the capacity to push the nipple itself deeper into the slave's breast to better accommodate one's cock.");
	r.push("In this case, bigger really is better.");
	r.toNode("div");
	return t;
}, "slaveModification");

App.Encyclopedia.addArticle("Ejaculation Boosting Prostate Implant", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push("An additional prostate implant designed to hyperstimulate one's prostate and store the resulting fluid for release during ejaculation in a specialized reservoir.");
	r.push("An easy way to tell if the precum soaked slave you are fucking is sporting this implant is the distinct swelling in her lower belly as she nears release.");
	r.push("Due to the sheer amount of prostate fluid released, sperm per volume is greatly reduced, devastating profits of those looking to sell cum.");
	r.push("Remember to keep your slaves well hydrated!");
	r.toNode("div");
	return t;
}, "slaveModification");

App.Encyclopedia.addCategory("slaveModification", function(currentArticle) {
	const links = [];
	if (currentArticle !== "Slave Modification") {
		links.push(App.Encyclopedia.link("Slave Modification"));
	}
	links.push(App.Encyclopedia.link("Corrective Diet"));
	links.push(App.Encyclopedia.link("Nipple Conversion — Penetratable"));
	links.push(App.Encyclopedia.link("Ejaculation Boosting Prostate Implant"));
	return App.UI.DOM.generateLinksStrip(links);
});


code:
App.Encyclopedia.addArticle("Quirks", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Quirks", ["bold"]));
	r.push("are positive slave qualities. They increase slaves' value and performance at sexual assignments, and each quirk also has other, differing effects. Each quirk is associated with a corresponding");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), ", and each slave can have two quirks (a sexual quirk and a behavioral quirk), just like flaws. Quirks may appear randomly, but the most reliable way to give slaves quirks is to soften flaws."));
	r.toParagraph();

	r.push("The", App.Encyclopedia.link("Head Girl"), "can be ordered to soften flaws, the");
	r.push(App.Encyclopedia.link("Attendant"), "can soften the flaws of slaves resting in the", App.UI.DOM.combineNodes(App.Encyclopedia.link("Spa"), ","));
	r.push("and the player character can soften flaws with personal attention. Certain flaws can also be naturally softened into quirks by fetishes, high libido, or other factors.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Adores men", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Adores men", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("hates women"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.Encyclopedia.link("pregnancy fetishists", "Pregnancy Fetishists"), "if capable of becoming pregnant, or", App.Encyclopedia.link("cumsluts"), "otherwise.");
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("trust", "Trust", "mediumaquamarine"), "on", App.Encyclopedia.link("fucktoy"), "duty if the player character is masculine, and increased chance of gaining additional XY attraction.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Adores women", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Adores women", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("hates men"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.Encyclopedia.link("pregnancy fetishists", "Pregnancy Fetishists"), "if capable of impregnating others, or", App.Encyclopedia.link("breast fetishists", "Boob Fetishists"), "otherwise.");
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("trust", "Trust", "mediumaquamarine"), "on", App.Encyclopedia.link("fucktoy"), "duty if the player character is feminine, and increased chance of gaining additional XX attraction.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Advocate", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Advocate", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("liberated"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("submissive", "Submissives"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "while performing");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.link("public service", "Public Service"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Confident", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Confident", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("arrogant"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("doms"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("trust", "Trust", "mediumaquamarine"), "on", App.Encyclopedia.link("fucktoy"), "duty.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Cutting", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Cutting", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("bitchy"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("sadists"), ", and the quirk can also reinforce an existing"), App.UI.DOM.combineNodes(App.Encyclopedia.link("dominance fetish", "Doms"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "while performing", App.UI.DOM.combineNodes(App.Encyclopedia.link("whoring"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Fitness", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Fitness", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("gluttonous"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they gain additional sex drive each week, and are better at working out.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Funny", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Funny", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("odd"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("masochists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "while performing", App.UI.DOM.combineNodes(App.Encyclopedia.link("public service", "Public Service"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Insecure", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Insecure", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("anorexic"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("submissive", "Submissives"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus", App.Encyclopedia.link("trust", "Trust", "mediumaquamarine"), "on", App.Encyclopedia.link("fucktoy"), "duty.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Sinful", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Sinful", ["bold"]), "is a behavioral", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("devout"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("humiliation fetishists", "Humiliation Fetishists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus", App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "when in incestuous relationships and while performing", App.UI.DOM.combineNodes(App.Encyclopedia.link("whoring"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Caring", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Caring", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("apathetic"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("submissive", "Submissives"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "while performing");
	r.push(App.Encyclopedia.link("whoring"), "and nannying.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Gagfuck Queen", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Gagfuck Queen", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("hates oral"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("cumsluts"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they enjoy living in a penthouse upgraded with phallic food dispensers.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Painal Queen", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Painal Queen", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("hates anal"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("buttsluts"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they enjoy living in a penthouse upgraded with dildo drug dispensers.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Perverted", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Perverted", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("repressed"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.UI.DOM.combineNodes(App.Encyclopedia.link("humiliation fetishists", "Humiliation Fetishists"), ".")));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "when in incestuous relationships, and gain additional sex drive each week.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Romantic", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Romantic", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("idealistic"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("pregnancy fetishists", "Pregnancy Fetishists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("trust", "Trust", "mediumaquamarine"), "on", App.Encyclopedia.link("fucktoy"), "duty.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Size Queen", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Size Queen", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("judgemental"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("buttsluts"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they will enjoy relationships with well-endowed, virile slaves so much their partners will get");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "benefits, too.");
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Strugglefuck Queen", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Strugglefuck Queen", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("hates penetration"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("masochists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, this Quirk avoids");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "losses if the slave is assigned to be a");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.link("sexual servant", "Sexual Servitude"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Tease", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Tease", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("shamefast"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("humiliation fetishists", "Humiliation Fetishists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they get bonus");
	r.push(App.Encyclopedia.link("devotion", "From Rebellious to Devoted", "hotpink"), "while performing");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.link("public service", "Public Service"), "."));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addArticle("Unflinching", function() {
	const f = new DocumentFragment();
	const r = new SpacedTextAccumulator(f);
	r.push(App.UI.DOM.makeElement("span", "Unflinching", ["bold"]), "is a sexual", App.Encyclopedia.link("quirk", "Quirks"), "developed from the");
	r.push(App.Encyclopedia.link("crude"), App.UI.DOM.combineNodes(App.Encyclopedia.link("flaw", "Flaws"), "."));
	r.push("Slaves may naturally become", App.UI.DOM.combineNodes(App.Encyclopedia.link("masochists"), "."));
	r.push("In addition to the standard value and sexual assignment advantages, they will experience a partial rebound during weeks in which they lose");
	r.push(App.Encyclopedia.link("devotion.", "From Rebellious to Devoted", "hotpink"));
	r.toNode("div");

	return f;
}, "slaveQuirks");

App.Encyclopedia.addCategory("slaveQuirks", function() {
	const f = new DocumentFragment();
	let r = [];
	r.push(App.Encyclopedia.link("Adores men"));
	r.push(App.Encyclopedia.link("Adores women"));
	r.push(App.Encyclopedia.link("Advocate"));
	r.push(App.Encyclopedia.link("Confident"));
	r.push(App.Encyclopedia.link("Cutting"));
	r.push(App.Encyclopedia.link("Fitness"));
	r.push(App.Encyclopedia.link("Funny"));
	r.push(App.Encyclopedia.link("Insecure"));
	r.push(App.Encyclopedia.link("Sinful"));
	App.Events.addNode(f, ["Behavioral ", App.UI.DOM.combineNodes(App.Encyclopedia.link("Quirks"), ":"), App.UI.DOM.generateLinksStrip(r)], "div");

	r = [];
	r.push(App.Encyclopedia.link("Caring"));
	r.push(App.Encyclopedia.link("Gagfuck Queen"));
	r.push(App.Encyclopedia.link("Painal Queen"));
	r.push(App.Encyclopedia.link("Perverted"));
	r.push(App.Encyclopedia.link("Romantic"));
	r.push(App.Encyclopedia.link("Size Queen"));
	r.push(App.Encyclopedia.link("Strugglefuck Queen"));
	r.push(App.Encyclopedia.link("Tease"));
	r.push(App.Encyclopedia.link("Unflinching"));
	App.Events.addNode(f, ["Sexual ", App.UI.DOM.combineNodes(App.Encyclopedia.link("Quirks"), ":"), App.UI.DOM.generateLinksStrip(r)], "div");

	return f;
});


code:
App.Encyclopedia.addArticle("Relationships", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		"Slaves can develop many different", App.UI.DOM.makeElement("span", "relationships", ["bold"]), "as they become accustomed to their lives, which offer many benefits and some downsides.",
		"It is possible for the player to push slaves towards one kind of relationship or another, but slaves' feelings are less susceptible to complete control than their bodies.",
		"All relationships in Free Cities are one-to-one, which is a limitation imposed by Twine."
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Rivalries", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Rivalries", ["bold"]), "tend to arise naturally between slaves on the same assignment.",
		"Slaves may enjoy rivals' misfortunes, but bickering on the job between rivals will impede performance if the rivals remain on the same assignment.",
		"Rivals will also dislike working with each other.",
		"Rivalries may be defused naturally with time apart, or suppressed by rules.",
		"Rivalries impede the formation of", App.Encyclopedia.link("romances"), ", but a romance can defuse a rivalry."
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Romances", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Romances", ["bold"]), "tend to arise naturally between slaves on the same assignment, and between slaves having a lot of sex with each other.",
		"Slaves will be saddened by their romantic partners' misfortunes, but will do better on public sexual assignments if assigned to work at the same job as a romantic partner.",
		"Slaves will also derive various mental effects from being in a relationship: they can rely on each other, take solace in each other's company, and even learn fetishes from each other.",
		"Romances can be suppressed by the rules, or fall apart naturally.",
		"On the other hand, romances can develop from friendships, to best friendships, to friendships with benefits, to loving relationships.",
		"Romances impede the formation of", App.Encyclopedia.link("rivalries"), "and can defuse them.",
		"Once a romance has advanced to where the slaves are lovers, its members are eligible for several events in which the couple can be", App.Encyclopedia.link("married.", "Slave Marriages")
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Emotionally Bonded", function() {
	const devotion = (text) => App.Encyclopedia.link(text, "From Rebellious to Devoted", "hotpink");
	const trust = (text) => App.Encyclopedia.link(text, "Trust", "mediumaquamarine");
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Emotionally Bonded", ["bold"]), "slaves have become so", devotion("devoted"), "to the player character that they define their own happiness mostly in terms of pleasing the PC.",
		"Slaves may become emotionally bonded if they become perfectly", devotion("devoted"), "and", trust("trusting"), "without being part of a", App.Encyclopedia.link("romance.", "Romances"),
		"They receive powerful mental benefits — in fact, they are likely to accept anything short of sustained intentional abuse without lasting displeasure — and perform better at the",
		App.Encyclopedia.link("servitude"), "and", App.Encyclopedia.link("fucktoy"), "assignments.",
		"The most reliable way of ensuring a slave's development of emotional bonds is to have her assigned as a fucktoy or to the",
		App.Encyclopedia.link("Master suite"), "as she becomes perfectly", devotion("devoted"), "and", trust("trusting.")
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Emotional Slut", function() {
	const devotion = (text) => App.Encyclopedia.link(text, "From Rebellious to Devoted", "hotpink");
	const trust = (text) => App.Encyclopedia.link(text, "Trust", "mediumaquamarine");
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Emotional sluts", ["bold"]), "are slaves who have lost track of normal human emotional attachments, seeing sex as the only real closeness.",
		"Slaves may become emotional sluts if they become perfectly", devotion("devoted"), "and", trust("trusting"), "without being part of a", App.Encyclopedia.link("romance.", "Romances"),
		"They receive powerful mental benefits, though they will be disappointed if they are not on assignments that allow them to be massively promiscuous, and perform better at the", App.Encyclopedia.link("whoring"), "and", App.Encyclopedia.link("public service", "Public Service"), "assignments.",
		"The most reliable way of ensuring a slave's development into an emotional slut is to have her assigned as a public servant or to the", App.Encyclopedia.link("Club"), "as she becomes perfectly", devotion("devoted"), "and", trust("trusting"), "."
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Slave Marriages", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Slave Marriages", ["bold"]), "take place between two slaves.",
		"Several random events provide the opportunity to marry slave lovers. Slave Marriages function as an end state for slave",
		App.Encyclopedia.link("romances"), ";", "slave wives receive the best relationship bonuses, and can generally be depended upon to help each other be good slaves in various ways. The alternative end states for slaves' emotional attachments are the",
		App.Encyclopedia.link("emotional slut", "Emotional Slut"), "and", App.Encyclopedia.link("emotionally bonded", "Emotionally Bonded"), "statuses, both of which are for a single slave alone."
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addArticle("Slaveowner Marriages", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Slaveowner Marriages", ["bold"]), ", marriages between a", App.Encyclopedia.link("devoted", "From Rebellious to Devoted", "hotpink"), "slave and the player character, require passage of a slaveowner marriage policy unlocked by advanced", App.Encyclopedia.link("paternalism"), ". Once this policy is in place,",
		App.Encyclopedia.link("emotionally bonded", "Emotionally Bonded"), "slaves can be married.",
		"There is no limit to the number of slaves a paternalist player character can marry.",
		"Marriage to the player character functions as a direct upgrade to being emotionally bonded."
	], "div");
	return t;
}, "SlaveRelationships");

App.Encyclopedia.addCategory("SlaveRelationships", function() {
	const r = [];
	r.push(App.Encyclopedia.link("Relationships"));
	r.push(App.Encyclopedia.link("Rivalries"));
	r.push(App.Encyclopedia.link("Romances"));
	r.push(App.Encyclopedia.link("Emotionally Bonded"));
	r.push(App.Encyclopedia.link("Emotional Slut"));
	r.push(App.Encyclopedia.link("Slave Marriages"));
	r.push(App.Encyclopedia.link("Slaveowner Marriages"));
	return App.UI.DOM.generateLinksStrip(r);
});


code:
App.Encyclopedia.addArticle("Skills", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [App.UI.DOM.makeElement("span", "Future room for lore text", ["note"])], "div");
	App.Events.addNode(t, ["Choose a more particular entry below:"], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addArticle("Anal Skill", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Anal skill", ["bold"]), "improves performance on sexual assignments and is available in three levels.",
		"Training methods include schooling (up to level one), plugs (up to level one), personal attention (unlimited), Head Girl attention (up to the Head Girl's skill), and on the job experience (unlimited).",
		App.Encyclopedia.link("Anus", "Anuses"), "surgery can reduce this skill."
	], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addArticle("Combat Skill", function() {
	const r = new SpacedTextAccumulator();
	r.push(App.UI.DOM.makeElement("span", "Combat skill", ["bold"]), "is a slaves combat experience and schooling.",
		"It can be roughly split into three stages.",
		"The first stage is basic skill in hand-to-hand combat as well as common melee and ranged weapons usage.", // 0-30
		"The second stage is high skill in common weapons and their maintenance as well as basic skill in exotic weaponry. It also includes basic skill in protection tasks and group combat ability.", // 31-60
		"The last stage perfects the slaves usage of all weaponry and refines their tactical abilities.", // 61-100
	);
	r.toParagraph();
	r.push("It improves performance in lethal and nonlethal pit fights and performance as the Bodyguard.",
		"Training methods are limited to on the job experience (including pit fights), successor training and events.",
		"Only your bodyguard with their constant training can reach the last stage.");
	r.toParagraph();
	return r.container();
}, "SlaveSkills");

App.Encyclopedia.addArticle("Entertainment Skill", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Entertainment skill", ["bold"]), "is available in three levels.",
		"It improves performance on all sexual assignments, though it affects public service or working in the club most.",
		"Training methods include schooling (up to level one), personal attention (up to level one), Head Girl attention (up to the Head Girl's skill), and on the job experience (unlimited)."
	], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addArticle("Oral Skill", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Oral skill", ["bold"]), "improves performance on sexual assignments and is available in three levels.",
		"Training methods include schooling (up to level one), gags (up to level one), personal attention (unlimited), Head Girl attention (up to the Head Girl's skill), and on the job experience (unlimited).",
		App.Encyclopedia.link("Lip", "Lips"), "surgery can reduce this skill."
	], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addArticle("Vaginal Skill", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Vaginal skill", ["bold"]), "improves performance on sexual assignments and is available in three levels.",
		"Training methods include schooling (up to level one), plugs (up to level one), personal attention (unlimited), Head Girl attention (up to the Head Girl's skill), and on the job experience (unlimited).",
		"Slaves without vaginas cannot learn or teach this skill, limiting their ultimate skill ceiling.",
		App.Encyclopedia.link("Vagina", "Vaginas"), "surgery can reduce this skill."
	], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addArticle("Whoring Skill", function() {
	const t = new DocumentFragment();
	App.Events.addNode(t, [
		App.UI.DOM.makeElement("span", "Whoring skill", ["bold"]), "is available in three levels.",
		"It improves performance on all sexual assignments, though it affects whoring or working in the brothel most.",
		"Training methods include schooling (up to level one), personal attention (up to level one), Head Girl attention (up to the Head Girl's skill), and on the job experience (unlimited)."
	], "div");
	return t;
}, "SlaveSkills");

App.Encyclopedia.addCategory("SlaveSkills", function() {
	const r = [];
	r.push(App.Encyclopedia.link("Skills"));
	r.push(App.Encyclopedia.link("Anal Skill"));
	r.push(App.Encyclopedia.link("Combat Skill"));
	r.push(App.Encyclopedia.link("Entertainment Skill"));
	r.push(App.Encyclopedia.link("Oral Skill"));
	r.push(App.Encyclopedia.link("Vaginal Skill"));
	r.push(App.Encyclopedia.link("Whoring Skill"));
	r.push(App.Encyclopedia.link("Career Experience"));
	return App.UI.DOM.generateLinksStrip(r);
});


code:
App.Encyclopedia.addArticle("Terrain Types", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Future room for lore text", ["note"])], "div");
	App.Events.addNode(f, ["Choose a more particular entry below:"], "div");
	return f;
}, "Terrain");

App.Encyclopedia.addArticle("Urban Terrain", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Urban", ["bold"]), "terrain is one of the possible settings for the Free City in which the arcology is located. It provides:"], "div");
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Low", ["yellow"]), "minimum slave value and initial", App.UI.DOM.makeElement("span", "bear market", ["yellow"]), "for slaves."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["green"]), "ease of commerce with the old world."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["green"]), "access to refugees and other desperate people."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Low", ["red"]), "cultural independence."], "div", ["indent"]);
	return f;
}, "Terrain");

App.Encyclopedia.addArticle("Rural Terrain", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Rural", ["bold"]), "terrain is one of the possible settings for the Free City in which the arcology is located. It provides:"], "div");
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["yellow"]), "minimum slave value and initial", App.UI.DOM.makeElement("span", "bull market", ["yellow"]), "for slaves."], "div", ["indent"]);
	App.Events.addNode(f, ["Moderate ease of commerce with the old world."], "div", ["indent"]);
	App.Events.addNode(f, ["Moderate access to refugees and other desperate people."], "div", ["indent"]);
	App.Events.addNode(f, ["Moderate cultural independence."], "div", ["indent"]);
	return f;
}, "Terrain");

App.Encyclopedia.addArticle("Ravine Terrain", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Ravine", ["bold"]), "terrain is one of the possible settings for the Free City in which the arcology is located. It provides:"], "div");
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["yellow"]), "minimum slave value and initial", App.UI.DOM.makeElement("span", "bull market", ["yellow"]), "for slaves."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Low", ["red"]), "ease of commerce with the old world."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Very low", ["red"]), "access to refugees and other desperate people."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["green"]), "cultural independence."], "div", ["indent"]);
	return f;
}, "Terrain");

App.Encyclopedia.addArticle("Marine Terrain", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Marine", ["bold"]), "terrain is one of the possible settings for the Free City in which the arcology is located. It provides:"], "div");
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Moderate minimum slave value and initially balanced market for slaves.")], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Moderate ease of commerce with the old world.")], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Low", ["red"]), "access to refugees and other desperate people."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["green"]), "cultural independence."], "div", ["indent"]);
	return f;
}, "Terrain");

App.Encyclopedia.addArticle("Oceanic Terrain", function() {
	const f = new DocumentFragment();
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Oceanic", ["bold"]), "terrain is one of the possible settings for the Free City in which the arcology is located. It provides:"], "div");
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "High", ["yellow"]), "minimum slave value and initial", App.UI.DOM.makeElement("span", "bull market", ["yellow"]), "for slaves."], "div", ["indent"]);
	App.Events.addNode(f, ["Moderate ease of commerce with the old world."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Very low", ["red"]), "access to refugees and other desperate people."], "div", ["indent"]);
	App.Events.addNode(f, [App.UI.DOM.makeElement("span", "Very high", ["green"]), "cultural independence."], "div", ["indent"]);
	App.Events.addNode(f, ["Ensures access to slaves from all over the world and will not associate the arcology with a continent."], "div", ["indent"]);
	return f;
}, "Terrain");

App.Encyclopedia.addCategory("Terrain", function() {
	const f = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.link("Types", "Terrain Types"));
	r.push(App.Encyclopedia.link("Urban", "Urban Terrain"));
	r.push(App.Encyclopedia.link("Rural", "Rural Terrain"));
	r.push(App.Encyclopedia.link("Ravine", "Ravine Terrain"));
	r.push(App.Encyclopedia.link("Marine", "Marine Terrain"));
	r.push(App.Encyclopedia.link("Oceanic", "Oceanic Terrain"));
	App.Events.addNode(f, ["Terrain:", App.UI.DOM.generateLinksStrip(r)], "div");
	return f;
});


code:
App.Encyclopedia.addArticle("Table of Contents", function() {
	const outerDiv = document.createElement("div");
	outerDiv.classList.add("center");
	App.UI.DOM.appendNewElement("h3", outerDiv, "Introduction");
	lineLink(outerDiv, "Playing Free Cities");

	App.UI.DOM.appendNewElement("h3", outerDiv, "The Player Character");
	lineLink(outerDiv, "Design your master", "Design Your Master");
	lineLink(outerDiv, "Being in Charge");
	lineLink(outerDiv, "PC Skills");

	App.UI.DOM.appendNewElement("h3", outerDiv, "Your Slaves");
	lineLink(outerDiv, "Slaves");
	lineLink(outerDiv, "Obtaining Slaves");
	let div = document.createElement("div");
	div.append(App.Encyclopedia.link("Slave Leaders", "Leadership Positions"), " / ",
		App.Encyclopedia.link("Assignments", "Slave Assignments"));
	outerDiv.append(div);
	div = document.createElement("div");
	div.append(App.Encyclopedia.link("Slave Body", "Body"), " / ",
		App.Encyclopedia.link("Skills"));
	outerDiv.append(div);
	div = document.createElement("div");
	div.append(App.Encyclopedia.link("Slave Fetishes", "Fetishes"), " / ",
		App.Encyclopedia.link("Paraphilias Overview"));
	outerDiv.append(div);
	div = document.createElement("div");
	div.append(App.Encyclopedia.link("Quirks"), " / ",
		App.Encyclopedia.link("Flaws"));
	outerDiv.append(div);
	lineLink(outerDiv, "Slave Relationships", "Relationships");
	lineLink(outerDiv, "Slave Health", "Health");
	div = document.createElement("div");
	div.append(App.Encyclopedia.link("Slave Pregnancy", "Pregnancy"), " / ",
		App.Encyclopedia.link("Inflation"));
	outerDiv.append(div);
	lineLink(outerDiv, "Slave Modification");

	App.UI.DOM.appendNewElement("h3", outerDiv, "Your Arcology");
	lineLink(outerDiv, "The X-Series Arcology");
	lineLink(outerDiv, "Arcology Facilities", "Facilities Overview");
	lineLink(outerDiv, "Terrain Types");
	lineLink(outerDiv, "Future Societies");
	lineLink(outerDiv, "The Black Market");

	App.UI.DOM.appendNewElement("h3", outerDiv, "Extras");
	lineLink(outerDiv, "Mods/Pregmod");
	lineLink(outerDiv, "Lore");
	lineLink(outerDiv, "Credits");
	return outerDiv;

	function lineLink(container, text, article) {
		App.UI.DOM.appendNewElement("div", container, App.Encyclopedia.link(text, article));
	}
}, "toc");