From eeee56ef798b420d6cdd7c899ec6afdca2dbfa16 Mon Sep 17 00:00:00 2001
From: Blank <blank@national.shitposting.agency>
Date: Thu, 16 May 2019 20:37:53 -0700
Subject: [PATCH] SF+SecExp_Tweaking

---
 src/SecExp/securityHQ.tw           | 63 +++++++++++++++---------------
 src/SecExp/weaponsManufacturing.tw |  9 ++---
 src/SpecialForce/SpecialForce.js   |  4 +-
 3 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/src/SecExp/securityHQ.tw b/src/SecExp/securityHQ.tw
index f93cac2b134..a037cc5e476 100644
--- a/src/SecExp/securityHQ.tw
+++ b/src/SecExp/securityHQ.tw
@@ -26,16 +26,17 @@ You have <span id="secHel"> <<print num($secMenials)>> </span> slaves working in
 <<if $cash > _menialPrice>>
 	<<if _bulkMax > 0 || $menials+$fuckdolls+$menialBioreactors == 0>>
 		<br>
-		[[Buy|securityHQ][$menials+=1,$menialSupplyFactor-=1,cashX(forceNeg(_menialPrice), "menialTransfer")]]
+		[[Buy|securityHQ][$menials+=1,$menialSupplyFactor -= 1, cashX(-_menialPrice, "menialTransfer")]]
 		<<if $cash > (menialSlaveCost(10))*10>>
-			[[(x10)|securityHQ][$menials+=10,$menialSupplyFactor-=10,cashX(forceNeg((menialSlaveCost(10))*10), "menialTransfer")]]
+			[[(x10)|securityHQ][$menials+=10,$menialSupplyFactor -= 10, cashX(-(menialSlaveCost(10)*10), "menialTransfer")]]
 		<</if>>
 		<<if $cash > (menialSlaveCost(100))*100>>
-			[[(x100)|securityHQ][$menials+=100,$menialSupplyFactor-=100,cashX(forceNeg((menialSlaveCost(100))*100), "menialTransfer")]]
+			[[(x100)|securityHQ][$menials+=100,$menialSupplyFactor -= 100, cashX(-(menialSlaveCost(100)*100), "menialTransfer")]]
 		<</if>>
 		<<if $cash > (_menialPrice+1)*2>>
 			<<set _menialBulkPremium = Math.trunc(1 + Math.clamp($cash/_menialPrice,0,_bulkMax)/400)>>
-			[[(max)|securityHQ][$menials+=Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),$menialSupplyFactor-=Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)*(_menialPrice+_menialBulkPremium))), "menialTransfer")]]
+			<<set _finalMaxCost = Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)*(_menialPrice+_menialBulkPremium))>>
+			[[(max)|securityHQ][$menials += Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)), $menialSupplyFactor -= Math.trunc(Math.clamp($cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)), cashX(-_finalMaxCost, "menialTransfer")]]
 		<</if>>
 		//Bulk transactions may require offering a premium.//
 	<</if>>
@@ -214,14 +215,14 @@ Considering the current upgrades the resting level for security is <<print $secR
 <br>
 
 <<if $secUpgrades.nanoCams == 0>>
-	[[Install a nano-camera system |securityHQ][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.nanoCams = 1, $secRestPoint += 15, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
+	[[Install a nano-camera system |securityHQ][cashX(-Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.nanoCams = 1, $secRestPoint += 15, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
 	<br>//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will raise rest point of security by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have installed all across the arcology closed circuit nano-cameras to keep the arcology under your watchful eye.
 <</if>>
 <br>
 <<if $secUpgrades.cyberBots == 0>>
-	[[Buy cybersecurity algorithms|securityHQ][cashX(forceNeg(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.cyberBots = 1, $secRestPoint += 15, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
+	[[Buy cybersecurity algorithms|securityHQ][cashX(-Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.cyberBots = 1, $secRestPoint += 15, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
 	<br>//Costs <<print cashFormat(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will raise rest point of security by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have bought advanced cybersecurity algorithms that will defend your arcology against hack attempts or cyber frauds.
@@ -229,20 +230,20 @@ Considering the current upgrades the resting level for security is <<print $secR
 <br>
 <<if $authority > 10000>>
 	<<if $secUpgrades.eyeScan == 0>>
-		[[Install invisible eye scanners|securityHQ][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.eyeScan = 1, $secRestPoint += 20, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
+		[[Install invisible eye scanners|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.eyeScan = 1, $secRestPoint += 20, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
 		<br>//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will raise rest point of security by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have installed numerous hidden eye scanners that accurately register the movements of everyone inside the arcology.
 	<</if>>
 	<br>
 	<<if $secUpgrades.cryptoAnalyzer == 0>>
-		[[Buy and install crypto analyzers|securityHQ][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.cryptoAnalyzer = 1, $secRestPoint += 20, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
+		[[Buy and install crypto analyzers|securityHQ][cashX(-Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.cryptoAnalyzer = 1, $secRestPoint += 20, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
 		<br>//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will raise rest point of security by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have bought and employed sophisticated crypto analyzing software to accurately track and archive every financial movement or transaction made inside the walls of your arcology.
 	<</if>>
 <<else>>
-	<br>You lack the reputation to access more advanced upgrades.
+	<br>You lack the authority to access more advanced upgrades.
 <</if>>
 
 <br>
@@ -267,14 +268,14 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 
 <<if $crimeUpgrades.advForensic == 0>>
-	[[Install advanced forensic equipment|securityHQ][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $crimeUpgrades.advForensic = 1, $crimeCap -= 10, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+	[[Install advanced forensic equipment|securityHQ][cashX(-Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $crimeUpgrades.advForensic = 1, $crimeCap -= 10, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 	<br>//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will bring down the crime level cap by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have installed advanced forensic equipment, able to extract every bit of precious information from any clue.
 <</if>>
 <br>
 <<if $crimeUpgrades.autoArchive == 0>>
-	[[Install auto-curating archiver|securityHQ][cashX(forceNeg(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $crimeUpgrades.autoArchive = 1, $crimeCap -= 10, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+	[[Install auto-curating archiver|securityHQ][cashX(-Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $crimeUpgrades.autoArchive = 1, $crimeCap -= 10, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 	<br>//Costs <<print cashFormat(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will bring down the crime level cap by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have installed auto-curating archiver software, which will update in real time your data archives with any new relevant information on criminals residing in your arcology.
@@ -282,20 +283,20 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 <<if $authority > 10000>>
 	<<if $crimeUpgrades.autoTrial == 0>>
-		[[Install automated trials software|securityHQ][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $crimeUpgrades.autoTrial = 1, $crimeCap -= 15, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Install automated trials software|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $crimeUpgrades.autoTrial = 1, $crimeCap -= 15, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will bring down the crime level cap by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have installed advanced legal algorithms that allows the handling of legal matters much quicker and much more accurately.
 	<</if>>
 	<br>
 	<<if $crimeUpgrades.worldProfiler == 0>>
-		[[Install worldwide profilers|securityHQ][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $crimeUpgrades.worldProfiler = 1, $crimeCap -= 15, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Install worldwide profilers|securityHQ][cashX(-Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $crimeUpgrades.worldProfiler = 1, $crimeCap -= 15, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will bring down the crime level cap by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have installed advanced profiler software, which will constantly scour every known data archive on the globe (legally or not) to gather as much information as possible on dangerous criminals.
 	<</if>>
 <<else>>
-	<br>You lack the reputation to access more advanced upgrades.
+	<br>You lack the authority to access more advanced upgrades.
 <</if>>
 
 <br>
@@ -317,14 +318,14 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 
 <<if $intelUpgrades.sensors == 0>>
-	[[Install perimeter sensors|securityHQ][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $intelUpgrades.sensors = 1, $recon += 1, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+	[[Install perimeter sensors|securityHQ][cashX(-Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $intelUpgrades.sensors = 1, $recon += 1, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 	<br>//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will increase recon capabilities, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have installed perimeter seismic sensors able to detect movement with high accuracy.
 <</if>>
 <br>
 <<if $intelUpgrades.signalIntercept == 0>>
-	[[Create signal interception hub|securityHQ][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $intelUpgrades.signalIntercept = 1, $recon += 1, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+	[[Create signal interception hub|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $intelUpgrades.signalIntercept = 1, $recon += 1, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 	<br>//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will increase recon capabilities, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have installed advanced signal interception equipment.
@@ -332,13 +333,13 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 <<if $authority > 10000>>
 	<<if $intelUpgrades.radar == 0>>
-		[[Install advanced radar equipment|securityHQ][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $intelUpgrades.radar = 1, $recon += 1, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Install advanced radar equipment|securityHQ][cashX(-Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $intelUpgrades.radar = 1, $recon += 1, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will increase recon capabilities, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have installed sophisticated radar equipment.
 	<</if>>
 <<else>>
-	<br>You lack the reputation to access more advanced upgrades.
+	<br>You lack the authority to access more advanced upgrades.
 <</if>>
 
 <br>
@@ -360,14 +361,14 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 
 <<if $readinessUpgrades.pathways == 0>>
-	[[Build specialized pathways in the arcology|securityHQ][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount)), "capEx"), $readinessUpgrades.pathways = 1, $readiness += 1, $secHQUpkeep += $upgradeUpkeep]]
+	[[Build specialized pathways in the arcology|securityHQ][cashX(-Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.pathways = 1, $readiness += 1, $secHQUpkeep += $upgradeUpkeep]]
 	<br>//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology*_HistoryDiscount))>>. Will increase readiness by 1, but will increase upkeep.//
 <<else>>
 	You have built specialized pathways inside the arcology to quickly move troops around the structure.
 <</if>>
 <br>
 <<if $readinessUpgrades.rapidVehicles == 0>>
-	[[Buy rapid armored transport vehicles|securityHQ][cashX(forceNeg(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount)), "capEx"), $readinessUpgrades.rapidVehicles = 1, $readiness += 2, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
+	[[Buy rapid armored transport vehicles|securityHQ][cashX(-Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.rapidVehicles = 1, $readiness += 2, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
 	<br>//Costs <<print cashFormat(Math.trunc(7500*$upgradeMultiplierArcology*_HistoryDiscount))>>. Will increase readiness by 2, but will require 5 extra slaves in the headquarters and increases upkeep.//
 <<else>>
 	You have bought rapid armored transport vehicles able to bring your troops to battle much quicker than before.
@@ -375,20 +376,20 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 <br>
 <<if $authority > 10000>>
 	<<if $readinessUpgrades.rapidPlatforms == 0>>
-		[[Build rapid deployment platforms|securityHQ][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount)), "capEx"), $readinessUpgrades.rapidPlatforms = 1, $readiness += 2, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
+		[[Build rapid deployment platforms|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.rapidPlatforms = 1, $readiness += 2, $reqMenials += 5, $secHQUpkeep += $upgradeUpkeep]]
 		<br>//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount))>>. Will increase readiness by 2, but will require 5 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have built rapid deployment platforms able to equip and deploy units within very limited time windows.
 	<</if>>
 	<br>
 	<<if $readinessUpgrades.earlyWarn == 0>>
-		[[Institute early warning systems|securityHQ][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount)), "capEx"), $readinessUpgrades.earlyWarn = 1, $readiness += 2, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
+		[[Institute early warning systems|securityHQ][cashX(-Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.earlyWarn = 1, $readiness += 2, $reqMenials += 10, $secHQUpkeep += $upgradeUpkeep]]
 		<br>//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology*_HistoryDiscount))>>. Will increase readiness by 2, but will require 10 extra slaves in the headquarters and increases upkeep.//
 	<<else>>
 		You have created early warning systems that constantly analyze in real time data to determine the likeness of an attack.
 	<</if>>
 <<else>>
-	<br>You lack the reputation to access more advanced upgrades.
+	<br>You lack the authority to access more advanced upgrades.
 <</if>>
 
 <br>
@@ -399,41 +400,41 @@ Considering the current upgrades the maximum level of crime is <<print $crimeCap
 	<<if $secUpgrades.coldstorage == 6 && $authority >= 19500 && $reqMenials > 10>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of two years.
 		<br>
-		[[Expand the cold storage facility to increase data retention to three years|securityHQ][cashX(forceNeg(Math.trunc(2400000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to three years|securityHQ][cashX(-Math.trunc(2400000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(2400000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 5 && $authority >= 19500 && $reqMenials > 10>>
 	<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of one year.
 		<br>
-		[[Expand the cold storage facility to increase data retention to two years|securityHQ][cashX(forceNeg(Math.trunc(1200000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to two years|securityHQ][cashX(-Math.trunc(1200000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(1200000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 4 && $authority >= 19500 && $reqMenials > 10>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of nine months.
 		<br>
-		[[Expand the cold storage facility to increase data retention to one year|securityHQ][cashX(forceNeg(Math.trunc(900000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to one year|securityHQ][cashX(-Math.trunc(900000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(900000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 3 && $authority > 18000 && $reqMenials > 10>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of six months.
 		<br>
-		[[Expand the cold storage facility to increase data retention to nine months|securityHQ][cashX(forceNeg(Math.trunc(600000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to nine months|securityHQ][cashX(-Math.trunc(600000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(600000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 2 && $authority > 16000 && $reqMenials > 10>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of three months.
 		<br>
-		[[Expand the cold storage facility to increase data retention to six months|securityHQ][cashX(forceNeg(Math.trunc(300000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to six months|securityHQ][cashX(-Math.trunc(300000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(300000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 1 && $authority > 14000 && $reqMenials > 10>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of one month.
 		<br>
-		[[Expand the cold storage facility to increase data retention to three months|securityHQ][cashX(forceNeg(Math.trunc(100000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Expand the cold storage facility to increase data retention to three months|securityHQ][cashX(-Math.trunc(100000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(100000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by a further 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage == 0 && $authority > 12000 && $reqMenials > 10>>
-		[[Install a cold storage facility|securityHQ][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier)), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
+		[[Install a cold storage facility|securityHQ][cashX(-Math.trunc(50000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier), "capEx"), $secUpgrades.coldstorage++, $reqMenials -= 10, $secHQUpkeep += $upgradeUpkeep, $PC.hacking += 1]]
 		<br>//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology*_HistoryDiscount*$HackingSkillMultiplier))>>. Will lower the amount of required slaves by 10, but will increase upkeep.//
 	<<elseif $secUpgrades.coldstorage > 6>>
 		<br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of three years.
 	<<elseif $reqMenials <= 10>>
 		<br>Personnel cannot be further reduced.
 	<<else>>
-		<br>You lack the reputation to access more advanced upgrades.
+		<br>You lack the authority to access more advanced upgrades.
 	<</if>>
 <</if>>
diff --git a/src/SecExp/weaponsManufacturing.tw b/src/SecExp/weaponsManufacturing.tw
index fd1a5d996ed..20df5947191 100644
--- a/src/SecExp/weaponsManufacturing.tw
+++ b/src/SecExp/weaponsManufacturing.tw
@@ -99,7 +99,6 @@ You own <<print num($menials)>> free menial slaves. This manufacturing complex c
 	<</link>>
 <</if>>
 <br>
-<br>
 <<if $weapProductivity < 5>>
 	<<link "Invest in automating the complex">>
 		<<run cashX(forceNeg(10000 * $weapProductivity), "capEx")>>
@@ -241,11 +240,10 @@ __Upgrades__:
 	<<else>>
 		You have fully upgraded the security drones.
 	<</if>>
-	<br><br>
+	<br>
 	/* human troops upgrades */
 	<br>Troops:
-	<br>
-	<<if !$completedUpgrades.includes(0)>>
+	<<if !$completedUpgrades.includes(0)>> <br>
 		<<link "Develop magnetic based ballistic weaponry">>
 			<<set $currentUpgrade = {
 				ID: 0,
@@ -328,8 +326,7 @@ __Upgrades__:
 		<</link>>
 		<br>//Will take _time weeks, cost <<print cashFormat(120000*$HackingSkillMultiplier)>> and will increase the base hp and morale values of human troops.//
 	<</if>>
-	<br>
-	<<if $SF.Toggle && $SF.Active >= 1>>
+	<<if $SF.Toggle && $SF.Active >= 1>> <br>
 		<<if !$completedUpgrades.includes(6) && $weapLab >= 2 && $SFSupportLevel >= 2 && $SF.Squad.Firebase >= 7>>
 			<br>
 			<<link "Develop combined training regimens with $SF.Lower">>
diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js
index 57f05c859dc..48d56b44370 100644
--- a/src/SpecialForce/SpecialForce.js
+++ b/src/SpecialForce/SpecialForce.js
@@ -1,8 +1,10 @@
 // V=SugarCube.State.variables, T=SugarCube.State.temporary;
 App.SF.Init = function() {
 	const V = State.variables;
-	if (passage() === "init" || passage() === "New Game Plus") V.SF = {Active: -1};
 	V.SF.Toggle = V.SF.Toggle || 0;
+	if (passage() === "init" || passage() === "New Game Plus") {
+		V.SF = {Active: -1, Toggle:V.SF.Toggle};
+	}
 	V.SF.FS = V.SF.FS || {};
 	V.SF.FS.Tension = V.SF.FS.Tension || -1;
 	if (V.SF.Toggle && V.SF.Active >= 1) {
-- 
GitLab