From 8538e3a8212b7474cbcea8c872d2caa84d95c640 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 15 Nov 2020 18:58:01 -0500 Subject: [PATCH] calc profits in report --- src/endWeek/reports/arcadeReport.js | 7 ++++--- src/endWeek/saWorkAGloryHole.js | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/endWeek/reports/arcadeReport.js b/src/endWeek/reports/arcadeReport.js index 18e8f66786e..1851188c6c5 100644 --- a/src/endWeek/reports/arcadeReport.js +++ b/src/endWeek/reports/arcadeReport.js @@ -76,7 +76,7 @@ App.EndWeek.arcadeReport = function() { if (slave.muscles > -100) { slave.muscles--; } - + const oldCash = V.cash; if (V.showEWD !== 0) { const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); @@ -95,7 +95,7 @@ App.EndWeek.arcadeReport = function() { slaveEntry, [ He, - App.SlaveAssignment.workAGloryHole(slave, profits), + App.SlaveAssignment.workAGloryHole(slave), ], "div", "indent" @@ -103,8 +103,9 @@ App.EndWeek.arcadeReport = function() { } else { // discard return values silently App.SlaveAssignment.choosesOwnJob(slave); - App.SlaveAssignment.workAGloryHole(slave, profits); + App.SlaveAssignment.workAGloryHole(slave); } + profits = V.cash - oldCash; if (V.arcadeUpgradeCollectors > 0) { if (slave.vasectomy === 1) { diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index f521122da54..919a2f13737 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -20,10 +20,9 @@ App.SlaveAssignment.workAGloryHole = (function() { /** * @param {App.Entity.SlaveState} slave - * @param {number} [profits] * @returns {string} */ - function saWorkAGloryHole(slave, profits) { + function saWorkAGloryHole(slave) { r = ``; ({ // eslint-disable-next-line no-unused-vars @@ -39,7 +38,7 @@ App.SlaveAssignment.workAGloryHole = (function() { jobBody(slave); applyFSDecoration(slave); sexCounts(slave); - profitReport(slave, profits); + profitReport(slave); return r; } @@ -423,9 +422,9 @@ App.SlaveAssignment.workAGloryHole = (function() { /** * @param {App.Entity.SlaveState} slave - * @param {number} profits + * */ - function profitReport(slave, profits) { + function profitReport(slave) { let cash = 0; if (V.policies.publicFuckdolls === 0) { cash = Math.trunc(beauty * FResult); @@ -441,7 +440,7 @@ App.SlaveAssignment.workAGloryHole = (function() { cashX(cash, "income for working a gloryhole in an unregistered building", slave); } - profits += cash; + State.temporary.profits += cash; incomeStats.income += cash; } })(); -- GitLab