From 8b916b8eb4c40e10839594b1291b2a55a9c5fc93 Mon Sep 17 00:00:00 2001
From: Jones <Jones>
Date: Fri, 9 Nov 2018 23:54:13 +0100
Subject: [PATCH] Rents etc.

---
 src/init/storyInit.tw                       |  12 +--
 src/pregmod/manageEconomy.tw                |  61 +++++++++++
 src/uncategorized/BackwardsCompatibility.tw |  36 +++----
 src/uncategorized/arcmgmt.tw                | 106 ++++++++++----------
 src/uncategorized/costsReport.tw            |   2 +-
 src/uncategorized/policies.tw               |  34 +++----
 6 files changed, 146 insertions(+), 105 deletions(-)

diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 0f60738532a..630cf16de81 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -1115,26 +1115,22 @@ DairyRestraintsSetting($dairyRestraintsSetting)
 <<set $ACitizens = 4250>>
 <<set $lowerClass = 3120>>
 <<set $LSCBase = 800>>
-<<set $LSCFS = 0>>
-<<set $LSCPolicies = 0>>
 <<set $visitors = 0>>
 <<set $welfare = 0.004>>
 <<set $rentEffectL = 1>>
+<<set $LCRent = 20>>
 <<set $middleClass = 890>>
 <<set $MCBase = 200>>
-<<set $MCFS = 0>>
-<<set $MCPolicies = 0>>
 <<set $rentEffectM = 1>>
+<<set $MCRent = 50>>
 <<set $upperClass = 200>>
 <<set $UCBase = 40>>
-<<set $UCFS = 0>>
-<<set $UCPolicies = 0>>
 <<set $rentEffectU = 1>>
+<<set $UCRent = 175>>
 <<set $topClass = 40>>
 <<set $TCBase = 20>>
-<<set $TCFS = 0>>
-<<set $TCPolicies = 0>>
 <<set $rentEffectT = 1>>
+<<set $TCRent = 650>>
 <<set $GDP = 278.6>>
 <<set $ACitizenLimit = 4800>>
 <<set $ASlaves = 900>>
diff --git a/src/pregmod/manageEconomy.tw b/src/pregmod/manageEconomy.tw
index bb05654a280..e20f39787f8 100644
--- a/src/pregmod/manageEconomy.tw
+++ b/src/pregmod/manageEconomy.tw
@@ -1,6 +1,7 @@
 :: Manage Economy [nobr]
 
 <<if $difficultySwitch == 1>>
+__Economy__<br>
 	<span id="economy">
 		@@.yellowgreen;Global Economy@@
 	| <<print $economy>>
@@ -62,6 +63,66 @@
 <br><br>	
 <</if>>
 
+__Population and Rent__<br>
+<<print $arcologies[0].name>> is home to the following;
+<<set _percACitizens = Math.trunc(($ACitizens / ($ACitizens + $ASlaves)) * 1000) / 10,
+_percASlaves = Math.trunc(($ASlaves / ($ACitizens + $ASlaves)) * 1000) / 10,
+_percLowerClass = Math.trunc(($lowerClass / ($ACitizens + $ASlaves)) * 1000) / 10,
+_percMiddleClass = Math.trunc(($middleClass / ($ACitizens + $ASlaves)) * 1000) / 10,
+_percUpperClass = Math.trunc(($upperClass / ($ACitizens + $ASlaves)) * 1000) / 10,
+_percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
+<br>Lower Class Citizens  | $lowerClass | <<print _percLowerClass>>% | Rent @@.yellowgreen;<<print cashFormat($LCRent)>>@@ 
+<<if $LCRent > 30>>
+	//Very High// | [[Decrease|Manage Economy][$LCRent = 30, $rentEffectL = 0.94]]
+<<elseif $LCRent > 20>>
+	//High// | [[Increase|Manage Economy][$LCRent = 40, $rentEffectL = 0.85]] | [[Decrease|Manage Economy][$LCRent = 20, $rentEffectL = 1]]
+<<elseif $LCRent > 10>>
+	//Average// | [[Increase|Manage Economy][$LCRent = 30, $rentEffectL = 0.94]] | [[Decrease|Manage Economy][$LCRent = 10, $rentEffectL = 1.04]]
+<<elseif $LCRent > 0>>
+	//Low// | [[Increase|Manage Economy][$LCRent = 20, $rentEffectL = 1]] | [[Free Rent|Manage Economy][$LCRent = 0, $rentEffectL = 1.1]]
+<<else>>
+	//Free// | [[Increase|Manage Economy][$LCRent = 10, $rentEffectL = 1.04]]
+<</if>>
+<br>Middle Class Citizens | $middleClass | <<print _percMiddleClass>>% | Rent @@.yellowgreen;<<print cashFormat($MCRent)>>@@
+<<if $MCRent > 75>>
+	//Very High// | [[Decrease|Manage Economy][$MCRent = 75, $rentEffectM = 0.94]]
+<<elseif $MCRent > 50>>
+	//High// | [[Increase|Manage Economy][$MCRent = 100, $rentEffectM = 0.85]] | [[Decrease|Manage Economy][$MCRent = 50, $rentEffectM = 1]]
+<<elseif $MCRent > 25>>
+	//Average// | [[Increase|Manage Economy][$MCRent = 75, $rentEffectM = 0.94]] | [[Decrease|Manage Economy][$MCRent = 25, $rentEffectM = 1.04]]
+<<elseif $MCRent > 0>>
+	//Low// | [[Increase|Manage Economy][$MCRent = 20, $rentEffectM = 1]] | [[Free Rent|Manage Economy][$MCRent = 0, $rentEffectM = 1.1]]
+<<else>>
+	//Free// | [[Increase|Manage Economy][$LCRent = 10, $rentEffectL = 1.04]]
+<</if>>
+<br>Upper Class Citizens  | $upperClass | <<print _percUpperClass>>% | Rent @@.yellowgreen;<<print cashFormat($UCRent)>>@@
+<<if $UCRent > 270>>
+	//Very High// | [[Decrease|Manage Economy][$UCRent = 270, $rentEffectU = 0.94]]
+<<elseif $UCRent > 180>>
+	//High// | [[Increase|Manage Economy][$UCRent = 360, $rentEffectU = 0.85]] | [[Decrease|Manage Economy][$UCRent = 180, $rentEffectU = 1]]
+<<elseif $UCRent > 90>>
+	//Average// | [[Increase|Manage Economy][$UCRent = 270, $rentEffectU = 0.94]] | [[Decrease|Manage Economy][$UCRent = 90, $rentEffectU = 1.04]]
+<<elseif $UCRent > 0>>
+	//Low// | [[Increase|Manage Economy][$UCRent = 180, $rentEffectU = 1]] | [[Free Rent|Manage Economy][$UCRent = 0, $rentEffectU = 1.1]]
+<<else>>
+	//Free// | [[Increase|Manage Economy][$UCRent = 90, $rentEffectU = 1.04]]
+<</if>>
+<br>Millionaires          | $topClass | <<print _percTopClass>>% | Rent @@.yellowgreen;<<print cashFormat($TCRent)>>@@
+<<if $TCRent > 975>>
+	//Very High// | [[Decrease|Manage Economy][$TCRent = 975, $rentEffectT = 0.94]]
+<<elseif $TCRent > 650>>
+	//High// | [[Increase|Manage Economy][$TCRent = 1300, $rentEffectT = 0.85]] | [[Decrease|Manage Economy][$TCRent = 650, $rentEffectT = 1]]
+<<elseif $TCRent > 325>>
+	//Average// | [[Increase|Manage Economy][$TCRent = 975, $rentEffectT = 0.94]] | [[Decrease|Manage Economy][$TCRent = 325, $rentEffectT = 1.04]]
+<<elseif $TCRent > 0>>
+	//Low// | [[Increase|Manage Economy][$TCRent = 650, $rentEffectT = 1]] | [[Free Rent|Manage Economy][$TCRent = 0, $rentEffectT = 1.1]]
+<<else>>
+	//Free// | [[Increase|Manage Economy][$TCRent = 325, $rentEffectT = 1.04]]
+<</if>>
+<br>Slaves                | $ASlaves | <<print _percASlaves>>% /*should probably include player owned slaves of all types*/
+
+<br><br>
+__Slaves__<br>
 Slave demand is 
 <<if $menialDemandFactor <= -35000>>
 	@@.red;''extremely low''@@
diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw
index be03f53de49..b30a7c1fb2c 100644
--- a/src/uncategorized/BackwardsCompatibility.tw
+++ b/src/uncategorized/BackwardsCompatibility.tw
@@ -3495,63 +3495,51 @@ Done!
 <<if ndef $LSCBase>>
 	<<set $LSCBase = 800>>
 <</if>>
-<<if ndef $LSCFS>>
-	<<set $LSCFS = 0>>
-<</if>>
-<<if ndef $LSCPolicies>>
-	<<set $LSCPolicies = 0>>
-<</if>>
 <<if ndef $welfare>>
 	<<set $welfare = 0.004>>
 <</if>>
 <<if ndef $rentEffectL>>
 	<<set $rentEffectL = 1>>
 <</if>>
+<<if ndef $LCRent>>
+	<<set $LCRent = 20>>
+<</if>>
 <<if ndef $middleClass>>
 	<<set $middleClass = 890>>
 <</if>>
 <<if ndef $MCBase>>
 	<<set $MCBase = 200>>
 <</if>>
-<<if ndef $MCFS>>
-	<<set $MCFS = 0>>
-<</if>>
-<<if ndef $MCPolicies>>
-	<<set $MCPolicies = 0>>
-<</if>>
 <<if ndef $rentEffectM>>
 	<<set $rentEffectM = 1>>
 <</if>>
+<<if ndef $MCRent>>
+	<<set $MCRent = 50>>
+<</if>>
 <<if ndef $upperClass>>
 	<<set $upperClass = 200>>
 <</if>>
 <<if ndef $UCBase>>
 	<<set $UCBase = 40>>
 <</if>>
-<<if ndef $UCFS>>
-	<<set $UCFS = 0>>
-<</if>>
-<<if ndef $UCPolicies>>
-	<<set $UCPolicies = 0>>
-<</if>>
 <<if ndef $rentEffectU>>
 	<<set $rentEffectU = 1>>
 <</if>>
+<<if ndef $UCRent>>
+	<<set $UCRent = 175>>
+<</if>>
 <<if ndef $topClass>>
 	<<set $topClass = 38>>
 <</if>>
 <<if ndef $TCBase>>
 	<<set $TCBase = 20>>
 <</if>>
-<<if ndef $TCFS>>
-	<<set $TCFS = 0>>
-<</if>>
-<<if ndef $TCPolicies>>
-	<<set $TCPolicies = 0>>
-<</if>>
 <<if ndef $rentEffectT>>
 	<<set $rentEffectT = 1>>
 <</if>>
+<<if ndef $TCRent>>
+	<<set $TCRent = 650>>
+<</if>>
 <<if ndef $GDP>>
 	<<set $GDP = 278.6>>
 <</if>>
diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw
index fb90fd427cf..b12c21a686f 100644
--- a/src/uncategorized/arcmgmt.tw
+++ b/src/uncategorized/arcmgmt.tw
@@ -24,7 +24,7 @@ _welfareFS = 1, /*changes to likelyhood of lowerclass getting enslaved*/
 _middleClass = 0, /*see lowerclass examples for the rest of these*/
 _middleClassP = 1,
 _upperClass = 0,
-_upperClassP = 0,
+_upperClassP = 1,
 _topClass = 0,
 _topClassP = 1>>
 <<if $arcologies[0].FSSupremacist != "unset">>
@@ -53,7 +53,7 @@ _topClassP = 1>>
 	_upperClassP *= 1 + Math.trunc($arcologies[0].FSSubjugationist / 20) * 0.002,
 	_topClass += Math.trunc($arcologies[0].FSSubjugationist / 20) * 0.4,
 	_topClassP *= 1 + Math.trunc($arcologies[0].FSSubjugationist / 20) * 0.004>>
-	Your racial policies are stripping all power from the $arcologies[0].FSSupremacistRace people. /*perhaps too obvious to bother with printing?*/
+	Your racial policies are stripping all power from the $arcologies[0].FSSubjugationistRace people. /*perhaps too obvious to bother with printing?*/
 <</if>>
 <<if $arcologies[0].FSGenderRadicalist != "unset">>
 	<<set _FSScore += $arcologies[0].FSGenderRadicalist,
@@ -95,7 +95,7 @@ _topClassP = 1>>
 	_slaveDemandU *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.02,
 	_slaveDemandT *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.025,
 	_expirationFS *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.1,
-	_slaveProductivity += Math.trunc($arcologies[0].FSDegradatinist / 20) * 0.01,
+	_slaveProductivity += Math.trunc($arcologies[0].FSDegradationist / 20) * 0.01,
 	_lowerClass += Math.trunc($arcologies[0].FSDegradationist / 20) * -20,
 	_lowerClassP *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * -0.004,
 	_welfareFS *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.1,
@@ -231,7 +231,7 @@ _topClassP = 1>>
 	_slaveDemandU *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.01,
 	_slaveDemandT *= 1 + Math.trunc($arcologies[0].FSDegradationist / 20) * 0.0125>>
 <</if>>
-<<if $arcologoes[0].FSAztecRevivalist != "unset">>
+<<if $arcologies[0].FSAztecRevivalist != "unset">>
 	<<set _FSScore += $arcologies[0].FSAztecRevivalist,
 	_slaveDemandU *= 1 + Math.trunc($arcologies[0].FSAztecRevivalist / 20) * 0.01,
 	_slaveDemandT *= 1 + Math.trunc($arcologies[0].FSAztecRevivalist / 20) * 0.0125>>
@@ -395,10 +395,10 @@ _topClassP = 1>>
 	_upperClassP *= 1.02,
 	_topClass += 2,
 	_topClassP *= 1.04>>
-	<<if $FSSupremacistLawMETrigger == 1>>
-		<<set _ASlavesSupremeLaw = Math.trunc(($lowerClass + $middleClass + $upperClass) * 0.65),
-		$ASlaves += _Math.trunc(ASlavesSupremeLaw * 0.75),
-		$helots += Math.trunc(_ASlavesSupremeLaw * 0.25),
+	<<if $FSSupLawTrigger == 1>>
+		<<set _slavesSupLaw = Math.trunc(($lowerClass + $middleClass + $upperClass) * 0.65),
+		$ASlaves += _Math.trunc(_slavesSupLaw * 0.75),
+		$helots += Math.trunc(_slavesSupLaw * 0.25),
 		$lowerClass = Math.trunc($lowerClass * 0.35),
 		$middleClass = Math.trunc($middleClass * 0.35),
 		$upperClass = Math.trunc($upperClass * 0.35),
@@ -414,14 +414,14 @@ _topClassP = 1>>
 	_upperClassP *= 1.01,
 	_topClass += 1,
 	_topClassP *= 1.02>>
-	<<if $FSSubjugationistLawMETrigger == 1 && $arcologies[0].FSSupremacistLawME == 0>>
-		<<set _ASlavesSupremeLaw = Math.trunc(($lowerClass + $middleClass + $upperClass) * 0.2),
-		$ASlaves += _Math.trunc(ASlavesSupremeLaw * 0.75),
-		$helots += Math.trunc(_ASlavesSupremeLaw * 0.25),
+	<<if $FSSubLawTrigger == 1 && $arcologies[0].FSSupremacistLawME == 0>>
+		<<set _slavesSubLaw = Math.trunc(($lowerClass + $middleClass + $upperClass) * 0.2),
+		$ASlaves += _Math.trunc(_slavesSubLaw * 0.75),
+		$helots += Math.trunc(_slavesSubLaw * 0.25),
 		$lowerClass = Math.trunc($lowerClass * 0.8),
 		$middleClass = Math.trunc($middleClass * 0.8),
 		$upperClass = Math.trunc($upperClass * 0.8),
-		$FSSubjugationistLawMETrigger = 2>>
+		$FSSubLawTrigger = 2>>
 	<</if>>
 <</if>>
 <<if $arcologies[0].FSRepopulationFocusLaw == 1>>
@@ -561,7 +561,7 @@ _middleClass *= 1 + ($TSS.subsidize + $GRI.subsidize + $SCP.subsidize + $LDE.sub
 <</if>>
 
 /*Slave expiration*/
-<<set _expirationPC = Math.trunc($helots * ($slaveExpiration * _expirationFS),
+<<set _expirationPC = Math.trunc($helots * ($slaveExpiration * _expirationFS)),
 _expirationNPC = Math.trunc($ASlaves * ($slaveExpiration * _expirationFS)),
 _expiration = _expirationPC + _expirationNPC,
 $ASlaves -= _expirationNPC,
@@ -653,9 +653,9 @@ $lowerClass -= _enslaved>>
 
 /*slaves*/
 /*Demand for simple labor*/
-<<set _LSCD = ($LSCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 4) + (($middleClass + $visitors * 0.6) * 1.5) + (($upperClass + $visitors * 0.2) * 3.5) + ($topClass * 18),
+<<set _LSCD = Math.trunc(($LSCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 4) + (($middleClass + $visitors * 0.6) * 1.5) + (($upperClass + $visitors * 0.2) * 3.5) + ($topClass * 18)),
 /*Demand for owning slaves*/
-_SCD = ($upperClass * ($slaveDemandU + _slaveDemandU)) + ($topClass * ($slaveDemandT + _slaveDemandT))>>
+_SCD = Math.trunc(($upperClass * ($slaveDemandU + _slaveDemandU)) + ($topClass * ($slaveDemandT + _slaveDemandT)))>>
 <br><<print _LSCD>> LSCD
 <br><<print _SCD>> SCD
 /*More slaves than there is work*/
@@ -689,30 +689,30 @@ _SCD = ($upperClass * ($slaveDemandU + _slaveDemandU)) + ($topClass * ($slaveDem
 
 /*Lower Class Citizens*/
 /*Work left for lower class citizens*/
-<<set _LCD = (($LSCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 4) + _lowerClass + (($middleClass + $visitors * 0.6) * 1.5) + (($upperClass + $visitors * 0.2) * 3.5) + ($topClass * 18) - ($ASlaves + $helots) * ($slaveProductivity + _slaveProductivity)) * $rentEffectL * _lowerClassP>>
-<br><<print _LCD>> LCD
+<<set _LCD = Math.trunc((($LSCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 4) + _lowerClass + (($middleClass + $visitors * 0.6) * 1.5) + (($upperClass + $visitors * 0.2) * 3.5) + ($topClass * 18) - ($ASlaves + $helots) * ($slaveProductivity + _slaveProductivity)) * $rentEffectL * _lowerClassP)>>
+<br><<print _LCD>> LCD | <<print _slaveProductivity>> | <<print _lowerClassP>>
 /*Changing population depending on work available*/
 <<if $lowerClass < _LCD>>
-	<<set _ACImmigration = Math.trunc((_LCD - $lowerClass) * 0.3) + 1,
-	$lowerClass += _ACImmigration>>
-	<<if _ACImmigration > 1>>
-		<br>@@.green;<<print _ACImmigration>> Lower class citizens@@ moved to your arcology.
-	<<elseif _ACImmigration > 0>>
+	<<set _LCImmigration = Math.trunc((_LCD - $lowerClass) * 0.3) + 1,
+	$lowerClass += _LCImmigration>>
+	<<if _LCImmigration > 1>>
+		<br>@@.green;<<print _LCImmigration>> Lower class citizens@@ moved to your arcology.
+	<<elseif _LCImmigration > 0>>
 		<br>@@.green;One lower class citizen@@ moved to your arcology.
 	<</if>>
 <<elseif $lowerClass > _LCD>>
-	<<set _ACEmigration = Math.trunc(($lowerClass - _LCD) * 0.6) + 1,
+	<<set _LCEmigration = Math.trunc(($lowerClass - _LCD) * 0.6) + 1,
 	_enslavedEmigrants = Math.trunc((($lowerClass - _LCD) * 0.6) * $enslaveChance),
-	$lowerClass -= _ACEmigration,
+	$lowerClass -= _LCEmigration,
 	_enslaved += _enslavedEmigrants>>
-	<<if _ACEmigration > 1>>
-		<br>@@.red;<<print _ACEmigration>> Lower class citizens@@ had no work and tried to leave your arcology.
+	<<if _LCEmigration > 1>>
+		<br>@@.red;<<print _LCEmigration>> Lower class citizens@@ had no work and tried to leave your arcology.
 		<<if _enslavedEmigrants > 1>>
 			@@.green;<<print _enslavedEmigrants>> Of them were enslaved instead.@@
 		<<elseif _enslavedEmigrants > 0>>
 			@@.green;One of them was enslaved instead.@@
 		<</if>>
-	<<elseif _ACEmigration > 0>>
+	<<elseif _LCEmigration > 0>>
 		<br>@@.red;One lower class citizen@@ left your arcology due to a lack of work.
 	<</if>>
 <</if>>
@@ -741,7 +741,7 @@ $ASlaves += _enslavedNPC>>
 
 /*Middle Class Citizens*/
 /*Demand for Middle Class*/
-<<set _MCD = (($MCBase * ($localEcon / 100)) + $arcology[0].prosperity + _middleClass + ($ASlaves * 0.15) + ($lowerClass * 0.1) + (($upperClass + $visitors * 0.2) * 0.5) + ($topClass * 2.5)) * $rentEffectM * _middleClassP>>
+<<set _MCD = Math.trunc((($MCBase * ($localEcon / 100)) + $arcologies[0].prosperity + _middleClass + ($ASlaves * 0.15) + ($lowerClass * 0.1) + (($upperClass + $visitors * 0.2) * 0.5) + ($topClass * 2.5)) * $rentEffectM * _middleClassP)>>
 <br><<print _MCD>> MCD
 /*Middle Class Citizens immigrating*/
 <<if $middleClass < _MCD>>
@@ -765,7 +765,7 @@ $ASlaves += _enslavedNPC>>
 
 /*Upper Class Citizens*/
 /*Demand for Upper Class*/
-<<set _UCD = (($UCBase * ($localEcon / 100)) + ($arcology[0].prosperity * 0.2) + _upperClass + ($ASlaves * 0.02) + ($lowerClass * 0.025) + (($middleClass + $visitors * 0.6) * 0.05) + ($topClass * 0.3)) * $rentEffectU * _upperClassP>>
+<<set _UCD = Math.trunc((($UCBase * ($localEcon / 100)) + ($arcologies[0].prosperity * 0.2) + _upperClass + ($ASlaves * 0.02) + ($lowerClass * 0.025) + (($middleClass + $visitors * 0.6) * 0.05) + ($topClass * 0.3)) * $rentEffectU * _upperClassP)>>
 /*Upper Class Citizens immigrating*/
 <<if $upperClass < _UCD>>
 	<<set _UCImmigration = Math.trunc((_UCD - $upperClass) * 0.3) + 1,
@@ -790,7 +790,7 @@ $ASlaves += _enslavedNPC>>
 /*Setting GDP depending on population*/
 <<set $GDP = Math.trunc((($ASlaves + $helots) * 0.35 * $slaveProductivity) + ($lowerClass * 0.35) + ($middleClass * 0.75) + ($upperClass * 2) + ($topClass * 10)) / 10,
 /*Top Class Interest in living in your arcology*/
-_TCD = ($GDP / 15 + _topClass) * $rentEffectT * _topClassP + $TCBase>>
+_TCD = Math.trunc(($GDP / 15 + _topClass) * $rentEffectT * _topClassP + $TCBase)>>
 /*Top Class Citizens immigrating*/
 <<if $topClass < _TCD>>
 	<<set _TCImmigration = Math.trunc((_TCD - $topClass) * 0.3) + 1,
@@ -824,7 +824,7 @@ _percLowerClass = Math.trunc(($lowerClass / ($ACitizens + $ASlaves)) * 1000) / 1
 _percMiddleClass = Math.trunc(($middleClass / ($ACitizens + $ASlaves)) * 1000) / 10,
 _percUpperClass = Math.trunc(($upperClass / ($ACitizens + $ASlaves)) * 1000) / 10,
 _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
-
+<br>
 <br>
 <<print $arcologies[0].name>> is home to the following;
 <br>Lower Class Citizens  | <<print $lowerClass>> | <<print _difLowerClass>> | <<print _percLowerClass>>% /*the dif is not very crucial, remove after testing is complete*/
@@ -832,6 +832,7 @@ _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
 <br>Upper Class Citizens  | <<print $upperClass>> | <<print _difUpperClass>> | <<print _percUpperClass>>%
 <br>Millionaires          | <<print $topClass>> | <<print _difTopClass>> | <<print _percTopClass>>%
 <br>Slaves                | <<print $ASlaves>> | <<print _difASlaves>> | <<print _percASlaves>>%
+<br>
 <br><<if $arcologies[0].FSSupremacistLawME == 1>>The citizenry is entirely $arcologies[0].FSSupremacistRace.<</if>>
 <<if $arcologies[0].FSRomanRevivalistLaw == 1>>The citizens take pride in their martial duties, preferring to wear utilitarian clothing even when off duty.<</if>>
 <<if $arcologies[0].FSGenderRadicalistDecoration == 100>>Every single one of the slaves is female by virtue of her fuckable asshole.
@@ -870,6 +871,7 @@ _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
 
 <br>
 
+/*
 <<set _rents = random(1,100)>>
 <<for _i = 1; _i < $sectors.length; _i++>>
 	<<if $sectors[_i].ownership == 1>>
@@ -894,61 +896,57 @@ _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
 		<</if>>
 	<</if>>
 <</for>>
-<<set $rentalMultiplier = 1>>
+*/
+
+<<set _rentMultiplier = 1>>
 <<if $arcologies[0].FSPaternalistLaw == 1>>
-	<<set $rentalMultiplier -= 0.1>>
+	<<set _rentMultiplier *= 0.95>>
 	Tenants who can prove that they abstain from certain practices are given a reduction to their rent.
 <</if>>
 <<if $arcologies[0].FSYouthPreferentialistLaw == 1>>
-	<<set $rentalMultiplier -= 0.1>>
+	<<set _rentMultiplier *= 0.95>>
 	Younger citizens are offered subsidized rent to encourage young people to join the free population of your arcology.
-<</if>>
-<<if $arcologies[0].FSMaturityPreferentialistLaw == 1>>
-	<<set $rentalMultiplier -= 0.1>>
+<<elseif $arcologies[0].FSMaturityPreferentialistLaw == 1>>
+	<<set _rentlMultiplier *= 0.95>>
 	Older citizens are offered subsidized rent to encourage mature people to join the free population of your arcology.
 <</if>>
 <<if $arcologies[0].FSRepopulationFocusLaw == 1>>
-	<<set $rentalMultiplier -= 0.1>>
+	<<set _rentMultiplier *= 0.95>>
 	Pregnant citizens are offered subsidized rent to encourage free women to become pregnant and pregnant women to join the free population of your arcology.
 <<elseif $arcologies[0].FSRestartLaw == 1>>
-	<<set $rentalMultiplier += 0.1>>
+	<<set _rentMultiplier *= 1.05>>
 	Non-elite citizens who refuse to be sterilized face a moderate tax and the looming possibility of expulsion or enslavement.
 <</if>>
 <<if $arcologies[0].FSHedonisticDecadenceLaw == 1>>
-	<<set $rentalMultiplier -= 0.1>>
+	<<set _rentMultiplier *= 0.95>>
 	Food vendors are offered subsidized rent and operating expenses to set up shop in your arcology.
 <</if>>
-<<if $alternativeRents == 1>>
+<<if $alternativeRents == 1>> /*A silly policy*/
 	Your citizens are allowed to pay their rents in slaves rather than cash and a few financially challenged individuals make use of this.
-	<<set $rentalMultiplier -= 0.1>>
+	<<set _rentMultiplier *= 0.95>>
 	<<set $helots += random(0,3)>>
 <</if>>
 <<if $discountMercenaries == 1>>
 	Mercenaries willing to come to your arcology are given a discount on rent.
-	<<set $rentalMultiplier -= 0.05>>
+	<<set _rentMultiplier *= 0.98>>
 <</if>>
 <<if $militiaSoldierPrivilege == 1>>
 	Citizens in the militia are exempt from rent payment.
-	<<set $rentalMultiplier -= 0.05>>
+	<<set _rentMultiplier *= 0.98>>
 <</if>>
 <<if $arcologies[0].FSArabianRevivalistLaw == 1>>
-	<<set $rentalMultiplier += 0.1>>
+	<<set _rentMultiplier *= 1.05>>
 	Those of your citizens who have not yet subscribed to the society you are building are permitted to live and do business here, but must pay a moderate jizya tax for the privilege as part of their rent.
 <</if>>
-<<set _rents = Math.trunc(_rents*$rentalMultiplier)>>
+<<set _rents = Math.trunc(($lowerClass * $LCRent + $middleClass * $MCRent + $upperClass * $UCRent + $topClass * $TCRent) * _rentMultiplier / 25)>>
 <<if !isInt(_rents)>>
 	<br>@@.red;Error: rents is outside accepted range, please report this issue@@
 <</if>>
 <<set $cash += _rents>>
 
-This week, rents from $arcologies[0].name came to
-<<if _rents > 0>>
-	@@.yellowgreen;<<print cashFormat(_rents)>>.@@
-<<else>>
-	@@.red;<<print cashFormat(_rents)>>.@@
-<</if>>
+This week, rents from $arcologies[0].name came to @@.yellowgreen;<<print cashFormat(_rents)>>.@@
 <<if $difficultySwitch == 0>>
-	<<if $economy < 100>>
+	<<if $localEcon < 100>>
 		<<set _bribes = ($week*100)+random(-100,100)>>
 		<<if $cash > 1000>>
 			<<set _bribes += Math.trunc($cash*0.02)>>
diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw
index 661c197ee81..baa660a1a21 100644
--- a/src/uncategorized/costsReport.tw
+++ b/src/uncategorized/costsReport.tw
@@ -13,7 +13,7 @@ Since you are
 <<else>>
 	used to a fairly normal life,
 <</if>>
-your __personal living expenses__ are <<print cashFormat(Math.trunc($girls*(250+(50000/$economy))))>>.
+your __personal living expenses__ are <<print cashFormat(Math.trunc($girls*(250+(50000/$localEcon))))>>.
 
 <<if $arcologies[0].FSRepopulationFocusLaw == 1 && $PC.pregKnown == 1>>
 	<br>Rent promotion for being a pregnant citizen under ''Universal Pregnancy Subsidy:'' <<print cashFormat(500)>>
diff --git a/src/uncategorized/policies.tw b/src/uncategorized/policies.tw
index 593ce1fefc2..62443365e12 100644
--- a/src/uncategorized/policies.tw
+++ b/src/uncategorized/policies.tw
@@ -427,13 +427,8 @@
 	<</if>>
 
 	<<if $arcologies[0].FSSupremacistLawME == 1>>
-		<<if $FSSupremacistLawMETrigger == 0>>
-			<br>''Universal Enslavement of the Impure:'' by law, anyone not of the $arcologies[0].FSSupremacistRace in your arcology is a slave.
-			[[Repeal|Policies][$arcologies[0].FSSupremacistLawME = 0, $FSSupremacistLawMETrigger = 1]]
-		<<else>>
-			<br>''Universal Enslavement of the Impure:'' by law, anyone not of the $arcologies[0].FSSupremacistRace in your arcology is a slave.
-			[[Repeal|Policies][$arcologies[0].FSSupremacistLawME = 0]]
-		<</if>>
+		<br>''Universal Enslavement of the Impure:'' by law, anyone not of the $arcologies[0].FSSupremacistRace in your arcology is a slave.
+		[[Repeal|Policies][$arcologies[0].FSSupremacistLawME = 0]]
 	<</if>>
 
 	<<if $arcologies[0].FSSupremacistSMR == 1>>
@@ -442,13 +437,8 @@
 	<</if>>
 
 	<<if $arcologies[0].FSSubjugationistLawME == 1>>
-		<<if $FSSubjugationistLawMETrigger == 0>>
-			<br>''Universal Enslavement of Subhumans:'' by law, all $arcologies[0].FSSubjugationistRace subhumans in your arcology are slaves.
-			[[Repeal|Policies][$arcologies[0].FSSubjugationistLawME = 0, $FSSubjugationistLawMETrigger = 1]]
-		<<else>>
-			<br>''Universal Enslavement of Subhumans:'' by law, all $arcologies[0].FSSubjugationistRace subhumans in your arcology are slaves.
-			[[Repeal|Policies][$arcologies[0].FSSubjugationistLawME = 0]]
-		<</if>>
+		<br>''Universal Enslavement of Subhumans:'' by law, all $arcologies[0].FSSubjugationistRace subhumans in your arcology are slaves.
+		[[Repeal|Policies][$arcologies[0].FSSubjugationistLawME = 0]]
 	<</if>>
 
 	<<if $arcologies[0].FSSubjugationistSMR == 1>>
@@ -1233,8 +1223,12 @@
 	<<if $arcologies[0].FSSupremacist >= 90>>
 		<<if $arcologies[0].FSSupremacistLawME == 0>>
 			<br>''@@.lime;Universal Enslavement of the Impure:@@'' will force anyone not of the $arcologies[0].FSSupremacistRace to emigrate or accept enslavement, and make sex with non-$arcologies[0].FSSupremacistRace people such an expectation that the appetite for all such slaves will increase slightly.
-			[[Implement|Policies][$arcologies[0].FSSupremacistLawME = 1, $cash -=5000, $rep -= 1000]]
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will affect the slave markets in unpredictable ways//
+			<<if $FSSupLawTrigger == 0>>
+				[[Implement|Policies][$arcologies[0].FSSupremacistLawME = 1, $FSSupLawTrigger = 1, $cash -= 5000, $rep -= 1000]]
+			<<else>>
+				[[Implement|Policies][$arcologies[0].FSSupremacistLawME = 1, $cash -= 5000, $rep -= 1000]]
+			<</if>>
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will affect the slave market and arcology drastically//
 		<</if>>
 	<</if>>
 
@@ -1251,8 +1245,12 @@
 	<<if $arcologies[0].FSSubjugationist >= 90>>
 		<<if $arcologies[0].FSSubjugationistLawME == 0>>
 			<br>''@@.lime;Universal Enslavement of Subhumans:@@'' will force slavery on all $arcologies[0].FSSubjugationistRace subhumans in your arcology, and make sex with $arcologies[0].FSSubjugationistRace people such an expectation that the appetite for all such slaves will increase slightly.
-			[[Implement|Policies][$arcologies[0].FSSubjugationistLawME = 1, $cash -=5000, $rep -= 1000]]
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will affect the slave markets in unpredictable ways//
+			<<if $FSSubLawTrigger == 0>>
+				[[Implement|Policies][$arcologies[0].FSSubjugationistLawME = 1, $FSSubLawTrigger = 1, $cash -= 5000, $rep-= 1000]]
+			<<else>>
+				[[Implement|Policies][$arcologies[0].FSSubjugationistLawME = 1, $cash -= 5000, $rep -= 1000]]
+			<</if>>
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will affect the slave market and arcology drastically//
 		<</if>>
 	<</if>>
 
-- 
GitLab