From b70799aded8312fc4ceb0fc66bf5cda84a2b70e0 Mon Sep 17 00:00:00 2001 From: i107760 <13422-i107760@users.noreply.gitgud.io> Date: Sat, 21 Mar 2020 19:20:28 +0100 Subject: [PATCH] Rework 'saWorkAGloryHole.js' --- src/endWeek/saWorkAGloryHole.js | 36 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index b2aef70b900..e60e1e73b35 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -50,7 +50,7 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { */ function gatherStatistics(slave) { /* Statistics gathering */ - const facility = slave.assignment === Job.ARCADE ? V.facility.arcade : undefined; + const facility = slave.assignment === window.Job.ARCADE ? V.facility.arcade : undefined; T.incomeStats = getSlaveStatisticData(slave, facility); T.incomeStats.customers = beauty; } @@ -280,7 +280,7 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { */ function applyFSDecoration(slave) { /* FACILITY DECORATION IMPACTS */ - if (slave.assignment === "be confined in the arcade" && V.arcadeDecoration !== "standard") { + if (slave.assignment === window.job.ARCADE && V.arcadeDecoration !== "standard") { const impact = (0.0001 * V.FSSingleSlaveRep * beauty); switch (V.arcadeDecoration) { case "Roman Revivalist": @@ -480,26 +480,22 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { * */ function profitReport(slave) { + let cash = 0; if (V.publicFuckdolls === 0) { - if (slave.assignment === "work a glory hole") { - cashX(Math.trunc(beauty * FResult), "gloryhole", slave); - } else if (slave.assignment === "be confined in the arcade") { - cashX(Math.trunc(beauty * FResult), "gloryholeArcade", slave); - } else { - cashX(Math.trunc(beauty * FResult), "working a gloryhole in an unregistered building", slave); - } - T.profits += Math.trunc(beauty * FResult); - T.incomeStats.income += Math.trunc(beauty * FResult); + cash = Math.trunc(beauty * FResult); } else { - if (slave.assignment === "work a glory hole") { - cashX(Math.trunc(beauty * FResult / 5), "gloryhole", slave); - } else if (slave.assignment === "be confined in the arcade") { - cashX(Math.trunc(beauty * FResult / 5), "gloryholeArcade", slave); - } else { - cashX(Math.trunc(beauty * FResult / 5), "working a gloryhole in an unregistered building", slave); - } - T.profits += Math.trunc(beauty * FResult / 5); - T.incomeStats.income += Math.trunc(beauty * FResult / 5); + cash = Math.trunc(beauty * FResult / 5); + } + + if (slave.assignment === window.Job.GLORYHOLE) { + cashX(cash, "slaveIncomeGloryhole", slave); + } else if (slave.assignment === window.Job.ARCADE) { + cashX(cash, "slaveIncomeArcade", slave); + } else { + cashX(cash, "income for working a gloryhole in an unregistered building", slave); } + + T.profits += cash; + T.incomeStats.income += cash; } })(); -- GitLab