code:
:: Random Individual Event [nobr]

<<set $showEncyclopedia = 0>>
<<if $eventSlave == 0>>
  <<set $eventSlave = $eligibleSlaves.random()>>
  <<if $cheatMode == 1>>
	<<set $nextButton = "Refresh", $nextLink = "Random Individual Event", $returnTo = "Random Individual Event">>
	''One of the following eligible slaves would have been selected for an individual random event:''

	<<for $i = 0; $i < $eligibleSlaves.length; $i++>>

<<print "[[$eligibleSlaves[$i].slaveName|Random Individual Event][$eventSlave = $eligibleSlaves[" + $i + "]]]">>
	<</for>>

[[Switch to Random Nonindividual Event|Random Nonindividual Event][$activeSlave = 0, $eventSlave = 0]]
  <<else>>
	<<goto "Random Individual Event">>
  <</if>>
<<else>>
<<silently>>
/* initialize event lists as arrays [], not objects {} */
<<set $events = [], $RESSevent = [], $RESSTRevent = [], $RETSevent = [], $RECIevent = [], $activeSlave = 0, $groomSlave = 0, $brideSlave = 0, $legendaryFacility = 0>>

/* SUB CHECKS */

<<set $RERelationshipSlave = 0>>
<<set $REAnalCowgirlSubIDs = [], $RETasteTestSubIDs = [], $RESimpleAssaultIDs = [], $REInterslaveBeggingIDs = [], $RECockmilkInterceptionIDs = [], $REShowerForceSubIDs = [], $RESadisticDescriptionSubIDs = [], $REIfYouEnjoyItSubIDs = [], $REBoobCollisionSubIDs = [], $RERepressedAnalVirginSubIDs = []>>

<<for $i = 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].fetish != "mindbroken">>
	<<if canWalk($slaves[$i])>>
	<<if canTalk($slaves[$i])>>
		<<if ($slaves[$i].assignment != "be confined in the cellblock")>>
		<<if ($slaves[$i].assignment != "stay confined")>>
		<<if (($slaves[$i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2))>>
			<<if $slaves[$i].devotion <= 20>>
				<<if ($slaves[$i].fetish != "buttslut") || ($slaves[$i].fetishKnown == 0)>>
				<<if $slaves[$i].anus != 0>>
					<<set $REShowerForceSubIDs.push($slaves[$i].ID)>>
					<<set $REIfYouEnjoyItSubIDs.push($slaves[$i].ID)>>
				<<else>>
					<<set $RESadisticDescriptionSubIDs.push($slaves[$i].ID)>>
				<</if>>
				<</if>>
				<<if $slaves[$i].anus != 0 && canDoAnal($slaves[$i])>>
				<<if $slaves[$i].vagina != 0 && canDoVaginal($slaves[$i])>>
				<<if $slaves[$i].belly < 2000>>
				<<if $slaves[$i].combatSkill == 0>>
				<<if $slaves[$i].muscles <= 30>>
					<<set $RESimpleAssaultIDs.push($slaves[$i].ID)>>
				<</if>>
				<</if>>
				<</if>>
				<</if>>
				<</if>>
			<<else>>
				<<if $slaves[$i].boobs > 3000>>
					<<set $REBoobCollisionSubIDs.push($slaves[$i].ID)>>
				<</if>>
				<<if $slaves[$i].releaseRules != "restrictive" && $slaves[$i].releaseRules != "masturbation">>
				<<if $slaves[$i].energy > 40>>
				<<if canDoVaginal($slaves[$i]) || canDoAnal($slaves[$i])>>
					<<set $REInterslaveBeggingIDs.push($slaves[$i].ID)>>
				<</if>>
				<</if>>
				<</if>>
			<</if>>
			<<if $slaves[$i].devotion >= -20>>
			<<if $slaves[$i].devotion <= 60>>
			<<if $slaves[$i].fetish != "buttslut">>
			<<if $slaves[$i].anus != 0>>
				<<set $REAnalCowgirlSubIDs.push($slaves[$i].ID)>>
			<</if>>
			<</if>>
			<</if>>
			<</if>>
		<</if>>
		<</if>>
		<</if>>
		<<if $slaves[$i].assignmentVisible == 1>>
		<<if $slaves[$i].livingRules == "luxurious">>
		<<if $slaves[$i].devotion >= -20>>
			<<if $slaves[$i].anus != 0>>
				<<set $RETasteTestSubIDs.push($slaves[$i].ID)>>
			<</if>>
		<</if>>
		<</if>>
		<</if>>
		<<if $slaves[$i].anus > 0>>
		<<if $slaves[$i].devotion > 50>>
		<<if $slaves[$i].amp == 0>>
			<<set $RERepressedAnalVirginSubIDs.push($slaves[$i].ID)>>
		<</if>>
		<</if>>
		<</if>>
	<</if>>
	<</if>>
	<<if $slaves[$i].assignment == "work in the dairy" || $slaves[$i].assignment == "get milked">>
	<<if $slaves[$i].balls>>
	<<if $slaves[$i].dick>>
	<<if $slaves[$i].vasectomy == 0 && $slaves[$i].ballType == "human">>
	<<if canDoAnal($slaves[$i])>>
		<<set $RECockmilkInterceptionIDs.push($slaves[$i].ID)>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</if>>
<</for>>

<<if $eventSlave.relationship > 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
  <<if $slaves[$i].ID == $eventSlave.relationshipTarget>>
	<<set $RERelationshipSlave = $slaves[$i]>>
  <</if>>
<</for>>
<</if>>

/* STANDARD EVENTS */

<<if ($eventSlave.fetish != "mindbroken")>>
<<if canWalk($eventSlave)>>
<<if canTalk($eventSlave)>>

<<if $RECockmilkInterceptionIDs.length > 1 || ($RECockmilkInterceptionIDs.length == 1 && $eventSlave.ID != $RECockmilkInterceptionIDs[0])>>
<<if $eventSlave.devotion > 20>>
<<if $eventSlave.dietCum > 0 || ($eventSlave.fetishKnown && $eventSlave.fetish == "cumslut")>>
	<<set $RETSevent.push("cockmilk interception")>>
<</if>>
<</if>>
<</if>>

<<if $REInterslaveBeggingIDs.length > 1 || ($REInterslaveBeggingIDs.length == 1 && $eventSlave.ID != $REInterslaveBeggingIDs[0])>>
<<if $universalRulesConsent == 1>>
<<if $eventSlave.devotion > 20>>
<<if $eventSlave.energy > 40>>
<<if canPenetrate($eventSlave)>>
<<if canSee($eventSlave)>>
<<if $eventSlave.releaseRules != "restrictive" && $eventSlave.releaseRules != "masturbation">>
	<<set $RETSevent.push("interslave begging")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $familyTesting == 0>>
	<<if $eventSlave.devotion > 20>>
	<<if $eventSlave.sexualQuirk == "perverted" || $eventSlave.energy > 80>>
	<<if $eventSlave.relation == "mother">>
	<<if $eventSlave.lactation>>
	<<if $eventSlave.releaseRules != "restrictive" && $eventSlave.releaseRules != "masturbation">>
		<<set $RETSevent.push("incestuous nursing")>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<<else>>
	<<if $eventSlave.devotion > 20 && ($eventSlave.sexualQuirk == "perverted" || $eventSlave.energy > 80) && $eventSlave.belly < 100000 && $eventSlave.lactation > 0 && $eventSlave.releaseRules != "restrictive" && $eventSlave.releaseRules != "masturbation" && $eventSlave.daughters > 0>>
		<<set $RETSevent.push("incestuous nursing")>>
	<</if>>
<</if>>

<<if ($eventSlave.intelligence > 1)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.intelligenceImplant > 0)>>
	<<set $RESSevent.push("devoted educated slave")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.intelligence > 1)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.intelligenceImplant > 0)>>
<<if $eventSlave.accent < 4>>
	<<set $RESSevent.push("devoted educated slave")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.entertainSkill >= 60) || ["an exotic dancer", "a dancer", "a house DJ", "a party girl", "an aspiring pop star"].includes($eventSlave.career)>>
<<if ($eventSlave.health > 40)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
	<<set $RESSevent.push("happy dance")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $RERepressedAnalVirginSubIDs.length > 0>>
<<if ($eventSlave.anus == 0)>>
<<if ($eventSlave.devotion >= -50)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.sexualFlaw == "repressed")>>
	<<set $RETSevent.push("repressed anal virgin")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($assistant > 0)>>
<<if ($assistantAppearance != "normal")>>
<<if ($eventSlave.devotion >= -20)>>
<<if canSee($eventSlave)>>
	<<if ($eventSlave.devotion <= 50)>>
		<<if ["be a servant", "work as a servant"].includes($eventSlave.assignment)>>
			<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
				<<set $RESSevent.push("PA servant")>>
			<</if>>
		<</if>>
	<<elseif ($eventSlave.trust > 75)>>
		<<if ($eventSlave.energy > 60)>>
		<<if (canDoAnal($eventSlave) && $eventSlave.anus > 0) || (canDoVaginal($eventSlave) && $eventSlave.vagina > 0)>>
			<<set $RESSevent.push("PA flirting")>>
		<</if>>
		<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.clothes == "a succubus outfit")>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("sexy succubus")>>
<</if>>
<</if>>
<</if>>

<<if ($HeadGirl != 0)>>
  <<if ($eventSlave.devotion <= 50)>>
  <<if ($eventSlave.anus != 0)>>
	<<if ($HGSeverity >= 0)>>
	  <<set $events.push("RE anal punishment")>>
	<</if>>
	<<set $events.push("RE shower punishment")>>
  <</if>>
  <</if>>
  <<if ($eventSlave.ID == $HeadGirl.ID)>>
  <<if ($eventSlave.trust > 50)>>
	<<set $RESSevent.push("trusting HG")>>
  <</if>>
  <</if>>
  <<if ($eventSlave.ID != $HeadGirl.ID)>>
  <<if ($eventSlave.speechRules != "restrictive")>>
  <<if ($eventSlave.trust > 75)>>
  <<if ($eventSlave.devotion > 50)>>
  <<if ($eventSlave.oralSkill > 30)>>
  <<if ($eventSlave.intelligence >= $HeadGirl.intelligence)>>
  <<if ($eventSlave.oralSkill > $HeadGirl.oralSkill)>>
	<<set $events.push("RE HG replacement")>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
<</if>>

<<if ($eventSlave.livingRules == "spare")>>
<<if ($eventSlave.devotion <= 20)>>
	<<if ($eventSlave.devotion > -10)>>
		<<set $RESSevent.push("sleeping ambivalent")>>
	<</if>>
	<<if ($eventSlave.trust < -20)>>
		<<set $RESSevent.push("bad dream")>>
	<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($week-$eventSlave.weekAcquired < 10)>>
<<if $eventSlave.energy > 20>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.vagina != 0)>>
	<<set $RESSevent.push("ignorant horny")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($RETasteTestSubIDs.length > 1)>>
<<if ($eventSlave.livingRules == "luxurious")>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.energy > 80)>>
	<<set $RETSevent.push("taste test")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($modRequestsAllowed > 0)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.dick != 0) || ($eventSlave.vagina != -1)>>
<<if ($eventSlave.speechRules == "permissive")>>
<<if ($eventSlave.corsetPiercing == 0)>>
<<if ($eventSlave.tonguePiercing == 0)>>
<<if ($eventSlave.anusPiercing == 0)>>
<<if ($eventSlave.nipplesPiercing == 0)>>
<<if ($eventSlave.dickPiercing == 0)>>
<<if ($eventSlave.vaginaPiercing == 0)>>
<<if ($eventSlave.lipsTat == 0) || ($eventSlave.lipsTat == "none")>>
<<if ($eventSlave.vaginaTat == 0) || ($eventSlave.vaginaTat == "none")>>
	<<set $RESSevent.push("mods please")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.muscles > 5)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.diet != "slimming")>>
	<<set $RESSevent.push("sore shoulders")>>
<</if>>
<</if>>
<</if>>

<<if $RERelationshipSlave != 0>>
<<if ($eventSlave.relationship > 3)>>
<<if ($RERelationshipSlave.devotion > 20)>>
<<if canWalk($RERelationshipSlave)>>
<<if canTalk($RERelationshipSlave)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
	<<if ($eventSlave.speechRules != "restrictive")>>
		<<set $RETSevent.push("date please")>>
	<</if>>
	<<if ($RERelationshipSlave.anus != 0)>>
	<<if ($RERelationshipSlave.dick != 1)>>
	<<if ($RERelationshipSlave.dick == 0) || (canAchieveErection($RERelationshipSlave))>>
	<<if ($RERelationshipSlave.fetish == "dom") || ($RERelationshipSlave.fetish == "sadist")>>
		<<set $RETSevent.push("top exhaustion")>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $REAnalCowgirlSubIDs.length > 1 || ($REAnalCowgirlSubIDs.length == 1 && $eventSlave.ID != $REAnalCowgirlSubIDs[0])>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.releaseRules != "restrictive") && $eventSlave.releaseRules != "masturbation">>
<<if ($eventSlave.fetish == "buttslut") || ($eventSlave.fetish == "sadist") || ($eventSlave.fetish == "dom")>>
<<if ($eventSlave.dickAccessory != "chastity") || ($eventSlave.dick == 0)>>
	<<set $RETSevent.push("anal cowgirl")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $REBoobCollisionSubIDs.length > 1>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.boobs > 3000)>>
<<if ($eventSlave.attrXX >= 50) || (($eventSlave.fetish == "boobs") && ($eventSlave.fetishStrength > 95))>>
	<<set $RETSevent.push("boob collision")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($weatherToday.severity <= 1)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.anus != 0) && canDoAnal($eventSlave)>>
<<if ($eventSlave.vagina != 0)>>
	<<set $RESSevent.push("confident tanning")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
	<<set _giver = 0>>
	<<if $HeadGirl == 0>>
		<<set _giver = 1>>
	<<elseif $HeadGirl.ID != $eventSlave.ID>>
		<<set _giver = 1>>
	<</if>>
	<<if _giver == 1>>
		<<set $RESSevent.push("a gift")>>
	<</if>>
<</if>>
<</if>>

<<if ($eventSlave.relationship >= 2)>>
<<if ($eventSlave.relationship < 5)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > -20)>>
	<<set $events.push("RE relationship advice")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.devotion > 50>>
<<if $eventSlave.anus > 0>>
<<if $eventSlave.vagina != 0>>
  <<if $eventSlave.trust > 20>>
	<<set $RESSevent.push("devoted exhibition")>>
	<<set $RESSevent.push("devoted lotion")>>
  <</if>>
  <<if $eventSlave.energy > 95>>
	<<set $RESSevent.push("devoted nympho")>>
  <</if>>
  <<if $eventSlave.releaseRules == "permissive" || $eventSlave.releaseRules == "masturbation">>
  <<if !["chastity", "combined chastity"].includes($eventSlave.dickAccessory) || ($eventSlave.dick == 0)>>
	<<set $RESSevent.push("permitted masturbation")>>
  <</if>>
  <</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.trust < -50>>
<<if $eventSlave.devotion <= 20>>
	<<set $RESSevent.push("terrified inspection")>>
<</if>>
<</if>>

<<if $eventSlave.dick > 0>>
  <<if $eventSlave.anus > 0>>
  <<if $eventSlave.devotion >= 10>>
	<<if $REFeminizationCheckinIDs.includes($eventSlave.ID)>>
	  <<set $RECIevent.push("feminization")>>
	<</if>>
	<<if $eventSlave.trust >= 10>>
	<<if canAchieveErection($eventSlave)>>
	  <<if $REFutaSisterCheckinIDs.includes($eventSlave.ID)>>
		<<set $RECIevent.push("futa")>>
	  <</if>>
	<</if>>
	<</if>>
  <</if>>
  <</if>>
<</if>>

<<if $eventSlave.analSkill > 30>>
  <<if $eventSlave.devotion >= 10>>
  <<if $REMILFCheckinIDs.includes($eventSlave.ID)>>
	<<set $RECIevent.push("MILF")>>
  <</if>>
  <</if>>
<</if>>

<<if $eventSlave.attrXY > 50>>
  <<if $eventSlave.anus != 0>>
  <<if $eventSlave.vagina != 0>>
  <<if $eventSlave.devotion >= 10>>
  <<if $REOrientationCheckinIDs.includes($eventSlave.ID)>>
	<<set $RECIevent.push("orientation")>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
<</if>>

<<if $eventSlave.face >= -10>>
  <<if $eventSlave.devotion >= 10>>
  <<if ($eventSlave.assignment is "serve the public") || ($eventSlave.assignment is "whore")>>
  <<if $REUglyCheckinIDs.includes($eventSlave.ID)>>
	<<set $RECIevent.push("ugly")>>
  <</if>>
  <</if>>
  <</if>>
<</if>>

<<if $eventSlave.anus > 1>>
  <<if $eventSlave.anus < 4>>
  <<if $eventSlave.analArea > 1>>
  <<if $eventSlave.devotion > 50>>
  <<if $eventSlave.trust > 50>>
  <<if $REButtholeCheckinIDs.includes($eventSlave.ID)>>
	<<set $RECIevent.push("butthole")>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
<</if>>

/*
<<if $eventSlave.drugs == "breast injections">>
  <<if ($eventSlave.anus > 0) || ($eventSlave.vagina > 0)>>
  <<if $eventSlave.devotion <= 50>>
  <<if $eventSlave.devotion >= -20>>
  <<if $eventSlave.trust >= -50>>
	<<if $REReductionCheckinIDs.includes($eventSlave.ID)>>
	  <<set $RECIevent.push("reduction")>>
	<</if>>
  <</if>>
  <</if>>
  <</if>>
  <</if>>
<</if>>
*/

<<if ($eventSlave.assignment == "be a servant") || ($eventSlave.assignment == "work as a servant")>>
<<if ($eventSlave.devotion <= 95)>>
<<if ($eventSlave.intelligence < -1)>>
	<<set $RESSevent.push("cooler lockin")>>
<</if>>
<</if>>
<</if>>

<<if ($universalRulesConsent == 0)>>
<<if ($eventSlave.devotion > 50)>>
	<<if ($eventSlave.fetish == "sadist") || ($eventSlave.fetish == "dom") || ($eventSlave.energy > 95)>>
	  <<if ($REShowerForceSubIDs.length > 0)>>
	  <<if ($eventSlave.trust <= 75)>>
		  <<set $RETSevent.push("shower force")>>
	  <</if>>
	  <</if>>
	  <<if ($eventSlave.anus > 0)>>
	  <<if ($RESadisticDescriptionSubIDs.length > 0)>>
		<<set $RETSevent.push("sadistic description")>>
	  <</if>>
	  <</if>>
	  <<if ($cockFeeder > 0)>>
	  <<if canPenetrate($eventSlave) || ($eventSlave.dick == 0)>>
		<<set $RESSevent.push("kitchen molestation")>>
	  <</if>>
	  <</if>>
	<</if>>
	<<if ($REIfYouEnjoyItSubIDs.length > 0)>>
	  <<set $RETSevent.push("if you enjoy it")>>
	<</if>>
	<<if $RESimpleAssaultIDs.length > 0>>
	<<if canPenetrate($eventSlave)>>
		<<set $RETSevent.push("simple assault")>>
	<</if>>
	<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion < -50)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.speechRules == "restrictive")>>
	<<set $RESSevent.push("vocal disobedience")>>
<</if>>
<</if>>
<</if>>

<<if ($boobAccessibility != 1) && $ballsAccessibility != 1 && $pregAccessibility != 1>>
<<if ($eventSlave.boobs > 10000)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($slaves.length > 2)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("huge tits")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.physicalAge > 30)>>
<<if ($eventSlave.ageImplant > 0)>>
<<if ($eventSlave.devotion > 20)>>
	<<set $RESSevent.push("age implant")>>
<</if>>
<</if>>
<</if>>

<<if ($seeAge != 0)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.speechRules != "restrictive")>>
<<if ($eventSlave.birthWeek >= 51)>>
	<<set $RESSevent.push("birthday")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.clothes == "a penitent nuns habit")>>
<<if ($eventSlave.anus > 0)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("penitent")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.slaveName != $eventSlave.birthName)>>
<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.anus > 0 && canDoAnal($eventSlave))>>
	<<set $RESSevent.push("not my name")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($slaves.length > 2)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.heels == 1)>>
<<if ($eventSlave.shoes == "heels") || ($eventSlave.shoes == "boots") || ($eventSlave.shoes == "extreme heels")>>
	<<set $RESSevent.push("tendon fall")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.vagina < 0)>>
<<if canDoAnal($eventSlave)>>
<<if ($eventSlave.anus > 0)>>
<<if ($eventSlave.analSkill <= 30)>>
	<<set $RESSevent.push("obedient shemale")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.physicalAge > 37)>>
<<if ($eventSlave.anus > 0)>>
<<if ($eventSlave.vagina > 0)>>
	<<set $RESSevent.push("devoted old")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.actualAge > 35)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($PC.actualAge < 25)>>
	<<set $RESSevent.push("young PC age difference")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.actualAge < 22)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($PC.actualAge >= 50)>>
	<<set $RESSevent.push("old PC age difference")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.fetish == "humiliation") || ($eventSlave.energy > 95)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.fetishKnown == 1)>>
	<<set $RESSevent.push("fearful humiliation")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.livingRules == "luxurious")>>
<<if ($eventSlave.devotion <= 75)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("newly devoted sunrise")>>
<</if>>
<</if>>
<</if>>

<<if $PC.dick == 1>>
<<if $PC.belly < 5000>>
<<if ["be a servant", "work as a servant"].includes($eventSlave.assignment)>>
<<if $eventSlave.attrXY <= 35 || $eventSlave.behavioralFlaw == "hates men" || $eventSlave.sexualFlaw == "repressed">>
<<if ($eventSlave.devotion > -20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("frightening dick")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($spa > 0)>>
<<if ($eventSlave.boobs > 2000)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("spa boobs")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.lactation > 0)>>
<<if ($eventSlave.boobs > 800)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("cow milking")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.dietCum > 0)>>
<<if ($eventSlave.devotion < 20)>>
<<if (($eventSlave.fetish != "cumslut") && ($eventSlave.fetish != "masochist")  && ($eventSlave.fetishStrength < 60)) || ($eventSlave.fetishKnown == 0)>>
  <<set $RESSevent.push("retching cum feeding")>>
<</if>>
<</if>>
<</if>>

<<if ($arcologies[0].FSSubjugationist != "unset")>>
<<if ($eventSlave.race != $arcologies[0].FSSubjugationistRace)>>
<<if ($week-$eventSlave.weekAcquired > 1)>>
<<if ($week-$eventSlave.weekAcquired < 10)>>
<<if ($eventSlave.devotion < -20)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.health > -20)>>
<<set $toSearch = $eventSlave.race>>
<<if ($toSearch.indexOf("surgically") == -1)>>
<<if ($eventSlave.indentureRestrictions < 1)>>
  <<set $RESSevent.push("subjugation blues")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if canTalk($eventSlave)>>
<<if ($eventSlave.dietCum > 0)>>
<<if ($eventSlave.diet == "fattening")>>
<<if ($eventSlave.trust > -50)>>
<<if ($eventSlave.fetish != "cumslut")>>
<<if ($eventSlave.weight < -30)>>
<<if ($eventSlave.health > -80)>>
<<if ($eventSlave.behavioralFlaw != "anorexic")>>
<<if ($eventSlave.sexualFlaw != "self hating")>>
<<if ($eventSlave.fetishStrength <= 60) || ($eventSlave.fetishKnown != 1)>>
  <<set $RESSevent.push("too thin for cum diet")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.drugs == "intensive breast injections" || $eventSlave.drugs == "hyper breast injections">>
<<if $eventSlave.boobs <= 8000>>
<<if $eventSlave.boobs > 2000>>
<<if $eventSlave.devotion <= 50>>
<<if $eventSlave.devotion >= -50>>
<<if $eventSlave.trust >= -50>>
<<if $eventSlave.fetish != "boobs">>
<<if $eventSlave.intelligence > -2>>
	<<set $RESSevent.push("breast expansion blues")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.physicalAge > 35>>
<<if $eventSlave.speechRules != "restrictive">>
<<if ["whore", "serve the public", "work in the brothel", "serve in the club"].includes($eventSlave.assignment)>>
<<if $eventSlave.devotion > -20>>
<<if $eventSlave.devotion <= 95>>
	<<set $RESSevent.push("ara ara")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.anus > 3>>
<<if $eventSlave.devotion > 50>>
<<if $eventSlave.trust > 50>>
	<<set $RESSevent.push("gaped asshole")>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.health > 90>>
<<if $eventSlave.muscles > 5>>
<<if $eventSlave.weight <= 30>>
<<if $eventSlave.weight >= -30>>
<<if $eventSlave.trust > 50>>
<<if $eventSlave.devotion > 50>>
	<<set $RESSevent.push("passing declaration")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.trust < -50>>
<<if $eventSlave.devotion < 50>>
	<<set $RESSevent.push("im scared")>>
<</if>>
<</if>>

<<if $eventSlave.fetish == "sadist">>
<<if $eventSlave.fetishStrength > 20>>
<<if $arcade != 0>>
<<if $eventSlave.trust > -20>>
<<if $eventSlave.devotion > 50>>
<<if $eventSlave.belly < 300000>>
	<<set $RESSevent.push("arcade sadist")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.dick == 0>>
<<if $eventSlave.vagina == -1>>
<<if canDoAnal($eventSlave)>>
<<if $eventSlave.energy > 20>>
<<if $eventSlave.devotion >= -50>>
<<if $eventSlave.fetish != "buttslut" || $eventSlave.fetishStrength <= 20>>
	<<set $RESSevent.push("desperate null")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.devotion > 20>>
<<if $eventSlave.boobs > 2000>>
	<<set $RESSevent.push("back stretch")>>
<</if>>
<</if>>

<<if $eventSlave.devotion > 20>>
<<if $eventSlave.trust > 20>>
<<if $eventSlave.speechRules != "restrictive">>
<<if setup.modestClothes.includes($eventSlave.clothes)>>
	<<set $RESSevent.push("modest clothes")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($PC.vagina == 1)>>
<<if ($eventSlave.devotion <= 20)>>
<<if (($eventSlave.trust > -20 && $eventSlave.behavioralFlaw == "arrogant") || ($eventSlave.trust > 20))>>
<<if ($eventSlave.muscles > 30)>>
<<if ($eventSlave.health > 20)>>
<<if ($eventSlave.energy > 50)>>
<<if canPenetrate($eventSlave)>>
<<if ($Bodyguard == 0)>>
	<<set $RESSevent.push("mutinery attempt")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<</if>> /* closes mute exempt */

<<if ($eventSlave.devotion >= 20)>>
<<if ["ball gag", "bit gag", "dildo gag", "massive dildo gag"].includes($eventSlave.collar)>>
	<<set $RESSevent.push("gagged slave")>>
<</if>>
<</if>>

<<if $eventSlave.devotion > 20>>
<<if $eventSlave.butt > 5>>
<<if $eventSlave.clothes != "no clothing">>
<<if $eventSlave.clothes != "body oil">>
<<if $eventSlave.clothes != "a toga">>
<<if $eventSlave.clothes != "a kimono">>
<<if $eventSlave.clothes != "shibari ropes">>
<<if $eventSlave.clothes != "a slutty maid outfit">>
<<if $eventSlave.clothes != "a string bikini">>
<<if $eventSlave.clothes != "a scalemail bikini">>
<<if $eventSlave.clothes != "a chattel habit">>
<<if $eventSlave.clothes != "a slave gown">>
<<if $eventSlave.clothes != "a halter top dress">>
<<if $eventSlave.clothes != "a ball gown">>
<<if $eventSlave.clothes != "a mini dress">>
<<if $eventSlave.clothes != "harem gauze">>
	<<set $RESSevent.push("ass fitting")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.trust > 20>>
<<if $eventSlave.devotion > 20>>
<<if $eventSlave.energy > 40>>
<<if $eventSlave.belly < 300000>>
<<if $PC.belly < 5000 && $PC.ballsImplant < 3 && $PC.balls < 3>>
<<if canSee($eventSlave)>>
	<<set $RESSevent.push("comfortable seat")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.vaginaLube > 1>>
<<if $eventSlave.devotion > 20>>
<<if canDoVaginal($activeSlave)>>
	<<set $RESSevent.push("moist pussy")>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.devotion <= 20>>
<<if $eventSlave.trust <= -20>>
<<if $eventSlave.genes == "XY">>
<<if $eventSlave.dick > 0>>
<<if !["chastity", "combined chastity"].includes($eventSlave.dickAccessory)>>
<<if $eventSlave.vagina == -1>>
<<if $eventSlave.attrXY < 50>>
	<<set $RESSevent.push("transition anxiety")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $seeAge == 1>>

<<if $eventSlave.actualAge < 18>>
<<if $eventSlave.ovaries == 1>>
<<if ($eventSlave.devotion >= 20)>>
<<if ($eventSlave.physicalAge == Math.round($eventSlave.pubertyAgeXX))>>
<<if canGetPregnant($eventSlave)>>
<<if ($eventSlave.birthWeek < 2)>>
	<<set $RESSevent.push("first period")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.actualAge < 18>>
<<if ($eventSlave.devotion >= 20)>>
<<if canAchieveErection($eventSlave)>>
<<if ($eventSlave.physicalAge == Math.round($eventSlave.pubertyAgeXY))>>
<<if ($eventSlave.dickAccessory != "chastity" || $eventSlave.dickAccessory != "combined chastity")>>
<<if ($eventSlave.birthWeek < 2)>>
	<<set $RESSevent.push("wet dreams")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<</if>> /* closes aging exemption */

<<if $eventSlave.devotion >= -150>>
<<if $eventSlave.devotion <= 50>>
	<<set $events.push("RE standard punishment")>>
<</if>>
<</if>>

<<if $eventSlave.boobs > 600>>
<<if $eventSlave.boobShape == "torpedo-shaped">>
<<if $eventSlave.devotion >= -50>>
	<<set $RESSevent.push("torpedo squeeze")>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.assignment == "serve the public">>
<<if $eventSlave.fetishKnown == 1>>
<<if $FSDegradationist == "unset">>
<<if $arcologyUpgrade.drones == 1>>
	<<set $RESSevent.push("mean girls")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.hormoneBalance >= 100)>>
<<if ($hormoneUpgradeMood == 0)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("orchiectomy please")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.devotion > 50)>>
	<<if $PC.belly < 5000>>
		<<set $RESSevent.push("shower slip")>>
	<</if>>
	<<if ($eventSlave.amp < 0)>>
		<<set $RESSevent.push("plimb help")>>
	<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.devotion > -50)>>
<<if ($eventSlave.trust > -20)>>
	<<if ($suppository != 0)>>
	<<if ($eventSlave.fetish != "buttslut")>>
		<<set $RESSevent.push("suppository resistance")>>
	<</if>>
	<</if>>
	<<if ($cockFeeder != 0)>>
	<<if ($eventSlave.fetish != "cumslut")>>
		<<set $RESSevent.push("cockfeeder resistance")>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.relationship <= -2)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("bonded love")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("objectifying visit")>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > -10)>>
<<if ($eventSlave.ID != $HeadGirl.ID)>>
<<if ($eventSlave.ID != $Concubine.ID)>>
	<<set $RESSevent.push("refreshment delivery")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.dick > 8)>>
<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.energy > 60)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($eventSlave.belly < 100000)>>
	<<set $RESSevent.push("dick wringing")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.scrotum > 0)>>
<<if ($eventSlave.dickAccessory == "chastity") || ($eventSlave.dickAccessory == "combined chastity")>>
<<if ($eventSlave.devotion <= 95)>>
<<if ($eventSlave.energy > 50)>>
<<if ($eventSlave.energy < 95)>>
<<if ($eventSlave.devotion >= -20) || ($eventSlave.trust < -20)>>
	<<set $RESSevent.push("cage relief")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($PC.dick > 0)>>
<<if ($PC.boobs > 0)>>
<<if canSee($eventSlave)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if (($eventSlave.attrXY <= 35) && ($eventSlave.attrXX > 65)) || (($eventSlave.attrXX <= 35) && ($eventSlave.attrXY > 65))>>
	<<set $RESSevent.push("dickgirl PC")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.voice > 0>>
<<if $eventSlave.lips <= 95>>
<<if !["dildo gag", "massive dildo gag", "ball gag", "bit gag"].includes($eventSlave.collar)>>
<<if $eventSlave.accent == 3>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.trust > -10)>>
<<if ($eventSlave.devotion >= -20) || ($eventSlave.trust < -20)>>
	<<set $RESSevent.push("language lesson")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.energy > 40)>>
<<if canSee($eventSlave)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.devotion > 0)>>
<<if ($eventSlave.devotion <= 50)>>
<<if (($eventSlave.attrXX >= 50) && ($PC.boobs == 1 || $PC.title == 0) && ($PC.belly < 5000))
	|| (($eventSlave.attrXY >= 50) && ($PC.dick == 1) && ($PC.boobs == 0) && ($PC.belly < 1500))
	|| ($eventSlave.fetish == "pregnancy" && $PC.belly >= 5000)
	|| ($eventSlave.fetish == "boobs" && $PC.belly < 5000 && $PC.boobsBonus > 0)>>
	<<set $RESSevent.push("hot PC")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.trust <= 20)>>
<<if ($eventSlave.trust >= -75)>>
<<if ($eventSlave.devotion <= 30)>>
<<if ($eventSlave.devotion >= -20)>>
	<<set $RESSevent.push("like me")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.boobs > 1400)>>
<<if ($eventSlave.boobsImplant == 0)>>
<<if ($eventSlave.nipples != "tiny")>>
<<if ($eventSlave.devotion > 20)>>
	<<set $RESSevent.push("huge naturals")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.boobs > 800)>>
<<if Math.floor($eventSlave.boobsImplant/$eventSlave.boobs) >= .60>>
<<if ($eventSlave.devotion > 20)>>
	<<set $RESSevent.push("implant inspection")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion < -20)>>
<<if ($eventSlave.trust >= -20)>>
<<if ($eventSlave.clothes == "uncomfortable straps")>>
	<<set $RESSevent.push("bondage gear")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.labia > 1)>>
<<if ($eventSlave.muscles > 5) || $eventSlave.diet == "muscle building">>
<<if $eventSlave.belly < 10000>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("inconvenient labia")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.addict > 20)>>
<<if ($eventSlave.aphrodisiacs > 0) || ($eventSlave.inflationType == "aphrodisiac")>>
	<<set $RESSevent.push("obedient addict")>>
<</if>>
<</if>>
<</if>>

<<if ($seeExtreme == 1)>>
<<if ($eventSlave.devotion < -50)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.assignment != "stay confined")>>
<<if ($eventSlave.heels != 1)>>
	<<set $RESSevent.push("escapee")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.behavioralFlaw == "gluttonous")>>
<<if ($eventSlave.diet == "restricted")>>
	<<set $RESSevent.push("diet")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.devotion >= -50)>>
	<<set $RESSevent.push("resistant shower")>>
<</if>>
<</if>>

<<if ($eventSlave.speechRules != "restrictive")>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.trust >= -20)>>
<<if ($eventSlave.energy > 75)>>
<<if ($eventSlave.fetish != "buttslut")>>
<<if ($eventSlave.vagina != 0) || ($eventSlave.anus != 0)>>
	<<set $RESSevent.push("night visit")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules == "restrictive")>>
<<if $eventSlave.need>>
  <<if ($eventSlave.devotion <= 95)>>
  <<if ($eventSlave.trust >= -20)>>
  <<if ($eventSlave.dickAccessory != "chastity" && $eventSlave.dickAccessory != "combined chastity") || ($eventSlave.dick == 0)>>
	<<set $RESSevent.push("forbidden masturbation")>>
  <</if>>
  <</if>>
  <</if>>
  <<if ($eventSlave.devotion >= -20)>>
  <<if ($eventSlave.trust >= -50)>>
	<<set $RESSevent.push("desperately horny")>>
  <</if>>
  <</if>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules != "restrictive") && $eventSlave.releaseRules != "masturbation">>
<<if canPenetrate($eventSlave)>>
	<<set $RESSevent.push("slave dick on slave")>>
<</if>>
<</if>>

<<if ($eventSlave.muscles > 30)>>
<<if $eventSlave.weight <= 10>>
<<if ($eventSlave.anus != 0) || $PC.dick == 0>>
<<if ($eventSlave.vagina != 0) || $PC.dick == 0>>
	<<set $RESSevent.push("muscles")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.lactation > 1)>>
<<if canDoVaginal($eventSlave) || canDoAnal($eventSlave)>>
	<<set $RESSevent.push("milkgasm")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.waist < -95)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.belly < 30000)>>
<<if ($eventSlave.weight <= 95)>>
	<<set $RESSevent.push("devoted waist")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.entertainSkill >= 100)>>
<<if ($eventSlave.trust > 50)>>
<<if ["serve the public", "serve in the club"].includes($eventSlave.assignment)>>
	<<set $RESSevent.push("masterful entertainer")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.whoreSkill >= 100)>>
<<if ($eventSlave.trust > 50)>>
<<if ["whore", "work in the brothel"].includes($eventSlave.assignment)>>
	<<set $RESSevent.push("masterful whore")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.dick > 0)>>
<<if ($eventSlave.balls == 0)>>
<<if ($eventSlave.ovaries == 0)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.trust < -50)>>
<<if ($eventSlave.anus > 0)>>
<<if canDoAnal($eventSlave)>>
	<<set $RESSevent.push("resistant gelding")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if isFertile($eventSlave)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($PC.dick != 0)>>
<<if ($eventSlave.fetish == "pregnancy") || ($eventSlave.energy > 95)>>
<<if $eventSlave.eggType == "human">>
<<if ($eventSlave.fetishKnown == 1)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus > 0)>>
	<<set $RESSevent.push("impregnation please")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ["large plug", "long, large plug", "huge plug", "long, huge plug"].includes($eventSlave.buttplug)>>
<<if ($eventSlave.assignment != "stay confined") && isSlaveAvailable($eventSlave)>>
<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.anus < 3)>>
	<<set $RESSevent.push("plug disobedience")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ["whore", "serve the public", "work in the brothel", "serve in the club"].includes($eventSlave.assignment)>>
<<if $eventSlave.vagina != 0>>
<<if $eventSlave.anus != 0>>
<<if canDoAnal($eventSlave)>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("used whore")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.assignment == "serve the public">>
<<if $eventSlave.devotion >= -20>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("nice guys")>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.assignment == "please you">>
<<if $eventSlave.devotion > 20>>
	<<set $RESSevent.push("lazy evening")>>
<</if>>
<</if>>

<<if $eventSlave.height < (Height.mean($eventSlave)*0.95)>>
<<if $eventSlave.physicalAge > 12>>
<<if canDoAnal($activeSlave)>>
<<if $eventSlave.devotion > 20>>
<<if $eventSlave.trust <= 95>>
	<<set $RESSevent.push("devoted shortstack")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<</if>> /* closes amp/crawling exempt */

<<if canTalk($eventSlave)>>

<<if ($eventSlave.speechRules != "restrictive")>>
<<if ($eventSlave.boobsImplant > 400)>>
<<if $eventSlave.lipsImplant >= 30>>
<<if $eventSlave.buttImplant > 3>>
<<if ($eventSlave.boobs < 9000) || ($eventSlave.butt < 8)>>
	<<set $RESSevent.push("surgery addict")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.assignment == "please you")>>
	<<if ($eventSlave.devotion > 20)>>
	<<if ($eventSlave.trust > -20)>>
	<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
		<<if (!["chastity", "combined chastity"].includes($eventSlave.dickAccessory)) || ($eventSlave.dick == 0)>>
			<<if ($corpIncorporated != 0)>>
				<<set $RESSevent.push("shift sleep")>>
			<</if>>
			<<if ($eventSlave.releaseRules == "permissive") || $eventSlave.releaseRules == "masturbation">>
				<<set $RESSevent.push("shift masturbation")>>
			<</if>>
			<<if ($eventSlave.entertainSkill >= 60)>>
				<<set $RESSevent.push("shift doorframe")>>
			<</if>>
		<</if>>
		<<if canDoVaginal($eventSlave)>>
		<<if ($PC.vagina == 1)>>
		<<if ($eventSlave.dick == 0)>>
		<<if ($fuckSlaves > 2)>>
			<<set $RESSevent.push("fucktoy tribbing")>>
		<</if>>
		<</if>>
		<</if>>
		<</if>>
	<</if>>
	<</if>>
	<</if>>
<<elseif ["serve in the master suite", "be your Concubine"].includes($eventSlave.assignment)>>
	<<if ($eventSlave.devotion > 20)>>
	<<if ($eventSlave.trust > -20)>>
	<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
		<<if (!["chastity", "combined chastity"].includes($eventSlave.dickAccessory)) || ($eventSlave.dick == 0)>>
			<<if ($corpIncorporated != 0)>>
				<<set $RESSevent.push("shift sleep")>>
			<</if>>
			<<if ($eventSlave.entertainSkill >= 60)>>
				<<set $RESSevent.push("shift doorframe")>>
			<</if>>
		<</if>>
		<<if canDoVaginal($eventSlave)>>
		<<if ($PC.vagina == 1)>>
		<<if ($eventSlave.dick == 0)>>
		<<if ($fuckSlaves > 2)>>
			<<set $RESSevent.push("fucktoy tribbing")>>
		<</if>>
		<</if>>
		<</if>>
		<</if>>
	<</if>>
	<</if>>
	<</if>>
<</if>>

<<if ($eventSlave.speechRules != "restrictive")>>
<<if ($eventSlave.oralCount+$eventSlave.vaginalCount+$eventSlave.analCount > 900)>>
<<if ($eventSlave.oralCount+$eventSlave.vaginalCount+$eventSlave.analCount < 1100)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus > 0)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("millenary")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.assignment == "stay confined")>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("solitary desperation")>>
<</if>>
<</if>>

<<if ($eventSlave.speechRules == "restrictive")>>
<<if ($eventSlave.devotion > 60)>>
<<if ($eventSlave.trust >= -20)>>
	<<set $RESSevent.push("restricted profession")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.speechRules == "restrictive")>>
<<if ($eventSlave.intelligence > 0)>>
<<if ($eventSlave.trust >= -20)>>
<<if ($eventSlave.devotion <= 20)>>
	<<set $RESSevent.push("restricted smart")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($expansionRequestsAllowed > 0)>>
<<if ($eventSlave.drugs == "no drugs")>>
<<if ($eventSlave.speechRules == "permissive")>>
<<if ($eventSlave.health > 20)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($arcologies[0].FSSlimnessEnthusiast == "unset")>>
	<<set $RESSevent.push("injections please")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.assignment == "serve the public")>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("serve the public devoted")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.behavioralFlaw == "bitchy")>>
<<if canSee($eventSlave)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust >= -20)>>
	<<set $RESSevent.push("obedient bitchy")>>
<</if>>
<</if>>
<</if>>
<</if>>

<</if>> /* closes mute exempt */

<<if ($cockFeeder == 0)>>
<<if ($eventSlave.intelligence < -1)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20) || ($eventSlave.trust < -20)>>
	<<set $RESSevent.push("obedient idiot")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.boobs > 25000)>>
<<if ($eventSlave.belly < 100000)>>
	<<set $RESSevent.push("tittymonster inspection")>>
<</if>>
<</if>>

<<if ($assistant > 1)>>
<<if ($eventSlave.fetishKnown == 1)>>
<<if ($eventSlave.energy > 95)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.releaseRules == "permissive") || $eventSlave.releaseRules == "masturbation">>
	<<set $RESSevent.push("nympho with assistant")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.assignment == "please you") || ($eventSlave.assignment == "serve in the master suite") || ($eventSlave.assignment == "be your Concubine")>>
	<<set $RESSevent.push("bed snuggle")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.minorInjury == "sore ass")>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("sore ass")>>
<</if>>
<</if>>

<<if ($eventSlave.sexualFlaw == "hates oral")>>
<<if ($PC.dick != 0)>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("hates oral")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.anus == 0)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.speechRules != "restrictive")>>
	<<set $RESSevent.push("devoted anal virgin")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($seeExtreme == 1)>>
<<if ($eventSlave.balls > 1)>>
<<if $eventSlave.scrotum > 0>>
<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.trust <= 20)>>
<<if ($eventSlave.speechRules != "restrictive")>>
	<<set $RESSevent.push("fearful balls")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.assignment == "work as a servant") || ($eventSlave.assignment == "be a servant")>>
	<<set $RESSevent.push("scrubbing")>>
<</if>>
<</if>>

<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.assignment == "work as a servant") || ($eventSlave.assignment == "be a servant")>>
<<if ($eventSlave.clothes == "a slutty maid outfit") || ($eventSlave.clothes == "a nice maid outfit")>>
	<<set $RESSevent.push("servant maid")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.speechRules != "restrictive")>>
<<if canDoVaginal($eventSlave)>>
<<if ($eventSlave.fetish != "buttslut")>>
<<if ($eventSlave.vagina == 0)>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.oralCount+$eventSlave.vaginalCount+$eventSlave.analCount > 100)>>
	<<set $RESSevent.push("unhappy virgin")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.aphrodisiacs > 1) || ($eventSlave.inflationType == "aphrodisiac")>>
<<if ($eventSlave.speechRules == "restrictive") && ($eventSlave.releaseRules !== "permissive")>>
	<<set $RESSevent.push("extreme aphrodisiacs")>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules != "restrictive") && $eventSlave.releaseRules != "masturbation">>
<<if ($eventSlave.clit > 2)>>
	<<set $RESSevent.push("slave clit on slave")>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules != "restrictive")>>
<<if ($eventSlave.dick > 4) >>
<<if canAchieveErection($eventSlave)>>
<<if $eventSlave.belly < 10000>>
<<if ($eventSlave.dickAccessory != "chastity" && $eventSlave.dickAccessory != "combined chastity")>>
	<<set $RESSevent.push("slave dick huge")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.heels == 1) >>
<<if ($eventSlave.shoes == "heels") || ($eventSlave.shoes == "extreme heels")>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("heels")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules != "restrictive")>>
<<if $eventSlave.belly < 300000>>
<<if ($eventSlave.anus > 2)>>
<<if ($eventSlave.fetish == "buttslut") || ($eventSlave.energy > 95)>>
<<if ($eventSlave.fetish != "none")>>
<<if canDoAnal($eventSlave)>>
	<<set $RESSevent.push("loose buttslut")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.assignment == "whore")>>
<<if canDoAnal($eventSlave) && ($eventSlave.vagina < 0 || canDoVaginal($eventSlave))>>
<<if ($eventSlave.devotion < -20) && ($eventSlave.trust > -20)>>
	<<set $RESSevent.push("whore rebellious")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.amp == 1)>>
	<<if ($eventSlave.devotion > 20)>>
	<<if ($eventSlave.anus > 0 && canDoAnal($eventSlave))>>
		<<set $RESSevent.push("devoted amp")>>
	<</if>>
	<</if>>
	<<if ($eventSlave.assignment == "rest")>>
		<<set $RESSevent.push("resting amp")>>
	<</if>>
<</if>>

<<if ($eventSlave.boobs < 500)>>
<<if ($eventSlave.butt < 3)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion > 20) && ($eventSlave.trust > -20)>>
<<if ($eventSlave.weight <= 10)>>
<<if ($eventSlave.muscles <= 30)>>
	<<set $RESSevent.push("obedient girlish")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.boobs > 1200)>>
<<if ($eventSlave.areolae > 3)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("shaped areolae")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.behavioralFlaw == "arrogant")>>
<<if ($eventSlave.devotion < -50)>>
<<if ($eventSlave.trust >= -50)>>
	<<set $RESSevent.push("rebellious arrogant")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.bellyPreg >= 10000)>>
	<<set $RESSevent.push("hugely pregnant")>>
<</if>>

<<if ($eventSlave.hormoneBalance >= 50)>>
<<if ($eventSlave.vagina == -1)>>
<<if ($eventSlave.balls >= 0)>>
<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.fetish != "buttslut")>>
<<if ($eventSlave.speechRules == "permissive")>>
	<<set $RESSevent.push("hormone dysfunction")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.vaginaPiercing > 1)>>
<<if ($eventSlave.nipplesPiercing > 1)>>
<<if ($eventSlave.clitPiercing > 1)>>
<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.devotion <= 50)>>
<<if canDoAnal($eventSlave) || canDoVaginal($eventSlave)>>
	<<set $RESSevent.push("heavy piercing")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.fetishKnown == 1)>>
<<if ($eventSlave.fetish == "cumslut") || ($eventSlave.energy > 95)>>
<<if ["whore", "serve the public", "work in the brothel", "serve in the club", "work a glory hole"].includes($eventSlave.assignment)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($PC.dick != 0)>>
	<<set $RESSevent.push("cumslut whore")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.anus == 0)>>
<<if ($eventSlave.devotion < -20)>>
<<if ($eventSlave.trust >= -20)>>
	<<set $RESSevent.push("resistant anal virgin")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.relationship == 4)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $events.push("RE slave marriage")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.prestige == 0)>>

<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>

<<if ($eventSlave.entertainSkill >= 100)>>
<<if ($eventSlave.assignment == "serve the public")>>
	<<set $events.push("RE legendary entertainer")>>
<</if>>
<</if>>

<<if ($eventSlave.whoreSkill >= 100)>>
<<if ($eventSlave.assignment == "whore")>>
	<<set $events.push("RE legendary whore")>>
<</if>>
<</if>>

<<if ($eventSlave.lactation > 0)>>
<<if (($eventSlave.boobs-$eventSlave.boobsImplant) > 6000)>>
<<if ($eventSlave.assignment == "get milked")>>
	<<set $events.push("RE legendary cow")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.preg > 30)>>
<<if ($eventSlave.pregType < 50)>>
<<if ($eventSlave.births > 10)>>
<<if ($eventSlave.assignment == "whore") || ($eventSlave.assignment == "serve the public")>>
<<if ($eventSlave.amp != 1)>>
	<<set $events.push("RE legendary womb")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 6)>>
<<if ($eventSlave.dick > 6)>>
<<if ($eventSlave.assignment == "work in the dairy") || ($eventSlave.assignment == "get milked")>>
	<<set $events.push("RE legendary balls")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.origin == "You sentenced her to enslavement as a punishment for attempted theft of a slave.") || ($eventSlave.origin == "She is an enslaved Daughter of Liberty.")>>
<<if ($eventSlave.devotion > 95) && ($eventSlave.assignment == "please you")>>
	<<set $events.push("RE former abolitionist")>>
<</if>>
<</if>>

<</if>>
<</if>>

<</if>>

/* NICKNAME EVENTS */

<<if $nicknamesAllowed == 1>>
<<set $toSearch = $eventSlave.slaveName.toLowerCase();>>
<<if ($toSearch.indexOf("'") == -1)>>
  <<if ($week-$eventSlave.weekAcquired >= 4)>>
	<<set $events.push("RE nickname")>>
	<<set $seed = 0>>
  <</if>>
<</if>> /* closes nickname check */
<</if>> /* closes no nicknames option */

<</if>> /* closes mindbreak exempt */

<<if ($eventSlave.fetish == "mindbroken")>>
<<if canWalk($eventSlave)>>
	<<set $RESSevent.push("mindbroken morning")>>
<</if>>
<<if def $eventSlave.kindness && $eventSlave.kindness >= 100>>
<<if isSlaveAvailable($eventSlave) && (canWalk($eventSlave) || (["please you", "serve in the master suite", "be your Concubine"].includes($eventSlave.assignment)))>>
<<if $eventSlave.relationship == -3>>
<<if random(1,200) < $eventSlave.kindness>>
	<<set $RESSevent.push("surprising wakeup")>>
<</if>>
<</if>>
<</if>>
<</if>>
<<if $eventSlave.career == "a breeding bull" && $eventSlave.assignment == "serve in the master suite" && canPenetrate($eventSlave) && $eventSlave.amp != 1 && $PC.vagina == 1 && $PC.preg == 0>>
	<<set $RESSevent.push("breeding bull")>>
<</if>>
<</if>>

/* EVENT STRIPPING */

<<if $normalizedEvents == 1>>
  <<for $i = 0; $i < $events.length; $i++>>
	<<if $events.count($events[$i]) > 1>>
	  <<set $events.deleteAt($i), $i-->>
	<</if>>
  <</for>>
<</if>>

/* EVENT RANDOMIZATION */

<<for $i = 0; $i < $RESSevent.length; $i++>>
  <<set $events.push("RESS")>>
<</for>>
<<for $i = 0; $i < $RESSTRevent.length; $i++>>
  <<set $events.push("RESSTR")>>
<</for>>
<<for $i = 0; $i < $RETSevent.length; $i++>>
  <<set $events.push("RETS")>>
<</for>>
<<for $i = 0; $i < $RECIevent.length; $i++>>
  <<set $events.push("RECI")>>
<</for>>
<<if $events.length == 0>>
	<<set $events.push("RE no event")>>
<</if>>
<<if $cheatMode == 1>>
  <<goto "random event select">>
<<else>>
  <<goto "random event roll">>
<</if>>

<</silently>>
<</if>> /* CLOSES SLAVE SELECT */


code:
:: Random Nonindividual Event [nobr]

<<set $showEncyclopedia = 0>>
<<if $eventSlave == 0>>
  <<set $eventSlave = $slaves.random()>>
  <<if $cheatMode == 1>>
	<<set $nextButton = "Refresh", $nextLink = "Random Nonindividual Event", $returnTo = "Random Nonindividual Event">>
	''Any one of your slaves would have been selected for a random non-individual event:''

	<<for $i = 0; $i < $slaves.length; $i++>>

<<print "[[$slaves[$i].slaveName|Random Nonindividual Event][$eventSlave = $slaves[" + $i + "]]]">>
	<</for>>

[[Switch to RIE Eligibility Check|RIE Eligibility Check][$activeSlave = 0, $eventSlave = 0]]
  <<else>>
	<<goto "Random Nonindividual Event">>
  <</if>>
<<else>>
<<silently>>
/* initialize event lists as arrays [], not objects {} */
<<set $events = [], $RecETSevent = [], $REFIevent = [], $PESSevent = [], $PETSevent = [], $REFSevent = [], $activeSlave = 0, $groomSlave = 0, $brideSlave = 0, $recruiterSlave = 0>>

<<set $seed = 0>>

<<if $eventSlave.fuckdoll == 0>>

<<if $nicknamesAllowed == 1>>
<<if $eventSlave.assignment != "be confined in the arcade">>
<<set $toSearch = $eventSlave.slaveName.toLowerCase()>>
<<if ($toSearch.indexOf("'") == -1)>>
	<<if ($week-$eventSlave.weekAcquired >= 4)>>
	<<if ($eventSlave.devotion >= -20)>>
	<<set $events.push("RE nickname")>>
	<<set $events.push("RE nickname")>>
	<<set $events.push("RE nickname")>>
	<<set $events.push("RE nickname")>>
	<<set $seed = 1>> /* tells RE nickname to set nextLink to RIE Eligibility Check */
	<<else>>
	<<set $events.push("RE nickname")>>
	<<set $events.push("RE nickname")>>
	<<set $seed = 1>> /* tells RE nickname to set nextLink to RIE Eligibility Check */
	<</if>>
	<</if>>
<</if>> /* closes nickname check */
<</if>>
<</if>> /* closes no nicknames option */

<</if>> /* CLOSES FUCKDOLL CHECK */

<<set $legendaryFacility = 1>>
<<if $legendaryWhoreID != 0>>
	<<set $events.push("RE legendary whore")>>
<</if>>
<<if $legendaryEntertainerID != 0>>
	<<set $events.push("RE legendary entertainer")>>
<</if>>
<<if $legendaryCowID != 0>>
	<<set $events.push("RE legendary cow")>>
<</if>>
<<if $legendaryBallsID != 0>>
	<<set $events.push("RE legendary balls")>>
<</if>>
<<if $legendaryWombID != 0>>
	<<set $events.push("RE legendary womb")>>
<</if>>
<<if $legendaryAbolitionistID != 0>>
<<set $events.push("RE former abolitionist")>>
<</if>>

<<if $shelterAbuse <= 5>>
<<if $shelterGirlsIDs.length > 0>>
<<set $events.push("RE shelter inspection")>>
<</if>>
<</if>>

/* Relationship Events */

<<if $familyTesting == 0>>

<<set _relatedSlaves = $slaves.filter(function(s) { return s.relation != 0; })>>

<<set _devMothers = _relatedSlaves.filter(function(s) { return s.relation == "mother" && s.devotion > 50 && s.anus != 0 && s.relationshipTarget != s.relationTarget && canWalk(s); })>>
<<for _devMothers.length > 0>>
	<<set $devMother = _devMothers.pluck()>>
	<<set $devDaughter = _relatedSlaves.find(function(s) { return s.ID == $devMother.relationTarget && s.devotion > 50 && s.anus != 0 && canWalk(s); })>>
	<<if (def $devDaughter)>>
		<<set $events.push("RE devoted mother daughter")>>
		<<break>>
	<</if>>
<</for>>

<<set _resMothers = _relatedSlaves.filter(function(s) { return s.relation == "mother" && s.devotion < 10 && s.anus != 0 && s.relationshipTarget != s.relationTarget && canWalk(s); })>>
<<for _resMothers.length > 0>>
	<<set $mother = _resMothers.pluck()>>
	<<set $daughter = _relatedSlaves.find(function(s) { return s.ID == $mother.relationTarget && s.devotion < 10 && s.anus != 0 && canWalk(s); })>>
	<<if (def $daughter)>>
		<<set $events.push("RE resistant mother daughter")>>
		<<break>>
	<</if>>
<</for>>

<<set _youngerSisters = _relatedSlaves.filter(function(s) { return s.relation == "sister" && canPenetrate(s); })>>
<<for _youngerSisters.length > 0>>
	<<set $youngerSister = _youngerSisters.pluck()>>
	<<set $olderSister = _relatedSlaves.find(function(s) { return s.ID == $youngerSister.relationTarget && s.anus == 0 && $youngerSister.devotion > (s.devotion+20); })>>
	<<if (def $olderSister)>>
		<<set $events.push("RE sibling revenge")>>
		<<break>>
	<</if>>
<</for>>

<<set _twins = _relatedSlaves.filter(function(s) { return s.relation == "twin" && s.anus > 0 && s.devotion > 50 && canWalk(s); })>>
<<for _twins.length > 0>>
	<<set $alphaTwin = _twins.pluck()>>
	<<set $betaTwin = _relatedSlaves.find(function(s) { return s.ID == $alphaTwin.relationTarget && s.anus > 0 && s.devotion > 50 && canWalk(s); })>>
	<<if (def $betaTwin)>>
		<<set $events.push("RE devoted twins")>>
		<<break>>
	<</if>>
<</for>>

<<else>> /* $familyTesting == 1 */

<<set _relatedSlaves = $slaves.filter(function(s) { return s.daughters > 0 || s.sisters > 0; })>>

<<set _devMothers = _relatedSlaves.filter(function(s) { return s.daughters > 0 && s.devotion > 50 && s.anus != 0 && canWalk(s); })>>
<<for _devMothers.length > 0>>
	<<set $devMother = _devMothers.pluck()>>
	<<set $devDaughter = randomDaughter($devMother)>>
	<<if (def $devDaughter) && ($devDaughter.devotion > 50) && ($devDaughter.anus != 0) && canWalk($devDaughter)>>
		<<set $events.push("RE devoted mother daughter")>>
		<<break>>
	<</if>>
<</for>>

<<set _resMothers = _relatedSlaves.filter(function(s) { return s.daughters > 0 && s.devotion < 10 && s.anus != 0 && canWalk(s); })>>
<<for _resMothers.length > 0>>
	<<set $mother = _resMothers.pluck()>>
	<<set $daughter = randomDaughter($mother)>>
	<<if (def $daughter) && ($daughter.devotion < 10) && ($daughter.anus != 0) && canWalk($daughter)>>
		<<set $events.push("RE resistant mother daughter")>>
		<<break>>
	<</if>>
<</for>>

<<set _youngerSisters = _relatedSlaves.filter(function(s) { return s.sisters > 0 && canPenetrate(s); })>>
<<for _youngerSisters.length > 0>>
	<<set $youngerSister = _youngerSisters.pluck()>>
	<<set $olderSister = randomSister($youngerSister)>>
	<<if (def $olderSister) && ($olderSister.anus == 0) && $youngerSister.devotion > ($olderSister.devotion+20)>>
		<<set $events.push("RE sibling revenge")>>
		<<break>>
	<</if>>
<</for>>

<<set _twins = _relatedSlaves.filter(function(s) { return s.sisters > 0 && s.anus > 0 && s.devotion > 50 && canWalk(s); })>>
<<for _twins.length > 0>>
	<<set $alphaTwin = _twins.pluck()>>
	<<set $betaTwin = randomTwinSister($alphaTwin)>>
	<<if (def $betaTwin) && ($betaTwin.anus > 0) && ($betaTwin.devotion > 50) && canWalk($betaTwin)>>
		<<set $events.push("RE devoted twins")>>
		<<break>>
	<</if>>
<</for>>

<</if>>  /* closes extended family mode */

/* Fetish Interest Events */

<<set $buttslutID = 0, $cumslutID = 0, $humiliationID = 0, $subID = 0, $pregnancyID = 0, $masochistID = 0, $boobsID = 0>>

<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($slaves[$i].fetishKnown == 1)>>
<<if ($slaves[$i].fetishStrength > 95)>>
<<if ($slaves[$i].fetish == "buttslut")>>
	<<if ($slaves[$i].anus > 0)>>
	<<if ($buttslutID == 0)>>
		<<set $buttslutID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<<elseif ($slaves[$i].fetish == "cumslut")>>
	<<if ($cumslutID == 0)>>
		<<set $cumslutID = $slaves[$i].ID>>
	<</if>>
<<elseif ($slaves[$i].fetish == "submissive")>>
	<<if ($slaves[$i].anus > 0)>>
	<<if ($subID == 0)>>
		<<set $subID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<<elseif ($slaves[$i].fetish == "humiliation")>>
	<<if ($slaves[$i].anus > 0)>>
	<<if ($humiliationID == 0)>>
		<<set $humiliationID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<<elseif ($slaves[$i].fetish == "boobs")>>
	<<if ($slaves[$i].lactation > 0)>>
	<<if ($boobsID == 0)>>
		<<set $boobsID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<<elseif ($slaves[$i].fetish == "pregnancy")>>
	<<if ($slaves[$i].bellyPreg >= 5000)>>
	<<if ($pregnancyID == 0)>>
		<<set $pregnancyID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<<elseif ($slaves[$i].fetish == "masochist")>>
	<<if ($slaves[$i].anus != 0)>>
	<<if ($masochistID == 0)>>
		<<set $masochistID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<set $buttslutInterestTargetID = 0, $cumslutInterestTargetID = 0, $submissiveInterestTargetID = 0, $humiliationInterestTargetID = 0, $boobsInterestTargetID = 0, $pregnancyInterestTargetID = 0, $masochistInterestTargetID = 0>>

<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($slaves[$i].speechRules != "restrictive")>>
<<if ($slaves[$i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
<<if ($slaves[$i].fetish == "none") || ($slaves[$i].fetishStrength <= 60)>>
	<<if ($buttslutID != 0) && ($buttslutInterestTargetID == 0)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("buttslut")>>
		<<set $buttslutInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
	<<if ($cumslutID != 0) && ($cumslutInterestTargetID == 0)>>
		<<if $PC.dick == 1>>
			<<set $REFIevent.push("cumslut")>>
		<</if>>
		<<set $cumslutInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($subID != 0) && ($submissiveInterestTargetID == 0)>>
		<<set $REFIevent.push("submissive")>>
		<<set $submissiveInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($humiliationID != 0) && ($humiliationInterestTargetID == 0)>>
		<<set $REFIevent.push("humiliation")>>
		<<set $humiliationInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($boobsID != 0) && ($boobsInterestTargetID == 0)>>
		<<set $REFIevent.push("boobs")>>
		<<set $boobsInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($pregnancyID != 0) && ($pregnancyInterestTargetID == 0)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("pregnancy")>>
		<<set $pregnancyInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
	<<if ($masochistID != 0) && ($masochistInterestTargetID == 0)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("masochist")>>
		<<set $masochistInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

/* Multislave Events */

<<set $devotedSlaves = $slaves.filter(function(s) { return s.devotion > 50 && canWalk(s) && s.assignment != "be your agent" && s.assignment != "live with your agent"; })>>
<<if def $devotedSlaves[3]>>
	<<set $devotedSlaves = $devotedSlaves.shuffle()>>
	<<set $devotedSlaves.length = 4>>
	<<set $events.push("RE devotees")>>
<</if>>

<<if $fuckSlaves > 1>>
	<<set $bedSlaves = $slaves.filter(function(s) { return s.devotion > 50 && (s.assignment == "please you" || s.assignment == "serve in the master suite" || s.assignment == "be your Concubine") && s.amp != 1 && canDoAnal(s); })>>
	<<if def $bedSlaves[1]>>
		<<set $bedSlaves = $bedSlaves.shuffle()>>
		<<set $bedSlaves.length = 2>>
		<<set $events.push("RE full bed")>>
	<</if>>
<</if>>
<<if $fuckSlaves > 3>>
	<<set $events.push("RE staffed morning")>>
<</if>>

<<if $dairyRestraintsSetting >= 2>>
	<<set $rebelSlaves = $slaves.filter(function(s) { return s.devotion < -20 && s.assignment != "be confined in the arcade" && canWalk(s) && s.assignment != "work in the dairy"; })>>
<<else>>
	<<set $rebelSlaves = $slaves.filter(function(s) { return s.devotion < -20 && s.assignment != "be confined in the arcade" && canWalk(s); })>>
<</if>>
<<if $rebelSlaves.length > 1>>
	<<set $rebelSlaves = $rebelSlaves.shuffle()>>
	<<set $rebelSlaves.length = 2>>
	<<set $events.push("RE rebels")>>
<</if>>

<<if $brothelSlaves > 3>>
	<<set $events.push("RE busy brothel")>>
<</if>>
<<if $brothelSlaves > 5>>
	<<set $events.push("RE brothel function")>>
<</if>>
<<if $clubSlaves > 3>>
	<<set $events.push("RE busy club")>>
<</if>>
<<if $dairySlaves > 3>>
<<if $dairyRestraintsSetting < 2>>
	<<set $events.push("RE busy dairy")>>
<</if>>
<</if>>
<<if $servantsQuartersSlaves > 3>>
	<<set $events.push("RE busy servants quarters")>>
<</if>>
<<if $arcadeSlaves > 3>>
	<<set $events.push("RE busy arcade")>>
<</if>>
<<if $masterSuiteSlaves > 3>>
	<<if $Concubine != 0>>
	<<set $events.push("RE busy master suite")>>
	<</if>>
<</if>>

/* Position Events */

<<if ($HeadGirl != 0)>>

	<<if ($Concubine != 0)>>
	<<if $fuckSlaves > 1>>
	<<if canTalk($Concubine)>>
	<<if canSee($Concubine)>>
	<<if canWalk($Concubine)>>
		<<set $events.push("PE headgirl concubine")>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>

	<<set $j = $slaves.findIndex(function(s) { return s.ID != $HeadGirl.ID && s.devotion < 20; })>>

	<<if canPenetrate($HeadGirl) && ($HeadGirl.balls > 0)>>
		<<if $j != -1>>
			<<set $PESSevent.push("headgirl dickgirl")>> /* requires valid $slaves[$j] */
		<</if>>

		<<if ($universalRulesImpregnation == "HG")>>
		<<if ($HeadGirl.devotion > 95)>>
			<<set $PESSevent.push("worshipful impregnatrix")>> /* does not use $j */
		<</if>>
		<</if>>
	<</if>>

	<<if ($HeadGirl.devotion > 95)>>
		<<if ($slaves.length > 4)>>
			<<set $PESSevent.push("loving headgirl")>> /* uses $j if valid, but not required */
		<</if>>
		<<if ($week > 20)>>
		<<if ($HeadGirl.trust > 95)>>
		<<if ($HeadGirl.intelligence > 1)>>
			<<set $PESSevent.push("worried headgirl")>> /* does not use $j */
		<</if>>
		<</if>>
		<</if>>
	<</if>>

<</if>>

<<if ($Bodyguard != 0)>>

	/*<<set $events.push("PE pit fight invite")>>*/

	<<if ($Bodyguard.combatSkill != 0)>>
		<<set $PESSevent.push("bodyguard bedtime")>>
	<</if>>

	<<if ($Bodyguard.devotion > 45)>>
		<<set $PESSevent.push("bodyguard beatdown")>>
	<</if>>

	<<if ($Bodyguard.relationship == 0)>>
	<<if ($Bodyguard.relationshipRules == "permissive")>>
	<<if ($Bodyguard.fetish != "mindbroken")>>
		<<set $j = $slaves.findIndex(function(s) { return s.ID != $Bodyguard.ID && s.relationship == 0 && s.devotion > -20; })>>
		<<if $j != -1>>
			<<set $events.push("PE lonely bodyguard")>> /* requires valid $slaves[$j] */
		<</if>>
	<</if>>
	<</if>>
	<</if>>

	<<if ($Bodyguard.combatSkill == 0)>>
		<<set $events.push("PE combat training")>>
		<<set $events.push("PE combat training")>>
		<<set $events.push("PE combat training")>>
	<</if>>

<</if>>

<<if ($Milkmaid != 0) && ($dairySlaves >= 5) && ($Milkmaid.health >= 70)>>
	<<if ($Milkmaid.muscles > 5)>>
		<<set $PESSevent.push("tired milkmaid")>>
	<</if>>
	<<if canAchieveErection($Milkmaid)>>
		<<set $PESSevent.push("tired collectrix")>>
	<</if>>
<</if>>

<<if ($Stewardess != 0) && ($servantsQuartersSlaves > 0) && ($Stewardess.actualAge >= 35 || $AgePenalty == 0)>>
	<<set $PETSevent.push("stewardess beating")>>
<</if>>

<<if ($Madam != 0) && ($brothelSlaves >= 5) && ($Madam.actualAge >= 35 || $AgePenalty == 0) && ($Madam.whoreSkill >= 100)>>
	<<set $PESSevent.push("madam strategy")>>
<</if>>

<<if ($DJ != 0) && ($clubSlaves >= 5) && ($DJ.face > 95) && ($DJ.entertainSkill >= 100)>>
	<<set $PESSevent.push("DJ publicity")>>
<</if>>

<<if ($Schoolteacher != 0) && ($schoolroomSlaves > 0) && ($Schoolteacher.intelligence >= 1) && ($Schoolteacher.actualAge >= 35)>>
	<<set $PETSevent.push("aggressive schoolteacher")>>
<</if>>

<<if ($Wardeness != 0) && ($cellblockSlaves > 0) && canTalk($Wardeness)>>
	<<set $PETSevent.push("abusive wardeness")>>
<</if>>

<<if ($Attendant != 0) && ($spaSlaves > 0) && canTalk($Attendant)>>
	<<set $PETSevent.push("comforting attendant")>>

<</if>>

<<if ($Nurse != 0) && ($clinicSlaves > 0) && ($Nurse.energy > 95) || (($Nurse.fetishStrength > 60) && ($Nurse.fetish == "sadist" || $Nurse.fetish == "dom"))>>
	<<set $subSlave = $slaves.find(function(s) { return s.anus != 0 && s.assignment == "get treatment in the clinic"; })>>
	<<if (def $subSlave)>>
		<<set $PETSevent.push("nurse molestation")>>
	<</if>>
<</if>>

<<if ($Concubine != 0)>>
	<<if canWalk($Concubine)>>
	<<if canSee($Concubine)>>
	<<set $PESSevent.push("loving concubine")>>
	<</if>>
	<<if canTalk($Concubine)>>
		<<set $events.push("PE concubine interview")>>
	<</if>>
	<</if>>
<</if>>

/* Acquisition Events */

<<set $events.push("RE recruit")>>
<<if random(1,100) < $rep/200>>
	<<set $events.push("RE recruit")>>
<</if>>
<<if $ProRecruitment == 1>>
<<if random(1,100) < $rep/200>>
	<<set $events.push("RE recruit")>>
<</if>>
<</if>>
<<if $AntiEnslavementRep == 0>>
<<if random(1,100) < $rep/300>>
	<<set $events.push("RE recruit")>>
<</if>>
<</if>>
<<if $AntiEnslavementCash == 0>>
<<if random(1,100) < $rep/300>>
	<<set $events.push("RE recruit")>>
<</if>>
<</if>>
<<set $recruit = []>>

<<if $boomerangSlave>>
<<if $boomerangWeeks > 5>>
	<<set $events.push("RE boomerang")>>
	<<if $boomerangWeeks > 10>><<set $events.push("RE boomerang")>><</if>>
<</if>>
<</if>>

<<if $seeDicks != 100>> /*XX ACQUISITIONS*/

<<set $recruit.push("repo milf housekeeper")>>
<<set $recruit.push("spoiled daughter")>>
<<set $recruit.push("desperate university milf")>>
<<set $recruit.push("female debtor")>>
<<set $recruit.push("desperate milf")>>
<<if $arcologies[0].FSRestart == "unset">>
	<<set $recruit.push("desperate preg")>>
<</if>>
<<if random(1,1000) < 5>>
	<<set $recruit.push("wandering homeless")>>
<</if>>
<<if $PC.medicine >= 50>>
	<<set $recruit.push("desperate birth")>>
<</if>>
<<set $recruit.push("blind homeless")>>
<<set $recruit.push("female SD")>>
<<set $recruit.push("female SD 2")>>
<<set $recruit.push("female SE")>>
<<set $recruit.push("CCS angel")>>
<<set $recruit.push("CCS DA")>>
<<set $recruit.push("racer loser")>>
<<set $recruit.push("racer winner")>>
<<set $recruit.push("repo housekeeper")>>
<<set $recruit.push("repo nanny")>>
<<set $recruit.push("farm cow")>>
<<set $recruit.push("farm virgin cow")>>
<<set $recruit.push("orphan rebellious female")>>
<<set $recruit.push("captured teen")>>
<<if ($mercenaries >= 5)>>
	<<set $recruit.push("female runaway")>>
<</if>>
<<if ($cash > 20000)>>
	<<set $recruit.push("school sale")>>
<</if>>
<<if ($HeadGirl.devotion > 50) && ($HeadGirl.entertainSkill >= 100)>>
	<<set $recruit.push("female recruit")>>
<</if>>
<<if ($HeadGirl.devotion > 50) && ($HeadGirl.whoreSkill >= 100)>>
	<<set $recruit.push("whore recruit")>>
<</if>>
<<if $arcologyUpgrade.drones == 1>>
	<<set $events.push("RE malefactor")>>
	<<set $malefactor = ["liberator", "whore", "businesswoman", "addict", "anchorBaby"]>>
	<<if $seeDicks != 0>>
	<<set $malefactor.push("rapist")>>
	<</if>>
	<<if $minimumSlaveAge <= 12>>
	<<set $malefactor.push("orphanloli")>>
	<</if>>
	<<if $arcologies[0].FSPaternalist < 50>>
	<<set $malefactor.push("escapee")>>
	<</if>>
	<<set $malefactor = $malefactor.random()>>
	<<if ($rep/150) > random(1,100)>>
	<<set $events.push("RE malefactor")>>
	<</if>>
<</if>>

<</if>>

<<if $seeDicks != 0>> /*XY ACQUISITIONS*/

<<set $recruit.push("male debtor")>>
<<set $recruit.push("tg addict")>>
<<set $recruit.push("male SD")>>
<<set $recruit.push("MTF SE")>>
<<set $recruit.push("DG SE")>>
<<set $recruit.push("gang leader")>>
<<set $recruit.push("racer DG chaser")>>
<<set $recruit.push("farm bull")>>
<<set $recruit.push("orphan femboy")>>
<<if ($mercenaries >= 5)>>
	<<set $recruit.push("DG runaway")>>
	<<set $recruit.push("herm runaway")>>
<</if>>
<<if ($cash > 20000)>>
	<<set $recruit.push("school trap")>>
<</if>>
<<if ($HeadGirl.devotion > 50) && ($HeadGirl.dick > 0)>>
	<<set $recruit.push("male recruit")>>
<</if>>
<<if $seeDicks != 100>>
	<<if ($HeadGirl.devotion > 50)>>
		<<set $RecETSevent.push("mismatched pair")>>
	<</if>>
	<<if ($rep/250) > random(1,100)>>
		<<set $RecETSevent.push("matched pair")>>
	<</if>>
	<<if ($rep/250) > random(1,100) && $arcologies[0].FSRestart == "unset">>
		<<set $RecETSevent.push("identical herm pair")>>
	<</if>>
	<<if ($rep/250) > random(1,100) && $arcologies[0].FSRestart == "unset">>
		<<set $RecETSevent.push("incest mother son")>>
	<</if>>
	<<if ($rep/250) > random(1,100) && $arcologies[0].FSRestart == "unset">>
		<<set $RecETSevent.push("incest father daughter")>>
	<</if>>
<</if>>

<<else>> /*XX ACQUISITIONS*/

<<if ($rep/250) > random(1,100)>>
	<<set $RecETSevent.push("identical pair")>>
<</if>>
<<if ($rep/250) > random(1,100)>>
	<<set $RecETSevent.push("posh mother daughter")>>
<</if>>

<</if>>

<<set $recruit.push("starving artist")>>
<<if ($rep/250) > random(1,100)>>
	<<set $RecETSevent.push("addict mother daughter")>>
<</if>>
<<if $seeHyperPreg == 1 && $arcologies[0].FSRestart == "unset" && random(1,100) <= 5>>
	<<set $RecETSevent.push("desperate broodmother")>>
<</if>>
<<if ($rep/250) > random(1,100)>>
	<<set $recruit.push("immigrant")>>
<</if>>

<<if ($PC.dick == 1) && ($PC.vagina == 0) && ($PC.boobs == 0) && ($PC.title == 1)>>
	<<if ($rep/250) > random(1,100)>>
	<<set $recruit.push("handsome PC")>>
	<<set $recruit.push("handsome PC")>>
	<</if>>
<<elseif ($PC.dick == 0) && ($PC.boobs == 1) && ($PC.title == 0)>>
	<<if ($rep/250) > random(1,100)>>
	<<set $recruit.push("womanly PC")>>
	<<set $recruit.push("womanly PC")>>
	<</if>>
<<elseif ($PC.dick == 1) && ($PC.boobs == 1)>>
	<<if ($rep/250) > random(1,100)>>
	<<set $recruit.push("shemale PC")>>
	<<set $recruit.push("shemale PC")>>
	<</if>>
<</if>>

<<if $familyTesting == 1>>

<<set _recruiterSlaves = $slaves.filter(function(s) { return s.fuckdoll == 0 && s.canRecruit == 1 && s.devotion > 50 && canWalk(s); })>>
<<for _recruiterSlaves.length > 0>>
	<<set $recruiterSlave = _recruiterSlaves.pluck()>>
	<<if random(1,100) > 90+(totalRelatives($recruiterSlave)*2)>>
		<<set $j = $genePool.findIndex(function(o) { return o.ID == $recruiterSlave.ID; })>>
		<<if $j != -1>>
			<<set $events.push("RE relative recruiter")>>
			<<break>>
		<<else>> /* no matching slave object in the slavesOriginal array */
			<<set $i = $slaves.findIndex(function(o) { return o.ID == $recruiterSlave.ID; })>>
			<<set $slaves[$i].canRecruit = 0>>
		<</if>>
	<</if>>
<</for>>

<<else>> /* extended family mode == 0 */

<<set _recruiterSlaves = $slaves.filter(function(s) { return s.recruiter != 0 && s.fuckdoll == 0 && s.devotion > 50 && s.relation == 0 && canWalk(s); })>>
<<for _recruiterSlaves.length > 0>>
	<<set $recruiterSlave = _recruiterSlaves.pluck()>>
	<<set $j = $genePool.findIndex(function(o) { return o.ID == $recruiterSlave.ID; })>>
	<<if $j != -1>>
		<<set $events.push("RE relative recruiter")>>
		<<break>>
	<<else>> /* no matching slave object in the slavesOriginal array -- bug? */
		<<set $i = $slaves.findIndex(function(o) { return o.ID == $recruiterSlave.ID; })>>
		<<set $slaves[$i].recruiter = 0>>
	<</if>>
<</for>>

<</if>> /* closes extended family mode */

<<if $FSAnnounced == 1>>
	<<set $FSAcquisitionEvents = []>>
	<<if $arcologies[0].FSSupremacist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Supremacist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSSubjugationist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Subjugationist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSGenderRadicalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Gender Radicalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSRepopulationFocus > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Repopulation Efforts")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSRestart > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Eugenics")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSGenderFundamentalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Gender Fundamentalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPaternalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Paternalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSDegradationist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Degradationist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSBodyPurist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Body Purist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSTransformationFetishist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Transformation Fetishist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSYouthPreferentialist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Youth Preferentialist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSMaturityPreferentialist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Maturity Preferentialist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSSlimnessEnthusiast > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Slimness Enthusiast")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSAssetExpansionist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Asset Expansionist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPastoralist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Pastoralist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPhysicalIdealist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Physical Idealist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSHedonisticDecadence > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Hedonistic Decadence")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSChattelReligionist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Chattel Religionist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSSupremacist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Supremacist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSSubjugationist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Subjugationist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSGenderRadicalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Gender Radicalist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSGenderFundamentalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Gender Fundamentalist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPaternalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Paternalist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSDegradationist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Degradationist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSBodyPurist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Body Purist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSTransformationFetishist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Transformation Fetishist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSYouthPreferentialist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Youth Preferentialist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSMaturityPreferentialist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Maturity Preferentialist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSSlimnessEnthusiast > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Slimness Enthusiast Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSAssetExpansionist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Asset Expansionist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPastoralist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Pastoralist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPhysicalIdealist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Physical Idealist Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSHedonisticDecadence > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Hedonistic Decadence Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSRepopulationFocus > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Repopulation Efforts Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSRestart > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Eugenics Two")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSRomanRevivalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Roman Revivalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSAztecRevivalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Aztec Revivalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSEdoRevivalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Edo Revivalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSArabianRevivalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Arabian Revivalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSChineseRevivalist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Chinese Revivalist")>>
		<<set $events.push("RE FS acquisition")>>
	<</if>>
	<<if $arcologies[0].FSEgyptianRevivalist > random(1,100)>>
		<<set $events.push("RE FSEgyptianRevivalist acquisition")>>
	<</if>>
	<<if $arcologies[0].FSPaternalistDecoration == 100 && $minimumSlaveAge <= 14 && $week >= 100>>
		<<set $recruit.push("paternalist swan song")>>
	<</if>>
	<<set $FSNonconformistEvents = []>>
	<<if $arcologies[0].FSSupremacist < 95>><<if $arcologies[0].FSSupremacist > 50>>
		<<set $FSNonconformistEvents.push("Supremacist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSSubjugationist < 95>><<if $arcologies[0].FSSubjugationist > 50>>
		<<set $FSNonconformistEvents.push("Subjugationist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSRepopulationFocus < 95>><<if $arcologies[0].FSRepopulationFocus > 50>>
		<<set $FSNonconformistEvents.push("Repopulation Efforts")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSRestart < 95>><<if $arcologies[0].FSRestart > 50>>
		<<set $FSNonconformistEvents.push("Eugenics")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSGenderRadicalist < 95>><<if $arcologies[0].FSGenderRadicalist > 50>>
		<<set $FSNonconformistEvents.push("Gender Radicalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSGenderFundamentalist < 95>><<if $arcologies[0].FSGenderFundamentalist > 50>>
		<<set $FSNonconformistEvents.push("Gender Fundamentalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSPaternalist < 95>><<if $arcologies[0].FSPaternalist > 50>>
		<<set $FSNonconformistEvents.push("Paternalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSDegradationist < 95>><<if $arcologies[0].FSDegradationist > 50>>
		<<set $FSNonconformistEvents.push("Degradationist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSBodyPurist < 95>><<if $arcologies[0].FSBodyPurist > 50>>
		<<set $FSNonconformistEvents.push("Body Purist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSTransformationFetishist < 95>><<if $arcologies[0].FSTransformationFetishist > 50>>
		<<set $FSNonconformistEvents.push("Transformation Fetishist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSYouthPreferentialist < 95>><<if $arcologies[0].FSYouthPreferentialist > 50>>
		<<set $FSNonconformistEvents.push("Youth Preferentialist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSMaturityPreferentialist < 95>><<if $arcologies[0].FSMaturityPreferentialist > 50>>
		<<set $FSNonconformistEvents.push("Maturity Preferentialist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSSlimnessEnthusiast < 95>><<if $arcologies[0].FSSlimnessEnthusiast > 50>>
		<<set $FSNonconformistEvents.push("Slimness Enthusiast")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSAssetExpansionist < 95>><<if $arcologies[0].FSAssetExpansionist > 50>>
		<<set $FSNonconformistEvents.push("Asset Expansionist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSPastoralist < 95>><<if $arcologies[0].FSPastoralist > 50>>
		<<set $FSNonconformistEvents.push("Pastoralist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSPhysicalIdealist < 95>><<if $arcologies[0].FSPhysicalIdealist > 50>>
		<<set $FSNonconformistEvents.push("Physical Idealist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSHedonisticDecadence < 95>><<if $arcologies[0].FSHedonisticDecadence > 50>>
		<<set $FSNonconformistEvents.push("Hedonistic Decadence")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSChattelReligionist < 95>><<if $arcologies[0].FSChattelReligionist > 50>>
		<<set $FSNonconformistEvents.push("Chattel Religionist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSRomanRevivalist < 95>><<if $arcologies[0].FSRomanRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Roman Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSAztecRevivalist < 95>><<if $arcologies[0].FSAztecRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Aztec Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSEdoRevivalist < 95>><<if $arcologies[0].FSEdoRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Edo Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSArabianRevivalist < 95>><<if $arcologies[0].FSArabianRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Arabian Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSChineseRevivalist < 95>><<if $arcologies[0].FSChineseRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Chinese Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
	<<if $arcologies[0].FSEgyptianRevivalist < 95>><<if $arcologies[0].FSEgyptianRevivalist > 50>>
		<<set $FSNonconformistEvents.push("Egyptian Revivalist")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</if>>
<</if>>

/* SCHOOL EVENTS */

<<if $cash > 50000>>
	<<set $RESEndowment = []>>
	<<if $TSS.schoolUpgrade == 0>>
	<<if ($TSS.studentsBought > 1) || ($TSS.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $TSS.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("TSS")>>
	<</if>>
	<</if>>
	<<if $GRI.schoolUpgrade == 0>>
	<<if ($GRI.studentsBought > 1) || ($GRI.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $GRI.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("GRI")>>
	<</if>>
	<</if>>
	<<if $SCP.schoolUpgrade == 0>>
	<<if ($SCP.studentsBought > 1) || ($SCP.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $SCP.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("SCP")>>
	<</if>>
	<</if>>
	<<if $LDE.schoolUpgrade == 0>>
	<<if ($LDE.studentsBought > 1) || ($LDE.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $LDE.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("LDE")>>
	<</if>>
	<</if>>
	<<if $TGA.schoolUpgrade == 0>>
	<<if ($TGA.studentsBought > 1) || ($TGA.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $TGA.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("TGA")>>
	<</if>>
	<</if>>
	<<if $TCR.schoolUpgrade == 0>>
	<<if ($TCR.studentsBought > 1) || ($TCR.schoolPresent != 0)>>
		<<set $events.push("RES Endowment")>>
		<<if $TCR.studentsBought > 2>>
		<<set $events.push("RES Endowment")>>
		<</if>>
		<<set $RESEndowment.push("TCR")>>
	<</if>>
	<</if>>
	<<if $TFS.schoolUpgrade == 0>>
	<<if ($TFS.studentsBought > 1) || ($TFS.schoolPresent != 0) || (($TFS.studentsBought > 0) && ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1))>>
		<<set $events.push("RES Endowment")>>
		<<set $RESEndowment.push("TFS")>>
		<<if $TFS.studentsBought > 2>>
			<<set $events.push("RES Endowment")>>
			<<set $RESEndowment.push("TFS")>>
		<</if>>
		<<if ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>>
			<<set $events.push("RES Endowment")>>
			<<set $RESEndowment.push("TFS")>>
		<</if>>
	<</if>>
	<</if>>
<</if>>

<<set $RESMove = []>>
<<if $TSS.schoolUpgrade != 0>>
<<if $TSS.schoolPresent == 0>>
<<if $TSS.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("TSS")>>
<</if>>
<</if>>
<</if>>
<<if $GRI.schoolUpgrade != 0>>
<<if $GRI.schoolPresent == 0>>
<<if $GRI.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("GRI")>>
<</if>>
<</if>>
<</if>>
<<if $SCP.schoolUpgrade != 0>>
<<if $SCP.schoolPresent == 0>>
<<if $SCP.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("SCP")>>
<</if>>
<</if>>
<</if>>
<<if $LDE.schoolUpgrade != 0>>
<<if $LDE.schoolPresent == 0>>
<<if $LDE.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("LDE")>>
<</if>>
<</if>>
<</if>>
<<if $TGA.schoolUpgrade != 0>>
<<if $TGA.schoolPresent == 0>>
<<if $TGA.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("TGA")>>
<</if>>
<</if>>
<</if>>
<<if $TCR.schoolUpgrade != 0 && $TCR.schoolPresent == 0 && $TCR.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("TCR")>>
<</if>>
<<if $TFS.schoolUpgrade != 0>>
<<if $TFS.schoolPresent == 0>>
<<if $TFS.schoolAnnexed == 0>>
	<<set $events.push("RES Move")>>
	<<set $events.push("RES Move")>>
	<<set $RESMove.push("TFS")>>
	<<if ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>>
		<<set $events.push("RES Move")>>
		<<set $events.push("RES Move")>>
		<<set $RESMove.push("TFS")>>
		<<set $RESMove.push("TFS")>>
	<</if>>
<</if>>
<</if>>
<</if>>

<<set $RESSale = []>>
<<if $cash > 10000>>
<<if $rep > 6000>>
	<<if $seeDicks != 100>>
		<<if $TSS.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("TSS")>>
		<</if>>
		<<if $GRI.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("GRI")>>
		<</if>>
		<<if $SCP.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("SCP")>>
		<</if>>
		<<if $TCR.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("TCR")>>
		<</if>>
	<</if>>
	<<if $seeDicks != 0>>
		<<if $LDE.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("LDE")>>
		<</if>>
		<<if $TGA.studentsBought == 0>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("TGA")>>
		<</if>>
		<<if ($TFS.studentsBought == 0)>>
			<<set $events.push("RES Sale")>>
			<<set $RESSale.push("TFS")>>
			<<if ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>>
				<<set $events.push("RES Sale")>>
				<<set $events.push("RES Sale")>>
				<<set $RESSale.push("TFS")>>
				<<set $RESSale.push("TFS")>>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<</if>>

<<if $justiceEvents.length > 0>>
	<<if ($seeExtreme == 0) || ($seeDicks == 0)>>
		<<set $justiceEvents.delete("slave training")>>
	<</if>>
	<<if $justiceEvents.length > 2>>
		<<set $events.push("JE slave dispute")>>
		<<set $events.push("JE slave dispute")>>
	<<else>>
		<<set $events.push("JE slave dispute")>>
	<</if>>
<</if>>

<<if $minimumSlaveCost > 3000>>
	<<set $events.push("RE shipping container")>>
<</if>>

<<if $corpCash > 50000>>
	<<set $events.push("REM merger")>>
<</if>>

<<if $rep-10000 > random(1,12500)>>
		<<set $events.push("RE royal blood")>>
<</if>>

<<if $mercenaries > 0>>
		<<set $events.push("RE AWOL")>>
		<<set $events.push("RE Poker Night")>>
<</if>>

<<if $arcologies[0].prosperity >= 100 && ($rep > random(1,30000))>>
	<<set $milfSlave = $slaves.find(function(s) { return s.devotion > 20 && canTalk(s) && canWalk(s) && (s.assignment == "serve the public" || s.assignment == "serve in the club"); })>>
	<<if def $milfSlave>>
		<<set $events.push("RE milf tourist")>>
	<</if>>
<</if>>

<<if $RegularParties == 1>>
	<<if ($PC.vagina == 1 && $PC.title == 0) && (random(0,99) < $seeDicks)>>
		<<set $events.push("RE male citizen hookup")>>
	<<else>>
		<<set $events.push("RE citizen hookup")>>
	<</if>>
	<<if $rep-10000 > random(1,10000)>>
	<<if ($PC.vagina == 1 && $PC.boobs == 1 && $PC.title == 0) && (random(0,99) < $seeDicks)>>
		<<set $events.push("RE male arcology owner")>>
	<<else>>
		<<set $events.push("RE female arcology owner")>>
	<</if>>
	<</if>>
<</if>>

<<set $REM = []>>
<<if random(1,100) > $slaveCostFactor*40>>
	<<set $events.push("REM fluctuations")>>
	<<set $events.push("REM fluctuations")>>
	<<set $REM = 1>>
<</if>>
<<if random(1,100) < $slaveCostFactor*60>>
	<<set $events.push("REM fluctuations")>>
	<<set $events.push("REM fluctuations")>>
	<<set $REM = -1>>
<</if>>

/* FUTURE SOCIETY EVENTS */

	<<if $arcologies[0].FSBodyPurist > random(25,100)>>
		<<set $REFSevent.push("body purism encounter")>>
	<</if>>
	<<if $arcologies[0].FSTransformationFetishist > random(25,100)>>
		<<set $REFSevent.push("transformation fetishism encounter")>>
	<</if>>
	<<if $arcologies[0].FSYouthPreferentialist > random(25,100)>>
		<<set $REFSevent.push("youth preferentialist encounter")>>
	<</if>>
	<<if $arcologies[0].FSMaturityPreferentialist > random(25,100)>>
		<<set $REFSevent.push("maturity preferentialist encounter")>>
	<</if>>
	<<if $arcologies[0].FSPastoralist > random(25,100)>>
		<<set $REFSevent.push("pastoralist encounter")>>
	<</if>>
	<<if $arcologies[0].FSPhysicalIdealist > random(25,100)>>
		<<set $REFSevent.push("physical idealist encounter")>>
	<</if>>
	<<if $arcologies[0].FSPaternalist > random(25,100)>>
		<<set $REFSevent.push("paternalist encounter")>>
	<</if>>
	<<if $arcologies[0].FSDegradationist > random(25,100)>>
		<<set $REFSevent.push("degradationist encounter")>>
	<</if>>

/* EVENT RANDOMIZATION */

<<for $i = 0; $i < $RecETSevent.length; $i++>>
  <<set $events.push("RecETS")>>
<</for>>
<<for $i = 0; $i < $REFIevent.length; $i++>>
  <<set $events.push("REFI")>>
<</for>>
<<for $i = 0; $i < $PESSevent.length; $i++>>
  <<set $events.push("PESS")>>
<</for>>
<<for $i = 0; $i < $PETSevent.length; $i++>>
  <<set $events.push("PETS")>>
<</for>>
<<for $i = 0; $i < $REFSevent.length; $i++>>
  <<set $events.push("REFS")>>
<</for>>
<<if $cheatMode == 1>>
	<<goto "random event select">>
<<else>>
	<<goto "random event roll">>
<</if>>

<</silently>>
<</if>> /* CLOSES SLAVE SELECT */

repo_name: GavAndAlt/fc

license: mit