From e497d4ed76be21c390f04135fd9fc507697eedf2 Mon Sep 17 00:00:00 2001 From: lowercase-donkey <lowercasedonkey@gmail.com> Date: Wed, 16 Jan 2019 20:46:42 -0500 Subject: [PATCH] Simplify environment function a bit. --- src/js/economyJS.tw | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 1286da2dee5..2bde6716221 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -65,7 +65,6 @@ window.predictCost = function(array) { window.getCost = function(array) { var array2 = array; var oldCash = State.variables.cash; - var fee = 0; var costSoFar = 0; cashX(forceNeg(getBrothelCosts()), "brothel"); cashX(forceNeg(getBrothelAdsCosts()), "brothelAds"); @@ -97,13 +96,11 @@ window.getCost = function(array) { //these two apply a multiplicative effect to all costs so far. // Calculate what the deduced expenses would be, then subtract - costSoFar = (oldCash - State.variables.cash); //expected to be positive. - fee = (costSoFar - getEnvironmentCosts(costSoFar)); - cashX(forceNeg(fee), "environment"); + costSoFar = (oldCash - State.variables.cash); //How much we have spent by this point; expected to be positive. + cashX(forceNeg(costSoFar - getEnvironmentCosts(costSoFar), "environment")); //getEnv takes total costs and makes it worse. Figure out how much worse and record it costSoFar = (oldCash - State.variables.cash); - fee = (costSoFar - getPCMultiplierCosts(costSoFar)); - cashX(forceNeg(fee), "PCskills"); + cashX(forceNeg(costSoFar - getPCMultiplierCosts(costSoFar)), "PCskills"); //in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. cashX(forceNeg(getSFCosts()), "specialForces"); -- GitLab