From 53ce81f0a69685a0f5ea3500f9bd9a0f98859345 Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Mon, 12 Oct 2020 09:02:20 -0400 Subject: [PATCH] Changed const and let to match project style --- js/utils.js | 5 +- src/Mods/SpecialForce/SpecialForce.js | 31 ++- src/endWeek/reports/childrenReport.js | 93 ++++---- src/endWeek/reports/nurseryReport.js | 43 ++-- src/endWeek/saNanny.js | 5 +- src/endWeek/saWorkTheFarm.js | 30 ++- src/endWeek/standardSlaveReport.js | 18 +- src/facilities/farmyard/farmyard.js | 200 ++++++++---------- .../farmyard/reports/farmyardReport.js | 43 ++-- .../farmyard/shows/farmShowsIncome.js | 11 +- .../farmyard/shows/saFarmyardShows.js | 15 +- .../nursery/scenes/fChildWidgets.js | 4 +- src/facilities/nursery/utils/nurseryUtils.js | 82 +++---- src/npc/children/longChildDescription.js | 195 +++++++---------- src/npc/infants/infantSummary.js | 36 ++-- src/npc/infants/longInfantDescription.js | 44 ++-- 16 files changed, 357 insertions(+), 498 deletions(-) diff --git a/js/utils.js b/js/utils.js index dfa2aea268b..bc02a03af45 100644 --- a/js/utils.js +++ b/js/utils.js @@ -408,9 +408,8 @@ function deepAssign(target, source) { * @returns {number} */ function median(arr = []) { - const - mid = Math.floor(arr.length / 2), - nums = [...arr].sort((a, b) => a - b); + const mid = Math.floor(arr.length / 2); + const nums = [...arr].sort((a, b) => a - b); return arr.length % 2 === 0 ? (nums[mid] + nums[mid - 1]) / 2 : diff --git a/src/Mods/SpecialForce/SpecialForce.js b/src/Mods/SpecialForce/SpecialForce.js index ecc36f9f447..7c563880587 100644 --- a/src/Mods/SpecialForce/SpecialForce.js +++ b/src/Mods/SpecialForce/SpecialForce.js @@ -1142,14 +1142,14 @@ App.SF.fsIntegration = (function() { })(); App.SF.AAR = function(endWeekCall = 1) { - const - S = V.SF.Squad, - size = App.SF.upgrades.total(); - let profit = 0, - upkeep = 0, - income = 0, - incomeAdd = 0, - r = ``; + const S = V.SF.Squad; + const size = App.SF.upgrades.total(); + + let profit = 0; + let upkeep = 0; + let income = 0; + let incomeAdd = 0; + let r = ``; if (V.SF.FS.Tension > 100 && endWeekCall > 0) { if (V.SF.FS.BadOutcome === undefined) { App.SF.fsIntegration.badOutcome(); @@ -1592,12 +1592,11 @@ App.SF.ColonelStatus = function() { }; App.SF.Interactions = function() { - "use strict"; - let choice = ``, - time = ``; - const - C = V.SF.Colonel, - capSF = capFirstChar(V.SF.Lower || "the special force"); + let choice = ``; + let time = ``; + + const C = V.SF.Colonel; + const capSF = capFirstChar(V.SF.Lower || "the special force"); if (V.SF.Gift > 0) { if (V.SF.Gift === 1) { choice += `${capSF} is turning over spare capital in tribute this week. `; @@ -1623,9 +1622,7 @@ App.SF.Interactions = function() { }; App.SF.UnitText = function(input) { - "use strict"; - const - S = V.SF.Squad; + const S = V.SF.Squad; // Sorted by case let appear = `is currently constructed in a haphazard fashion.`; let barracks = `Soldiers' cots are mixed in with weapons crates and ammunition.`; diff --git a/src/endWeek/reports/childrenReport.js b/src/endWeek/reports/childrenReport.js index e45f71b3eb6..a286acb3172 100644 --- a/src/endWeek/reports/childrenReport.js +++ b/src/endWeek/reports/childrenReport.js @@ -3,16 +3,15 @@ * @returns {DocumentFragment} */ App.Facilities.Nursery.childrenReport = function childrenReport() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - Matron = S.Matron, - nannies = App.Utils.sortedEmployees(App.Entity.facilities.nursery), - NL = App.Entity.facilities.nursery.employeesIDs().size, - CL = V.cribs.length, + const Matron = S.Matron; + const nannies = App.Utils.sortedEmployees(App.Entity.facilities.nursery); + const NL = App.Entity.facilities.nursery.employeesIDs().size; + const CL = V.cribs.length; - medianNannyIntelligence = NL ? findMedianNannyIntelligence() : null, - medianNannyIntelligenceImplant = NL ? findMedianNannyIntelligenceImplant() : null; + const medianNannyIntelligence = NL ? findMedianNannyIntelligence() : null; + const medianNannyIntelligenceImplant = NL ? findMedianNannyIntelligenceImplant() : null; for (const child of V.cribs) { const childDiv = App.UI.DOM.appendNewElement("div", frag, '', "child-section"); @@ -30,9 +29,8 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { } if (NL > 0) { - const - randomNanny = NL > 1 ? jsRandom(0, nannies.length - 1) : 0, - nanny = nannies[randomNanny]; + const randomNanny = NL > 1 ? jsRandom(0, nannies.length - 1) : 0; + const nanny = nannies[randomNanny]; if (nanny.fetish !== "none") { childDiv.append(nannyFetishEffects(child, nanny)); @@ -61,8 +59,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { // MARK: Matron Effects function matronFetishEffects(child) { - const - chance = jsRandom(1, 100); + const chance = jsRandom(1, 100); if ((chance > 90 && child.fetish === "none") || chance > 95) { child.fetish = Matron.fetish; @@ -73,10 +70,9 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { function matronEducationEffects(child) { // TODO: expand this - const - { he, him, his } = getPronouns(Matron), + const { he, him, his } = getPronouns(Matron); - theChildren = CL > 1 ? `the children` : `${child.slaveName}`; + const theChildren = CL > 1 ? `the children` : `${child.slaveName}`; if (Matron.intelligence + Matron.intelligenceImplant > 65) { child.intelligenceImplant += 3; @@ -91,9 +87,8 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { return `Though ${Matron.slaveName} has had little to no formal education, ${his} natural brilliance allows ${him} to teach ${theChildren} quite effectively, and so ${CL > 1 ? `they grow` : `${child.slaveName} grows`} a bit smarter. `; } else { - const - totalSpan = App.UI.DOM.makeElement("span", `${Matron.slaveName} isn't the brightest and not well educated, `), - damageSpan = App.UI.DOM.makeElement("span", `damaging the amount of real education ${theChildren} receive. `, "red"); + const totalSpan = App.UI.DOM.makeElement("span", `${Matron.slaveName} isn't the brightest and not well educated, `); + const damageSpan = App.UI.DOM.makeElement("span", `damaging the amount of real education ${theChildren} receive. `, "red"); child.intelligenceImplant--; @@ -113,9 +108,8 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { // MARK: Nanny Effects function nannyFetishEffects(child, slave) { - const - { he } = getPronouns(child), - chance = jsRandom(1, 100); + const { he } = getPronouns(child); + const chance = jsRandom(1, 100); if (chance > 85) { if (child.fetish === "none") { @@ -135,10 +129,9 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { function nannyEducationEffects(child) { // TODO: redo this entire section // TODO: expand this - const - firstNanny = nannies[0], - theNanniesAre = NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`, - theChildren = CL > 1 ? `the children` : child.slaveName; + const firstNanny = nannies[0]; + const theNanniesAre = NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`; + const theChildren = CL > 1 ? `the children` : child.slaveName; if (medianNannyIntelligence + medianNannyIntelligenceImplant > 65) { child.intelligenceImplant += 3; @@ -171,14 +164,12 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { function weightRulesEffects(child) { // TODO: redo this entire section // TODO: double check these classes, make sure they make sense - const - span = document.createElement("span"), - { he, He, His } = getPronouns(child); + const span = document.createElement("span"); + const {he, He, His} = getPronouns(child); if (V.nurseryWeight) { - const - firstNanny = NL > 0 ? nannies[0] : null, - caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName; + const firstNanny = NL > 0 ? nannies[0] : null; + const caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName; if (V.nurseryWeightSetting === 1) { const weightSpan = App.UI.DOM.makeElement("span", 'rapid weight gain.', ["health", "dec"]); @@ -234,10 +225,9 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { // TODO: rewrite these // FIXME: this entire section needs a rewrite - numbers and text don't line up at all if (V.nurseryMuscles) { - const - firstNanny = NL > 0 ? nannies[0] : null, - caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName, - { His, He, he } = getPronouns(child); + const firstNanny = NL > 0 ? nannies[0] : null; + const caretaker = Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName; + const { His, He, he } = getPronouns(child); const muscleSpan = App.UI.DOM.makeElement("div", 'rapid muscle development.', "improvement"); @@ -293,21 +283,19 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { cribsCopy.splice(V.cribs.findIndex(c => c.ID === child.ID)); for (const target of cribsCopy) { - const - becomeFriends = () => `${child.slaveName} and ${target.slaveName} have realized that they have more in common that they originally thought, and have become friends. `, - becomeRivals = () => `${child.slaveName} and ${target.slaveName} have more differences between them than they could put aside and have become rivals. `, - haveSameFetish = () => child.fetish === target.fetish && child.fetish !== "none", - haveSameBehavioralQuirk = () => child.behavioralQuirk && child.behavioralQuirk === target.behavioralQuirk && child.behavioralQuirk !== "none", - haveSameSexualQuirk = () => child.sexualQuirk && child.sexualQuirk === target.sexualQuirk && child.sexualQuirk !== "none", + const becomeFriends = () => `${child.slaveName} and ${target.slaveName} have realized that they have more in common that they originally thought, and have become friends. `; + const becomeRivals = () => `${child.slaveName} and ${target.slaveName} have more differences between them than they could put aside and have become rivals. `; + const haveSameFetish = () => child.fetish === target.fetish && child.fetish !== "none"; + const haveSameBehavioralQuirk = () => child.behavioralQuirk && child.behavioralQuirk === target.behavioralQuirk && child.behavioralQuirk !== "none"; + const haveSameSexualQuirk = () => child.sexualQuirk && child.sexualQuirk === target.sexualQuirk && child.sexualQuirk !== "none"; - div = document.createElement("div"), + const div = document.createElement("div"); - { his } = getPronouns(target), - chance = jsRandom(1, 100); + const { his } = getPronouns(target); + const chance = jsRandom(1, 100); - let - friend = 0, - rival = 0; + let friend = 0; + let rival = 0; if (target.actualAge >= 3) { if (haveSameFetish()) { @@ -509,12 +497,11 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { } function childGrowTime(child) { - const - nameSpan = App.UI.DOM.makeElement("span", child.slaveName, "pink"), - limeSpan = App.UI.DOM.makeElement("span", 'ready for release.', "lime"), - mainSpan = document.createElement("span"), + const nameSpan = App.UI.DOM.makeElement("span", child.slaveName, "pink"); + const limeSpan = App.UI.DOM.makeElement("span", 'ready for release.', "lime"); + const mainSpan = document.createElement("span"); - { He } = getPronouns(child); + const {He} = getPronouns(child); if (child.growTime > 0) { mainSpan.append(nameSpan, ` is growing steadily. ${He} will be ready for release in about ${years(child.growTime)}. `); diff --git a/src/endWeek/reports/nurseryReport.js b/src/endWeek/reports/nurseryReport.js index 9d9bfdb6df6..24c9a23faec 100644 --- a/src/endWeek/reports/nurseryReport.js +++ b/src/endWeek/reports/nurseryReport.js @@ -3,16 +3,13 @@ * @returns {DocumentFragment} */ App.Facilities.Nursery.nurseryReport = function nurseryReport() { - let - frag = document.createDocumentFragment(); + const frag = new DocumentFragment(); - const - slaves = App.Utils.sortedEmployees(App.Entity.facilities.nursery), - devBonus = (V.nurseryDecoration !== "standard") ? 1 : 0, - arcology = V.arcologies[0]; + const slaves = App.Utils.sortedEmployees(App.Entity.facilities.nursery); + const devBonus = (V.nurseryDecoration !== "standard") ? 1 : 0; + const arcology = V.arcologies[0]; - let - matronBonus = 0; + let matronBonus = 0; function matronChanges() { if (S.Matron) { @@ -47,11 +44,9 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { function matronText() { if (S.Matron) { - const - {He, he, His, his, him} = getPronouns(S.Matron); + const {He, he, His, his, him} = getPronouns(S.Matron); - let - r = []; + let r = []; r.push(`${SlaveFullName(S.Matron)} is serving as your Matron.`); @@ -116,18 +111,15 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { } } - const - matronEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + const matronEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); matronChanges(); $(matronEffects).append(matronText()); if (slaves) { - const - intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + const intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); - let - r = []; + let r = []; r.push(`${slaves.length > 1 ? `There are ${slaves.length} slaves` : `There is one slave`} working in ${V.nurseryName}.</strong>`); @@ -148,8 +140,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { App.Utils.setLocalPronouns(slave); // needed for "include"s if (V.showEWD !== 0) { - const - matronEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); + const matronEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); if (V.seeImages && V.seeReportImages) { App.UI.DOM.appendNewElement("div", matronEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); @@ -212,9 +203,8 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { App.Utils.setLocalPronouns(slave); // needed for "include"s if (V.showEWD) { - const - {He} = getPronouns(slave), - slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); + const {He} = getPronouns(slave); + const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); if (V.seeImages && V.seeReportImages) { App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); @@ -229,14 +219,13 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { $(slaveEntry).append(`is working out of ${V.nurseryName}.`); } - const - nannyContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent"); + const nannyContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent"); - $(nannyContent).append(`${He} ${App.SlaveAssignment.nanny(slave, matronBonus)}`); + $(nannyContent).append(`${He} ${App.SlaveAssignment.nanny(slave, matronBonus)}`); // FIXME: nanny() takes one argument $(slaveEntry).append(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { // silently discard return values - App.SlaveAssignment.nanny(slave, matronBonus); + App.SlaveAssignment.nanny(slave, matronBonus); // FIXME: nanny() takes one argument App.SlaveAssignment.standardSlaveReport(slave, true); } } diff --git a/src/endWeek/saNanny.js b/src/endWeek/saNanny.js index 6a532de345a..e2a6c8f7c62 100644 --- a/src/endWeek/saNanny.js +++ b/src/endWeek/saNanny.js @@ -5,9 +5,8 @@ // TODO: redo this App.SlaveAssignment.nanny = function(slave) { - const - {he, him, his, He, His} = getPronouns(slave), - child = `child${V.nurseryChildren > 0 ? `ren` : ``}`; + const {he, him, his, He, His} = getPronouns(slave); + const child = `child${V.nurseryChildren > 0 ? `ren` : ``}`; let t = `works as a nanny. ${He} ${V.nurseryChildren ? `looks after the ${child} in ${V.nurseryName}, ensuring their needs are met and that they are being raised as ${V.nurseryChildren === 1 ? diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index 0e23f8b83a9..541472568d9 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -7,17 +7,16 @@ App.SlaveAssignment.workTheFarm = function(slave) { let frag = document.createDocumentFragment(); - const - {he, him, his, He, His} = getPronouns(slave), - incomeStats = getSlaveStatisticData(slave, V.facility.farmyard), + const {he, him, his, He, His} = getPronouns(slave); + const incomeStats = getSlaveStatisticData(slave, V.facility.farmyard); - slaveApproves = () => sexualQuirks.includes(slave.sexualQuirk) || behavioralQuirks.includes(slave.behavioralQuirk) || fetishes.includes(slave.fetish), + const sexualQuirks = ["perverted", "unflinching"]; + const behavioralQuirks = ["sinful"]; + const fetishes = ["humiliation", "masochist"]; - sexualQuirks = ["perverted", "unflinching"], - behavioralQuirks = ["sinful"], - fetishes = ["humiliation", "masochist"], + const slaveApproves = () => sexualQuirks.includes(slave.sexualQuirk) || behavioralQuirks.includes(slave.behavioralQuirk) ||fetishes.includes(slave.fetish); - foodAmount = Math.trunc(App.Facilities.Farmyard.foodAmount(slave)); + const foodAmount = Math.trunc(App.Facilities.Farmyard.foodAmount(slave)); function fullReport(slave) { const report = App.UI.DOM.appendNewElement("div", frag); @@ -80,10 +79,9 @@ App.SlaveAssignment.workTheFarm = function(slave) { } function healthIllness(slave) { - let - r = [], - health = ``, - exhaustion = ``; + let r = []; + let health = ``; + let exhaustion = ``; if (slave.health.illness > 0 || slave.health.tired > 60) { if (slave.health.illness === 1) { @@ -210,8 +208,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { function slaveVignettes() { if (V.showVignettes) { - const - vignette = GetVignette(slave); + const vignette = GetVignette(slave); let r = []; @@ -242,9 +239,8 @@ App.SlaveAssignment.workTheFarm = function(slave) { } function vignetteCash(vignette) { - const - FResultNumber = FResult(slave), - cash = Math.trunc(FResultNumber * vignette.effect); + const FResultNumber = FResult(slave); + const cash = Math.trunc(FResultNumber * vignette.effect); incomeStats.income += cash; diff --git a/src/endWeek/standardSlaveReport.js b/src/endWeek/standardSlaveReport.js index c8aafd7521e..d8181b37cd5 100644 --- a/src/endWeek/standardSlaveReport.js +++ b/src/endWeek/standardSlaveReport.js @@ -5,19 +5,17 @@ * @returns {HTMLElement|null} */ App.SlaveAssignment.standardSlaveReport = function(slave, silent=false) { - const - clothes = App.SlaveAssignment.choosesOwnClothes(slave); + const clothes = App.SlaveAssignment.choosesOwnClothes(slave); tired(slave); - const - rules = App.UI.DOM.renderPassage("SA rules"), - diet = App.SlaveAssignment.diet(slave), - ltEffects = App.SlaveAssignment.longTermEffects(slave), - drugs = App.SlaveAssignment.drugs(slave), - relationships = App.SlaveAssignment.relationships(slave), - rivalries = App.SlaveAssignment.rivalries(slave), - devotion = App.SlaveAssignment.devotion(slave); + const rules = App.UI.DOM.renderPassage("SA rules"); + const diet = App.SlaveAssignment.diet(slave); + const ltEffects = App.SlaveAssignment.longTermEffects(slave); + const drugs = App.SlaveAssignment.drugs(slave); + const relationships = App.SlaveAssignment.relationships(slave); + const rivalries = App.SlaveAssignment.rivalries(slave); + const devotion = App.SlaveAssignment.devotion(slave); if (!silent) { const content = App.UI.DOM.makeElement("div", '', "indent"); diff --git a/src/facilities/farmyard/farmyard.js b/src/facilities/farmyard/farmyard.js index dc6bc10931f..9ea1dcb58fc 100644 --- a/src/facilities/farmyard/farmyard.js +++ b/src/facilities/farmyard/farmyard.js @@ -20,14 +20,13 @@ App.Facilities.Farmyard.farmyard = function() { App.UI.SlaveList.ScrollPosition.restore(); function intro() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - desc = App.UI.DOM.makeElement("div", '', "scene-intro"), - link = App.UI.DOM.makeElement("div", '', "indent"), + const desc = App.UI.DOM.makeElement("div", '', "scene-intro"); + const link = App.UI.DOM.makeElement("div", '', "indent"); - count = App.Entity.facilities.farmyard.totalEmployeesCount, - farmyardNameCaps = capFirstChar(V.farmyardName); + const count = App.Entity.facilities.farmyard.totalEmployeesCount; + const farmyardNameCaps = capFirstChar(V.farmyardName); desc.append(`${farmyardNameCaps} is an oasis of growth in the midst of the jungle of steel and concrete that is ${V.arcologies[0].name}. Animals are kept in pens, tended to by your slaves, while ${V.farmyardUpgrades.hydroponics ? `rows of hydroponics equipment` : `makeshift fields`} grow crops. `); @@ -172,13 +171,12 @@ App.Facilities.Farmyard.farmyard = function() { } function expand() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - desc = document.createElement("div"), - link = App.UI.DOM.makeElement("div", '', "indent"), - note = App.UI.DOM.makeElement("span", '', "note"), - cost = App.UI.DOM.makeElement("span", '', "yellowgreen"), + const desc = document.createElement("div"); + const link = App.UI.DOM.makeElement("div", '', "indent"); + const note = App.UI.DOM.makeElement("span", '', "note"); + const cost = App.UI.DOM.makeElement("span", '', "yellowgreen"); upgradeCost = Math.trunc(V.farmyard * 1000 * V.upgradeMultiplierArcology), farmhands = App.Entity.facilities.farmyard.totalEmployeesCount; @@ -216,15 +214,14 @@ App.Facilities.Farmyard.farmyard = function() { } function transferMenials() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(), - links = [], - linksDiv = App.UI.DOM.makeElement("div", '', "indent"), + const links = []; + const linksDiv = App.UI.DOM.makeElement("div", '', "indent"); - menials = V.menials, - farmMenials = V.farmMenials, - farmMenialsSpace = V.farmMenialsSpace; + const menials = V.menials; + const farmMenials = V.farmMenials; + const farmMenialsSpace = V.farmMenialsSpace; if (farmMenials) { frag.append(`Assigned to ${V.farmyardName} ${farmMenials === 1 ? `is` : `are`} ${farmMenials} menial ${farmMenials === 1 ? `slave` : `slaves`}, working to produce as much food for your arcology as they can. `); @@ -288,20 +285,19 @@ App.Facilities.Farmyard.farmyard = function() { } function buyMenials() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - links = [], - linksDiv = App.UI.DOM.makeElement("div", '', "indent"), + const links = []; + const linksDiv = App.UI.DOM.makeElement("div", '', "indent"); - menials = V.menials, - farmMenials = V.farmMenials, - farmMenialsSpace = V.farmMenialsSpace, - popCap = menialPopCap(), - bulkMax = popCap.value - menials - V.fuckdolls - V.menialBioreactors, + const menials = V.menials; + const farmMenials = V.farmMenials; + const farmMenialsSpace = V.farmMenialsSpace; + const popCap = menialPopCap(); + const bulkMax = popCap.value - menials - V.fuckdolls - V.menialBioreactors; - menialPrice = Math.trunc(menialSlaveCost()), - maxMenials = Math.trunc(Math.clamp(V.cash / menialPrice, 0, bulkMax)); + const menialPrice = Math.trunc(menialSlaveCost()); + const maxMenials = Math.trunc(Math.clamp(V.cash / menialPrice, 0, bulkMax)); if (farmMenialsSpace) { if (bulkMax > 0 || V.menials + V.fuckdolls + V.menialBioreactors === 0) { @@ -340,15 +336,14 @@ App.Facilities.Farmyard.farmyard = function() { } function houseMenials() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - desc = document.createElement("div"), - link = App.UI.DOM.makeElement("div", '', "indent"), - note = App.UI.DOM.makeElement("span", '', "note"), - cost = App.UI.DOM.makeElement("span", '', "yellowgreen"), + const desc = document.createElement("div"); + const link = App.UI.DOM.makeElement("div", '', "indent"); + const note = App.UI.DOM.makeElement("span", '', "note"); + const cost = App.UI.DOM.makeElement("span", '', "yellowgreen"); - unitCost = Math.trunc(1000 * V.upgradeMultiplierArcology); + const unitCost = Math.trunc(1000 * V.upgradeMultiplierArcology); cost.append(cashFormat(unitCost)); @@ -450,12 +445,11 @@ App.Facilities.Farmyard.farmyard = function() { * @param {string[]} disabled Variables to be set to 0 */ function makeRule(descText, boldText, linkText, enabled, disabled) { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - desc = document.createElement("div"), - bold = App.UI.DOM.makeElement("span", boldText, "bold"), - link = document.createElement("span"); + const desc = document.createElement("div"); + const bold = App.UI.DOM.makeElement("span", boldText, "bold"); + const link = document.createElement("span"); if (Array.isArray(descText)) { desc.append(`${descText[0]} `, bold, ` ${descText[1]}. `); @@ -489,14 +483,13 @@ App.Facilities.Farmyard.farmyard = function() { machineryCost = Math.trunc(50000 * V.upgradeMultiplierArcology); if (!farmyardUpgrades.pump) { - const - desc = document.createElement("div"), - upgrade = createUpgrade( - "Upgrade the water pump", - pumpCost, - 'slightly decreases upkeep costs', - "pump" - ); + const desc = document.createElement("div"); + const upgrade = createUpgrade( + "Upgrade the water pump", + pumpCost, + 'slightly decreases upkeep costs', + "pump" + ); desc.append(`${farmyardNameCaps} is currently using the basic water pump that it came with.`); @@ -578,11 +571,10 @@ App.Facilities.Farmyard.farmyard = function() { } function createUpgrade(linkText, price, effect, type) { - const - desc = document.createElement("div"), - link = App.UI.DOM.makeElement("div", '', "indent"), - note = App.UI.DOM.makeElement("span", '', "note"), - cost = App.UI.DOM.makeElement("span", '', "yellowgreen"); + const desc = document.createElement("div"); + const link = App.UI.DOM.makeElement("div", '', "indent"); + const note = App.UI.DOM.makeElement("span", '', "note"); + const cost = App.UI.DOM.makeElement("span", '', "yellowgreen"); cost.append(cashFormat(price)); @@ -607,32 +599,30 @@ App.Facilities.Farmyard.farmyard = function() { baseCost = Math.trunc(5000 * V.upgradeMultiplierArcology), upgradedCost = Math.trunc(10000 * V.upgradeMultiplierArcology); - let - farmyardKennels = V.farmyardKennels, - farmyardStables = V.farmyardStables, - farmyardCages = V.farmyardCages; + let farmyardKennels = V.farmyardKennels; + let farmyardStables = V.farmyardStables; + let farmyardCages = V.farmyardCages; // MARK: Kennels - const - CL = V.canines.length, + const CL = V.canines.length; - dogs = CL === 1 ? V.canines[0] : CL < 3 ? - `several different breeds of dogs` : - `all kinds of dogs`, - canines = CL === 1 ? V.canines[0].species === "dog" ? - V.canines[0].breed : V.canines[0].speciesPlural : CL < 3 ? - `several different ${V.canines.every( - c => c.species === "dog") ? - `breeds of dogs` : `species of canines`}` : - `all kinds of canines`, + const dogs = CL === 1 ? V.canines[0] : CL < 3 ? + `several different breeds of dogs` : + `all kinds of dogs`; + const canines = CL === 1 ? V.canines[0].species === "dog" ? + V.canines[0].breed : V.canines[0].speciesPlural : CL < 3 ? + `several different ${V.canines.every( + c => c.species === "dog") ? + `breeds of dogs` : `species of canines`}` : + `all kinds of canines`; - kennels = document.createElement("div"), - kennelsUpgrade = App.UI.DOM.makeElement("div", '', "indent"), - kennelsNote = App.UI.DOM.makeElement("span", '', "note"), - kennelsCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); + const kennels = document.createElement("div"); + const kennelsUpgrade = App.UI.DOM.makeElement("div", '', "indent"); + const kennelsNote = App.UI.DOM.makeElement("span", '', "note"); + const kennelsCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); if (farmyardKennels === 0) { kennels.append(App.UI.DOM.passageLink("Add kennels", "Farmyard", @@ -671,17 +661,16 @@ App.Facilities.Farmyard.farmyard = function() { // MARK: Stables - const - HL = V.hooved.length, + const HL = V.hooved.length; - hooved = HL === 1 ? V.hooved[0] : HL < 3 ? - `several different types of hooved animals` : - `all kinds of hooved animals`, + const hooved = HL === 1 ? V.hooved[0] : HL < 3 ? + `several different types of hooved animals` : + `all kinds of hooved animals`; - stables = document.createElement("div"), - stablesUpgrade = App.UI.DOM.makeElement("div", '', "indent"), - stablesNote = App.UI.DOM.makeElement("span", '', "note"), - stablesCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); + const stables = document.createElement("div"); + const stablesUpgrade = App.UI.DOM.makeElement("div", '', "indent"); + const stablesNote = App.UI.DOM.makeElement("span", '', "note"); + const stablesCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); if (farmyardStables === 0) { stables.append(App.UI.DOM.passageLink("Add stables", "Farmyard", @@ -720,23 +709,22 @@ App.Facilities.Farmyard.farmyard = function() { // MARK: Cages - const - FL = V.felines.length, + const FL = V.felines.length; - cats = FL === 1 ? V.felines[0] : FL < 3 ? - `several different breeds of cats` : - `all kinds of cats`, - felines = FL === 1 ? V.felines[0].species === "cat" ? - V.felines[0].breed : V.felines[0].speciesPlural : FL < 3 ? - `several different ${V.felines.every( - c => c.species === "cat") ? - `breeds of cats` : `species of felines`}` : - `all kinds of felines`, + const cats = FL === 1 ? V.felines[0] : FL < 3 ? + `several different breeds of cats` : + `all kinds of cats`; + const felines = FL === 1 ? V.felines[0].species === "cat" ? + V.felines[0].breed : V.felines[0].speciesPlural : FL < 3 ? + `several different ${V.felines.every( + c => c.species === "cat") ? + `breeds of cats` : `species of felines`}` : + `all kinds of felines`; - cages = document.createElement("div"), - cagesUpgrade = App.UI.DOM.makeElement("div", '', "indent"), - cagesNote = App.UI.DOM.makeElement("span", '', "note"), - cagesCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); + const cages = document.createElement("div"); + const cagesUpgrade = App.UI.DOM.makeElement("div", '', "indent"); + const cagesNote = App.UI.DOM.makeElement("span", '', "note"); + const cagesCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); if (farmyardCages === 0) { cages.append(App.UI.DOM.passageLink("Add cages", "Farmyard", @@ -775,12 +763,11 @@ App.Facilities.Farmyard.farmyard = function() { // MARK: Remove Housing - const - removeHousing = document.createElement("div"), - removeHousingNote = App.UI.DOM.makeElement("span", '', "note"), - removeHousingCost = App.UI.DOM.makeElement("span", '', "yellowgreen"), + const removeHousing = document.createElement("div"); + const removeHousingNote = App.UI.DOM.makeElement("span", '', "note"); + const removeHousingCost = App.UI.DOM.makeElement("span", '', "yellowgreen"); - removeHousingPrice = ((farmyardKennels + farmyardStables + farmyardCages) * 5000) * V.upgradeMultiplierArcology; + const removeHousingPrice = ((farmyardKennels + farmyardStables + farmyardCages) * 5000) * V.upgradeMultiplierArcology; if (farmyardKennels || farmyardStables || farmyardCages) { removeHousing.append(document.createElement("br")); @@ -814,11 +801,10 @@ App.Facilities.Farmyard.farmyard = function() { } function rename() { - const - frag = new DocumentFragment(), + const frag = new DocumentFragment(); - renameDiv = App.UI.DOM.makeElement("div", '', "farmyard-rename"), - renameNote = App.UI.DOM.makeElement("span", '', "note"); + const renameDiv = App.UI.DOM.makeElement("div", '', "farmyard-rename"); + const renameNote = App.UI.DOM.makeElement("span", '', "note"); renameDiv.append(`Rename ${V.farmyardName}: `); renameNote.append(` Use a noun or similar short phrase`); diff --git a/src/facilities/farmyard/reports/farmyardReport.js b/src/facilities/farmyard/reports/farmyardReport.js index 66becce59d7..ed82b5ab480 100644 --- a/src/facilities/farmyard/reports/farmyardReport.js +++ b/src/facilities/farmyard/reports/farmyardReport.js @@ -1,15 +1,13 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { - let frag = document.createDocumentFragment(); + let frag = new DocumentFragment(); - const - slaves = App.Utils.sortedEmployees(App.Entity.facilities.farmyard), - devBonus = (V.farmyardDecoration !== "standard") ? 1 : 0, - Farmer = S.Farmer; + const slaves = App.Utils.sortedEmployees(App.Entity.facilities.farmyard); + const devBonus = (V.farmyardDecoration !== "standard") ? 1 : 0; + const Farmer = S.Farmer; - let - profits = 0, - foodWeek = 0, - farmerBonus = 0; + let profits = 0; + let foodWeek = 0; + let farmerBonus = 0; @@ -124,8 +122,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } function farmerFetishEffects(slave, fetish = 0) { - const - {he, his, himself, He} = getPronouns(slave); + const {he, his, himself, He} = getPronouns(slave); if (fetish === 1) { return `${He} isn't above sampling the merchandise ${himself}; before long it's obvious to ${his} workers that ${he} <span class="lightcoral">really likes fucking them.</span> `; @@ -135,8 +132,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } function farmerSkill(slave) { - const - {he, his, His} = getPronouns(slave); + const {he, his, His} = getPronouns(slave); let r = []; @@ -216,9 +212,8 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { function farmerContracts(slave) { const {he, his, himself} = getPronouns(slave); - let - r = [], - seed = V.farmyardShowgirls ? App.Facilities.Farmyard.farmShowsIncome(slave) : jsRandom(1, 10) * (jsRandom(150, 170) + (farmerBonus * 10)); + let r = []; + let seed = V.farmyardShowgirls ? App.Facilities.Farmyard.farmShowsIncome(slave) : jsRandom(1, 10) * (jsRandom(150, 170) + (farmerBonus * 10)); if (V.farmyardShows && !V.farmyardShowgirls) { r.push(`<p class="indent">Since ${he} doesn't have enough showgirls to entertain your arcology's citizens, ${he} puts on shows with your animals on ${his} own, earning <span class="yellowgreen">${cashFormat(seed)}.</span></p>`); @@ -264,15 +259,13 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { const farmerIntro = slave => `<span class="indent">${SlaveFullName(slave)} is serving as the Farmer</span>.`; if (Farmer) { - const - farmerEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + const farmerEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); V.i = V.slaveIndices[Farmer.ID]; App.Utils.setLocalPronouns(Farmer); // needed for "include"s if (V.showEWD) { - const - farmerEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); + const farmerEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); if (V.seeImages && V.seeReportImages) { App.UI.DOM.appendNewElement("div", farmerEntry, App.Art.SlaveArtElement(Farmer, 0, 0), ["imageRef", "tinyImg"]); @@ -340,9 +333,8 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } function farmhandFood(slave) { - let - incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined), - foodWeek = incomeStats.food || 0; + let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined); + let foodWeek = incomeStats.food || 0; if (V.farmMenials > 0) { foodWeek += (V.farmMenials * 350); @@ -371,15 +363,14 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { r.push(farmhandCount(slaves.length)); for (const slave of slaves) { - V.i = V.slaveIndices[slave.ID]; + V.i = V.slaveIndices[slave.ID]; // FIXME: V.i is deprecated slave.devotion += devBonus; App.Utils.setLocalPronouns(slave); // needed for "include"s if (V.showEWD) { - const - slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); + const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); if (V.seeImages && V.seeReportImages) { App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); diff --git a/src/facilities/farmyard/shows/farmShowsIncome.js b/src/facilities/farmyard/shows/farmShowsIncome.js index f80c9654494..a9ec8eb55a2 100644 --- a/src/facilities/farmyard/shows/farmShowsIncome.js +++ b/src/facilities/farmyard/shows/farmShowsIncome.js @@ -3,13 +3,12 @@ * @returns {number} */ App.Facilities.Farmyard.farmShowsIncome = function(slave) { - const - arcology = V.arcologies[0], - heavyMods = SlaveStatsChecker.modScore(slave).total > 20, + const arcology = V.arcologies[0]; + const heavyMods = SlaveStatsChecker.modScore(slave).total > 20; - sexualQuirks = ["perverted", "unflinching"], - behavioralQuirks = ["sinful"], - fetishes = ["humiliation", "masochist"]; + const sexualQuirks = ["perverted", "unflinching"]; + const behavioralQuirks = ["sinful"]; + const fetishes = ["humiliation", "masochist"]; let cash = 7500; diff --git a/src/facilities/farmyard/shows/saFarmyardShows.js b/src/facilities/farmyard/shows/saFarmyardShows.js index ec00216ef08..89137bb1506 100644 --- a/src/facilities/farmyard/shows/saFarmyardShows.js +++ b/src/facilities/farmyard/shows/saFarmyardShows.js @@ -5,14 +5,13 @@ * @returns {string} */ App.Facilities.Farmyard.putOnShows = function(slave) { - const - {he, him, his, hers, He, His} = getPronouns(slave), - incomeStats = getSlaveStatisticData(slave, V.facility.farmyard), - arcology = V.arcologies[0], - _beautiful = beautiful(slave), - _pretty = pretty(slave), - - heavyMods = SlaveStatsChecker.modScore(slave).total > 20; + const {he, him, his, hers, He, His} = getPronouns(slave); + const incomeStats = getSlaveStatisticData(slave, V.facility.farmyard); + const arcology = V.arcologies[0]; + const _beautiful = beautiful(slave); + const _pretty = pretty(slave); + + const heavyMods = SlaveStatsChecker.modScore(slave).total > 20; let r = []; diff --git a/src/facilities/nursery/scenes/fChildWidgets.js b/src/facilities/nursery/scenes/fChildWidgets.js index 19d35a36c41..cec5f5d868c 100644 --- a/src/facilities/nursery/scenes/fChildWidgets.js +++ b/src/facilities/nursery/scenes/fChildWidgets.js @@ -35,9 +35,7 @@ App.Facilities.Nursery.fChildAnal = function fChildAnal(child) { }; App.Facilities.Nursery.fChildImpreg = function fChildImpreg(child) { - "use strict"; - const - bonus = jsRandom(6, 20); + const bonus = jsRandom(6, 20); let r = ``; diff --git a/src/facilities/nursery/utils/nurseryUtils.js b/src/facilities/nursery/utils/nurseryUtils.js index ad6acc9873a..639b97daf18 100644 --- a/src/facilities/nursery/utils/nurseryUtils.js +++ b/src/facilities/nursery/utils/nurseryUtils.js @@ -3,25 +3,21 @@ * @returns {DocumentFragment} */ App.Facilities.Nursery.childList = function childList() { - const - cribs = V.cribs; + const cribs = V.cribs; - let - frag = document.createDocumentFragment(), - r = []; + let frag = document.createDocumentFragment(); + let r = []; if (V.nurseryChildren) { App.UI.DOM.appendNewElement("h3", frag, `Children in ${V.nurseryName}`, "indent"); - const - list = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + const list = App.UI.DOM.appendNewElement("p", frag, '', "indent"); for (const child of cribs) { - const - weeksOwned = V.week - child.weekAcquired, - weeksLeft = (V.targetAgeNursery * 52) - weeksOwned, - {he, him, He} = getPronouns(child), - hr = document.createElement("hr"); + const weeksOwned = V.week - child.weekAcquired; + const weeksLeft = (V.targetAgeNursery * 52) - weeksOwned; + const {he, him, He} = getPronouns(child); + const hr = document.createElement("hr"); hr.style.margin = "0"; list.appendChild(hr); @@ -45,8 +41,7 @@ App.Facilities.Nursery.childList = function childList() { } if (child.growTime <= 0 || child.actualAge >= V.targetAgeNursery) { - const - targetText = child.targetLocation === "slavery" ? `"Introduce ${him} to life as a slave"` : `"Set ${him} free"`; + const targetText = child.targetLocation === "slavery" ? `"Introduce ${him} to life as a slave"` : `"Set ${him} free"`; list.appendChild(document.createElement("br")); @@ -372,10 +367,9 @@ App.Facilities.Nursery.infantToChild = function infantToChild(child) { * @returns {string} */ App.Facilities.Nursery.nameChild = function nameChild(child) { - const - PC = V.PC, - arcology = V.arcologies[0], - girl = child.genes === "XX" ? "girl" : "boy"; + const PC = V.PC; + const arcology = V.arcologies[0]; + const girl = child.genes === "XX" ? "girl" : "boy"; let r = ``; /** @type {App.Entity.SlaveState} */ @@ -412,12 +406,10 @@ App.Facilities.Nursery.nameChild = function nameChild(child) { } function parentNames(parent, child) { - const - slaves = V.slaves; + const slaves = V.slaves; - let - currentSlaveNames = slaves.map(s => s.slaveName), - continentNationality; + let currentSlaveNames = slaves.map(s => s.slaveName); + let continentNationality; child.slaveName = generateName(parent.nationality, parent.race, parent.genes === "XY", sn => !currentSlaveNames.includes(sn)); @@ -706,19 +698,16 @@ App.Facilities.Nursery.removeChild = function removeChild(index) { * @returns {string} */ App.Facilities.Nursery.nurserySort = function nurserySort() { - "use strict"; - const - PC = V.PC, - SL = V.slaves.length, - arcology = V.arcologies[0], - freeCribs = (V.nursery - V.cribs.length); - - let - r = ``, - eligibility = 0, - sortNurseryList = V.sortNurseryList || "Unsorted", - nurseryHasReservedChildren = false, - reservedChildrenNursery = FetusGlobalReserveCount("nursery"); + const PC = V.PC; + const SL = V.slaves.length; + const arcology = V.arcologies[0]; + const freeCribs = (V.nursery - V.cribs.length); + + let r = ``; + let eligibility = 0; + let sortNurseryList = V.sortNurseryList || "Unsorted"; + let nurseryHasReservedChildren = false; + let reservedChildrenNursery = FetusGlobalReserveCount("nursery"); r += `<br><i>Sorting:</i> <b><span id="ql-nursery-sort">${sortNurseryList}</span>.</b> `; r += `${App.UI.passageLink("Sort by Name", "Nursery", `${sortNurseryList = "Name"}, ${App.UI.replace(`#ql-nursery-sort`, sortNurseryList)}, ${byName()}`)} | `; @@ -737,13 +726,12 @@ App.Facilities.Nursery.nurserySort = function nurserySort() { if (slave.preg > 0 && !slave.broodmother && slave.pregKnown && slave.eggType === "human") { if (slave.assignment !== Job.DAIRY && V.dairyPregSetting <= 0) { - const - slaveID = "slave-" + slave.ID, - WL = slave.womb.length, - reservedNursery = WombReserveCount(slave, "nursery"), - reservedIncubator = WombReserveCount(slave, "incubator"), - pregWeek = slave.pregWeek, - slaveName = SlaveFullName(slave); + const slaveID = "slave-" + slave.ID; + const WL = slave.womb.length; + const reservedNursery = WombReserveCount(slave, "nursery"); + const reservedIncubator = WombReserveCount(slave, "incubator"); + const pregWeek = slave.pregWeek; + const slaveName = SlaveFullName(slave); r += `<div class="possible" @id="${slaveID}" @data-preg-count="${WL}" @data-reserved-spots="${reservedNursery}" @data-preg-week="${pregWeek}" @data-name="${slaveName}">`; @@ -855,12 +843,10 @@ App.Facilities.Nursery.nurserySort = function nurserySort() { } if (PC.pregKnown && (arcology.FSRestart === "unset" || V.eugenicsFullControl || (PC.pregSource !== -1 && PC.pregSource !== -6))) { - const - WL = PC.womb.length; + const WL = PC.womb.length; - let - reservedIncubator = WombReserveCount(PC, "incubator"), - reservedNursery = WombReserveCount(PC, "nursery"); + let reservedIncubator = WombReserveCount(PC, "incubator"); + let reservedNursery = WombReserveCount(PC, "nursery"); r += `<br><b><span class="pink">You're pregnant</span></b> and going to have ${WL === 1 ? `a baby. ` : pregNumberName(WL, 1)} `; diff --git a/src/npc/children/longChildDescription.js b/src/npc/children/longChildDescription.js index 8d36bdda9a6..eb7ca4c6210 100644 --- a/src/npc/children/longChildDescription.js +++ b/src/npc/children/longChildDescription.js @@ -4,28 +4,23 @@ * @returns {string} */ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, eventDescription = 0} = {}) { - // declarations - const - arcology = V.arcologies[0], - PC = V.PC, - slaves = V.slaves, - desc = child.actualAge < 13 ? `child` : `teen`, // TODO: - father = child.father === -1 ? PC : getSlave(child.father), - mother = child.mother === -1 ? PC : getSlave(child.mother); - - let - r = ``; - - const { - he, him, his, hers, himself, boy, He, His, girl - } = getPronouns(child); + // MARK: Declarations + const arcology = V.arcologies[0]; + const PC = V.PC; + const slaves = V.slaves; + const desc = child.actualAge < 13 ? `child` : `teen`; // TODO: + const father = child.father === -1 ? PC : getSlave(child.father); + const mother = child.mother === -1 ? PC : getSlave(child.mother); + + let r = ``; + + const {he, him, his, hers, himself, boy, He, His, girl} = getPronouns(child); // helper functions function accent(child) { - let - r = ``, - accent, - nationality; + let r = ``; + let accent; + let nationality; switch (child.nationality) { case "a Cook Islander": @@ -62,8 +57,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event function accessories() { function buttplug(child) { - let - r = ``; + let r = ``; if (V.showClothing && !market) { switch (child.clothes) { @@ -262,8 +256,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event accessories.buttplug = buttplug; function dick(child) { - let - r = ``; + let r = ``; if (child.chastityPenis) { r += `${His} cock is encased in a tight chastity cage, which is designed to be comfortable as long as ${he} remains soft. `; @@ -281,9 +274,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event accessories.dick = dick; function vaginal(child) { - let - r = ``, - held; + let r = ``; + let held; if (child.chastityVagina) { held = `held in place by a chastity belt`; @@ -358,12 +350,11 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function anus(child) { - let - r = ``, - skinDesc, - analSkinDesc, - ass, - anus = child.analArea - child.anus; + let r = ``; + let skinDesc; + let analSkinDesc; + let ass; + let anus = child.analArea - child.anus; if (skinToneLevel(child.skin) < 13) { skinDesc = "pink"; @@ -462,8 +453,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function butt(child) { - let - r = ``; + let r = ``; if (V.showClothing && !market) { if (!V.surgeryDescription) { @@ -746,8 +736,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function clothingCorset(child) { - let - r = ``; + let r = ``; switch (child.clothes) { case "a slave gown": @@ -820,10 +809,9 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function collar(child) { - let - r = ``, - daddy, - pregCollar = jsEither(1, 2, 3); + let r = ``; + let daddy; + let pregCollar = jsEither(1, 2, 3); switch (child.collar) { case "uncomfortable leather": @@ -954,8 +942,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function crotch(child) { - let - r = ``; + let r = ``; if (V.showClothing && !market) { switch (child.clothes) { @@ -1097,9 +1084,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function dick(child) { - let - r = ``, - scrotalFullness = child.scrotum - child.balls; + let r = ``; + let scrotalFullness = child.scrotum - child.balls; if (child.dick > 0) { switch (child.dick) { @@ -2188,8 +2174,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function ears(child) { - let - r = ``; + let r = ``; switch (child.earShape) { case "none": @@ -2314,8 +2299,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function face(child) { - let - r = ``; + let r = ``; r += `${His} <span class="pink">face is `; switch (child.faceShape) { @@ -2500,8 +2484,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function flowers(child) { - let - r = ``; + let r = ``; if (child.dick > 0 && !child.balls) { r += `a white orchid, its black stamen stiffly erect. `; @@ -2527,8 +2510,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function footwear(child) { - let - r = ``; + let r = ``; if (hasAnyLegs(child)) { switch (child.clothes) { @@ -2675,9 +2657,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function hair(child) { - let - r = `${His} `, - hLength; + let r = `${His} `; + let hLength; switch (child.hStyle) { case "bald": @@ -2855,8 +2836,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function hairClothing(child) { - let - r = ``; + let r = ``; switch (child.hStyle) { case "neat": @@ -3707,8 +3687,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function heel(child) { - let - r = ``; + let r = ``; if (child.heels) { r += `${His} <span class="pink">legs have been altered</span> so that ${he} must wear heels in order to walk. `; @@ -3728,8 +3707,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function heightImplant(child) { - let - r = ``; + let r = ``; if (child.heightImplant > 0) { r += `The proportions of ${his} arms and legs are odd, as though they have been artificially lengthened. `; @@ -3741,8 +3719,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function hips(child) { - let - r = ``; + let r = ``; if (child.hips < -1) { if (child.butt > 2) { @@ -3862,8 +3839,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function makeup(child) { - let - r = ``; + let r = ``; if (child.makeup > 0) { switch (child.makeup) { @@ -3906,8 +3882,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function mouth(child) { - let - r = ``; + let r = ``; r += `${He} has `; if (child.lips <= 10) { @@ -3996,8 +3971,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function nails(child) { - let - r = ``; + let r = ``; if (!hasAnyArms(child)) { r += `${He} has no hands, and thus, no nails. `; @@ -4041,8 +4015,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event function piercings() { function anus(child) { - let - r = ``; + let r = ``; if (child.vagina > -1) { if (child.anusPiercing === 1) { @@ -4064,8 +4037,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.anus = anus; function clit(child) { - let - r = ``; + let r = ``; switch (child.clitPiercing) { case 3: @@ -4097,8 +4069,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.clit = clit; function corset(child) { - let - r = ``; + let r = ``; if (child.corsetPiercing > 0) { r += `${He} has a corset piercing, a ladder of steel rings running up each side of ${his} back: `; @@ -4148,8 +4119,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.corset = corset; function dick(child) { - let - r = ``; + let r = ``; if (child.dick !== 0) { if (child.dickPiercing === 1) { @@ -4179,8 +4149,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.dick = dick; function ears(child) { - let - r = ``; + let r = ``; if (child.earPiercing > 0) { if (child.earPiercing === 1) { @@ -4215,8 +4184,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.ears = ears; function eyebrows(child) { - let - r = ``; + let r = ``; if (child.eyebrowPiercing === 1) { r += `${He} has a simple stud in one eyebrow. `; @@ -4230,8 +4198,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.eyebrows = eyebrows; function lips(child) { - let - r = ``; + let r = ``; if (child.lipsPiercing === 1) { r += `${He} has a simple lip piercing. `; @@ -4245,9 +4212,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.lips = lips; function nipples(child) { - let - r = ``, - nipColor = nippleColor(child); + let r = ``; + let nipColor = nippleColor(child); if (child.nipplesPiercing === 1) { r += `${His} ${nipColor} nipples have a simple piercing, which keeps them a little harder than they would normally be. `; @@ -4279,8 +4245,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.nipples = nipples; function nose(child) { - let - r = ``; + let r = ``; if (child.nosePiercing === 1) { r += `${He} has simple studs in ${his} nose. `; @@ -4294,8 +4259,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.nose = nose; function tongue(child) { - let - r = ``; + let r = ``; if (child.tonguePiercing === 1) { r += `${His} tongue bears a single stud, so oral sex with ${him} is a bit more fun. `; @@ -4312,8 +4276,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event piercings.tongue = tongue; function vagina(child) { - let - r = ``; + let r = ``; if (child.vaginaPiercing > 0) { r += `${He} has a `; @@ -4332,8 +4295,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function shoulders(child) { - let - r = ``; + let r = ``; if (child.shoulders < -1) { r += `${His} shoulders and chest are very narrow and `; @@ -4389,8 +4351,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function skin(child) { - let - r = ``; + let r = ``; if (V.seeNationality) { if (child.nationality === 0) { @@ -4456,8 +4417,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event function tats() { function anus(child) { - let - r = ``; + let r = ``; if (child.anusTat !== 0) { switch (child.anusTat) { @@ -4529,8 +4489,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.anus = anus; function arms(child) { - let - r = ``; + let r = ``; if (child.armsTat !== 0) { switch (child.armsTat) { @@ -4636,8 +4595,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.arms = arms; function back(child) { - let - r = ``; + let r = ``; if (child.backTat !== 0) { switch (child.backTat) { @@ -4734,8 +4692,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.back = back; function boobs(child) { - let - r = ``; + let r = ``; if (child.boobsTat !== 0) { switch (child.boobsTat) { @@ -4796,8 +4753,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.boobs = boobs; function butt(child) { - let - r = ``; + let r = ``; if (child.buttTat !== 0) { switch (child.buttTat) { @@ -4866,8 +4822,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.butt = butt; function dick(child) { - let - r = ``; + let r = ``; if (!child.fuckdoll) { if (child.dick !== 0 && child.dickTat !== 0) { @@ -4934,8 +4889,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.dick = dick; function lips(child) { - let - r = ``; + let r = ``; if (child.lipsTat !== 0) { switch (child.lipsTat) { @@ -5000,8 +4954,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.lips = lips; function shoulders(child) { - let - r = ``; + let r = ``; if (child.shouldersTat !== 0) { switch (child.shouldersTat) { @@ -5063,8 +5016,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.shoulders = shoulders; function stamp(child) { - let - r = ``; + let r = ``; if (child.stampTat !== 0) { switch (child.stampTat) { @@ -5132,8 +5084,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event tats.stamp = stamp; function vagina(child) { - let - r = ``; + let r = ``; if (child.vaginaTat !== 0) { switch (child.vaginaTat) { @@ -5316,9 +5267,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function vagina(child) { - let - r = ``, - pubertyAge = Math.min(child.pubertyAgeXX, child.pubertyAgeXY); + let r = ``; + let pubertyAge = Math.min(child.pubertyAgeXX, child.pubertyAgeXY); if (child.dick > 0) { if (child.vagina > -1) { @@ -5838,9 +5788,8 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } function waist(child) { - let - r = ``, - belly; + let r = ``; + let belly; if (child.belly >= 1500) { belly = bellyAdjective(child); diff --git a/src/npc/infants/infantSummary.js b/src/npc/infants/infantSummary.js index 9e1cb4dd192..b546ea7f4ef 100644 --- a/src/npc/infants/infantSummary.js +++ b/src/npc/infants/infantSummary.js @@ -4,13 +4,11 @@ * @returns {string} */ App.Facilities.Nursery.InfantSummary = function(child) { - const - weeksOwned = V.week - child.weekAcquired, - pronouns = getPronouns(child), - abbreviate = V.UI.slaveSummary.abbreviation; + const weeksOwned = V.week - child.weekAcquired; + const pronouns = getPronouns(child); + const abbreviate = V.UI.slaveSummary.abbreviation; - let - r = ``; + let r = ``; function InfantSummaryUncached() { // r += health(); @@ -1232,9 +1230,8 @@ App.Facilities.Nursery.InfantSummary = function(child) { } function shortIntelligence() { - let - intelligence = child.intelligence, - r = ``; + let intelligence = child.intelligence; + let r = ``; if (child.hasOwnProperty("intelligenceImplant")) { intelligence += child.intelligenceImplant; @@ -1298,9 +1295,8 @@ App.Facilities.Nursery.InfantSummary = function(child) { } function longIntelligence() { - let - intelligence = child.intelligence, - r = ``; + let intelligence = child.intelligence; + let r = ``; if (child.hasOwnProperty("intelligenceImplant")) { intelligence += child.intelligenceImplant; @@ -1598,12 +1594,10 @@ App.Facilities.Nursery.InfantSummary = function(child) { } function shortExtendedFamily() { - const - {daughter, sister} = getPronouns(child); + const {daughter, sister} = getPronouns(child); - let - handled = 0, - r = ``; + let handled = 0; + let r = ``; if (child.mother > 0) { const _ssj = V.slaves.findIndex(function(s) { @@ -1720,12 +1714,10 @@ App.Facilities.Nursery.InfantSummary = function(child) { } function longExtendedFamily() { - const - {daughter, sister} = getPronouns(child); + const {daughter, sister} = getPronouns(child); - let - handled = 0, - r = ``; + let handled = 0; + let r = ``; if (child.mother > 0) { const _ssj = V.slaves.findIndex(function(s) { diff --git a/src/npc/infants/longInfantDescription.js b/src/npc/infants/longInfantDescription.js index 4a26e56713b..924a69efebe 100644 --- a/src/npc/infants/longInfantDescription.js +++ b/src/npc/infants/longInfantDescription.js @@ -4,24 +4,19 @@ * @returns {string} */ App.Facilities.Nursery.LongInfantDescription = function(child, {market = 0, eventDescription = 0} = {}) { - const - PC = V.PC, - arcology = V.arcologies[0], - weeksOwned = V.week - child.weekAcquired; - - let - r = ``, - age, - title, - father = 0, - fatherPC = 0, - mother = 0, - motherPC = 0; - - const - { - he, his, He - } = getPronouns(child); + const PC = V.PC; + const arcology = V.arcologies[0]; + const weeksOwned = V.week - child.weekAcquired; + + let r = ``; + let age; + let title; + let father = 0; + let fatherPC = 0; + let mother = 0; + let motherPC = 0; + + const {he, his, He} = getPronouns(child); if (child.father === -1 && child.mother === -1) { father = PC; @@ -88,13 +83,12 @@ App.Facilities.Nursery.LongInfantDescription = function(child, {market = 0, even r += ` is a ${age} <strong><span class="coral">${title}.</span></strong> ${He} was born in ${arcology.name} ${weeksOwned > 4 ? weeksOwned < 9 ? `about a month` : `${num(weeksOwned)} months` : weeksOwned <= 1 ? `last week` : `${num(weeksOwned)} weeks`}${weeksOwned > 1 ? ` ago` : ``}`; if (jsDef(child.counter)) { - const - oral = child.counter.oral, - vaginal = child.counter.vaginal, - anal = child.counter.oral, - mammary = child.counter.mammary, - penetrative = child.counter.penetrative, - total = oral + vaginal + anal + mammary + penetrative; + const oral = child.counter.oral; + const vaginal = child.counter.vaginal; + const anal = child.counter.oral; + const mammary = child.counter.mammary; + const penetrative = child.counter.penetrative; + const total = oral + vaginal + anal + mammary + penetrative; if (total > 0) { r += ` and has been fucked about ${num(total)} times, including `; -- GitLab