From 7f4d592cf185e6c155291ce2de98a89a378768c3 Mon Sep 17 00:00:00 2001 From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io> Date: Tue, 10 May 2022 00:17:41 +0000 Subject: [PATCH] minorCleanup - Closes #3967 --- devTools/types/FC/facilities.d.ts | 2 - src/004-base/facilityFramework.js | 4 +- src/facilities/dairy/dairy.js | 93 ++++++++----------------------- src/js/utilsSlave.js | 2 +- 4 files changed, 27 insertions(+), 74 deletions(-) diff --git a/devTools/types/FC/facilities.d.ts b/devTools/types/FC/facilities.d.ts index a530277fb63..e57b89ab250 100644 --- a/devTools/types/FC/facilities.d.ts +++ b/devTools/types/FC/facilities.d.ts @@ -70,8 +70,6 @@ declare namespace FC { content: string|HTMLElement|DocumentFragment; /** The name of the dialog to display. */ name?: string; - /** Any prerequisites that must be met for the dialog to be displayed. */ - prereqs?: Array<() => boolean> }; }> /** Any additional nodes to attach. */ diff --git a/src/004-base/facilityFramework.js b/src/004-base/facilityFramework.js index 7a61d9e83b9..d21ac18d5d2 100644 --- a/src/004-base/facilityFramework.js +++ b/src/004-base/facilityFramework.js @@ -225,7 +225,6 @@ App.Facilities.Facility = class Facility { /** * Allows rules to be set up in the facility. - * * @private * @returns {HTMLDivElement} */ @@ -244,7 +243,8 @@ App.Facilities.Facility = class Facility { if (!o.prereqs || o.prereqs.every(prereq => prereq())) { option.addValue(o.link, o.value); - const dialogHandler = o.dialog ? function() { + const dialogContent = o.dialog ? o.dialog.content : null; + const dialogHandler = dialogContent ? function() { if (Dialog.isOpen()) { Dialog.close(); } diff --git a/src/facilities/dairy/dairy.js b/src/facilities/dairy/dairy.js index ffbeccf79a5..2b809810a59 100644 --- a/src/facilities/dairy/dairy.js +++ b/src/facilities/dairy/dairy.js @@ -45,13 +45,7 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { get intro() { const text = []; - if (V.dairyRestraintsSetting > 1) { - text.push(`${this.facility.nameCaps} is an industrial facility, but there's a viewing gallery for visitors.`); - } else { - text.push(this.facility.nameCaps); - } - text.push(this.decorations); - + text.push(`${this.facility.nameCaps} ${V.dairyRestraintsSetting > 1 ? `is an industrial facility, but there's a viewing gallery for visitors.` : ``} ${this.decorations}`); if (this.facility.hostedSlaves > 2) { text.push(`${this.facility.nameCaps} is working steadily.`); @@ -73,10 +67,10 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } } if (V.dairyPregUpgrade === 1 && V.dairyPregSetting > 0) { - if (V.dairyPregSetting === 3) { - text.push(`Fertile cows' vaginas are constantly penetrated by huge dildos that ejaculate extra strong fertility drugs into their progressively distending wombs. The drugs induce intense arousal and excessive female lubrication, so the constant dildo rape fills ${this.facility.name} with occasional gushing noises and nonstop moaning.`); - } else if (V.dairyPregSetting === 2) { - text.push(`Fertile cows' vaginas are constantly penetrated by huge dildos that ejaculate fertility drugs. The drugs produce excessive female lubrication, so the constant dildo rape fills ${this.facility.name} with occasional gushing noises.`); + const DrugPlus = V.dairyPregSetting === 3; + if (V.dairyPregSetting >= 2) { + text.push(`Fertile cows' vaginas are constantly penetrated by huge dildos that ejaculate ${DrugPlus ? 'extra strong' : ''} fertility drugs${DrugPlus ? ' into their progressively distending wombs' : ''}.`); + text.push(`The drugs ${DrugPlus ? 'induce intense arousal and' : 'produce'} excessive female lubrication, so the constant dildo rape fills ${this.facility.name} with occasional gushing noises${DrugPlus ? ' and nonstop moaning' : ''}.`); } else { text.push(`The fertile cows are visibly pregnant.`); } @@ -184,11 +178,9 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } const res = FS[V.dairyDecoration]; - if (!res) { throw new Error(`Unknown V.dairyDecoration value of '${V.dairyDecoration}' found in decorations().`); } - return res; } @@ -719,24 +711,20 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { /** @returns {HTMLDivElement} */ get warning() { const div = document.createElement("div"); - if (V.dairyPregSetting > 1 || V.dairyFeedersSetting > 1 || V.dairyStimulatorsSetting > 1) { App.Events.addNode(div, [ `<span class="warning">Current milking machine settings will have dramatic and possibly irreversible effects on cow bodies and minds.</span>` ]); } - return div; } /** * Returns the dialog text to display when setting a rule. - * * @param {'feeders'|'stimulators'|'preg'|'restraints'} setting */ _getEffect(setting) { const text = []; - const {He: HeU, he: heU, him: himU, his: hisU, himself: himselfU} = getNonlocalPronouns(V.seeDicks); if (this.facility.hostedSlaves > 1) { @@ -749,33 +737,23 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } else if (setting === "preg") { if (V.dairyPregSetting < 2) { for (const slave of this.facility.employees()) { - const {him, his} = getPronouns(slave); - + const {He, him, his} = getPronouns(slave); if (slave.vagina.isBetween(-1, 3)) { - text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it cannot fit the mandated dildo into ${his} tight cunt.`); - + text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it cannot fit the mandated dildo into ${his} tight cunt. <span class="yellow">${He} has been kicked out of ${this.facility.name}.</span>`); removeJob(slave, Job.DAIRY); } if (V.dairyPregSetting > 0) { WombCleanGenericReserve(slave, "incubator", 9999); WombCleanGenericReserve(slave, "nursery", 9999); - if (slave.broodmother > 0 || slave.bellyImplant !== -1) { - text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it detected a foreign body in ${his} womb blocking its required functions.`); - + text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it detected a foreign body in ${his} womb blocking its required functions. <span class="yellow">${He} has been kicked out of ${this.facility.name}.</span>`); removeJob(slave, Job.DAIRY); } } } text.push(`In unison, the milking machines withdraw their dildos from the pregnant slaves' vaginas. The auxiliary drug injectors hiss as the slaves are filled with drugs that promote natural lubrication. The slaves begin to shift awkwardly as they feel their pussies begin to drool slick female fluids. Once a machine judges that its slave's cunt is sufficiently wet, it readies a gigantic dildo. The slaves cannot see their own groins, but as soon as the heads of the dildos touch their pussylips, they begin to`); - - if (V.dairyFeedersSetting < 2) { - text.push(`struggle instinctively against their restraints, and the more energetic ones begin to weep.`); - } else { - text.push(`struggle instinctively against their restraints.`); - } - + text.push(`struggle instinctively against their restraints${V.dairyFeedersSetting < 2 ? ', and the more energetic ones begin to weep': ''}.`); text.push(`As the massive phalli begin to ejaculate fertility drugs and semen, they drive all resistance out of the poor girls.`); } else { text.push(`In unison, the milking machines withdraw their monstrous dildos from the pregnant slaves' stretched cunts. Their pussies' overcharged production of natural lubricant produces a gush of pent-up female fluids from each loose vagina as the phalli slide clear.`); @@ -785,29 +763,18 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } else { text.push(`The slaves are silent, since their mouths and throats are being fucked by the feeders, but most of them relax a little in their restraints.`); } - text.push(`The machines do replace the withdrawn dildos with more reasonably sized phalli and resume thrusting, but the slaves are relieved anyway.`); } } else if (setting === "stimulators") { if (V.dairyStimulatorsSetting < 2) { - for (const slave of this.facility.employees()) { - const {him, his} = getPronouns(slave); - - if (slave.vagina.isBetween(-1, 3)) { - text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it cannot fit its massive anal dildo up ${his} tight asshole.`); - - removeJob(slave, Job.DAIRY); - } + for (const slave of this.facility.employees().filter(s => s.vagina.isBetween(-1, 3))) { + const {He, him, his} = getPronouns(slave); + text.push(`${slave.slaveName}'s milking machine ejects ${him}, since it cannot fit its massive anal dildo up ${his} tight asshole. <span class="yellow">${He} has been kicked out of ${this.facility.name}.</span>`); + removeJob(slave, Job.DAIRY); } text.push(`In unison, the milking machines shove their dildos deep into slaves' anuses, ejaculating large quantities of lubricant deep inside their rectums. The slaves start in surprise at the sudden rush of warm slick fluid, and then relax as the phalli withdraw themselves from their butts. Their relief is short-lived, however, as their assholes are only empty for a moment. The reasonably sized dildos are replaced with dildos the size of horse cocks. As soon as the slaves feel the heads of these monstrous phalli press inexorably against their sphincters,`); - - if (V.dairyStimulatorsSetting < 2) { - text.push(`they begin to scream and struggle instinctively. As the constant assrape that will define their existences for the foreseeable future begins in earnest, their whining`); - } else { - text.push(`they begin to struggle wildly. As the constant assrape that will define their existences for the foreseeable future begins in earnest, their wriggling`); - } - + text.push(`they begin to ${V.dairyStimulatorsSetting < 2 ? 'scream and struggle instinctively' : 'struggle wildly'}. As the constant assrape that will define their existences for the foreseeable future begins in earnest, their ${V.dairyStimulatorsSetting < 2 ? 'whining' : 'wriggling'}`); text.push(`gradually diminishes as each slave is exhausted and slumps within their restraints. The machines take no notice, and continue the relentless sodomy.`); } else { text.push(`In unison, the milking machines withdraw their gargantuan dildos from the slaves' loosened anuses.`); @@ -817,20 +784,15 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } else { text.push(`The slaves are silent, since their mouths and throats are being fucked by the feeders, but most of them slump against their machines with relief`); } - text.push(`as their sphincters gradually recover from wide open to merely gaping. The machines switch out the withdrawn dildos for phalli that are just large, but the slaves barely react at all as they are penetrated. After what their sphincters have been through, a merely big dick is nothing to them.`); } } else if (setting === "restraints") { if (V.dairyRestraintsSetting < 2) { if (V.dairyRestraintsSetting === 1) { - for (const slave of this.facility.employees()) { - if (slave.indentureRestrictions > 1) { - const {he, him} = getPronouns(slave); - - text.push(`${slave.slaveName}'s milking machine declines to restrain ${him}, since ${he} is encoded as an indentured servant protected from restraint for milking.`); - - removeJob(slave, Job.DAIRY); - } + for (const slave of this.facility.employees().filter(s => s.indentureRestrictions > 1)) { + const {He, he, him} = getPronouns(slave); + text.push(`${slave.slaveName}'s milking machine declines to restrain ${him}, since ${he} is encoded as an indentured servant protected from restraint for milking. <span class="yellow">${He} has been kicked out of ${this.facility.name}.</span>`); + removeJob(slave, Job.DAIRY); } text.push(`The next cow to stumble over to a milking machine to be drained is gently but firmly embraced by its restraints, allowing it to suck ${himU} dry and violate ${himU} without any regard for ${hisU} feelings. Most of the cows accept this new wrinkle in their lives, since the restraints let them go afterward, and the milking machines bring temporary relief. Some, however, begin to regard the machines with concern.`); @@ -839,25 +801,18 @@ App.Facilities.Dairy.dairy = class Dairy extends App.Facilities.Facility { } } else { if (V.dairyRestraintsSetting === 2) { - for (const slave of this.facility.employees()) { - const {he, him} = getPronouns(slave); - - if (slave.indentureRestrictions > 1) { - text.push(`${slave.slaveName}'s milking machine declines to restrain ${him}, since ${he} is encoded as an indentured servant protected from restraint for milking.`); - - removeJob(slave, Job.DAIRY); - } + for (const slave of this.facility.employees().filter(s => s.indentureRestrictions > 1)) { + const {He, he, him} = getPronouns(slave); + text.push(`${slave.slaveName}'s milking machine declines to restrain ${him}, since ${he} is encoded as an indentured servant protected from restraint for milking. <span class="yellow">${He} has been kicked out of ${this.facility.name}.</span>`); + removeJob(slave, Job.DAIRY); } - - text.push(`The next time a cow tries to get up after being milked, ${heU} finds to ${hisU} sudden terror that the machine will not let ${himU} go. It continues to add fluids to ${hisU} body, and remove them from ${hisU} nipples, ignoring ${hisU} mounting panic as ${heU} realizes that it's to be ${hisU} new partner and lover, on a level far more intimate than any possible human relationship. The other cows approach their machines with trepidation, but the mounting pressure in their udders forces them to embrace their immurement despite their terror.`); - if (S.Milkmaid) { const {his} = getPronouns(S.Milkmaid); - text.push(`${S.Milkmaid.slaveName} has been removed from ${his} position as Milkmaid, since an industrialized dairy automates ${his} duties.`); - removeJob(S.Milkmaid, Job.MILKMAID); } + + text.push(`The next time a cow tries to get up after being milked, ${heU} finds to ${hisU} sudden terror that the machine will not let ${himU} go. It continues to add fluids to ${hisU} body, and remove them from ${hisU} nipples, ignoring ${hisU} mounting panic as ${heU} realizes that it's to be ${hisU} new partner and lover, on a level far more intimate than any possible human relationship. The other cows approach their machines with trepidation, but the mounting pressure in their udders forces them to embrace their immurement despite their terror.`); } else { text.push(`The next time a cow finishes an intensive milking period, ${hisU} restraints loosen. ${HeU} does not move for a long time, as though ${heU} is unable to believe that ${heU} is, at least in an immediate and local sense, free. Finally, ${heU} prises ${himselfU} out of ${hisU} milking machine's embrace, thick strings of fluid leading from it to ${hisU} orifices as ${heU} pulls each one off of its corresponding port.`); } diff --git a/src/js/utilsSlave.js b/src/js/utilsSlave.js index 69e896443e9..1b13711a4f9 100644 --- a/src/js/utilsSlave.js +++ b/src/js/utilsSlave.js @@ -1348,7 +1348,7 @@ globalThis.pronounReplacer = function(slavetext) { /** * Describes a slaves pre-slavery career in a gender sensitive way. If career is "a dominatrix" but the slave is male and the pronoun system is on, returns "a dominator" * @param {App.Entity.SlaveState} slave - * @returns {FC.Zeroable<string>} + * @returns {string} */ globalThis.convertCareer = function(slave) { let job = slave.career; -- GitLab