From d9c81263466c9a35054d9818e021e2c5fadf9f15 Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Sun, 17 Mar 2019 23:22:38 -0400 Subject: [PATCH] Fixes --- src/js/economyJS.js | 52 +++++++++++++++++++-------------------- src/uncategorized/REFI.tw | 1 - 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 423312c05af..08b4014739b 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -11,8 +11,8 @@ window.Job = Object.freeze({ window.PersonalAttention = Object.freeze({TRADE: 'trading', WAR: 'warfare', SLAVING: 'slaving', ENGINEERING: 'engineering', MEDICINE: 'medicine', MAID: 'upkeep', HACKING: 'hacking'}); window.predictCost = function(array) { - var array2 = array; - var totalCosts = ( + const array2 = array; + let totalCosts = ( getBrothelCosts() + getBrothelAdsCosts() + getArcadeCosts() + @@ -140,8 +140,8 @@ window.getBrothelCosts = function() { }; window.getBrothelAdsCosts = function() { - var brothel = State.variables.brothel; - var costs = 0; + const brothel = State.variables.brothel; + let costs = 0; if (brothel > 0) { costs += State.variables.brothelAdsSpending; } @@ -169,8 +169,8 @@ window.getClubCosts = function() { }; window.getClubAdsCosts = function() { - var club = State.variables.club; - var costs = 0; + const club = State.variables.club; + let costs = 0; if (club > 0) { costs += State.variables.clubAdsSpending; } @@ -212,7 +212,7 @@ window.getServantsQuartersCosts = function() { }; window.getMasterSuiteCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.masterSuitePregnancySlaveLuxuries === 1) { costs += 500; } @@ -238,8 +238,8 @@ window.getFarmyardCosts = function() { window.getSecurityExpansionCost = function() { //security expansion - var secExpCost = 0; - var soldierMod = 0; + let secExpCost = 0; + let soldierMod = 0; if (State.variables.secExp === 1) { if (State.variables.edictsUpkeep > 0) { secExpCost += State.variables.edictsUpkeep; @@ -327,7 +327,7 @@ window.getPrivateOrphanageCosts = function() { }; window.getPeacekeeperCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.peacekeepers !== 0 && State.variables.peacekeepers.undermining !== 0) { costs += State.variables.peacekeepers.undermining; } @@ -335,8 +335,8 @@ window.getPeacekeeperCosts = function() { }; window.getMercenariesCosts = function() { - var costs = 0; - var mercCosts = State.variables.mercenaries * 2000; + let costs = 0; + let mercCosts = State.variables.mercenaries * 2000; if (State.variables.mercenaries > 0) { if (State.variables.barracks) { mercCosts *= 0.5; @@ -350,7 +350,7 @@ window.getMercenariesCosts = function() { }; window.getMenialRetirementCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.citizenRetirementMenials === 1) { costs += State.variables.menials * 2; } @@ -359,7 +359,7 @@ window.getMenialRetirementCosts = function() { // policy and other expenses window.getRecruiterCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.Recruiter !== 0) { costs += 250; } @@ -367,7 +367,7 @@ window.getRecruiterCosts = function() { }; window.getSchoolCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.TSS.schoolPresent === 1) { costs += 1000; } @@ -420,8 +420,8 @@ window.getSchoolCosts = function() { }; window.getPolicyCosts = function() { - var costs = 0; - var policyCost = State.variables.policyCost; + let costs = 0; + let policyCost = State.variables.policyCost; if (State.variables.alwaysSubsidizeGrowth === 1) { costs += policyCost; } @@ -446,7 +446,7 @@ window.getPolicyCosts = function() { }; window.getCyberModCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.cyberMod !== 0 && State.variables.researchLab.built === 'true') { costs += ((100 * State.variables.researchLab.maxSpace) + (300 * State.variables.researchLab.hired) + (100 * State.variables.researchLab.hired)); } @@ -456,7 +456,7 @@ window.getCyberModCosts = function() { //player expenses window.getPCTrainingCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.PC.actualAge >= State.variables.IsInPrimePC && State.variables.PC.actualAge < State.variables.IsPastPrimePC) { if (State.variables.personalAttention === PersonalAttention.TRADE) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; @@ -475,7 +475,7 @@ window.getPCTrainingCosts = function() { return costs; }; window.getPCCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.PC.preg === -1) { costs += 25; } else if (State.variables.PC.fertDrugs === 1) { @@ -520,7 +520,7 @@ window.getEnvironmentCosts = function(cost) { }; window.getSFCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.SF.Toggle && State.variables.SF.Active >= 1 && State.variables.SF.Subsidy !== undefined) { Count(); costs += Math.ceil(State.temporary.SFSubsidy); } @@ -528,7 +528,7 @@ window.getSFCosts = function() { }; window.getWeatherCosts = function() { - var costs = 0; + let costs = 0; if (State.variables.econWeatherDamage && State.variables.disasterResponse > 0) { costs += Math.trunc(State.variables.disasterResponse * 200000 / State.variables.localEcon); } @@ -539,8 +539,8 @@ window.getWeatherCosts = function() { }; window.getSlaveMinorCosts = function(slave) { - var costs = 0; - var rulesCost = State.variables.rulesCost; + let costs = 0; + let rulesCost = State.variables.rulesCost; if (slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER) { if (slave.trust < -20) { costs -= rulesCost * 4; @@ -907,7 +907,7 @@ window.corpValue = function() { if (V.corpIncorporated === 0) { return 0; } else { - var corpAssets = 0; + let corpAssets = 0; if (V.corpDivExtra > 0) { corpAssets += V.corpDivExtraDev * 16000 + V.corpDivExtraSlaves * 10000; } @@ -1033,7 +1033,7 @@ window.corpDivWhoreSlavesRoom = function() { //Corporation race blacklisting/whitelisting //race is the lowercase string representing the race, 'blacklist' is either 1 or 0. 1 means we are blacklisting and 0 means we are whitelisting said race window.corpBlacklistRace = function(race, blacklist) { - var raceArray = State.variables.corpSpecRaces; + let raceArray = State.variables.corpSpecRaces; if (raceArray.length > 0 && blacklist === 1) { raceArray.delete(race); } else if (blacklist === 1) { diff --git a/src/uncategorized/REFI.tw b/src/uncategorized/REFI.tw index 775500272cc..92098eaef28 100644 --- a/src/uncategorized/REFI.tw +++ b/src/uncategorized/REFI.tw @@ -1,4 +1,3 @@ - :: REFI [nobr] /* This is one of several files that contains and organizes many different events. */ -- GitLab