From a4c440bc6b7e60bbd7f2dfb67ede62914953afd7 Mon Sep 17 00:00:00 2001
From: Sotisi <Sotisi@tzi.de>
Date: Wed, 13 Dec 2017 20:46:06 +0100
Subject: [PATCH] consolidated $FSGotRepCredit variables.

---
 src/events/intro/initNationalities.tw       |  3 +-
 src/init/storyInit.tw                       |  7 +--
 src/uncategorized/BackwardsCompatibility.tw | 20 +++++--
 src/uncategorized/fsDevelopments.tw         | 64 ++++++++++-----------
 src/uncategorized/futureSocities.tw         | 14 ++---
 5 files changed, 58 insertions(+), 50 deletions(-)

diff --git a/src/events/intro/initNationalities.tw b/src/events/intro/initNationalities.tw
index 5bb9b85f0b5..7b7fcbf39f6 100644
--- a/src/events/intro/initNationalities.tw
+++ b/src/events/intro/initNationalities.tw
@@ -47,6 +47,7 @@
 <<elseif $PC.rumor == "social engineering">>
 	<<set $FSAnnounced = 1>>
 	<<set $FSCredits = 1>>
+	<<set $FSGotRepCredits = 1>>
 <<elseif $PC.rumor == "luck">>
 	<<set $rep += 4000>>
 <</if>>
@@ -583,7 +584,7 @@
 				<<set $activeArcology.FSNull = 20>>
 			<</switch>>
 			<<if $PC.rumor == "social engineering">>
-				<<set $FSGotRepCreditOne = 1>>
+				<<set $FSGotRepCredits = 1>>
 			<</if>>
 		<</if>>
 	<<else>>
diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 4ef56629193..aa5e39bc394 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -561,12 +561,7 @@ DairyRestraintsSetting($dairyRestraintsSetting)
 <<set $FSCredits = 0>>
 <<set $FSCreditCount = 5>>
 <<set $FSCreditCountString = "five">>
-<<set $FSGotRepCreditOne = 0>>
-<<set $FSGotRepCreditTwo = 0>>
-<<set $FSGotRepCreditThree = 0>>
-<<set $FSGotRepCreditFour = 0>>
-<<set $FSGotRepCreditFive = 0>>
-<<set $FSGotRepCreditSix = 0>>
+<<set $FSGotRepCredits = 0>>
 <<set $FSSingleSlaveRep = 10>>
 <<set $FSSpending = 0>>
 <<set $FSLockinLevel = 100>>
diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw
index 512a1d72b97..ff5e5179461 100644
--- a/src/uncategorized/BackwardsCompatibility.tw
+++ b/src/uncategorized/BackwardsCompatibility.tw
@@ -503,11 +503,23 @@
 <<if ndef $FSCreditCountString>>
 	<<set $FSCreditCountString = "five">>
 <</if>>
-<<if ndef $FSGotRepCreditFive>>
-	<<set $FSGotRepCreditFive = 0>>
+<<if ndef $FSGotRepCredits>>
+	<<if def $FSGotRepCreditSix && $FSGotRepCreditSix == 1>>
+		<<set $FSGotRepCredits = 7>>
+	<<elseif def $FSGotRepCreditFive && $FSGotRepCreditFive == 1>>
+		<<set $FSGotRepCredits = 6>>
+	<<elseif def $FSGotRepCreditFour && $FSGotRepCreditFour == 1>>
+		<<set $FSGotRepCredits = 5>>
+	<<elseif def $FSGotRepCreditThree && $FSGotRepCreditThree == 1>>
+		<<set $FSGotRepCredits = 4>>
+	<<elseif def $FSGotRepCreditTwo && $FSGotRepCreditTwo == 1>>
+		<<set $FSGotRepCredits = 3>>
+	<<elseif def $FSGotRepCreditOne && $FSGotRepCreditOne == 1>>
+		<<set $FSGotRepCredits = 2>>
+	<<elseif def $FSAnnounced && $FSAnnounced == 1>>
+		<<set $FSGotRepCredits = 1>>
+	<</if>
 <</if>>
-<<if ndef $FSGotRepCreditSix>>
-	<<set $FSGotRepCreditSix = 0>>
 <</if>>
 <<if ndef $makeDicks>>
 	<<set $makeDicks = 0>>
diff --git a/src/uncategorized/fsDevelopments.tw b/src/uncategorized/fsDevelopments.tw
index 9df3f0ce8ba..5f1cbfbe862 100644
--- a/src/uncategorized/fsDevelopments.tw
+++ b/src/uncategorized/fsDevelopments.tw
@@ -8,132 +8,132 @@
 <</if>>
 
 <<if $FSCreditCount == 4>>
-	<<if ($FSGotRepCreditOne != 1)>>
+	<<if ($FSGotRepCredits <= 1)>>
 	<<if ($rep > 7000)>>
 		@@.yellow;Your reputation is so solid that $arcologies[0].name's society is ready to begin accepting a second societal direction.@@
-		<<set $FSGotRepCreditOne = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditTwo != 1)>>
+	<<if ($FSGotRepCredits <= 2)>>
 	<<if ($rep > 11000)>>
 		@@.yellow;Your reputation is so high that $arcologies[0].name's society is ready to begin accepting a third societal direction.@@
-		<<set $FSGotRepCreditTwo = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditThree != 1)>>
+	<<if ($FSGotRepCredits <= 3)>>
 	<<if ($rep > 15000)>>
 		@@.yellow;Your reputation is so unparalleled that $arcologies[0].name's society is ready to begin accepting a fourth and final societal direction.@@
-		<<set $FSGotRepCreditThree = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
 <<elseif $FSCreditCount == 5>>
-	<<if ($FSGotRepCreditOne != 1)>>
+	<<if ($FSGotRepCredits <= 1)>>
 	<<if ($rep > 6000)>>
 		@@.yellow;Your reputation is so solid that $arcologies[0].name's society is ready to begin accepting a second societal direction.@@
-		<<set $FSGotRepCreditOne = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditTwo != 1)>>
+	<<if ($FSGotRepCredits <= 2)>>
 	<<if ($rep > 9000)>>
 		@@.yellow;Your reputation is so high that $arcologies[0].name's society is ready to begin accepting a third societal direction.@@
-		<<set $FSGotRepCreditTwo = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditThree != 1)>>
+	<<if ($FSGotRepCredits <= 3)>>
 	<<if ($rep > 12000)>>
 		@@.yellow;Your reputation is so great that $arcologies[0].name's society is ready to begin accepting a fourth societal direction.@@
-		<<set $FSGotRepCreditThree = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditFour != 1)>>
+	<<if ($FSGotRepCredits <= 4)>>
 	<<if ($rep > 15000)>>
 		@@.yellow;Your reputation is so unparalleled that $arcologies[0].name's society is ready to begin accepting a fifth and final societal direction.@@
-		<<set $FSGotRepCreditFour = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
 <<elseif $FSCreditCount == 6>>
-	<<if ($FSGotRepCreditOne != 1)>>
+	<<if ($FSGotRepCredits <= 1)>>
 	<<if ($rep > 6000)>>
 		@@.yellow;Your reputation is so solid that $arcologies[0].name's society is ready to begin accepting a second societal direction.@@
 		<<set $FSGotRepCreditOne = 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditTwo != 1)>>
+	<<if ($FSGotRepCredits <= 2)>>
 	<<if ($rep > 9000)>>
 		@@.yellow;Your reputation is so high that $arcologies[0].name's society is ready to begin accepting a third societal direction.@@
 		<<set $FSGotRepCreditTwo = 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditThree != 1)>>
+	<<if ($FSGotRepCredits <= 3)>>
 	<<if ($rep > 12000)>>
 		@@.yellow;Your reputation is so great that $arcologies[0].name's society is ready to begin accepting a fourth societal direction.@@
 		<<set $FSGotRepCreditThree = 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditFour != 1)>>
+	<<if ($FSGotRepCredits <= 4)>>
 	<<if ($rep > 15000)>>
 		@@.yellow;Your reputation is so excellent that $arcologies[0].name's society is ready to begin accepting a fifth societal direction.@@
 		<<set $FSGotRepCreditFour = 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditFive != 1)>>
+	<<if ($FSGotRepCredits <= 5)>>
 	<<if ($rep > 18000)>>
 		@@.yellow;Your reputation is so unparalleled that $arcologies[0].name's society is ready to begin accepting a sixth and final societal direction.@@
-		<<set $FSGotRepCreditFive = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
 <<elseif $FSCreditCount == 7>>
-	<<if ($FSGotRepCreditOne != 1)>>
+	<<if ($FSGotRepCredits <= 1)>>
 	<<if ($rep > 6000)>>
 		@@.yellow;Your reputation is so solid that $arcologies[0].name's society is ready to begin accepting a second societal direction.@@
-		<<set $FSGotRepCreditOne = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditTwo != 1)>>
+	<<if ($FSGotRepCredits <= 2)>>
 	<<if ($rep > 9000)>>
 		@@.yellow;Your reputation is so high that $arcologies[0].name's society is ready to begin accepting a third societal direction.@@
-		<<set $FSGotRepCreditTwo = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditThree != 1)>>
+	<<if ($FSGotRepCredits <= 3)>>
 	<<if ($rep > 12000)>>
 		@@.yellow;Your reputation is so remarkable that $arcologies[0].name's society is ready to begin accepting a fourth societal direction.@@
-		<<set $FSGotRepCreditThree = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditFour != 1)>>
+	<<if ($FSGotRepCredits <= 4)>>
 	<<if ($rep > 15000)>>
 		@@.yellow;Your reputation is so great that $arcologies[0].name's society is ready to begin accepting a fifth societal direction.@@
-		<<set $FSGotRepCreditFour = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditFive != 1)>>
+	<<if ($FSGotRepCredits <= 5)>>
 	<<if ($rep > 17000)>>
 		@@.yellow;Your reputation is so excellent that $arcologies[0].name's society is ready to begin accepting a sixth societal direction.@@
-		<<set $FSGotRepCreditFive = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
-	<<if ($FSGotRepCreditSix != 1)>>
+	<<if ($FSGotRepCredits <= 6)>>
 	<<if ($rep > 19000)>>
 		@@.yellow;Your reputation is so unparalleled that $arcologies[0].name's society is ready to begin accepting a seventh and final societal direction.@@
-		<<set $FSGotRepCreditSix = 1>>
+		<<set $FSGotRepCredits += 1>>
 		<<set $FSCredits += 1>>
 	<</if>>
 	<</if>>
diff --git a/src/uncategorized/futureSocities.tw b/src/uncategorized/futureSocities.tw
index 38aaf165344..daf35e0da94 100644
--- a/src/uncategorized/futureSocities.tw
+++ b/src/uncategorized/futureSocities.tw
@@ -173,7 +173,7 @@
 
 <<if $FSCredits > 0>>
 	@@.yellow;$arcologies[0].name's society is ready to begin accepting a new societal direction.@@
-<<elseif $FSGotRepCreditTwo == 1>>
+<<elseif $FSGotRepCredits >= 3>>
 	Your society is so radically changed that it is starting to take on a life of its own. The major decisions about its direction have been made.
 <<else>>
 	You must develop your reputation further for $arcologies[0].name's society to be ready for a new societal direction.
@@ -430,17 +430,17 @@
 <</if>>
 
 You have unlocked
-<<if ($FSGotRepCreditSix == 1)>>
+<<if ($FSGotRepCredits == 7)>>
 	__seven of <<print $FSCreditCountString>>__
-<<elseif ($FSGotRepCreditFive == 1)>>
+<<elseif ($FSGotRepCredits == 6)>>
 	__six of <<print $FSCreditCountString>>__
-<<elseif ($FSGotRepCreditFour == 1)>>
+<<elseif ($FSGotRepCredits == 5)>>
 	__five of <<print $FSCreditCountString>>__
-<<elseif ($FSGotRepCreditThree == 1)>>
+<<elseif ($FSGotRepCredits == 4)>>
 	__four of <<print $FSCreditCountString>>__
-<<elseif ($FSGotRepCreditTwo == 1)>>
+<<elseif ($FSGotRepCredits == 3)>>
 	__three of <<print $FSCreditCountString>>__
-<<elseif ($FSGotRepCreditOne == 1)>>
+<<elseif ($FSGotRepCredits == 2)>>
 	__two of <<print $FSCreditCountString>>__
 <<else>>
 	__one of <<print $FSCreditCountString>>__
-- 
GitLab