From b2a4a80780df8f5168e208ed62ba1c282aa732e3 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 5 Nov 2020 19:25:54 -0500 Subject: [PATCH] fixes --- src/endWeek/reports/dairyReport.js | 30 +++++++++++++++++----------- src/endWeek/slaveAssignmentReport.js | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/endWeek/reports/dairyReport.js b/src/endWeek/reports/dairyReport.js index 1dc680988d1..cf0891587f4 100644 --- a/src/endWeek/reports/dairyReport.js +++ b/src/endWeek/reports/dairyReport.js @@ -1,9 +1,9 @@ /** * @returns {DocumentFragment} */ -globalThis.dairyReport = function() { +App.EndWeek.dairyReport = function() { const el = new DocumentFragment(); - let r = []; + let r; const dairyStats = document.createElement("div"); el.append(dairyStats); @@ -40,6 +40,7 @@ globalThis.dairyReport = function() { const _dairyNameCaps = capFirstChar(V.dairyName); if (V.MilkmaidID !== 0) { + r = []; const _FLs = V.slaveIndices[V.MilkmaidID]; let _milkmaidImpregnated = 0, _milkers = 0, _cummers = 0, _breeders = 0, _prostateStim = 0; @@ -354,14 +355,12 @@ globalThis.dairyReport = function() { slave.trust += 3; } } + App.Events.addParagraph(el, r); } _Tadd = (V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren); if (_DL + _Tadd > 0) { - if (V.MilkmaidID !== 0) { - // <br><br> - } - // + r = []; if (_DL !== 1) { r.push(App.UI.DOM.makeElement("span", `There are ${_DL} cows in ${V.dairyName}.`, "bold")); } else { @@ -373,6 +372,7 @@ globalThis.dairyReport = function() { if (_Tadd > 0) { r.push(`${_Tadd} milking machines have permanent biological components, making a total of ${_Tadd + _DL} milk-producing bodies.`); } + App.Events.addNode(el, r, "div"); } if (V.MilkmaidID !== 0) { @@ -1045,6 +1045,7 @@ globalThis.dairyReport = function() { } if (_Tadd > 0) { + r = []; const _tempCash = V.cash; let _seed; @@ -1086,7 +1087,6 @@ globalThis.dairyReport = function() { _cashX = _seed * 9; cashX(_cashX, "menialBioreactors"); } - // <br><br> r.push(`${_Tadd} permanently converted biological`); if (_Tadd > 1) { r.push(`"machines" produce`); @@ -1094,6 +1094,7 @@ globalThis.dairyReport = function() { r.push(`"machine" produces`); } r.push(`<span class="yellowgreen">${cashFormat(V.cash - _tempCash)}</span> income.`); + App.Events.addParagraph(el, r); } if (_inflatedSlaves.milk > 0) { @@ -1106,7 +1107,7 @@ globalThis.dairyReport = function() { } _profits = V.cash - _oldCash; - // <br><br> + r = []; if (_chemSevere > 1) { r.push(`${_chemSevere} cows' productivity is being reduced by the long term effects of industrial use.`); } else if (_chemSevere > 0) { @@ -1312,9 +1313,10 @@ globalThis.dairyReport = function() { if (V.arcologies[0].FSPastoralistLaw === 1) { r.push(`Slave products have completely replaced traditional dairy, making the facility extremely lucrative.`); } + App.Events.addParagraph(el, r); if (V.dairySlimMaintainUpgrade === 1 && V.dairySlimMaintain === 1) { - // <br> + r = []; if (V.arcologies[0].FSSlimnessEnthusiast > 80) { r.push(`Because of your arcology's great enthusiasm for small breasted slaves, the dairy's milking systems have been carefully overhauled and optimized for maximum milk extraction from slaves with smaller endowments — providing a significant boost to their otherwise modest output. This also prevents unfashionable breast expansion of already slim slaves through the milking process.`); } else if (V.arcologies[0].FSSlimnessEnthusiast > 20) { @@ -1324,6 +1326,7 @@ globalThis.dairyReport = function() { V.dairySlimMaintain = 0; V.dairySlimMaintainUpgrade = 0; } + App.Events.addParagraph(el, r); } if (V.createBioreactors === 1 && V.bioreactorPerfectedID !== 0) { @@ -1352,7 +1355,7 @@ globalThis.dairyReport = function() { he, him, his, He, His, wife, girl } = getPronouns(slave)); const _ageInWeeks = 52 * (V.retirementAge - slave.physicalAge); - // <br><br> + r = []; r.push(`${SlaveFullName(slave)}'s breasts,`); if (slave.balls > 0) { r.push(`balls,`); @@ -1380,6 +1383,7 @@ globalThis.dairyReport = function() { r.push(`liters of milk over a`); r.push(V.retirementAge - slave.physicalAge); r.push(`year period before its biological components must be replaced.`); + App.Events.addParagraph(el, r); removeSlave(slave); break; } @@ -1387,8 +1391,10 @@ globalThis.dairyReport = function() { } if (V.dairyDecoration !== "standard") { - // <br><br> - App.UI.DOM.appendNewElement("p", el, `${_dairyNameCaps}'s <span class="green">${V.dairyDecoration} style is well known.</span>`); + r = []; + r.push(`${_dairyNameCaps}'s`); + r.push(App.UI.DOM.makeElement("span", `${V.dairyDecoration} style is well known.`, "green")); + App.Events.addParagraph(el, r); } if (_DL > 0) { diff --git a/src/endWeek/slaveAssignmentReport.js b/src/endWeek/slaveAssignmentReport.js index 6e2c5ba8601..52e839dee37 100644 --- a/src/endWeek/slaveAssignmentReport.js +++ b/src/endWeek/slaveAssignmentReport.js @@ -321,7 +321,7 @@ App.EndWeek.slaveAssignmentReport = function() { ["Cellblock Report", App.Entity.facilities.cellblock], ["Clinic Report", App.Entity.facilities.clinic], ["Club Report", App.Entity.facilities.club], - ["Dairy Report", App.Entity.facilities.dairy], + [App.EndWeek.dairyReport, App.Entity.facilities.dairy], ["Farmyard Report", App.Entity.facilities.farmyard], ["Schoolroom Report", App.Entity.facilities.schoolroom], ["Spa Report", App.Entity.facilities.spa], -- GitLab