From 1e86537d5d302b4ee7b35ef78c59dbc3eb708dd8 Mon Sep 17 00:00:00 2001
From: j <okp57855@psoxs.com>
Date: Sat, 27 Jan 2018 21:03:23 +1300
Subject: [PATCH] Convert to JS check.

---
 src/SecExp/propagandaHub.tw                   |  8 -----
 src/SecExp/riotControlCenter.tw               |  8 -----
 src/SecExp/secBarracks.tw                     |  8 -----
 src/SecExp/securityHQ.tw                      |  8 -----
 src/js/utilJS.tw                              | 32 +++++++++++++++++++
 .../SecForceEX/SpecialForceUpgradeOptions.tw  |  8 -----
 src/uncategorized/manageArcology.tw           |  8 -----
 src/uncategorized/personalAssistantOptions.tw | 10 ------
 8 files changed, 32 insertions(+), 58 deletions(-)

diff --git a/src/SecExp/propagandaHub.tw b/src/SecExp/propagandaHub.tw
index a1a9ac1ab4f..03317a392c7 100644
--- a/src/SecExp/propagandaHub.tw
+++ b/src/SecExp/propagandaHub.tw
@@ -1,13 +1,5 @@
 :: propagandaHub [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
-<<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<if $career == "capitalist" || $career == "celebrity" || $career == "wealth">>
 	<<set _HistoryDiscount = .5>>
 <<else>>
diff --git a/src/SecExp/riotControlCenter.tw b/src/SecExp/riotControlCenter.tw
index f345f585be2..9d53e2aaffa 100644
--- a/src/SecExp/riotControlCenter.tw
+++ b/src/SecExp/riotControlCenter.tw
@@ -1,13 +1,5 @@
 :: riotControlCenter [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
-<<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">>
 
 Riot Control Center
diff --git a/src/SecExp/secBarracks.tw b/src/SecExp/secBarracks.tw
index 7e4e54e1268..4d216954610 100644
--- a/src/SecExp/secBarracks.tw
+++ b/src/SecExp/secBarracks.tw
@@ -1,13 +1,5 @@
 :: secBarracks [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
-<<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">>
 
 The Barracks
diff --git a/src/SecExp/securityHQ.tw b/src/SecExp/securityHQ.tw
index 829d91e845d..78996e8bc71 100644
--- a/src/SecExp/securityHQ.tw
+++ b/src/SecExp/securityHQ.tw
@@ -1,13 +1,5 @@
 :: securityHQ [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
-<<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<if $career == "mercenary" || $career == "gang" || $career == "slaver">>
 	<<set _HistoryDiscount = .5>>
 <<else>>
diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw
index e3a908dc921..d319835ac5b 100644
--- a/src/js/utilJS.tw
+++ b/src/js/utilJS.tw
@@ -432,3 +432,35 @@ if(typeof Categorizer === 'function') {
 }
 */
 jQuery(document).trigger('categorizer.ready');
+
+window.bellyAdjective = 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);
+	}
+}
\ No newline at end of file
diff --git a/src/pregmod/SecForceEX/SpecialForceUpgradeOptions.tw b/src/pregmod/SecForceEX/SpecialForceUpgradeOptions.tw
index fe10a91b3b7..f840ed1bf93 100755
--- a/src/pregmod/SecForceEX/SpecialForceUpgradeOptions.tw
+++ b/src/pregmod/SecForceEX/SpecialForceUpgradeOptions.tw
@@ -1,13 +1,5 @@
 :: SpecialForceUpgradeOptions
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
-<<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<nobr>>
 <<if ($SFAO < _max) && $securityForceUpgradeToken == 0>>
 <span id="resultX">
diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw
index 3772ae29d1d..a9c1e6ba566 100644
--- a/src/uncategorized/manageArcology.tw
+++ b/src/uncategorized/manageArcology.tw
@@ -1,13 +1,5 @@
 :: Manage Arcology [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $PC.technician = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
- <<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
 <<set $nextButton = "Back", $nextLink = "Main">>
 
 <<if $cheatMode == 1>>
diff --git a/src/uncategorized/personalAssistantOptions.tw b/src/uncategorized/personalAssistantOptions.tw
index 9a7acfbf192..302664e6ccd 100644
--- a/src/uncategorized/personalAssistantOptions.tw
+++ b/src/uncategorized/personalAssistantOptions.tw
@@ -1,15 +1,5 @@
 :: Personal assistant options [nobr]
 
-<<if $PC.technician <= -100>>
-	<<set $TechnicianSkillEffect = 1.5>>
-<<elseif $PC.technician >= 100>>
-	<<set $TechnicianSkillEffect = .5>>
- <<else>>
-	<<set $TechnicianSkillEffect = 1>>
-<</if>>
-
- /* <<elseif $PC.technician > -100 && $PC.technician < 100>> */
-
 <<set $nextButton = "Back", $nextLink = "Main">>
 
 <<if $marketAssistantLimit>><<set $marketAssistantLimit to Math.clamp($marketAssistantLimit, 10000, 10000000)>><</if>>
-- 
GitLab