code:
App.Encyclopedia.addArticle("Body", function() {
	const fragment = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", fragment, "Future room for lore text", "note");
	App.UI.DOM.appendNewElement("div", fragment, "Choose a more particular entry below:");
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Waist", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("waist"));
	r.push(`contributes to beauty. Waists can be altered permanently by corsets over time, or quickly in the surgery. (wiki: needs more technical detail)`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Anuses", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("anuses"));
	r.push(`are a valuable commodity. Like`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"),
		`,`
	));
	r.push(`they appear in four degrees of tightness: virgin and three increasing levels of looseness. Tighter anuses improve performance at sexual assignments, but most methods of learning `);
	r.push(App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"));
	r.push(`tend to loosen anuses. Assigning a virgin to sex work will result in a one-time bonus to performance, but may anger her and can result in skipping up one level of looseness. A virgin anus applies a moderate cost multiplier for slave purchase or sale. Anuses can be loosened by events, strenuous sex work, or plug accessories; they can be tightened with rest from strenuous sex work, personal attention, or the autosurgery, though such surgery can reduce`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Areolae", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("areolae"));
	r.push(`can be altered in size or shape through surgery. (wiki: needs more technical detail)`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Breasts", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("breasts"));
	r.push(`contribute to beauty. They can be enlarged with`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`, intense`
	));
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"),
		`,`
	));
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("weight gain", "Weight"),
		`, or surgery (which`
	));
	r.push(App.Encyclopedia.Dialog.linkDOM("boob fetishists", "Boob Fetishists"));
	r.push(`will be grateful for).`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Clits", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("clits"));
	r.push(`contribute to beauty. (wiki: needs more technical detail)`);
	// TODO: how are clits tied to dicks, vaginas, and hormones?
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Dicks", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("dicks"));
	r.push(`are less straightforward than`);

	r.push(App.Encyclopedia.Dialog.linkDOM("anuses", "Anuses"));
	r.push(`or `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"), `.`
	));
	r.push(`At game start, larger dicks reduce slave value, though this can be reduced or even reversed by some future society choices. Slaves will remain capable of erection so long as they retain `);
	r.push(App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"));
	r.push(`and are not on `);
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("female hormone treatments", "Hormones (XX)"), `.`));
	App.Events.addParagraph(fragment, r);
	fragment.append(App.Encyclopedia.Dialog.linkDOM("Clits?", "Clits"));
	// TODO: how do dicks and clits relate, future coder?
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Ethnicity", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("ethnicity"));
	r.push(`affects random slave generation; the game produces bodies according to broad phenotypes. For example, black hair is almost universal among randomly generated Asian slaves. Its only other impact at game start is that white slaves enjoy a minor bonus to beauty, modeling the near-universal reach of western standards of beauty. Racially based future societies can apply ethnic bonuses or penalties to beauty, changing this landscape.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Faces", function() {
	const fragment = new DocumentFragment();
	let r = [];
	for (const [key, shape] of App.Medicine.Modification.faceShape) {
		if (!shape.hasOwnProperty("requirements") || shape.requirements) {
			r.push(App.UI.DOM.makeElement("span", capFirstChar(key), "note"));
			r.push(shape.desc);
			App.Events.addNode(fragment, r, "div");
			r = [];
		}
	}
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("faces"));
	r.push(`contribute heavily to beauty. They occur in six shapes and seven levels of attractiveness, which can be affected by surgery or, if the slave is unattractive or masculine, intensive `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`.`
	));
	r.push(`Unlike most other attributes, a slave's face cannot be improved more than two steps by surgery. The autosurgery upgrade removes this limitation.`);
	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(App.UI.DOM.makeElement("h2", `Facial shapes and beauty`));
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Height", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("height"));
	r.push(`contributes to beauty and improves combat effectiveness. It is measured in`); // TODO: link to CE?
	if (V.showInches === 2) {
		r.push(`inches,`);
	} else {
		r.push(`centimeters,`);
	}
	r.push(`though the game handles it in terms of ranges; beyond ${heightToEitherUnit(190)}, all very tall slaves will be treated almost identically. Height can be affected by surgery, and younger slaves can also see minor hormonal impacts on height. Unlike most other attributes, a slave's height cannot be changed more than one step by surgery.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hips", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("hips"));
	r.push(`contribute to beauty. (wiki: needs more technical detail)`);
	// TODO: how are clits tied to dicks, vaginas, and hormones?
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Lactation", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves can begin to`);
	r.push(App.Encyclopedia.topic("lactate"));
	r.push(`two ways: naturally due to pregnancy or constant stimulation, or artificially, through surgical implantation of a slow-release lactation-inducing drug pellet. Drug-induced lactation is more copious, but may damage `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("health", "Health"),
		`. Larger `
	));
	r.push(App.Encyclopedia.Dialog.linkDOM("breasts", "Breasts"));
	r.push(`will produce more milk, but not linearly: diminishing returns apply to bigger tits. Happy and `);
	r.push(App.Encyclopedia.Dialog.linkDOM("healthy", "Health"));
	r.push(`cows are also more productive, and slaves with`);
	r.push(App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"));
	r.push(`enjoy a bonus to milk production. Natural lactation will dry up over time if not constantly maintained.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Lips", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("lips"));
	r.push(`contribute to beauty. At very large sizes, they will alter dialog, though this has no mechanical effect. They can be enlarged with targeted growth hormones or surgery, but such surgery can reduce `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("oral skill", "Oral Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Musculature", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("musculature"));
	r.push(`occurs in seven levels, and affects combat effectiveness, beauty, and the effects of breasts. For combat, the penultimate level is best. At game start, muscles are a minor detriment to beauty, though this can be changed through `);
	r.push(App.Encyclopedia.Dialog.linkDOM("future society", "Future Societies"));
	r.push(`choices. Extremely large breasts can begin to hinder slaves, but the first level will allow them to carry their burdens.`);
	App.Events.addParagraph(fragment, r);
	r = [];

	r.push(`From the slave documentation;`);
	const table = App.UI.DOM.makeElement("table", null, "invisible");
	r.push(table);
	App.UI.DOM.makeRow(table, `96`, `100`, `extremely muscular`);
	App.UI.DOM.makeRow(table, `31`, `95`, `muscular`);
	App.UI.DOM.makeRow(table, `6`, `30`, `toned`);
	App.UI.DOM.makeRow(table, `-5`, `5`, `none`);
	App.UI.DOM.makeRow(table, `-30`, `-6`, `weak`);
	App.UI.DOM.makeRow(table, `-95`, `-31`, `very weak`);
	App.UI.DOM.makeRow(table, `-100`, `-96`, `frail`);

	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(`A standard`);
	r.push(App.Encyclopedia.Dialog.linkDOM("bodyguard", "Bodyguard"));
	r.push(`is negatively impacted by being weak or extremely muscular and positively impacted by being muscular. A slave that is at the max of tall or very tall (>= 185) can handle being extremely muscular.`);
	App.Events.addParagraph(fragment, r);
	App.UI.DOM.appendNewElement("p", fragment, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("DJ", "DJ"),
		`'s are more effective when they are just under being muscular and inside being toned.`
	));

	App.UI.DOM.appendNewElement("p", fragment, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Nurse", "Nurse"),
		` is more effective when they are toned or greater.`
	));
	App.UI.DOM.appendNewElement("p", fragment, `Values >= 95 allows slaves with extremely hypertrophied balls (>70) to move around with effort.`);

	return fragment;
}, "body");

App.Encyclopedia.addArticle("Nipples", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("nipples"));
	r.push(`have varying effects, depending on their shape. Tiny nipples have a negative effect on beauty, puffy and inverted nipples improve it, huge nipples improve it more strongly, and all others have no effect. Inverted and partially inverted nipples can be permanently protruded by nipple piercings or milking: this is uncomfortable, and will reduce`);
	r.push(App.UI.DOM.makeElement("span",
		App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"
	));
	r.push(`unless the slave is a`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("masochist", "Masochists"),
		`. Tiny nipples can be enlarged with `,
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`, huge nipples can be reduced with `,
		App.Encyclopedia.Dialog.linkDOM("XY hormones", "Hormones (XY)"),
		`, breast growth hormones will grow and may invert nipples, and breast implantation may damage nipples enough to shrink them slightly.`
	));

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Ovaries", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("ovaries"));
	r.push(`are necessary for pregnancy and provide a small amount of natural XX hormones. An oophorectomy, available with extreme content enabled, will render a slave barren and stop ovaries' hormonal effects, producing a slave with no natural hormones. Barren slaves do suffer penalties under some future society choices, but do not require costly contraceptives to avoid pregnancy. Ovaries grant a bonus to `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Pregnancy", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves require both`);
	r.push(App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"));
	r.push(`and`);
	r.push(App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"));
	r.push(`to become pregnant. However, it's rumored that Gender Radicalist societies have developed a method for `);
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("male impregnation", "Gender Radicalism Research"), "."));
	r.push(`Fertile slaves can be impregnated by the player character or a slave with`);
	r.push(App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"));
	r.push(`from the fertile slave's individual menu. Otherwise, slaves with vaginas and ovaries who aren't wearing chastity belts or taking contraceptives, and have not had their tubes tied via surgery, will likely become pregnant if performing sexual jobs or if allowed to have sex with slaves with balls. Pregnancy has a number of minor physical effects and will induce`);
	r.push(App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Skin Distinctions", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves can have various`);
	r.push(App.Encyclopedia.topic("skin distinctions,"));
	r.push(`including freckles, heavy freckling, beauty marks, and birthmarks. Beauty marks and birthmarks can be removed in the Salon.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Freckles", "italics"));
	r.push(`of both densities will slightly improve a slave's `);
	App.Encyclopedia.Dialog.linkDOM("attractiveness score", "Slave Score (Attractiveness)");
	r.push(`if she has pale or fair skin, and slightly improve it again if she has red hair.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Beauty marks,", "italics"));
	r.push(`otherwise known as facial moles, will improve a slave's`);
	App.Encyclopedia.Dialog.linkDOM("attractiveness score", "Slave Score (Attractiveness)");
	r.push(`if she has a gorgeous `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("face", "Faces"),
		`, reduce it if she has an average or worse face, and have no effect if she has a very pretty face.`
	));
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Birthmarks", "italics"));
	r.push(`will improve a slave's attractiveness score if she is prestigious, and reduce it if she is not.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Teeth", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("teeth"));
	r.push(`have a variety of impacts and can be customized in several ways.`);
	App.Events.addParagraph(fragment, r);
	r = [];
	for (const [key, teeth] of App.Medicine.Modification.teeth) {
		if (!teeth.hasOwnProperty("requirements") || teeth.requirements) {
			r.push(App.UI.DOM.makeElement("span", capFirstChar(key), "note"));
			r.push(teeth.desc);
			App.Events.addNode(fragment, r, "div");
			r = [];
		}
	}
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Testicles", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("testicles"));
	r.push(`are necessary for erection and provide a small amount of natural XY hormones. At game start, larger testicles reduce slave value, though this can be reduced or even reversed by some future society choices. Orchiectomy, available with extreme content enabled, will stop testicles' hormonal effects, producing a slave with no natural hormones. It also has significant mental effects.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Vaginas", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("vaginas"));
	r.push(`are a valuable commodity. Like `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("anuses", "Anuses"),
		`, they appear in four degrees of tightness: virgin and three increasing levels of looseness. Tighter vaginas improve performance at sexual assignments, but most methods of learning `
	));

	r.push(App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"));
	r.push(`tend to loosen anuses. Assigning a virgin to sex work will result in a one-time bonus to performance but may anger her; alternatively, a chastity belt can be used to preserve virginity during sexual assignments. A virgin vagina applies a large cost multiplier for slave purchase or sale. Vaginas can be loosened by events, strenuous sex work, or plug accessories; they can be tightened with rest from strenuous sex work, personal attention, or the autosurgery, though such surgery can reduce`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginal skill", "Vaginal Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);

	fragment.append(App.Encyclopedia.Dialog.linkDOM("Clit?", "Clits"));

	return fragment;
}, "body");

App.Encyclopedia.addArticle("Weight", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`A slaves'`);
	r.push(App.Encyclopedia.topic("weight"));
	r.push(`contributes to their beauty. The middle three values (thin, average and curvy) are all considered equally good; outside that range, penalties are applied. Gaining and losing weight can cause changes to a slave's`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("breast", "Breasts"),
		` and `,
		App.Encyclopedia.Dialog.linkDOM("butt", "Butts"),
		` size, and will be different for `,
		App.Encyclopedia.Dialog.linkDOM("anorexics", "Anorexic"),
		`, `,
		App.Encyclopedia.Dialog.linkDOM("gluttons", "Gluttonous"),
		`, and `,
		App.Encyclopedia.Dialog.linkDOM("fitness", "Fitness"),
		` fanatics.`,
	));
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`From the slave documentation;`);
	const table = App.UI.DOM.makeElement("table", null, "invisible");
	r.push(table);
	App.UI.DOM.makeRow(table, `191`, `200`, `dangerously obese. This can lead to a slave losing their leadership position.`);
	App.UI.DOM.makeRow(table, `161`, `190`, `super obese`);
	App.UI.DOM.makeRow(table, `131`, `160`, `obese`);
	App.UI.DOM.makeRow(table, `96`, `130`, `fat`);
	App.UI.DOM.makeRow(table, `31`, `95`, `overweight`);
	App.UI.DOM.makeRow(table, `11`, `30`, `curvy`);
	App.UI.DOM.makeRow(table, `-10`, `10`, `neither too fat nor too skinny`);
	App.UI.DOM.makeRow(table, `-30`, `-11`, `thin`);
	App.UI.DOM.makeRow(table, `-95`, `-31`, `very thin`);
	App.UI.DOM.makeRow(table, `-100`, `-96`, `emaciated`);

	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(`he ideal range for a`);
	r.push(App.Encyclopedia.Dialog.linkDOM("bodyguard", "Bodyguard"));
	r.push(`is -10 to 30, going either way negatively impacts them.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hormones (XX)", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.topic("XX Hormones"),
		`are female hormones, either from hormone treatments or from `,
		App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"),
		`. A hidden hormonal score is calculated for each slave, with positive values more feminine:`
	));
	App.Events.addNode(fragment, r, "div");

	const list = App.UI.DOM.appendNewElement("ul", fragment);

	App.UI.DOM.appendNewElement("li", list, `normal XX hormones provide +1`);
	App.UI.DOM.appendNewElement("li", list, `heavy XX hormones provide +2`);
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"),
		` provide +1`
	));
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		` provide -1`
	));

	r = [];
	r.push(`At a total of +1 with no ovaries present, XY attraction will increase, dicks will shrink, testicles will shrink, deep voices will be raised, small breasts and buttocks will grow, ugly faces will soften, huge clits will shrink, and extreme `);
	r.push(App.Encyclopedia.Dialog.linkDOM("musculature", "Musculature"));
	r.push(`will soften.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`At +2, all these effects become more likely and more extreme, and`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"));
	r.push(`and`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("trust", "Trust"), "mediumaquamarine"));
	r.push(`can both increase.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`Artificial hormonal effects can be accelerated by installing the second `);
	r.push(App.Encyclopedia.Dialog.linkDOM("upgrade", "What the Upgrades Do"));
	r.push(`to the kitchen, which will also stop slave's assets from shrinking due to natural hormonal effects.`);

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hormones (XY)", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.topic("XY Hormones"),
		`are male hormones, either from hormone treatments or from `,
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		`. A hidden hormonal score is calculated for each slave, with negative values more masculine:`
	));
	App.Events.addNode(fragment, r, "div");

	const list = App.UI.DOM.appendNewElement("ul", fragment);

	App.UI.DOM.appendNewElement("li", list, `normal XY hormones provide -1`);
	App.UI.DOM.appendNewElement("li", list, `heavy XY hormones provide -2`);
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"),
		` provide +1`
	));
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		` provide -1`
	));

	App.UI.DOM.appendNewElement("p", fragment, `At a total of -1, XY attraction will increase, large breasts and buttocks will shrink, and clits will grow.`);

	r = [];
	r.push(`At +2, all these effects become more likely and more extreme,`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"));
	r.push(`can decrease, dicks and testicles will grow, voices will deepen, and faces will become uglier.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`Artificial hormonal effects can be accelerated by installing the second `);
	r.push(App.Encyclopedia.Dialog.linkDOM("upgrade", "What the Upgrades Do"));
	r.push(`to the kitchen, which will also stop slave's assets from shrinking due to natural hormonal effects.`);

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addCategory("body", function() {
	const links = [];
	links.push(App.Encyclopedia.Dialog.linkDOM("Anuses", "Anuses"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Areolae", "Areolae"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Breasts", "Breasts"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Butts", "Butts"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Clits", "Clits"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Dicks", "Dicks"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Ethnicity", "Ethnicity"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Faces", "Faces"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Height", "Height"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Hips", "Hips"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Lactation", "Lactation"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Lips", "Lips"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Musculature", "Musculature"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Nipples", "Nipples"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Pregnancy", "Pregnancy"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Skin Distinctions", "Skin Distinctions"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Teeth", "Teeth"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Vaginas", "Vaginas"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Waist", "Waist"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Weight", "Weight"));
	links.push(App.Encyclopedia.Dialog.linkDOM("XX", "Hormones (XX)"));
	links.push(App.Encyclopedia.Dialog.linkDOM("XY", "Hormones (XY)"));
	return App.UI.DOM.generateLinksStrip(links);
});


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

App.Encyclopedia.Assignments = {
	/**
	 * @returns {DocumentFragment}
	 */
	attendingClasses() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	confinement() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Confinement"),
			" is an assignment which accelerates breaking for disobedient slaves. If a slave isn't obedient enough to work and isn't ",
			App.Encyclopedia.Dialog.linkDOM("unhealthy", "Health"),
			" enough to need rest, this will make them useful sooner."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	fucktoy() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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 ",
			App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"),
			" 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."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	gloryHole() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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 ",
			App.Encyclopedia.Dialog.linkDOM("healthy", "Health"),
			" but very powerful for extracting ¤ out of otherwise useless slaves."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	milking() {
		const fragment = document.createDocumentFragment();

		fragment.append(
			App.Encyclopedia.topic("Getting milked"),
			" is an assignment which makes money from lactation based on a slave's breasts, ",
			App.Encyclopedia.Dialog.linkDOM("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;
	},

	/**
	 * @returns {DocumentFragment}
	 */
	farming() {
		const fragment = document.createDocumentFragment();
		fragment.append(
			App.Encyclopedia.topic("Farming"),
			" is an assignment which produces ",
			App.Encyclopedia.Dialog.linkDOM("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 ",
			App.Encyclopedia.Dialog.linkDOM("Farmyard", "Farmyard")
		);
		return fragment;
	},

	/**
	 * @returns {DocumentFragment}
	 */
	publicService() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	rest() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Rest"),
			" is an assignment mostly used to improve ",
			App.Encyclopedia.Dialog.linkDOM("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."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	sexualServitude() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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 ",
			App.Encyclopedia.Dialog.linkDOM("devotion", "Devotion"),
			" up quickly."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	servitude() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Servitude"),
			" is an assignment which reduces your upkeep based on the slave's ",
			App.Encyclopedia.Dialog.linkDOM("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."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	whoring() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.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."
		);
	}
};

App.Encyclopedia.addArticle("Slave Assignments", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push("Slave assignments are stratified into ordinary assignments and");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("leadership positions", "Leadership Positions"), "."));
	App.Events.addParagraph(frag, r);

	App.UI.DOM.appendNewElement("p", frag, "Choose a more particular entry below:");

	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Attending Classes", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.attendingClasses());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Schoolroom", "Schoolroom")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Confinement", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.confinement());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Cellblock", "Cellblock")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Fucktoy", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.fucktoy());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Master Suite", "Master Suite")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Glory Hole", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.gloryHole());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Arcade", "Arcade")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Milking", function() {
	const frag = document.createDocumentFragment();
	const r = [];

	r.push(App.Encyclopedia.Assignments.milking());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Dairy", "Dairy")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Farming", function() {
	const frag = document.createDocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.farming());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Farmyard", "Farmyard")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Public Service", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.publicService());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Club", "Club")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Rest", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.rest());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facilities: ", App.Encyclopedia.Dialog.linkDOM("Spa", "Spa"),
			", ", App.Encyclopedia.Dialog.linkDOM("Clinic", "Clinic")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Sexual Servitude", App.Encyclopedia.Assignments.servitude, "assignmentCommon");

App.Encyclopedia.addArticle("Servitude", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.servitude());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Servants' Quarters", "Servants' Quarters")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Whoring", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.whoring());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Brothel", "Brothel")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addCategory("assignmentCommon", function() {
	const r = [];
	r.push(App.Encyclopedia.Dialog.linkDOM("Common Assignments", "Slave Assignments"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Career Experience", "Career Experience"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Attending Classes", "Attending Classes"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Confinement", "Confinement"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Farming", "Farming"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Fucktoy", "Fucktoy"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Glory Hole", "Glory Hole"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Milking", "Milking"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Public Service", "Public Service"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Rest", "Rest"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Servitude, Sexual", "Sexual Servitude"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Servitude", "Servitude"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Whoring", "Whoring"));
	return App.UI.DOM.generateLinksStrip(r);
});

repo_name: Banyanael/fc

license: mit


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
	 * @param {string} [classNames] CSS Class to add to the link
	 * @returns {HTMLElement} DOM link element
	 */
	function makeLinkDOM(text, article, classNames) {
		const link = App.UI.DOM.link(text, () => showArticleInDialog(article));
		if (!classNames) {
			return link;
		}
		// Wrap in a span for coloring, more reliable when hovering over the link
		const span = document.createElement("span");
		span.className += classNames;
		span.append(link);
		return span;
	}

	/** 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,
		showArticleInDialog: showArticleInDialog
	};
})();


code:
App.Encyclopedia.addArticle("Obtaining Slaves", function() {
	const f = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", f, "Future room for lore text", "note");
	App.UI.DOM.appendNewElement("p", f, "Choose a more particular entry below:");
	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Kidnapped Slaves", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["Slavers, from disreputable to noble, visit the Free Cities in droves. Their merchandise is, as a rule, offered as-is and no questions asked. This usually means that their charges have been forcibly kidnapped. These slaves are generally rebellious, often unhealthy, and always cheap."]);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Slave Schools", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	if (V.minimumSlaveAge < 16) {
		r.push("The Free Cities host what are referred to as 'orphanages,' but are in fact slave schools.");
	} else {
		r.push("It is not legal to own children in the Free Cities. It is however legal to hold an interest in future ownership of a child once they reach their 16th birthday. The Free Cities host what are referred to as 'orphanages,' but are in fact slave schools. Of course, instruction cannot include sexual training, so it instead focuses on obedience and fitness.");
	}
	App.Events.addParagraph(f, r);

	App.Events.addParagraph(f, ["The standard slave school produces merchandise to a strict mold. Their stock is guaranteed to be robustly healthy, at a sleek weight, body modification free, 16 to 19 years of age, very obedient, and 100% virgin. A few schools specialize in slaves with non-standard organs or in modified slaves, but most protect brand identity by confining themselves to natural females."]);

	App.Events.addParagraph(f, ["It has recently become common practice to begin treating such trainees with drugs years before sale. Not all orphanages engage in this questionable practice, usually justified as 'seeing to orphans' medical welfare,' but you will occasionally see fresh slaves sold with breasts and asses unusually well-developed for their age. These are very rare, as the newness of slavery means that few slaves have been so from a young age. Presumably, slaves treated in this way will become more common as the Free Cities mature."]);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Stables", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["At any given time, many hundreds of new slaves are listed for sale in the Free City. Since these slaves have come through a training stable, they will tend to be fairly obedient, reasonably healthy, and have basic sexual skill, but will never be virgins."]);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Household Liquidations", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["It is natural that where there is a demand for slaves who are related to one another, supply should arise."]);

	App.Events.addParagraph(f, ["Suppliers of slaves from the outside world are well aware that paired slaves, whether mothers and daughters or sisters, command a premium. This special merchandise is best found at dealers that specialize in it. After all, the demand is strong enough that only experienced dealers have the skill and equipment to defeat all the tricks suppliers are willing to use to pass slaves off as relatives."]);

	App.Events.addParagraph(f, ["Nature has contrived that the demand for twin slaves should far outstrip the supply. Since slavery is new, a majority of those now enslaved were born free, so this is difficult for slave trainers to address. However, the coming decades should see a great increase in the number of slave twins as breeders improve fertility treatments."]);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Direct Sales", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["On occasion, an established slaveowner will sell a trained and modified slave due to financial need, because he is bored of her, or because he trains unique slaves as a hobby."]);

	App.Events.addParagraph(f, ["Some of the most powerful persons in the Free Cities also maneuver their enemies into selling a favorite slave as a way of bloodlessly showing dominance. The truly powerful occasionally feel the need to show that they can obtain any slave, at any time, regardless of her owners' wishes."]);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Pre-Owned Slaves", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["The slaves left behind by the previous owner of your arcology are from a catalog of slaves that can also be accessed through the pre-owned slave vendor."]);

	// TODO: update link
	App.Events.addParagraph(f, ["Most of these slaves were submitted to the game by anons on /d/. If you'd like to submit a slave for addition to the game, you can do so at the GitGud development site."]);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Discarded Slaves", function() {
	const f = new DocumentFragment();
	let r;

	App.Events.addParagraph(f, ["Slaves don't last forever in the Free Cities. Many don't even last until retirement, with broken minds and abused or over-used bodies."]);

	r = [];
	r.push("These slaves which have lost their value are often simply culled from the owners' herds, but may also be sold through");
	r.push(App.Encyclopedia.Dialog.linkDOM("the Flesh Heap", "The Flesh Heap"));
	r.push("as discount merchandise for new or cash-strapped slaveowners who can wring some final use out of them. Their new owners may end up using them as discount whores,");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("living sex toys", "Fuckdolls"), ","));
	r.push("or for medical testing.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Some discarded slaves are also");
	r.push(App.Encyclopedia.topic("rescued"));
	r.push("by the so-called Slave Shelters. These charities place the discarded slaves with well-off slaveowners who are willing to invest the time and effort into caring for them, whether to restore them to serviceable condition or simply for humanitarian reasons. Abuse and resale of placed shelter slaves is generally prohibited, and most shelters attempt to enforce these terms with regular inspections.");
	App.Events.addParagraph(f, r);

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

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("The Flesh Heap", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	r.push("More of a trash heap than a slave market, the");
	r.push(App.Encyclopedia.topic("Flesh Heap"));
	r.push("is a dumping ground for thoroughly broken slaves. Relatively healthy bodies are usually scooped up for medical testing or other purposes; several that one wouldn't want to waste a valuable slave on. Anything with some sort of life in it is up for sale, usually at extremely low prices, though one gets what they pay for; most slaves are nothing more than vegetables. One would have to place a reserve should they want a mindless, healthy slave for whatever they seek.");
	App.Events.addParagraph(f, r);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("The Job Fulfillment Center", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	r.push("If you are looking for a slave qualified for a specific role, look no further than the Traders Union that makes up the Job Fulfillment Center. Leave the job description and a list of desired traits and before long a suitable slave will be delivered to your doorstep and ready to serve you. Due to the nature of the business, these slaves are not");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheap", "Money", "cash"));
	r.push("and usually not perfect, but they always fulfill their job adequately and obediently.");
	App.Events.addParagraph(f, r);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Wetware CPUs", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["Slaves stripped of all unneeded parts, attached to a VR world, and honed to near perfection. Their minds are peerless, but their bodies are broken; if one is able to overcome such an obstacle, a valuable slave awaits."]);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addCategory("obtainingSlaves", function() {
	const r = [];
	r.push(App.Encyclopedia.Dialog.linkDOM("Kidnapped Slaves", "Kidnapped Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Slave Schools", "Slave Schools"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Stables", "Stables"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Household Liquidations", "Household Liquidations"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Direct Sales", "Direct Sales"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Pre-Owned Slaves", "Pre-Owned Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Random Events", "Random Events"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Discarded Slaves", "Discarded Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Flesh Heap", "The Flesh Heap"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Job Fulfillment Center", "The Job Fulfillment Center"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Wetware CPUs", "Wetware CPUs"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Corporation", "The Corporation"));
	return App.UI.DOM.generateLinksStrip(r);
});


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

	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! Documentation for slave attributes can be found " +
		"here.");
	acc.toParagraph();

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


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>>

<<set _pass = App.Encyclopedia.renderCategory($encyclopedia)>>
<<if _pass>>
	<<includeDOM _pass>>
<<else>>

<<switch $encyclopedia>>

/**********
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 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 Sons of Sekhmet" "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 Sons of Sekhmet", "The Sons of Sekhmet")>>
	| <<= 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")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Catmod", "Catmod")>>

<<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")>>

<<case "Catmod" "Bioengineering" "Catgirls">>
	<<= App.Encyclopedia.Dialog.linkSC("Catmod", "Catmod")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Catgirls", "Catgirls")>>
	| <<= App.Encyclopedia.Dialog.linkSC("Bioengineering", "Bioengineering")>>

<</switch>>
<</if>>


code:
/** Render a link that toggles the slave's favorite status
 * @param {App.Entity.SlaveState} slave
 * @param {function():void} [handler]
 * @returns {HTMLAnchorElement}
 */
App.UI.favoriteToggle = function(slave, handler) {
	function favLink() {
		const linkID = `fav-link-${slave.ID}`;
		if (V.favorites.includes(slave.ID)) {
			const link = App.UI.DOM.link(String.fromCharCode(0xe800), () => {
				V.favorites.delete(slave.ID);
				$(`#${linkID}`).replaceWith(favLink());

				if (handler) {
					handler();
				}
			});
			link.classList.add("icons", "favorite");
			link.id = linkID;
			return link;
		} else {
			const link = App.UI.DOM.link(String.fromCharCode(0xe801), () => {
				V.favorites.push(slave.ID);
				$(`#${linkID}`).replaceWith(favLink());

				if (handler) {
					handler();
				}
			});
			link.classList.add("icons", "not-favorite");
			link.id = linkID;
			return link;
		}
	}

	return favLink();
};


code:
App.Intro.alphaDisclaimer = function() {
	App.Intro.init();
	const node = new DocumentFragment();

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

	App.UI.DOM.appendNewElement("p", node, `This is a text-based game that includes descriptions of sexual activity, graphic violence, drug use, and other subjects not suitable for persons under the age of 18. This is a work of fiction; any resemblance to actual persons, places, or events is unintended.`, "yellow");

	App.UI.DOM.appendNewElement("h2", node, "Welcome!");

	App.UI.DOM.appendNewElement("p", node, `An in-game encyclopedia is available from the sidebar, with answers to most basic gameplay questions.`);
	App.Events.addParagraph(node, [
		App.UI.DOM.makeElement("span", `Important info for new players, and a reminder for FC veterans:`, "bold"),
		`when the player is offered a set of choices, the`,
		App.UI.DOM.makeElement("span", `Continue`, "bold"),
		`button at the top of the left sidebar will almost always remain available. Using this to decline all the options presented is not cheating. If it's available, it's supposed to be available. It represents the player character politely bowing out of the situation.`
	]);

	App.UI.DOM.appendNewElement("h2", node, "Please note");
	const p = App.UI.DOM.appendNewElement("p", node);
	App.Events.addNode(p, [
		App.UI.DOM.makeElement("span", `This is an alpha.`, "bold"),
		`That means the game is missing content, is full of bugs, is imbalanced, and is generally in an incomplete state. The game will keep a start of turn autosave. If you encounter a bug, we strongly recommend you reload your start of turn autosave immediately. Please submit your feedback and bug reports here. Consider attaching a save file and screenshot of the problem.`,
	], "div");
	App.Events.addNode(p, [`Pregmod is a modification of the original <i>Free Cities</i> ${V.ver} created by FCdev, which can be seen <a href='https://freecitiesblog.blogspot.com/' target='_blank'>here</a>.`], "div");

	App.Events.addNode(p, [`mod version: ${V.pmodVer}, build: ${V.releaseID}${App.Version.commitHash ? `, commit: ${App.Version.commitHash}` : ``}`], "div", "note");
	App.Events.addNode(p, [`4.0.0 is an alpha release. This means the new player content has minimal implementation.`], "div", "bold"); /* remove me with 4.0.0! */

	App.Events.addResponses(node, [
		new App.Events.Result(`More version info`, versionInfo)
	]);

	App.UI.DOM.appendNewElement("p", node, App.UI.DOM.passageLink(
		"I am 18 or more years of age, I understand, and I wish to continue",
		"Economy Intro"
	));

	return node;

	function versionInfo() {
		const frag = new DocumentFragment();
		App.Events.addNode(frag, [
			App.UI.DOM.makeElement("span", "Mod: expanded age ranges and other tweaks 2016-08-30", ["green", "note"]),
			App.UI.DOM.makeElement("span", `+SV`, "darkred"),
		], "div");
		App.UI.DOM.appendNewElement("div", frag, "Mod: extra preg content and other crap", ["green", "note"]);
		App.UI.DOM.appendNewElement("div", frag, "Saves from versions prior to 0.6 are not compatible.", "bold");

		return frag;
	}
};


code:
/**
 * Provide a mechanism to inspect multiple slaves at once (for example, for Household Liquidators and recETS).
 * @param {Array<App.Entity.SlaveState>} slaves
 * @param {boolean} showFamilyTree
 * @param {FC.SlaveMarketName} [market]
 * @returns {DocumentFragment}
 */
App.UI.MultipleInspect = function(slaves, showFamilyTree, market) {
	const tabBar = new App.UI.Tabs.TabBar("MultipleInspect");

	for (const slave of slaves) {
		tabBar.addTab(slave.slaveName, `slave${slave.ID}`, App.Desc.longSlave(slave, {market: market}));
	}

	if (slaves.length > 1 && showFamilyTree) {
		tabBar.addTab("Family Tree", "family-tree-tab", renderFamilyTree(slaves, slaves[0].ID));
	}

	return tabBar.render();
};


code:
App.UI.descriptionOptions = function() {
	const f = document.createDocumentFragment();
	App.UI.DOM.appendNewElement("h1", f, "Description Options");

	App.UI.DOM.appendNewElement("p", f,
		"These options will affect both the long form description of each slave and the miniscenes available from the main menu.",
		"scene-intro");

	const options = new App.UI.OptionsGroup();

	options.addOption("", "surnameOrder")
		.addValue("Allow nationality name order", 0).customDescription("Order names ''based on country of origin''.")
		.addValue("Force name surname", 1).customDescription("Names will always be ''Name Surname''.")
		.addValue("Force surname name", 2).customDescription("Names will always be ''Surname Name''.");

	options.addOption("", "seeRace")
		.addValue("Disable most mentions of race", 0).off()
		.customDescription("Ethnicity will ''almost never'' be mentioned.")
		.addValue("Enable mentions of race", 1).on().customDescription("Ethnicity will ''occasionally'' be mentioned.");

	options.addOption("", "seeNationality")
		.addValue("Disable most mentions of nationality", 0).off()
		.customDescription("Nationality will ''almost never'' be mentioned.")
		.addValue("Enable mentions of nationality", 1).on()
		.customDescription("Nationality will ''occasionally'' be mentioned.");

	options.addOption("The effects of implants are", "showImplantEffects")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Clothing is mostly", "showClothing")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Detailed slave age information is", "showAgeDetail")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Approximate height is", "showHeightCMs")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Cosmetic body mods are", "showBodyMods")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Sexual histories are", "showSexualHistory")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Attractiveness and sexual scores are", "showScores")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Volume, in CCs, of breasts is", "showBoobCCs")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off();

	options.addOption("Height and length units are in", "showInches")
		.addValueList([["Metric", 0], ["Both", 1], ["Imperial", 2]]);

	if (V.seeDicks > 0) {
		options.addOption("Approximate sizes of dicks and balls are", "showDickCMs")
			.addValue("Shown", 1).on().addValue("Hidden", 0).off();
	}

	options.addOption("Numbers are displayed as", "showNumbers")
		.addValueList([["Integers", 2], ["Both", 1], ["Words", 0]]);

	if (V.showNumbers === 1) {
		options.addOption(`Only numbers up to ${V.showNumbersMax} are displayed as words`, "showNumbersMax")
			.addValue("Default (20)", 20).showTextBox();
	}

	App.UI.DOM.appendNewElement("p", f, options.render());

	return f;
};