:: Scheduled Event

<<if $expired == 1>>
	<<set $activeSlave = getSlave($expiree), $expiree = 0>>
	<<= removeActiveSlave() >>
	<<set _expireSlave = $slaves.find((s) => s.indenture === 0)>>
	<<if def _expireSlave>>
		<<set $expiree = _expireSlave.ID>>
	<</if>>
<</if>>
<<set $expired = 0>>

<<if $retired == 1>>
	<<set $activeSlave = getSlave($retiree), $retiree = 0>>
	<<= removeActiveSlave() >>
	<<set _retireSlave = $slaves.find((s) => retirementReady(s))>>
	<<if def _retireSlave>>
		<<set $retiree = _retireSlave.ID>>
	<</if>>
<</if>>
<<set $retired = 0>>

/* birth scheduled event */
<<if $birthed == 1>>
	<<set $birthee = 1>>
<</if>>
<<set $birthed = 0>>

/* burst scheduled event */
<<if $burst == 1>>
	<<set $burstee = 1>>
<</if>>
<<set $burst = 0>>

<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek == $week-1>>
	<<set $fcnn.push("...Ladies: Do you want dick so much that you want to HAVE a dick? If yes, join the Futanari Sisters today! Learn more at...")>>
<</if>>
<<if $week == 30>>
	<<set $fcnn.push("...is where I'll be when the bombs hit. Survival is my first...")>>
	<<set $fcnn.push("...time to prepare for major shortages is now, since there's no likelihood...")>>
	<<set $fcnn.push("...construction of shelters accelerated last quarter, due to fears...")>>
	<<set $fcnn.push("...major drought across the entire hemisphere shows no signs of...")>>
	<<set $fcnn.push("...medical organization offered no explanation, stating that...")>>
	<<set $fcnn.push("...just ahead, an FCNN Special Report: Immortality and You — Breakthroughs in 'Bodyswapping' technology and what they mean for...")>>
	<<set $fcnn.push("...wildfires have now cost an estimated...")>>
	<<set $fcnn.push("...widespread demonstrations against the government's friendly relations with the Free Cities...")>>
	<<set $fcnn.push("...of the small island nation, declared that his homeland may be completely underwater by...")>>
	<<set $fcnn.push("...claimed the sanctions constituted as an act of war...")>>
	<<set $fcnn.push("...nuclear weapons development program, drawing harsh criticism from international observers...")>>
	<<set $fcnn.push("...simply don't have the money to adequately respond to a natural disaster of this...")>>
<<elseif $week == 50>>
	<<set $fcnn.push("...tested a thermonuclear device of some five megatons last night...")>>
	<<set $fcnn.push("...heavy fighting for the third week in the capital city of...")>>
	<<set $fcnn.push("...economic recovery looking increasingly unlikely in the event of...")>>
	<<set $fcnn.push("...complete exhaustion of safe water reserves across...")>>
	<<set $fcnn.push("...climate refugees streamed across the border despite...")>>
	<<set $fcnn.push("...released a statement today, explaining their refusal to intervene against the pillaging of several Free Cities in northern...")>>
	<<set $fcnn.push("...denies allegations of ordering last week's combined arms assault on the arcology known as...")>>
	<<set $fcnn.push("...Coming up, an FCNN Special Report: Ghost Cities — The truth about recent surge of depopulated metropolitan areas in...")>>
	<<set $fcnn.push("...was assassinated in his home in the nation's capital, alongside his entire...")>>
	<<set $fcnn.push("...forces opened fire on crowds of protesters, killing and wounding...")>>
	<<set $fcnn.push("...declared the insurgency officially defeated, despite reports of widespread violence...")>>
<<elseif $week == 70>>
	<<set $fcnn.push("...second low-order nuclear detonation in the city of...")>>
	<<set $fcnn.push("...total societal collapse induced by rising sea levels declared today in...")>>
	<<set $fcnn.push("...likelihood of containing Influenza-M was downgraded to a lower...")>>
	<<set $fcnn.push("...threatened immediate use of chemical weapons should those forces not withdraw...")>>
	<<set $fcnn.push("...relief organizations unable to deal with casualties from nuclear exchange between...")>>
	<<set $fcnn.push("...guerrilla fighting intensifies in escalating proxy war between 'Paternalist' and 'Degradationist' Free Cities in the region of...")>>
	<<set $fcnn.push("...Coming up, an FCNN Special Report about the unprecedented scale of slave insurrections across...")>>
	<<set $fcnn.push("...invasive plant growth epidemic contested by persistent droughts in eastern...")>>
	<<set $fcnn.push("...Daughters of Liberty claimed responsibility for the attack...")>>
	<<set $fcnn.push("...mass suicide of the cult members, who believed that current events were prophesied...")>>
<<elseif $week == 90>>
	<<set $fcnn.push("...have enslaved the entire legislature, their leader personally sexually assaulting...")>>
	<<set $fcnn.push("...confirmed that the arcologies were subject to a nuclear detonation, but...")>>
	<<set $fcnn.push("...conflict can now be said to encompass the entire continent...")>>
	<<set $fcnn.push("...government has effectively fallen, with much of the capital destroyed...")>>
	<<set $fcnn.push("...deadliest in the nation's history, was allegedly committed by the Daughters of Liberty...")>>
	<<set $fcnn.push("...famine so devastating that confirmed reports of cannibalism are now...")>>
	<<set $fcnn.push("...dozens upon dozens of mass graves in what were once city parks...")>>
<</if>>

<<if $secExpEnabled == 1>>
	<<if $SecExp.settings.battle.enabled > 0>>
		<<include "attackGenerator">>
	<</if>>
<</if>>

<<if $rivalOwner == -1>>
	<<goto "P rival initiation">>
<<elseif $slaveRebellion == 1 && $secExpEnabled == 1>>
	<<goto "rebellionOptions">>
<<elseif $citizenRebellion == 1 && $secExpEnabled == 1>>
	<<goto "rebellionOptions">>
<<elseif $attackThisWeek == 1 && $secExpEnabled == 1>>
	<<goto "attackOptions">>
<<elseif $PC.labor == 1>>
	<<goto "SE Player Birth">>
<<elseif ($independenceDay == 1) && (Math.trunc(($week-23)/52) == ($week-23)/52)>>
	<<goto "SE independence day">>
<<elseif ($weddingPlanned > 0)>>
	<<set _wedding = 0>>
	<<if ($weddingPlanned > 0)>>
		<<set _wedding = 1>>
		<<goto "SE wedding">>
	<</if>>
	<<if _wedding == 0>>
		<<set $weddingPlanned = 0, $marrying = []>>
		<<run cashX(10000, "event")>>
		<<goto "Scheduled Event">>
	<</if>>
<<elseif $playerBred == 1 && ($PC.preg == 0 || $PC.preg == -1) && $PC.pregWeek == 0 && $PC.vagina >= 1>>
	<<goto "P insemination">>
<<elseif ($retiree != 0)>>
	<<goto "SE retirement">>
<<elseif ($expiree != 0)>>
	<<goto "SE expiration">>
<<elseif ($burstee != 0)>>
	<<set $burst = 0>>
	<<goto "SE Burst">>
<<elseif ($slaveDeath != 0)>>
	<<set $slaveDeath = 0>>
	<<goto "SE Death">>
<<elseif ($birthee != 0)>>
	<<set $birthed = 0>>
	<<goto "SE Birth">>
<<elseif $FCTV.receiver > 0 && $FCTV.pcViewership.frequency != -1 && $FCTV.pcViewership.count == 0>>
	<<if $week > 50 && $FCTV.remote < 2>> <<goto "SE FCTV Remote">>
	<<else>> <<goto "SE FCTV Watch">>
	<</if>>
<<elseif ($Recruiter != 0 && $recruiterEugenics == 0 && $recruiterProgress >= 13)>>
	<<goto "SE recruiter success">>
<<elseif $Recruiter != 0 && $recruiterEugenics == 1 && $recruiterProgress >= (13 + (policies.countEugenicsSMRs() * 6))>>
	<<goto "SE recruiter success">>
<<elseif ($customSlaveOrdered == 1 && $customSlaveOrderedReorder != 1)>>
	<<goto "SE custom slave delivery">>
<<elseif ($JFCOrder == 1 && $JFCReorder != 1)>>
	<<goto "JobFulfillmentCenterDelivery">>
<<elseif ($huskSlaveOrdered == 1)>>
	<<goto "SE husk slave delivery">>
<<elseif $LurcherID != 0 && $policies.coursingAssociation == 1 && (Math.trunc($week/4) == ($week/4)) && $coursed == 0>>
	<<goto "SE coursing">>
<<elseif $policies.raidingMercenaries == 1 && ($week > ($raided + 6))>>
	<<goto "SE raiding">>
<<elseif ((($fighterIDs.length > 1) && ($pitBG == 0)) || (($fighterIDs.length > 0) && ($Bodyguard != 0) && ($pitBG == 1)) || (($pitAnimal > 0) && ($fighterIDs.length > 0)) || (($killChoice == 2))) && ($pitFought == 0)>>
	<<if $pitLethal == 1>><<goto "SE lethal pit">><<else>><<goto "SE nonlethal pit">><</if>>
<<elseif ($bioreactorPerfectedID != 0) && ($bioreactorsAnnounced != 1)>>
	<<goto "P bioreactor perfected">>
<<elseif ($TSS.schoolPresent == 1) && ($TSS.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($GRI.schoolPresent == 1) && ($GRI.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($SCP.schoolPresent == 1) && ($SCP.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($LDE.schoolPresent == 1) && ($LDE.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($TGA.schoolPresent == 1) && ($TGA.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($HA.schoolPresent == 1) && ($HA.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($TCR.schoolPresent == 1) && ($TCR.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($NUL.schoolPresent == 1) && ($NUL.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($TFS.schoolPresent == 1) && ($TFS.schoolProsperity <= -10)>>
	<<goto "RES Failure">>
<<elseif ($TFS.schoolPresent == 1) && ($organFarmUpgrade != 0) && ($TFS.farmUpgrade == 0)>>
	<<goto "TFS Farm Upgrade">>

/* Nicea */
<<elseif ($nicaea == 1) && ($organFarmUpgrade != 0) && ($TFS.farmUpgrade == 0)>>
	<<goto "TFS Farm Upgrade">>
<<elseif ($nicaeaHeld != 1) && ($arcologies[0].FSChattelReligionist != "unset") && ($nicaeaAnnounceable == 1) && ($nicaeaAnnounced != 1)>>
	<<goto "SE nicaea announcement">>
<<elseif ($nicaeaHeld != 1) && ($arcologies[0].FSChattelReligionist != "unset") && ($nicaeaPreparation == 1)>>
	<<if $nicaeaInvolvement != 0>>
		<<goto "SE nicaea preparation">>
	<<else>>
		<<set $nicaeaPreparation = 0>>
		<<if $plot == 1>><<goto "Nonrandom Event">><<else>><<goto "Random Nonindividual Event">><</if>>
	<</if>>
<<elseif ($nicaeaHeld != 1) && ($arcologies[0].FSChattelReligionist != "unset") && ($nicaeaInvolvement >= 0)>>
	<<set $nicaeaFocus = either("owners", "slaves")>>
	<<set $nicaeaAssignment = either("please you", "serve the public", "whore")>>
	<<set $nicaeaAchievement = either("devotion", "slaves", "trust")>>
	<<goto "SE nicaea council">>
<<else>>
	<<run delete $JFCReorder>>
	<<run delete $customSlaveOrderedReorder>>
	<<goto "Nonrandom Event">>
<</if>>

src/uncategorized/scheduledEvent.tw