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("vaginal 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 reputation based on their beauty, and the player character's attention can be targeted to areas of the slave's body with possible fetish effects on happy slaves."
		);
	},

	/**
	 * @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: Elohiem/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("Playing Free Cities", function() {
	const f = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", f, `Welcome to the Free Cities, ${PlayerName()}!`);
	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;
}, "guide");

App.Encyclopedia.addArticle("First Game Guide", function() {
	const f = new DocumentFragment();
	let r;

	App.UI.DOM.appendNewElement("p", f, "Unfortunately, Twine doesn't have a solid tooltip system at the moment. So, a certain amount of confusion is to be expected. Sorry about that. Flip through the encyclopedia, or at least this gameplay section. It answers a lot of frequently asked questions, and if you read it you can save yourself the trouble of asking your frequently asked question on /d/ or the blog and getting told to read the encyclopedia. If you've still got questions, start a game and read what it says. The game is reasonably good about telling you what's happening to your slaves, and why. It bears repetition that almost all stat effects are called out with colored text. Try this opening strategy if you don't know where to start. It isn't an optimal build, but it works reliably and will show you the basics.");

	App.UI.DOM.appendNewElement("h3", f, "Starting options");
	r = [];
	r.push("Start the game and select any of the world options; choose normal difficulty, since it's pretty forgiving and this opener will make good");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("money", "Money"), "."), "cash"));
	r.push("Build a completely male PC for your first game; it makes");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("maintenance much easier. Choose wealth for both your career and your rumored method of obtaining the arcology; the other options are fun but a full wealth build will set you up quickly to get started.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("p", f, "Now, customize your starting slaves.");
	r = [];
	r.push("For your first, make her as intelligent, educated, and old as possible. Make her");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devoted", "From Rebellious to Devoted"), "."), ["devotion", "accept"]));
	r.push("but save");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push(`by giving her flaws, an unknown fetish, and making her afraid of you. (These are easy to fix.) You can customize the rest of her as you wish, but try to keep her under ${cashFormat(5000)}. Don't worry about skills, since with two of them you'll be able to rotate Head Girl duty so the other can learn skills. Commit her, base another slave off her, and commit that one too. Those are your`);
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Head Girls", "Head Girl"), "."));
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Spend the rest of your");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("on prospects: slaves that are");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheap", "Money", "cash"));
	r.push("now, but can be improved quickly. As long as you keep devotion pretty high, low");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust inc"));
	r.push("can be fixed reliably. Unknown fetishes, emaciated or fat, flaws, deep voice, and poor skills are all good ways to drive prices down, and can all be fixed quickly. Virginities are a bad idea because they drive costs up and are easy to break. Education can take awhile and will take slaves away from other jobs, so make them all educated for now, and keep their intelligence reasonably high.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "First turn");
	r = [];
	r.push("Assign one of your Head Girls to be the Head Girl and make the other whore. Assign everyone else to whore. The");
	r.push(App.Encyclopedia.Dialog.linkDOM("rules assistant", "Rules Assistant"));
	r.push("will speed things up a lot when you know the basics, but leave it off for now; it's easy to miss a lot of stuff if you set it up without a bit of experience. Go through your girls one by one and experiment with their options, but anyone who's Accepting or better should get nice clothes, accessories, and");
	r.push(App.Encyclopedia.Dialog.linkDOM("living conditions", "Living Conditions"));
	r.push("anyone who's not should not. When slaves tip over into Accepting, switch them over from bedrolls and uncomfortable straps; until then, the good life is a waste of");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("and will spoil them. Give unhealthy slaves curatives, and give everyone hormones, since they're");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheap", "Money", "cash"));
	r.push("and have good front end benefits. Get everyone working out or dieting to reach a basic fitness level and an attractive (not red)");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("weight", "Weight"), "."));
	r.push("Sell the girl(s) your predecessor left behind for seed");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("and choose the most profitable option; there are ways to maximize this, but worry about that later. Check out the arcology management menu. You should have the");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("to upgrade the security systems, build the");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Head Girl suite", "Head Girl Suite"), ","));
	r.push(`and to buy the kitchen upgrade; this will make dieting work faster. Check out the slave market, and buy a single bargain slave: ${cashFormat(2000)} is good. Put her in the suite: if she won't go, abuse her until she will. Open the personal attention menu, and fix your Head Girl's flaws; softening is powerful but it takes longer and we're focusing on the basics. Save the game and end the turn.`);
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "The end turn report");
	r = [];
	r.push("Read this, and note all the colored text. Pay particular attention to red, gold, or orchid text; these are generally bad. Being a slave whore is a hard life, and some trouble is inevitable. But take particular note of things like slaves losing");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("health", "Health"), ","));
	r.push("becoming");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("fearful", "Trust"), ","));
	r.push("or");
	r.push(App.Encyclopedia.Dialog.linkDOM("hating", "From Rebellious to Devoted"));
	r.push("you due to their");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("rules", "Rules Assistant"), ","));
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("conditions", "Living Conditions"), ","));
	r.push("or other slaves — these things you can control. Reload your save and fiddle around with the options to address these areas. (The Head Girl's girl may have a rough time; you can't affect that.) Since your Head Girl has her own slave to help her around the house, she'll work with two of your slaves.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "Economics and events");
	r = [];
	r.push("The economics report offers some flavor, but you should leave the options it offers alone until you've got some spare cash. An event or two will follow; feel free to reload the page on each (F5 on most browsers) to see what the different options do. Generally, try to pick options that give you");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("and improve");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "."), ["devotion", "inc"]));
	r.push(App.Encyclopedia.Dialog.linkDOM("Trust", "Trust", "trust inc"));
	r.push("and");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("can wait.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "Moving forward");
	r = [];
	r.push("Hopefully, many of your slaves learned skills during their week of");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("whoring", "Whoring"), "."));
	r.push("Three levels of skill (Veteran Whore or W+++ for example) is the maximum, though slaves without vaginas will only acquire two complete levels of sexual skills. As you move through the first ten weeks or so, many of your slaves will max out their whoring and sexual skills. When they do, switch them over to");
	r.push(App.Encyclopedia.Dialog.linkDOM("public service", "Public Service"));
	r.push("until they achieve maximum");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("entertainment skill", "Entertainment Skill"), ","));
	r.push("and then put them back on whoring, since cross training will improve their whoring performance. When your Head Girl alternate has maxed skills, make her the Head Girl and train up the MILF she replaced. Switch your personal attention around; for now, fix the");
	r.push(App.Encyclopedia.Dialog.linkDOM("quirks", "Quirks"));
	r.push("of the most");
	r.push(App.Encyclopedia.Dialog.linkDOM("devoted", "From Rebellious to Devoted", "devotion accept"));
	r.push("slave who has any, since that's the best way to maximize your chances of success each turn.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(`Pay attention to your cash flow. If it's positive and you have a decent buffer of ${cashFormat(10000)} or so built up, wait for the slave market prices to naturally dip, and then purchase a girl or two to work on once your starting stable is well trained, though you may have to confine or rest new purchases for a while if they're`);
	r.push(App.Encyclopedia.Dialog.linkDOM("rebellious", "From Rebellious to Devoted", "devotion resistant"));
	r.push("or sick. If you get a virgin, consider applying chastity to preserve value for resale. When prices are high, consider selling anyone who's free of flaws and has a discovered sexual fetish, since this maximizes value bonuses. Within ten turns, you should be making decent weekly profit, with resale of slaves building up your bank when prices favor sale. Once you're confident of the whoring mechanics, consider building a");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("brothel", "Brothel"), "."));
	r.push("Your alternate Head Girl will make a good");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("madam", "Madam"), "."));
	App.Events.addParagraph(f, r);

	return f;
}, "guide");

App.Encyclopedia.addArticle("How to Play", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	r.push("This is not a game in which the PC slaveowner is some magical sexual god whose mere presence turns women into submissives. This means that sane slaves will tend to lose obedience and");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust inc"));
	r.push("over time if you don't take any steps to maintain their mental state. Mental stats have maximum and minimum values. These are somewhat 'sticky,' so slaves at minimum");
	r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
	r.push("for example may require an extra jolt to break free of this state.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Maximized");
	r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
	r.push("and");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
	r.push("are not useless; if one of these stats is maximized and the other is not, the extra");
	r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
	r.push("or");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
	r.push("will boost the other. If both are maximized, the player gains");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("instead. However if both are low the slave in question is liable to experience breakdowns and generally be useless.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("A slave's health is extremely important. Being healthy generally improves beauty and job performance. Most transformative drugs and surgeries can damage health, while curative drugs and rest will restore it. Extremely unhealthy slaves can die, while extremely healthy slaves enjoy considerable bonuses on many assignments. Health damage is generally scaled to a slave's current health, so if a slave is already unhealthy, injuries will hurt her more severely. Pulling a slave with red health indicators off work for a week of rest is generally advisable.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The first button in the left-side UI bar will always continue the game without taking any actions. If you wish to advance the game rapidly, click that button repeatedly. If you are presented with a menu and do not wish to select any of the options, that button will also serve as a none of the above choice. The spacebar will also advance the game.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The author has played several otherwise good H-Games in which it can be hard to parse exactly what the flavor descriptions mean in terms of stats. Therefore, this game will usually flag stat impacts in descriptions by means of colored text. For example:");
	const ul = document.createElement("ul");
	App.Events.addNode(ul, ["Green text means something good, like a healthy slave."], "li");
	App.Events.addNode(ul, ["Red text means something bad, like a sick or injured slave. "], "li");
	App.Events.addNode(ul, ["Yellow text means something neutral but noteworthy. "], "li");
	App.Events.addNode(ul, ["pink text means an increase in a slave's regard for to you. "], "li");
	App.Events.addNode(ul, ["Orchid text means a decrease in a slave's regard for to you. "], "li");
	App.Events.addNode(ul, ["Aquamarine text means an increase in a slave's",
		App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust inc"), "of to you, and a reduction in her fear of you. "], "li");
	App.Events.addNode(ul, ["Gold text means a decrease in the slave's",
		App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust dec"), " of you, and an increase in her fear of you. "], "li");
	App.Events.addNode(ul, ["Orange-red text means a decrease in a hateful slave's fear of you. "], "li");
	App.Events.addNode(ul, ["Lime text means something has grown or improved, which is usually, but not always, good. "], "li");
	App.Events.addNode(ul, ["Orange text means something has shrunk or degraded, which is usually, but not always, bad. "], "li");
	App.Events.addNode(ul, ["Yellow-green text is for a",
		App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"), "-related"), "event. "], "li");
	App.Events.addNode(ul, ["Coral text is used for simple identifiers that can be used to check a slave's general type at a glance, also weakening fetishes. "], "li");
	App.Events.addNode(ul, ["Light coral text is used when a slave's fetish strengthens or develops. "], "li");
	App.Events.addNode(ul, ["Light green text is used to indicate positive relationships. "], "li");
	App.Events.addNode(ul, ["Light salmon text is used when a rivalry develops or strengthens. "], "li");
	App.Events.addNode(ul, ["Violet text means an increase in sex drive. "], "li");
	App.Events.addNode(ul, ["Khaki text means a decrease in sex drive. "], "li");
	r.push(ul);
	App.Events.addParagraph(f, r);

	r = [];
	r.push("It is important to note that if a scene doesn't have colored text, it doesn't impact a slave's stats. For example, the short sex scenes available from the main screen are for the most part unlimited and have no real gameplay effect: they are for fun and flavor only.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("This game produces less visible text than a lot of text-based H-Games; this is because most text has numerous variations that change based on a slave's body, mental state etc. The author has deliberately made some of the variations available only with extreme stats so that new content will still be out there even if you play for a while.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Things that increase income from");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("prostitution", "Whoring"), ","));
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("gain from");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("slutting", "Public Service"), ","));
	r.push("and performance in most jobs include all appearance stats (that's right, every one; though some are more or less important),");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("sexual skills", "Skills"), ","));
	r.push("a slave's");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("health", "Health"), ","));
	r.push("and the state of a slave's holes. Going from a novice to a veteran whore will have non-linear impacts on income, since a novice will get good");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("for being fresh and little");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("for her skills, and a veteran will get the reverse. The");
	r.push(App.Encyclopedia.Dialog.linkDOM("fetishes", "Fetishes"));
	r.push("and physical statuses that get pink text on the main menu (huge tits, bisexual, etc.) give bonuses.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The game is not intended to be crushingly difficult, but it is balanced so that in order to achieve some of the best event outcomes, and eventually in order to survive, the player must build a business empire that turns a significant profit. Profits are necessary because the player will want to be able to make some major expenditures in the late game. Buy low, sell high, and always try to improve your slaves. Even something as simple as a few weeks' personal attention to fix");
	r.push(App.Encyclopedia.Dialog.linkDOM("mental flaws", "Flaws"));
	r.push("and boost");
	r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
	r.push("can produce significant profits when a slave is resold.");
	App.Events.addParagraph(f, r);

	return f;
}, "guide");

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

	r = [];
	r.push(`The uppermost button (in events and reports it continues the game, while in menus it functions as a back button) in the left-side UI bar can be activated via context sensitive keybinds; ${App.UI.Hotkeys.hotkeys("endWeek")} is used to end the week from the main menu, and ${App.UI.Hotkeys.hotkeys("nextLink")} is used to continue in all other situations.`);
	App.Events.addParagraph(f, r);

	r = [];
	r.push(`Within slaves' individual menus <strong>${App.UI.Hotkeys.hotkeys("prev-slave")}</strong> will move to the last slave and <strong>${App.UI.Hotkeys.hotkeys("next-slave")}</strong> to the next.`);
	r.push(`Review your personal affairs with <strong>${App.UI.Hotkeys.hotkeys("Manage Personal Affairs")}</strong> and weekly actions with <strong>${App.UI.Hotkeys.hotkeys("Personal Attention Select")}</strong>.`);
	const ul = document.createElement("ul");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Rules Assistant")}</strong> will open RA Rules.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Manage Arcology")}</strong> will open arcology management.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Options")}</strong> will opens the options menu.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Buy Slaves")}</strong> will open the slave markets.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("BG Select")}</strong> will open Bodyguard management.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Future Society")}</strong> will open Future Societies.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Manage Penthouse")}</strong> will open Manage Penthouse.`], "li");
	App.Events.addNode(ul, [`<strong>${App.UI.Hotkeys.hotkeys("Manage Penthouse")}</strong> will <strong>only open</strong> Head Girl management on the main page.`], "li");
	r.push(ul);
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Nearly every key can be rebound in Hotkey Settings which can be accessed in game via SideBar -> Options -> Hotkey Settings.");
	App.Events.addParagraph(f, r);

	return f;
}, "guide");

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

	r = [];
	r.push("The Arcology Interface is the large table-based display at the top of the main menu. It's designed as an abstract representation of the arcology.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("It is divided into levels and sectors. Levels are the horizontal rows. An arcology is a very large building, and each Level includes many floors. Sectors are slices of those levels. For example, on Levels with four Sectors, each sector includes a quarter of each floor that's part of that Level. Each Sector has its own cell in the interface, and each Sector is occupied by facilities, tenants, or both. Each type of Sector occupant is bordered in a different color. The contents of a Sector can be viewed and changed by clicking on the text inside a Sector.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The uppermost level is the Penthouse. It's where the player character and the slaves under their direct supervision live, and it can be upgraded with a number of facilities that can be accessed through shortcuts that are added to the Penthouse in the interface once they're installed. Some of these facilities can house some of the player character's sex slaves. Unlike every other Sector, the Penthouse is always owned by the player and cannot be sold. Every other Sector can be privately owned, reducing the player's control of the arcology. Privately owned Sectors can be purchased, or acquired using");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("if the player character's");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("is extremely high. Privately owned sectors are bordered in red regardless of what's in them.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The next level down, with three Sectors, is the Promenade, which is a major social area and hosts most of the businesses which cater to the arcology's citizens. Promenade Sectors are occupied by Shops by default, which will automatically be filled by business tenants that will pay the player character rent if they own the Sector. Promenade Sectors can be upgraded into");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("brothels", "Brothel"), ","));
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("clubs", "Club"), ","));
	r.push("or an enhanced version of shops which will attract business tenants that help advance a specific");
	r.push(App.Encyclopedia.Dialog.linkDOM("future society", "Future Societies"));
	r.push("model, and still provide rent.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The next three levels have four sectors and are living areas that are occupied by apartments by default. These house arcology citizens, who pay rent, and who are indirectly very important because they determine the level of local demand for sexual services provided by whores, public servants, and other sex slaves doing sexual jobs. Apartments can be upgraded for either density or luxury. Dense Apartments increase the citizen population, and are therefore useful to keep demand up if the player is relying on selling or giving away sexual services. Luxury apartments increase the arcology's prosperity, and are therefore a better choice if demand for sexual services isn't a priority.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The first level with five Sectors is the Concourse. Like the Promenade, it hosts businesses, but these focus more on bulk trade and less on citizens' luxury needs, and include the arcology's slave markets. Its sectors are occupied by Markets by default, which pay rent. Concourse sectors can be upgraded into a");
	r.push(App.Encyclopedia.Dialog.linkDOM("pit", "Pit"));
	r.push("for fighting slaves, an");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("arcade", "Arcade"), ","));
	r.push("or into a flagship store for the player character's");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("corporation", "The Corporation"), "."));
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The lowest level, also with five Sectors, is the Service level. Its Sectors are occupied by Manufacturing by default, which of course pay rent. If the player is focusing on menial slaves, its Sectors can be upgraded into pens, to increase the total number of");
	r.push(App.Encyclopedia.Dialog.linkDOM("menial slaves", "Menial Slaves"));
	r.push("that can be kept in the arcology, or into Sweatshops, to put the labor of menial slaves in the arcology to use. Alternatively, these Sectors can be upgraded into a");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("dairy", "Dairy"), ","));
	r.push("or into a barracks, which will reduce the weekly upkeep of any mercenaries the player character has hired.");
	App.Events.addParagraph(f, r);

	return f;
}, "guide");

App.Encyclopedia.addArticle("Tips and Tricks", function() {
	const f = new DocumentFragment();
	let r;

	App.UI.DOM.appendNewElement("p", f, "Buy low, sell high.");

	r = [];
	r.push("Slaves will sometimes default to the resting assignment after they're done with something else. If a slave is resting and the game suspects that she shouldn't be, her assignment will be lime, bold, and underlined on the main menu to indicate that.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("If a new slave isn't afraid of you, make her. Then and only then build her");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "."), ["devotion", "accept"]));
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The personal attention assignment should be used tactically. It is the most powerful single way of improving slaves because it's reliable. Devotion and");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust"));
	r.push("gains during a single week are normally capped. However, personal attention removes these caps. This is most powerful for slaves that are already well broken and are enjoying fairly luxurious lives. With so many things driving up devotion and");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("trust", "Trust"), ","));
	r.push("using personal attention to remove the caps can quickly maximize both stats. Focusing on business instead (by selecting no slave for personal attention) is also powerful. Doing so produces");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("proportional to the amount of");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("on hand, and improves prosperity growth, which improves future income from rents.");
	App.Events.addParagraph(f, r);

	return f;
}, "guide");

App.Encyclopedia.addArticle("Design Your Master", function() {
	const outer = document.createElement("p");
	const showSecExp = V.secExpEnabled > 0;

	outer.append(content(showSecExp));

	return outer;

	/**
	 * @param {boolean} showSecExp
	 * @returns {DocumentFragment}
	 */
	function content(showSecExp) {
		const f = new DocumentFragment();
		let r;

		r = [];
		r.push("This happens at the start of a game of FC: it is not possible to change the PC during the main game. The player must select a career background, a rumored method of acquiring the arcology, and their age group; then choose between some broad body and gender options.");
		App.Events.addParagraph(f, r);

		r = [];
		r.push(`Wealth is a choice for both the career background and rumored method of acquiring the arcology options. Both provide you with ${cashFormat(10000)} each for a total of ${cashFormat(30000)} if both are chosen. As a background option it means that your starting slaves will have two free levels of sex skills available`);
		if (showSecExp) {
			r.push("and maintaining");
			r.push(App.Encyclopedia.Dialog.linkDOM("authority", "Security Expansion", "darkviolet"));
			r.push("will be harder, but upgrades in the propaganda hub will be");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money"), "."), "cash"));
		} else {
			r.push(r.pop() + ".");
		}
		App.Events.addParagraph(f, r);

		App.UI.DOM.appendNewElement("h3", f, "Career background options");
		const p = document.createElement("p");
		p.append("Being an ex-");
		let ul = document.createElement("ul");

		r = [];
		r.push("business owner (also referred to as capitalist) enhances the business-focused personal attention, increasing the");
		r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
		r.push("it produces and improving arcology prosperity when business-focused personal attention is selected. Also,");
		if (showSecExp) {
			r.push("upgrades in the propaganda hub will be");
			r.push(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money", "cash"));
			r.push("and");
		}
		r.push("your starting slaves will have a free level of prostitution skill available.	Starts having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Trading", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("private security contractor (also referred to as mercenary background) greatly reduces the cost of keeping mercenaries in your employ.");
		if (showSecExp) {
			r.push("Upgrades in the security HQ will be");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money"), "."), "cash"));
		}
		r.push("Your starting slaves will have free");
		r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
		r.push("available. Starts having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Warfare", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("slave driver enhances slave-focused personal attention, adding bonus");
		r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
		r.push("or");
		r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
		r.push("to many training applications or preventing their loss.");
		if (showSecExp) {
			r.push(App.Encyclopedia.Dialog.linkDOM("Authority", "Security Expansion", "darkviolet"));
			r.push("will be easier to maintain. Plus upgrades in the security HQ will be");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money"), "."), "cash"));
		}
		r.push("Starting slaves will be cheaper, in addition having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Slaving", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("arcology engineer provides a significant discount on many arcology upgrades and expansions. In addition to the arcology starting off with basic economic upgrades already installed. Starts having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Engineering", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("doctor allows the player character to perform surgery personally, providing a discount on surgery costs and a reduction to resulting health damage. Additionally, slaves may react differently to surgery if the player character performs it and starting slaves will have free implants available. Starts having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Medicine", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("escort provides a one-time bonus to a slave's entertainment, whoring, and two sexual skills when a new slave is acquired. Furthermore, society will not take lightly to being run by an ex-whore, and you will receive heavy");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		if (showSecExp) {
			r.push("and");
			r.push(App.Encyclopedia.Dialog.linkDOM("authority", "Security Expansion", "darkviolet"));
		}
		r.push("losses each week. You can spend your free time selling your body for");
		r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("money", "Money"), ","), "cash"));
		r.push("at the cost of a large amount of");
		r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation"), "."), ["reputation", "inc"]));
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("celebrity provides extra");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("at game start");
		if (showSecExp) {
			r.push("and upgrades in the propaganda hub will be");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money"), "."), "cash"));
		} else {
			r.push(r.pop() + ".");
		}
		r.push("Starting slaves will have a free level of entertainment skill available.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("servant provides a one-time bonus to a slave's");
		r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
		r.push("and");
		r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "."), ["devotion", "accept"]));
		r.push("Furthermore, society will not approve of being run by an ex-servant, and you will face");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		if (showSecExp) {
			r.push("and");
			r.push(App.Encyclopedia.Dialog.linkDOM("authority", "Security Expansion", "darkviolet"));
		}
		r.push("losses each week. You can spend your free time, putting your previous experience to use, by greatly reducing the costs of your penthouse. You also passively reduce costs when not focusing on doing so.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("gang leader provides a one-time bonus to a slave's health and a free level of combat skill. Furthermore, society will not approve of being run by a gang-banger, and you will face");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("losses each week. New slaves will likely have heard of your previous exploits and fear you.");
		if (showSecExp) {
			r.push("You know how to haggle slaves and assert your");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("authority", "Security Expansion"), "."), "darkviolet"));
			r.push("Plus upgrades in the security HQ will be");
			r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money"), "."), "cash"));
		}
		r.push("You know how to haggle slaves. You can spend your free time putting your previous experience to use, proving another source of income however this isn't guaranteed.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("incursion specialist provides starting slaves with a free level of intelligence. Also certain upgrades may be");
		r.push(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money", "cash"));
		r.push("and you may find alternative approaches to");
		if (showSecExp) {
			r.push("problems, but you will find");
			r.push(App.Encyclopedia.Dialog.linkDOM("authority", "Security Expansion", "darkviolet"));
			r.push("quite hard to maintain.");
		} else {
			r.push("problems.");
		}
		r.push("Starts having already mastered");
		r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("Hacking", "PC Skills"), "."));
		App.Events.addNode(ul, r, "li");

		p.append(ul);
		f.append(p);

		r = [];
		let text;
		if (showSecExp) {
			text = "Hide SecExp details";
		} else {
			r.push("Players using the");
			r.push(App.Encyclopedia.Dialog.linkDOM("Security Expansion", "Security Expansion"));
			r.push("mod may want to view this page with");
			text = "additional details";
		}
		r.push(App.UI.DOM.combineNodes(App.UI.DOM.link(text, () => {
			$(outer).empty().append(content(!showSecExp));
		}), "."));
		App.Events.addParagraph(f, r);

		App.UI.DOM.appendNewElement("h3", f, "Rumored acquisition options");
		ul = document.createElement("ul");
		r = [];
		r.push("Hard Work provides a one-time bonus to both");
		r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
		r.push("and");
		r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust accept"));
		r.push("when a new slave is acquired.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("Force means that if a slave does not have enough");
		r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
		r.push("to obey when acquired, this option will terrify her and reduce her");
		r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust accept"));
		r.push("to the point where she should comply.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("Social Engineering means that you will start with the first societal option unlocked, since you manipulated the arcology's citizens.");
		App.Events.addNode(ul, r, "li");

		r = [];
		r.push("Luck provides extra");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("at game start, but no ongoing advantages once the main game begins.");
		App.Events.addNode(ul, r, "li");

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

		App.UI.DOM.appendNewElement("h3", f, "Age groups");
		r = [];
		r.push("Older PCs enjoy easier");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("maintenance, but possess lower");
		r.push(App.Encyclopedia.Dialog.linkDOM("sexual energy", "Sexual Energy"));
		r.push("while younger PC's are the opposite.");
		App.Events.addParagraph(f, r);

		App.UI.DOM.appendNewElement("h3", f, "Body and gender options");
		r = [];
		r.push("All PC body changes will alter scenes, but their main mechanical effect is on");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("maintenance. Feminine options will make it harder to maintain");
		r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
		r.push("without providing any gameplay advantage, making playing as a feminine PC a form of increased difficulty. There are other minor gameplay differences including differing slave reactions to the PC based on attraction, but these are fairly minor.");
		App.Events.addParagraph(f, r);

		return f;
	}
}, "guide");

App.Encyclopedia.addCategory("guide", function() {
	const r = [];
	r.push(App.Encyclopedia.Dialog.linkDOM("First Game Guide", "First Game Guide"));
	r.push(App.Encyclopedia.Dialog.linkDOM("How to Play", "How to Play"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Keyboard Shortcuts", "Keyboard Shortcuts"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Arcology Interface", "The Arcology Interface"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Tips and Tricks", "Tips and Tricks"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Design Your Master", "Design Your Master"));
	return App.UI.DOM.generateLinksStrip(r);
});


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