From 1a270f938ff8115d0447b58fdfd5f7a8d67ede9c Mon Sep 17 00:00:00 2001 From: j <okp57855@psoxs.com> Date: Sun, 28 Jan 2018 12:26:30 +1300 Subject: [PATCH] Update checks. --- src/SecExp/weaponsManufacturing.tw | 16 ++++----- src/js/utilJS.tw | 56 ++++++++++++++---------------- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/SecExp/weaponsManufacturing.tw b/src/SecExp/weaponsManufacturing.tw index 75376e90859..9a371c6649b 100644 --- a/src/SecExp/weaponsManufacturing.tw +++ b/src/SecExp/weaponsManufacturing.tw @@ -197,10 +197,10 @@ __Upgrades__: unit: 0, type: "attack", time: _time}>> - <<set $cash -= 10000*(1-(Math.max(0.99,$PC.technician)/100))>> + <<set $cash -= 10000*$TechnicianSkillEffect>> <<goto "weaponsManufacturing">> <</link>> - <br>//Will take _time weeks, cost <<print cashFormat(10000*(1-(Math.max(0.99,$PC.technician)/100)))>> and will increase the base attack value of the security drones.// + <br>//Will take _time weeks, cost <<print cashFormat(10000*$TechnicianSkillEffect)>> and will increase the base attack value of the security drones.// <<elseif !$completedUpgrades.includes(-2) && $weapLab >= 2>> <<link "Develop adaptive armored frames">> <<set $currentUpgrade = { @@ -299,10 +299,10 @@ __Upgrades__: unit: 1, type: "attackAndDefense", time: _time}>> - <<set $cash -= 120000*(1-(Math.max(0.99,$PC.technician)/100))>> + <<set $cash -= 120000*$TechnicianSkillEffect>> <<goto "weaponsManufacturing">> <</link>> - <br>//Will take _time weeks, cost <<print cashFormat(120000*(1-(Math.max(0.99,$PC.technician)/100)))>> and will increase the base attack and "defense" values of human troops.// + <br>//Will take _time weeks, cost <<print cashFormat(120000*$TechnicianSkillEffect)>> and will increase the base attack and "defense" values of human troops.// <</if>> <<if !$completedUpgrades.includes(5) && $weapLab >= 3>> <br> @@ -313,10 +313,10 @@ __Upgrades__: unit: 1, type: "hpAndMorale", time: _time}>> - <<set $cash -= 120000*(1-(Math.max(0.99,$PC.technician)/100))>> + <<set $cash -= 120000*$TechnicianSkillEffect>> <<goto "weaponsManufacturing">> <</link>> - <br>//Will take _time weeks, cost <<print cashFormat(120000*(1-(Math.max(0.99,$PC.technician)/100)))>> and will increase the base hp and morale values of human troops.// + <br>//Will take _time weeks, cost <<print cashFormat(120000*$TechnicianSkillEffect)>> and will increase the base hp and morale values of human troops.// <</if>> <br> <<if $securityForceCreate == 1>> @@ -356,10 +356,10 @@ __Upgrades__: unit: 1, type: "all", time: _time}>> - <<set $cash -= 1000000*(1-(Math.max(0.99,$PC.technician)/100))>> + <<set $cash -= 1000000*$TechnicianSkillEffect>> <<goto "weaponsManufacturing">> <</link>> - <br>//Will take _time weeks, cost <<print cashFormat(1000000*(1-(Math.max(0.99,$PC.technician)/100)))>> and will increase all base stats of human troops.// + <br>//Will take _time weeks, cost <<print cashFormat(1000000*$TechnicianSkillEffect)>> and will increase all base stats of human troops.// <</if>> <</if>> <<if $securityForceCreate == 1 && ($humanUpgrade.attack >= 4 || $humanUpgrade.hp >= 4 || $humanUpgrade.morale >= 40 || $humanUpgrade.defense >= 4)>> diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw index 46279efaddf..f7bd85c7165 100644 --- a/src/js/utilJS.tw +++ b/src/js/utilJS.tw @@ -433,34 +433,30 @@ if(typeof Categorizer === 'function') { */ jQuery(document).trigger('categorizer.ready'); -window.TechnicianSkillEffect = function(PC) { - PC = PC || State.variables.PC.technician; - - if(PC.technician <= -100) { - var TechnicianSkillEffect = (TechnicianSkillEffect, 1.5); - } - if(PC.technician >= -75) { - var TechnicianSkillEffect = (TechnicianSkillEffect, 1.35); - } - if(PC.technician >= -50) { - var TechnicianSkillEffect = (TechnicianSkillEffect, 1.25); - } - if(PC.technician >= -25) { - var TechnicianSkillEffect = (TechnicianSkillEffect, 1.15); - } - if(PC.technician <= 25) { - var TechnicianSkillEffect = (TechnicianSkillEffect, 1); - } - if(PC.technician >= 25) { - var TechnicianSkillEffect = (TechnicianSkillEffect, .95); - } - if(PC.technician >= 50) { - var TechnicianSkillEffect = (TechnicianSkillEffect, .75); - } - if(PC.technician >= 75) { - var TechnicianSkillEffect = (TechnicianSkillEffect, .65); - } - if(PC.technician >= 100) { - var TechnicianSkillEffect = (TechnicianSkillEffect, .5); - } +if(Story.variables.PC.technician <= -100) { + var Story.variables.TechnicianSkillEffect = "1.5" +} +if(Story.variables.PC.technician >= -75) { + var Story.variables.TechnicianSkillEffect = "1.35" +} +if(Story.variables.PC.technician >= -50) { + var Story.variables.TechnicianSkillEffect = "1.25" +} +if(Story.variables.PC.technician >= -25) { + var Story.variables.TechnicianSkillEffect = "1.15" +} +if(Story.variables.PC.technician <= 25) { + var Story.variables.TechnicianSkillEffect = "1" +} +if(Story.variables.PC.technician >= 25) { + var Story.variables.TechnicianSkillEffect = ".95" +} +if(Story.variables.PC.technician >= 50) { + var Story.variables.TechnicianSkillEffect = ".75" +} +if(Story.variables.PC.technician >= 75) { + var Story.variables.TechnicianSkillEffect = ".65" +} +if(Story.variables.PC.technician >= 100) { + var Story.variables.TechnicianSkillEffect = ".5" } \ No newline at end of file -- GitLab