diff --git a/src/endWeek/saNanny.js b/src/endWeek/saNanny.js index 2556a3145b9c50a8b2bcbc7633e30db6a7c0f949..af3d3bfffe984a0ba74f7795629c38e394519f67 100644 --- a/src/endWeek/saNanny.js +++ b/src/endWeek/saNanny.js @@ -8,62 +8,130 @@ window.saNanny = function saNanny(slave) { { // eslint-disable-next-line no-unused-vars he, him, his, hers, himself, boy, He, His - } = getPronouns(slave); - - let t = `works as a nanny. ${He} ${V.nurseryBabies ? `looks after the child${V.nurseryBabies > 0 ? `ren` : ``} in ${V.nurseryName}, ensuring their needs are met and that they are being raised as ${V.nurseryBabies === 1 ? `a good future slave` : `good future slaves`}. ` : `keeps ${V.nurseryName} neat and tidy for the children it will one day support`}. `; - - // TODO: - t += ` ${He} is `; - if (slave.trust < -20) { - t += `frightened of punishment and works very hard, <span class="yellowgreen">reducing the upkeep</span> of ${V.nurseryName}${V.nurseryBabies ? ` and the children within` : ``}.`; - } else if (slave.devotion <= 20) { - t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class="yellowgreen">reduces upkeep</span> of your slaves.`; - } else if (slave.devotion <= 50) { - t += `obedient, offering your other slaves ${his} services, and moderately <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; - } else if (slave.devotion <= 95) { - t += `devoted, happily giving your other slaves ${his} services, and <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; - } else { - t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; + } = getPronouns(slave), + child = V.nurseryBabies > 0 ? `ren` : ``; + + let t = `works as a nanny. ${He} ${V.nurseryBabies ? `looks after the ${child} in ${V.nurseryName}, ensuring their needs are met and that they are being raised as ${V.nurseryBabies === 1 ? `a good future slave` : `good future slaves`}. ` : `keeps ${V.nurseryName} neat and tidy for the children it will one day support`}. `; + + t += nannyEffort(slave); + t += nannyRelationship(slave); + t += nannyCareer(slave); + t += nannyEffort(slave); + t += nannyFetish(slave); + t += nannyEnergy(slave); + t += nannyVision(slave); + t += nannyVignettes(slave); + t += matronEffects(slave); + + return t; + + function nannyEffort(slave) { + let t = ''; + + t += ` ${He} is `; + if (slave.trust < -20) { + t += `frightened of punishment and works very hard, <span class="yellowgreen">reducing the upkeep</span> of ${V.nurseryName}${V.nurseryBabies ? ` and the children within` : ``}.`; + } else if (slave.devotion <= 20) { + t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class="yellowgreen">reduces upkeep</span> of your slaves.`; + } else if (slave.devotion <= 50) { + t += `obedient, offering your other slaves ${his} services, and moderately <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; + } else if (slave.devotion <= 95) { + t += `devoted, happily giving your other slaves ${his} services, and <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; + } else { + t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; + } + + return t; } - // TODO: - if (slave.relationship === -2) { - t += ` ${He} does ${his} best to perfect your domesticity due to ${his} emotional bond to you.`; - } else if (slave.relationship === -3 && slave.devotion > 50) { - t += ` ${He} does ${his} very best to be the perfect housewife, making ${him} an outstanding servant.`; + function nannyRelationship(slave) { + let t = ''; + + // TODO: + if (slave.relationship === -2) { + t += ` ${He} does ${his} best to look after the ${child} in ${his} care due to ${his} emotional bond to you.`; + } else if (slave.relationship === -3 && slave.devotion > 50) { + t += ` ${He} does ${his} very best to be the perfect caretaker, making ${him} an outstanding nanny.`; + } + + return t; + } + + function nannyCareer(slave) { + let t = ''; + + // TODO: + if (setup.servantCareers.includes(slave.career)) { + t += ` ${He} has experience with nannying from ${his} life before ${he} was a slave, making ${him} more effective.`; + } else if (slave.skill.servant >= V.masteredXP) { + t += ` ${He} has experience with nannying from working for you, making ${him} more effective.`; + } else { + slave.skill.servant += jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 15) + 8); + } + + return t; } - // TODO: - if (setup.servantCareers.includes(slave.career)) { - t += ` ${He} has experience with house keeping from ${his} life before ${he} was a slave, making ${him} more effective.`; - } else if (slave.skill.servant >= V.masteredXP) { - t += ` ${He} has experience with house keeping from working for you, making ${him} more effective.`; - } else { - slave.skill.servant += jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 15) + 8); + function nannyFetish(slave) { + let t = ''; + + // TODO: + if (slave.fetishStrength > 60) { + if (slave.fetish === "submissive" && slave.fetishKnown === 1) { + t += ` ${His} natural affinity for submission increases ${his} effectiveness.`; + } else if (slave.fetishKnown === 1 && slave.fetish === "dom") { + t += ` ${His} sexual appetite for domination reduces ${his} effectiveness.`; + } + } + + return t; } - // TODO: - if (slave.fetishStrength > 60) { - if (slave.fetish === "submissive" && slave.fetishKnown === 1) { - t += ` ${His} natural affinity for submission increases ${his} effectiveness.`; - } else if (slave.fetishKnown === 1 && slave.fetish === "dom") { - t += ` ${His} sexual appetite for domination reduces ${his} effectiveness.`; + function nannyEnergy(slave) { + let t = ''; + + // TODO: + if (slave.energy < 20) { + t += ` ${His} frigidity allows ${him} to ignore the intercourse all around ${him}, making ${him} very efficient.`; + } else if (slave.energy < 40) { + t += ` ${His} low sex drive keeps ${him} from becoming too distracted by the intercourse all around ${him}, making ${him} more efficient.`; } + + return t; } - // TODO: - if (slave.energy < 20) { - t += ` ${His} frigidity allows ${him} to ignore the intercourse all around ${him}, making ${him} very efficient.`; - } else if (slave.energy < 40) { - t += ` ${His} low sex drive keeps ${him} from becoming too distracted by the intercourse all around ${him}, making ${him} more efficient.`; + + function nannyVision(slave) { + let t = ''; + + // TODO: + if (!canSeePerfectly(slave)) { + t += ` ${His} bad vision makes ${him} a worse nanny.`; + } + + return t; } - // TODO: - if (!canSeePerfectly(slave)) { - t += ` ${His} bad vision makes ${him} a worse nanny.`; + + function nannyVignettes(slave) { + let t = ''; + + if (V.showVignettes === 1 && (slave.assignment === Job.NANNY)) { + const vignette = GetVignette(slave); + t += ` <u>This week</u> ${vignette.text} `; + + vignetteCash(slave); + vignetteDevotion(slave); + vignetteTrust(slave); + vignetteHealth(slave); + vignetteRep(slave); + } + + return t; } - if (V.showVignettes === 1 && (slave.assignment === Job.NANNY)) { + function vignetteCash(slave) { const vignette = GetVignette(slave); - t += ` <u>This week</u> ${vignette.text} `; + let t = ''; + if (vignette.type === "cash") { let modifier = FResult(slave); if (vignette.effect > 0) { @@ -74,7 +142,16 @@ window.saNanny = function saNanny(slave) { t += `an incident without lasting effect.`; } cashX(Math.trunc(modifier * vignette.effect), "houseServant", slave); - } else if (vignette.type === "devotion") { + } + + return t; + } + + function vignetteDevotion(slave) { + const vignette = GetVignette(slave); + let t = ''; + + if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { t += `<span class="hotpink">increasing ${his} devotion to you.</span>`; @@ -99,7 +176,16 @@ window.saNanny = function saNanny(slave) { t += `an incident without lasting effect.`; } slave.devotion += (1 * vignette.effect); - } else if (vignette.type === "trust") { + } + + return t; + } + + function vignetteTrust(slave) { + const vignette = GetVignette(slave); + let t = ''; + + if (vignette.type === "trust") { if (vignette.effect > 0) { if (slave.trust > 20) { t += `<span class="mediumaquamarine">increasing ${his} trust in you.</span>`; @@ -120,7 +206,16 @@ window.saNanny = function saNanny(slave) { t += `an incident without lasting effect.`; } slave.trust += (1 * vignette.effect); - } else if (vignette.type === "health") { + } + + return t; + } + + function vignetteHealth(slave) { + const vignette = GetVignette(slave); + let t = ''; + + if (vignette.type === "health") { if (vignette.effect > 0) { t += `<span class="green">improving ${his} health.</span>`; } else if (vignette.effect < 0) { @@ -129,7 +224,16 @@ window.saNanny = function saNanny(slave) { t += `an incident without lasting effect.`; } improveCondition(slave, 2 * vignette.effect); - } else { + } + + return t; + } + + function vignetteRep(slave) { + const vignette = GetVignette(slave); + let t = ''; + + if (vignette.type === "rep") { let modifier = FResult(slave); if (vignette.effect > 0) { t += `<span class="green">gaining you a bit of reputation.</span>`; @@ -140,30 +244,36 @@ window.saNanny = function saNanny(slave) { } repX((modifier * vignette.effect * 0.1), "vignette", slave); } + + return t; } - if (V.Matron) { - t += `While there, ${he} benefits from ${V.Matron.slaveName}'s `; - if (V.Matron.physicalAge < 21) { - t += `youthful energy`; - } else { - t += `care`; - } - if (V.Matron.skill.oral) { // TODO: keep this? replace with something else? - t += ` and talented tongue`; - } - t += `. `; - /* TODO: farmer is often not set and makes no sense here. What should this be? LCD. - if (slave.devotion < V.FarmerDevotionThreshold) { - slave.devotion += V.FarmerDevotionBonus; + function matronEffects(slave) { + let t = ''; + + if (V.Matron) { + t += `While there, ${he} benefits from ${V.Matron.slaveName}'s `; + if (V.Matron.physicalAge < 21) { + t += `youthful energy`; + } else { + t += `care`; } - if (slave.devotion < V.FarmerTrustThreshold) { - slave.trust += V.FarmerTrustBonus; + if (V.Matron.skill.oral) { // TODO: keep this? replace with something else? + t += ` and talented tongue`; } - if (slave.condition < 100) { - improveCondition(slave, V.FarmerHealthBonus); - }*/ - } + t += `. `; + /* TODO: farmer is often not set and makes no sense here. What should this be? LCD. + if (slave.devotion < V.FarmerDevotionThreshold) { + slave.devotion += V.FarmerDevotionBonus; + } + if (slave.devotion < V.FarmerTrustThreshold) { + slave.trust += V.FarmerTrustBonus; + } + if (slave.condition < 100) { + improveCondition(slave, V.FarmerHealthBonus); + }*/ + } - return t; + return t; + } }; diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 1bfb5db7c7ec796f6907809ca6fda73c1c006f09..cb4ef5362206841de0fc3536120a2ee2b2df9dab 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -18975,6 +18975,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { * Creates a full report of the Nursery * @returns {string} */ +// TODO: refactor this App.Facilities.Nursery.nurseryReport = function nurseryReport() { "use strict";