From 8bbc38f6d41fdb161ec098c4b89e9f435b13589d Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Wed, 5 May 2021 17:49:27 +0200 Subject: [PATCH 1/2] Change encyclopedia from classes to a map from article key to DOM function --- src/004-base/baseEncyclopediaEntry.js | 43 - src/004-base/encyclopediaMap.js | 39 + .../Encyclopedia/encyclopediaAssignments.js | 191 ++- src/gui/Encyclopedia/encyclopediaBody.js | 1029 ++++++++--------- 4 files changed, 643 insertions(+), 659 deletions(-) delete mode 100644 src/004-base/baseEncyclopediaEntry.js create mode 100644 src/004-base/encyclopediaMap.js diff --git a/src/004-base/baseEncyclopediaEntry.js b/src/004-base/baseEncyclopediaEntry.js deleted file mode 100644 index 67370408c5f..00000000000 --- a/src/004-base/baseEncyclopediaEntry.js +++ /dev/null @@ -1,43 +0,0 @@ -/** base class for class-based events */ -App.Encyclopedia.EncyclopediaCategory = class EncyclopediaCategory { - constructor() {} - /** - * @param {string} topic - * @returns {HTMLElement} - */ - topic(topic) { - return App.UI.DOM.makeElement("span", topic, ["encyclopedia", "topic"]); - } - - /** - * @param {string} linkText - * @param {string} topic - * @returns {HTMLElement} - */ - encyLink(linkText, topic) { - return App.Encyclopedia.Dialog.linkDOM(linkText, topic); - } - - renderArticle(which) { - if (which in this) { - return this[which](); - } - return null; - } -}; - -App.Encyclopedia.renderArticle = function(article) { - const categories = [ - new App.Encyclopedia.Anatomy(), - new App.Encyclopedia.Assignments(), - ]; - for (const cat of categories) { - const result = cat.renderArticle(article); - if (result) { - return result; - } - } - //TODO: turn this back on when completed. - // return `Encyclopedia entry "${article}" not found`; - return; -}; diff --git a/src/004-base/encyclopediaMap.js b/src/004-base/encyclopediaMap.js new file mode 100644 index 00000000000..55a7f235620 --- /dev/null +++ b/src/004-base/encyclopediaMap.js @@ -0,0 +1,39 @@ +/** + * @type {Map<string, function():(HTMLElement|DocumentFragment)>} + */ +App.Encyclopedia.articles = new Map(); + +/** + * Adds an article if it does not exist yet. + * + * @param {string} key + * @param {function():(HTMLElement|DocumentFragment)} article + */ +App.Encyclopedia.addArticle = function(key, article) { + if (!App.Encyclopedia.articles.has(key)) { + App.Encyclopedia.articles.set(key, article); + } else { + console.log(`Trying to overwrite encyclopedia article ${article}.`); + } +}; + +/** + * Renders the specified article. + * + * @param {string} article + * @returns {string|HTMLElement|DocumentFragment} + */ +App.Encyclopedia.renderArticle = function(article) { + if (App.Encyclopedia.articles.has(article)) { + return App.Encyclopedia.get(article)(); + } + + // TODO: turn this back on when completed. + // return `Encyclopedia entry "${article}" not found.`; + return null; +}; + +// Utility functions +App.Encyclopedia.topic = function(topic) { + return App.UI.DOM.makeElement("span", topic, ["encyclopedia", "topic"]); +}; diff --git a/src/gui/Encyclopedia/encyclopediaAssignments.js b/src/gui/Encyclopedia/encyclopediaAssignments.js index 1723d8d5996..2fb32e4c1e0 100644 --- a/src/gui/Encyclopedia/encyclopediaAssignments.js +++ b/src/gui/Encyclopedia/encyclopediaAssignments.js @@ -1,111 +1,108 @@ /* TODO: add entries for Nursery */ +App.Encyclopedia.addArticle("attendingClasses", function() { + 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." + ); +}); -App.Encyclopedia.Assignments = class Assignments extends App.Encyclopedia.EncyclopediaCategory { - attendingClasses() { - return App.UI.DOM.combineNodes( - this.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." - ); - } - - confinement() { - App.UI.DOM.combineNodes( - this.topic("Confinement"), - " is an assignment which accelerates breaking for disobedient slaves. If a slave isn't obedient enough to work and isn't ", - this.encyLink("unhealthy", "Health"), - " enough to need rest, this will make them useful sooner." - ); - } +App.Encyclopedia.addArticle("confinement", function() { + 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." + ); +}); - fucktoy() { - return App.UI.DOM.combineNodes( - this.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." - ); - } - - gloryHole() { - return App.UI.DOM.combineNodes( - this.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 ", - this.encyLink("healthy", "Health"), - " but very powerful for extracting ¤ out of otherwise useless slaves." - ); - } +App.Encyclopedia.addArticle("fucktoy", function() { + 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." + ); +}); - milking() { - const fragment = document.createDocumentFragment(); +App.Encyclopedia.addArticle("gloryHole", function() { + 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." + ); +}); - fragment.append( - this.topic("Getting milked"), - " is an assignment which makes money from lactation based on a slave's breasts, ", - this.encyLink("health", "Health"), - " and hormonal status." - ); - if (V.seeDicks > 0) { - fragment.append(" Cows with balls will also give semen."); - } - fragment.append(` Creates profit quickly from slaves with big tits${V.seeDicks ? " or balls" : ""}.`); +App.Encyclopedia.addArticle("milking", function() { + const fragment = document.createDocumentFragment(); - return fragment; + 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" : ""}.`); - farming() { - const fragment = document.createDocumentFragment(); - fragment.append( - this.topic("Farming"), - " is an assignment which produces ", - this.encyLink("food", "Food"), - " from your slaves' hard work" - ); - if (V.seeBestiality) { - fragment.append(" and allows you to breed slaves with animals"); - } - fragment.append( - ". Can also reduce arcology upkeep with upgrades in the ", - this.encyLink("Farmyard", "Farmyard") - ); - return fragment; - } + return fragment; +}); - publicService() { - return App.UI.DOM.combineNodes( - this.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." - ); +App.Encyclopedia.addArticle("farming", function() { + 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; +}); - rest() { - return App.UI.DOM.combineNodes( - this.topic("Rest"), - " is an assignment mostly used to improve ", - this.encyLink("health", "Health"), - ". It can be useful to order slaves you wish to intensively modify to rest, since most modifications damage health. It will synergize with curative treatments, providing bonus healing when both are simultaneously applied." - ); - } +App.Encyclopedia.addArticle("publicService", function() { + 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." + ); +}); - sexualServitude() { - return App.UI.DOM.combineNodes( - this.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 ", - this.encyLink("devotion", "Devotion"), - " up quickly." - ); - } +App.Encyclopedia.addArticle("rest", function() { + 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." + ); +}); - servitude() { - return App.UI.DOM.combineNodes( - this.topic("Servitude"), - " is an assignment which reduces your upkeep based on the slave's ", - this.encyLink("devotion", "Devotion"), - " Available at lower obedience than other jobs, is insensitive to the quality of a slave's body, and doesn't require skills; a good transitional assignment. Unusually, low sex drive is advantageous as a servant, since it reduces distraction. Lactating slaves are slightly better at this job, since they can contribute to their fellow slaves' nutrition." - ); - } +App.Encyclopedia.addArticle("sexualServitude", function() { + 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." + ); +}); - whoring() { - return App.UI.DOM.combineNodes( - this.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("servitude", function() { + 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." + ); +}); + +App.Encyclopedia.addArticle("whoring", function() { + 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." + ); +}); diff --git a/src/gui/Encyclopedia/encyclopediaBody.js b/src/gui/Encyclopedia/encyclopediaBody.js index 2483b7f7e1e..05efeb9edc5 100644 --- a/src/gui/Encyclopedia/encyclopediaBody.js +++ b/src/gui/Encyclopedia/encyclopediaBody.js @@ -1,524 +1,515 @@ -App.Encyclopedia.Anatomy = class Anatomy extends App.Encyclopedia.EncyclopediaCategory { - constructor() { - super(); - this["Body"] = () => { - 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; - }; - - this["Waist"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Anuses"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Areolae"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Breasts"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Clits"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Dicks"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Ethnicity"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Faces"] = () => { - const fragment = new DocumentFragment(); - let r = []; - for (const [key, shape] of App.Medicine.Modification.faceShape) { - if (shape.hasOwnProperty("requirements") && !shape.requirements) { - continue; - } else { - 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(this.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; - }; - - this["Height"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Hips"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Lactation"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves can begin to`); - r.push(this.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; - }; - - this["Lips"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Musculature"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Nipples"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Ovaries"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Pregnancy"] = () => { - return App.UI.DOM.combineNodes( - `Slaves require both `, - App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"), - ` and `, - App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"), - ` to become`, - this.topic("pregnant."), - `However, it's rumored that Gender Radicalist societies have developed a method for `, - App.Encyclopedia.Dialog.linkDOM("male impregnation", "Gender Radicalism Research"), - `. Fertile slaves can be impregnated by the player character or a slave with `, - App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"), - ` 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 `, - App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation") - ); - }; - - this["Skin Distinctions"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(`Slaves can have various`); - r.push(this.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; - }; - - this["Teeth"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(`Slaves'`); - r.push(this.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) { - continue; - } else { - 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; - }; - - this["Testicles"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Vaginas"] = () => { - const fragment = new DocumentFragment(); - const r = []; - r.push(`Slaves'`); - r.push(this.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; - }; - - this["Weight"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(`A slaves'`); - r.push(this.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; - }; - - this["Hormones (XX)"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(App.UI.DOM.combineNodes( - this.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.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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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"); - - 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; - }; - - this["Hormones (XY)"] = () => { - const fragment = new DocumentFragment(); - let r = []; - r.push(App.UI.DOM.combineNodes( - this.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:` - )); + } + } + 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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +App.Encyclopedia.addArticle("Pregnancy", function() { + return App.UI.DOM.combineNodes( + `Slaves require both `, + App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"), + ` and `, + App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"), + ` to become`, + App.Encyclopedia.topic("pregnant."), + `However, it's rumored that Gender Radicalist societies have developed a method for `, + App.Encyclopedia.Dialog.linkDOM("male impregnation", "Gender Radicalism Research"), + `. Fertile slaves can be impregnated by the player character or a slave with `, + App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"), + ` 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 `, + App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation") + ); +}); + +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; +}); + +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"); - - 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; - }; + } } -}; + App.Events.addParagraph(fragment, r); + return fragment; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); + +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; +}); -- GitLab From 1764ffe39789e6dcb17e5c753d3aa81bad1b6492 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Wed, 5 May 2021 23:40:59 +0200 Subject: [PATCH 2/2] Add categories to encyclopedia entries --- src/004-base/encyclopediaMap.js | 66 ++++++++++++++-- src/gui/Encyclopedia/encyclopediaBody.js | 75 +++++++++++++------ .../Encyclopedia/encyclopediaRelatedLinks.tw | 37 ++------- 3 files changed, 119 insertions(+), 59 deletions(-) diff --git a/src/004-base/encyclopediaMap.js b/src/004-base/encyclopediaMap.js index 55a7f235620..38b23c44ead 100644 --- a/src/004-base/encyclopediaMap.js +++ b/src/004-base/encyclopediaMap.js @@ -1,5 +1,11 @@ +// Articles map /** - * @type {Map<string, function():(HTMLElement|DocumentFragment)>} + * @typedef {object} article + * @property {function():(HTMLElement|DocumentFragment)} render + * @property {string} [category] + */ +/** + * @type {Map<string, article>} */ App.Encyclopedia.articles = new Map(); @@ -8,12 +14,13 @@ App.Encyclopedia.articles = new Map(); * * @param {string} key * @param {function():(HTMLElement|DocumentFragment)} article + * @param {string} [category] */ -App.Encyclopedia.addArticle = function(key, article) { +App.Encyclopedia.addArticle = function(key, article, category) { if (!App.Encyclopedia.articles.has(key)) { - App.Encyclopedia.articles.set(key, article); + App.Encyclopedia.articles.set(key, {render: article, category: category}); } else { - console.log(`Trying to overwrite encyclopedia article ${article}.`); + console.log(`Trying to overwrite encyclopedia article "${article}".`); } }; @@ -25,14 +32,61 @@ App.Encyclopedia.addArticle = function(key, article) { */ App.Encyclopedia.renderArticle = function(article) { if (App.Encyclopedia.articles.has(article)) { - return App.Encyclopedia.get(article)(); + return App.Encyclopedia.articles.get(article).render(); } // TODO: turn this back on when completed. - // return `Encyclopedia entry "${article}" not found.`; + // return `Encyclopedia article "${article}" not found.`; return null; }; +// Categories map +/** + * @type {Map<string, function():(HTMLElement|DocumentFragment)>} + */ +App.Encyclopedia.categories = new Map(); + +/** + * Adds an article if it does not exist yet. + * + * @param {string} key + * @param {function():(HTMLElement|DocumentFragment)} category + */ +App.Encyclopedia.addCategory = function(key, category) { + if (!App.Encyclopedia.categories.has(key)) { + App.Encyclopedia.categories.set(key, category); + } else { + console.log(`Trying to overwrite encyclopedia category "${category}".`); + } +}; + +/** + * Renders the specified article. + * + * @param {string} article + * @returns {string|HTMLElement|DocumentFragment} + */ +App.Encyclopedia.renderCategory = function(article) { + if (!App.Encyclopedia.articles.has(article)) { + // TODO: turn this back on when completed. + // return `Encyclopedia article "${article}" not found.`; + return null; + } + + const category = App.Encyclopedia.articles.get(article).category; + if (!category) { + // TODO: turn this back on when completed. + // return `Encyclopedia article "${article}" has no category.`; + return null; + } + + if (!App.Encyclopedia.categories.has(category)) { + return `Encyclopedia category "${category}" not found.`; + } + + return App.Encyclopedia.categories.get(category)(); +}; + // Utility functions App.Encyclopedia.topic = function(topic) { return App.UI.DOM.makeElement("span", topic, ["encyclopedia", "topic"]); diff --git a/src/gui/Encyclopedia/encyclopediaBody.js b/src/gui/Encyclopedia/encyclopediaBody.js index 05efeb9edc5..ff8f91b4030 100644 --- a/src/gui/Encyclopedia/encyclopediaBody.js +++ b/src/gui/Encyclopedia/encyclopediaBody.js @@ -3,7 +3,7 @@ App.Encyclopedia.addArticle("Body", function() { 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(); @@ -13,7 +13,7 @@ App.Encyclopedia.addArticle("Waist", function() { 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(); @@ -34,7 +34,7 @@ App.Encyclopedia.addArticle("Anuses", function() { )); App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Areolae", function() { const fragment = new DocumentFragment(); @@ -44,7 +44,7 @@ App.Encyclopedia.addArticle("Areolae", function() { 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(); @@ -68,7 +68,7 @@ App.Encyclopedia.addArticle("Breasts", function() { r.push(`will be grateful for).`); App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Clits", function() { const fragment = new DocumentFragment(); @@ -79,7 +79,7 @@ App.Encyclopedia.addArticle("Clits", function() { // 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(); @@ -101,7 +101,7 @@ App.Encyclopedia.addArticle("Dicks", function() { 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(); @@ -111,7 +111,7 @@ App.Encyclopedia.addArticle("Ethnicity", function() { 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(); @@ -136,7 +136,7 @@ App.Encyclopedia.addArticle("Faces", function() { r = []; r.push(App.UI.DOM.makeElement("h2", `Facial shapes and beauty`)); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Height", function() { const fragment = new DocumentFragment(); @@ -152,7 +152,7 @@ App.Encyclopedia.addArticle("Height", function() { 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(); @@ -163,7 +163,7 @@ App.Encyclopedia.addArticle("Hips", function() { // 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(); @@ -183,7 +183,7 @@ App.Encyclopedia.addArticle("Lactation", function() { 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(); @@ -197,7 +197,7 @@ App.Encyclopedia.addArticle("Lips", function() { )); App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Musculature", function() { const fragment = new DocumentFragment(); @@ -239,7 +239,7 @@ App.Encyclopedia.addArticle("Musculature", function() { 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(); @@ -262,7 +262,7 @@ App.Encyclopedia.addArticle("Nipples", function() { App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Ovaries", function() { const fragment = new DocumentFragment(); @@ -276,7 +276,7 @@ App.Encyclopedia.addArticle("Ovaries", function() { )); App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Pregnancy", function() { return App.UI.DOM.combineNodes( @@ -293,7 +293,7 @@ App.Encyclopedia.addArticle("Pregnancy", function() { ` 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 `, App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation") ); -}); +}, "body"); App.Encyclopedia.addArticle("Skin Distinctions", function() { const fragment = new DocumentFragment(); @@ -326,7 +326,7 @@ App.Encyclopedia.addArticle("Skin Distinctions", function() { 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(); @@ -346,7 +346,7 @@ App.Encyclopedia.addArticle("Teeth", function() { } App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Testicles", function() { const fragment = new DocumentFragment(); @@ -356,7 +356,7 @@ App.Encyclopedia.addArticle("Testicles", function() { 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(); @@ -380,7 +380,7 @@ App.Encyclopedia.addArticle("Vaginas", function() { fragment.append(App.Encyclopedia.Dialog.linkDOM("Clit?", "Clits")); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Weight", function() { const fragment = new DocumentFragment(); @@ -424,7 +424,7 @@ App.Encyclopedia.addArticle("Weight", function() { 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(); @@ -471,7 +471,7 @@ App.Encyclopedia.addArticle("Hormones (XX)", function() { App.Events.addParagraph(fragment, r); return fragment; -}); +}, "body"); App.Encyclopedia.addArticle("Hormones (XY)", function() { const fragment = new DocumentFragment(); @@ -512,4 +512,33 @@ App.Encyclopedia.addArticle("Hormones (XY)", function() { 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); }); diff --git a/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw b/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw index 48bf1a4d93a..1f3354bc0d0 100644 --- a/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw +++ b/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw @@ -5,6 +5,12 @@ <br><h3>Related Links</h3> <</if>> + +<<set _pass = App.Encyclopedia.renderCategory($encyclopedia)>> +<<if _pass>> + <<includeDOM _pass>> +<<else>> + <<switch $encyclopedia>> /********** @@ -105,36 +111,6 @@ SLAVE ASSIGNMENTS (COMMON): | <<= App.Encyclopedia.Dialog.linkSC("Servitude, Sexual", "Sexual Servitude")>> | <<= App.Encyclopedia.Dialog.linkSC("Servitude", "Servitude")>> | <<= App.Encyclopedia.Dialog.linkSC("Whoring", "Whoring")>> - -/********** -SLAVE BODY: -**********/ -<<case "Anuses" "Areolae" "Body" "Breasts" "Butts" "Clits" "Dicks" "Ethnicity" "Faces" "Height" "Hips" "Lactation" "Lips" "Musculature" "Nipples" "Ovaries" "Skin Distinctions" "Teeth" "Testicles" "Vaginas" "Waist" "Weight" "Hormones (XX)" "Hormones (XY)">> - <<= App.Encyclopedia.Dialog.linkSC("Anuses", "Anuses")>> - | <<= App.Encyclopedia.Dialog.linkSC("Areolae", "Areolae")>> - | <<= App.Encyclopedia.Dialog.linkSC("Breasts", "Breasts")>> - | <<= App.Encyclopedia.Dialog.linkSC("Butts", "Butts")>> - | <<= App.Encyclopedia.Dialog.linkSC("Clits", "Clits")>> - | <<= App.Encyclopedia.Dialog.linkSC("Dicks", "Dicks")>> - | <<= App.Encyclopedia.Dialog.linkSC("Ethnicity", "Ethnicity")>> - | <<= App.Encyclopedia.Dialog.linkSC("Faces", "Faces")>> - | <<= App.Encyclopedia.Dialog.linkSC("Height", "Height")>> - | <<= App.Encyclopedia.Dialog.linkSC("Hips", "Hips")>> - | <<= App.Encyclopedia.Dialog.linkSC("Lactation", "Lactation")>> - | <<= App.Encyclopedia.Dialog.linkSC("Lips", "Lips")>> - | <<= App.Encyclopedia.Dialog.linkSC("Musculature", "Musculature")>> - | <<= App.Encyclopedia.Dialog.linkSC("Nipples", "Nipples")>> - | <<= App.Encyclopedia.Dialog.linkSC("Ovaries", "Ovaries")>> - | <<= App.Encyclopedia.Dialog.linkSC("Pregnancy", "Pregnancy")>> - | <<= App.Encyclopedia.Dialog.linkSC("Skin Distinctions", "Skin Distinctions")>> - | <<= App.Encyclopedia.Dialog.linkSC("Teeth", "Teeth")>> - | <<= App.Encyclopedia.Dialog.linkSC("Testicles", "Testicles")>> - | <<= App.Encyclopedia.Dialog.linkSC("Vaginas", "Vaginas")>> - | <<= App.Encyclopedia.Dialog.linkSC("Waist", "Waist")>> - | <<= App.Encyclopedia.Dialog.linkSC("Weight", "Weight")>> - | <<= App.Encyclopedia.Dialog.linkSC("XX", "Hormones (XX)")>> - | <<= App.Encyclopedia.Dialog.linkSC("XY", "Hormones (XY)")>> - /********** SLAVE SKILLS **********/ @@ -466,3 +442,4 @@ MODS | <<= App.Encyclopedia.Dialog.linkSC("Bioengineering", "Bioengineering")>> <</switch>> +<</if>> -- GitLab