diff --git a/src/endWeek/reports/cellblockReport.js b/src/endWeek/reports/cellblockReport.js index 4acc7cfc171fc62e2f9fa586ddfaa9100a5bd1c3..266d586caa1651a3f9f17c0bbeaa71fd1f2beccf 100644 --- a/src/endWeek/reports/cellblockReport.js +++ b/src/endWeek/reports/cellblockReport.js @@ -8,6 +8,7 @@ App.EndWeek.cellblockReport = function() { const slaves = App.Utils.sortedEmployees(App.Entity.facilities.cellblock); let brokenSlaves = 0, idleBonus = 0, softenedQuirks = 0, trustMalus = 0, FLsFetish = 0; let devBonus = (V.cellblockDecoration !== "standard") ? 1 : 0; + let confinedResults; const cellblockNameCaps = capFirstChar(V.cellblockName); V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.cellblock);/* FIXME: should be local, passed as a parameter to saRules */ @@ -304,15 +305,17 @@ App.EndWeek.cellblockReport = function() { r = []; r.push(He); - r.push(App.SlaveAssignment.stayConfined(slave, brokenSlaves)); + confinedResults = App.SlaveAssignment.stayConfined(slave); + r.push(confinedResults.text); r.push(App.SlaveAssignment.standardSlaveReport(slave, false)); App.Events.addNode(slaveEntry, r, "div", "indent"); } else { // discard return values silently App.SlaveAssignment.choosesOwnJob(slave); - App.SlaveAssignment.stayConfined(slave, brokenSlaves); + confinedResults = App.SlaveAssignment.stayConfined(slave); App.SlaveAssignment.standardSlaveReport(slave, true); } + brokenSlaves += confinedResults.number; } if (softenedQuirks || brokenSlaves) { r = []; diff --git a/src/endWeek/reports/penthouseReport.js b/src/endWeek/reports/penthouseReport.js index fe830219624d03a68dd89f54c7c2bcd82ff90c53..48d99150473c0a5bfc22b15edf350402d73e7739 100644 --- a/src/endWeek/reports/penthouseReport.js +++ b/src/endWeek/reports/penthouseReport.js @@ -104,7 +104,7 @@ App.EndWeek.penthouseReport = function() { r.push(App.SlaveAssignment.servant(slave)); break; case "stay confined": - r.push(App.SlaveAssignment.stayConfined(slave)); + r.push(App.SlaveAssignment.stayConfined(slave).text); break; case "guard you": r.push(App.SlaveAssignment.guardYou(slave)); diff --git a/src/endWeek/saStayConfined.js b/src/endWeek/saStayConfined.js index 47d426bcfce6128055ef7614e369f58b434dc60a..ab60131d0be491e0a0b80fa75f133f0164ebbc97 100644 --- a/src/endWeek/saStayConfined.js +++ b/src/endWeek/saStayConfined.js @@ -1,9 +1,15 @@ +/** + * @typedef {Object} confinedResults + * @property {string} text + * @property {number} number + */ + /** * @param {App.Entity.SlaveState} slave * @param {number} [brokenSlaves] - * @returns {string} + * @returns {confinedResults} */ -App.SlaveAssignment.stayConfined = function(slave, brokenSlaves) { +App.SlaveAssignment.stayConfined = function(slave, brokenSlaves = 0) { /* eslint-disable no-unused-vars*/ const { he, him, his, hers, himself, boy, @@ -152,5 +158,5 @@ App.SlaveAssignment.stayConfined = function(slave, brokenSlaves) { t += `</span>`; } - return t; + return {text: t, number: brokenSlaves}; }; diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index 919a2f13737261c7b9eacd3467e5695e7bae2060..56e2731edf69ec034659ac8a013fabb25f01db42 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -440,7 +440,6 @@ App.SlaveAssignment.workAGloryHole = (function() { cashX(cash, "income for working a gloryhole in an unregistered building", slave); } - State.temporary.profits += cash; incomeStats.income += cash; } })();