:: Nonrandom Event

<<set $activeSlave = 0, $eventSlave = 0>>

<<if $plot>>

<<set _effectiveWeek = $week-$nationHate>>
<<if (_effectiveWeek == 4) && ($arcologies[0].name.indexOf("Arcology ") != -1)>>
	<<set $Event = "arcology naming">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek >= 5 && $FCTV.receiver == -1)>>
	<<goto "SE FCTV Install">>
<<elseif (_effectiveWeek == 6)>>
	<<set $Event = "strip club closing">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 8)>>
	<<set $Event = "strip club aftermath">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 11)>>
	<<set $Event = "assistant">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek == 12) && $raped == -1 && $arcologyUpgrade.drones != 1 && $Bodyguard == 0 && $PC.career != "arcology owner">>
	<<goto "P raped">>
<<elseif (_effectiveWeek == 14) && $badC != 1>>
	<<set _valid = $slaves.find(function(s) { return s.curatives > 1 || s.inflationType == "curative"; })>>
	<<if def _valid>>
		<<set $badC = 1, $Event = "bad curatives">>
		<<goto "Generic Plot Events">>
	<<else>>
		<<set $badC = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif (_effectiveWeek == 17)>>
	<<set $Event = "shoot invitation">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 20)>>
	<<set $Event = "slave food">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 24)>>
	<<set $Event = "militia">>
	<<goto "Generic Plot Events">>
<<elseif ($week == 29)>>
	<<set $Event = "aid invitation">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 31) && ($mercenaries == 0)>>
	<<goto "P mercenaries">>
<<elseif (_effectiveWeek == 35) && ($mercenaries > 0)>>
	<<goto "P snatch and grab">>
<<elseif (_effectiveWeek == 43)>>
	<<goto "P invasion">>
<<elseif (_effectiveWeek == 44) && ($mercenaries > 0) && $mercRomeo != 1>>
	<<set _valid = $slaves.find(function(s) { return (["serve the public", "serve in the club", "whore", "work in the brothel"].includes(s.assignment) || s.counter.publicUse >= 50) && s.fetish != "mindbroken" && s.fuckdoll == 0; })>>
	<<if def _valid>>
		<<set $mercRomeo = 1, $activeSlave = 0>>
		<<goto "P mercenary romeo">>
	<<else>>
		<<set $mercRomeo = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif (_effectiveWeek == 46) && ($mercenaries > 0)>>
	<<goto "P raid invitation">>
<<elseif (_effectiveWeek == 48) && ($experimental.food == 1)>>
	<<set $foodCrisis = 1>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 50) && ($rations > 0)>>
	<<set $foodCrisis = 2>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 52) && ($seeHyperPreg == 1) && $seePreg != 0 && $badB != 1>>
	<<set _valid = $slaves.find(function(s) { return s.drugs == "breast injections" || s.drugs == "hyper breast injections" || s.drugs == "intensive breast injections"; })>>
	<<if def _valid>>
		<<set $badB = 1, $Event = "bad breasts">>
		<<goto "Generic Plot Events">>
	<<else>>
		<<set $badB = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif _effectiveWeek == 54 && (def $peacekeepers) && $peacekeepers.attitude >= 0>>
	<<goto "P peacekeepers deficit">>
<<elseif (_effectiveWeek == 56)>>
	<<set $collaboration = 0>>
	<<set $traitor = 0>>
	<<set $hackerSupport = 0>>
	<<goto "P underground railroad">>
<<elseif (_effectiveWeek == 58) && ($traitor == 0)>>
	<<goto "P bombing">>
<<elseif (_effectiveWeek == 60) && ($rations > 0)>>
	<<set $foodCrisis = 3>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 61) && ($traitor != 0)>>
	<<goto "P traitor message">>
<<elseif (_effectiveWeek == 62) && ($mercenaries < 3)>>
	<<goto "P defense fears">>
<<elseif (_effectiveWeek == 65) && ($mercenaries >= 3)>>
	<<goto "P citizens and civilians">>
<<elseif (_effectiveWeek == 67) && ($traitor != 0)>>
	<<goto "P collaboration choice">>
<<elseif (_effectiveWeek == 69)>>
	<<goto "P hacker support">>
<<elseif (_effectiveWeek == 70) && ($collaboration == 1)>>
	<<if $traitorType != "trapper">>
		<<goto "P coup collaboration">>
	<<else>>
		<<goto "P coup betrayal">>
	<</if>>
<<elseif (_effectiveWeek == 71)>>
	<<if $traitorType != "agent" && $traitorType != "trapper">>
		<<set _doubleAgent = 0>>
	<<else>>
		<<set _doubleAgent = 1>>
	<</if>>
	<<if $mercenaries + $personalArms + $hackerSupport + _doubleAgent < 5>>
		<<goto "P coup loss">>
	<<else>>
		<<goto "P coup attempt">>
	<</if>>
<<elseif (_effectiveWeek == 72)>>
	<<goto "P coup aftermath">>
<<elseif $SF.Toggle && $SF.Active === -1 && _effectiveWeek >= 72>>
	<<goto "Security Force Proposal">>
<<elseif $arcologies[0].FSRestart != "unset" && $failedElite > 300 && $eugenicsFullControl != 1>>
	<<goto "eliteTakeOver">>
<<elseif (_effectiveWeek > 5) && ($rep > 3000) && ($FSAnnounced == 0)>>
	<<goto "P FS Announcement">>
<<elseif _effectiveWeek > 18 && $assistant.personality > 0 && !$assistant.options>>
	<<set $Event = "assistant SP">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek > 45) && ($bodyswapAnnounced == 0) && ($surgeryUpgrade == 1)>>
	<<goto "P Bodyswap Reveal">>
<<elseif _effectiveWeek > 48 && $invasionVictory > 0 && $peacekeepers == 0 && $peacekeepersGone != 1>>
	<<goto "P peacekeepers intro">>
<<elseif ($arcologies[0].prosperity > 80) && ($TSS.schoolPresent+$GRI.schoolPresent+$SCP.schoolPresent+$LDE.schoolPresent+$TGA.schoolPresent+$HA.schoolPresent+$TFS.schoolPresent+$TCR.schoolPresent+$NUL.schoolPresent == 0) && ($schoolSuggestion == 0)>>
	<<goto "P school suggestion">>
<<elseif ($assistant.fsOptions !== 1) && $assistant.personality > 0 && $assistant.appearance != "normal" && FutureSocieties.HighestDecoration() >= 40>>
	<<set $Event = "assistant FS">>
	<<goto "Assistant Events">>
<<elseif $assistant.personality > 0 && !$assistant.announcedName && $assistant.power > 0>>
	<<set $Event = "assistant name">>
	<<goto "Assistant Events">>
<<elseif !$assistant.market && $assistant.power > 1>>
	<<set $Event = "market assistant">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek > 70) && ($corp.Incorporated > 0) && ($rivalOwnerEnslaved > 0) && ($mercenaries >= 3) && ($mercenariesHelpCorp == 0) && ($corp.DivExtra > 0)>>
	<<goto "P Mercs Help Corp">>
<<elseif _effectiveWeek > 75 && (def $peacekeepers) && $peacekeepers.strength < 50 && $rivalOwner == 0 && $peacekeepersFate != 1>>
	<<goto "P peacekeepers independence">>
<<elseif (def $peacekeepers) && $peacekeepers.strength >= 50 && $peacekeepers.influenceAnnounced == 0>>
	<<goto "P peacekeepers influence">>
<<elseif ($cash > 120000) && ($rep > 4000) && ($corp.Announced == 0)>>
	<<goto "P Corp Announcement">>
<<elseif ($rivalOwner > 0)>>
	<<if $hostageAnnounced == 0 && $rivalSet != 0>>
		<<goto "P rivalry hostage">>
	<<elseif ($rivalOwner-$rivalryPower+10)/$arcologies[0].prosperity < 0.5>>
		<<goto "P rivalry victory">>
	<<elseif $peacekeepers.attitude > 5 && $rivalryDuration > 1>>
		<<goto "P rivalry peacekeepers">>
	<<else>>
		<<goto "P rivalry actions">>
	<</if>>
<<elseif ($arcologies[0].FSPaternalistDecoration == 100) && ($swanSong == 2) && ($week-$swanSongWeek >= 3)>>
	<<goto "RE The Siren Strikes Back">>
<<elseif ($PShoot == 1)>>
	<<set $Event = "shoot result">>
	<<goto "Generic Plot Events">>
<<elseif ($PSnatch == 1)>>
	<<goto "P snatch and grab result">>
<<elseif ($PRaid == 1)>>
	<<goto "P raid result">>
<<elseif ($PAid == 1)>>
	<<set $Event = "aid result">>
	<<goto "Generic Plot Events">>
<<elseif ($slaveMedic > 0)>>
	<<goto "P slave medic">>
<<elseif ($PPit == 1) && ($Bodyguard != 0)>>
	<<goto "PE pit fight">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 0 && _effectiveWeek >= 74 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 1 && _effectiveWeek >= 77 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 2 && _effectiveWeek >= 82 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 3 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif ($rivalOwner == 0) && ($seeFCNN == 1) && ($FCNNstation == 0) && ($week > 95) && ($cash > 200000) && ($rep > 7500)>>
	<<goto "SE FCNN Station">>
<<else>>
	<<if random(1,100) > _effectiveWeek+25>>
		<<goto "RIE Eligibility Check">>
	<<else>>
		<<goto "Random Nonindividual Event">>
	<</if>>
<</if>>

<<else>>

<<if random(1,200) > _effectiveWeek+100 || $hostageRescued == 1>>
	<<goto "RIE Eligibility Check">>
<<else>>
	<<goto "Random Nonindividual Event">>
<</if>>

<</if>>

src/uncategorized/nonRandomEvent.tw