code:
App.Encyclopedia.addArticle("Being in Charge", function() {
	const f = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", f, "Future room for lore text", "scene-intro");
	App.UI.DOM.appendNewElement("p", f, "Choose a more particular entry below:");
	return f;
}, "beingInCharge");

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

	const intro = App.UI.DOM.appendNewElement("div", f, "", "scene-intro");
	App.UI.DOM.appendNewElement("p", intro, "Arcologies are the urban buildings of the future: almost completely self-contained, almost completely self sufficient. In the anarcho-liberal 'paradise' of the Free Cities, as owner of your own arcology you are like a modern-day feudal suzerain, lord and master.");

	App.UI.DOM.appendNewElement("p", intro, "Your arcology is a flared structure, needle thin at the top where you live in your penthouse, and broad at the base. The base below ground contains storage and machinery. The lowest aboveground levels are commercial; above them are the residential areas. The entire structure is jacketed in dense gardens and solar arrays, cleverly structured to create naturally lit corridors and beautiful park-like balconies.");

	App.UI.DOM.appendNewElement("p", intro, "— Owner's Report");

	App.UI.DOM.appendNewElement("p", f, "You may wish to improve your arcology, but should be able to ignore its development, if you wish.");

	r = [];
	r.push("Your reputation is, of course, already quite impressive. The reputation tracked in the sidebar is specifically your reputation as a slaveowner. It can be raised through decadent actions that display your munificence and opulence. Some random events can increase it, but the most reliable way to improve your reputation is to send sexually skilled slaves out into the arcology to offer free sexual services. This assignment is very similar to prostitution, but produces reputation rather than");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("money", "Money"), "."), "cash"));
	r.push(`Your`, App.Encyclopedia.Dialog.linkDOM("Concubine", "Concubine"), `and to a lesser extent, other slaves assigned to your personal sexual service, also have a direct impact on your reputation. Maintaining an exclusive harem of beautiful, talented girls is not just one of the greatest perks of being an arcology owner, it's also a grand statement to the world about your personal standing and power.`);
	App.Events.addParagraph(f, r);

	r = [];
	r.push("As your reputation develops, you may have the opportunity to guide the future of your arcology's society. Successfully doing so will increase your reputation in turn, which will duly enable you to further shape society. Managing societal development well will have a recursive effect on your reputation, and can drive it to great heights.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Because societal development and reputation build upon each other, arcology owners who have a natural reputation disadvantage (such as young women) may find it best to develop a future society model for which they can easily build wide support early on in their arcology's development. Arcology owners who choose to focus on an especially challenging path at the start of their career, such as");
	r.push(App.Encyclopedia.Dialog.linkDOM("Repopulation", "Repopulationism"), "or", App.Encyclopedia.Dialog.linkDOM("Eugenics,", "Eugenics Focus"));
	r.push("may find that they have difficulty accumulating and maintaining enough reputation to shape additional societal development.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("The benefits of high reputation are numerous. Many business and enslavement opportunities will open to you once you are reputable. Some of the most advanced technology is only available to those with impeccable reputations as slaveowners, and many of the finer slave markets will only consider reputable buyers. You may eventually become so renowned that merely branding a slave with your mark will increase her value on the open market.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("However, your reputation will not look after itself. At a certain point, you will become so reputable that continual effort will be necessary to maintain your renown and greater feats will be needed to cultivate it further. The old world question \"What have you done for me lately?\" is asked with twice the force in the Free Cities! You will quickly find that this natural decay of reputation can overwhelm your efforts to improve it by the end of the week. A concerted strategy will be necessary to overcome this.");
	App.Events.addParagraph(f, r);

	return f;
}, "beingInCharge");

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

	r = [];
	r.push("At the end of every turn, a random event may occur. Almost all random events are tied to necessary preconditions. For example, events concerning");
	r.push(App.Encyclopedia.Dialog.linkDOM("rebellious", "From Rebellious to Devoted", "devotion resistant"));
	r.push("slaves will stop happening if all the player's slaves become obedient.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Usually, a situation will be presented and the player may choose one of two or three resolutions. Please note that the player may also to choose none of these by using the Continue button in the sidebar; in effect, this usually means the player's character has simply declined to involve himself.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Almost all choices will result in small effects. The most common are changes to a slave's attitude towards the player's character, but there are others.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Finally, there are events that can result in the player being offered the chance to acquire new slaves, some of which can be unique or valuable. Generally, these events offer this livestock at an extremely discounted price. These events will appear more often the higher the player's");
	r.push(App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"));
	r.push("becomes.");
	App.Events.addParagraph(f, r);

	return f;
}, "beingInCharge");

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

	const basicDrugCost = 100;
	const basicRulesCost = 100;

	r = [];
	r.push("Aphrodisiacs are");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheap", "Money", "cash"));
	r.push(`and cost ${cashFormat(basicDrugCost)} weekly; curatives are expensive and cost ${cashFormat(basicDrugCost * 3)} weekly; while all other drug regimes cost ${cashFormat(basicDrugCost * 2)}. Standard hormone regimens cost ${Math.trunc(basicDrugCost * 0.5)} while intensive hormone treatment costs ${Math.trunc(basicDrugCost * 2 * 0.5)}. Contraceptives cost ${Math.trunc(basicDrugCost * 0.5)}.`);
	App.Events.addParagraph(f, r);

	r = [];
	r.push(`Slaves on spare living standards are fed a bland diet and obliged to sleep on bedrolls. Keeping a slave under restrictive rules costs <span class='cash'>${cashFormat(basicRulesCost)}</span> weekly.`);
	App.Events.addParagraph(f, r);

	r = [];
	r.push(`Slaves enjoying luxurious living standards on the other hand are fed a tasty diet and permitted to sleep in comfortable beds, and are generally pampered. The increased luxury of permissive rules costs ${cashFormat(basicRulesCost * 3)} weekly.`);
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("p", f, "Costs given are only the base costs, they can be affected by a variety of modifiers, for example economy settings, player background and arcology upgrades. Some upgrades may have associated upkeep costs as well.");

	return f;
}, "beingInCharge");

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

	r = [];
	r.push(App.Encyclopedia.topic("The Rules Assistant"));
	r.push("is a system to apply multiple rule sets to multiple slaves at once. You can apply rules to slaves based on slave");
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), ","), ["devotion", "accept"]));
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("trust", "Trust"), ","), ["trust", "careful"]));
	r.push("sex drive, health,");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("weight", "Weight"), ","));
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("muscles", "Musculature"), ","));
	r.push("lactation, pregnancy, number of fetuses, abdominal implants and age.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Rule settings"));
	r.push("Rules can be used to control certain aspects of slaves everyday lives, for example to automatically give slaves a certain clothing option, collar, footwear or allow slaves to choose their own outfit. They can be used to give unhealthy slaves curatives to improve their health or to put slaves on a diet so that their");
	r.push(App.Encyclopedia.Dialog.linkDOM("weight", "Weight"));
	r.push("can be closer to the ideal weight. Rules set to No default setting will not apply that particular condition to slaves. Rules can also be renamed to be more indicative of their intended purpose.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Rule activation"));
	r.push("In order to apply a rule to slaves, the activation will need to be set. Choose an activation type");
	r.push(App.UI.DOM.combineNodes("(",
		App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), ","), ["devotion", "accept"])));
	r.push(App.UI.DOM.makeElement("span", App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("trust", "Trust"), ","), ["trust", "careful"]));
	r.push("sex drive,");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("health", "Health"), ","));
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("weight", "Weight"), ","));
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("muscles", "Musculature"), ","));
	r.push("lactation, pregnancy, fetuses, implant size, or age) and then choose the level at which to apply. For example to apply a rule to obedient slaves, choose");
	r.push(App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted", "devotion accept"));
	r.push("for the activation and 4 or more for the lower limit by selecting >=.");
	r.push(`You can also create custom conditions using any property of a slave, which you can find documented here.`);
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Selecting or excluding slaves from a rule"));
	r.push("Slaves can be selected for a rule by selecting slaves from the list so that a rule can apply only to them. Slaves can similarly be excluded from a rule.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Applying a rule to specific assignments"));
	r.push("You can apply a rule only to slaves on individual assignments by selecting them under Apply to assignments. For example a rule can give aphrodisiacs to slaves on whoring assignments. This is mutually exclusive to automatically giving an assignment to slaves.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Automatically giving an assignment"));
	r.push("A rule can be set to automatically set a slave to an assignment when activated. For example a");
	r.push(App.Encyclopedia.Dialog.linkDOM("devoted", "From Rebellious to Devoted", "devotion accept"));
	r.push("slave can be set to automatically be put on the whoring assignment. This is mutually exclusive to applying a rule to assignments.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Applying a rule to facilities"));
	r.push("You can apply a rule to slaves in any or all facilities as long as that facility has been constructed. The rule will only apply to slaves within the selected facilities. This is mutually exclusive to automatically putting slaves into a facility.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Automatically assigning slaves to a facility"));
	r.push("A rule can be set to automatically put a slave into a facility when activated. For example disobedient slaves can be set to automatically be confined in the arcade if it has been constructed. This is mutually exclusive to applying a rule to facilities.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Saving a rule"));
	r.push("If you are finished setting up a rule make sure to save it by clicking Save rule at the bottom before clicking another link otherwise your settings will be lost.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Applying a rule"));
	r.push("Clicking on Apply rules will automatically save the current rule and apply all rules to slaves at once.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Adding or removing a rule"));
	r.push("The game starts with 3 basic default rule settings but more can be added and/or removed as needed. To add a new rule, click Add a new rule at the bottom, removing a rule is the same by clicking Remove rule.");
	App.Events.addParagraph(f, r);

	return f;
}, "beingInCharge");

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

	r = [];
	r.push("Once you are fairly reputable and have a large sum of cash in the bank, you will receive a brief end of turn event that unlocks the ability to found a corporation dedicated to slaving. Once this happens, you can incorporate from the Manage Corporation link on the sidebar, and once you've done that, you can manage your corporation every week from the same place.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "Shares");
	r = [];
	r.push("Buying shares from the corporation or issuing new shares will create new shares in the corporation. If you buy them yourself, cash will be transferred from you to the corporation in return for the shares; if you direct the corporation to issue new public shares,");
	r.push(App.Encyclopedia.Dialog.linkDOM("money", "Money", "cash"));
	r.push("will come into the corporation from the market. If you direct the corporation to buy back shares from the public, cash will be transferred from the corporation to reduce the number of public shares, which will increase your ownership percentage. You are not permitted to give up majority ownership of the corporation. Selling your shares or buying publicly held shares are both transactions between you and your shares and shareholders and their shares. All transactions impact the stock price.");
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("h3", f, "Divisions");
	App.UI.DOM.appendNewElement("p", f, "The corporation consists of divisions. Starting up your corporation requires you to choose a single division as starting point and you will be able to expand into linked divisions once you have grown sufficiently in size. There are 3 general categories of divisions; acquisition, modification and exploitation. The first consists of legal and extralegal enslavement and they feed fresh slaves into either your corporation or the market at large. Investing in one of these is a good starting point when slave prices are high. Do note that each slave acquired and sold reduces the demand for slaves on the market. This means little at first, but when large enough will impact the market significantly.");
	App.UI.DOM.appendNewElement("p", f, "The second category consists of slave breaking, physical slave modifications and slave training. These divisions either take improvable slaves from your acquisition divisions or the slave market and improve them. Slaves can go from breaking to physical modifications to training and become highly valuable slaves by the end of it. If the slave market is balanced or you are looking for a safe initial investment these divisions are a good choice. Their market impact is neutral, buying slaves reduces supply but selling them back onto the market reduces demand by the same amount.");
	App.UI.DOM.appendNewElement("p", f, "The final category consists of an arcade, menial services, dairy and escort division. These divisions require a particular quality of slave and then put them to work in their respective fields. As these divisions operate they will have to write off some of their slaves and replace them with fresh ones, you can provide these slaves through your acquisition or modification divisions or the market. Whenever prices are low these divisions operate at a higher margin, making them a great first division when slave prices are low. Do note that each slave bought from the market reduces the supply of slaves. As these divisions grow and write off more and more slaves each week, replenishing them from the market will begin to impact the market significantly.");

	App.UI.DOM.appendNewElement("h3", f, "Management");
	App.UI.DOM.appendNewElement("p", f, "Your first division will automatically buy and/or sell slaves in order to do business and make money. It is up to you to decide when to expand the division's capacity, but investing aggressively early will pay off in the long run. Once your corporation has gotten a little time to grow its value (the sum of slave value, division value, cash on hand and dividends reserved) the end of week report will prompt you that a new division can be added. This requires a significant cash investment so you may have to save up a little. Adding divisions comes with efficiency benefits, but also adds overhead costs. Adding a second division will hardly slow you down, but as you grow these costs grow ever larger; depending on the number of divisions, but also the size of them.");
	App.UI.DOM.appendNewElement("p", f, "Any new division will have at least one direct link to your current divisions, meaning it can either use slaves from a division or provide them to another division. New divisions are not automatically set to buy and/or sell slaves from the market. It is expected you either manually move slaves between divisions or sets up automatic links between them using several rules.");
	App.UI.DOM.appendNewElement("p", f, "You have the ability to reduce the size of your divisions or dissolve them entirely. While this only recoups 80% of the investment it may sometimes be prudent to do so, i.e. in case market conditions have become unfavorable for the division and/or overhead costs are becoming oppressively high. Also note that divisions become less efficient the larger they get (even without considering overhead), eventually growing it further will hurt your profit, not improve it. You will want to cut your losses early or otherwise suffer the consequences.");
	App.UI.DOM.appendNewElement("p", f, "In order to personally benefit monetarily from your corporation you will have to decide how much of its profit will be set aside to be paid out as dividends. Setting low or no dividends allows for rapid development, while siphoning a lot of profits away from the corporation will slow it down significantly. Please note that the corporation does not pay out every week but only every quarter (13 weeks).");

	App.UI.DOM.appendNewElement("h3", f, "Slave Sales");
	App.UI.DOM.appendNewElement("p", f, "Once a corporation is created, it will get its own establishment in the slave market. As the corporation's value increase, it can be given direction about what kind of slaves it should train and how it should train them, which will affect the slaves seen in the corporate catalog. As with divisions; the higher your corporation's value, the more specializations you are allowed to choose. Your corporation's divisions determine which specialization options are available. Each division has a unique specialization associated with it while many others are slightly more general and linked to either acquisition or modification. All kinds of restrictions may apply depending on Future Society choices and the size of your divisions. Several specializations can be enhanced beyond the first choice, but again you may need to satisfy certain conditions first.");
	r = [];
	r.push("If the corporation's slaves have qualities that make them especially appealing to an arcology's citizens, the corporation will enjoy increased profits, and the");
	r.push(App.Encyclopedia.Dialog.linkDOM("future society", "Future Societies"));
	r.push("creating the demand will progress more rapidly due to the supply of appealing slaves. All arcologies present in the Free City will interact with the corporation this way, making shares in a corporation which supplies girls that appeal to the whole city extremely lucrative.");
	App.Events.addParagraph(f, r);

	return f;
}, "beingInCharge");

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

	App.UI.DOM.appendNewElement("p", f, `Though you're (naturally) a virile, oversexed oligarch, even your reserves of sexual energy are not infinite. They're impressive, but not infinite. Since one turn represents one week, the game does not allow you direct control over every sexual interaction between you character and your slaves. Put another way, the game assumes there's an impressive amount of off-screen sex going on between the you and your chattel.`);

	r = [];
	r.push(`Your sexual energy can have gameplay effects. Though of course all slaves are at the owner's sexual beck and call, some assignments and training methods involve close sexual attention by yourself. If a large number of slaves are subject to this, your attention will be somewhat diluted, and the effects on each slave will be reduced. Slaves assigned to be fucktoys and serve in the master suite count towards a hidden estimation of your sexual foci. With two or fewer such slaves, the your sexual attention on these slaves will be intense and have intense effects. With five or more, the you may have some difficulty in using every slave every day, diluting the mental effects of being one's personal sex toy.`);
	App.Events.addParagraph(f, r);

	App.UI.DOM.appendNewElement("p", f, `It is possible to raise these limits by focusing on sexual decadence for the week. By paying less attention to business and not using sexual training on specific slaves, you will have more energy to spare and can offer intense sexual attention to three slaves or give sexual attention to up to seven slaves without dilution.`);

	App.UI.DOM.appendNewElement("p", f, `There exist several other ways to raise your sexual energy as well.`);

	return f;
}, "beingInCharge");

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

	r = [];
	r.push(App.Encyclopedia.topic("Trading"));
	r.push("signifies how efficient you are at making exchanges. Provides more passive income the higher it is. Can be increased through acquiring slaves.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Warfare"));
	r.push("is an indication your combat prowess. Cuts cost of housing mercs in half. Can be increased through use in relevant situations.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Hacking"));
	r.push("is an indication of your effectiveness at manipulating computer systems. Higher levels make technological upgrades");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheaper", "Money", "cash"));
	r.push("or free, provides a boost situations where fame is measured digitally. Can be increased through choosing to Sell your intrusion services to the highest bidder once the option becomes available after having some skill and purchasing technological upgrades.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Slaving"));
	r.push("improves your effectiveness as a slave driver. At max level it allows you to more easily spot");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("gingering", "Gingering"), "."));
	r.push("Can be increased through acquiring performing the duties of a slave driver.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Engineering"));
	r.push("is a sign of how effective you are building and maintenance. Mastering the skill reduces the cost of arcology upgrades and expansions. Can be increased through purchasing arcology upgrades or expanding facility capacity. If the");
	r.push(App.Encyclopedia.Dialog.linkDOM("Security Expansion", "Security Expansion"));
	r.push("mod is enabled, the skill is also increased by repairing your arcology.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push(App.Encyclopedia.topic("Medicine"));
	r.push("shows how effective you are treating wounds. Max level reduces a slave's health and");
	r.push(App.Encyclopedia.Dialog.linkDOM("trust", "Trust", "trust careful"));
	r.push("loss during surgery.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("In addition to the above methods of increasing a skill (if any), all of them can be learnt by retaining a trainer");
	if (V.SF.Toggle && V.SF.Active >= 1) {
		r.push("or by talking to/learning from The Colonel");
	}
	r.push(r.pop() + ".");
	App.Events.addParagraph(f, r);

	return f;
}, "beingInCharge");

App.Encyclopedia.addCategory("beingInCharge", function() {
	const links = [];
	links.push(App.Encyclopedia.Dialog.linkDOM("Arcologies and Reputation", "Arcologies and Reputation"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Random Events", "Random Events"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Costs Summary", "Costs Summary"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Rules Assistant", "Rules Assistant"));
	links.push(App.Encyclopedia.Dialog.linkDOM("The Corporation", "The Corporation"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Sexual Energy", "Sexual Energy"));
	links.push(App.Encyclopedia.Dialog.linkDOM("PC Skills", "PC Skills"));
	return App.UI.DOM.generateLinksStrip(links);
});


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

repo_name: Pecanus/fc

license: mit


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


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