diff --git a/src/endWeek/reports/cellblockReport.js b/src/endWeek/reports/cellblockReport.js index f9eba9aef65b1da9c81aac39fbd6424e164a555a..4411600773899e36146c69c6abeea6e3655c900c 100644 --- a/src/endWeek/reports/cellblockReport.js +++ b/src/endWeek/reports/cellblockReport.js @@ -6,13 +6,9 @@ App.EndWeek.cellblockReport = function() { let r; const slaves = App.Utils.sortedEmployees(App.Entity.facilities.cellblock); - let brokenSlaves = 0, idleBonus = 0, softenedQuirks = 0, trustMalus = 0, FLsFetish = 0, devBonus; + let brokenSlaves = 0, idleBonus = 0, softenedQuirks = 0, trustMalus = 0, FLsFetish = 0; + let devBonus = (V.cellblockDecoration !== "standard") ? 1 : 0; - if (V.cellblockDecoration !== "standard") { - devBonus = 1; - } else { - devBonus = 0; - } const cellblockNameCaps = capFirstChar(V.cellblockName); V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.cellblock);/* FIXME: should be local, passed as a parameter to saRules */ diff --git a/src/endWeek/reports/clubReport.js b/src/endWeek/reports/clubReport.js index de98b3b10aa2a49b8c96c8edccb3b48456b25b6d..9f43989a3e6505c5a6476491c91ebc4da4903766 100644 --- a/src/endWeek/reports/clubReport.js +++ b/src/endWeek/reports/clubReport.js @@ -4,12 +4,9 @@ App.EndWeek.clubReport = function() { const el = new DocumentFragment(); let r; - let he, him, his, He, His, wife, himself; const slaves = App.Utils.sortedEmployees(App.Entity.facilities.club); - const DL = slaves.length; V.legendaryEntertainerID = 0; - let FLsFetish = 0; V.legendaryWombID = 0; // Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep @@ -19,6 +16,7 @@ App.EndWeek.clubReport = function() { el.append(clubStats); if (S.DJ) { + let FLsFetish = 0; r = []; if (S.DJ.health.condition < -80) { improveCondition(S.DJ, 20); @@ -58,16 +56,16 @@ App.EndWeek.clubReport = function() { } /* Make sure we have registered living expenses as for any other slave */ getSlaveStatisticData(S.DJ, V.facility.club); - ({ - he, him, his, He, His, wife - } = getPronouns(S.DJ)); + const { + he, him, his, He, His, wife, himself + } = getPronouns(S.DJ); r.push(`${SlaveFullName(S.DJ)} is performing as the DJ.`); if (S.DJ.relationship === -3 && S.DJ.devotion > 50) { r.push(`${He} tries ${his} best to be your energetic, cheerful ${wife}.`); } if (FLsFetish === 1) { r.push(`${He}'s expected to be the innovative, beautiful DJ spinning beats one minute, and come out of ${his} booth to grind on the floor the next; ${he} enjoys the interplay, and finds greater <span class="lightcoral">pleasure in exhibitionism.</span>`); - } else if ((FLsFetish === 2)) { + } else if (FLsFetish === 2) { r.push(`Every day ${he} gets to enjoy hundreds of stares on ${his} skin, and <span class="lightsalmon">becomes more of an exhibitionist.</span>`); } if (getBestVision(S.DJ) === 0) { @@ -101,7 +99,7 @@ App.EndWeek.clubReport = function() { S.DJ.skill.DJ += random(1, Math.ceil((S.DJ.intelligence + S.DJ.intelligenceImplant) / 15) + 8); } App.Events.addNode(el, r, "p", "indent"); - if (DL + V.clubSlavesGettingHelp < 10 && V.DJnoSex !== 1 && !slaveResting(S.DJ)) { + if (slaves.length + V.clubSlavesGettingHelp < 10 && V.DJnoSex !== 1 && !slaveResting(S.DJ)) { if (V.legendaryEntertainerID === 0 && S.DJ.prestige === 0 && S.DJ.skill.entertainment >= 100 && S.DJ.devotion > 50) { V.legendaryEntertainerID = S.DJ.ID; } @@ -127,10 +125,10 @@ App.EndWeek.clubReport = function() { } } - if (DL > 0) { + if (slaves.length > 0) { r = []; - if (DL !== 1) { - r.push(App.UI.DOM.makeElement("span", `The ${DL} slaves pleasing citizens in ${V.clubName}`, "bold")); + if (slaves.length !== 1) { + r.push(App.UI.DOM.makeElement("span", `The ${slaves.length} slaves pleasing citizens in ${V.clubName}`, "bold")); } else { r.push(App.UI.DOM.makeElement("span", `The one slave pleasing citizens in ${V.clubName}`, "bold")); } @@ -160,11 +158,8 @@ App.EndWeek.clubReport = function() { } } - if (DL > 0) { + if (slaves.length > 0) { for (const slave of slaves) { - ({ - he, him, his, He, His, wife - } = getPronouns(slave)); if (V.legendaryEntertainerID === 0 && slave.prestige === 0 && slave.skill.entertainment >= 100 && slave.devotion > 50) { V.legendaryEntertainerID = slave.ID; } @@ -213,6 +208,7 @@ App.EndWeek.clubReport = function() { } App.Events.addNode(slaveEntry, r, "div"); + const {He} = getPronouns(slave); App.Events.addNode( slaveEntry, [ @@ -234,7 +230,7 @@ App.EndWeek.clubReport = function() { App.Events.addNode(el, [App.Ads.report("club")], "p", "indented"); // Record statistics gathering - const b = State.variables.facility.club; + const b = V.facility.club; b.whoreIncome = 0; b.customers = 0; b.whoreCosts = 0; @@ -245,8 +241,8 @@ App.EndWeek.clubReport = function() { b.whoreCosts += si.cost; b.rep += si.rep; } - b.adsCosts = State.variables.clubAdsSpending; - b.maintenance = State.variables.club * State.variables.facilityCost * (1.0 + 0.2 * State.variables.clubUpgradePDAs); + b.adsCosts = V.clubAdsSpending; + b.maintenance = V.club * V.facilityCost * (1.0 + 0.2 * V.clubUpgradePDAs); b.totalIncome = b.whoreIncome + b.adsIncome; b.totalExpenses = b.whoreCosts + b.adsCosts + b.maintenance; b.profit = b.totalIncome / b.totalExpenses; diff --git a/src/endWeek/reports/spaReport.js b/src/endWeek/reports/spaReport.js index f2057ae42464bce93b6889fd4233a9bc113ca749..b1cbd22ac63c7dda95ec86f27fd9482ce8aba24e 100644 --- a/src/endWeek/reports/spaReport.js +++ b/src/endWeek/reports/spaReport.js @@ -6,18 +6,17 @@ App.EndWeek.spaReport = function() { let r; const slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa); - let DL = slaves.length; - let bonusToggle = 0, healthBonus = 0, idleBonus = 0, restedSlaves = 0, restedSlave, devBonus; + let healthBonus = 0, restedSlaves = 0, restedSlave; + let devBonus = (V.spaDecoration !== "standard") ? 1 : 0; - if (V.spaDecoration !== "standard") { - devBonus = 1; - } else { - devBonus = 0; - } V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.spa); /* FIXME: should be local, passed as a parameter to saRules */ - if (V.AttendantID !== 0) { + if (S.Attendant) { + let idleBonus = 0; + let bonusToggle = 0; + let FLsFetish = 0; r = []; + if (S.Attendant.health.condition < 100) { improveCondition(S.Attendant, normalRandInt(20)); } @@ -30,7 +29,6 @@ App.EndWeek.spaReport = function() { if (S.Attendant.rules.living !== "luxurious") { S.Attendant.rules.living = "luxurious"; } - let FLsFetish = 0; if (S.Attendant.fetishStrength <= 95) { if (S.Attendant.fetish !== "submissive") { if (fetishChangeChance(S.Attendant) > random(0, 100)) { @@ -101,13 +99,14 @@ App.EndWeek.spaReport = function() { idleBonus++; healthBonus++; } - let attendantUsedCure = 0; + let attendantUsedCure = false; App.Events.addNode(el, r, "div", "indent"); + const softenFlawBonus = bonusToggle ? 10 : 0; for (const slave of slaves) { const {he2, his2, him2} = getPronouns(slave).appendSuffix("2"); r = []; - if (slave.fetish === "mindbroken" && slave.health.condition > 20 && attendantUsedCure === 0 && V.spaFix !== 2) { - attendantUsedCure = 1; + if (slave.fetish === "mindbroken" && slave.health.condition > 20 && !attendantUsedCure && V.spaFix !== 2) { + attendantUsedCure = true; if (random(1, 100) > 90 - S.Attendant.devotion) { const curedSlave = App.UI.DOM.makeElement("div", null, "indent"); const curedArray = [`<span class="green">Something almost miraculous has happened.</span> ${S.Attendant.slaveName} has always refused to believe that ${slave.slaveName} could not be reached, and has lavished patient tenderness on ${him2} in ${V.spaName}. ${slave.slaveName} has begun to respond, and is stirring from ${his2} mental torpor.`]; @@ -129,7 +128,6 @@ App.EndWeek.spaReport = function() { r.push(curedSlave); } } - const seed = bonusToggle * 10; if (bonusToggle === 1 && slave.trust < 60) { slave.trust++; } @@ -231,20 +229,20 @@ App.EndWeek.spaReport = function() { } } if ( + !attendantUsedCure && (S.Attendant.intelligence + S.Attendant.intelligenceImplant > 15) && - (attendantUsedCure === 0) && - (S.Attendant.intelligence + S.Attendant.intelligenceImplant + seed) > random(1, 200) && + (S.Attendant.intelligence + S.Attendant.intelligenceImplant + softenFlawBonus) > random(1, 200) && (V.spaFix === 0) ) { if (slave.behavioralFlaw !== "none") { SoftenBehavioralFlaw(slave); - attendantUsedCure += 1; + attendantUsedCure = true; r.push(`${S.Attendant.slaveName} works carefully with ${slave.slaveName}, and successfully`); r.push(App.UI.DOM.makeElement("span", `softens ${his2} behavioral flaw`, "green")); r.push(`into an appealing quirk.`); } else if (slave.sexualFlaw !== "none") { SoftenSexualFlaw(slave); - attendantUsedCure += 1; + attendantUsedCure = true; r.push(`${S.Attendant.slaveName} works carefully with ${slave.slaveName}, and successfully`); r.push(App.UI.DOM.makeElement("span", `softens ${his2} sexual flaw`, "green")); r.push(`into an appealing quirk.`); @@ -259,12 +257,12 @@ App.EndWeek.spaReport = function() { App.Events.addNode(el, r, "div", "indent"); } - if (DL < V.spa) { - const seed = random(1, 10) + ((V.spa - DL) * (random(150, 170) + (idleBonus * 10))); + if (slaves.length < V.spa) { + const seed = random(1, 10) + ((V.spa - slaves.length) * (random(150, 170) + (idleBonus * 10))); cashX(seed, "spa", S.Attendant); r = []; r.push(`Since ${he} doesn't have enough slaves to occupy all ${his} time, the spa takes in citizens' slaves on a contract basis and ${he} helps them too, earning <span class="yellowgreen"> ${cashFormat(seed)}.</span>`); - if (V.arcologies[0].FSHedonisticDecadence > 0 && DL === 0) { + if (V.arcologies[0].FSHedonisticDecadence > 0 && slaves.length === 0) { r.push(`Society <span class="green">loves</span> being allowed to lounge in your spa, greatly advancing your laid back culture.`); FutureSocieties.Change("Hedonistic", 2); } @@ -272,18 +270,14 @@ App.EndWeek.spaReport = function() { } } - if (DL > 0) { + if (slaves.length > 0) { r = []; - if (DL > 1) { - r.push(`There are ${DL} slaves`); + if (slaves.length > 1) { + r.push(`There are ${slaves.length} slaves`); } else { r.push(`There is one slave`); } r.push(`resting and recuperating in the spa.`); - if (V.arcologies[0].FSHedonisticDecadence > 0 && DL === 0) { - r.push(`Society <span class="green">approves</span> of your slaves being pampered this way, greatly advancing your laid back culture.`); - FutureSocieties.Change("Hedonistic", 1); - } App.Events.addNode(el, r, "p", ["indent", "bold"]); } @@ -374,7 +368,6 @@ App.EndWeek.spaReport = function() { el.append(slaveFixed); restedSlaves++; restedSlave = slave; - DL--; continue; }