From 744965620317683f51027784de52196d3e948d65 Mon Sep 17 00:00:00 2001
From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io>
Date: Thu, 10 Oct 2019 20:13:30 -0700
Subject: [PATCH] Sec exp hotfix+art tools mode revert

---
 artTools/normalize_svg.py              |   0
 artTools/vector_clothing_replicator.py |   0
 artTools/vector_layer_split.py         |   0
 artTools/vector_revamp_layer_split.py  |   0
 src/js/economyJS.js                    |   9 +-
 src/uncategorized/repBudget.tw         |   4 +-
 src/uncategorized/storyCaption.tw      | 150 ++++++++++++-------------
 7 files changed, 78 insertions(+), 85 deletions(-)
 mode change 100644 => 100755 artTools/normalize_svg.py
 mode change 100644 => 100755 artTools/vector_clothing_replicator.py
 mode change 100644 => 100755 artTools/vector_layer_split.py
 mode change 100644 => 100755 artTools/vector_revamp_layer_split.py

diff --git a/artTools/normalize_svg.py b/artTools/normalize_svg.py
old mode 100644
new mode 100755
diff --git a/artTools/vector_clothing_replicator.py b/artTools/vector_clothing_replicator.py
old mode 100644
new mode 100755
diff --git a/artTools/vector_layer_split.py b/artTools/vector_layer_split.py
old mode 100644
new mode 100755
diff --git a/artTools/vector_revamp_layer_split.py b/artTools/vector_revamp_layer_split.py
old mode 100644
new mode 100755
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 8d99ccc0fe0..06c866d0a9a 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -232,9 +232,8 @@ window.calculateCosts = (function() {
 	// security expansion
 	function getSecurityExpansionCost() {
 		const V = State.variables;
-		let secExpCost = 0;
-		let soldierMod = 0;
-		if (V.secExpEnabled === 1) {
+		let secExpCost = 0, soldierMod = 0;
+		if (V.secExpEnabled > 0) {
 			secExpCost += App.SecExp.upkeep('edictsCash');
 			secExpCost += App.SecExp.upkeep('SF');
 			secExpCost += App.SecExp.upkeep('buildings');
@@ -457,8 +456,8 @@ window.calculateCosts = (function() {
 		return cost;
 	}
 
-	function getEnvironmentCosts(cost) {
-		if (State.variables.secExpEnabled === 1) {
+	function getEnvironmentCosts(cost = 0) {
+		if (State.variables.secExpEnabled > 0) {
 			if (State.variables.terrain === 'oceanic' || State.variables.terrain === 'marine') {
 				if (State.variables.docks > 0) {
 					cost *= (1 - State.variables.docks * 0.05);
diff --git a/src/uncategorized/repBudget.tw b/src/uncategorized/repBudget.tw
index c1eeedf9134..5868ab27f68 100644
--- a/src/uncategorized/repBudget.tw
+++ b/src/uncategorized/repBudget.tw
@@ -127,7 +127,7 @@ for (var i = 0; i < State.variables.lastWeeksRepIncome.length; i++){
 	</tr>
 
 	<<print budgetLine("policies", "Capital expenses")>>
-	<<print budgetLine("edicts", "<<if $secExpEnabled>>[[Edicts|edicts]]<<else>>Edicts<</if>>")>>
+	<<print budgetLine("edicts", "<<if $secExpEnabled > 0>>[[Edicts|edicts]]<<else>>Edicts<</if>>")>>
 
 	<<print budgetLine("capEx", "[[Policies|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]] and [[Edicts|edicts][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]")>>
 
@@ -142,6 +142,8 @@ for (var i = 0; i < State.variables.lastWeeksRepIncome.length; i++){
 
 	<<print budgetLine("specialForces", "Special forces")>>
 
+	<<print budgetLine("securityExpansion", "securityExpansion")>>
+
 	<<print budgetLine("peacekeepers", "Peacekeepers")>>
 
 	<<print budgetLine("war", "Conflict")>>
diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw
index 262bc01f39c..1cf0d746140 100644
--- a/src/uncategorized/storyCaption.tw
+++ b/src/uncategorized/storyCaption.tw
@@ -2,65 +2,61 @@
 
 <<set _Pass = passage()>>
 <<widget "userButton">>
-	/*Don't remove these spans, it will break things.*/
-	<<if _Pass !== "End Week">>
-		<<if _Pass !== "Encyclopedia">> <br><br> <</if>>
-		<<if _Pass === "Main" && $nextButton === "END WEEK">>
-			<span id="endWeekButton"> <strong>
-			<<link [[END WEEK|End Week]]>><</link>>
-			</strong> </span> @@.cyan;[Ent]@@
+	/* Must use link so spacebar shortcut will work. */
+	/* Don't remove these spans, it will break things. */
+	<<if _Pass != "End Week">>
+		<<if _Pass == "Main">>
+			<strong> <span id="endWeekButton"> <br><br>
+			<<link "$nextButton">> <<goto $nextLink>> <</link>> @@.cyan;[Ent]@@
+			</span> </strong>
 			<<if $rulesError && $rulesAssistantAuto == 1>>
-				<br>@@.yellow; WARNING: some custom rules will change slave variables@@
+				<br>@@.yellow;WARNING: some custom rules will change slave variables@@
 			<</if>>
 		<<else>>
-			<span id="nextButton">
-			<<if $nextButton !== " ">>
-				<strong>
-				<<if _Pass !== "Encyclopedia">> /* must use link so spacebar shortcut will work */
-					<<link "$nextButton">> <<goto $nextLink>> <</link>>
-				<<else>>
-					<<link [[Back to Free Cities|$nextLink]]>><</link>>
-				<</if>>
-				</strong> @@.cyan;[Space]@@
+			<strong> <span id="nextButton"> <<if $nextButton != " ">> <br><br>
+				<<link "$nextButton">> <<goto $nextLink>> <</link>> @@.cyan;[Space]@@
 			<</if>>
-			</span>
-		<</if>>
-		<br>
-	<</if>>
+			</span> </strong> <</if>>
+	<</if>> <br>
 <</widget>>
 
-<<widget "security">> <br>
-	<<if $SF.Toggle && $SF.Active >= 1 && _Pass !== "Firebase">>
+<<widget "security">>
+	<<if ($SF.Toggle && $SF.Active >= 1) || $secExpEnabled > 0 && ($SecExp.buildings.propHub.active + $secHQ + $SecExp.buildings.barracks.active  + $riotCenter) > 1>>
+		<br>
+	<</if>>
+	<<if $SF.Toggle && $SF.Active >= 1 && _Pass != "Firebase">>
 		<span id="SFMButton"> <br>
 			<<link "$SF.Caps's firebase""Firebase">><</link>>
 		</span> @@.cyan;[Z]@@
 	<</if>>
 
-	<<if $SecExp.buildings.propHub.active > 0 && _Pass !== "propagandaHub">>
-		<span id="propHub"> <br>
-			<<link [[Manage PR|propagandaHub]]>><</link>>
-		</span> @@.cyan;[Shift+H]@@
-	<</if>>
-	<<if $secHQ > 0 && _Pass !== "securityHQ">>
-		<span id="securityHQ"> <br>
-			<<link [[Manage Security|securityHQ]]>><</link>>
-		</span> @@.cyan;[Shift+S]@@
-	<</if>>
+	<<if $secExpEnabled > 0>>
+		<<if $SecExp.buildings.propHub.active > 0 && _Pass != "propagandaHub">>
+			<span id="propHub"> <br>
+				<<link [[Manage PR|propagandaHub]]>><</link>>
+			</span> @@.cyan;[Shift+H]@@
+		<</if>>
+		<<if $secHQ > 0 && _Pass != "securityHQ">>
+			<span id="securityHQ"> <br>
+				<<link [[Manage Security|securityHQ]]>><</link>>
+			</span> @@.cyan;[Shift+S]@@
+		<</if>>
 
-	<<if $SecExp.buildings.barracks.active > 0 && _Pass !== "secBarracks">>
-		<span id="secBarracks"> <br>
-			<<link [[Manage Military|secBarracks]]>><</link>>
-		</span> @@.cyan;[Shift+A]@@
-	<</if>>
-	<<if $riotCenter > 0 && _Pass !== "riotControlCenter">>
-		<span id="riotCenter"> <br>
-			<<link [[Manage Rebels|riotControlCenter]]>><</link>>
-		</span> @@.cyan;[Shift+R]@@
+		<<if $SecExp.buildings.barracks.active > 0 && _Pass != "secBarracks">>
+			<span id="secBarracks"> <br>
+				<<link [[Manage Military|secBarracks]]>><</link>>
+			</span> @@.cyan;[Shift+A]@@
+		<</if>>
+		<<if $riotCenter > 0 && _Pass != "riotControlCenter">>
+			<span id="riotCenter"> <br>
+				<<link [[Manage Rebels|riotControlCenter]]>><</link>>
+			</span> @@.cyan;[Shift+R]@@
+		<</if>>
 	<</if>>
 <</widget>>
 
 <<if $ui != "start" || _Pass === "Encyclopedia">>
- <<if _Pass !== "Encyclopedia">>
+ <<if _Pass != "Encyclopedia">>
 		<<if $cheatMode || $debugMode>> _Pass<br> <</if>>
 		<span id="week">''Week $week''</span>
 		<<if $week > 52>> (<<= years($week)>>) <</if>>
@@ -75,17 +71,14 @@
 			<</link>>
 		<</if>>
 		<br>
-		<<if $weatherToday.severity == 1>>
-			//@@.cyan;$weatherToday.name@@//
-		<<elseif $weatherToday.severity == 2>>
-			//@@.yellow;$weatherToday.name@@//
-		<<elseif $weatherToday.severity == 3>>
-			//@@.orange;$weatherToday.name@@//
-		<<else>>
-			//@@.red;$weatherToday.name@@//
+		<<if $weatherToday.severity == 1>> //@@.cyan;
+		<<elseif $weatherToday.severity == 2>> //@@.yellow;
+		<<elseif $weatherToday.severity == 3>> //@@.orange;
+		<<else>> //@@.red;
 		<</if>>
+		$weatherToday.name@@//
 	<</if>>
-	<<userButton>>
+	<<if _Pass != "End Week">> <<userButton>> <</if>>
 <</if>>
 
 <<if _Pass == "Encyclopedia">> <br>
@@ -113,7 +106,7 @@
 	<span id="cost"><<SlaveCostDescription>></span> <br><br>
 <</if>>
 
-<<if $ui != "start" && _Pass !== "Encyclopedia">> <br>
+<<if $ui != "start" && _Pass != "Encyclopedia">>
 	<<if $sideBarOptions.Cash > 0>>
 		<<set $cash = Math.trunc($cash)>>
 		<span id="cash">
@@ -171,9 +164,7 @@
 			<<else>>
 				@@.red;Food@@
 			<</if>>
-			<<if $food < 0>>
-				<<set $food = 0>>
-			<</if>>
+			<<if $food < 0>> <<set $food = 0>> <</if>>
 			| <<print massFormat($food)>>
 			</span>
 
@@ -181,10 +172,11 @@
 			<<set _TFood2 = ($food-$foodLastWeek)>>
 			<span id="oldfood">
 			<<if _TFood2 < 0>>
-				(@@.red;<<print massFormat(_TFood2)>>@@
+				(@@.red;
 			<<else>>
-				(@@.chocolate;+<<print massFormat(_TFood2)>>@@
+				(@@.chocolate;+
 			<</if>>
+			<<print massFormat(_TFood2)>>@@)
 			</span>
 			since last week)
 			<<if ($cheatMode) && ($cheatModeM)>>
@@ -247,8 +239,8 @@
 		<br>@@.pink;Luxury Rooms@@ | <<if $roomsPopulation > $rooms>>@@.red;<<print $roomsPopulation>>@@<<else>><<print $roomsPopulation>><</if>>/<<print $rooms>>
 	<</if>>
 
-	<<if _Pass !== "Manage Penthouse">>
-		<<if $sideBarOptions.GSP > 0 && _Pass !== "Neighbor Interact">> <br>
+	<<if _Pass != "Manage Penthouse">>
+		<<if $sideBarOptions.GSP > 0 && _Pass != "Neighbor Interact">> <br>
 			@@.yellowgreen;GSP@@ |
 			<<print Math.trunc(0.1*$arcologies[0].prosperity)>>m
 			<<if $arcologies[0].ownership >= $arcologies[0].minority>>
@@ -382,7 +374,7 @@
 			<</if>>
 		<</if>>
 
-		<<if $secExpEnabled == 1 && ( $sideBarOptions.Authority > 0 || $sideBarOptions.Security > 0 || $sideBarOptions.Crime > 0)>>
+		<<if $secExpEnabled > 0 && ($sideBarOptions.Authority + $sideBarOptions.Security + $sideBarOptions.Crime > 0)>>
 			<<if $sideBarOptions.Authority > 0>> <br>
 				@@.darkviolet;Auth@@ |
 				<<set $SecExp.core.authority = Math.clamp(Math.trunc($SecExp.core.authority), 0, 20000)>>
@@ -521,26 +513,26 @@
 			<</if>>
 
 		<</if>> /* Closes secExp check and associated sideBarOptions options */
-	<</if>> /* Closes Pass !== "Manage Penthouse""*/
+	<</if>> /* Closes Pass != "Manage Penthouse""*/
 
-	<<if $nextButton !== "Continue" && $nextButton !== " ">> <br>
-		<<if _Pass !== "Manage Penthouse">> <br>
+	<<if $nextButton != "Continue" && $nextButton != " ">> <br>
+		<<if _Pass != "Manage Penthouse">> <br>
 			<span id="managePenthouse">
 				<<link [[Manage Penthouse]]>><</link>>
 			</span> @@.cyan;[P]@@
 		<</if>>
-		<<if _Pass !== "Manage Arcology">> <br>
+		<<if _Pass != "Manage Arcology">> <br>
 			<span id="manageArcology">
 				<<link [[Manage Arcology]]>><</link>>
 			</span> @@.cyan;[C]@@
 		<</if>>
 
-		<<if _Pass !== "Manage Personal Affairs">>
+		<<if _Pass != "Manage Personal Affairs">>
 			<span id="managePerson"> <br>
 				<<link [[Manage Personal Affairs]]>><</link>>
 			</span> @@.cyan;[X]@@
 		<</if>>
-		<<if $corpAnnounced == 1 && _Pass !== "Manage Corporation">>
+		<<if $corpAnnounced == 1 && _Pass != "Manage Corporation">>
 			<span id="manageCorporation"> <br>
 				<<link [[Manage Corporation][$nextButton = "Back", $nextLink = _Pass]]>><</link>>
 			</span>
@@ -705,7 +697,7 @@
 				<<link [[Policies]]>><</link>>
 			</span> @@.cyan;[Y]@@
 
-			<<if $secExpEnabled == 1>>
+			<<if $secExpEnabled > 0>>
 				<span id="edictButton"> <br>
 					<<link [[Edicts|edicts]]>><</link>>
 				</span> @@.cyan;[D]@@
@@ -715,7 +707,7 @@
 			<</if>>
 
 			<span id="Security">
-			<<if $secExpEnabled > 0 && ($SecExp.buildings.propHub.active > 0 || $secHQ > 0 || $SecExp.buildings.barracks.active > 0 || $riotCenter > 0) || $SF.Toggle && $SF.Active >= 1>> <br>
+			<<if ($secExpEnabled > 0 && ($SecExp.buildings.propHub.active + $secHQ + $SecExp.buildings.barracks.active + $riotCenter > 0)) || $SF.Toggle && $SF.Active >= 1>> <br>
 				<<link "Manage Security">> <<replace "#Security">>
 					<<security>>
 				<</replace>> <</link>>
@@ -745,11 +737,11 @@
 			<</if>>
 
 		<<elseif ["Dispensary", "Organ Farm", "Implant Manufactory", "Gene Lab", "Prosthetic Lab"].includes(_Pass)>>
-			<<if $dispensary && _Pass !== "Dispensary">> <br>[[Pharmaceutical Fabricator|Dispensary]]<</if>>
-			<<if $organFarmUpgrade && _Pass !== "Organ Farm">> <br>[[Organ Farm]]<</if>>
-			<<if $ImplantProductionUpgrade && _Pass !== "Implant Manufactory">> <br>[[Implant Manufactory]]<</if>>
-			<<if $geneticMappingUpgrade && _Pass !== "Gene Lab">> <br>[[Gene Lab]]<</if>>
-			<<if $prostheticsUpgrade && _Pass !== "Prosthetic Lab">> <br>[[Prosthetic Lab]]<</if>>
+			<<if $dispensary && _Pass != "Dispensary">> <br>[[Pharmaceutical Fabricator|Dispensary]]<</if>>
+			<<if $organFarmUpgrade && _Pass != "Organ Farm">> <br>[[Organ Farm]]<</if>>
+			<<if $ImplantProductionUpgrade && _Pass != "Implant Manufactory">> <br>[[Implant Manufactory]]<</if>>
+			<<if $geneticMappingUpgrade && _Pass != "Gene Lab">> <br>[[Gene Lab]]<</if>>
+			<<if $prostheticsUpgrade && _Pass != "Prosthetic Lab">> <br>[[Prosthetic Lab]]<</if>>
 
 		<<elseif _Pass == "Rules Assistant">> <br>
 			[[Rules Assistant Summary]]
@@ -768,20 +760,20 @@
 				<<link [[Game Options|Options][$nextButton = "Back", $nextLink = _Pass]]>><</link>>
 			</span> @@.cyan;[O]@@
 		<<else>>
-			<<if _Pass !== "Summary Options">> [[Summary Options]] <</if>>
+			<<if _Pass != "Summary Options">> [[Summary Options]] <</if>>
 			<<if _Pass === "Options">> <br> <</if>>
-			<<if _Pass !== "Description Options">> [[Description Options]] <</if>>
+			<<if _Pass != "Description Options">> [[Description Options]] <</if>>
 		<</if>>
 
-	<</if>> /* Closes nextButton !== "Continue" && nextButton !== " " */
+	<</if>> /* Closes nextButton != "Continue" && nextButton != " " */
 <</if>>
 
-<<if _Pass !== "Encyclopedia" && $showEncyclopedia > 0 && $nextButton !== "Continue">>
+<<if _Pass != "Encyclopedia" && $showEncyclopedia > 0 && $nextButton != "Continue">>
 	<<if $nextButton === " ">> <br> <</if>> <<if $ui != "start">> <br> <</if>>
 	//''FCE'':// [[$encyclopedia|Encyclopedia][$nextButton = "Back", $nextLink = _Pass]]
 <</if>>
 
-<<if $ui != "start" && _Pass !== "Encyclopedia" && $debugMode > 0>>
+<<if $ui != "start" && _Pass != "Encyclopedia" && $debugMode > 0>>
 	<br><br>Debugging Tools<br> <<link "Display Variables">><<checkvars>><</link>>
 	<br> <<link "Display Changed Variables">>
 		<<set Config.history.maxStates = 2>> /* makes sure we store the current state so we can return to it */
-- 
GitLab