From 567a6b3c419090afefd62efdf8f87cf715373ebc Mon Sep 17 00:00:00 2001 From: Blank <blank@national.shitposting.agency> Date: Wed, 13 Mar 2019 01:18:41 -0700 Subject: [PATCH] (Ready to merge) PCengineeringReview --- devNotes/Useful JS Function Documentation.txt | 4 ++- src/events/intro/initNationalities.tw | 2 -- src/js/utilJS.js | 31 +++++++++++++++++++ src/pregmod/eliteTakeOverResult.tw | 2 +- src/uncategorized/BackwardsCompatibility.tw | 5 ++- src/uncategorized/nextWeek.tw | 1 + 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/devNotes/Useful JS Function Documentation.txt b/devNotes/Useful JS Function Documentation.txt index f0e1e92a9e7..8f1186b094e 100644 --- a/devNotes/Useful JS Function Documentation.txt +++ b/devNotes/Useful JS Function Documentation.txt @@ -346,4 +346,6 @@ UtilJS [script] removeDuplicates() - Takes an array and returns a new array without duplicate entries - HackingSkillMultiplier() - outputs a value based off of the PC's hacking skill. \ No newline at end of file + HackingSkillMultiplier() - outputs a value based off of the PC's hacking skill. + + upgradeMultiplierArcology() - outputs a value based off of the PC's engineering skill. diff --git a/src/events/intro/initNationalities.tw b/src/events/intro/initNationalities.tw index e4c1f257698..ed54a9c4fe9 100644 --- a/src/events/intro/initNationalities.tw +++ b/src/events/intro/initNationalities.tw @@ -26,7 +26,6 @@ <<set $trinkets.push("an artist's impression of an early arcology design")>> <<set $arcologyUpgrade.drones = 1, $arcologyUpgrade.hydro = 1>> <<set $secBots.active = 1, $secBots.troops = 30, $secBots.maxTroops = 30>> - <<set $upgradeMultiplierArcology = 0.6>> <<elseif $PC.career == "medicine">> <<set $trinkets.push("a framed postsurgical x-ray")>> <<set $surgeryCost = Math.trunc($surgeryCost/2)>> @@ -36,7 +35,6 @@ <<run repX(4000, "event")>> <<elseif $PC.career == "arcology owner">> <<set $trinkets.push("a miniature model of your first arcology")>> - <<set $upgradeMultiplierArcology = 0.8>> <<run repX(2000, "event")>> <<elseif $PC.career == "escort">> <<set $trinkets.push("a copy of the first porno you starred in")>> diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 752971d503b..17431b10bda 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1732,3 +1732,34 @@ window.SkillIncrease = (function() { Entertain: EntertainSkillIncrease }; })(); + +window.upgradeMultiplierArcology = function() { + const V = State.variables; + if (V.PC.career === "engineer" || (V.arcologies[0].FSRestartDecoration >= 100 && V.eugenicsFullControl === 0) ) { + return 0.6; + } else if (V.PC.engineering <= -100) { + return 1.5; + } else if (V.PC.engineering <= -75) { + return 1.35; + } else if (V.PC.engineering <= -50) { + return 1.25; + } else if (V.PC.engineering <= -25) { + return 1.15; + } else if (V.PC.engineering < 0) { + return 1.10; + } else if (V.PC.engineering === 0) { + return 1; + } else if (V.PC.engineering <= 10) { + return 0.97; + } else if (V.PC.engineering <= 25) { + return 0.95; + } else if (V.PC.engineering <= 50) { + return 0.90; + } else if (V.PC.engineering <= 75) { + return 0.85; + } else if (V.PC.engineering < 100) { + return 0.83; + } else if (V.PC.engineering >= 100 || V.PC.career === "arcology owner") { + return 0.80; + } +}; \ No newline at end of file diff --git a/src/pregmod/eliteTakeOverResult.tw b/src/pregmod/eliteTakeOverResult.tw index dccc19a9521..217375157a7 100644 --- a/src/pregmod/eliteTakeOverResult.tw +++ b/src/pregmod/eliteTakeOverResult.tw @@ -210,4 +210,4 @@ <</if>> /* clean up */ -<<set $failedElite = 0, $eugenicsFullControl = 1, $upgradeMultiplierArcology = 1>> +<<set $failedElite = 0, $eugenicsFullControl = 1>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index df7d1e9163e..d2603d3a4f6 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -2092,7 +2092,6 @@ Setting missing global variables: <<if ndef $trinkets>> <<set $trinkets = []>> - <<set $upgradeMultiplierArcology = 1>> <<set $upgradeMultiplierMedicine = 1>> <<if $PC.career == "wealth">> <<set $trinkets.push("a collection of diplomas from expensive schools")>> @@ -2104,7 +2103,6 @@ Setting missing global variables: <<set $trinkets.push("a framed picture of a slave with her sale price scrawled across the bottom")>> <<elseif $PC.career == "engineer">> <<set $trinkets.push("an artist's impression of an early arcology design")>> - <<set $upgradeMultiplierArcology = 0.6>> <<elseif $PC.career == "medicine">> <<set $trinkets.push("a framed postsurgical x-ray")>> <<set $upgradeMultiplierMedicine = 0.8>> @@ -3563,6 +3561,7 @@ Done! <</if>> <<set $HackingSkillMultiplier = HackingSkillMultiplier()>> +<<set $upgradeMultiplierArcology = upgradeMultiplierArcology()>> /* reset NaNArray after BC is run */ -<<set $NaNArray = findNaN()>> +<<set $NaNArray = findNaN()>> \ No newline at end of file diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index 755f3ae730b..64b03fe8c14 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -1,6 +1,7 @@ :: Next Week [nobr] <<set $HackingSkillMultiplier = HackingSkillMultiplier()>> +<<set $upgradeMultiplierArcology = upgradeMultiplierArcology()>> <<if $rivalOwner != 0>> <<set _rival = $arcologies.find(function(s) { return s.rival == 1; })>> -- GitLab