code:
:: Random Individual Event [nobr]

<<set $showEncyclopedia = 0>>
<<if $eventSlave == 0>>
  <<if $cheatMode == 1>>
	''One of the following slaves would have been selected for a random event:''

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

	<</for>>
  <<else>>
	<<set $eventSlave = $eligibleSlaves.random()>>
	<<goto "Random Individual Event">>
  <</if>>
<<else>>
<<silently>>
<<set $events = []>>
<<set $RESSevent = []>>
<<set $RESSTRevent = []>>
<<set $RETSevent = []>>
<<set $RECIevent = []>>
<<set $activeSlave = 0>>
<<set $groomSlave = 0>>
<<set $brideSlave = 0>>

<<set $legendaryFacility = 0>>

/* SUB CHECKS */

<<set $RERelationshipSlave = 0>>
<<set $REShowerForceSub = 0>>
<<set $RESadisticDescriptionSub = 0>>
<<set $REIfYouEnjoyItSub = 0>>
<<set $REBoobCollisionSub = 0>>
<<set $REAnalCowgirlSubIDs = []>>
<<set $RETasteTestSubIDs = []>>

<<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 $REShowerForceSub = $slaves[$i]>>
			<<set $REIfYouEnjoyItSub = $slaves[$i]>>
		  <<else>>
			<<set $RESadisticDescriptionSub = $slaves[$i]>>
		  <</if>>
		  <</if>>
		<<else>>
		  <<if $slaves[$i].boobs > 3000>>
			<<set $REBoobCollisionSub = $slaves[$i]>>
		  <</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>>
  <</if>>
  <</if>>
  <<if ($REShowerForceSub != 0)>>
  <<if ($RESadisticDescriptionSub != 0)>>
  <<if ($REIfYouEnjoyItSub != 0)>>
  <<if ($REAnalCowgirlSubIDs.length > 1)>>
  <<if ($RETasteTestSubIDs.length > 1)>>
	<<break>>
  <</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 ($eventSlave.entertainSkill >= 60)>>
<<if ($eventSlave.health > 40)>>
<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
	<<set $RESSevent.push("happy dance")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<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 ($assistant > 0)>>
<<if ($assistantAppearance != "normal")>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.devotion >= -20)>>
<<if canSee($eventSlave)>>
  <<if ($eventSlave.devotion <= 50)>>
	<<if ($eventSlave.assignment == "be a servant")>>
	  <<set $RESSevent.push("PA servant")>>
	<</if>>
  <<elseif ($eventSlave.trust > 75)>>
	<<if ($eventSlave.energy > 60)>>
	  <<set $RESSevent.push("PA flirting")>>
	<</if>>
  <</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.clothes == "a succubus outfit")>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("sexy succubus")>>
<</if>>
<</if>>
<</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 ($HeadGirl != 0)>>
  <<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>>

<<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.anus != 0)>>
<<if ($eventSlave.vagina != 0)>>
	<<set $RESSevent.push("ignorant horny")>>
<</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.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 ($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>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.releaseRules != "restrictive")>>
<<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 $REBoobCollisionSub != 0>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.boobs > 3000)>>
<<if ($eventSlave.attrXX > 1) || (($eventSlave.fetish == "boobs") && ($eventSlave.fetishStrength > 95))>>
<<if $eventSlave.ID != $REBoobCollisionSub.ID>>
	<<set $RETSevent.push("boob collision")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

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

<<if ($eventSlave.devotion > 50)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.vagina != 0)>>
  <<set $seed = 0>>
  <<if $HeadGirl == 0>>
	<<set $seed = 1>>
  <<elseif $HeadGirl.ID != $eventSlave.ID>>
	<<set $seed = 1>>
  <</if>>
  <<if $seed == 1>>
	<<set $RESSevent.push("a gift")>>
  <</if>>
<</if>>
<</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">>
  <<if ($eventSlave.dickAccessory != "chastity") || ($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 $eventSlave.balls >= 0>>
	<<if $eventSlave.hormones <= 0>>
	  <<if $REFutaSisterCheckinIDs.includes($eventSlave.ID)>>
		<<set $RECIevent.push("futa")>>
	  <</if>>
	<</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")>>
<<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 ($REShowerForceSub != 0)>>
	  <<if ($eventSlave.trust <= 75)>>
		  <<set $RETSevent.push("RE shower force")>>
	  <</if>>
	  <</if>>
	  <<if ($eventSlave.anus > 0)>>
	  <<if ($RESadisticDescriptionSub != 0)>>
		<<set $RETSevent.push("sadistic description")>>
	  <</if>>
	  <</if>>
	  <<if ($cockFeeder > 0)>>
	  <<if ($eventSlave.dickAccessory != "chastity") || ($eventSlave.dick == 0)>>
		  			<<set $RESSevent.push("kitchen molestation")>>
	  <</if>>
	  <</if>>
	<</if>>
	<<if ($REIfYouEnjoyItSub != 0)>>
	  <<set $RETSevent.push("if you enjoy it")>>
	<</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)>>
<<if ($eventSlave.boobs > 3000)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($slaves.length > 2)>>
	<<set $RESSevent.push("huge tits")>>
<</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 ($week-$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.vagina != 0)>>
<<if ($eventSlave.anus > 0)>>
	<<set $RESSevent.push("not my name")>>
<</if>>
<</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 ($eventSlave.anus > 0)>>
<<if ($eventSlave.analSkill <= 30)>>
	<<set $RESSevent.push("obedient shemale")>>
<</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.fetish == "humiliation") || ($eventSlave.energy > 95)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus != 0)>>
<<if ($eventSlave.fetishKnown == 1)>>
	<<set $RESSevent.push("fearful humiliation")>>
<</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 ($spa > 0)>>
<<if ($eventSlave.boobs > 2000)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $RESSevent.push("spa boobs")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.lactation > 0)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
<<if ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus != 0)>>
	<<set $RESSevent.push("cow milking")>>
<</if>>
<</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 ($eventSlave.accent < 3)>>
<<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 == "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 ($eventSlave.assignment == "serve the public") || ($eventSlave.assignment == "whore")>>
<<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.muscle > 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 $eventSlave.arcade != 0>>
<<if $eventSlave.trust > -20>>
<<if $eventSlave.devotion > 50>>
	<<set $RESSTRevent.push("arcade sadist")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

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

<<if $eventSlave.devotion > 20>>
<<if $eventSlave.butt > 5>>
<<if $eventSlave.anus != 0>>
<<if $eventSlave.vagina != 0>>
<<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 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 $RESSTRevent.push("ass fitting")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $eventSlave.trust > 20>>
<<if $eventSlave.energy > 40>>
	<<set $RESSTRevent.push("comfortable seat")>>
<</if>>
<</if>>

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

<<if $eventSlave.devotion <= 20>>
<<if $eventSlave.trust <= -20>>
<<if $eventSlave.dick > 0>>
<<if $eventSlave.attrXY < 50>>
	<<set $RESSevent.push("transition anxiety")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $seeAge == 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 ($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>> /* 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 $AProsperityCap > 60>>
	<<set $RESSevent.push("mean girls")>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.hormones > 0)>>
<<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)>>
	<<set $RESSevent.push("shower slip")>>
	<<if ($eventSlave.amp < 0)>>
		<<set $RESSevent.push("plimb help")>>
	<</if>>
<</if>>
<</if>>

<<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 ($eventSlave.relationship <= -2)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("bonded love")>>
<</if>>
<</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 ($eventSlave.vagina != 0)>>
<<if ($eventSlave.anus != 0)>>
	<<set $RESSevent.push("dick wringing")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.dickAccessory == "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 ($PC.dick > 0)>>
<<if ($PC.boobs > 0)>>
<<if ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.anus != 0)>>
<<if (($eventSlave.attrXY <= 0) && ($eventSlave.attrXX > 0)) || (($eventSlave.attrXX <= 0) && ($eventSlave.attrXY > 0))>>
	<<set $RESSevent.push("dickgirl PC")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if canTalk($eventSlave)>>
<<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 ($eventSlave.energy > 40)>>
<<if canSee($eventSlave)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.devotion > 0)>>
<<if ($eventSlave.devotion <= 50)>>
<<if (($eventSlave.attrXX > 0) && ($PC.boobs == 1)) || (($eventSlave.attrXY > 0) && ($PC.dick == 1))>>
	<<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.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 > 30)>>
<<if ($eventSlave.vagina > -1)>>
<<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)>>
	<<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")>>
  <<SexualRelease $eventSlave>>
<<if ($release != 1)>>
  <<if ($eventSlave.devotion <= 95)>>
  <<if ($eventSlave.trust >= -20)>>
  <<if ($eventSlave.dickAccessory != "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") >>
<<if ($eventSlave.dick != 0) >>
<<if ($eventSlave.hormones < 1)>>
<<if ($eventSlave.balls > 0)>>
<<if ($eventSlave.dickAccessory != "chastity")>>
<<if ($eventSlave.vaginalAccessory != "chastity belt") >>
	<<set $RESSevent.push("slave dick on slave")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

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

<<if ($eventSlave.devotion >= -20)>>
<<if ($eventSlave.lactation > 1)>>
<<if ($eventSlave.vaginalAccessory != "chastity belt")>>
	<<set $RESSevent.push("milkgasm")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.waist < -95)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.anus > 0)>>
	<<set $RESSevent.push("devoted waist")>>
<</if>>
<</if>>
<</if>>
<</if>>

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

<<if ($eventSlave.whoreSkill >= 100)>>
<<if ($eventSlave.trust > 50)>>
<<if ($eventSlave.assignment == "whore")>>
	<<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)>>
	<<set $RESSevent.push("resistant gelding")>>
<</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 ($eventSlave.buttplug == "large plug") || ($eventSlave.buttplug == "long, large plug")>>
<<if ($eventSlave.assignment != "stay confined")>>
<<if ($eventSlave.devotion <= 20)>>
<<if ($eventSlave.trust >= -50)>>
<<if ($eventSlave.anus < 3)>>
	<<set $RESSevent.push("plug disobedience")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

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

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

<<if canTalk($eventSlave)>>

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

<<if ($eventSlave.assignment == "please you")>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > -20)>>
<<if ($eventSlave.anus > 0)>>
	<<if ($eventSlave.vagina != 0)>>
	<<if ($eventSlave.dickAccessory != "chastity") || ($eventSlave.dick == 0)>>
	  <<if ($corpIncorporated != 0)>>
		<<set $RESSevent.push("shift sleep")>>
	  <</if>>
	  <<if ($eventSlave.releaseRules == "permissive")>>
		<<set $RESSevent.push("shift masturbation")>>
	  <</if>>
	  <<if ($eventSlave.entertainSkill >= 60)>>
		<<set $RESSevent.push("shift doorframe")>>
	  <</if>>
	<</if>>
	<</if>>
	<<if ($PC.vagina == 1)>>
	<<if ($eventSlave.dick == 0)>>
	<<if ($fuckSlaves > 2)>>
		<<set $RESSevent.push("fucktoy tribbing")>>
	<</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)>>
	<<set $RESSevent.push("millenary")>>
<</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 ($eventSlave.devotion > 50)>>
	<<set $RESSevent.push("serve the public devoted")>>
<</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 > 15000)>>
	<<set $RESSevent.push("tittymonster inspection")>>
<</if>>

<<if ($assistant > 1)>>
<<if ($eventSlave.fetishKnown == 1)>>
<<if ($eventSlave.energy > 95)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.releaseRules == "permissive")>>
	<<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.devotion <= 20)>>
<<if ($eventSlave.trust <= 20)>>
<<if ($eventSlave.speechRules != "restrictive")>>
	<<set $RESSevent.push("fearful balls")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

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

<<if ($eventSlave.speechRules != "restrictive")>>
<<if ($eventSlave.vaginalAccessory != "chastity belt")>>
<<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)>>
<<if ($eventSlave.speechRules == "restrictive")>>
	<<set $RESSevent.push("extreme aphrodisiacs")>>
<</if>>
<</if>>

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

<<if ($eventSlave.releaseRules != "restrictive") >>
<<if ($eventSlave.dick > 4) >>
<<if ($eventSlave.hormones < 1)>>
<<if ($eventSlave.balls != 0)>>
<<if ($eventSlave.dickAccessory != "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 ($eventSlave.anus != 0)>>
	<<set $RESSevent.push("heels")>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.releaseRules != "restrictive") >>
<<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 ($eventSlave.assignment == "whore")>>
<<if ($eventSlave.devotion < -20) && ($eventSlave.trust > -20)>>
	<<set $RESSevent.push("whore rebellious")>>
<</if>>
<</if>>

<<if ($eventSlave.amp == 1)>>
	<<if ($eventSlave.devotion > 20)>>
	<<if ($eventSlave.anus > 0)>>
		<<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 ($eventSlave.devotion <= 50)>>
<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.anus > 0)>>
<<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)>>
<<if ($eventSlave.anus > 0)>>
	<<set $RESSevent.push("shaped areolae")>>
<</if>>
<</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.preg > 20)>>
	<<set $RESSevent.push("hugely pregnant")>>
<</if>>

<<if ($eventSlave.hormones > 0)>>
<<if ($eventSlave.vagina == -1)>>
<<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 ($eventSlave.vaginaPiercing > 1)>>
<<if ($eventSlave.nipplesPiercing > 1)>>
<<if ($eventSlave.clitPiercing > 1)>>
<<if ($eventSlave.devotion > 20) || ($eventSlave.trust < -20)>>
<<if ($eventSlave.devotion <= 50)>>
	<<set $RESSevent.push("heavy piercing")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.fetishKnown == 1)>>
<<if ($eventSlave.fetish == "cumslut") || ($eventSlave.energy > 95)>>
<<if (($eventSlave.assignment == "whore") || ($eventSlave.assignment == "serve the public"))>>
<<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 > 3)>>
<<if ($eventSlave.relationship < 5)>>
<<if ($eventSlave.devotion > 20)>>
<<if ($eventSlave.trust > 20)>>
	<<set $events.push("RE slave marriage")>>
<</if>>
<</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")>>
<<if ($eventSlave.prestige == 0)>>
	<<set $events.push("RE legendary cow")>>
<</if>>
<</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)>>
<<if ($eventSlave.prestige == 0)>>
	<<set $events.push("RE legendary womb")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($eventSlave.balls > 4)>>
<<if ($eventSlave.dick > 4)>>
<<if ($eventSlave.assignment == "work in the dairy") || ($eventSlave.assignment == "get milked")>>
<<if ($eventSlave.prestige == 0>>
	<<set $events.push("RE legendary balls")>>
<</if>>
<</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.prestige == 0) && ($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>>

/* EVENT STRIPPING */

<<if $normalizedEvents == 1>>
  <<for $i = 0; $i < $events.length; $i++>>
	<<if $events.count($events[$i]) > 1>>
	  <<set $dumped = $events.pluck([$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

<<silently>>

<<set $showEncyclopedia = 0>>

<<set $events = []>>
<<set $RecETSevent = []>>
<<set $REFIevent = []>>
<<set $PESSevent = []>>
<<set $PETSevent = []>>
<<set $activeSlave = 0>>
<<set $groomSlave = 0>>
<<set $brideSlave = 0>>

<<set $seed = 0>>
<<set $eventSlave = $slaves.random()>>

<<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>>
	<<else>>
	<<set $events.push("RE nickname")>>
	<<set $events.push("RE nickname")>>
	<<set $seed = 1>>
	<</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 == 1>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].daughters > 0)>>
<<if ($slaves[$i].devotion > 50)>>
	<<set $mother = $slaves[$i]>>
	<<set $daughter = RandomDaughter($slaves[$i])>>
	<<if ($daughter.devotion > 50)>>
	<<if canWalk($daughter)>>
		<<if canWalk($mother)>>
		<<if ($daughter.anus != 0)>>
			<<if ($mother.anus != 0)>>
			<<set $events.push("RE devoted mother daughter")>>
			<<set $used = 1>>
			<</if>>
		<</if>>
		<</if>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].sisters > 0)>>
<<if ($slaves[$i].dick == 1)>>
	<<set $youngerSister = $slaves[$i]>>
	<<set $olderSister = randomSister($slaves[$i])>>
<<if ($olderSister.anus == 0)>>
<<if ($youngerSister.devotion > ($olderSister.devotion+20))>>
<<set $events.push("RE sibling revenge")>>
<<set $used = 1>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].sisters > 0)>>
	<<set $alphaTwin = $slaves[$i]>>
	<<set $betaTwin = randomTwinSister($slaves[$i])>>
<<if ($alphaTwin.anus > 0)>>
<<if ($betaTwin.anus > 0)>>
<<if ($alphaTwin.devotion > 50)>>
<<if ($betaTwin.devotion > 50)>>
<<if canWalk($alphaTwin)>>
<<if canWalk($betaTwin)>>
<<set $events.push("RE devoted twins")>>
<<set $used = 1>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<else>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].relation == "mother")>>
<<if ($slaves[$i].relationshipTarget != $slaves[$i].relationTarget)>>
<<if ($slaves[$i].devotion > 50)>>
	<<set $mother = $slaves[$i]>>
	<<for $j = 0; $j < $slaves.length; $j++>>
	<<if $slaves[$j].ID == $mother.relationTarget>>
		<<set $daughter = $slaves[$j]>>
		<<break>>
	<</if>>
	<</for>>
	<<if ($daughter.devotion > 50)>>
	<<if canWalk($daughter)>>
		<<if canWalk($mother)>>
		<<if ($daughter.anus != 0)>>
			<<if ($mother.anus != 0)>>
			<<set $events.push("RE devoted mother daughter")>>
			<<set $used = 1>>
			<</if>>
		<</if>>
		<</if>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].relation == "sister")>>
<<if ($slaves[$i].dick == 1)>>
	<<set $youngerSister = $slaves[$i]>>
	<<for $j = 0; $j < $slaves.length; $j++>>
		<<if $slaves[$j].ID == $slaves[$i].relationTarget>>
			<<set $olderSister = $slaves[$j]>>
			<<break>>
		<</if>>
	<</for>>
<<if ($olderSister.anus == 0)>>
<<if ($youngerSister.devotion > ($olderSister.devotion+20))>>
<<set $events.push("RE sibling revenge")>>
<<set $used = 1>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

<<set $used = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
<<if ($used == 0)>>
<<if ($slaves[$i].relation == "twin")>>
	<<set $alphaTwin = $slaves[$i]>>
	<<for $j = 0; $j < $slaves.length; $j++>>
		<<if $slaves[$j].ID == $slaves[$i].relationTarget>>
			<<set $betaTwin = $slaves[$j]>>
			<<break>>
		<</if>>
	<</for>>
<<if ($alphaTwin.anus > 0)>>
<<if ($betaTwin.anus > 0)>>
<<if ($alphaTwin.devotion > 50)>>
<<if ($betaTwin.devotion > 50)>>
<<if canWalk($alphaTwin)>>
<<if canWalk($betaTwin)>>
<<set $events.push("RE devoted twins")>>
<<set $used = 1>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

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

/* Fetish Interest Events */

<<set $buttslutID = 0>>
<<set $cumslutID = 0>>
<<set $humiliationID = 0>>
<<set $subID = 0>>
<<set $pregnancyID = 0>>
<<set $masochistID = 0>>
<<set $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].preg > 15)>>
	<<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>>

<<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)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("buttslut")>>
		<<set $buttslutInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
	<<if ($cumslutID != 0)>>
		<<set $REFIevent.push("cumslut")>>
		<<set $cumslutInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($subID != 0)>>
		<<set $REFIevent.push("submissive")>>
		<<set $submissiveInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($humiliationID != 0)>>
		<<set $REFIevent.push("humiliation")>>
		<<set $humiliationInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($boobsID != 0)>>
		<<set $REFIevent.push("boobs")>>
		<<set $boobsInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<<if ($pregnancyID != 0)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("pregnancy")>>
		<<set $pregnancyInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
	<<if ($masochistID != 0)>>
	<<if ($slaves[$i].anus != 0)>>
		<<set $REFIevent.push("masochist")>>
		<<set $masochistInterestTargetID = $slaves[$i].ID>>
	<</if>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</for>>

/* Multislave Events */

<<if def $slaves[3]>>
<<if ($slaves[3].devotion > 50)>>
<<if canWalk($slaves[3])>>
<<if canWalk($slaves[2])>>
<<if canWalk($slaves[1])>>
<<if canWalk($slaves[0])>>
	<<set $events.push("RE devotees")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $fuckSlaves > 1>>
	<<set $events.push("RE full bed")>>
<</if>>
<<if $fuckSlaves > 3>>
	<<set $events.push("RE staffed morning")>>
<</if>>

<<if $slaves.length > 2>>
<<if ($slaves[$slaves.length-2].devotion < -20)>>
<<if canWalk($slaves[$slaves.length-2])>>
<<if ($slaves[$slaves.length-2].assignment != "be confined in the arcade")>>
<<if ($slaves[$slaves.length-2].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
<<if canWalk($slaves[$slaves.length-1])>>
<<if ($slaves[$slaves.length-1].assignment != "be confined in the arcade")>>
<<if ($slaves[$slaves.length-1].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
	<<set $events.push("RE rebels")>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $brothelSlaves > 3>>
	<<set $events.push("RE busy brothel")>>
<</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>>

	<<if ($HeadGirl.dick > 0)>>
	<<if ($HeadGirl.hormones < 1)>>
	<<if ($slaves[$slaves.length-1].devotion <= 20)>>
		<<set $PESSevent.push("headgirl dickgirl")>>
	<</if>>
	<</if>>
	<<if ($universalRuleImpregnation == "HG")>>
	<<if ($HeadGirl.devotion > 95)>>
	<<if ($HeadGirl.balls > 0)>>
		<<set $PESSevent.push("worshipful impregnatrix")>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>

	<<if ($HeadGirl.devotion > 95)>>
	<<if ($slaves.length > 4)>>
		<<set $PESSevent.push("loving headgirl")>>
	<</if>>
	<<if ($week > 20)>>
	<<if ($HeadGirl.trust > 95)>>
	<<if ($HeadGirl.intelligence > 1)>>
		<<set $PESSevent.push("worried headgirl")>>
	<</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.relationship == 0)>>
	<<if ($Bodyguard.relationshipRules == "permissive")>>
	<<if ($Bodyguard.fetish != "mindbroken")>>
	<<set $seed = 0>>
	<<for $j = 0; $j < $slaves.length; $j++>>
	<<if ($slaves[$j].relationship == 0)>>
		<<set $seed = 1>>
		<<break>>
	<</if>>
	<</for>>
	<<if ($seed == 1)>>
		<<set $events.push("PE lonely bodyguard")>>
	<</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)>>

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

<</if>>

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

	<<if ($servantsQuartersSlaves >= 1)>>
	<<if ($Stewardess.actualAge >= 35)>>
		<<set $PETSevent.push("stewardess beating")>>
	<</if>>
	<</if>>

<</if>>

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

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

<</if>>

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

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

<</if>>

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

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

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

<<if ($Nurse != 0)>>
<<if ($clinicSlaves > 0)>>
	<<set $nurseMolestationSubIDs = []>>
	<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].assignment == "get treatment in the clinic">>
	<<if $slaves[$i].anus != 0>>
		<<set $nurseMolestationSubIDs.push($slaves[$i].ID)>>
	<</if>>
	<</if>>
	<</for>>
	<<if ($nurseMolestationSubIDs.length > 0)>>
	<<if ($Nurse.energy > 95) || (($Nurse.fetishStrength > 60) && (($Nurse.fetish == "sadist") || ($Nurse.fetish == "dom")))>>
		<<set $PETSevent.push("nurse molestation")>>
		<<set $nurseMolestationSubIDs = $slaves[$i].ID>>
	<</if>>
	<</if>>
<</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 $seeDicks != 2>> /*XX ACQUISITIONS*/

<<set $recruit.push("female debtor")>>
<<set $recruit.push("desperate milf")>>
<<if $arcologies[0].FSRestart == "unset">>
	<<set $recruit.push("desperate preg")>>
<</if>>
<<set $recruit.push("blind homeless")>>
<<set $recruit.push("female SD")>>
<<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 ($AProsperityCap > 60)>>
	<<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 != 2>>
	<<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>>

<<if ($rep/250) > random(1,100)>>
	<<set $RecETSevent.push("addict mother daughter")>>
<</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>>

<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].fuckdoll == 0>>
	<<if $slaves[$i].canRecruit == 1>>
	<<if ($slaves[$i].devotion > 50)>>
	<<if canWalk($slaves[$i])>>
	<<if random(1,100) > 90+(totalRelatives($slaves[$i])*2)>>
		<<for $j = 0; $j < $slavesOriginal.length; $j++>>
			<<if $slaves[$i].ID == $slavesOriginal[$j].ID>>
				<<set $events.push("RE relative recruiter")>>
				<<break>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</for>>

<<else>>

<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].recruiter != 0>>
	<<if $slaves[$i].canRecruit == 1>>
	<<if ($slaves[$i].devotion > 50)>>
	<<if ($slaves[$i].relation == 0)>>
	<<if canWalk($slaves[$i])>>
		<<for $j = 0; $j < $recruiters.length; $j++>>
			<<if $slaves[$i].ID == $recruiters[$j].ID>>
				<<set $seed = 1>>
				<<set $events.push("RE relative recruiter")>>
				<<break>>
			<</if>>
		<</for>>
		<<if $seed != 1>><<set $slaves[$i].recruiter = 0>><</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</for>>

<</if>>

<<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].FSChattelReligionist > random(1,100)>>
		<<set $FSAcquisitionEvents.push("Chattel Religionist")>>
		<<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].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>>
	<<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 $seeHyperPreg == 1>>
	<<if $arcologies[0].FSRepopulationFocus < 95>><<if $arcologies[0].FSRepopulationFocus > 50>>
		<<set $FSNonconformistEvents.push("Repopulation Efforts")>>
		<<set $events.push("RE FS nonconformist")>>
	<</if>><</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].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].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 $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 $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>>

<<if $cash > 10000>>
<<if $rep > 6000>>
	<<set $RESSale = []>>
<<if $seeDicks != 2>>
<<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>>
<<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)>>
	<<for $x = 0; $x < $justiceEvents.length; $x++>>
		<<if "slave training" == $justiceEvents[$x]>>
		<<set $dump = $justiceEvents.pluck([$x], [$x])>>
		<<break>>
		<</if>>
	<</for>>
	<</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 $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>>

/* 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>>
<<if $cheatMode == 1>>
	<<goto "random event select">>
<<else>>
	<<goto "random event roll">>
<</if>>

<</silently>>

repo_name: Qotsafan/fc


code:
:: RE busy arcade

<<set $activeSlave = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].assignment == "be confined in the arcade">>
	<<if $slaves[$i].fetish != "mindbroken">>
	<<if $slaves[$i].amp != 1>>
	<<set $activeSlave = $slaves[$i]>>
	<</if>>
	<</if>>
	<</if>>
<</for>>
<<if $activeSlave == 0>>
	<<goto "RIE Eligibility Check">>
<<else>>
	<<goto "RE busy arcade workaround">>
<</if>>


code:
:: RE busy brothel [nobr]

<<set $nextButton = "Continue">>
<<set $nextLink = "RIE Eligibility Check">>

$brothelNameCaps is well staffed, and does a busy trade in flesh 24 hours a day. With so many sex slaves in the Free Cities, brothels occupy a functional, nearly mechanical part of the sexual landscape. Free citizens and sometimes even favored slaves visit the brothel, select from the available merchandise, relieve their sexual needs, and leave. Affection, companionship, and emotional needs are available elsewhere.

Of course, $brothelName is the best establishment of its kind in the arcology. Citizens who patronize it can expect themselves to be very well looked after by skilled slaves. The quality of the merchandise, the efficiency with which it is delivered, and the cleanliness and reputation of the premises @@color:green;reflect well on you,@@<<set $rep += 100>> so much so that you could leverage this bustling sexual commerce in many ways.

<<link "Surprise the hardworking whores with a day of rest">>
	<<replace "#result">>
	The problem with assembly-line sex is that it has a tendency to destroy any sense of intimacy or fun. So, you make some simple preparations and close the brothel for a day, hiring some freelancers to cover. All your slave whores are allowed to sleep late, and then spend the day with you playing games and enjoying light amusements. The girls are surprised by your generosity, but they have fun. Many of the games are sexually themed. One day of giggling and squealing can't completely reverse the transactionalization of sex for them, but they @@color:hotpink;appreciate the effort.@@
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].assignment == "work in the brothel">>
		<<set $slaves[$i].devotion += 4>>
		<</if>>
	<</for>>
	<<set $cash -= 1000>>
	<</replace>>
<</link>> //This will cost ¤1000//

<<link "Hire an expert hooker to give lessons">>
	<<replace "#result">>
	The citizen streetwalker has had her day. A few of the cleverest have avoided being driven into poverty, either by becoming madams or by finding a way to build a new career serving the slave brothel industry. One of these is touring the city, offering her long sexual experience in seminars for slave prostitutes. Her services are not cheap, but it rapidly becomes clear that they are worth it. She is a grey-haired but still elegant woman with deep crow's feet and a smoker's voice. She is not only a sexual master, but a hardbitten and comprehensively experienced businesswoman. All of your brothel slaves with any room for improvement in their whoring skills @@color:green;learn from her lessons,@@ while those who have nothing to learn @@color:hotpink;gain confidence@@ from her praise.
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].assignment == "work in the brothel">>
		<<if $slaves[$i].whoreSkill < 100>>
		<<set $slaves[$i].whoreSkill += 10>>
		<<else>>
		<<set $slaves[$i].devotion += 4>>
		<</if>>
		<</if>>
	<</for>>
	<<set $cash -= 2000>>
	<</replace>>
<</link>> //This will cost ¤2000//

<<link "Eliminate prices for one morning to promote the brothel">>
	<<replace "#result">>
	The news that sex will be free at the brothel travels like wildfire. Security measures are necessary to control the throng that spends the entire day entering and leaving the brothel, though as the day goes on the crowds thin. By midmorning, all the holes on offer are so fucked out that only those who fetishize that sort of thing stick around. The brothel is a real seminal sewer by noon, and it smells like it. Nevertheless, free sex is a short route to @@color:green;public approval,@@ though you do miss a morning's fees. The poor slave whores are @@color:red;fairly battered@@ by so much wear and tear in so little time.
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].assignment == "work in the brothel">>
		<<set $slaves[$i].health -= 10>>
		<</if>>
		<<if ($slaves[$i].vagina > -1) && ($slaves[$i].vaginalAccessory != "chastity belt")>>
		<<set $slaves[$i].vaginalCount += 5>>
		<<set $vaginalTotal += 5>>
		<<set $slaves[$i].analCount += 5>>
		<<set $analTotal += 5>>
		<<else>>
		<<set $slaves[$i].analCount += 10>>
		<<set $analTotal += 10>>
		<</if>>
		<<set $slaves[$i].oralCount += 10>>
		<<set $oralTotal += 10>>
	<</for>>
	<<set $cash -= 2000>>
	<</replace>>
<</link>> //This will cost ¤2000//


code:
:: RE busy club

<<nobr>>

<<set $nextButton = "Continue">>
<<set $nextLink = "RIE Eligibility Check">>

<</nobr>>\
\
The original designers of the modern arcology did not realize how inseparable from slavery their work would become. The club at the social heart of $arcologies[0].name was not meant as a center of the more friendly kind of sexual slavery, but that is what it has become. Free whores of the highest quality work there, and they are accompanied by a flock of your slaves who have simple orders to dance, add cheer, and perform sexual favors wherever they can.

Offering slaves for free sex would become unmanageable if the club where your public servants work was open to the unwashed masses, but it is not. The arcology is already selective, and only good citizens can party, dance, and fuck the night away in $clubName. The upper classes @@color:green;recognize your contributions@@<<set $rep += 100>> to arcology culture, which you could probably parlay into an even greater benefit.
\
<span id="result">
<<link "Sponsor a special event in the club">>
	<<replace "#result">>
	The Free Cities are new, and so is their culture. There are new traditions, new expectations, and now, new holidays. One morning, the upper classes of the arcology are surprised and gratified to find that the club has been specially decorated, and all the club sluts are nude. The floor of the club is typically meant for dirty dancing and some light sex, not public penetrative intercourse. Not today; today is special. The festivities @@color:green;greatly improve your renown;@@ you have set a high bar for what a wealthy arcology owner should do.
	<<set $cash -= 2000>>
	<<set $rep += 500>>
	<</replace>>
<</link>> //This will cost ¤2000//
<<link "Host a business exposition">>
	<<replace "#result">>
	With the world economy in a perilous state, the Free Cities are one of the few remaining areas where innovation and new business opportunities still appear. The novel markets associated with the slave trade only reinforce this trend, offering a cornucopia of opportunities for the clear-eyed investor with liquid assets. Every other week there is news of a new fortune being made from smart investments in leather, in human growth hormones, or in psychoactive drugs. You host an exposition for slave services centered on the club, with your slaves serving as greeters who are eager to ensure that all the little wants of visiting notables are thoroughly satisfied. The optimistic outlook projected by this event @@color:green;improves $arcologies[0].name's business prospects@@ and even @@color:green;reflects well on you personally.@@
	<<set $cash -= 5000>>
	<<set $arcologies[0].prosperity += 2>>
	<<set $rep += 500>>
	<</replace>>
<</link>> //This will cost ¤5000//
</span>


code:
:: RE busy dairy

<<nobr>>

<<set $nextButton = "Continue">>
<<set $nextLink = "RIE Eligibility Check">>

<</nobr>>\
\
$dairyNameCaps is working away steadily. Its high-quality product @@color:green;reflects well on you,@@<<set $rep += 100>> you muse one day as you inspect the premises. The gentle pneumatic sounds of the milkers and the whimpers of the cows being milked are a pleasant background for the thought.

Even with high doses of modern drugs, human cows simply do not produce a very high volume of milk. This isn't much of a business problem, since it just means that the product can be sold at a high price. However, some of the more grandiose ideas about how to use milk have had to wait until you have enough cows producing enough milk to make them possible.
\
<span id="result">
<<link "Share a milk bath with the cows">>
	<<replace "#result">>
	Milk is a fashionable skin treatment in the Free Cities, and many of the cows fetishize their breasts and their milk. Many of them giggle with delight when you bring them all into a large spa room with a huge tub full of their fresh milk. A pittance will be lost from sales, but it's hard to think of such things when swimming and splashing in warm, nutty mother's milk with so many huge-breasted slaves, many of whom are milking themselves into the bath. Some of the older ones relax and luxuriate, gently milking themselves and masturbating or each other, according to taste. The younger cows prefer to rub themselves against you, taking turns being fucked. Regardless, they all @@color:hotpink;appreciate such a special experience.@@
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].assignment == "work in the dairy">>
		<<set $slaves[$i].devotion += 4>>
		<<if ($slaves[$i].vagina > -1) && ($slaves[$i].vaginalAccessory != "chastity belt")>>
		<<set $slaves[$i].vaginalCount += 1>>
		<<set $vaginalTotal += 1>>
		<<else>>
		<<set $slaves[$i].analCount += 1>>
		<<set $analTotal += 1>>
		<</if>>
		<<set $slaves[$i].oralCount += 1>>
		<<set $oralTotal += 1>>
		<</if>>
	<</for>>
	<<set $cash -= 1000>>
	<</replace>>
<</link>> //This will cost ¤1000//
<<if $club != 0>>\
<<link "Add fresh milk to the club for a day to advertise">>
	<<replace "#result">>
	Sexual sights and sounds are all over the arcology. Nevertheless, passersby on the club are surprised to find one morning that a previously normal screen advertising your brand of milk has a luscious pair of breasts protruding through it at head height. The advertisement encourages anyone to try a free sample. The slaves constantly rotate, pressing fresh tits through the gap for public suckling. It is @@color:green;generally agreed that your product is of the finest quality@@ and you even have enquiries about how it might be exported outside the arcology, should you manage to increase production.
	<<set $cash -= 2000>>
	<<set $rep += 500>>
	<</replace>>
<</link>> //This will cost ¤2000//
<</if>>\
<<if ($cumSlaves >= 5) && ($activeSlave.fetish != "cumslut")>>
	<<link "Cum in, milk out">>
		<<replace "#result">>
		As a promotional gimmick, you announce with considerable fanfare a special, experimental brand of milk, available at the normal price for a short time only. The milk will be unique in that it will be from cows fed mostly on slaves' cum; the cockmilked slaves will in turn be given as much milk as possible to produce a 'pure slave product,' recursively. The sad realities of nutrition stop it from being much more than a marketing ploy, but it's certainly a @@color:green;successful@@ attempt to spark discussion.
	<<set $rep += 1000>>
	<<set $cash -= 1000>>
		<</replace>>
	<</link>> //This will cost ¤1000//
<</if>>
</span>


code:
:: RE busy servants quarters [nobr]

<<set $nextButton = "Continue">>
<<set $nextLink = "RIE Eligibility Check">>

Your penthouse is very well staffed with servants. The trend in modern buildings is to design around automatic cleaning systems. Dusting, mopping, and polishing are no longer really necessary when machines that do them more cheaply and thoroughly than any human are readily available. Keeping slaves to clean is an ostentation, and visitors to your quarters are often @@color:green;surprised and gratified@@ to see a sex slave working away in the old way.<<set $rep += 100>>

The busy servants' quarters are a reservoir of slaves that can be used for almost any whim that occurs to you.

<<link "Share the servants' quarters with your more favored slaves">>
	<<replace "#result">>

	The poor slaves in the servants' quarters are lower than almost any others, and they know it. Unfortunately for them, they're about to spend a long weekend knowing it unusually well. Sleeping time is usually nearly inviolate; you are the only person in the penthouse who is permitted to wake a sleeping slave for any but emergency reasons. Not now. You haunt the servants' quarters, using and abusing at will, and encourage your better slaves to follow your example. They quickly take the opportunity to be better than someone for once, and compete with each other in sexual harassment of the servants. They @@color:hotpink;appreciate@@ having @@color:mediumorchid;targets@@ for their frustrations.
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].assignment != "work in servants' quarters">>
		<<set $slaves[$i].devotion += 4>>
			<<set $slaves[$i].oralCount += 3>>
			<<set $oralTotal += 3>>
		<</if>>
		<<if $slaves[$i].assignment == "work in servants' quarters">>
		<<set $slaves[$i].devotion -= 5>>
		<<if ($slaves[$i].vagina > -1) && ($slaves[$i].vaginalAccessory != "chastity belt")>>
			<<set $slaves[$i].vaginalCount += 1>>
			<<set $vaginalTotal += 1>>
		<<else>>
			<<set $slaves[$i].analCount += 1>>
			<<set $analTotal += 1>>
		<</if>>
			<<set $slaves[$i].oralCount += 5>>
			<<set $oralTotal += 5>>
		<</if>>
	<</for>>
	<</replace>>
<</link>>