From 583ca8653bb1595070a54d9d9ecf41bad81e5905 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Mon, 1 Mar 2021 16:34:26 +0100 Subject: [PATCH] code style and deduplication of descriptions --- src/npc/descriptions/career.js | 2 +- src/npc/descriptions/describeBrands.js | 11 +- src/npc/descriptions/describePiercings.js | 39 +-- src/npc/descriptions/describeScars.js | 80 +++-- src/npc/descriptions/describeTattoos.js | 3 +- src/npc/descriptions/descriptionWidgets.js | 34 +-- src/npc/descriptions/dimensions.js | 43 +-- src/npc/descriptions/eyes.js | 7 +- src/npc/descriptions/face.js | 2 +- src/npc/descriptions/heightImplant.js | 3 +- src/npc/descriptions/longSlave.js | 3 +- src/npc/descriptions/mind.js | 2 +- src/npc/descriptions/skills.js | 1 - src/npc/descriptions/skin.js | 48 +-- src/npc/descriptions/waist.js | 339 ++++++++------------- 15 files changed, 236 insertions(+), 381 deletions(-) diff --git a/src/npc/descriptions/career.js b/src/npc/descriptions/career.js index 25d069597e0..79f96f648c9 100644 --- a/src/npc/descriptions/career.js +++ b/src/npc/descriptions/career.js @@ -159,7 +159,7 @@ App.Desc.career = function(slave) { ]; const careersArray = careerMap.filter((o) => (slave.skill[o.prop] >= V.masteredXP)).map((o) => o.val); if (careersArray.length > 0) { - r.push(`${He} has working experience as a ${careersArray.reduce((res, ch, i, arr) => res + (i === arr.length-1 ? ' and ' : ', ') + ch)}.`); + r.push(`${He} has working experience as a ${careersArray.toStringExt()}.`); } return r.join(" "); }; diff --git a/src/npc/descriptions/describeBrands.js b/src/npc/descriptions/describeBrands.js index 26527717b96..5b09e4c5f0f 100644 --- a/src/npc/descriptions/describeBrands.js +++ b/src/npc/descriptions/describeBrands.js @@ -1,5 +1,6 @@ /** * @param {App.Entity.SlaveState} slave + * @param {string} surface * @returns {string} Slave's brand. Slave is the slave in question, but call the body part without modifiers. Rather than using "left breast" and "right breast" just use "breast". The function will then describe any brands on the breasts, if present, in natural language. */ App.Desc.brand = function(slave, surface) { @@ -30,7 +31,7 @@ App.Desc.brand = function(slave, surface) { r += `${His} fake belly has the same brand, ${slave.brand.belly}, as ${his} real one. `; } else { const description = desc(surface); - if (description) { + if (description !== "") { r += `${He} has ${description}. `; } } @@ -38,6 +39,10 @@ App.Desc.brand = function(slave, surface) { } return r; + /** + * @param {string} part + * @returns {string} + */ function desc(part) { const surface = App.Desc.oppositeSides(part); const centerBrand = slave.brand[surface.center] ? pronounsForSlaveProp(slave, slave.brand[surface.center]) : undefined; @@ -47,9 +52,9 @@ App.Desc.brand = function(slave, surface) { return `${centerBrand} branded into the flesh of ${his} ${surface.center}`; } else { // Center not defined, body part has a mirror. if (!leftBrand && !rightBrand) { - return; // no marks + return ""; // no marks } else if (part.startsWith("right ") && leftBrand) { - return; // we already described it on the left + return ""; // we already described it on the left } else if (leftBrand === rightBrand) { // matching places and marks // note that the slave.brand object won't have slave.brand["upper armS"] with an S defined, just the left and right, so we just use the left since we know they match. diff --git a/src/npc/descriptions/describePiercings.js b/src/npc/descriptions/describePiercings.js index 660bbc4c870..4120e520ebc 100644 --- a/src/npc/descriptions/describePiercings.js +++ b/src/npc/descriptions/describePiercings.js @@ -1,15 +1,14 @@ /** * @param {App.Entity.SlaveState} slave + * @param {string} surface * @returns {string} Relevant slave tattoo, if present */ App.Desc.piercing = function(slave, surface) { "use strict"; let r = []; - /* eslint-disable no-unused-vars*/ const { - he, him, his, hers, himself, girl, He, His + he, him, his, himself, girl, He, His } = getPronouns(slave); - /* eslint-enable */ if (V.showBodyMods !== 1) { return; } @@ -781,26 +780,20 @@ App.Desc.piercing = function(slave, surface) { break; } case "chastity": { // non anatomical - if (slave.clitPiercing > 0) { - if (slave.nipplesPiercing > 0) { - if (!(slave.chastityPenis)) { - if (slave.dick > 4) { - if (slave.boobs > 1000) { - if (canAchieveErection(slave) && slave.balls > 0) { - if (slave.devotion > 20) { - if (slave.energy > 90) { - r.push(`${His} very special body allows ${him} to wear an incredibly lewd piece of jewelry: a thin golden chain that runs from nipple to nipple, through ${his} pierced cockhead. The chain is short, and any motion at all tugs at ${his} nipples and penis.`); - if (canWalk(slave) || (canMove(slave) && slave.rules.mobility === "permissive" && hasBothLegs(slave))) { - r.push(`The stimulation is almost unbearable, and the mere act of walking sometimes causes ${him} to cum.`); - } else if (canMove(slave)) { - r.push(`The stimulation is almost unbearable, as any effort to move ${himself} starts building up an orgasm.`); - } - } - } - } - } - } - } + if (slave.clitPiercing > 0 + && slave.nipplesPiercing > 0 + && !(slave.chastityPenis) + && slave.dick > 4 + && slave.boobs > 1000 + && canAchieveErection(slave) + && slave.balls > 0 + && slave.devotion > 20 + && slave.energy > 90) { + r.push(`${His} very special body allows ${him} to wear an incredibly lewd piece of jewelry: a thin golden chain that runs from nipple to nipple, through ${his} pierced cockhead. The chain is short, and any motion at all tugs at ${his} nipples and penis.`); + if (canWalk(slave) || (canMove(slave) && slave.rules.mobility === "permissive" && hasBothLegs(slave))) { + r.push(`The stimulation is almost unbearable, and the mere act of walking sometimes causes ${him} to cum.`); + } else if (canMove(slave)) { + r.push(`The stimulation is almost unbearable, as any effort to move ${himself} starts building up an orgasm.`); } } break; diff --git a/src/npc/descriptions/describeScars.js b/src/npc/descriptions/describeScars.js index 4d9aa253286..99aa7caff5b 100644 --- a/src/npc/descriptions/describeScars.js +++ b/src/npc/descriptions/describeScars.js @@ -1,16 +1,15 @@ /** * @param {App.Entity.SlaveState} slave + * @param {string|object} surface * @returns {string} Slave's scar. Slave is the slave in question, but call the body part without modifiers. Rather than using "left breast" and "right breast" just use "breast". The function will then describe any scars on the breasts, if present, in natural language. */ App.Desc.scar = function(slave, surface) { "use strict"; let r = ``; const bellyAccessory = slave.bellyAccessory; - /* eslint-disable no-unused-vars*/ const { - he, him, his, hers, himself, boy, He, His + him, his, He, His } = getPronouns(slave); - /* eslint-enable */ if (V.showBodyMods === 1) { if (surface === "extra") { // Make a sentence that describes all body parts that aren't explicitly described elsewhere in longSlave. If you scar a slave on her thumb, for instance. But why. let extraMarks = App.Desc.extraMarks(slave, "scar"); @@ -120,6 +119,7 @@ App.Desc.scar = function(slave, surface) { /** * @param {App.Entity.SlaveState} slave + * @param {string} surface * @returns {string} Slave's scar. Slave is the slave in question, but call the body part without modifiers. Rather than using "left breast" and "right breast" just use "breast". The function will then describe any scars on the breasts, if present, in natural language. */ App.Desc.expandScarString = function(slave, surface) { // scars can sometimes be an int. This function generates a reasonable description. It can later be expanded to apply to different body parts, or include features of the slave such as skin tone or weight @@ -201,50 +201,10 @@ App.Desc.expandScarString = function(slave, surface) { // scars can sometimes be break; case "surgical": if (surface === "left breast" || surface === "right breast") { - if (slave.boobsImplant > 0) { - r += "scars from "; - if (scar > 3) { - r += "horribly botched "; - } else if (scar > 2) { - r += "sloppily inserted "; - } else if (scar > 1) { - r += "carelessly inserted "; - } - r += "implants"; - } else { - r += "scars from "; - if (scar > 3) { - r += "horribly botched "; - } else if (scar > 2) { - r += "sloppily done "; - } else if (scar > 1) { - r += "carelessly done "; - } - r += "surgery to remove implants"; - } + implantScars(slave.boobsImplant === 0, scar); } else if (surface === "left buttock" || surface === "right buttock") { - if (slave.buttImplant > 0) { - r += "scars from "; - if (scar > 3) { - r += "horribly botched "; - } else if (scar > 2) { - r += "sloppily inserted "; - } else if (scar > 1) { - r += "carelessly inserted "; - } - r += "implants"; - } else { - r += "scars from "; - if (scar > 3) { - r += "horribly botched "; - } else if (scar > 2) { - r += "sloppily done "; - } else if (scar > 1) { - r += "carelessly done "; - } - r += "surgery to remove implants"; - } - } else if (surface === "belly" ) { + implantScars(slave.buttImplant === 0, scar); + } else if (surface === "belly") { r += "scars from "; if (scar > 1) { r += "a crazy network of scars, as though a hack had tried internal surgery"; @@ -286,4 +246,32 @@ App.Desc.expandScarString = function(slave, surface) { // scars can sometimes be } r = r.replace(/,(?=[^,]*$)/, ' and'); /* replace the last comma with the word "and" so we can use this in a sentence.*/ return r; + + /** + * @param {boolean} removed if true, scars come from removal, otherwise from implantation + * @param {number} scar + */ + function implantScars(removed, scar) { + if (removed) { + r += "scars from "; + if (scar > 3) { + r += "horribly botched "; + } else if (scar > 2) { + r += "sloppily done "; + } else if (scar > 1) { + r += "carelessly done "; + } + r += "surgery to remove implants"; + } else { + r += "scars from "; + if (scar > 3) { + r += "horribly botched "; + } else if (scar > 2) { + r += "sloppily inserted "; + } else if (scar > 1) { + r += "carelessly inserted "; + } + r += "implants"; + } + } }; diff --git a/src/npc/descriptions/describeTattoos.js b/src/npc/descriptions/describeTattoos.js index 52e9e03badd..3a12d0be288 100644 --- a/src/npc/descriptions/describeTattoos.js +++ b/src/npc/descriptions/describeTattoos.js @@ -1,15 +1,14 @@ /** * @param {App.Entity.SlaveState} slave + * @param {string} surface * @returns {string} Relevant slave tattoo, if present */ App.Desc.tattoo = function(slave, surface) { "use strict"; let r = []; - /* eslint-disable no-unused-vars*/ const { he, him, his, He, His, hers } = getPronouns(slave); - /* eslint-enable */ if (V.showBodyMods !== 1) { return; } diff --git a/src/npc/descriptions/descriptionWidgets.js b/src/npc/descriptions/descriptionWidgets.js index d435376f0c5..f0d06c042c4 100644 --- a/src/npc/descriptions/descriptionWidgets.js +++ b/src/npc/descriptions/descriptionWidgets.js @@ -3,7 +3,6 @@ * @returns {string} Slave's nails */ App.Desc.nails = function(slave) { - /* eslint-disable no-unused-vars*/ const {He, His, his} = getPronouns(slave); if (!hasAnyArms(slave)) { return `${He} has no hands, and thus, no nails.`; @@ -35,7 +34,6 @@ App.Desc.nails = function(slave) { * @returns {string} Slave's makeup */ App.Desc.makeup = function(slave) { - /* eslint-disable no-unused-vars*/ const {He, His, his} = getPronouns(slave); if (slave.makeup === 1) { return `${He}'s wearing minimal makeup.`; @@ -69,11 +67,9 @@ App.Desc.makeup = function(slave) { */ App.Desc.eyes = function(slave, {market, eventDescription} = {}) { let r = ``; - /* eslint-disable no-unused-vars*/ const { - he, him, his, hers, himself, boy, He, His + he, him, his, He, His } = getPronouns(slave); - /* eslint-enable */ if (getBestVision(slave) === 0) { if (!hasAnyEyes(slave)) { @@ -367,20 +363,12 @@ App.Desc.eyes = function(slave, {market, eventDescription} = {}) { App.Desc.ageAndHealth = function(slave) { "use strict"; const H = slave.health; + const { + he, him, his, He, boy, woman + } = getPronouns(slave); + let r = ``; - /* eslint-disable no-unused-vars*/ - let pronouns = getPronouns(slave); - let he = pronouns.pronoun; - let him = pronouns.object; - let his = pronouns.possessive; - let hers = pronouns.possessivePronoun; - let himself = pronouns.objectReflexive; - let boy = pronouns.noun; - let woman = pronouns.woman; - let He = capFirstChar(he); - let His = capFirstChar(his); let array; - /* eslint-enable */ let age; let birthday = ""; if (V.seeAge !== 0) { @@ -807,6 +795,7 @@ App.Desc.ageAndHealth = function(slave) { /** * @param {App.Entity.SlaveState} slave * @returns {string} Slave's mods. + * @param {string} surface */ App.Desc.mods = function(slave, surface) { if (V.showBodyMods !== 1) { @@ -830,11 +819,9 @@ App.Desc.mods = function(slave, surface) { App.Desc.limbs = function(slave) { "use strict"; let r = ``; - /* eslint-disable no-unused-vars*/ const { he, his, He } = getPronouns(slave); - /* eslint-enable */ /* TODO @Arkerthan description similar in style to the commented out one instead of this simple version. @@ -1016,7 +1003,7 @@ App.Desc.extraMarks = function(slave, markType) { let slaveMarks = Object.keys(slave[markType]); if (["brand", "scar"].includes(markType)) { for (const bodyPart of slaveMarks) { - if ([ + if (![ "left ear", "right ear", "left cheek", "right cheek", "lips", "neck", @@ -1038,8 +1025,6 @@ App.Desc.extraMarks = function(slave, markType) { "left ankle", "right ankle", "left foot", "right foot" ].includes(bodyPart)) { - continue; - } else { extras[bodyPart] = slave[markType][bodyPart]; } } @@ -1047,13 +1032,13 @@ App.Desc.extraMarks = function(slave, markType) { return extras; }; - /** * @param {App.Entity.SlaveState} slave * @returns {string} short description of the slaves limbs. */ App.Desc.shortLimbs = function(slave) { let r = ""; + function desc(id, limb) { switch (id) { case 0: @@ -1395,8 +1380,7 @@ App.Desc.mouthAccessory = function(slave) { App.Desc.geneticQuirkAssessment = function(slave) { const r = []; const { - // eslint-disable-next-line no-unused-vars - he, him, his, hers, himself, boy, He, His + he, him, his, He, His } = getPronouns(slave); if (V.geneticMappingUpgrade >= 1) { if (slave.geneticQuirks.albinism === 2) { diff --git a/src/npc/descriptions/dimensions.js b/src/npc/descriptions/dimensions.js index 36c9ceda7f1..96ed609faf9 100644 --- a/src/npc/descriptions/dimensions.js +++ b/src/npc/descriptions/dimensions.js @@ -30,7 +30,6 @@ App.Desc.dimensions = function(slave) { return r.join(" "); - function height() { const r = []; const averageHeight = Height.mean(slave); @@ -54,6 +53,7 @@ App.Desc.dimensions = function(slave) { } return r.join(" "); } + function weight() { const r = []; if (slave.weight > 190) { @@ -117,6 +117,7 @@ App.Desc.dimensions = function(slave) { } return r.join(" "); } + function FS() { const r = []; @@ -183,43 +184,14 @@ App.Desc.dimensions = function(slave) { } return r.join(" "); } + function travel() { const r = []; if (canWalk(slave)) { - if (slave.weight > (170 + (slave.muscles / 5)) && slave.physicalAge >= 18) { - r.push(`${He} is so fat that it is difficult for ${him} to move.`); - if (slave.muscles > 95) { - r.push(`However, ${he} is so powerfully built that ${he} can manage it with effort, though ${he} often has to stop for breaks.`); - } else if (slave.muscles > 30) { - r.push(`${He} can barely manage to get to ${his} feet unaided, and usually walks alongside objects to help relieve the weight.`); - } else if (slave.muscles > 5) { - r.push(`${He} requires assistance to get to ${his} feet, and tends to lean on things to help relieve the weight. Much furniture has met an early demise thanks to this habit.`); - } else { - r.push(`${He} cannot get to ${his} feet unaided, and tries to stay seated as much as ${he} can.`); - } - } else if (slave.weight > (110 + (slave.muscles / 20)) && slave.physicalAge <= 3) { - r.push(`${He} is so fat that it is difficult for ${him} to move.`); - if (slave.muscles > 95) { - r.push(`However, ${he} is so powerfully built that ${he} can manage it with effort, though ${he} often has to stop for breaks.`); - } else if (slave.muscles > 30) { - r.push(`${He} can barely manage to get to ${his} feet unaided, and usually walks alongside objects to help relieve the weight.`); - } else if (slave.muscles > 5) { - r.push(`${He} requires assistance to get to ${his} feet, and tends to lean on things to help relieve the weight. Much furniture has met an early demise thanks to this habit.`); - } else { - r.push(`${He} cannot get to ${his} feet unaided, and tries to stay seated as much as ${he} can.`); - } - } else if (slave.weight > (140 + (slave.muscles / 15)) && slave.physicalAge <= 12) { - r.push(`${He} is so fat that it is difficult for ${him} to move.`); - if (slave.muscles > 95) { - r.push(`However, ${he} is so powerfully built that ${he} can manage it with effort, though ${he} often has to stop for breaks.`); - } else if (slave.muscles > 30) { - r.push(`${He} can barely manage to get to ${his} feet unaided, and usually walks alongside objects to help relieve the weight.`); - } else if (slave.muscles > 5) { - r.push(`${He} requires assistance to get to ${his} feet, and tends to lean on things to help relieve the weight. Much furniture has met an early demise thanks to this habit.`); - } else { - r.push(`${He} cannot get to ${his} feet unaided, and tries to stay seated as much as ${he} can.`); - } - } else if (slave.weight > (165 + (slave.muscles / 10)) && slave.physicalAge < 18) { + if ((slave.weight > (170 + (slave.muscles / 5)) && slave.physicalAge >= 18) + || (slave.weight > (110 + (slave.muscles / 20)) && slave.physicalAge <= 3) + || (slave.weight > (140 + (slave.muscles / 15)) && slave.physicalAge <= 12) + || (slave.weight > (165 + (slave.muscles / 10)) && slave.physicalAge < 18)) { r.push(`${He} is so fat that it is difficult for ${him} to move.`); if (slave.muscles > 95) { r.push(`However, ${he} is so powerfully built that ${he} can manage it with effort, though ${he} often has to stop for breaks.`); @@ -234,6 +206,7 @@ App.Desc.dimensions = function(slave) { } return r.join(" "); } + function muscles() { const r = []; r.push(`${He} is`); diff --git a/src/npc/descriptions/eyes.js b/src/npc/descriptions/eyes.js index d2b8f17939f..f647f2297ed 100644 --- a/src/npc/descriptions/eyes.js +++ b/src/npc/descriptions/eyes.js @@ -52,9 +52,10 @@ App.Desc.eyeTypeToString = function(type) { * Use App.Desc.eyesColorLong for a complete eye description. * * @param {FC.HumanState} slave - * @param {string} [adj] - * @param {string} [eye] - * @param {string} [eyes] + * @param {string} [adj=""] + * @param {string} [eye="eye"] + * @param {string} [eyes="eyes"] + * @param {boolean} [a=true] * @returns {string} */ App.Desc.eyesColor = function(slave, adj = "", eye = "eye", eyes = "eyes", a = true) { diff --git a/src/npc/descriptions/face.js b/src/npc/descriptions/face.js index 154c90899fc..a1078e24ec0 100644 --- a/src/npc/descriptions/face.js +++ b/src/npc/descriptions/face.js @@ -100,7 +100,7 @@ App.Desc.face = function(slave) { if (slave.face < -95) { r.push(`a hideous, furred feline face with pronounced fangs and whiskers that's nothing short of terrifying.`); } else if (slave.face < -40) { - r.push (`an ugly, furred feline face, featuring idly-twitching whiskers and a misshapen button nose.`); + r.push(`an ugly, furred feline face, featuring idly-twitching whiskers and a misshapen button nose.`); } else if (slave.face < -10) { r.push(`an comely, furred feline face, somewhat unappealing in its strange catlike whiskers and nose.`); } else if (slave.face <= 10) { diff --git a/src/npc/descriptions/heightImplant.js b/src/npc/descriptions/heightImplant.js index 498c780ca9f..5ab221f576d 100644 --- a/src/npc/descriptions/heightImplant.js +++ b/src/npc/descriptions/heightImplant.js @@ -19,6 +19,8 @@ App.Desc.heightImplant = function(slave) { r.push(`are odd, as though they have been artificially shortened.`); } + return r.join(" "); + function limbs() { const r = []; r.push(`The proportions of ${his}`); @@ -41,5 +43,4 @@ App.Desc.heightImplant = function(slave) { } return r; } - return r.join(" "); }; diff --git a/src/npc/descriptions/longSlave.js b/src/npc/descriptions/longSlave.js index b51bbbbabe2..0e347eeb31a 100644 --- a/src/npc/descriptions/longSlave.js +++ b/src/npc/descriptions/longSlave.js @@ -178,7 +178,8 @@ App.Desc.longSlave = function(slave, {market = 0, eventDescription = false, pris r.push(App.Desc.ageAndHealth(slave)); $(p).append(r.join(" ")); - r = []; const clinicNameCaps = capFirstChar(V.clinicName); + r = []; + const clinicNameCaps = capFirstChar(V.clinicName); if (!market) { if (V.clinic !== 0 && V.clinicUpgradeScanner === 1) { if (slave.chem > 15) { diff --git a/src/npc/descriptions/mind.js b/src/npc/descriptions/mind.js index db3a4f6894f..a78e387981b 100644 --- a/src/npc/descriptions/mind.js +++ b/src/npc/descriptions/mind.js @@ -310,6 +310,7 @@ App.Desc.mind = function(slave, {market, eventDescription} = {}) { } return r.join(" "); } + function behavioralQuirks() { const r = []; switch (slave.behavioralQuirk) { @@ -704,6 +705,5 @@ App.Desc.mind = function(slave, {market, eventDescription} = {}) { return r.join(" "); } - return r.join(" "); }; diff --git a/src/npc/descriptions/skills.js b/src/npc/descriptions/skills.js index 95320e173df..edc6065f1df 100644 --- a/src/npc/descriptions/skills.js +++ b/src/npc/descriptions/skills.js @@ -8,7 +8,6 @@ App.Desc.skills = function(slave) { He, girl } = getPronouns(slave); - if (slave.fuckdoll > 0) { r.push(`${He} is`); if (slave.fuckdoll <= 10) { diff --git a/src/npc/descriptions/skin.js b/src/npc/descriptions/skin.js index 9c991237ac9..dfa040277bc 100644 --- a/src/npc/descriptions/skin.js +++ b/src/npc/descriptions/skin.js @@ -6,12 +6,12 @@ * @returns {string} */ App.Desc.skin = function(slave, {market, eventDescription} = {}) { + /** @type {Array<string>} */ let r = []; const { he, his, He, His } = getPronouns(slave); - const skin = (slave.race === "catgirl") ? "fur" : "skin"; if (slave.fuckdoll > 0) { @@ -33,27 +33,26 @@ App.Desc.skin = function(slave, {market, eventDescription} = {}) { r.push(`${He}'s originally <span class="tan">${slave.nationality};</span> ethnically, ${he}'s`); } r.push(`<span class="tan">${slave.race},</span> and ${his} ${skin} is`); - r = r.concat(freckles()); - r = r.concat(tanned()); - if (slave.race !== slave.origRace && !market) { - r.push(`${He} has received plastic surgery to appear ${slave.race}; ${he} is originally ${slave.origRace}.`); - } else if (slave.race !== slave.origRace && market) { - if (V.PC.skill.medicine >= 100) { - r.push(`Thanks to your medical experience, you can easily tell that ${he} was originally ${slave.origRace}, but surgically modified.`); - } else if (V.PC.skill.medicine >= 50) { - r.push(`Oddly enough, ${he} appears to have a number of ${slave.origRace} features.`); - } else if (V.PC.skill.slaving >= 50) { - r.push(`Thanks to your experience in buying and selling slaves, you can easily tell that ${he} is not naturally ${slave.race}.`); - } else if (jsRandom(0, 100) < V.PC.skill.medicine) { - r.push(`${His} features seem slightly off.`); - } - } + r.push(...freckles(), ...tanned(), ...changedRace()); } else if (V.seeRace === 1) { r.push(`Ethnically, ${he}'s <span class="tan">${slave.race},</span> and ${his} ${skin} is`); + r.push(...freckles(), ...tanned(), ...changedRace()); + } else { + r.push(`${His} ${skin} is`); r = r.concat(freckles()); r = r.concat(tanned()); + } + + return r.join(" "); + + /** + * @returns {Array<string>} + */ + function changedRace() { + /** @type {Array<string>} */ + const r = []; if (slave.race !== slave.origRace && !market) { - r.push(`${He} has received plastic surgery to appear ${slave.race}; ${he} is originally ${slave.origRace}`); + r.push(`${He} has received plastic surgery to appear ${slave.race}; ${he} is originally ${slave.origRace}.`); } else if (slave.race !== slave.origRace && market) { if (V.PC.skill.medicine >= 100) { r.push(`Thanks to your medical experience, you can easily tell that ${he} was originally ${slave.origRace}, but surgically modified.`); @@ -65,15 +64,14 @@ App.Desc.skin = function(slave, {market, eventDescription} = {}) { r.push(`${His} features seem slightly off.`); } } - } else { - r.push(`${His} ${skin} is`); - r = r.concat(freckles()); - r = r.concat(tanned()); + return r; } - return r.join(" "); - + /** + * @returns {Array<string>} + */ function freckles() { + /** @type {Array<string>} */ const r = []; if (slave.markings === "freckles" && slave.race === "catgirl") { r.push(`${slave.skin} and lightly spotted.`); @@ -99,7 +97,11 @@ App.Desc.skin = function(slave, {market, eventDescription} = {}) { return r; } + /** + * @returns {Array<string>} + */ function tanned() { + /** @type {Array<string>} */ const r = []; if (slave.skin === "sun tanned" || slave.skin === "spray tanned") { r.push(`${His} ${skin} has been`); diff --git a/src/npc/descriptions/waist.js b/src/npc/descriptions/waist.js index 37df44eb601..50fed8e48f8 100644 --- a/src/npc/descriptions/waist.js +++ b/src/npc/descriptions/waist.js @@ -3,17 +3,20 @@ * @returns {string} */ App.Desc.waist = function(slave) { + /** + * @type {Array<string>} + */ const r = []; - let frag; + const { + he, him, his, girl, He, His, woman + } = getPronouns(slave); + let belly; if (slave.belly >= 1500) { belly = bellyAdjective(slave); } - const { - he, him, his, girl, He, His, woman - } = getPronouns(slave); - r.push(`${He} has`); + r.push(`${He} has`); if (slave.waist > 95) { r.push(`a badly <span class="red">masculine waist</span> that ruins ${his}`); if (slave.weight > 30) { @@ -24,16 +27,7 @@ App.Desc.waist = function(slave) { r.push(`figure.`); } if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} thick waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 300000) { + if (slave.belly < 300000) { r.push(`${His} ${belly} belly is hidden by ${his} thick waist.`); } else if (slave.belly < 450000) { r.push(`${His} ${belly} belly can be seen around ${his} thick waist.`); @@ -55,6 +49,15 @@ App.Desc.waist = function(slave) { r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); } } + } else { + r.push(`${His} ${belly} belly grotesquely bulges around ${his} thick waist.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } + } } } } else if (slave.waist > 40) { @@ -67,16 +70,7 @@ App.Desc.waist = function(slave) { r.push(`mannish.`); } if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} chunky waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 150000) { + if (slave.belly < 150000) { r.push(`${His} ${belly} belly is hidden by ${his} chunky waist.`); } else if (slave.belly < 450000) { r.push(`${His} ${belly} belly can be seen around ${his} chunky waist.`); @@ -98,6 +92,15 @@ App.Desc.waist = function(slave) { r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); } } + } else { + r.push(`${His} ${belly} belly grotesquely bulges around ${his} chunky waist.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } + } } } } else if (slave.waist > 10) { @@ -114,46 +117,9 @@ App.Desc.waist = function(slave) { } else { r.push(`figure.`); } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 10000) { - r.push(`From behind, ${his} figure hides ${his} ${belly} belly.`); - } else if (slave.belly < 200000) { - r.push(`From behind, ${his} figure barely hides ${his} ${belly} belly.`); - } else if (slave.belly < 300000) { - r.push(`${His} ${belly} belly can be seen around ${his} waist.`); - } else if (slave.belly < 450000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - } else if (slave.belly < 600000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 750000) { - r.push(`${His} ${belly} belly lewdly bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } - } + r.push(...normalWaistBelly()); } else if (slave.waist >= -10) { - frag = `an average waist for a `; + let frag = `an average waist for a `; if (slave.physicalAge <= 25) { frag += `${girl}`; } else { @@ -166,44 +132,7 @@ App.Desc.waist = function(slave) { } frag += `.`; r.push(frag); - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 10000) { - r.push(`From behind, ${his} figure hides ${his} ${belly} belly.`); - } else if (slave.belly < 200000) { - r.push(`From behind, ${his} figure barely hides ${his} ${belly} belly.`); - } else if (slave.belly < 300000) { - r.push(`${His} ${belly} belly can be seen around ${his} waist.`); - } else if (slave.belly < 450000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - } else if (slave.belly < 600000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 750000) { - r.push(`${His} ${belly} belly lewdly bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } - } + r.push(...normalWaistBelly()); } else if (slave.waist >= -40) { r.push(`a nice <span class="pink">feminine waist</span> that gives ${him} a`); if (slave.physicalAge <= 25) { @@ -218,44 +147,7 @@ App.Desc.waist = function(slave) { } else { r.push(`figure.`); } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 10000) { - r.push(`From behind, ${his} figure hides ${his} ${belly} belly.`); - } else if (slave.belly < 100000) { - r.push(`From behind, ${his} figure barely hides ${his} ${belly} belly.`); - } else if (slave.belly < 300000) { - r.push(`${His} ${belly} belly can be seen around ${his} waist.`); - } else if (slave.belly < 450000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - } else if (slave.belly < 600000) { - r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 750000) { - r.push(`${His} ${belly} belly lewdly bulges around ${his} waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } - } + r.push(...normalWaistBelly()); } else if (slave.waist >= -95) { r.push(`a hot <span class="pink">wasp waist</span> that gives ${him} an hourglass`); if (slave.weight > 30) { @@ -266,27 +158,7 @@ App.Desc.waist = function(slave) { r.push(`figure.`); } if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} narrow waist and continues`); - if (slave.belly >= 1000000) { - r.push(`quite the distance`); - } else { - r.push(`over half a`); - if (V.showInches === 2) { - r.push(`yard`); - } else { - r.push(`meter`); - } - } - r.push(`farther to either side.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 5000) { + if (slave.belly < 5000) { r.push(`From behind, ${his} narrow figure hides ${his} ${belly} belly.`); } else if (slave.belly < 80000) { r.push(`From behind, ${his} narrow figure barely hides ${his} ${belly} belly.`); @@ -294,30 +166,8 @@ App.Desc.waist = function(slave) { r.push(`${His} ${belly} belly can be seen around ${his} narrow waist.`); } else if (slave.belly < 450000) { r.push(`${His} ${belly} belly lewdly extends past ${his} narrow waist.`); - } else if (slave.belly < 600000) { - r.push(`${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 750000) { - r.push(`${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a`); - if (V.showInches === 2) { - r.push(`yard`); - } else { - r.push(`meter`); - } - r.push(`in both directions.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } + } else { + r.push(...narrowWaistLargeBelly()); } } } else { @@ -330,27 +180,7 @@ App.Desc.waist = function(slave) { r.push(`figure.`); } if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r.push(`${His} ${belly} belly grotesquely bulges around ${his} narrow waist and continues`); - if (slave.belly >= 1000000) { - r.push(`quite the distance`); - } else { - r.push(`over half a`); - if (V.showInches === 2) { - r.push(`yard`); - } else { - r.push(`meter`); - } - } - r.push(`farther to either side.`); - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); - } else { - r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); - } - } - } else if (slave.belly < 2000) { + if (slave.belly < 2000) { r.push(`From behind, ${his} narrow figure hides ${his} ${belly} belly.`); } else if (slave.belly < 5000) { r.push(`From behind, ${his} narrow figure barely hides ${his} ${belly} belly.`); @@ -360,8 +190,30 @@ App.Desc.waist = function(slave) { r.push(`${His} ${belly} belly lewdly extends past ${his} narrow waist.`); } else if (slave.belly < 45000) { r.push(`${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist.`); + } else { + r.push(...narrowWaistLargeBelly()); + } + } + } + return r.join(" "); + + /** + * @returns {Array<string>} + */ + function normalWaistBelly() { + /** @type {Array<string>} */ + const r = []; + if (slave.belly >= 1500) { + if (slave.belly < 10000) { + r.push(`From behind, ${his} figure hides ${his} ${belly} belly.`); + } else if (slave.belly < 200000) { + r.push(`From behind, ${his} figure barely hides ${his} ${belly} belly.`); + } else if (slave.belly < 300000) { + r.push(`${His} ${belly} belly can be seen around ${his} waist.`); + } else if (slave.belly < 450000) { + r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); } else if (slave.belly < 600000) { - r.push(`${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist.`); + r.push(`${His} ${belly} belly can clearly be seen around ${his} waist.`); if (slave.preg > 3) { if (slave.belly > (slave.pregAdaptation * 1000)) { r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); @@ -370,22 +222,79 @@ App.Desc.waist = function(slave) { } } } else if (slave.belly < 750000) { - r.push(`${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a`); - if (V.showInches === 2) { - r.push(`yard`); - } else { - r.push(`meter`); + r.push(`${His} ${belly} belly lewdly bulges around ${his} waist.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } } - r.push(`in both directions.`); + } else { + r.push(`${His} ${belly} belly grotesquely bulges around ${his} waist.`); if (slave.preg > 3) { if (slave.belly > (slave.pregAdaptation * 1000)) { - r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind.`); + r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); } else { r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); } } } } + return r; + } + + /** + * @returns {Array<string>} + */ + function narrowWaistLargeBelly() { + /** @type {Array<string>} */ + const r = []; + if (slave.belly < 600000) { + r.push(`${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } + } + } else if (slave.belly < 750000) { + r.push(`${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a`); + if (V.showInches === 2) { + r.push(`yard`); + } else { + r.push(`meter`); + } + r.push(`in both directions.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } + } + } else { + r.push(`${His} ${belly} belly grotesquely bulges around ${his} narrow waist and continues`); + if (slave.belly >= 1000000) { + r.push(`quite the distance`); + } else { + r.push(`over half a`); + if (V.showInches === 2) { + r.push(`yard`); + } else { + r.push(`meter`); + } + } + r.push(`farther to either side.`); + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r.push(`${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind.`); + } else { + r.push(`However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline.`); + } + } + } + return r; } - return r.join(" "); }; -- GitLab