From 865ada4cbf6a87c8d2349b666340f0130cddfb5e Mon Sep 17 00:00:00 2001
From: j <okp57855@psoxs.com>
Date: Thu, 7 Dec 2017 04:54:14 +1300
Subject: [PATCH] Done.

---
 src/pregmod/securityForceTradeShow.tw | 152 ++++++++++++++++++++++++++
 src/uncategorized/nonRandomEvent.tw   |   6 +
 2 files changed, 158 insertions(+)
 create mode 100644 src/pregmod/securityForceTradeShow.tw

diff --git a/src/pregmod/securityForceTradeShow.tw b/src/pregmod/securityForceTradeShow.tw
new file mode 100644
index 00000000000..8bd05db0f5d
--- /dev/null
+++ b/src/pregmod/securityForceTradeShow.tw
@@ -0,0 +1,152 @@
+:: securityForceTradeShow
+<<nobr>>
+<<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check", $returnTo = "RIE Eligibility Check">>
+
+<<set _N1 = 2>>
+<<set _N2 = 2>>
+<<set _N3 = 2>>
+
+<<if $economy == .5>>
+	<<set $Env = _N1>>
+<<elseif $economy == 1>>
+	<<set $Env = _N2>>
+<<elseif $economy == 1.5>>
+	<<set $Env = _N3>>
+<</if>>
+
+<<set _Barracks = $securityForceArcologyUpgrades>>
+<<set _Armoury = $securityForceInfantryPower>>
+<<set _StimulantLab = $securityForceStimulantPower>>
+<<set _Garage = $securityForceVehiclePower+$securityForceHeavyBattleTank>>
+<<set _Hangar = $securityForceAircraftPower+$securityForceSpacePlanePower+$securityForceFortressZeppelin+$securityForceAC130+$securityForceHeavyTransport>>
+<<set _DroneBay = $securityForceDronePower>>
+<<set _LaunchBayNO = $securityForceSatalitePower+$securityForceGiantRobot+$securityForceMissileSilo>>
+<<set _LaunchBayO = $securityForceSatalitePower>>
+<<set _FacilitySupport = $FacilitySupport>>
+
+<<if $terrain != "oceanic" || $terrain != "marine">>
+	<<set $SFNO = _Barracks+_Armoury+_StimulantLab+_Garage+_Hangar+_DroneBay+_LaunchBayNO+_FacilitySupport>>
+<</if>>
+<<if $terrain == "oceanic" || $terrain == "marine">>
+	<<set $SFO = _Barracks+_Armoury+_StimulantLab+_Garage+_Hangar+_DroneBay+_LaunchBayO+_NavalYard+_FacilitySupport>>
+<</if>>
+
+<<if $OverallTradeShowAttendance == 0>>
+	<<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Sir<<else>>Ma'am<</if>>, back when I was a major there was a bi-yearly international security trade show that me and some of my colleagues went to. I would very much like to continue doing, can I?<span id="choice1">
+
+	<<link "Yes,">>
+	<<replace "#choice1">>
+	<br><br>"Thank you <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>."
+	<<set $OverallTradeShowAttendance += 1>>
+	<<set $CurrentTradeShowAttendanceGranted = 1>>
+	<<set $TradeShowAttendanceGranted = 1>>
+	<</replace>>
+	<</link>>
+
+	<<link "No">>
+	<<replace "#choice1">>
+	<br><br>"I understand <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>."
+	<</replace>>
+	<</link>>
+	</span>
+
+
+<<elseif $OverallTradeShowAttendance >= 1>>
+	<<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Sir<<else>>Ma'am<</if>>, do you still need me back here?
+	<span id="choice2">
+
+	<<link "Yes">>
+	<<replace "#choice2">>
+		<br>The look of disappointement is bearly noticable on The Colonel's face.
+	<</replace>>
+	<</link>>
+
+	<<link "No,">>
+	<<replace "#choice2">><br>
+	<br>"Thanks <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>"
+
+	<<set $CurrentTradeShowAttendanceGranted = 1, _TradeShowAttendes = 150, _BonusProviderPercentage = .15>>
+	<<set _MenialSlavesPerAttendee = 15>>
+
+	<<if $arcologies[0].prosperity < 25>>
+		<<set _TradingPower = 15>>
+	<<elseif $arcologies[0].prosperity > 70>>
+		<<set _TradingPower = 25>>
+	<<elseif $arcologies[0].prosperity > 65>>
+		<<set _TradingPower = 24>>
+	<<elseif $arcologies[0].prosperity > 60>>
+		<<set _TradingPower = 23>>
+	<<elseif $arcologies[0].prosperity > 55>>
+		<<set _TradingPower = 22>>
+	<<elseif $arcologies[0].prosperity > 50>>
+		<<set _TradingPower = 21>>
+	<<elseif $arcologies[0].prosperity > 45>>
+		<<set _TradingPower = 20>>
+	<<elseif $arcologies[0].prosperity > 40>>
+		<<set _TradingPower = 19>>
+	<<elseif $arcologies[0].prosperity > 35>>
+		<<set _TradingPower = 18>>
+	<<elseif $arcologies[0].prosperity > 30>>
+		<<set _TradingPower = 17>>
+	<<elseif $arcologies[0].prosperity > 25>>
+		<<set _TradingPower = 16>>
+	<</if>>
+
+	<<if ($SFNO || $SFO) < 10 && random(0,100)+_TradingPower > 90>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.05>>
+	<<elseif ($SFNO || $SFO) >= 110 && random(0,100)+_TradingPower > 40>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.95>>
+	<<elseif ($SFNO || $SFO) >= 100 && random(0,100)+_TradingPower > 45>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.90>>
+	<<elseif ($SFNO || $SFO) >= 90 && random(0,100)+_TradingPower > 50>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.80>>
+	<<elseif ($SFNO || $SFO) >= 80 && random(0,100)+_TradingPower > 55>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.70>>
+	<<elseif ($SFNO || $SFO) >= 70 && random(0,100)+_TradingPower > 60>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.60>>
+	<<elseif ($SFNO || $SFO) >= 60 && random(0,100)+_TradingPower > 65>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.50>>
+	<<elseif ($SFNO || $SFO) >= 50 && random(0,100)+_TradingPower > 70>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.40>>
+	<<elseif ($SFNO || $SFO) >= 40 && random(0,100)+_TradingPower > 75>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.30>>
+	<<elseif ($SFNO || $SFO) >= 30 && random(0,100)+_TradingPower > 80>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.20>>
+	<<elseif ($SFNO || $SFO) >= 10 && random(0,100)+_TradingPower > 85>>
+		<<set _SuccesfulPersuationAttempt = 1>>
+		<<set _PersuationBonus = 1.10>>
+	<</if>>
+
+	<<set _RawMenialSlaves = random(0,_TradeShowAttendes)*_BonusProviderPercentage*_MenialSlavesPerAttendee*_PersuationBonus>>
+	<<set _SuccesfulPersuationAttempt = 0>>
+
+	<<set _RawProfit = ($cash*.010*$SFNO || $SFO*$arcologies[0].prosperity*$Env)*_PersuationBonus>>
+	<<set _ProcessedProfit = Math.trunc(_RawProfit)>>
+
+		<br>During a break, The Colonel manages to sell some generic scematics to the _TradeShowAttendes people peresent, some decided to also give her some menial slaves as a bonus.
+
+			<<set $helots = $helots+_RawMenialSlaves>>
+			<<set $TradeShowHelots += _RawMenialSlaves>>
+			<<set $TotalTradeShowHelots += _RawMenialSlaves>>
+
+			<<set $cash = $cash+_ProcessedProfit>>
+			<<set $TradeShowIncome += _ProcessedProfit>>
+			<<set $TotalTradeShowIncome += _ProcessedProfit>>
+
+	<</replace>>
+	<</link>>
+
+	</span>
+
+<</if>>
+<</nobr>>
\ No newline at end of file
diff --git a/src/uncategorized/nonRandomEvent.tw b/src/uncategorized/nonRandomEvent.tw
index 5aa6c8025d7..04156580d08 100644
--- a/src/uncategorized/nonRandomEvent.tw
+++ b/src/uncategorized/nonRandomEvent.tw
@@ -156,6 +156,12 @@
 	<<goto "secExpSmilingMan">>
 <<elseif $rivalOwner == 0 && $smilingManProgress == 3 && $secExp == 1>>
 	<<goto "secExpSmilingMan">>
+<<elseif (_effectiveWeek > 84) && (random(1,100) > 66) && ($securityForceCreate == 1) && ($SFMODToggle == 1) && $OverallTradeShowAttendance == 0>>>
+	<<goto "securityForceTradeShow">>
+	<<set _TradeShowWeek = _effectiveWeek>>
+<<elseif _TradeShowWeek = 24 && (random(1,100) > 66) && ($securityForceCreate == 1) && ($SFMODToggle == 1) && $OverallTradeShowAttendance >= 1>>>
+	<<goto "securityForceTradeShow">>
+	<<set _TradeShowWeek = 0>>
 <<else>>
 	<<if random(1,100) > _effectiveWeek+25>>
 		<<goto "RIE Eligibility Check">>
-- 
GitLab