From 5f40ec6b08aa68a679e8159b9a49331a78b51f93 Mon Sep 17 00:00:00 2001
From: hexall90 <hexall90@gmail.com>
Date: Sun, 8 Oct 2017 17:18:06 +0200
Subject: [PATCH] finished most of the work

---
 TODO.txt                                  |   9 +-
 src/SecExp/SecExpBackwardCompatibility.tw |  18 +-
 src/SecExp/attackHandler.tw               |  46 +++-
 src/SecExp/attackReport.tw                |  61 ++++-
 src/SecExp/authorityReport.tw             | 151 ++++++++++-
 src/SecExp/edicts.tw                      |   4 +-
 src/SecExp/propagandaHub.tw               |  10 +-
 src/SecExp/secInit.tw                     |   8 +-
 src/SecExp/securityReport.tw              | 316 ++++++++++++++--------
 src/events/intro/pcExperienceIntro.tw     |  12 +-
 src/uncategorized/arcmgmt.tw              |  26 +-
 src/uncategorized/persBusiness.tw         |  10 +-
 src/uncategorized/reputation.tw           |   5 +
 13 files changed, 509 insertions(+), 167 deletions(-)

diff --git a/TODO.txt b/TODO.txt
index 47b5eb76b3e..e48a4a2dbcd 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,11 +1,6 @@
--add wounds description to the battle report
--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 security/authority and crime choices to game creation
+-add fortifications?
 -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
+-gender fundamentalism does not allow women in army/gerder radicalism does?
diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw
index 3045b146d6b..61f2514a823 100644
--- a/src/SecExp/SecExpBackwardCompatibility.tw
+++ b/src/SecExp/SecExpBackwardCompatibility.tw
@@ -360,18 +360,24 @@
 	<<set $bribeCost = 0>>
 <</if>>
 <<if ndef $tacticsSuccessful>>
-	<<set $tacticsSuccessful == 0>>
-<</if>>
-<<if ndef $auto>>
-	<<set $auto = 0>>
+	<<set $tacticsSuccessful = 0>>
 <</if>>
 <<if ndef $leaderWounded>>
 	<<set $leaderWounded = 0>>				/* 0=no wound, 1=mute, 2=blind, 3=amputee, 4=health */
 <</if>>
 <<if ndef $gainedCombat>>
-	<<set $gainedCombat == 1>>
+	<<set $gainedCombat == 0>>
+<</if>>
+<<if ndef $gainedWarfare>>
+<<set $gainedWarfare = 0>>
+<</if>>
+<<if ndef $PCWounded>>
+<<set $PCWounded = 0>>
 <</if>>
-	
+<<if ndef $PCWoundCooldown>>
+<<set $PCWoundCooldown = 0>>
+<</if>>
+
 /* statistics */
 <<if ndef $baseBribePerAttacker>>
 <<set $baseBribePerAttacker = 5>>
diff --git a/src/SecExp/attackHandler.tw b/src/SecExp/attackHandler.tw
index f250b5ba0e5..b583fe7696e 100644
--- a/src/SecExp/attackHandler.tw
+++ b/src/SecExp/attackHandler.tw
@@ -88,9 +88,43 @@
 	<</if>>
 	/* 80% chance of increasing warfare */
 	<<if $PC.warfare < 100 && random(1,100) <= 80>>
+		<<set $gainedWarfare = 1>>
 		<<set $PC.warfare += 10>>
 		<<set $PC.warfare = Math.clamp($PC.warfare,-100,100)>>
 	<</if>>
+		/* does the PC get wounded? */
+	<<if $PC.career == "mercenary" || $PC.career == "gang">>
+		<<set _woundChance -= 3>>
+	<</if>>
+	<<if $PC.physicalAge >= 60>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.belly > 5000>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.boobsBonus >= 2>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.butt >= 2>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.preg >= 30>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.balls == 2>>
+		<<set _woundChance += 1>>
+	<</if>>
+	<<if $PC.ballsImplant >= 2>>
+		<<set _woundChance += 1>>
+	<</if>>	
+	<<if random(1,100) <= _woundChance>>
+		<<set $leaderWounded = 1>>
+		<<set _militiaMod -= 0.2>>
+		<<set _slaveMod -= 0.2>>
+		<<set _mercMod -= 0.2>>
+		<<set _enemyMod += 0.2>>
+		<<set $PCWounded = 1>>
+	<</if>>
 <<elseif $leadingTroops == "assistant">>
 	<<if $rep < 10000 && $authority < 10000>>
 		<<set _militiaMod -= 0.15>>
@@ -184,9 +218,6 @@
 	<<if $Bodyguard.preg >= 30>>
 		<<set _woundChance += 1>>
 	<</if>>
-	<<if $Bodyguard.preg >= 30>>
-		<<set _woundChance += 1>>
-	<</if>>
 	<<if $Bodyguard.dick >= 8>>
 		<<set _woundChance += 1>>
 	<</if>>
@@ -211,13 +242,13 @@
 			<<set $Bodyguard.amp = 1>>
 		<<elseif $woundType >= 4>>
 			<<if $Bodyguard.health >= -60>>
-				<<set $Bodyguard.health -= 40>>
+				<<set $Bodyguard.health -= 30>>
 			<<else>>
-				<<set $Bodyguard.health -= Math.abs(100 + $Bodyguard.health)>>
+				<<set $Bodyguard.health -= Math.abs(90 - $Bodyguard.health)>>
 			<</if>>
 		<</if>>
 	<</if>>
-	/* 60% chance of getting combat skill if nto already have it */
+	/* 60% chance of getting combat skill if not already have it */
 	<<if $Bodyguard.combatSkill == 0 && random(1,100) <= 60>>
 		<<set $gainedCombat == 1>>
 		<<set $Bodyguard.combatSkill = 1>>
@@ -300,9 +331,6 @@
 	<<if $HeadGirl.preg >= 30>>
 		<<set _woundChance += 1>>
 	<</if>>
-	<<if $HeadGirl.preg >= 30>>
-		<<set _woundChance += 1>>
-	<</if>>
 	<<if $HeadGirl.dick >= 8>>
 		<<set _woundChance += 1>>
 	<</if>>
diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw
index 366dbf29755..62c589bc256 100644
--- a/src/SecExp/attackReport.tw
+++ b/src/SecExp/attackReport.tw
@@ -34,7 +34,7 @@
 
 
 <<if $attackType == "raiders">>
-	Today, the $day of $month $year, our arcology was attacked by a band of wild raiders, $attackTroops men strong. Our defense forces clashed with them 
+	Today, the <<print $day + random(0,7)>> of $month, $year, our arcology was attacked by a band of wild raiders, $attackTroops men strong. Our defense forces clashed with them 
 	<<if $battleTerrain == "urban">>
 		in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
 		<<elseif $battleTerrain == "rural">>
@@ -93,7 +93,7 @@
 		You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls.
 	<</if>>
 <<elseif $attackType == "free city">>
-	Today, the $day of $month, $year, our arcology was attacked by a contingent of mercenaries hired by a competing free city, $attackTroops men strong. Our defense forces clashed with them 
+	Today, the <<print $day + random(0,7)>> of $month, $year, our arcology was attacked by a contingent of mercenaries hired by a competing free city, $attackTroops men strong. Our defense forces clashed with them 
 	<<if $battleTerrain == "urban">>
 		in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
 	<<elseif $battleTerrain == "rural">>
@@ -152,7 +152,7 @@
 		You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls.
 	<</if>>
 <<elseif $attackType == "freedom fighters">>
-	Today, the $day of $month, $year, our arcology was attacked by a group of freedom fighters bent on the destruction of the institution of slavery, $attackTroops men strong. Our defense forces clashed with them 
+	Today, the <<print $day + random(0,7)>> of $month, $year, our arcology was attacked by a group of freedom fighters bent on the destruction of the institution of slavery, $attackTroops men strong. Our defense forces clashed with them 
 	<<if $battleTerrain == "urban">>
 		in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
 	<<elseif $battleTerrain == "rural">>
@@ -211,7 +211,7 @@
 		You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls.
 	<</if>>
 <<elseif $attackType == "old world">>
-	Today, the $day of $month, $year, our arcology was attacked by an old world nation boasting a misplaced sense of superiority, $attackTroops men strong. Our defense forces clashed with them 
+	Today, the <<print $day + random(0,7)>> of $month, $year, our arcology was attacked by an old world nation boasting a misplaced sense of superiority, $attackTroops men strong. Our defense forces clashed with them 
 	<<if $battleTerrain == "urban">>
 		in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
 	<<elseif $battleTerrain == "rural">>
@@ -641,6 +641,13 @@
 	<<elseif $PC.warfare >= 75>>
 		Your great experience in military matters has a major positive impact on your troops performance and the effectiveness of your battleplan.
 	<</if>>
+	<<if $gainedWarfare == 1>>
+		Battlefield experience increased your understanding of warfare, making you a better commander.
+	<</if>>
+	<<if $PCWounded == 1>>
+		During the fighting @@.red;you were wounded@@. Your medics assure you it's nothing life threatening, but you'll be weakened for a few weeks.
+		<<set $PCWoundCooldown = 6>>
+	<</if>>
 <<elseif $leadingTroops == "assistant">>
 	<<if $auto == 1>>$assistantName<<else>>You<</if>> let your personal assistant lead the troops.
 	<<if $deployingMercs == 1 || $deployingMilitia == 1 || $deployingSlaves == 1>>
@@ -721,6 +728,21 @@
 	<<elseif $Bodyguard.intelligence <= -1>>
 		She lacks the experience and the intelligence to be an effective commander, the performance of your troops suffers because of her poor leadership.
 	<</if>>
+	<<if $gainedCombat == 1>>
+		During the battle, she had to fight for her life, giving her experience in modern combat. She is now proficient with modern firearms and hand to hand combat.
+	<</if>>
+	<<if $woundType != 0>>
+		Unfortunately @@.red;she reported injuries@@.
+		<<if $woundType == 1>>
+			A stray bullet hit her neck. While she fortunately avoided fatal hemorrhages, her vocal cords were irreparably damaged. 
+		<<elseif $woundType == 2>>
+			A few sharpnels found her eyes as final target, blinding her permanently.
+		<<elseif $woundType == 3>>
+			A granade landed close to her, rendering her a quadruple amputee.
+		<<elseif $woundType >= 4>>
+			While grave wounds, it seems she will be able to fully recover, given enough time.
+		<</if>>
+	<</if>>
 <<elseif $leadingTroops == "headGirl">>
 	<<if $auto == 1>>$assistantName<<else>>You<</if>> decided it will be your head girl to lead the troops.
 	<<if $deployingSlaves == 1>>
@@ -785,7 +807,21 @@
 	<<elseif $HeadGirl.intelligence <= -1>>
 		She lacks the experience and the intelligence to be an effective commander, the performance of your troops suffers because of her poor leadership.
 	<</if>>
-
+	<<if $gainedCombat == 1>>
+		During the battle, she had to fight for her life, giving her experience in modern combat. She is now proficient with modern firearms and hand to hand combat.
+	<</if>>
+	<<if $woundType != 0>>
+		Unfortunately @@.red;she reported injuries@@.
+		<<if $woundType == 1>>
+			A stray bullet hit her neck. While she fortunately avoided fatal hemorrhages, her vocal cords were irreparably damaged. 
+		<<elseif $woundType == 2>>
+			A few sharpnels found her eyes as final target, blinding her permanently.
+		<<elseif $woundType == 3>>
+			A granade landed close to her, rendering her a quadruple amputee.
+		<<elseif $woundType >= 4>>
+			While grave wounds, it seems she will be able to fully recover, given enough time.
+		<</if>>
+	<</if>>
 <<elseif $leadingTroops == "citizen">>
 	<<if $auto == 1>>$assistantName<<else>>You<</if>> decided to appoint one of your volunteers as the commander.
 	<<if $arcologies[0].FSDegradationist == "unset" && $arcologies[0].FSPaternalist == "unset">>
@@ -1060,9 +1096,9 @@
 	<</if>>
 <</if>>
 <<if $tacticsSuccessful == 1>>
-	In the end <<if $leadingTroops == "PC">>you<<else>>your commander<</if>> @@.green;was able to successfully employ <<print $chosenTactic>> tactics@@, greatly enhancing the efficacy of your army.
+	In the end <<if $leadingTroops == "PC">>you were<<else>>your commander was<</if>> @@.green;able to successfully employ <<print $chosenTactic>> tactics@@, greatly enhancing the efficacy of your army.
 <<else>>
-	In the end <<if $leadingTroops == "PC">>you<<else>>your commander<</if>> @@.red;was not able to effectively employ <<print $chosenTactic>> tactics@@, greatly affecting the efficacy of your army.
+	In the end <<if $leadingTroops == "PC">>you were<<else>>your commander was<</if>> @@.red;not able to effectively employ <<print $chosenTactic>> tactics@@, greatly affecting the efficacy of your army.
 <</if>>
 	
 <br>
@@ -1111,6 +1147,7 @@
 					, however 
 					<<print math.trunc(_loss * $militiaUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit.
 					<<set $militiaUnits[_i].troops -= Math.trunc(_loss - _loss * $militiaUnits[_i].medics * 0.25)>>
+					<<set $militiaTotalCasualties += Math.trunc(_loss - _loss * $militiaUnits[_i].medics * 0.25)>>
 				<<else>>
 					.
 				<</if>>
@@ -1118,7 +1155,7 @@
 					<<set $militiaUnits[_i].active = 0>>
 					Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The remnants will be sent home honored as veterans or reorganized in a new unit. 
 				<<elseif $militiaUnits[_i].troops <= 10>>
-					The unit has very few operatives left, it risks compelte annihilation if deployed again.
+					The unit has very few operatives left, it risks complete annihilation if deployed again.
 				<</if>>
 			<</if>>
 		<</for>>
@@ -1143,6 +1180,7 @@
 					, however 
 					<<print math.trunc(_loss * $slaveUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit.
 					<<set $slaveUnits[_i].troops -= Math.trunc(_loss - _loss * $slaveUnits[_i].medics * 0.25)>>
+					<<set $slavesTotalCasualties += Math.trunc(_loss - _loss * $slaveUnits[_i].medics * 0.25)>>
 				<<else>>
 					.
 				<</if>>
@@ -1158,7 +1196,7 @@
 		<<for _i = 0; _i < _meL; _i++>>
 			<<if $mercUnits[_i].isDeployed == 1>>
 				<br>
-				$mercUnits[_i].platoonName participated in the battle. Mercenaries are a comon sight on the modern battlefield and yours are proud to serve their generous contractor.
+				$mercUnits[_i].platoonName participated in the battle. Mercenaries are a common sight on the modern battlefield and yours are proud to serve their generous contractor.
 				During the battle they suffered 
 				<<if _loss <= 10>>
 					light casualties
@@ -1173,6 +1211,7 @@
 					, however 
 					<<print math.trunc(_loss * $mercUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit.
 					<<set $mercUnits[_i].troops -= Math.trunc(_loss - _loss * $mercUnits[_i].medics * 0.25)>>
+					<<set $mercTotalCasualties += Math.trunc(_loss - _loss * $mercUnits[_i].medics * 0.25)>>
 				<<else>>
 					.
 				<</if>>
@@ -1233,7 +1272,9 @@
 	
 /* resets variables */
 <<set $leaderWounded = 0>>
-<<set $auto = 0>>
+<<set $PCWounded = 0>>
+<<set $gainedWarfare = 0>>
+<<set $woundType = 0>>
 <<set $tacticsSuccessful == 0>>
 <<set $attackType = "none">>
 <<set $chosenTactic = "none">>
diff --git a/src/SecExp/authorityReport.tw b/src/SecExp/authorityReport.tw
index b17fb55504c..f37349b2566 100644
--- a/src/SecExp/authorityReport.tw
+++ b/src/SecExp/authorityReport.tw
@@ -1,3 +1,152 @@
 :: authorityReport [nobr]
 
-authority stuff
\ No newline at end of file
+<<if $authority > 19500>>
+	Your authority is nearly absolute. The arcology is yours to command as it pleases you.
+<<elseif $authority > 15000>>
+	Your authority is extremely high. There's little you cannot do within the walls of your arcology.
+<<elseif $authority > 10000>>
+	Your authority is high. You command respect and fear in equal measure.
+<<elseif $authority > 5000>>
+	Your authority is moderate. You command some respect from your citizens.
+<<else>>
+	Your authority is low. You command no respect or fear from your citizens.
+<</if>>
+
+<<if $PC.career == "wealth">>
+	As part of the idle wealth, you were used to have obedience coming naturally to you. Now you find it harder to maintain authority over the arcology.
+	<<set _authGrowth -= 10 * random(5,15)>>
+<<elseif $PC.career == "slaver">>
+	Your past as a slaver helps you assert your authority over the arcology.
+	<<set _authGrowth += 10 * random(5,15)>>
+<<elseif $PC.career == "escort">>
+	Given your past career as an escort, you find it hard to assert your authority over the arcology and its inhabitants.
+	<<set _authGrowth -= 10 * random(5,15)>>
+<<elseif $PC.career == "servant">>
+	Given your past career as a servant, you find it hard to assert your authority over the arcology and its inhabitants.
+	<<set _authGrowth -= 10 * random(5,15)>>
+<<elseif $PC.career == "gang">>
+	Given your past life as a gang leader, you find it easier to assert your authority over the arcology and its inhabitants.
+	<<set _authGrowth += 10 * random(5,15)>>
+<</if>>
+<<set _authGrowth = 0>>
+<<if $rep >= 19500>>
+	Your legend is so well known that your mere presence command respect and obedience, increasing your authority.
+	<<set _authGrowth += 10 * random(10,20)>>
+<<elseif $rep >= 15000>>
+	Your reputation is so high that your mere presence command respect, increasing your authority.
+	<<set _authGrowth += 10 * random(5,15)>>
+<<elseif $rep >= 10000>>
+	Your reputation is high enough that your presence command some respect, increasing your authority.
+	<<set _authGrowth += 10 * random(2,8)>>
+<</if>>
+
+<<if $security >= 90>>
+	Your arcology is incredibly secure and your citizens know quite well who to thank, greatly increasing your authority.
+	<<set _authGrowth += 10 * random(10,20)>>
+<<elseif $security >= 70>>
+	Your arcology is really secure and your citizens know quite well who to thank, increasing your authority.
+	<<set _authGrowth += 10 * random(5,15)>>
+<<elseif $security >= 50>>
+	Your arcology is quite secure and your citizens know who to thank, increasing your authority.
+	<<set _authGrowth += 10 * random(2,8)>>
+<</if>>
+
+<<if $crime >= 90>>
+	The all powerful criminal organizations controlling the arcology has a easy time undermining your authority.
+	<<set _authGrowth -= 10 * random(10,20)>>
+<<elseif $crime >= 70>>
+	Crime is king in the arcology, powerful criminals  have a easy time undermining your authority.
+	<<set _authGrowth -= 10 * random(5,15)>>
+<<elseif $crime >= 50>>
+	Criminal organizations have a strong foothold in the arcology, their activities undermine your authority.
+	<<set _authGrowth -= 10 * random(2,8)>>
+<</if>>
+
+<<if $averageDevotion >= 50 && $averageTrust >= 50>>
+	The high devotion and trust of your slaves speak eloquently of your leadership capabilities, helping your authority grow.
+	<<set _authGrowth += 5 * (($averageDevotion + $averageTrust) / 10)>>
+<<elseif $averageDevotion >= 50>>
+	The high devotion of your slaves speak eloquently of your leadership capabilities, helping your authority grow.
+	<<set _authGrowth += 5 * ($averageDevotion / 10)>>
+<<elseif $averageTrust >= 50>>
+	The high trust of your slaves speak eloquently of your leadership capabilities, helping your authority grow.
+	<<set _authGrowth += 5 * ($averageTrust / 10)>>
+<</if>>
+
+<<if $arcologies[0].ownership >= 90>>
+	You own so much of the arcology that your authority quickly increases.
+	<<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>>
+<<elseif $arcologies[0].ownership >= 70>>
+	You own a big part of the arcology, causing your authority to increase.
+	<<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>>
+<<elseif $arcologies[0].ownership >= 50>>
+	You own the majority of the arcology, causing your authority to slowly increase.
+	<<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>>
+<<else>>
+	Your low ownership of the arcology causes your authority to decrease.
+	<<set _authGrowth -= 5 * Math.trunc($arcologies[0].ownership / 10)>>
+<</if>>
+
+<<if $activeUnits >= 9>>
+	Your military is massive, commanding so many troops greatly increases your authority.
+	<<set _authGrowth += 12 * $activeUnits)>>
+<<elseif $activeUnits >= 7>>
+	Your military is huge, commanding such a number of soldiers increases your authority.
+	<<set _authGrowth += 12 * $activeUnits)>>
+<<elseif $activeUnits >= 4>>
+	Your military is at a decent size, commanding a small army increases your authority.
+	<<set _authGrowth += 12 * $activeUnits)>>
+<</if>>
+
+<<if $arcologies[0].FSChattelReligionist >= 90>>
+	Religious organizations have a tight grip on the minds of your residents and their dogma greatly helps your authority grow.
+	<<set _authGrowth += $arcologies[0].FSChattelReligionist>>
+<<elseif $arcologies[0].FSChattelReligionist >= 90>>
+	Religious organizations have a tight grip on the minds of your residents and their dogma helps your authority grow.
+	<<set _authGrowth += $arcologies[0].FSChattelReligionist>>
+<</if>>
+
+<<if $arcologies[0].FSRestart >= 90>>
+	The arcology's society is extremely stratified. The reliance on the societal elite by the lower classes greatly increases your reputation.
+	<<set _authGrowth += $arcologies[0].FSRestart>>
+<<elseif $arcologies[0].FSRestart >= 50>>
+	The arcology's society is very stratified. The reliance on the societal elite by the lower classes increases your reputation.
+	<<set _authGrowth += $arcologies[0].FSRestart>>
+<</if>>
+
+<<if $arcologies[0].FSPaternalist >= 90>>
+	Your extremely paternalistic society has the unfortunate side effects of spreading dangerous ideals in the arcology, damaging your authority.
+	<<set _authGrowth -= $arcologies[0].FSPaternalist>>
+<<elseif $arcologies[0].FSPaternalist >= 50>>
+	Your paternalistic society has the unfortunate side effects of spreading dangerous ideals in the arcology, damaging your authority.
+	<<set _authGrowth -= $arcologies[0].FSPaternalist>>
+<</if>>
+
+<<if $arcologies[0].FSNull >= 90>>
+	Cultural openess allows dangerous ideas to spread in your arcology, damaging your reputation.
+	<<set _authGrowth -= $arcologies[0].FSNull>>
+<<elseif $arcologies[0].FSNull >= 50>>
+	Cultural openess allows dangerous ideas to spread in your arcology, damaging your reputation.
+	<<set _authGrowth -= $arcologies[0].FSNull>>
+<</if>>
+
+<<if $miniTruth >= 1>>
+	Your authenticity department works tirelessly to impose your authority in all the arcology.
+	<<set _authGrowth += 15 * $miniTruth>>
+<</if>>
+
+<<if $secretService >= 1>>
+	Your secret services constantly keep under surveillance any potential threat, intervenening when necessary. Rumors of the secretive security service and mysterious disappereances make increase your authority.
+	<<set _authGrowth += 15 * $secretService>>
+<</if>>
+This week
+<<if _authGrowth > 0>>
+	@@.green;authority has increased@@.
+<<elseif _authGrowth == 0>>
+	@@.yellow;authority did not change@@.
+<<else>>
+	@@.red;authority has decreased@@.
+<</if>>
+
+<<set $authority += _authGrowth>>
+<<set $authority = Math.trunc(Math.clamp($authority, 0, 20000))>>
diff --git a/src/SecExp/edicts.tw b/src/SecExp/edicts.tw
index 06c9f07d63d..780f80782a8 100644
--- a/src/SecExp/edicts.tw
+++ b/src/SecExp/edicts.tw
@@ -1,7 +1,7 @@
 :: edicts [nobr]
 
 <<set $nextButton = "Back">>
-<<set $nextLink = "Main">
+<<set $nextLink = "Main">>
 
 ''__Active Edicts__''
 
@@ -35,6 +35,7 @@
 	[[Repeal|edicts][$subsidyChurch = 0, $edictsUpkeep -= 1000]]
 <</if>>
 
+<<if $limitImmigration == 1 || $openBorders == 1>>
 <br><br>__Immigration:__
 
 <<if $limitImmigration == 1>>
@@ -46,6 +47,7 @@
 	<br>''Open borders:'' you have lowered considerably the requirements to become citizens.
 	[[Repeal|edicts][$openBorders = 0]]
 <</if>>
+<</if>>
 
 <<if $hasFoughtOnce == 1>>
 <br><br>Defense Force:__
diff --git a/src/SecExp/propagandaHub.tw b/src/SecExp/propagandaHub.tw
index 98b9e408203..5a6ad2f4293 100644
--- a/src/SecExp/propagandaHub.tw
+++ b/src/SecExp/propagandaHub.tw
@@ -117,7 +117,7 @@ The propaganda hub is a surprisingly inconspicuous building, dimly lit from the
 			<<goto "propagandaHub">>
 		<</link>>
 		<br>Install an automatic news generator, able to fabricate thousands of plausible sounding news every day.
-		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The authenticity dept. now provides reputation as well as authority, but increases upkeep.//
+		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The authenticity dept. now provides a small amount of reputation as well as authority, but increases upkeep.//
 	<<else>>
 		You have installed an automatic news generator.
 	<</if>>
@@ -129,8 +129,8 @@ The propaganda hub is a surprisingly inconspicuous building, dimly lit from the
 			<<set $propHubUpkeep += $upgradeUpkeep>>
 			<<goto "propagandaHub">>
 		<</link>>
-		<br>Institute a system able to release erroneous, but plausible, information about your business, leading your competitors to prepared economical traps.
-		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. Will increase prosperity each week, but increases upkeep.//
+		<br>Institute a system able to release erroneous, but plausible, information about your business, leading your competitors to prepared financial traps.
+		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The authenticity dept. now slightly increases prosperity each week as well as authority, but increases upkeep.//
 	<<else>>
 		You have instituted controlled leaks protocols, able to create fabricated leaks of sensible information.
 	<</if>>
@@ -171,7 +171,7 @@ The propaganda hub is a surprisingly inconspicuous building, dimly lit from the
 			<<goto "propagandaHub">>
 		<</link>>
 		<br>Create a black ops team, ready to carry out corporate sabotage and sensible operations to furhter your goals.
-		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The secret services now provide security as well a authority, but increases upkeep.//
+		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The secret services now provides security as well a authority, but increases upkeep.//
 	<<else>>
 		You have created a black ops team.
 	<</if>>
@@ -184,7 +184,7 @@ The propaganda hub is a surprisingly inconspicuous building, dimly lit from the
 			<<goto "propagandaHub">>
 		<</link>>
 		<br>Establish a presence on the black market in order to manipulate it.
-		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. Will provide cash each week, but will increase crime.//
+		<br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The secret services now provides cash as well as authority each week, but will increase crime.//
 	<<else>>
 		You have infiltrated the black market and are now in partial control of it.
 	<</if>>
diff --git a/src/SecExp/secInit.tw b/src/SecExp/secInit.tw
index 9eb4bb6268b..cafe26bb084 100644
--- a/src/SecExp/secInit.tw
+++ b/src/SecExp/secInit.tw
@@ -138,11 +138,13 @@
 <<set $enemyLosses = 0>>
 <<set $battleTurns = 0>>
 <<set $bribeCost = 0>>
-<<set $tacticsSuccessful == 0>>
-<<set $auto = 0>>
+<<set $tacticsSuccessful = 0>>
 <<set $leaderWounded = 0>>
 <<set $woundType = 0>>				/* 0=no wound, 1=mute, 2=blind, 3=amputee, 4<=health */
-<<set $gainedCombat == 0>>
+<<set $gainedCombat = 0>>
+<<set $gainedWarfare = 0>>
+<<set $PCWounded = 0>>
+<<set $PCWoundCooldown = 0>>
 
 /* statistics */
 <<set $baseBribePerAttacker = 5>>
diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw
index 19fcc568213..9dd8f5c4bc5 100644
--- a/src/SecExp/securityReport.tw
+++ b/src/SecExp/securityReport.tw
@@ -34,16 +34,20 @@
 <</if>>
 
 /* security modifiers */
+<<if $PC.career == "mercenary">>
+	Your past life as a mercenary makes it easier to manage the security of the arcology.
+	<<set _secGrowth += 1>>
+<</if>>
 <<if $ACitizens + $ASlaves <= 2000>>
-	The small number of residents makes their job easier<<set _secGrowth += 2>>
+	The small number of residents makes their job easier.<<set _secGrowth += 2>>
 <<elseif $ACitizens + $ASlaves <= 4000>>
-	The relatively low number of residents makes their job a little easier<<set _secGrowth += 1>>
+	The fairly low number of residents makes their job a little easier.<<set _secGrowth += 1>>
 <<elseif $ACitizens + $ASlaves <= 6000>>
-	The relatively high number of residents makes their job a little harder<<set _secGrowth -= -0.5>>
+	The fairly high number of residents makes their job a little harder.<<set _secGrowth -= -0.5>>
 <<elseif $ACitizens + $ASlaves <= 8000>>
-	The high number of residents makes their job harder<<set _secGrowth -= 1>>
+	The high number of residents makes their job harder.<<set _secGrowth -= 1>>
 <<else>>
-	The extremely high number of residents makes their job a lot harder<<set _secGrowth -= 2>>
+	The extremely high number of residents makes their job a lot harder.<<set _secGrowth -= 2>>
 <</if>>
 <<if _immigration < 10>>
 	The limited number of immigrants that reached the arcology this week does not have any serious impact on the efficacy of current security measures.<<set _secGrowth += 0.5>>
@@ -78,6 +82,9 @@
 <<else>>
 	The absolute authority you hold on the arcology makes the security department's work a lot easier.<<set _secGrowth += 1>>
 <</if>>
+<<if $activeUnits >= 6>>
+	Your military is the size of a small army. Security is easier to maintain with such forces at your disposal. <<set _secGrowth += 0.5>>
+<</if>>
 <<if $lastAttackWeeks < 3 && $week > 3>>
 	The recent attack has a negative effect on the security of the arcology.<<set _secGrowth -= 1>>
 <<elseif $lastAttackWeeks < 5 && $week > 5>>
@@ -85,6 +92,10 @@
 <<else>>
 	The arcology has not been attacked in a while, which has a positive effect on security.<<set _secGrowth += 0.5>>
 <</if>>
+<<if $blackOps == 1>>
+	Yoru black ops team proves to be a formidable tool against anyone threatening the security of your arcology.
+	<<set _secGrowth += 0.5 * random(1,2)>>
+<</if>>
 
 /* resting point */
 <<set _secRest = $secRestPoint * ($secHelots / $reqHelots)>>
@@ -95,7 +106,7 @@
 	The limited staff assigned to the HQ hampers the improvements to security achieved this week.
 <</if>>
 <<set _restGrowth = (_secRest - $security) * 0.2>>
-<<set _newSec = $security + _secGrowth + _secRest>>
+<<set _newSec = Math.trunc($security + _secGrowth + _secRest)>>
 <<if _newSec < $security>>
 	This week @@.red;security decreased@@.
 <<elseif _newSec == $security>>
@@ -103,7 +114,7 @@
 <<else>>
 	This week @@.green;security improved@@.
 <</if>>
-<<set $security = _newSec>>
+<<set $security = Math.clamp(_newSec, 0, 100)>>
 
 <br>
 <br>
@@ -163,13 +174,19 @@
 <<else>>
 	Your absolute authority is an extremely effective tool against crime.<<set _crimeGrowth -= 2>>
 <</if>>
+<<if $cash >= 100000>>
+	Your great wealth acts as a beacon for the greediest criminals, calling them to your arcology as moths to a flame.<<set _crimeGrowth += 0.5>>
+<</if>>	
+<<if $marketInfiltration == 1>>
+	<<set _crimeGrowth += 0.5 * random(1,2)>>
+<</if>>
 
 /* crime cap */
 <<set _crimeCap = Math.clamp($crimeCap + $crimeCap * (($reqHelots - $secHelots) / $reqHelots),0,100)>>
 <<if _crimeCap < $crimeCap && $secHQ == 1>>
 	The limited staff assigned to the HQ allows more space for criminals to act.
 <</if>>
-<<set _newCrime = $crime + _crimeGrowth>>
+<<set _newCrime = Math.trunc($crime + _crimeGrowth)>>
 <<if _newCrime > _crimeCap>>
 	<<set _newCrime = _crimeCap>>
 <</if>>
@@ -180,113 +197,184 @@
 <<else>>
 	This week @@.green;crime decreased@@.
 <</if>>
-<<set $crime = _newCrime>>
+<<set $crime = Math.clamp(_newCrime,0,100)>>
 
-<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>>
+<br>
+<br>
+
+<<if $militiaFounded == 1 || $activeUnits >= 1>>
+	<strong>Military</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 $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 $secBarracksUpgrades.training >= 1>>
+		<<if $secBarracksUpgrades.training == 1>>
+			<<set _sL = $slaveUnits.length>>
+			<<for _i = 0; _i < _sL; _i++>>
+				<<if $slaveUnits[_i].training < 100>>
+					<br>$slaveUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+					<<set $slaveUnits[_i].training += random(2,4)>>
+				<</if>>
+			<</for>>
+			<<set _mL = $militiaUnits.length>>
+			<<for _i = 0; _i < _mL; _i++>>
+				<<if $militiaUnits[_i].training < 100>>
+					<br>$militiaUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+					<<set $militiaUnits[_i].training += random(2,4)>>
+				<</if>>
+			<</for>>
+			<<set _meL = $mercUnits.length>>
+			<<for _i = 0; _i < _meL; _i++>>
+				<<if $mercUnits[_i].training < 100>>
+					<br>$mercUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+					<<set $mercUnits[_i].training += random(2,4)>>
+				<</if>>
+			<</for>>
+		<<elseif $secBarracksUpgrades.training == 2>>
+			<<set _sL = $slaveUnits.length>>
+			<<for _i = 0; _i < _sL; _i++>>
+				<<if $slaveUnits[_i].training < 100>>
+					<br>$slaveUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, increasing their experience level.
+					<<set $slaveUnits[_i].training += random(3,5)>>
+				<</if>>
+			<</for>>
+			<<set _mL = $militiaUnits.length>>
+			<<for _i = 0; _i < _mL; _i++>>
+				<<if $militiaUnits[_i].training < 100>>
+					<br>$militiaUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, increasing their experience level.
+					<<set $militiaUnits[_i].training += random(3,5)>>
+				<</if>>
+			<</for>>
+			<<set _meL = $mercUnits.length>>
+			<<for _i = 0; _i < _meL; _i++>>
+				<<if $mercUnits[_i].training < 100>>
+					<br>$mercUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, increasing their experience level.
+					<<set $mercUnits[_i].training += random(4,6)>>
+				<</if>>
+			<</for>>
+		<<elseif $secBarracksUpgrades.training == 3>>
+			<<set _sL = $slaveUnits.length>>
+			<<for _i = 0; _i < _sL; _i++>>
+				<<if $slaveUnits[_i].training < 100>>
+					<br>$slaveUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, quickly increasing their experience level.
+					<<set $slaveUnits[_i].training += random(4,6)>>
+				<</if>>
+			<</for>>
+			<<set _mL = $militiaUnits.length>>
+			<<for _i = 0; _i < _mL; _i++>>
+				<<if $militiaUnits[_i].training < 100>>
+					<br>$militiaUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, quickly increasing their experience level.
+					<<set $militiaUnits[_i].training += random(4,6)>>
+				<</if>>
+			<</for>>
+			<<set _meL = $mercUnits.length>>
+			<<for _i = 0; _i < _meL; _i++>>
+				<<if $mercUnits[_i].training < 100>>
+					<br>$mercUnits[_i].platoonName is able to make use of the training facilities to better prepare its soldiers, quickly increasing their experience level.
+					<<set $mercUnits[_i].training += random(4,6)>>
+				<</if>>
+			<</for>>
+		<</if>>
 	<</if>>
-<</if>>
 <</if>>
\ No newline at end of file
diff --git a/src/events/intro/pcExperienceIntro.tw b/src/events/intro/pcExperienceIntro.tw
index cbad7a3f913..2f2cca0b51d 100644
--- a/src/events/intro/pcExperienceIntro.tw
+++ b/src/events/intro/pcExperienceIntro.tw
@@ -8,13 +8,13 @@ You're a relative unknown in the Free Cities, but it's clear you're already acco
 <br>
 
 <br>[[Idle wealth|PC Rumor Intro][$PC.career = "wealth"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//Start with extra money. Your starting slaves will have two free levels of sex skills available.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//Start with extra money, but you will find harder to maintain authority. Your starting slaves will have two free levels of sex skills available.//
 <br>[[Venture capitalism|PC Rumor Intro][$PC.career = "capitalist"]]
 <br>&nbsp;&nbsp;&nbsp;&nbsp;//You will be more effective at business pursuits. Your starting slaves will have a free level of prostitution skill available.//
 <br>[[Private military work|PC Rumor Intro][$PC.career = "mercenary"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//You retain mercenary contacts and security skills. Your starting slaves will have free trust available.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//You retain mercenary contacts and your security skills will make it easier to keep the arcology safe. Your starting slaves will have free trust available.//
 <br>[[Slaving|PC Rumor Intro][$PC.career = "slaver"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//Your slave breaking experience will be useful. Your starting slaves will have free devotion available.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//Your slave breaking experience will be useful and authority will be easier to maintain. Your starting slaves will have free devotion available.//
 <br>[[Arcology engineering|PC Rumor Intro][$PC.career = "engineer"]]
 <br>&nbsp;&nbsp;&nbsp;&nbsp;//Upgrading the arcology will be cheaper. Also, the arcology will start with basic economic upgrades already installed.//
 <br>[[Slave surgery|PC Rumor Intro][$PC.career = "medicine"]]
@@ -22,10 +22,10 @@ You're a relative unknown in the Free Cities, but it's clear you're already acco
 <br>[[Minor celebrity|PC Rumor Intro][$PC.career = "celebrity"]]
 <br>&nbsp;&nbsp;&nbsp;&nbsp;//Start with extra reputation. Your starting slaves will have a free level of entertainment skill available.//
 <br>[[High class escort|PC Rumor Intro][$PC.career = "escort"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//As an ex-whore, you will find it hard to maintain reputation. Your starting slaves will have a free level of sex skills available, along with a free level of entertainment and prostitution.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//As an ex-whore, you will find it hard to maintain reputation and authority. Your starting slaves will have a free level of sex skills available, along with a free level of entertainment and prostitution.//
 <br>[[Servant|PC Rumor Intro][$PC.career = "servant"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//As an ex-servant, you will find it hard to maintain reputation. You know how to lower your upkeep, but not conduct business. Your starting slaves will have free trust and devotion.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//As an ex-servant, you will find it hard to maintain reputation and authority. You know how to lower your upkeep, but not conduct business. Your starting slaves will have free trust and devotion.//
 <br>[[Gang Leader|PC Rumor Intro][$PC.career = "gang"]]
-<br>&nbsp;&nbsp;&nbsp;&nbsp;//As a gang leader, you know how to haggle slaves, but you will find reputation quite hard to maintain. Your starting slaves will be fitter and posses a free level of combat skill.//
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//As a gang leader, you know how to haggle slaves and assert your authority, but you will find reputation quite hard to maintain. Your starting slaves will be fitter and posses a free level of combat skill.//
 
 <</if>>
diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw
index 6746848e2a2..3d8c3bd5d18 100644
--- a/src/uncategorized/arcmgmt.tw
+++ b/src/uncategorized/arcmgmt.tw
@@ -45,7 +45,7 @@
 	<<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.@@
+	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, however, cosndier this move an intromission in private affairs, @@.red;damaging your authority.@@
 	<<set $authority -= 100>>
 	<<set $cash += _flux * 100>>
 <</if>>
@@ -75,6 +75,13 @@ This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name
 	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 _immigrants += random(-10,10)>>
+	<<if $crime > 80>>
+		Crime is a widespread phenomenon in your arcology, many potential immigrants are scared away.
+		<<set _immigrants -= random(5,10)>>
+	<<elseif $crime < 20>>
+		Crime is a distant issue within the walls of your arcology, many immigrants are attracted to such safe shores.
+		<<set _immigrants += random(5,10)>>
+	<</if>>
 	<<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 _immigrants += random(10,20), $rep -= 100>>
@@ -370,8 +377,6 @@ 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)>>
@@ -501,6 +506,21 @@ earning you @@.yellowgreen;¤_earnings.@@
 		Growth was subsidized as planned.
 		<<set _AWeekGrowth++>>
 	<</if>>
+	<<if $authority > 18000>>
+		Your authority is so high it discourages new business, slowing down the economic growth of the arcology.
+		<<set _AWeekGrowth-->>
+	<</if>>
+	<<if $security > 80>>
+		Your arcology is extremely safe and stable. Many businesses are attracted to it because of this.
+		<<set _AWeekGrowth++>>
+	<<elseif $security < 20>>
+		Your arcology low security is an instability factor simply too dangerous to be ignored. Many businesses avoid your arcology because of this.
+		<<set _AWeekGrowth-->>
+	<</if>>
+	<<if $controlLeaks == 1>>
+		The authenticity department prepares extremely accurate, but false financial reports, misleading many of your competitors, allowing your arcology more space to grow undisturbed.
+		<<set _AWeekGrowth++>>
+	<</if>>
 	<<set _AWeekGrowth = Math.trunc(0.5*_AWeekGrowth)>>
 	<<if _AWeekGrowth > 0>>
 		Since $arcologies[0].name can support more citizens and more activity, @@.green;its prosperity improved this week.@@
diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw
index 412ebd08426..64ddb494c16 100644
--- a/src/uncategorized/persBusiness.tw
+++ b/src/uncategorized/persBusiness.tw
@@ -567,10 +567,16 @@
 		<<set _upgradeCount += 1>>
 	<</if>>
 	<<set _dataGain = _upgradeCount * 200>>
-	You are selling the data collected by your security department, making @@.yellowgreen;¤<<print _dataGain>>@@.
+	You are selling the data collected by your security department, making @@.yellowgreen;¤a discreet sum@@.
 	<<set $cash += _dataGain>>
 	Many of your citizens are not enthusiastic of this however, @@.red;damaging your authority@@.
-	<<set $authority -= 100>>
+	<<set $authority -= 50>>
+<</if>>
+
+<<if $marketInfiltration == 1>>
+	Your secret service makes use of black markets and illegal streams of goods to make a profit, making you @@.yellowgreen;¤a discreet sum@@. This however allows @@.red;crime to flourish@@ in the underbelly of the arcology.
+	<<set $cash += 1000>>
+	<<set $crime += random(0,1)>>
 <</if>>
 
 Routine upkeep of your demesne costs @@.yellow;¤$costs.@@
diff --git a/src/uncategorized/reputation.tw b/src/uncategorized/reputation.tw
index c68a1ba7830..97bd492c74f 100644
--- a/src/uncategorized/reputation.tw
+++ b/src/uncategorized/reputation.tw
@@ -579,6 +579,11 @@ On formal occasions, you are announced as $PCTitle.
 	<</if>>
 <</if>>
 
+<<if $fakeNews == 1>>
+	The authenticity department produces and distributes copious amounts of plausible enough news and reports, @@.green;increasing your reputation@@
+	<<set $repGain += 10 * $miniTruth>>
+<</if>>
+
 <<set $rep -= $repLoss>>
 <<set $rep += $repGain>>
 
-- 
GitLab