diff --git a/src/endWeek/saGetMilked.js b/src/endWeek/saGetMilked.js index 74b802e954e8c9a88bfd43b3e16535c92c4c3851..9f60351945202e1a9eb49715032766a772f21e8a 100644 --- a/src/endWeek/saGetMilked.js +++ b/src/endWeek/saGetMilked.js @@ -1,7 +1,7 @@ App.SlaveAssignment.getMilked = (function() { "use strict"; - let T; + let incomeStats; let r; let arcology; let cash; @@ -29,7 +29,6 @@ App.SlaveAssignment.getMilked = (function() { * @returns {(string|number)} returns number if 'preview' is true, string if it is not. */ function saGetMilked(slave, preview=false) { - T = State.temporary; arcology = V.arcologies[0]; milk = 0; cum = 0; @@ -103,10 +102,10 @@ App.SlaveAssignment.getMilked = (function() { if (slave.assignment === window.Job.DAIRY) { facility = V.facility.dairy; } - T.incomeStats = getSlaveStatisticData(slave, facility); - T.incomeStats.milk = 0; - T.incomeStats.cum = 0; - T.incomeStats.fluid = 0; + incomeStats = getSlaveStatisticData(slave, facility); + incomeStats.milk = 0; + incomeStats.cum = 0; + incomeStats.fluid = 0; } /** @@ -286,7 +285,7 @@ App.SlaveAssignment.getMilked = (function() { /* actX(slave, "milk", milk); - T.incomeStats.milk = milk; + incomeStats.milk = milk; */ // make sure milkSale is set here @@ -353,8 +352,8 @@ App.SlaveAssignment.getMilked = (function() { // Consider returning these if this function gets gutted if (!preview) { actX(slave, "milk", milk); - T.incomeStats.milk = milk; - T.incomeStats.income += milkSale; + incomeStats.milk = milk; + incomeStats.income += milkSale; } return milkSale; } @@ -603,7 +602,7 @@ App.SlaveAssignment.getMilked = (function() { /* actX(slave, "cum", cum); - T.incomeStats.cum = cum; + incomeStats.cum = cum; */ if (arcology.FSPastoralist === "unset") { @@ -663,8 +662,8 @@ App.SlaveAssignment.getMilked = (function() { // Consider returning these if this function gets gutted if (!preview) { actX(slave, "cum", cum); - T.incomeStats.cum = cum; - T.incomeStats.income += cumSale; + incomeStats.cum = cum; + incomeStats.income += cumSale; } return cumSale; } @@ -762,8 +761,8 @@ App.SlaveAssignment.getMilked = (function() { // Consider returning these if this function gets gutted if (!preview) { - T.incomeStats.fluid = fluid; - T.incomeStats.income += fluidSale; + incomeStats.fluid = fluid; + incomeStats.income += fluidSale; } return fluidSale; @@ -812,7 +811,7 @@ App.SlaveAssignment.getMilked = (function() { } else { cashX(cashVign, "slaveAssignmentExtraMilkVign", slave); } - T.incomeStats.income += cashVign; + incomeStats.income += cashVign; } else if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { @@ -877,7 +876,7 @@ App.SlaveAssignment.getMilked = (function() { r += `an incident without lasting effect.`; } repX(Math.trunc(FuckResult * vignette.effect * 0.1), "vignette", slave); - T.incomeStats.rep += Math.trunc(FuckResult * vignette.effect * 0.1); + incomeStats.rep += Math.trunc(FuckResult * vignette.effect * 0.1); } } diff --git a/src/endWeek/saServeThePublic.js b/src/endWeek/saServeThePublic.js index 8c9154842949a567c4682d988f682d3d3ee6b23d..43a8ed4fe5390045911d3b0b5582a603e3e3c19a 100644 --- a/src/endWeek/saServeThePublic.js +++ b/src/endWeek/saServeThePublic.js @@ -1,7 +1,7 @@ App.SlaveAssignment.serveThePublic = (function() { "use strict"; - let T; + let incomeStats; let r; let arcology; @@ -22,7 +22,6 @@ App.SlaveAssignment.serveThePublic = (function() { * @returns {string} */ function saServeThePublic(slave) { - T = State.temporary; arcology = V.arcologies[0]; r = ` `; ({ @@ -66,9 +65,9 @@ App.SlaveAssignment.serveThePublic = (function() { */ function gatherStatistics(slave) { /* Statistics gathering */ - const facility = slave.assignment === Job.CLUB ? V.facility.club : undefined; - T.incomeStats = getSlaveStatisticData(slave, facility); - T.incomeStats.customers = slave.sexAmount; + const facility = (slave.assignment === Job.CLUB || slave.assignment === Job.DJ) ? V.facility.club : undefined; + incomeStats = getSlaveStatisticData(slave, facility); + incomeStats.customers = slave.sexAmount; V.publicServants++; } @@ -1243,7 +1242,7 @@ App.SlaveAssignment.serveThePublic = (function() { repX(Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15), "publicServant", slave); // DJ bonus rep repX(Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15), "publicServantClub", slave); - T.incomeStats.income += Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15); + incomeStats.income += Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15); } else if (slave.assignment === Job.CLUB) { repX(Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15), "publicServantClub", slave); } else if (slave.assignment === Job.PUBLIC) { @@ -1252,7 +1251,7 @@ App.SlaveAssignment.serveThePublic = (function() { repX(Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15), "serving the public in an unregistered building", slave); } } - T.incomeStats.income += Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15); + incomeStats.income += Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15); } /** @@ -1462,7 +1461,7 @@ App.SlaveAssignment.serveThePublic = (function() { cashX(forceNeg(cashVign), "vignette public sexslave expense in an unregistered building", slave); } } - T.incomeStats.income += cashVign; + incomeStats.income += cashVign; } else if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { @@ -1528,7 +1527,7 @@ App.SlaveAssignment.serveThePublic = (function() { r += `an incident without lasting effect.`; } repX(Math.trunc(slave.sexQuality * vignette.effect * 0.1), "vignette", slave); - T.incomeStats.income += Math.trunc(slave.sexQuality * vignette.effect * 0.1); + incomeStats.income += Math.trunc(slave.sexQuality * vignette.effect * 0.1); } } } diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index 8b278a575e52119b285bccb81cadf7626608882f..a41161a612a3dd3b0b31280a91161744b4707e0d 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -1,7 +1,7 @@ App.SlaveAssignment.whore = (function() { "use strict"; - let T; + let incomeStats; let r; let arcology; @@ -28,7 +28,6 @@ App.SlaveAssignment.whore = (function() { * @returns {string} */ function saWhore(slave) { - T = State.temporary; arcology = V.arcologies[0]; r = ` `; ({ @@ -73,11 +72,8 @@ App.SlaveAssignment.whore = (function() { * */ function gatherStatistics(slave) { /* Statistics gathering */ - let facility; - if (slave.assignment === Job.BROTHEL || slave.assignment === Job.MADAM) { - facility = V.facility.brothel; - } - T.incomeStats = getSlaveStatisticData(slave, facility); + const facility = (slave.assignment === Job.BROTHEL || slave.assignment === Job.MADAM) ? V.facility.brothel : undefined; + incomeStats = getSlaveStatisticData(slave, facility); } // I suspect this one will mostly be cut out in the overhauling @@ -87,7 +83,7 @@ App.SlaveAssignment.whore = (function() { function updateNonSlaveVariables(slave) { // FuckResult and FuckAmount setting beauty = slave.sexAmount; - T.incomeStats.customers = beauty; + incomeStats.customers = beauty; if (slave.effectiveWhoreClass === 4) { customers = "extremely wealthy"; FuckResult = Math.trunc(slave.sexQuality * V.whorePriceAdjustment.topClass); @@ -1320,7 +1316,7 @@ App.SlaveAssignment.whore = (function() { } else { cashX(cash, "whoring income in an unregistered building", slave); } - T.incomeStats.income += cash; + incomeStats.income += cash; } /** @@ -1531,7 +1527,7 @@ App.SlaveAssignment.whore = (function() { cashX(forceNeg(cashVign), "vignette whoring expense in an unregistered building", slave); } } - T.incomeStats.income += cashVign; + incomeStats.income += cashVign; } else if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { @@ -1597,7 +1593,7 @@ App.SlaveAssignment.whore = (function() { r += `an incident without lasting effect.`; } repX(Math.trunc(FuckResult * vignette.effect * 0.1), "vignette", slave); - T.incomeStats.rep += Math.trunc(FuckResult * vignette.effect * 0.1); + incomeStats.rep += Math.trunc(FuckResult * vignette.effect * 0.1); } } })(); diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index 18eebdd88eec4f52b8a45c49dd04e9ec44b0824e..802671402b3c57a4ebfd8dab39ed4441646b1a7b 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -1,7 +1,7 @@ App.SlaveAssignment.workAGloryHole = (function() { "use strict"; - let T; + let incomeStats; let r; let beauty; let FResult; @@ -23,7 +23,6 @@ App.SlaveAssignment.workAGloryHole = (function() { * @returns {string} */ function saWorkAGloryHole(slave) { - T = State.temporary; r = ``; ({ // eslint-disable-next-line no-unused-vars @@ -51,8 +50,8 @@ App.SlaveAssignment.workAGloryHole = (function() { function gatherStatistics(slave) { /* Statistics gathering */ const facility = slave.assignment === window.Job.ARCADE ? V.facility.arcade : undefined; - T.incomeStats = getSlaveStatisticData(slave, facility); - T.incomeStats.customers = beauty; + incomeStats = getSlaveStatisticData(slave, facility); + incomeStats.customers = beauty; } /** @@ -439,7 +438,7 @@ App.SlaveAssignment.workAGloryHole = (function() { cashX(cash, "income for working a gloryhole in an unregistered building", slave); } - T.profits += cash; - T.incomeStats.income += cash; + State.temporary.profits += cash; + incomeStats.income += cash; } })();