From e2029c11d5770460a99f01158ded1b3d9253dc91 Mon Sep 17 00:00:00 2001
From: hexall90 <hexall90@gmail.com>
Date: Wed, 11 Oct 2017 15:36:52 +0200
Subject: [PATCH] last touches to base framework. start working on rebellions

---
 src/SecExp/rebellionEventGenerator.tw | 20 ++++++++++++
 src/SecExp/rebellionReport.tw         | 26 +++++++++++++++
 src/SecExp/securityReport.tw          | 46 +++++++++++++++++++++++++--
 3 files changed, 89 insertions(+), 3 deletions(-)
 create mode 100644 src/SecExp/rebellionEventGenerator.tw
 create mode 100644 src/SecExp/rebellionReport.tw

diff --git a/src/SecExp/rebellionEventGenerator.tw b/src/SecExp/rebellionEventGenerator.tw
new file mode 100644
index 00000000000..883357e2002
--- /dev/null
+++ b/src/SecExp/rebellionEventGenerator.tw
@@ -0,0 +1,20 @@
+:: rebellionEventGenerator [nobr]
+
+/* each week each possible rebellion will roll for events. If one happens (only one each week in total) the player may interact with it and the counter for the rebellion may go up or stay the same */
+
+Slaves:
+	-low authority
+	-low citizens/slaves
+	-FSs (degradation/paternalist, maybe others)
+	-low security
+	
+Citizens:
+	-low authority
+	-militarization without military focused revivalist FSs
+	-FSs (eugenics with many citizens, repopulation with few, maybe others)
+	-high crime
+	
+Mercenaries:
+	-low authority
+	-high numbers
+	-failing to pay upkeep each week (falling into debt)
\ No newline at end of file
diff --git a/src/SecExp/rebellionReport.tw b/src/SecExp/rebellionReport.tw
new file mode 100644
index 00000000000..dd7a25bbd7b
--- /dev/null
+++ b/src/SecExp/rebellionReport.tw
@@ -0,0 +1,26 @@
+:: rebellionEventGenerator [nobr]
+
+/* each week each possible rebellion will roll for events. If one happens (only one each week in total) the player may interact with it and the counter for the rebellion may go up or stay the same */
+
+
+
+
+
+
+
+
+
+
+
+
+Slaves:
+	-low authority
+	-low citizens/slaves
+	-FSs (degradation/paternalist, maybe others)
+	-low security
+	
+Citizens:
+	-low authority
+	-militarization without military focused revivalist FSs
+	-FSs (eugenics with many citizens, repopulation with few, maybe others)
+	-high crime
diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw
index 697c3debb11..e5245fd733f 100644
--- a/src/SecExp/securityReport.tw
+++ b/src/SecExp/securityReport.tw
@@ -9,6 +9,8 @@
 <<set _crimeGrowth = 0>>
 <<set _crimeCap = 0>>
 <<set _newCrime = 0>>
+<<set _recruits = 0>>
+<<set _newMercs = 0>>
 
 <<if $useTabs == 0>>__Security__<</if>>
 <br>
@@ -138,11 +140,11 @@
 	The low prosperity of the arcology facilitates criminal recruitment and organization.<<set _crimeGrowth += 2>>
 <<elseif $arcologies[0].prosperity < 80>>
 	The fairly low prosperity of the arcology facilitates criminal recruitment and organization.<<set _crimeGrowth += 1>>
-<<elseif $arcologies[0].prosperity < 12>>
+<<elseif $arcologies[0].prosperity < 120>>
 	The prosperity of the arcology is not high or low enough to have significant effects on criminal recruitment and organization.
-<<elseif $arcologies[0].prosperity < 16>>
+<<elseif $arcologies[0].prosperity < 160>>
 	The prosperity of the arcology is high enough to provide its citizens a decent life, hampering criminal recruitment and organization.<<set _crimeGrowth -= 0.5>>
-<<elseif $arcologies[0].prosperity < 18>>
+<<elseif $arcologies[0].prosperity < 180>>
 	The prosperity of the arcology is high enough to provide its citizens a decent life, significantly hampering criminal recruitment and organization.<<set _crimeGrowth -= 1>>
 <<else>>
 	The prosperity of the arcology is high enough to provide its citizens a very good life, significantly hampering criminal recruitment and organization.<<set _crimeGrowth -= 2>>
@@ -205,6 +207,7 @@
 <br>
 
 <<if $militiaFounded == 1 || $activeUnits >= 1>>
+	/* militia */
 	<strong>Military</strong>: 
 	<<if $recruitVolunteers == 1>>
 		Your militia accepts only volunteering citizens, ready to defend their arcology.
@@ -310,6 +313,43 @@
 			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>>
+	
+	/* mercs */
+	<<if $mercenaries >= 1>>
+		<<set _newMercs = random(0,3)>>
+		<<if $rep < 6000>>
+			Your low reputation turns some mercenaries away, hoping to find contracts that would bring them more renown.<<set _newMercs -= 1>>
+		<<elseif $rep < 12000>>
+			Your reputation is not high enough to attract many mercenaries to your free city.
+		<<else>>
+			Your reputation attracts many guns for hire who would be proud to have such distinct character on their resume.<<set _newMercs += 1>>
+		<</if>>
+		<<if $arcologies[0].prosperity < 50>>
+			The low prosperity of the arcology discourages new guns for hire from coming to your arcology.<<set _newMercs -= 1>>
+		<<elseif $arcologies[0].prosperity < 80>>
+			The fairly low prosperity of the arcology discourages new guns for hire from coming to your arcology.<<set _newMercs += 1>>
+		<<elseif $arcologies[0].prosperity < 120>>
+			The prosperity of the arcology attracts a few mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(1,2)>>
+		<<elseif $arcologies[0].prosperity < 160>>
+			The fairly high prosperity of the arcology attracts some mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(2,3)>>
+		<<elseif $arcologies[0].prosperity < 180>>
+			The high prosperity of the arcology is attracts some mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(2,4)>>
+		<<else>>
+			The very high prosperity of the arcology attracts a lot of mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(3,5)>>
+		<</if>>
+		<<if $crime > 60>>
+			The powerful crime organizatiosn that nested themselves in the arcology have an unending need for cheap guns for hire, many mercenaries flock to your free city in search of employment.<<set _newMercs += random(1,2)>>
+		<</if>>
+		<<if _newMercs > 0>>
+			<<set $mercTotalManpower += _recruits>>
+			<<set $mercFreeManpower += _recruits>>
+			This week <<print _newMercs>> citizens joined the militia.
+		<<else>>
+			This week no new mercenaries reached the arcology.
+		<</if>>
+	<</if>>
+	
+	/* training */
 	<<if $secBarracksUpgrades.training >= 1>>
 		<<if $secBarracksUpgrades.training == 1>>
 			<<set _sL = $slaveUnits.length>>
-- 
GitLab