From 33aa44edc80c7d02db474109ac5128fb69de679c Mon Sep 17 00:00:00 2001
From: hexall90 <hexall90@gmail.com>
Date: Sun, 8 Oct 2017 10:09:16 +0200
Subject: [PATCH] general work

---
 TODO.txt                                  |  12 +-
 src/SecExp/SecExpBackwardCompatibility.tw | 228 +++++++++++---
 src/SecExp/attackGenerator.tw             |  11 +-
 src/SecExp/edicts.tw                      | 350 +++++++++++++++++++---
 src/SecExp/secBarracks.tw                 |   6 +
 src/SecExp/secInit.tw                     |  34 ++-
 src/SecExp/securityReport.tw              | 113 ++++++-
 src/js/economyJS.tw                       |  21 +-
 src/uncategorized/arcmgmt.tw              |  72 ++++-
 src/uncategorized/economics.tw            |   4 +-
 src/uncategorized/fsDevelopments.tw       |  33 ++
 src/uncategorized/persBusiness.tw         |  42 +++
 src/uncategorized/reputation.tw           |   4 +
 src/uncategorized/storyCaption.tw         |   5 +-
 14 files changed, 813 insertions(+), 122 deletions(-)

diff --git a/TODO.txt b/TODO.txt
index 436716c16a5..47b5eb76b3e 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,11 +1,11 @@
 -add wounds description to the battle report
--sea attacks
 -randomize the battle day, so that it is not always the same day the turn is given
 -add fortifications
 -add casualties to the counters
--add upkeep costs
 -add security/authority and crime choices to game creation
--add random crimes to report and more detailed ones as events
--rewrite attackoption to reflect new recon system
--more foci for the propaganda machine?
--min rep for upgrades
\ No newline at end of file
+-add random crimes as events
+-rewrite attackOption to reflect new recon system
+-min rep for upgrades
+-a lot of units increase security
+-a lot of cash increases crime
+-renaming of units depending on FSs
diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw
index a8ab834c827..3045b146d6b 100644
--- a/src/SecExp/SecExpBackwardCompatibility.tw
+++ b/src/SecExp/SecExpBackwardCompatibility.tw
@@ -2,40 +2,40 @@
 
 /* base stats */
 <<if ndef $authority>>
-	<<set $authority = 0>>
+<<set $authority = 0>>
 <</if>>
 <<if ndef $security>>
-	<<set $security = 50>>
+<<set $security = 50>>
 <</if>>
 <<if ndef $secRestPoint>>
-	<<set $secRestPoint = 40>>
+<<set $secRestPoint = 40>>
 <</if>>
 <<if ndef $crime>>
-	<<set $crime = 20>>
+<<set $crime = 20>>
 <</if>>
 <<if ndef $crimeCap>>
-	<<set $crimeCap = 100>>
+<<set $crimeCap = 100>>
 <</if>>
 <<if ndef $readiness>>
-	<<set $readiness = 1>>
+<<set $readiness = 1>>
 <</if>>
 <<if ndef $maxUnits>>
-	<<set $maxUnits = 6>>
+<<set $maxUnits = 6>>
 <</if>>
 <<if ndef $activeUnits>>
-	<<set $activeUnits = 0>>
+<<set $activeUnits = 0>>
 <</if>>
 <<if ndef $attackType>>
-	<<set $attackType = "none">>
+<<set $attackType = "none">>
 <</if>>
 <<if ndef $attackThisWeek>>
-	<<set $attackThisWeek = 0>>
+<<set $attackThisWeek = 0>>
 <</if>>
 <<if ndef $lastAttackWeeks>>
-	<<set $lastAttackWeeks = 0>>
+<<set $lastAttackWeeks = 0>>
 <</if>>
 <<if ndef $hasFoughtOnce>>
-	<<set $hasFoughtOnce = 0>>
+<<set $hasFoughtOnce = 0>>
 <</if>>
 <<if ndef $PCvictoryStreak>>
 <<set $PCvictoryStreak = 0>>
@@ -43,35 +43,127 @@
 <<if ndef $PClossStreak>>
 <<set $PClossStreak = 0>>
 <</if>>
+<<if ndef $oldFlux>>
+<<set $oldFlux = 0>>
+<</if>>
+
+/* edicts */
+<<if ndef $edictsUpkeep>>
+<<set $edictsUpkeep = 0>>
+<</if>>
+<<if ndef $edictsAuthUpkeep>>
+<<set $edictsAuthUpkeep = 0>>
+<</if>>
+<<if ndef $alternativeRents>>
+<<set $alternativeRents = 0>>
+<</if>>
+<<if ndef $enslavementRights>>
+<<set $enslavementRights = 0>>
+<</if>>
+<<if ndef $securityExemption>>
+<<set $securityExemption = 0>>
+<</if>>
+<<if ndef $sellData>>
+<<set $sellData = 0>>
+<</if>>
+<<if ndef $propCampaignBoost>>
+<<set $propCampaignBoost = 0>>
+<</if>>
+<<if ndef $slaveWatch>>
+<<set $slaveWatch = 0>>
+<</if>>
+<<if ndef $subsidyChurch>>
+<<set $subsidyChurch = 0>>
+<</if>>
+<<if ndef $limitImmigration>>
+<<set $limitImmigration = 0>>
+<</if>>
+<<if ndef $openBorders>>
+<<set $openBorders = 0>>
+<</if>>
+<<if ndef $limitSubhumans>>
+<<set $limitSubhumans = 0>>
+<</if>>
+<<if ndef $slavesOfficers>>
+<<set $slavesOfficers = 0>>
+<</if>>
+<<if ndef $martialSchool>>
+<<set $martialSchool = 0>>
+<</if>>
+<<if ndef $discountMercenaries>>
+<<set $discountMercenaries = 0>>
+<</if>>
+<<if ndef $militiaFounded>>
+<<set $militiaFounded = 0>>
+<</if>>
+<<if ndef $recruitVolunteers>>
+<<set $recruitVolunteers = 0>>
+<</if>>
+<<if ndef $militaryService>>
+<<set $militaryService = 0>>
+<</if>>
+<<if ndef $militarizedSociety>>
+<<set $militarizedSociety = 0>>
+<</if>>
+<<if ndef $militaryExemption>>
+<<set $militaryExemption = 0>>
+<</if>>
+<<if ndef $lowerRquirements>>
+<<set $lowerRquirements = 0>>
+<</if>>
+<<if ndef $noSubhumansInArmy>>
+<<set $noSubhumansInArmy = 0>>
+<</if>>
+<<if ndef $pregExemption>>
+<<set $pregExemption = 0>>
+<</if>>
+<<if ndef $eliteOfficers>>
+<<set $eliteOfficers = 0>>
+<</if>>
+<<if ndef $liveTargets>>
+<<set $liveTargets = 0>>
+<</if>>
+<<if ndef $legionTradition>>
+<<set $legionTradition = 0>>
+<</if>>
+<<if ndef $eagleWarriors>>
+<<set $eagleWarriors = 0>>
+<</if>>
+<<if ndef $ronin>>
+<<set $ronin = 0>>
+<</if>>
+<<if ndef $sunTzu>>
+<<set $sunTzu = 0>>
+<</if>>
 
 /* buildings */
 <<if ndef $secHQ>>
-	<<set $secHQ = 0>>
+<<set $secHQ = 0>>
 <</if>>
 <<if ndef $secBarracks>>
-	<<set $secBarracks = 0>>
+<<set $secBarracks = 0>>
 <</if>>
 <<if ndef $secBarracksUpgrades>>
-	<<set $secBarracksUpgrades ={
+<<set $secBarracksUpgrades ={
 	size: 0,
 	luxury: 0,
 	training: 0}>> 
 <</if>>
 <<if ndef $secHelots>>
-	<<set $secHelots = 0>>
+<<set $secHelots = 0>>
 <</if>>
 <<if ndef $reqHelots>>
-	<<set $reqHelots = 20>>
+<<set $reqHelots = 20>>
 <</if>>
 <<if ndef $secUpgrades >>
-	<<set $secUpgrades = {
+<<set $secUpgrades = {
 	nanoCams: 0,
 	cyberBots: 0,
 	eyeScan: 0,
 	cryptoAnalyzer: 0}>>
 <</if>>	
 <<if ndef $crimeUpgrades>>
-	<<set $crimeUpgrades = {
+<<set $crimeUpgrades = {
 	autoTrial: 0,
 	autoArchive: 0,
 	worldProfiler: 0,
@@ -84,38 +176,38 @@
 	signalIntercept: 0}>>
 <</if>>
 <<if ndef $readinessUpgrades>>
-	<<set $readinessUpgrades = {
+<<set $readinessUpgrades = {
 	earlyWarn: 0,
 	rapidPlatforms: 0,
-	pathways: 0
+	pathways: 0,
 	rapidVehicles: 0}>>
 <</if>>
 <<if ndef $propHub>>
 	<<set $propHub = 0>>
 <</if>>
 <<if ndef $propCampaign>>
-	<<set $propCampaign = 0>>
+<<set $propCampaign = 0>>
 <</if>>
 <<if ndef $propFocus>>
-	<<set $propFocus = "none">>
+<<set $propFocus = "none">>
 <</if>>
 <<if ndef $miniTruth>>
-	<<set $miniTruth = 0>>
+<<set $miniTruth = 0>>
 <</if>>
 <<if ndef $fakeNews>>
-	<<set $fakeNews = 0>>
+<<set $fakeNews = 0>>
 <</if>>
 <<if ndef $controlLeaks>>
-	<<set $controlLeaks = 0>>
+<<set $controlLeaks = 0>>
 <</if>>
 <<if ndef $secretService>>
-	<<set $secretService = 0>>
+<<set $secretService = 0>>
 <</if>>
 <<if ndef $blackOps>>
-	<<set $blackOps = 0>>
+<<set $blackOps = 0>>
 <</if>>
 <<if ndef $marketInfiltration>>
-	<<set $marketInfiltration = 0>>
+<<set $marketInfiltration = 0>>
 <</if>>
 <<if ndef $propHubUpkeep>>
 <<set $propHubUpkeep = $facilityCost>>
@@ -206,13 +298,13 @@
 
 /* upgrades */
 <<if ndef $riskSim>>
-	<<set $riskSim = 0>>
+<<set $riskSim = 0>>
 <</if>>
 <<if ndef $riskSimExpectedAttack>>
-	<<set $riskSimExpectedAttack = "none">>
+<<set $riskSimExpectedAttack = "none">>
 <</if>>
 <<if ndef $perimeterDrones>>
-	<<set $perimeterDrones = 0>>
+<<set $perimeterDrones = 0>>
 <</if>>
 
 /* battle relevant vars */
@@ -280,43 +372,109 @@
 	<<set $gainedCombat == 1>>
 <</if>>
 	
-/* statistics | since these won't get modified in game, it's not necessary to check if they are defined */
+/* statistics */
+<<if ndef $baseBribePerAttacker>>
 <<set $baseBribePerAttacker = 5>>
-
+<</if>>
+<<if ndef $equipMod>>
 <<set $equipMod = 0.15>>
+<</if>>
+<<if ndef $secBotsBaseAttack>>
 <<set $secBotsBaseAttack = 9>>
+<</if>>
+<<if ndef $secBotsBaseDefense>>
 <<set $secBotsBaseDefense = 5>>
+<</if>>
+<<if ndef $secBotsMorale>>
 <<set $secBotsMorale = 200>>
+<</if>>
+<<if ndef $secBotsBaseHp>>
 <<set $secBotsBaseHp = 4>>
+<</if>>
+<<if ndef $militiaBaseAttack>>
 <<set $militiaBaseAttack = 7>>
+<</if>>
+<<if ndef $militiaBaseDefense>>
 <<set $militiaBaseDefense = 5>>
+<</if>>
+<<if ndef $militiaBaseMorale>>
 <<set $militiaBaseMorale = 140>>
+<</if>>
+<<if ndef $militiaBaseHp>>
 <<set $militiaBaseHp = 3>>
+<</if>>
+<<if ndef $slaveBaseAttack>>
 <<set $slaveBaseAttack = 9>>
+<</if>>
+<<if ndef $slaveBaseDefense>>
 <<set $slaveBaseDefense = 3>>
+<</if>>
+<<if ndef $slaveBaseMorale>>
 <<set $slaveBaseMorale = 110>>
+<</if>>
+<<if ndef $slaveBaseHp>>
 <<set $slaveBaseHp = 3>>
+<</if>>
+<<if ndef $mercBaseAttack>>
 <<set $mercBaseAttack = 8>>
+<</if>>
+<<if ndef $mercBaseDefense>>
 <<set $mercBaseDefense = 4>>
+<</if>>
+<<if ndef $mercBaseMorale>>
 <<set $mercBaseMorale = 125>>
+<</if>>
+<<if ndef $mercBaseHp>>
 <<set $mercBaseHp = 4>>
-
+<</if>>
+<<if ndef $raBaseAttack>>
 <<set $raBaseAttack = 7>>
+<</if>>
+<<if ndef $raBaseDefense>>
 <<set $raBaseDefense = 2>>
+<</if>>
+<<if ndef $raBaseMorale>>
 <<set $raBaseMorale = 100>>
+<</if>>
+<<if ndef $raBaseHp>>
 <<set $raBaseHp = 2>>
+<</if>>
+<<if ndef $fcBaseAttack>>
 <<set $fcBaseAttack = 6>>
+<</if>>
+<<if ndef $fcBaseDefense>>
 <<set $fcBaseDefense = 4>>
+<</if>>
+<<if ndef $fcBaseMorale>>
 <<set $fcBaseMorale = 130>>
+<</if>>
+<<if ndef $fcBaseHp>>
 <<set $fcBaseHp = 3>>
+<</if>>
+<<if ndef $owBaseAttack>>
 <<set $owBaseAttack = 8>>
+<</if>>
+<<if ndef $owBaseDefense>>
 <<set $owBaseDefense = 4>>
+<</if>>
+<<if ndef $owBaseMorale>>
 <<set $owBaseMorale = 110>>
+<</if>>
+<<if ndef $owBaseHp>>
 <<set $owBaseHp = 2>>
+<</if>>
+<<if ndef $ffBaseAttack>>
 <<set $ffBaseAttack = 9>>
+<</if>>
+<<if ndef $ffBaseDefense>>
 <<set $ffBaseDefense = 2>>
+<</if>>
+<<if ndef $ffBaseMorale>>
 <<set $ffBaseMorale = 160>>
+<</if>>
+<<if ndef $ffBaseHp>>
 <<set $ffBaseHp = 2>>
+<</if>>
 
 /* units */
 <<if ndef $secBots>>
diff --git a/src/SecExp/attackGenerator.tw b/src/SecExp/attackGenerator.tw
index d42b8900763..d4a0fb39829 100644
--- a/src/SecExp/attackGenerator.tw
+++ b/src/SecExp/attackGenerator.tw
@@ -1,7 +1,8 @@
 :: attackGenerator [nobr]
 
 /* _attackChance value is the chance out of 100 of an attack happening this week */
-<<if $lastAttackWeeks < 3 || $arcologyUpgrade.drones != 1>> /* attacks are deactivated until the player has at least the drones as a unit to send in battle */
+/* attacks are deactivated if the arcology is in the middle of the ocean, security drones are not around yet or the last attack happened within 3 weeks */
+<<if $terrain == "oceanic" || $arcologyUpgrade.drones != 1 || $lastAttackWeeks < 3>>
 	<<set _attackChance = 0>>
 <<else>>
 	<<if $week < 30>>
@@ -131,8 +132,6 @@
 			<<set $battleTerrain = either("mountains","outskirts","hills","wasteland")>>
 		<<elseif $terrain == "marine">>
 			<<set $battleTerrain = either("coast","outskirts","hills","wasteland")>>
-		<<elseif $terrain == "oceanic">>
-			<<set $battleTerrain = either("sea","urban")>>
 		<<else>>
 			<<set $battleTerrain = "err">>
 		<</if>>
@@ -166,8 +165,6 @@
 			<<set $battleTerrain = either("mountains","outskirts","hills","wasteland")>>
 		<<elseif $terrain == "marine">>
 			<<set $battleTerrain = either("coast","outskirts","hills","wasteland")>>
-		<<elseif $terrain == "oceanic">>
-			<<set $battleTerrain = either("sea","urban")>>
 		<<else>>
 			<<set $battleTerrain = "err">>
 		<</if>>
@@ -201,8 +198,6 @@
 			<<set $battleTerrain = either("mountains","outskirts","hills","wasteland")>>
 		<<elseif $terrain == "marine">>
 			<<set $battleTerrain = either("coast","outskirts","hills","wasteland")>>
-		<<elseif $terrain == "oceanic">>
-			<<set $battleTerrain = either("sea","urban")>>
 		<<else>>
 			<<set $battleTerrain = "err">>
 		<</if>>
@@ -236,8 +231,6 @@
 			<<set $battleTerrain = either("mountains","outskirts","hills","wasteland")>>
 		<<elseif $terrain == "marine">>
 			<<set $battleTerrain = either("coast","outskirts","hills","wasteland")>>
-		<<elseif $terrain == "oceanic">>
-			<<set $battleTerrain = either("sea","urban")>>
 		<<else>>
 			<<set $battleTerrain = "err">>
 		<</if>>
diff --git a/src/SecExp/edicts.tw b/src/SecExp/edicts.tw
index 35084af609a..06c9f07d63d 100644
--- a/src/SecExp/edicts.tw
+++ b/src/SecExp/edicts.tw
@@ -1,18 +1,157 @@
 :: edicts [nobr]
 
+<<set $nextButton = "Back">>
+<<set $nextLink = "Main">
+
 ''__Active Edicts__''
 
+<<if $alternativeRents == 1>>
+	<br>''Alternative rent payment:'' you are allowing citizens to pay for their rents in menial slaves rather than cash.
+	[[Repeal|edicts][$alternativeRents = 0]]
+<</if>>
+
+<<if $enslavementRights == 1>>
+	<br>''Enslavement rights:'' you are the only authority able to declare a person enslaved or not. 
+	[[Repeal|edicts][$enslavementRights = 0]]
+<</if>>
+
+<<if $sellData == 1>>
+	<br>''Private Data marketization:'' you are selling private citizens' data to the best bidder.
+	[[Repeal|edicts][$sellData = 0, $edictsAuthUpkeep -= 100]]
+<</if>>
 
+<<if $propCampaignBoost == 1>>
+	<br>''Obligatory educational material:'' you are forcing residents to read curated educational material about the arcology.
+	[[Repeal|edicts][$propCampaignBoost = 0]]
+<</if>>
 
-<br><br>''__Available policies__''
-<br>//Passing any law will cost ¤5000 and authority. More edicts will become available as the arcology develops.//
+<<if $slaveWatch == 1>>
+	<br>''@@.lime;Slave mistreatment watch:@@'' slaves are able access a special security service in case of mistreatment.
+	[[Repeal|edicts][$slaveWatch = 0, $edictsUpkeep -= 1000]]
+<</if>>
+
+<<if $subsidyChurch == 1>>
+	<br>''@@.lime;Religious activities subsidy:@@'' you are providing economic support to religious activities following the official dogma.
+	[[Repeal|edicts][$subsidyChurch = 0, $edictsUpkeep -= 1000]]
+<</if>>
+
+<br><br>__Immigration:__
+
+<<if $limitImmigration == 1>>
+	<br>''Immigration limits:'' you put strict limits to the amount of people the arcology can accept each week.
+	[[Repeal|edicts][$limitImmigration = 0]]
+<</if>>
+
+<<if $openBorders == 1>>
+	<br>''Open borders:'' you have lowered considerably the requirements to become citizens.
+	[[Repeal|edicts][$openBorders = 0]]
+<</if>>
+
+<<if $hasFoughtOnce == 1>>
+<br><br>Defense Force:__
+	<<if $slavesOfficers == 1>>
+		<br>''Slave Officers:'' your trusted slaves are allowed to lead the defense forces of the arcology.
+		[[Repeal|edicts][$slavesOfficers = 0, $edictsAuthUpkeep -= 100]]
+	<</if>>
+
+	<<if $mercenaries > 0>>
+		<<if $discountMercenaries == 1>>
+			<br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent.
+			[[Repeal|edicts][$discountMercenaries = 0]]
+		<</if>>
+	<</if>>
+
+	<<if $militiaFounded == 1>>
+		<<if $conscription == 1>>
+			<br>''Conscription:'' every citizen is required to train in the militia and serve the arcology for a limited amount of time.
+			[[Repeal|edicts][$conscription = 0, $recruitVolunteers = 1]]
+		<</if>>
+		<<if $militaryService == 1>>
+			<br>''Obligatory military service:'' every citizen is required to register and serve under the militia.
+			[[Repeal|edicts][$militaryService = 0, $recruitVolunteers = 1]]
+		<</if>>
+		<<if $militarizedSociety == 1>>
+			<br>''Militarized Society:'' every adult citizen is required to train and actively participate in the military of the arcology.
+			[[Repeal|edicts][$militarizedSociety = 0, $recruitVolunteers = 1]]
+		<</if>>
+		
+		<<if militaryExemption == 1>>
+			<br>''Military exemption:'' you allow citizens to avoid military duty by paying a weekly fee.
+			[[Repeal|edicts][$militaryExemption = 0]]
+		<</if>>
+		
+		<<if $lowerRquirements == 1>>
+			<br>''@@.lime;Revised minimum requirements:@@'' you allow citizens outside the normally accepted range to join the militia.
+			[[Repeal|edicts][$lowerRquirements = 0]]
+		<</if>>
+		
+		<<if $noSubhumansInArmy == 1>>
+			<br>''@@.lime;No subhumans in the militia:@@'' it is forbidden for subhumans to join the militia.
+			[[Repeal|edicts][$noSubhumansInArmy = 0]]
+		<</if>>
+			
+		<<if $pregExemption == 1>>
+			<br>''@@.lime;Military exemption for pregnancys:@@'' pregnant citizens are allowed, and encouraged, to avoid military service.
+			[[Repeal|edicts][$pregExemption = 0]]
+		<</if>>
+	<</if>>
+	
+	<<if $martialSchool == 1>>
+		<br>''@@.lime;Slave martial schools:@@'' specialized schools are training slaves in martial arts and bodyguarding.
+		[[Repeal|edicts][$martialSchool = 0, $edictsUpkeep -= 1000, $slaveBaseMorale -= 5]]
+	<</if>>
+
+	<<if $eliteOfficers == 1>>
+		<br>''@@.lime;Elite officers:@@'' officers are exclusively recruited from the elite of society.
+		[[Repeal|edicts][$eliteOfficers = 0, $militiaBaseMorale += 5, $slaveBaseMorale -= 5]]
+	<</if>>
+	
+	<<if $liveTargets == 1>>
+		<br>''@@.lime;Live targets drills:@@'' disobedient slaves are used as live targets at shooting ranges.
+		[[Repeal|edicts][$eliteOfficers = 0]]
+	<</if>>
+<</if>>
+
+<<if $FSAnnounced>>
+	<br><br>__Future Societies:__
+	<<if $legionTradition == 1>>
+		<br>''@@.lime;Legionaries traditions:@@'' you are funding specialized training for your recruits following the Roman tradition of professional armies.
+		[[Repeal|edicts][$legionTradition = 0, $edictsUpkeep -= 1000, $militiaBaseDefense -= 2, $militiaBaseMorale -= 5, $militiaBaseHp--]]
+	<</if>>
+	
+	<<if $pharaonTradition == 1>>
+		<br>''@@.lime;Legionaries traditions:@@'' you are funding specialized training for your recruits to turn them into an army worthy of a pharaon.
+		[[Implement|edicts][$pharaonTradition = 0, $edictsUpkeep -= 1000, $militiaBaseAttack -= 2, $militiaBaseDefense -= 2, $militiaBaseMorale -= 10]]
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, defense and morale of militia units, but will incur in upkeep costs.//
+	<</if>>
+	
+	<<if $eagleWarriors == 1>>
+		<br>''@@.lime;Eagle warriors traditions:@@'' you are funding specialized training for your mercenaries following the Aztec tradition of elite warriors.
+		[[Repeal|edicts][$eagleWarriors = 0, $edictsUpkeep -= 1000, $mercBaseAttack -= 4, $mercBaseDefense += 2, $mercBaseMorale -= 10]]
+	<</if>>
+	
+	<<if $ronin == 1>>
+		<br>''@@.lime;Ronin traditions:@@'' you are funding specialized training for your mercenaries following the Japanese tradition of elite errant samurai.
+		[[Repeal|edicts][$ronin = 0, $edictsUpkeep -= 1000, $mercBaseAttack -= 2, $mercBaseDefense -= 2, $mercBaseMorale -= 10]]
+	<</if>>
 
-<<if $slavesOfficers == 0>>
-	<br>''Slave Officers:'' allow your trusted slaves to lead the defense forces of the arcology.
-	[[Implement|edicts][$slavesOfficers = 1, $cash -=5000, $authority -= 1000]]
-	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow your bodyguard and head girl to lead the troops into battle, but will cost small amount of authority every week.//
+	<<if $mamluks == 1>>
+		<br>''@@.lime;Mamluks traditions:@@'' you are funding specialized training for your slaves following the Arabian tradition of mamluks slave soldiers.
+		[[Repeal|edicts][$ronin = 0, $edictsUpkeep -= 1000, $slaveBaseAttack -= 2, $slaveBaseHp--, $slaveBaseMorale -= 10]]
+	<</if>>
+	
+	<<if $sunTzu == 1>>
+		<br>''@@.lime;Sun Tzu Teachings:@@'' you are funding specialized training for your units and officers to follow the teachings of the "Art of War".
+		[[Repeal|edicts][$sunTzu = 0, $edictsUpkeep -= 1000, $militiaBaseAttack--, $militiaBaseDefense--, $mercBaseAttack--, $mercBaseDefense--, $slaveBaseAttack--, $slaveBaseDefense--, $militiaBaseMorale -= 5, $mercBaseMorale -= 5, $slaveBaseMorale -= 5]]
+	<</if>>
 <</if>>
 
+<hr>
+
+<<if $authority >= 1000>>
+''__Available Edicts__''
+<br>//Passing any edict will cost ¤5000 and some authority. More edicts will become available as the arcology develops.//
+
 <<if $alternativeRents == 0>>
 	<br>''Alternative rent payment:'' allow citizens to pay for their rents in menial slaves rather than cash, if so they wish.
 	[[Implement|edicts][$alternativeRents = 1, $cash -=5000, $authority -= 1000]]
@@ -22,72 +161,201 @@
 <<if $enslavementRights == 0>>
 	<br>''Enslavement rights:'' the arcology owner will be the the only authority able to declare a person enslaved or not. 
 	[[Implement|edicts][$enslavementRights = 1, $cash -=5000, $authority -= 1000]]
-	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the number of citizens falling into slavery each week, but will provide cash each week. The higher the flux of citizens to slaves the higher the income.//
+	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will provide cash each week. The higher the flux of citizens to slaves the higher the income. Will cost authority each week.//
 <</if>>
 
-<<if $sellData == 0 && ($secUpgrades.nanoCams == 1 ||  $secUpgrades.cyberBots == 1 ||  $secUpgrades.eyeScan == 1 ||  $secUpgrades.cryptoAnalyzer == 1 ||  $crimeUpgrades.autoTrial == 1 ||  crimeUpgrades.autoArchive == 1 ||  $crimeUpgrades.worldProfiler == 1 ||  $crimeUpgrades.advForensic == 1)>>
+<<if $sellData == 0 && ($secUpgrades.nanoCams == 1 ||  $secUpgrades.cyberBots == 1 ||  $secUpgrades.eyeScan == 1 ||  $secUpgrades.cryptoAnalyzer == 1 ||  $crimeUpgrades.autoTrial == 1 ||  $crimeUpgrades.autoArchive == 1 ||  $crimeUpgrades.worldProfiler == 1 ||  $crimeUpgrades.advForensic == 1)>>
 	<br>''Private Data marketization:'' allow the selling of private citizens' data.
-	[[Implement|edicts][$sellData = 1, $cash -=5000, $authority -= 1000]]
-	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will generate income dependent on the amount of upgrades installed in the security HQ.//
+	[[Implement|edicts][$sellData = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 100]]
+	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will generate income dependent on the amount of upgrades installed in the security HQ, but will cost a small amount of authority each week.//
 <</if>>
 
 <<if $propHub == 1>>
 	<<if $propCampaignBoost == 0>>
 		<br>''Obligatory educational material:'' force residents to read curated educational material about the arcology.
 		[[Implement|edicts][$alternativeRents = 1, $cash -=5000, $authority -= 1000]]
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the effectiveness of propaganda campaigns.//
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the effectiveness of propaganda campaigns, but will incur in upkeep costs.//
 	<</if>>
 <</if>>
 
-<br><br>__Immigration Laws:__
+<<if $arcologies[0].FSPaternalist != "unset">>
+	<<if $slaveWatch == 0>>
+		<br>''@@.lime;Slave mistreatment watch:@@'' slaves will be able access a special security service in case of mistreatment.
+		[[Implement|edicts][$slaveWatch = 1, $cash -=5000, $authority -= 1000]]
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance paternalism, but will incur in upkeep costs.//
+	<</if>>
+<</if>>
+
+<<if $arcologies[0].FSChattelReligionist >= 40>>
+	<<if $subsidyChurch == 0>>
+		<br>''@@.lime;Religious activities subsidy:@@'' will provide ecnomic support to religious activities following the official dogma.
+		[[Implement|edicts][$subsidyChurch = 1, $cash -=5000, $authority -= 1000]]
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will provide authority each week, but will incur in upkeep costs.//
+	<</if>>
+<</if>>
+
+<br><br>__Immigration:__
 
 <<if $limitImmigration == 0>>
-	<br>''Limit Immigration:'' rise the requirements to become citizens.
+	<br>''Immigration limits:'' institute limits to the amount of people the arcology will accept each week.
 	[[Implement|edicts][$openBorders = 0, $limitImmigration = 1, $cash -=5000, $authority -= 1000]]
 	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of people immigrating into the arcology and enhance security.//
 <</if>>
 
 <<if $openBorders == 0>>
-	<br>''Limit Immigration:'' considerably lower requirements to become citizens.
+	<br>''Open borders:'' considerably lower requirements to become citizens.
 	[[Implement|edicts][$openBorders = 1, $limitImmigration = 0, $cash -=5000, $authority -= 1000]]
-	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase immigration to the arcology at the cost of security.//
+	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase immigration to the arcology, but will increase crime.//
 <</if>>
 
+<<if $hasFoughtOnce == 1>>
+<br><br>Defense Force:__
+	<<if $slavesOfficers == 0>>
+		<br>''Slave Officers:'' allow your trusted slaves to lead the defense forces of the arcology.
+		[[Implement|edicts][$slavesOfficers = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 100]]
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow your bodyguard and head girl to lead troops into battle, but will cost a small amount of authority each week.//
+	<</if>>
 
-<br><br>__Citizenship Laws:__
-
+	<<if $mercenaries > 0>>
+		<<if $discountMercenaries == 0>>
+			<br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent.
+			[[Implement|edicts][$discountMercenaries = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly lower rent, but will increase the amount of available mercenaries.//
+		<</if>>
+	<</if>>
 
+	<<if $militiaFounded == 0>>
+		<br>''Found the militia:'' lay the groundwork for the formation of the arcology's citizens' army.
+		[[Implement|edicts][$militiaFounded = 1, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]]
+		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow for the recruitment and training of citizens.//
+	<</if>>
 
-<br><br>__Recruitment Laws:__
+	<<if $militiaFounded == 1>>
+		<<if $recruitVolunteers == 0>>
+			<br>''Volunteers' militia:'' only volunteers will be accepted in the militia.
+			[[Implement|edicts][$militarizedSociety = 0, $militaryService = 0, $conscription = 0, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish militia manpower slowly and will cap at 2% of the total citizens population.//
+		<</if>>
+		<<if $conscription == 0>>
+			<br>''Conscription:'' every citizen is required to train in the militia and serve the arcology if the need arises.
+			[[Implement|edicts][$militarizedSociety = 0, $militaryService = 0, $conscription = 1, $recruitVolunteers = 0, $cash -=5000, $authority -= 4000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish militia manpower moderatly fast and will cap at 5% of the total citizens population, but has a high authority cost//
+		<</if>>
+		<<if $militaryService == 0>>
+			<br>''Obligatory military service:'' every citizen is required to register and serve under the militia.
+			[[Implement|edicts][$militarizedSociety = 0, $militaryService = 1, $conscription = 0, $recruitVolunteers = 0, $cash -=5000, $authority -= 6000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will quickly replenish militia manpower and will cap at 10% of the total citizens population, but has a very high authority cost//
+		<</if>>
+		<<if $militarizedSociety == 0>>
+			<br>''Militarized Society:'' every adult citizen is required to train and participate in the defense of the arcology.
+			[[Implement|edicts][$militarizedSociety = 1, $militaryService = 0, $conscription = 0, $recruitVolunteers = 0, $cash -=5000, $authority -= 8000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will very quickly replenish militia manpower and will cap at 20% of the total citizens population, but has an extremely high authority cost//
+		<</if>>
+		
+		<<if militaryExemption == 0 && ($conscription == 1 || $militaryService == 1 || $militarizedSociety == 1)>>
+			<br>''Military exemption:'' allow citizens to avoid military duty by paying a weekly fee.
+			[[Implement|edicts][$militaryExemption = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slow down the replenishment of manpower, but will supply cash each week. More profitable with stricter recruitment laws.//
+		<</if>>
+		
+		<<if $arcologies[0].FSHedonisticDecadence >= 40>>
+		<<if $lowerRquirements == 0>>
+			<br>''@@.lime;Revised minimum requirements:@@'' will allow citizens outside the normally accepted range to join the militia.
+			[[Implement|edicts][$lowerRquirements = 1, $cash -=5000, $authority -= 1000, $militiaBaseDefense--, $militiaBaseHp--]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly lower defense and hp of militia units, but will increase the manpower replenishment rate.//
+		<</if>>
+		<</if>>
+		
+		<<if $arcologies[0].FSSubjugationist >= 40>>
+		<<if $noSubhumansInArmy == 0>>
+			<br>''@@.lime;No subhumans in the militia:@@'' prevent subhumans from joining the militia.
+			[[Implement|edicts][$noSubhumansInArmy = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance racial Subjugation, but will slow down slightly manpower replenishment.//
+		<</if>>
+		<</if>>
+			
+		<<if $arcologies[0].FSRepopulationFocus >= 40 && ($conscription == 1 || $militaryService == 1 || $militarizedSociety == 1)>>
+		<<if $pregExemption == 0>>
+			<br>''@@.lime;Military exemption for pregnancys:@@'' pregnant citizens will be allowed, and encouraged, to avoid military service.
+			[[Implement|edicts][$pregExemption = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance repopulation focus, but will slow down slightly manpower replenishment.//
+		<</if>>
+		<</if>>
+	<</if>>
+	
+	<<if $arcologies[0].FSPhysicalIdealist >= 40>>
+		<<if $martialSchool == 0>>
+			<br>''@@.lime;Slave martial schools:@@'' specialized schools will be set up to train slaves in martial arts and bodyguarding.
+			[[Implement|edicts][$martialSchool = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $slaveBaseMorale += 5]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase morale of slave units, but will incur in upkeep costs.//
+		<</if>>
+	<</if>>
 
-<<if $hasFoughtOnce == 1>>
-	<br>''Found the militia:'' lay the groundwork for the formation of the arcology's citizens' army.
-	[[Implement|edicts][$militiaFounded = 1, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]]
-	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow for the recruitment and training of citizens.//
+	<<if $arcologies[0].FSRestart >= 40>>
+		<<if $eliteOfficers == 0>>
+			<br>''@@.lime;Elite officers:@@'' officers will be exclusively recruited from the elite of society.
+			[[Implement|edicts][$eliteOfficers = 1, $cash -=5000, $authority -= 1000, $militiaBaseMorale += 5, $slaveBaseMorale -= 5]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance eugenics and provide a small morale boost to militia units, but will give a small morale malus to slave units.//
+		<</if>>
+	<</if>>
+	
+	<<if $arcologies[0].FSDegradationist >= 40>>
+		<<if $liveTargets == 0>>
+			<br>''@@.lime;Live targets drills:@@'' disobedient slaves will be used as live targets at shooting ranges.
+			[[Implement|edicts][$liveTargets = 1, $cash -=5000, $authority -= 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance degredationism and provide a small amount of exp to units, but will make the slave population slowly decline.//
+		<</if>>
+	<</if>>
 <</if>>
 
-<<if $militiaFounded == 1>>
-	<<if $recruitVolunteers == 0>>
-		<br>''Volunteers' militia:'' only volunteers will be accepted in the militia.
-		[[Implement|edicts][$militaryService = 0, $conscription = 0, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]]
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish milita manpower slowly and will cap at 2% of the total citizens population, but has a low authority cost//
+<<if $FSAnnounced>>
+	<br><br>__Future Societies:__
+	<<if $arcologies[0].FSRomanRevivalist >= 40 && $militiaFounded == 1>>
+		<<if $legionTradition == 0>>
+			<br>''@@.lime;Legionaries traditions:@@'' Fund specialized training for your recruits to turn them into the professional of Roman tradition.
+			[[Implement|edicts][$legionTradition = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $militiaBaseDefense += 2, $militiaBaseMorale += 5, $militiaBaseHp++]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase defense, morale and hp of militia units, but will incur in upkeep costs.//
+		<</if>>
 	<</if>>
-	<<if $conscription == 0>>
-		<br>''Conscription:'' every citizen is required to train in the militia and serve the arcology if the need arises.
-		[[Implement|edicts][$militaryService = 0, $conscription = 1, $recruitVolunteers = 0, $cash -=5000, $authority -= 4000]]
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish milita manpower moderatly fast and will cap at 5% of the total citizens population, but has a moderate authority cost//
+	
+	<<if $arcologies[0].FSEgyptianRevivalist >= 40 && $militiaFounded == 1>>
+		<<if $pharaonTradition == 0>>
+			<br>''@@.lime;Legionaries traditions:@@'' Fund specialized training for your recruits to turn them into an army worthy of a pharaon.
+			[[Implement|edicts][$pharaonTradition = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $militiaBaseAttack += 2, $militiaBaseDefense += 2, $militiaBaseMorale += 10]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, defense and morale of militia units, but will incur in upkeep costs.//
+		<</if>>
 	<</if>>
-	<<if $militaryService == 0>>
-		<br>''Obligatory military service:'' every citizen is required to register and serve under the militia.
-		[[Implement|edicts][$militaryService = 1, $conscription = 0, $recruitVolunteers = 0, $cash -=5000, $authority -= 4000]]
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will quickly replenish milita manpower and will cap at 10% of the total citizens population, but has a high authority cost//
+
+	<<if $arcologies[0].FSAztecRevivalist >= 40 && $mercenaries > 0>>
+		<<if $eagleWarriors == 0>>
+			<br>''@@.lime;Eagle warriors traditions:@@'' Fund specialized training for your mercenaries to turn them into the elite units of Aztec tradition.
+			[[Implement|edicts][$eagleWarriors = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $mercBaseAttack += 4, $mercBaseDefense -= 2, $mercBaseMorale += 10]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will give a high increase in attack and morale, but will lower defense of mercenary units and will incur in upkeep costs.//
+		<</if>>
 	<</if>>
-	<<if militaryExemption == 0 && ($conscription == 1 || $militaryService == 1)>>
-		<br>''Military exemption:'' allow citizens to avoid military duty by paying a weekly fee.
-		[[Implement|edicts][$militaryExemption = 1, $cash -=5000, $authority -= 1000]]
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slow down the replenishment of manpower, but will supply cash each week. More profitable with stricter recruitment laws.//
+
+	<<if $arcologies[0].FSEdoRevivalist >= 40 && $mercenaries > 0>>
+		<<if $ronin == 0>>
+			<br>''@@.lime;Ronin traditions:@@'' Fund specialized training for your mercenaries to turn them into the errant samurai of Japanese tradition.
+			[[Implement|edicts][$ronin = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $mercBaseAttack += 2, $mercBaseDefense += 2, $mercBaseMorale += 10]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, defense and morale of mercenary units, but will incur in upkeep costs.//
+		<</if>>
 	<</if>>
-<</if>>
 
-<br><br>__Future Societies Edicts:__
+	<<if $arcologies[0].FSArabianRevivalist >= 40>>
+		<<if $mamluks == 0>>
+			<br>''@@.lime;Mamluks traditions:@@'' Fund specialized training for your slaves to turn them into the mamluks slave soldiers of Arabian tradition.
+			[[Implement|edicts][$ronin = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $slaveBaseAttack += 2, $slaveBaseHp++, $slaveBaseMorale += 10]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, morale and hp of mercenary units, but will incur in upkeep costs.//
+		<</if>>
+	<</if>>
 
+	<<if $arcologies[0].FSChineseRevivalist >= 40>>
+		<<if $sunTzu == 0>>
+			<br>''@@.lime;Sun Tzu Teachings:@@'' Fund specialized training for your units and officers to comform your army to the teachings of the "Art of War".
+			[[Implement|edicts][$sunTzu = 1, $cash -=5000, $authority -= 1000, $militiaBaseAttack++, $militiaBaseDefense++, $mercBaseAttack++, $mercBaseDefense++, $slaveBaseAttack++, $slaveBaseDefense++, $militiaBaseMorale += 5, $mercBaseMorale += 5, $slaveBaseMorale += 5, $edictsUpkeep += 1000]]
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase attack, defense and morale of all units, but will incur in upkeep costs.//
+		<</if>>
+	<</if>>
+<</if>>
+<</if>> /* closes the check for at least 1000 authority */
\ No newline at end of file
diff --git a/src/SecExp/secBarracks.tw b/src/SecExp/secBarracks.tw
index a7b03658771..0c0e0dd5a88 100644
--- a/src/SecExp/secBarracks.tw
+++ b/src/SecExp/secBarracks.tw
@@ -107,6 +107,12 @@ While for many a sore sight in a free city, the barracks stand proud before you.
 __Units__
 <br>
 Your maximum number of units is <<print $maxUnits>>, currently you have <<print $activeUnits>>. <<if $secBarracksUpgrades.luxury > 0>>The barracks provide <<print $secBarracksUpgrades.luxury * 5>>% bonus morale in case of a battle.<</if>><<if $secBarracksUpgrades.training > 0>> The training facility will increase the effectiveness of your units with time.<</if>>
+<<if $arcologies[0].FSRomanRevivalist != "unset" || $arcologies[0].FSChineseRevivalist != "unset" || $arcologies[0].FSArabianRevivalist != "unset" || $arcologies[0].FSEdoRevivalist != "unset" || $arcologies[0].FSEgyptianRevivalist != "unset" || $arcologies[0].FSAztecRevivalist != "unset">>
+	<br>
+	<<link "Rename units to comform with future societies choices">>
+		/* TODO */
+	<</link>>
+<</if>>
 
 <br>
 <br>
diff --git a/src/SecExp/secInit.tw b/src/SecExp/secInit.tw
index f9c7e26e404..9eb4bb6268b 100644
--- a/src/SecExp/secInit.tw
+++ b/src/SecExp/secInit.tw
@@ -17,6 +17,38 @@
 <<set $PCvictories = 0>>
 <<set $PClossStreak = 0>>
 <<set $PClosses = 0>>
+<<set $oldFlux = 0>>
+
+/* edicts */
+<<set $edictsUpkeep = 0>>
+<<set $edictsAuthUpkeep = 0>>
+<<set $alternativeRents = 0>>
+<<set $enslavementRights = 0>>
+<<set $securityExemption = 0>>
+<<set $sellData = 0>>
+<<set $propCampaignBoost = 0>>
+<<set $slaveWatch = 0>>
+<<set $subsidyChurch = 0>>
+<<set $limitImmigration = 0>>
+<<set $openBorders = 0>>
+<<set $limitSubhumans = 0>>
+<<set $slavesOfficers = 0>>
+<<set $martialSchool = 0>>
+<<set $discountMercenaries = 0>>
+<<set $militiaFounded = 0>>
+<<set $recruitVolunteers = 0>>
+<<set $militaryService = 0>>
+<<set $militarizedSociety = 0>>
+<<set $militaryExemption = 0>>
+<<set $lowerRquirements = 0>>
+<<set $noSubhumansInArmy = 0>>
+<<set $pregExemption = 0>>
+<<set $eliteOfficers = 0>>
+<<set $liveTargets = 0>>
+<<set $legionTradition = 0>>
+<<set $eagleWarriors = 0>>
+<<set $ronin = 0>>
+<<set $sunTzu = 0>>
 
 /* buildings */
 <<set $upgradeUpkeep = 40>>
@@ -67,8 +99,6 @@
 <<set $secBotsUpgradeCost = 250>>
 <<set $equipUpgradeCost = 250>>
 <<set $maxTroops = 30>>
-<<set $militiaFounded = 0>>
-<<set $militiaRecruitment = 0>>
 <<set $militiaTotalManpower = 0>>
 <<set $militiaFreeManpower = 0>>
 <<set $militiaEmployedManpower = 0>>
diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw
index 35da5dd8eef..19fcc568213 100644
--- a/src/SecExp/securityReport.tw
+++ b/src/SecExp/securityReport.tw
@@ -98,7 +98,7 @@
 <<set _newSec = $security + _secGrowth + _secRest>>
 <<if _newSec < $security>>
 	This week @@.red;security decreased@@.
-<<elseif _newSec = $security>>
+<<elseif _newSec == $security>>
 	This week @@.yellow;security did not change@@.
 <<else>>
 	This week @@.green;security improved@@.
@@ -182,6 +182,111 @@
 <</if>>
 <<set $crime = _newCrime>>
 
-<br>
-
-<strong>Recruitment</strong>: here goes manpower gained this week.
\ No newline at end of file
+<br><br>
+<<if $militiaFounded == 1>>
+<strong>Recruitment</strong>: 
+<<if $recruitVolunteers == 1>>
+	Your militia accepts only volunteering citizens, ready to defend their arcology.
+	<<set _recruits = random(1,2)>>
+	<<if $rep >= 10000>>
+		Many citizens volunteer just to fight for someone of your renown.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $authority >= 10000>>
+		Many citizens feel it is their duty to fight for you, boosting volunteer enrollment.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $lowerRquirements == 1>>
+		Your lax phisical requirements to enter the militia allows for a greater number of citizens to join.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.02 * $ACitizens>>
+		<<set $militiaTotalManpower += _recruits>>
+		<<set $militiaFreeManpower += _recruits>>
+		This week <<print _recruits>> citizens joined the militia.
+	<<else>>
+		There are not many more citizens willing to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
+	<</if>>
+<<elseif $conscription == 1>>
+	Adult citizens are required to join the militia for a period of time.
+	<<set _recruits = random(3,5)>>
+	<<if $militaryExemption == 1>>
+		Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@.
+		<<set _recruits -= random(1,2)
+		<<set $cash += 250>>
+	<</if>>
+	<<if $lowerRquirements == 1>>
+		Your lax phisical requirements to enter the militia allows for a greater number of citizens to join.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $noSubhumansInArmy == 1>>
+		Guaranteeing the purity of your armed forces comes with a small loss of potential recruits.
+		<<set _recruits -= random(0,1)>>
+	<</if>>
+	<<if $pregExemption == 1>>
+		Many pregnant citizens prefer to avoid military service not to endager themselves and their children.
+		<<set _recruits -= 1>>
+	<</if>>
+	<<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.05 * $ACitizens>>
+		<<set $militiaTotalManpower += _recruits>>
+		<<set $militiaFreeManpower += _recruits>>
+		This week <<print _recruits>> citizens joined the militia.
+	<<else>>
+		There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
+	<</if>>
+<<elseif $militaryService == 1>>
+	Adult citizens are required to register and serve in the militia whenever necessary.
+	<<set _recruits = random(5,7)>>
+	<<if $militaryExemption == 1>>
+		Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@.
+		<<set _recruits -= random(1,2)
+		<<set $cash += 250>>
+	<</if>>
+	<<if $lowerRquirements == 1>>
+		Your lax phisical requirements to enter the militia allows for a greater number of citizens to join.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $noSubhumansInArmy == 1>>
+		Guaranteeing the purity of your armed forces comes with a small loss of potential recruits.
+		<<set _recruits -= random(0,1)>>
+	<</if>>
+	<<if $pregExemption == 1>>
+		Many pregnant citizens prefer to avoid military service not to endager themselves and their children.
+		<<set _recruits -= 1>>
+	<</if>>
+	<<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.10 * $ACitizens>>
+		<<set $militiaTotalManpower += _recruits>>
+		<<set $militiaFreeManpower += _recruits>>
+		This week <<print _recruits>> citizens joined the militia.
+	<<else>>
+		There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
+	<</if>>
+<<elseif $militarizedSociety == 1>>
+	Every citizen is required to train and participate in the military activities of the arcology.
+	<<set _recruits = random(7,9)>>
+	<<if $militaryExemption == 1>>
+		Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@.
+		<<set _recruits -= random(1,2)
+		<<set $cash += 250>>
+	<</if>>
+	<<if $lowerRquirements == 1>>
+		Your lax phisical requirements to enter the militia allows for a greater number of citizens to join.
+		<<set _recruits += 1>>
+	<</if>>
+	<<if $noSubhumansInArmy == 1>>
+		Guaranteeing the purity of your armed forces comes with a small loss of potential recruits.
+		<<set _recruits -= random(0,1)>>
+	<</if>>
+	<<if $pregExemption == 1>>
+		Many pregnant citizens prefer to avoid military service not to endager themselves and their children.
+		<<set _recruits -= 1>>
+	<</if>>
+	<<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.20 * $ACitizens>>
+		<<set $militiaTotalManpower += _recruits>>
+		<<set $militiaFreeManpower += _recruits>>
+		This week <<print _recruits>> citizens joined the militia.
+	<<else>>
+		There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
+	<</if>>
+<</if>>
+<</if>>
\ No newline at end of file
diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw
index c88c206b7bd..05c28390404 100644
--- a/src/js/economyJS.tw
+++ b/src/js/economyJS.tw
@@ -24,9 +24,6 @@ window.getCost = function(array) {
 	var secBarracks = State.variables.secBarracks;
 	var mercCosts = State.variables.mercenaries * 2000;
 	var policyCost = State.variables.policyCost;
-	var militia = State.variables.militiaUnits;
-	var slaves = State.variables.slaveUnits;
-	var mercs = State.variables.mercUnits;
 	var costs = (State.variables.brothel * facilityCost)
 		+ (State.variables.arcade * facilityCost * 0.5)
 		+ (State.variables.club * facilityCost)
@@ -77,19 +74,19 @@ window.getCost = function(array) {
 	if(secBarracks > 0) {
 		costs += State.variables.secBarracksUpkeep;
 	}
-	for (var i = 0; i < militia.length; i++) {
-		if( !(militia[i] === null) ){
-			costs += militia[i].troops * State.variables.soldierUpkeep;
+	for (var i = 0; i < State.variables.militiaUnits.length; i++) {
+		if( !(State.variables.militiaUnits[i] === null) ){
+			costs += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep;
 		}
 	}
-	for (var i = 0; i < slaves.length; i++) {
-		if( !(slaves[i] === null) ){
-			costs += slaves[i].troops * State.variables.soldierUpkeep * 0.5;
+	for (var i = 0; i < State.variables.slaveUnits.length; i++) {
+		if( !( State.variables.slaveUnits[i] === null) ){
+			costs +=  State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5;
 		}
 	}
-	for (var i = 0; i < mercs.length; i++) {
-		if( !(mercs[i] === null) ){
-			costs += mercs[i].troops * State.variables.soldierUpkeep * 1.5;
+	for (var i = 0; i < State.variables.mercUnits.length; i++) {
+		if( !(State.variables.mercUnits[i] === null) ){
+			costs += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5;
 		}
 	}
 	
diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw
index c63d31592eb..6746848e2a2 100644
--- a/src/uncategorized/arcmgmt.tw
+++ b/src/uncategorized/arcmgmt.tw
@@ -44,6 +44,12 @@
 	You @@.green;make friends@@ by tacitly supporting enslavement of upstart citizens.
 	<<set _flux += 10, $rep += 100>>
 <</if>>
+<<if $enslavementRights == 1>>
+	As the only legal entity in the arcology able to declare the status of a person as enslaved, you are able to @@.yellowgreen;collect fees@@ over enslavement of your citizens. Many of your citizens however are not enthusiastic about this, @@.red:damaging your authority.@@
+	<<set $authority -= 100>>
+	<<set $cash += _flux * 100>>
+<</if>>
+<<set $oldFlux = _flux>>
 <<set $ACitizens -= _flux, $ASlaves += _flux>>
 This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name's citizens fell into slavery.
 
@@ -62,32 +68,56 @@ This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name
 	<</if>>
 <</if>>
 
-<<set $oldACitizens = $ACitizens>> 
+<<set $oldACitizens = $ACitizens>>
+ <<set _immigrants = 0>>
 <<if $ACitizens >= $ACitizenLimit>>
 	<<set $ACitizens = $ACitizenLimit>>
 	Your arcology is currently home to as many citizens as it can house; unless the living areas are reconfigured, the citizen population will not increase.
 <<else>>
-	<<set $ACitizens += random(-10,10)>>
+	<<set _immigrants += random(-10,10)>>
 	<<if $ProImmigrationRep == 1>>
 		Your welcome program for new citizens helps encourage wealthy people from the old world to immigrate, but @@.red;annoys some longstanding citizens.@@
-		<<set $ACitizens += random(10,20), $rep -= 100>>
+		<<set _immigrants += random(10,20), $rep -= 100>>
 	<</if>>
 	<<if $ProImmigrationCash == 1>>
 		The rent promotion for new immigrants brings new citizens to the arcology.
-		<<set $ACitizens += random(10,20)>>
+		<<set _immigrants += random(10,20)>>
 	<</if>>
 	<<if $arcologies[0].FSRepopulationFocusLaw == 1>>
 		The rent promotion for pregnant women attracts several gravid ladies and a few girls eager to become mothers to enroll as citizens in your arcology.
-		<<set $ACitizens += random(5,10)>>
+		<<set _immigrants += random(5,10)>>
 	<</if>>
 	<<if $ACitizens < $ACitizenLimit*0.6>>
 		The availability of a large number of apartments encourages many new citizens to immigrate.
-		<<set $ACitizens += random(10,20)>>
+		<<set _immigrants += random(10,20)>>
+	<</if>>
+	<<if $limitSubhumans == 1>>
+		Subhumans are stopped and turned away as soon as they dare petition for citizenship in your arcology, slightly lowering immigrants numbers.
+		<<set _immigrants -= random(5,10)>>
+	<</if>>
+	<<if $openBorders == 1>>
+		The very liberal attituted towards immigration calls many hopeful immigrants to your arcology.
+		<<set _immigrants += random(10,20)>>
+	<</if>>
+	<<if $propCampaign >= 1 && $propFocus == "immigration">>
+		Your advertisement campaign outside the free city brings more people to the gates of your arcology.
+		<<if $propCampaignBoost == 0>>
+			<<set _immigrants += random(1,2) * $propCampaign>>
+		<<else>>
+			<<set _immigrants += random(1,4) * $propCampaign>>
+		<</if>>
+	<</if>>	
+	<<if $limitImmigration == 1>>
+		The strict limits on immigration keep the number of people coming in the arcology limited.
+		<<if _immigrants > 40>>
+			<<set _immigrants = 40>>
+		<</if>>
 	<</if>>
-	<<if $ACitizens <= 100>>
+<</if>>
+<<set $ACitizens += _immigrants>>
+<<if $ACitizens <= 100>>
 		Your arcology is home to an extremely small number of very wealthy citizens; wealth is as concentrated as possible and the citizen population will not decrease further.
 		<<set $ACitizens = 100>>
-	<</if>>
 <</if>>
 
 <<if $ASlaves >= $ASlaveLimit>>
@@ -114,6 +144,10 @@ This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name
 			$arcologies[0].name is quite prosperous, and they can afford to buy many pretty slaves.
 		<</if>>
 	<</if>>
+	<<if $liveTargets == 1>>
+		Disobedient slaves are used as live targets in the shooting ranges of the arcology<<if $secBarracks != 0>> and the barracks.<<else>>.<</if>>
+		<<set $ASlaves -= random(20,40)>>
+	<</if>>
 	<<if $ASlaves <= 1000>><<set $ASlaves = 1000>><</if>>
 <</if>>
 
@@ -197,6 +231,15 @@ $ACitizens citizens and <<print $ASlaves+$helots+$slaves.length>> slaves now liv
 	<<set $rentalMultiplier -= 0.1>>
 	Food vendors are offered subsidized rent and operating expenses to set up shop in your arcology.
 <</if>>
+<<if $alternativeRents == 1>>
+	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 $helots += random(0,5)>>
+<</if>>
+<<if $discountMercenaries == 1>>
+	Mercenaries willing to come to your arcology are given a discount on rent.
+	<<set $rentalMultiplier -= 0.1>>
+<</if>>
 <<if $arcologies[0].FSArabianRevivalistLaw == 1>>
 	<<set $rentalMultiplier += 0.1>>
 	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.
@@ -269,7 +312,16 @@ earning you @@.yellowgreen;¤_earnings.@@
 	<</if>>
 <</for>>
 <<if _refugees > 0>>
-	Some desperate people filtered into the arcology during the week: as owner, you were able to enslave _refugees of them.
+	Some desperate people filtered into the arcology during the week
+	<<if $propCampaign >= 1 && $propFocus == "enslavement">>
+		, many attracted by your advertisement campaigns
+		<<if $propCampaignBoost == 0>>
+			<<set _refugees += random(0,2)>>
+		<<else>>
+			<<set _refugees += random(0,4)>>
+		<</if>>
+	<</if>>.
+	As owner, you were able to enslave _refugees of them.
 	<<set $helots += _refugees>>
 <</if>>
 
@@ -318,6 +370,8 @@ earning you @@.yellowgreen;¤_earnings.@@
 			<</if>>
 		<</if>>
 	<</if>>
+	
+	
 	<<if $arcologies[0].FSNull != "unset">>
 		Your cultural openness is a powerful driver of economic activity.
 		<<set _AWeekGrowth += Math.trunc($arcologies[0].FSNull/25)>>
diff --git a/src/uncategorized/economics.tw b/src/uncategorized/economics.tw
index 3ca8a43c94a..903125d457e 100644
--- a/src/uncategorized/economics.tw
+++ b/src/uncategorized/economics.tw
@@ -67,15 +67,15 @@
 	<<if $corpAnnounced == 1>>
 	<button class="tablinks" onclick="opentab(event, 'Corporation')">Corporation</button>
 	<</if>>
-	<button class="tablinks" onclick="opentab(event, 'Reputation')">Reputation</button>
+	<button class="tablinks" onclick="opentab(event, 'Reputation')">Reputation and Authority</button>
 	<button class="tablinks" onclick="opentab(event, 'Management')">Arcology Management</button>
 	<<if ($PC.boobs == 1 && $PC.boobsBonus > 0) || $PC.pregKnown == 1 || $playerAging != 0>>
 	<button class="tablinks" onclick="opentab(event, 'Personal')">Personal Notes</button>
 	<</if>>
-	<button class="tablinks" onclick="opentab(event, 'securityReport')">Security Report</button>
 	<<if $FSAnnounced > 0>>
 	<button class="tablinks" onclick="opentab(event, 'Societies')">Society Development</button>
 	<</if>>
+	<button class="tablinks" onclick="opentab(event, 'securityReport')">Security Report</button>
 </div>
 
 <div id="Arcologies" class="tabcontent">
diff --git a/src/uncategorized/fsDevelopments.tw b/src/uncategorized/fsDevelopments.tw
index 06dbdfc822e..035bbf2832e 100644
--- a/src/uncategorized/fsDevelopments.tw
+++ b/src/uncategorized/fsDevelopments.tw
@@ -234,6 +234,14 @@
         <<set _broadProgress += 1>>
     <</if>>
 <</if>>
+<<if $propCampaign == 0 && $propFocus == "social engineering">>
+	Your propaganda campaign helps further your societal engineering efforts.
+	<<if $propCampaignBoost == 1>>
+		<<set _broadProgress += 2>>
+	<<else>>
+		<<set _broadProgress += 1>>
+	<</if>>
+<</if>>
 <<if $terrain == "urban">>
 	The @@.yellow;urban location@@ of the arcology naturally promotes cultural interchange, holding back $arcologies[0].name's cultural independence.
 	<<set _broadProgress -= 3>>
@@ -368,6 +376,31 @@
 	<</if>>
 <</if>>
 
+<<if $slaveWatch == 1>>
+	The Slave Mistreatment Watch helps many slaves, easing your citizens into the paternalist ideals it represents.
+	<<set $arcologies[0].FSPaternalist += 2>>
+<</if>>
+
+<<if $noSubhumansInArmy == 1>>
+	Your army is free of subhumans, further cementing their lower status in the eyes of your citizens.
+	<<set $arcologies[0].FSSubjugationist += 2>>
+<</if>>
+
+<<if $pregExemption == 1>>
+	Pregnant citizens are allowed and encouraged to avoid military service, making their value evident to all citizens.
+	<<set $arcologies[0].FSRepopulationFocus += 2>>
+<</if>>
+
+<<if $eliteOfficers == 1>>
+	Purity in leadership is fundamental in your army, helping eugenics ideals spread in the populace.
+	<<set $arcologies[0].FSRestart += 2>>
+<</if>>
+
+<<if $liveTargets == 1>>
+	Disobedient slaves are used in shooting ranges and military drills as live targets, furthering degradationist ideals.
+	<<set $arcologies[0].FSDegradationist += 2>>
+<</if>>
+
 /* Promenade effects */
 <<for _i = 5; _i <= 7; _i++>>
 <<if $sectors[_i].type != "Shops">>
diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw
index 0c4d9c96096..412ebd08426 100644
--- a/src/uncategorized/persBusiness.tw
+++ b/src/uncategorized/persBusiness.tw
@@ -531,6 +531,48 @@
 <</if>>
 <</if>>
 
+<<if $sellData == 1>>
+	<<set _upgradeCount = 0>>
+	<<if $secUpgrades.nanoCams == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $secUpgrades.cyberBots == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $secUpgrades.eyeScan == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $secUpgrades.cryptoAnalyzer == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $crimeUpgrades.autoTrial == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $crimeUpgrades.autoArchive == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $crimeUpgrades.worldProfiler == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $crimeUpgrades.advForensic == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $intelUpgrades.sensors == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $intelUpgrades.radar == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<if $intelUpgrades.signalIntercept == 1>>
+		<<set _upgradeCount += 1>>
+	<</if>>
+	<<set _dataGain = _upgradeCount * 200>>
+	You are selling the data collected by your security department, making @@.yellowgreen;¤<<print _dataGain>>@@.
+	<<set $cash += _dataGain>>
+	Many of your citizens are not enthusiastic of this however, @@.red;damaging your authority@@.
+	<<set $authority -= 100>>
+<</if>>
+
 Routine upkeep of your demesne costs @@.yellow;¤$costs.@@
 <<if $plot == 1>>
 <<if $week > 10>>
diff --git a/src/uncategorized/reputation.tw b/src/uncategorized/reputation.tw
index dfb0ee53624..c68a1ba7830 100644
--- a/src/uncategorized/reputation.tw
+++ b/src/uncategorized/reputation.tw
@@ -663,3 +663,7 @@ On formal occasions, you are announced as $PCTitle.
 		The Societal Elite @@.red;mutter about you@@.
 	<</if>>
 <</if>>
+
+<br><br>
+
+<<include "authorityReport">>
\ No newline at end of file
diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw
index 3304b0945fc..117392d9d6a 100644
--- a/src/uncategorized/storyCaption.tw
+++ b/src/uncategorized/storyCaption.tw
@@ -240,7 +240,7 @@
 <<else>>
 	@@color:rgb(148,0,211);harmless@@
 <</if>>
-($authority)
+(<<print $authority>>)
 </span>
 <br>@@.deepskyblue;Security@@ | @@.deepskyblue;<<print Math.trunc($security)>>%@@
 <br>@@.orangered;Crime@@ | @@.orangered;<<print Math.trunc($crime)>>%@@
@@ -428,6 +428,7 @@
 		<</if>>
 		<br><span id="PAOButton"><<link [[Personal Assistant|Personal assistant options]]>><</link>></span> @@.cyan;[T]@@
 		<br><span id="policyButton"><<link [[Policies]]>><</link>></span> @@.cyan;[Y]@@
+		<br><<link [[Edicts|edicts]]>><</link>>
 		<<if $FSAnnounced>>
 			<br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@
 		<</if>>
@@ -456,8 +457,8 @@
 		<br><span id="SFMButton"><<link [[SF Barracks|SFM Barracks]]>><</link>></span> @@.cyan;[Z]@@
 	<</if>>
 	<br><span id="PAOButton"><<link [[Personal Assistant|Personal assistant options]]>><</link>></span> @@.cyan;[T]@@
-	<br>
 	<br><span id="policyButton"><<link [[Policies]]>><</link>></span> @@.cyan;[Y]@@
+	<br><<link [[Edicts|edicts]]>><</link>>
 	<<if $FSAnnounced>>
 		<br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@
 	<</if>>
-- 
GitLab