code:
:: Rename

<<nobr>>
<<set $nextButton = "Back">>
<<set $nextLink = "Slave Interact">>

<<if $activeSlave.fetish == "mindbroken">>
	She doesn't even recognize that she's been renamed. It simply does not register.
<<elseif ($oldName == $activeSlave.birthName) && ($activeSlave.devotion > 50)>>
	She accepts her new name cheerfully. This attachment to you @@color:hotpink; increases her devotion.@@
	<<set $activeSlave.devotion += 4>>
<<elseif ($oldName == $activeSlave.birthName) && ($activeSlave.devotion >= -20)>>
	She accepts her new name. This surrender to you @@color:hotpink; increases her obedience.@@
	<<set $activeSlave.devotion += 4>>
<<elseif ($oldName == $activeSlave.birthName) && ($activeSlave.devotion >= -50)>>
	She reluctantly accepts her new name.
<<elseif ($oldName == $activeSlave.birthName)>>
	She angrily tries to resist her new name. This resistance @@color:mediumorchid; increases her rebelliousness.@@
	<<set $activeSlave.devotion -= 5>>
<<else>>
	Since $activeSlave.slaveName has already had a new name forced on her before, she accepts this fresh name without fuss.
<</if>>

<<set $insultingName = 0>>

<<for $i = 0; $i < $badWords.length; $i++>>
<<set $toSearch = $activeSlave.slaveName.toLowerCase();>>
<<if $toSearch.indexOf($badWords[$i]) != -1>>
	<<set $insultingName = 1>>
<</if>>
<</for>>

<<if ($activeSlave.fetish == "mindbroken") && ($insultingName == 1)>>
	Her new name would be insulting to a normal girl, but she dully accepts that it is an accurate description and goes about her duties.
<<elseif ($insultingName == 1) && ($activeSlave.devotion <= 50) && ($activeSlave.devotion >= -20)>>
	Accepting such a degrading name @@color:hotpink;further increases her devotion.@@
	<<set $activeSlave.devotion += 4>>
<<elseif ($insultingName == 1) && ($activeSlave.devotion < -50)>>
	Being given such a degrading name @@color:mediumorchid;further increases her hatred.@@
	<<set $activeSlave.devotion -= 5>>
<</if>>

<</nobr>>

repo_name: pillarofsalt/fc


code:
:: RES Failure

<<nobr>>

<<set $nextButton = "Continue">>
<<set $nextLink = "Scheduled Event">>
<<set $returnTo = "Scheduled Event">>

<<if ($TSS.schoolPresent == 1) && ($TSS.schoolProsperity <= -10)>>
	<<set $RESFailure = "TSS">>
<<elseif ($GRI.schoolPresent == 1) && ($GRI.schoolProsperity <= -10)>>
	<<set $RESFailure = "GRI">>
<<elseif ($SCP.schoolPresent == 1) && ($SCP.schoolProsperity <= -10)>>
	<<set $RESFailure = "SCP">>
<<elseif ($LDE.schoolPresent == 1) && ($LDE.schoolProsperity <= -10)>>
	<<set $RESFailure = "LDE">>
<<elseif ($TGA.schoolPresent == 1) && ($TGA.schoolProsperity <= -10)>>
	<<set $RESFailure = "TGA">>
<<elseif ($TFS.schoolPresent == 1) && ($TFS.schoolProsperity <= -10)>>
	<<set $RESFailure = "TFS">>
<</if>>

<<set $rep -= 200>>
<<set $AProsperity -= 2>>
<<set $slavesToAdd = 5>>
<<if $RESFailure == "TSS">>
	<<set $TSS.schoolPresent = 0>>
	<<set $TSS.subsidy = 0>>
	<<set $TSS.schoolProsperity = 0>>
	<<set $TSS.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.career = "a slave">>
		<<set $activeSlave.butt = either(1, 2, 2, 3)>>
		<<set $activeSlave.boobs = either(200, 300, 300, 400)>>
		<<if $TSS.schoolUpgrade == 1>>
			<<set $activeSlave.origin = "She was given to you by a failed branch campus of The Slavegirl School after she was retrained as a slave girl.">>
			<<set $activeSlave.butt += 1>>
			<<set $activeSlave.boobs += 200>>
			<<set $activeSlave.anus = 1>>
			<<set $activeSlave.vagina = 1>>
			<<set $activeSlave.actualAge = random(36,42)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<else>>
			<<set $activeSlave.origin = "She was given to you by a failed branch campus of The Slavegirl School right after her majority.">>
			<<set $activeSlave.anus = 0>>
			<<set $activeSlave.vagina = 0>>
			<<set $activeSlave.actualAge = 18>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<</if>>
		<<set $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.teeth = "normal">>
		<<set $activeSlave.intelligence = either (-1, 0, 1, 2)>>
		<<set $activeSlave.devotion = random(25,45)>>
		<<set $activeSlave.trust = random(25,45)>>
		<<set $activeSlave.health = random(50,60)>>
		<<set $activeSlave.preg = 0>>
		<<set $activeSlave.weight = 0>>
		<<set $activeSlave.chem = 20>>
		<<if $TSS.schoolUpgrade == 0>>
			<<set $activeSlave.vaginalSkill = 0>>
			<<set $activeSlave.oralSkill = 0>>
			<<set $activeSlave.analSkill = 0>>
			<<set $activeSlave.whoreSkill = 0>>
			<<set $activeSlave.entertainSkill = 15>>
		<<else>>
			<<set $activeSlave.vaginalSkill = 15>>
			<<set $activeSlave.oralSkill = 15>>
			<<set $activeSlave.analSkill = 15>>
			<<set $activeSlave.whoreSkill = 15>>
			<<set $activeSlave.entertainSkill = 15>>
		<</if>>
		<<set $activeSlave.combatSkill = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.sexualFlaw = either("none")>>
		<<set $activeSlave.behavioralFlaw = either("none")>>
		<<set $activeSlave.hStyle = "tails">>
		<<set $activeSlave.customTat = "She has the simple logo of the corporation that operates The Slavegirl School tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure == "GRI">>
	<<set $GRI.schoolPresent = 0>>
	<<set $GRI.subsidy = 0>>
	<<set $GRI.schoolProsperity = 0>>
	<<set $GRI.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.origin = "She was given to you by a failed subsidiary lab of the Growth Research Institute right after her use as a test subject ended.">>
		<<set $activeSlave.career = "a slave">>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.devotion = random(-15,-5)>>
		<<set $activeSlave.trust = random(-25,-45)>>
		<<set $activeSlave.chem = 100>>
		<<if $GRI.schoolUpgrade == 1>>
			<<set $activeSlave.health = 200>>
		<<else>>
			<<set $activeSlave.health = random(-80,100)>>
		<</if>>
		<<set $activeSlave.height = random(150,190)>>
		<<set $activeSlave.butt = random(4,10)>>
		<<if $GRI.schoolUpgrade == 2>>
			<<set $activeSlave.boobs = 200*random(15,30)>>
			<<set $activeSlave.lactation = 2>>
		<<else>>
			<<set $activeSlave.boobs = 200*random(4,20)>>
		<</if>>
		<<set $activeSlave.nipples = either("inverted", "huge")>>
		<<set $activeSlave.areolae = either(0, 1, 2, 3)>>
		<<set $activeSlave.clit = either(0, 1, 2, 3)>>
		<<set $activeSlave.lips = random(5,85)>>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.vagina = 0>>
		<<set $activeSlave.preg = 0>>
		<<set $activeSlave.weight = 0>>
		<<set $activeSlave.vaginalSkill = 0>>
		<<set $activeSlave.oralSkill = 0>>
		<<set $activeSlave.analSkill = 0>>
		<<set $activeSlave.whoreSkill = 0>>
		<<set $activeSlave.entertainSkill = 0>>
		<<set $activeSlave.combatSkill = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.actualAge = 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.behavioralFlaw = either("odd")>>
		<<set $activeSlave.hStyle = "shaved">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.customTat = "She has a barcode that identified her when she was a test subject at the Growth Research Institute tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure == "SCP">>
	<<set $SCP.schoolPresent = 0>>
	<<set $SCP.subsidy = 0>>
	<<set $SCP.schoolProsperity = 0>>
	<<set $SCP.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.origin = "She was given to you by a failed branch campus of St. Claver Preparatory after she served as a plastic surgeon's passing final exam.">>
		<<set $activeSlave.chem = 20>>
		<<set $activeSlave.career = "a slave">>
		<<if $SCP.schoolUpgrade == 1>>
			<<set $activeSlave.intelligenceImplant = 0>>
			<<set $activeSlave.intelligence = -2>>
			<<set $activeSlave.devotion = 20>>
			<<set $activeSlave.trust = 20>>
		<<else>>
			<<set $activeSlave.intelligenceImplant = 1>>
			<<set $activeSlave.teeth = "normal">>
			<<set $activeSlave.intelligence = either(-1, 0, 1, 2)>>
			<<set $activeSlave.devotion = random(25,45)>>
			<<set $activeSlave.trust = random(25,45)>>
		<</if>>
		<<set $activeSlave.health = 100>>
		<<set $activeSlave.heightImplant = 1>>
		<<set $activeSlave.height += 10>>
		<<set $activeSlave.buttImplant = (4-$activeSlave.butt)>>
		<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<<set $activeSlave.boobsImplant = (2000-$activeSlave.boobs)>>
		<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
		<<set $activeSlave.nipples = "tiny">>
		<<set $activeSlave.areolae = 0>>
		<<set $activeSlave.clit = 0>>
		<<set $activeSlave.lipsImplant = (75-$activeSlave.lips)>>
		<<set $activeSlave.lips += $activeSlave.lipsImplant>>
		<<set $activeSlave.faceImplant to (2-$activeSlave.face)>>
		<<set $activeSlave.face = Math.clamp($activeSlave.face+(20*$activeSlave.faceImplant),-100,100)>>
		<<set $activeSlave.anus to 0>>
		<<set $activeSlave.vagina to 0>>
		<<set $activeSlave.preg to 0>>
		<<set $activeSlave.weight = -20>>
		<<if $SCP.schoolUpgrade == 2>>
			<<set $activeSlave.vaginalSkill = 15>>
			<<set $activeSlave.oralSkill = 15>>
			<<set $activeSlave.analSkill = 15>>
			<<set $activeSlave.whoreSkill = 15>>
			<<set $activeSlave.entertainSkill = 15>>
		<<else>>
			<<set $activeSlave.vaginalSkill = 0>>
			<<set $activeSlave.oralSkill = 0>>
			<<set $activeSlave.analSkill = 0>>
			<<set $activeSlave.whoreSkill = 0>>
			<<set $activeSlave.entertainSkill = 0>>
		<</if>>
		<<set $activeSlave.combatSkill = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.actualAge = 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw = either("none")>>
		<<set $activeSlave.behavioralFlaw = either("none")>>
		<<set $activeSlave.hStyle = "tails">>
		<<set $activeSlave.hColor = "blonde">>
		<<set $activeSlave.pubicHColor = "blonde">>
		<<if $activeSlave.race != "white">><<set $activeSlave.race = "surgically altered to look white">><</if>>
		<<set $activeSlave.skin = "tanned">>
		<<set $activeSlave.customTat = "She has the coat of arms of St. Claver Preparatory tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure == "LDE">>
	<<set $LDE.schoolPresent = 0>>
	<<set $LDE.subsidy = 0>>
	<<set $LDE.schoolProsperity = 0>>
	<<set $LDE.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin = "She was given to you by a failed branch campus of the innovative École des Enculées right after her graduation.">>
		<<set $activeSlave.career = "a slave">>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.chem = 100>>
		<<if $LDE.schoolUpgrade == 1>>
			<<set $activeSlave.devotion = 20>>
			<<set $activeSlave.trust = 20>>
		<<else>>
			<<set $activeSlave.devotion = random(60,70)>>
			<<set $activeSlave.trust = random(55,60)>>
		<</if>>
		<<set $activeSlave.health = random(60,80)>>
		<<set $activeSlave.muscles = 0>>
		<<set $activeSlave.butt to either(4,5)>>
		<<set $activeSlave.face = random(20,60)>>
		<<set $activeSlave.boobs to either(500,650,800)>>
		<<set $activeSlave.waist = -15>>
		<<set $activeSlave.lips to 35>>
		<<if $LDE.schoolUpgrade == 2>>
			<<set $activeSlave.balls = either(3,4)>>
			<<set $activeSlave.dick = either(3,4)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum = $activeSlave.balls>><</if>>
		<<else>>
			<<set $activeSlave.dick = either(1,1,1,2)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum = $activeSlave.balls>><</if>>
			<<set $activeSlave.balls = either(1,1,1,2)>>
		<</if>>
		<<set $activeSlave.anus = 2>>
		<<set $activeSlave.vagina = -1>>
		<<set $activeSlave.preg = 0>>
		<<set $activeSlave.weight = random(0,20)>>
		<<set $activeSlave.vaginalSkill = 0>>
		<<set $activeSlave.oralSkill = 15>>
		<<set $activeSlave.analSkill = 100>>
		<<set $activeSlave.whoreSkill = 15>>
		<<set $activeSlave.entertainSkill = 15>>
		<<set $activeSlave.combatSkill = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.actualAge = 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw = "none">>
		<<set $activeSlave.behavioralFlaw = either("none", "odd")>>
		<<set $activeSlave.fetishStrength = either(1, 2)>>
		<<set $activeSlave.fetish = "buttslut">>
		<<set $activeSlave.fetishKnown = 1>><<set $activeSlave.attrKnown = 1>>
		<<set $activeSlave.hStyle = "tails">>
		<<set $activeSlave.hLength = 100>>
		<<set $activeSlave.customTat = "She has the buttock-shaped symbol of the École des Enculées that created her tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure == "TGA">>
	<<set $TGA.schoolPresent = 0>>
	<<set $TGA.subsidy = 0>>
	<<set $TGA.schoolProsperity = 0>>
	<<set $TGA.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin = "She was given to you by a failed branch campus of the intense Gymnasium-Academy right after her majority.">>
		<<set $activeSlave.career = "a slave">>
		<<set $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.teeth = "normal">>
		<<set $activeSlave.intelligence = either (-1, 0, 1, 2)>>
		<<set $activeSlave.chem = 20>>
		<<if $TGA.schoolUpgrade == 1>>
			<<set $activeSlave.devotion = 20>>
			<<set $activeSlave.trust = 20>>
		<<else>>
			<<set $activeSlave.devotion = random(25,45)>>
			<<set $activeSlave.trust = random(25,45)>>
		<</if>>
		<<set $activeSlave.health = 100>>
		<<set $activeSlave.muscles = either(20, 50, 50)>>
		<<set $activeSlave.butt = either(2, 2, 3)>>
		<<set $activeSlave.boobs = either(100, 200)>>
		<<set $activeSlave.dick = random(3,5)>>
		<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum = $activeSlave.balls>><</if>>
		<<set $activeSlave.balls = random(3,5)>>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.vagina = -1>>
		<<set $activeSlave.preg = 0>>
		<<set $activeSlave.weight = 0>>
		<<set $activeSlave.vaginalSkill = 0>>
		<<set $activeSlave.oralSkill = 0>>
		<<set $activeSlave.analSkill = 0>>
		<<set $activeSlave.whoreSkill = 0>>
		<<set $activeSlave.entertainSkill = 0>>
		<<if $TGA.schoolUpgrade == 2>>
			<<set $activeSlave.combatSkill = 1>>
		<<else>>
			<<set $activeSlave.combatSkill = 0>>
		<</if>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.actualAge = 18>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw = either("none", "apathetic")>>
		<<set $activeSlave.behavioralFlaw = either("none", "arrogant", "odd")>>
		<<set $activeSlave.hStyle = "short">>
		<<set $activeSlave.hLength = 2>>
		<<set $activeSlave.customTat = "She has the baroque crest of the Gymnasium-Academy that trained her branded into her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<else>>
	<<set $TFS.schoolPresent = 0>>
	<<set $TFS.subsidy = 0>>
	<<set $TFS.schoolProsperity = 0>>
	<<set $TFS.schoolAnnexed = 1>>
	<<for $i = 0; $i < $slavesToAdd-1; $i++>>
		<<set $seed = random(1,4)>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin = "She was a Futanari Sister until you engineered her early enslavement.">>
		<<set $activeSlave.career = "a Futanari Sister">>
		<<set $activeSlave.faceShape = either("sensual", "exotic")>>
		<<if $seed == 1>>
			<<set $activeSlave.intelligence to -1>>
			<<set $activeSlave.chem to 150>>
			<<set $activeSlave.butt to either(5,6)>>
			<<set $activeSlave.hips to 1>>
			<<set $activeSlave.face to either(35,35,35,75,100)>>
			<<set $activeSlave.boobs = 100*random(12,20)>>
			<<set $activeSlave.dick = random(2,3)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls = 6>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = random(2,3)>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to 0>>
			<<set $activeSlave.weight to 0>>
			<<set $activeSlave.actualAge = random(25,29)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina to 2>>
			<<set $activeSlave.anus to 2>>
			<<set $activeSlave.fetish to "submissive">>
		<<elseif $seed is 2>>
			<<set $activeSlave.intelligence to 0>>
			<<set $activeSlave.chem to 200>>
			<<set $activeSlave.butt to either(6,7)>>
			<<set $activeSlave.hips to 2>>
			<<set $activeSlave.face to either(35,35,75,75,100)>>
			<<set $activeSlave.boobs = 100*random(20,32)>>
			<<set $activeSlave.dick = random(3,4)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls = 6>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = random(3,4)>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to random(15,25)>>
			<<set $activeSlave.weight to 20>>
			<<set $activeSlave.actualAge = random(30,34)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina to 2>>
			<<set $activeSlave.anus to 2>>
			<<set $activeSlave.fetish to either("buttslut", "cumslut")>>
		<<elseif $seed is 3>>
			<<set $activeSlave.intelligence to 1>>
			<<set $activeSlave.chem to 250>>
			<<set $activeSlave.butt to either(7,8)>>
			<<set $activeSlave.hips to 2>>
			<<set $activeSlave.face to either(35,75,75,100,100)>>
			<<set $activeSlave.boobs = 100*random(32,42)>>
			<<set $activeSlave.dick = random(4,5)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls = 6>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = random(4,5)>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips = random(25,55)>>
			<<set $activeSlave.weight = 20>>
			<<set $activeSlave.actualAge = random(35,39)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina = 3>>
			<<set $activeSlave.anus = 3>>
			<<set $activeSlave.fetish = either("buttslut", "cumslut")>>
		<<else>>
			<<set $activeSlave.intelligence to 2>>
			<<set $activeSlave.chem to 300>>
			<<set $activeSlave.butt to either(8,9)>>
			<<set $activeSlave.hips to 2>>
			<<set $activeSlave.face to either(35,75,100,100,100)>>
			<<set $activeSlave.boobs = 100*random(44,60)>>
			<<set $activeSlave.dick = random(5,6)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls = 6>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = random(5,6)>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips = random(25,55)>>
			<<set $activeSlave.weight = 50>>
			<<set $activeSlave.actualAge = random(40,42)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina = 3>>
			<<set $activeSlave.anus = 3>>
			<<set $activeSlave.fetish = "dom">>
		<</if>>
		<<if $TFS.farmUpgrade != 0>>
			<<set $activeSlave.ovaries = 1>>
			<<if $TFS.farmUpgrade == 2>>
				<<set $activeSlave.preg = random(1,35)>>
			<</if>>
		<</if>>
		<<set $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.teeth = "normal">>
		<<if $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.energy = 100>>
		<<else>>
			<<set $activeSlave.energy = $activeSlave.physicalAge+random(20,30)>>
		<</if>>
		<<set $activeSlave.devotion = random(30,35)>>
		<<set $activeSlave.trust = random(-15,-5)>>
		<<set $activeSlave.health = random(60,80)>>
		<<set $activeSlave.muscles = 20>>
		<<set $activeSlave.waist = -15>>
		<<set $activeSlave.shoulders to 1>>
		<<set $activeSlave.preg to -2>>
		<<set $activeSlave.vaginalSkill = 100>>
		<<set $activeSlave.oralSkill = 100>>
		<<set $activeSlave.analSkill = 100>>
		<<set $activeSlave.whoreSkill = 15>>
		<<set $activeSlave.entertainSkill = 100>>
		<<set $activeSlave.combatSkill = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<if $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.sexualQuirk = "caring">>
		<</if>>
		<<set $activeSlave.sexualFlaw = either("none", "hates women")>>
		<<set $activeSlave.behavioralFlaw = either("none", "arrogant")>>
		<<set $activeSlave.fetishStrength = 100>>
		<<set $activeSlave.fetishKnown = 0>>
		<<set $activeSlave.attrKnown = 0>>
		<<set $activeSlave.hStyle = "neat">>
		<<set $activeSlave.hLength = 150>>
		<<set $activeSlave.customTat = "She has a simple pink heart tattooed on her right temple.">>
		<<set $REFutaSisterCheckinIDs.push($activeSlave.ID)>>
		<<AddSlave $activeSlave>>
	<</for>>
	<<include "Generate XY Slave">>
	<<set $activeSlave.origin to "She was the leader of your arcology's Futanari Sisters until you engineered her community's failure and enslavement.">>
	<<set $activeSlave.career to "a Futanari Sister">>
	<<set $activeSlave.intelligence to 2>>
	<<set $activeSlave.chem to 300>>
	<<set $activeSlave.butt to either(8,9)>>
	<<set $activeSlave.hips to 2>>
	<<set $activeSlave.face = 100>>
	<<set $activeSlave.boobs = 100*random(44,60)>>
	<<set $activeSlave.dick = random(5,6)>>
	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
	<<if $TFS.schoolUpgrade == 1>>
		<<set $activeSlave.balls = 1>>
		<<set $activeSlave.scrotum = 0>>
	<<elseif $TFS.schoolUpgrade == 2>>
		<<set $activeSlave.balls = 6>>
		<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<else>>
		<<set $activeSlave.balls = random(5,6)>>
		<<set $activeSlave.scrotum = $activeSlave.balls>>
	<</if>>
	<<set $activeSlave.lips = random(25,55)>>
	<<set $activeSlave.weight = 50>>
	<<set $activeSlave.actualAge = random(40,42)>>
	<<set $activeSlave.visualAge = $activeSlave.actualAge>>
	<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
	<<set $activeSlave.vagina = 3>>
	<<set $activeSlave.anus = 3>>
	<<set $activeSlave.fetish = "dom">>
	<<if $TFS.farmUpgrade != 0>>
		<<set $activeSlave.ovaries = 1>>
		<<if $TFS.farmUpgrade == 2>>
			<<set $activeSlave.preg = random(1,35)>>
		<</if>>
	<</if>>
	<<set $activeSlave.intelligenceImplant = 1>>
	<<set $activeSlave.teeth = "normal">>
	<<if $TFS.schoolUpgrade == 2>>
		<<set $activeSlave.energy = 100>>
	<<else>>
		<<set $activeSlave.energy = $activeSlave.physicalAge+random(20,30)>>
	<</if>>
		<<set $activeSlave.devotion = random(25,30)>>
		<<set $activeSlave.trust = random(10,15)>>
	<<set $activeSlave.health = random(60,80)>>
	<<set $activeSlave.muscles = 20>>
	<<set $activeSlave.waist = -15>>
	<<set $activeSlave.shoulders to 1>>
	<<set $activeSlave.preg to -2>>
	<<set $activeSlave.vaginalSkill = 100>>
	<<set $activeSlave.oralSkill = 100>>
	<<set $activeSlave.analSkill = 100>>
	<<set $activeSlave.whoreSkill = 15>>
	<<set $activeSlave.entertainSkill = 100>>
	<<set $activeSlave.combatSkill = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<if $TFS.schoolUpgrade == 1>>
		<<set $activeSlave.sexualQuirk = "caring">>
	<</if>>
	<<set $activeSlave.sexualFlaw = either("none", "hates women")>>
	<<set $activeSlave.behavioralFlaw = either("none", "arrogant")>>
	<<set $activeSlave.fetishStrength = 100>>
	<<set $activeSlave.fetishKnown = 0>>
	<<set $activeSlave.attrKnown = 0>>
	<<set $activeSlave.hStyle = "neat">>
	<<set $activeSlave.hLength = 150>>
	<<set $activeSlave.customTat = "She has a simple pink heart tattooed on her right temple.">>
	<<AddSlave $activeSlave>>
<</if>>

<<if $RESFailure == "TSS">>
	You receive a personal call from a senior representative of The Slavegirl School, as you've been expecting since their second missed rent payment. "I apologize," he says with some embarrassment, "but it seems our expansion into your arcology was a mistake. It's strange - the business climate seemed excellent, and other corporations are doing well." He sighs. "Nevertheless, nothing ever seemed to go as planned. We'll be shutting our branch campus down immediately. In fact, it should be shut down within the hour. I regret to add," he says nervously, "that we're experiencing continued difficulty finding the liquidity to pay what we owe you. The branch campus we're closing has five recent graduates. We'd like to transfer them to you in lieu of payment." He hurriedly ends the call.
<<elseif $RESFailure == "GRI">>
	You receive a personal call from a senior representative of the Growth Research Institute, as you've been expecting since their second missed rent payment. "I apologize," he says with some embarrassment, "but it seems our expansion into your arcology was a mistake. It's strange - the business climate seemed excellent, and other corporations are doing well." He sighs. "Nevertheless, nothing ever seemed to go as planned. We'll be shutting our subsidiary lab down immediately. In fact, it should be shut down within the hour. I regret to add," he says nervously, "that we're experiencing continued difficulty finding the liquidity to pay what we owe you. The lab we're closing has five solid test subjects. We'd like to transfer them to you in lieu of payment." He hurriedly ends the call.
<<elseif $RESFailure == "SCP">>
	You receive a personal call from a senior representative of St. Claver Prep, as you've been expecting since their second missed rent payment. "I apologize," he says with some embarrassment, "but it seems our expansion into your arcology was a mistake. It's strange - the business climate seemed excellent, and other corporations are doing well." He sighs. "Nevertheless, nothing ever seemed to go as planned. We'll be shutting our branch campus down immediately. In fact, it should be shut down within the hour. I regret to add," he says nervously, "that we're experiencing continued difficulty finding the liquidity to pay what we owe you. The branch campus we're closing has five recent graduates. We'd like to transfer them to you in lieu of payment." He hurriedly ends the call.
<<elseif $RESFailure == "LDE">>
	You receive a personal call from a senior representative of the Ecole des Enculees, as you've been expecting since their second missed rent payment. "I apologize," he says with some embarrassment, "but it seems our expansion into your arcology was a mistake. It's strange - the business climate seemed excellent, and other corporations are doing well." He sighs. "Nevertheless, nothing ever seemed to go as planned. We'll be shutting our branch campus down immediately. In fact, it should be shut down within the hour. I regret to add," he says nervously, "that we're experiencing continued difficulty finding the liquidity to pay what we owe you. The branch campus we're closing has five recent graduates. We'd like to transfer them to you in lieu of payment." He hurriedly ends the call.
<<elseif $RESFailure == "TGA">>
	You receive a personal call from a senior representative of the Gymnasium-Academy, as you've been expecting since their second missed rent payment. "I apologize," he says with some embarrassment, "but it seems our expansion into your arcology was a mistake. It's strange - the business climate seemed excellent, and other corporations are doing well." He sighs. "Nevertheless, nothing ever seemed to go as planned. We'll be shutting our branch campus down immediately. In fact, it should be shut down within the hour. I regret to add," he says nervously, "that we're experiencing continued difficulty finding the liquidity to pay what we owe you. The branch campus we're closing has five recent graduates. We'd like to transfer them to you in lieu of payment." He hurriedly ends the call.
<<else>>
	The senior Sister of the community of Futanari Sisters in your arcology appears at your penthouse, as you've been expecting since their second missed rent payment. This is quite the occasion, since they never leave their little nest. She's delightfully nude, and it occurs to you that the Sisters probably do not own clothing at all. She has obviously been crying; puffy eyes and a sniffling nose mar her gorgeous face. She must have caused quite the sensation as she made her way here, in tears, gigantic tits and huge cock bouncing around. To your surprise, she flings herself at your feet, her dick making a painful-sounding slap against the floor and her breasts squashing out to either side of her.
	<br><br>
	"Please," she cries to your feet. "Please take us as slaves. We're indebted, and we'll all be enslaved. You're our friend, you'll treat us better than anyone." Then she whispers, "Please, $PCName, don't make me beg." You tell the prostrate futa you accept. Her mood does not improve: she scrabbles around to face away from you, plush body jiggling submissively, and raises her buttocks to spread her pussy and anus for you. "Thank you," she weeps. "Now please rape me, <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title == 1>>Master<<else>>Mistress<</if>>. I deserve it. My mismanagement stole my Sisters' years of idyll from them. Please, rape me."
<</if>>
<br><br>
The failure of a prominent organization within your arcology has @@color:red;affected your reputation@@ and @@color:red;your arcology's prosperity@@ slightly, but you've come out a long way ahead. You've acquired excellent slaves for a pitiful fraction of their fair price.

<</nobr>>

<<nobr>>
<span id="result">
<<if $RESFailure == "TFS">>
<<link "Rape her">>
	<<replace "#result">>
	<<nobr>>
	<<for $i = 0; $i < $slaves.length; $i++>>
	<<if ($slaves[$i].origin == "She was the leader of your arcology's Futanari Sisters until you engineered her community's failure and enslavement.")>>
		<<set $activeSlave.devotion += 10>>
		<<set $activeSlave.analCount += 1>>
		<<set $activeSlave.vaginalCount += 1>>
		<<set $analTotal += 1>>
		<<set $vaginalTotal += 1>>
	<</if>>
	<</for>>
	You <<if $PC.dick == 1>>whip out your dick<<else>>pull on a strap-on, the one you use for disobedient slaves,<</if>> and kneel down behind the sobbing futa matron. When she feels it touching her pussylips, she whispers "Thank you, <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title == 1>>Master<<else>>Mistress<</if>>," through her tears. She's very, very sexually experienced, so it's harder to make her feel it than it would be for a girl with tighter holes. But you're an expert. You calibrate your pounding to pull just barely too far out, so that she feels you ramming mercilessly into her with each stroke, and so that the slightest mistake from her sends <<if $PC.dick == 1>>your cock<<else>>the phallus<</if>> right up the other hole. Despite her anguish and the brutal fuck, or perhaps because of them, she slowly manages to get hard, and orgasms painfully when you do. She @@color:hotpink;can't seem to stop thanking you,@@ but is quiet when you tell her to be.
	<</nobr>><</replace>>
<</link>>
<br>
<</if>>
<<link "Sell your prizes immediately">>
	<<replace "#result">>
	<<nobr>>
	<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $RESFailure == "TSS">>
		<<if ($slaves[$i].origin == "She was given to you by a failed branch campus of The Slavegirl School right after her majority.") || ($slaves[$i].origin == "She was given to you by a failed branch campus of The Slavegirl School after she was retrained as a slave girl.")>>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<<elseif $RESFailure == "GRI">>
		<<if $slaves[$i].origin == "She was given to you by a failed subsidiary lab of the Growth Research Institute right after her use as a test subject ended.">>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<<elseif $RESFailure == "SCP">>
		<<if $slaves[$i].origin == "She was given to you by a failed branch campus of St. Claver Preparatory after she served as a plastic surgeon's passing final exam.">>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<<elseif $RESFailure == "LDE">>
		<<if $slaves[$i].origin == "She was given to you by a failed branch campus of the innovative École des Enculées right after her graduation.">>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<<elseif $RESFailure == "TGA">>
		<<if $slaves[$i].origin == "She was given to you by a failed branch campus of the intense Gymnasium-Academy right after her majority.">>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<<else>>
		<<if ($slaves[$i].origin == "She was the leader of your arcology's Futanari Sisters until you engineered her community's failure and enslavement.") || ($slaves[$i].origin == "She was a Futanari Sister until you engineered her early enslavement.")>>
		<<slaveCost $slaves[$i]>>
		<<set $cash += $slaveCost>>
		<<include "Remove activeSlave">>
		<<set $i -= 1>>
		<</if>>
	<</if>>
	<</for>>
	Prizes sold.
	<</nobr>><</replace>>
<</link>>
</span>
<</nobr>>


code:
:: RES Move [nobr]

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

<<set $RESMove = $RESMove.random()>>

<<if $RESMove == "TSS">>
	You receive a personal call from a senior representative of The Slavegirl School. "$PCName," he says without preamble, "The Slavegirl School would like to open a branch campus in $arcologies[0].name. We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence." After some further pleasantries, he urges you to consider the offer, wishes you a pleasant day, and ends the call.
<<elseif $RESMove == "GRI">>
	You receive a personal call from a senior representative of the Growth Research Institute. "$PCName," he says without preamble, "GRI would like to open a subsidiary lab in $arcologies[0].name. We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence." After some further pleasantries, he urges you to consider the offer, wishes you a pleasant day, and ends the call.
<<elseif $RESMove == "SCP">>
	You receive a personal call from a senior representative of St. Claver Prep. "$PCName," he says without preamble, "St. Claver's would like to open a branch campus in $arcologies[0].name. We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence." After some further pleasantries, he urges you to consider the offer, wishes you a pleasant day, and ends the call.
<<elseif $RESMove == "LDE">>
	You receive a personal call from a senior representative of the Ecole des Enculees. "$PCName," he says without preamble, "The Ecole would like to open a branch campus in $arcologies[0].name. We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence." After some further pleasantries, he urges you to consider the offer, wishes you a pleasant day, and ends the call.
<<elseif $RESMove == "TGA">>
	You receive a personal call from a senior representative of the Gymnasium-Academy. "$PCName," he says without preamble, "The Academy would like to open a branch campus in $arcologies[0].name. We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence." After some further pleasantries, he urges you to consider the offer, wishes you a pleasant day, and ends the call.
<<else>>
	You receive a personal call from a senior Futanari Sister - not the one you helped win the power struggle over futa balls. "$PCName," she says with the odd confidence all elder Sisters share, "our numbers are growing,
	<<if ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>>
		and we are very eager to become closer to you. Normally, we would ask for lowered rent in return for the benefits we bring an arcology, but for you, we are unwilling to ask even that. We shall charge others more for their purchase of Sisters instead. Please, will you have us?" She bats her eyes at you, looking very willing to be had.
	<<else>>
		and you have shown yourself to be our friend. Would you accept one of our communities in $arcologies[0].name? We'd like to ask for a significant reduction in rent from your standard rate, since we could bring significant benefits to you through our presence."
	<</if>>

	You inquire about the Sister you helped, and she smiles. "She reached the age at which even the best Sister must serve us by being sold as a slave. Don't worry, though; I hear she is very happy. <<if random(1,3) == 1>>A powerful man from the old world bought her, and they're engaged. I believe he means to free her.<<elseif random(1,2) == 1>>A powerful woman from the old world bought her, and they're engaged. I believe she means to free her.<<else>>Though she's a slave, she's become something of a celebrity in the old world. I believe her porn is quite popular there.<</if>>"
<</if>>

<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> performed a business analysis of the proposal during the call,
<<if $assistant == 0>>
	its symbol slowly rotating on your desk. It presents its conclusions,
<<else>>
	<<if $assistantAppearance == "monstergirl">>
		her monstergirl avatar rather cutely using her fingers, the tips of her tentacle hair, and her dickheads to count:
	<<elseif $assistantAppearance == "shemale">>
		her shemale avatar ditzily using her fingers to keep count:
	<<elseif $assistantAppearance == "amazon">>
		her amazon avatar using a bone abacus to do sums while counting out loud gruffly:
	<<elseif $assistantAppearance == "businesswoman">>
		her businesswoman avatar projecting maturely sexy confidence as she runs the numbers:
	<<elseif $assistantAppearance == "fairy">>
		her fairy avatar conjures a bunch of colored lights to keep count:
	<<elseif $assistantAppearance == "pregnant fairy">>
		her pregnant fairy avatar conjures a bunch of colored lights to keep count:
	<<elseif $assistantAppearance == "goddess">>
		her goddess avatar keeping count by picking the petals off flowers in her hair:
	<<elseif $assistantAppearance == "hypergoddess">>
		her goddess avatar keeping count based off the number of contractions running through her huge belly:
	<<elseif $assistantAppearance == "loli">>
		her loli avatar carefully counts the numbers off on her fingers:
	<<elseif $assistantAppearance == "preggololi">>
		her pregnant loli avatar carefully counts the numbers off on her fingers before losing count to her baby kicking and starting over:
	<<elseif $assistantAppearance == "schoolgirl">>
		her schoolgirl avatar doing sums on a little blackboard:
	<<else>>
		her symbol slowly rotating on your desk:
	<</if>>
	She presents her conclusions:
<</if>>
as you suspected,
<<if ($RESMove == "TFS") && ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>>
	your futanari status means there are no potential downsides. Just having them present would probably be good for the arcology's prosperity.
<<else>>
	you'd run a loss on the rent, even bargaining them up as far as they'd be likely to go. On the other hand, just having them present would probably be good for the arcology's prosperity.
<</if>>
<<if $assistant == 1>>
	<<if ($RESMove == "TSS") || ($RESMove == "SCP")>>
		"Just think of
		<<if $assistantAppearance == "monstergirl">>
			all those virgin schoolgirl holes," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "shemale">>
			all those fresh schoolgirls, all innocent, and..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "amazon">>
			all those nice girls," her avatar blushes.
		<<elseif $assistantAppearance == "businesswoman">>
			all that potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance == "fairy">>
			all of the delicious, wonderful virginal love juices!" her avatar squeaks, quivering with delight while dripping with love juices of her own.
		<<elseif $assistantAppearance == "pregnant fairy">>
			all of the delicious, wonderful motherly love juices!" her avatar squeaks, quivering with delight while dripping with love juices of her own.
		<<elseif $assistantAppearance == "goddess">>
			all those virgin bodies to share..." her avatar murmurs, rubbing a hand over her belly.
		<<elseif $assistantAppearance == "hypergoddess">>
			all those virgin bodies to share...  I hope we can fill them with children..." her avatar murmurs, rubbing a hand over her massive belly.
		<<elseif $assistantAppearance == "loli">>
			all those new girls!" her avatar exclaims.
		<<elseif $assistantAppearance == "preggololi">>
			all those fresh girls! her avatar exclaims with a grin.
		<<elseif $assistantAppearance == "schoolgirl">>
			all those cute schoolgirls like me!" her avatar trills.
		<<else>>
			all those nice girls," she says.
		<</if>>
	<<elseif $RESMove == "GRI">>
		"Just think of
		<<if $assistantAppearance == "monstergirl">>
			the tits, and the asses, and the lips," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "shemale">>
			those big butts. It's so rare for girls to have such big butts and be anal virgins..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "amazon">>
			all those meaty girls," her avatar blushes.
		<<elseif $assistantAppearance == "businesswoman">>
			all that milking potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance == "fairy">>
			all that sweet, tasty milk!" her avatar squeaks, licking her lips and dripping with arousal.
		<<elseif $assistantAppearance == "pregnant fairy">>
			all that sweet, tasty mama milk!" her avatar squeaks, licking her lips and dripping with arousal.
		<<elseif $assistantAppearance == "goddess">>
			all those luscious, heavy tits," her avatar says, hefting one of her own.
		<<elseif $assistantAppearance == "hypergoddess">>
			all those luscious, heavy tits," her avatar says, hefting one of her own.
		<<elseif $assistantAppearance == "loli">>
			those tits!" her avatar says while cupping her flat chest.
		<<elseif $assistantAppearance == "loli">>
			those tits!" her avatar says while cupping her barely there chest.
		<<elseif $assistantAppearance == "schoolgirl">>
			those titties!" her avatar trills.
		<<else>>
			those ridiculous assets," she says.
		<</if>>
	<<elseif $RESMove == "LDE">>
		"Just think of
		<<if $assistantAppearance == "monstergirl">>
			their soft anuses. I could fit both of my dicks in one of them," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "shemale">>
			those soft young butthole sluts..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "amazon">>
			their soft - I mean their submissive - you know, how they take..." her avatar trails off, blushing.
		<<elseif $assistantAppearance == "businesswoman">>
			all that whoring potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance == "fairy">>
			all those soft, squeezable butts!," her avatar squeaks, shaking to and fro while she hugs herself.
		<<elseif $assistantAppearance == "pregnant fairy">>
			all those soft, squeezable butts and lovely birthing hips!," her avatar squeaks, shaking to and fro while she hugs her swollen belly.
		<<elseif $assistantAppearance == "goddess">>
			those servile little cuties!" her avatar exclaims, practically giggling.
		<<elseif $assistantAppearance == "hypergoddess">>
			those servile little cuties!  They could really use some cute little bellies!" her avatar exclaims, practically giggling.
		<<elseif $assistantAppearance == "loli">>
			those fat butts!" her avatar exclaims cheerfully.
		<<elseif $assistantAppearance == "preggololi">>
			those fat butts!" her avatar exclaims cheerfully.
		<<elseif $assistantAppearance == "schoolgirl">>
			those soft little bitches!" her avatar trills.
		<<else>>
			those bottoms," she says.
		<</if>>
	<<elseif $RESMove == "TGA">>
		"Just think of
		<<if $assistantAppearance == "monstergirl">>
			their sweaty bodies," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "shemale">>
			those muscly bodies, all sweaty and..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance == "amazon">>
			how they can fight!" she concludes, more loudly than is really necessary.
		<<elseif $assistantAppearance == "businesswoman">>
			all that bodyguard potential," her avatar says, looking aroused at the possibilities.
		<<elseif ($assistantAppearance == "fairy") || ($assistantAppearance == "pregnant fairy")>>
			those big, strong, sweaty, sexy bodies!" her avatar squeaks, looking beet red and breathing heavily.
		<<elseif $assistantAppearance == "goddess">>
			all those hard, strong, rippling..." she trails off, too breathless to be specific.
		<<elseif $assistantAppearance == "hypergoddess">>
			all those hard, strong, rippling..." she trails off, too breathless to be specific.
		<<elseif $assistantAppearance == "loli">>
			those muscles!" she exclaims.
		<<elseif $assistantAppearance == "preggololi">>
			those muscles!" she exclaims.
		<<elseif $assistantAppearance == "schoolgirl">>
			those cute bitches!" her avatar trills.
		<<else>>
			how well trained they always are," she says.
		<</if>>
	<<else>>
		<<if $assistantAppearance == "monstergirl">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I have never wanted to have a real body more."
		<<elseif $assistantAppearance == "shemale">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They almost make me want a pussy, too."
		<<elseif $assistantAppearance == "amazon">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I like them."
		<<elseif $assistantAppearance == "businesswoman">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I wonder if I could code an avatar version of one of them. As my own assistant, of course."
		<<elseif ($assistantAppearance == "fairy") || ($assistantAppearance == "pregnant fairy")>>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "If only I could get a taste myself."
		<<elseif $assistantAppearance == "goddess">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They truly have the best of both worlds."
		<<elseif $assistantAppearance == "hypergoddess">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They truly have the best of both worlds."
		<<elseif $assistantAppearance == "loli">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I wish I'll look like that when I grow up..."
		<<elseif $assistantAppearance == "preggololi">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I wish I'll look like that when I grow up..."
		<<elseif $assistantAppearance == "schoolgirl">>
			<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They kind of make me want a cock."
		<<else>>
			"Just think of how unique they are," she says.
		<</if>>
	<</if>>
<</if>>

Your assistant is a powerful analytic tool, but <<if $assistant == 0>>it<<else>>she<</if>> lacks the capacity for true creativity. <<if $assistant == 0>>It<<else>>She<</if>> did not mention the long term. It would be possible to support the
<<if ($RESMove == "TSS") || ($RESMove == "SCP)") || ($RESMove == "LDE") || ($RESMove == "TGA")>>
	school's
<<elseif $RESMove == "GRI">>
	lab's
<<else>>
	Sisters'
<</if>>
presence in the arcology, reaping all sorts of benefits. Alternatively, you might be able to undermine them covertly, picking up assets lost in the fallout of a local failure.

<<link "Accept the offer">>
	<<replace "#result">>
		You call them back and accept the offer. They forward their specifications for an appropriate space and the modifications it needs to host them, along with their thanks.
		<<if $RESMove == "TSS">>
			<<set $TSS.schoolPresent = 1>>
		<<elseif $RESMove == "GRI">>
			<<set $GRI.schoolPresent = 1>>
		<<elseif $RESMove == "SCP">>
			<<set $SCP.schoolPresent = 1>>
		<<elseif $RESMove == "LDE">>
			<<set $LDE.schoolPresent = 1>>
		<<elseif $RESMove == "TGA">>
			<<set $TGA.schoolPresent = 1>>
		<<else>>
			<<set $TFS.schoolPresent = 1>>
		<</if>>
	<</replace>>
<</link>> <<if ($RESMove == "TFS") && ($PC.dick == 1) && ($PC.vagina == 1) && ($PC.boobs == 1)>><<else>>//This will add minor upkeep costs//<</if>>

<<link "Politely decline">>
	<<replace "#result">>
		You call them back and politely communicate that your terms for rental of space in the arcology are not subject to special modification, even for trusted partners. This explanation is graciously accepted.
	<</replace>>
<</link>>


code:
:: RES Sale

<<nobr>>

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

<<set $RESSale = $RESSale.random()>>
<<if $RESSale == "TSS">>
	<<set $TSS.schoolSale = 1>>
<<elseif $RESSale == "GRI">>
	<<set $GRI.schoolSale = 1>>
<<elseif $RESSale == "SCP">>
	<<set $SCP.schoolSale = 1>>
<<elseif $RESSale == "LDE">>
	<<set $LDE.schoolSale = 1>>
<<elseif $RESSale == "TGA">>
	<<set $TGA.schoolSale = 1>>
<<else>>
	<<set $TFS.schoolSale = 1>>
<</if>>

You receive a personal call from
<<if $RESSale == "TSS">>
	The Slavegirl School, a rising slave training organization known for its reliably unremarkable products, offered at a competitive price.
<<elseif $RESSale == "GRI">>
	The Growth Research Institute, a drug development group breaking new ground on human experimentation.
<<elseif $RESSale == "SCP">>
	St. Claver Preparatory, an unusual combination of slave school and implant surgery training institution.
<<elseif $RESSale == "LDE">>
	L'Ecole des Enculees, an innovative slave school making new and interesting developments in sodomy.
<<elseif $RESSale == "TGA">>
	The Gymnasium-Academy, an intense slave school with a reputation for producing fit bitches with combat skills and stiff dicks.
<<else>>
	the Futanari Sisters, an enigmatic group of transformation enthusiasts that sells beautiful hermaphrodites.
<</if>>
It's from a piece of merchandise, not leadership, and she's offering herself for sale. Before you can hang up on her and reprimand $assistantName for allowing this Free Cities version of telemarketing to get through to you, the slave hurriedly says, "<<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>, I'm half off!"

You pause for a moment, and she plunges on: "<<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>, @@color:yellow;your first slave purchase from us this week is half price.@@ And, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>, I'm one of the slaves for sale.
<<if $RESSale == "TSS">>
	I've got the very best skills I could learn as a virgin. I'm healthy, obedient, and educated. And I'm fresh, and willing, and really eager." She rips her white schoolgirl blouse open to show off a fresh pair of tits, and shakes them for you. "I would love to be your sex slave, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, doing her very best to sound appealing, like she's been trained.
<<elseif $RESSale == "GRI">>
	I've, uh, been trained to obey." Her eyes flick to one side, like she's reading her cues. "And um I have really big boobs." She's wearing a bathrobe, and she suddenly jerks it open to reveal a bigger pair of breasts than anyone that age could possibly have grown herself. "I would love to be your sex slave, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, doing her very best to sound appealing. No doubt she'd prefer not to be part of any more testing.
<<elseif $RESSale == "SCP">>
	I'm ready to be the perfect bimbo slave, and the young surgeon who did my implants was very skilled." She's wearing a bikini, and she pulls it down to flash you, revealing that her tits resist gravity almost perfectly. They're gorgeous, but quite fake. "I would love to be your sex slave, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, doing her very best to sound appealing, like she's been trained.
<<elseif $RESSale == "LDE">>
	I've been trained to need cock up my ass." She's nude, and spins around to point her ass at the camera. She begins to wink her big butthole, her tiny, soft cock dangling limply below it. She cranes her head around to continue. "I can come from nothing but buttsex," she says proudly. "I would love to be your anal slut, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, sounding very eager to begin.
<<elseif $RESSale == "TGA">>
	My tutelage has been long and hard, and I'm very eager to begin my life as a slave." She's nude, and stands up to reveal her hardon. She spins for the camera, showing herself off. "I can help protect you, too: I'm proficient in unarmed combat, and I have weapons training. I would love to be your bitch, or your bodyguard, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, doing her very best to sound appealing, like she's been told.
<<else>>
	The time has come for me to serve my Sisters by leaving my community and becoming a slave. Our sex skills are unparalleled," she says proudly. She's nude, and reclines luxuriantly for the camera, showing her remarkable body off in all its gorgeous strangeness. Her boobs are huge, her dick is hard, her pussy is wet, and her ass is relaxed. "I love to fuck, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she says, and you believe her.
	<<if ($PC.dick == 1) && ($PC.vagina == 1)>>

		<<if ($PC.boobs == 1)>>
			"I would also adore serving someone like you," she adds sincerely, her emphasis making it quite clear the Sisters have heard rumors about your hermaphroditism. "We can't offer any further discount, but I promise I'd worship you with all my heart." She bats her eyes at you. "And my other parts, too!"
		<<else>>
			Her eyes flick downward momentarily, and she looks nervous, swallowing before continuing. "Please let me be your slave," she almost begs. "Serving another futa would, oh," and she pauses, shivering a little. Recollecting herself, she goes on, "Wonderful. Serving you would be a dream come true."
		<</if>>
	<</if>>
<</if>>

<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>>'s $assistantAppearance avatar appears on the screen next to the video call.
<<if $assistant == 0>>
	"I have stored the confirmation code, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," it notes. "If you wish to take advantage of this promotion, use the slave buying menu to navigate to the appropriate school next week. I have appended a note to that school's entry to remind you."
<<else>>
	<<if ($RESSale == "TSS") || ($RESSale == "SCP")>>
		"And I would love to
		<<if $assistantAppearance == "monstergirl">>
			break both her virgin holes at once," the monstergirl exclaims, and shakes her dicks for emphasis.
		<<elseif $assistantAppearance == "shemale">>
			wreck her virgin asshole," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance == "amazon">>
			fist her virgin cunt," the amazon exclaims, and helpfully raises the fist in question.
		<<elseif $assistantAppearance == "businesswoman">>
			sell her fresh pussy to the highest bidder," the businesswoman exclaims.
		<<elseif $assistantAppearance == "fairy">>
			play with her clit and lap up those sweet virgin juices!" the fairy exclaims, licking her lips.
		<<elseif $assistantAppearance == "pregnant fairy">>
			play with her clit and lap up those sweet motherly juices!" the fairy exclaims, licking her lips.
		<<elseif $assistantAppearance == "goddess">>
			teach her all about being a real woman," the goddess exclaims, rubbing her belly in anticipation.
		<<elseif $assistantAppearance == "hypergoddess">>
			teach her all about being a real woman," the goddess exclaims, rubbing her massive belly in anticipation.
		<<elseif $assistantAppearance == "loli">>
			play with her!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance == "preggololi">>
			play with her!"  The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance == "schoolgirl">>
			make out with her. She's cute!" the schoolgirl exclaims.
		<<else>>
			fuck her virgin holes," she says.
		<</if>>
	<<elseif $RESSale == "GRI">>
		"And I would love to
		<<if $assistantAppearance == "monstergirl">>
			get my tentacles on those tits," the monstergirl exclaims.
		<<elseif $assistantAppearance == "shemale">>
			fuck those titties," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance == "amazon">>
			put her out to pasture," the amazon exclaims, indicating the skin of milk on her belt.
		<<elseif $assistantAppearance == "businesswoman">>
			put that cow in the dairy," the businesswoman exclaims.
		<<elseif $assistantAppearance == "fairy">>
			bounce on those nipples until they fill me with milk!" the fairy exclaims, rubbing her belly.
		<<elseif $assistantAppearance == "pregnant fairy">>
			bounce on those nipples until my babies are fed!" the fairy exclaims, rubbing her swollen belly.
		<<elseif $assistantAppearance == "goddess">>
			taste those bountiful breasts," the goddess exclaims, licking her lips.
		<<elseif $assistantAppearance == "hypergoddess">>
			taste those bountiful breasts," the goddess exclaims, licking her lips.
		<<elseif $assistantAppearance == "loli">>
			play with her tits!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance == "preggololi">>
			play with her tits!"  The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance == "schoolgirl">>
			suck on those titties!" the schoolgirl exclaims.
		<<else>>
			make those breasts bounce," she says.
		<</if>>
	<<elseif $RESSale == "LDE">>
		"And I would love to
		<<if $assistantAppearance == "monstergirl">>
			shove both my cocks up there," the monstergirl exclaims.
		<<elseif $assistantAppearance == "shemale">>
			fuck that butt even bigger," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance == "amazon">>
			fist that butthole," the amazon exclaims, and helpfully raises the fist in question.
		<<elseif $assistantAppearance == "businesswoman">>
			see how many customers that asshole can bear," the businesswoman exclaims.
		<<elseif $assistantAppearance == "fairy">>
			use that butt as a pillow!," the fairy exclaims.
		<<elseif $assistantAppearance == "pregnant fairy">>
			see if I can impregnate her butt!," the fairy exclaims.
		<<elseif $assistantAppearance == "goddess">>
			see just how obedient she really is," the goddess exclaims, flexing a hand for emphasis.
		<<elseif $assistantAppearance == "hypergoddess">>
			see just how obedient she really is," the goddess exclaims, flexing a hand for emphasis.
		<<elseif $assistantAppearance == "loli">>
			play with her big butt!" The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance == "preggololi">>
			play with her big butt!" The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance == "schoolgirl">>
			lick her big soft behind," the schoolgirl exclaims, and sticks out her tongue.
		<<else>>
			fuck that ass," she says.
		<</if>>
	<<elseif $RESSale == "TGA">>
		"And I would love to
		<<if $assistantAppearance == "monstergirl">>
			shove both my cocks up her virgin anus," the monstergirl exclaims.
		<<elseif $assistantAppearance == "shemale">>
			fuck that virgin asshole," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance == "amazon">>
			finger fuck her virgin ass," the amazon exclaims, and helpfully raises the fingers in question.
		<<elseif $assistantAppearance == "businesswoman">>
			sell her anal virginity to the highest bidder," the businesswoman exclaims.
		<<elseif $assistantAppearance == "fairy">>
			give the dick a great big hug and suckle out all the precum!" the fairy exclaims, rubbing her legs together.
		<<elseif $assistantAppearance == "pregnant fairy">>
			play meet the baby! ...Well, maybe just with you, <<if ($PC.title == 0)>>Big Sis.<<else>>Big Bro." the fairy exclaims, rubbing her legs together.
		<<elseif $assistantAppearance == "goddess">>
			see her put that dick to work," the goddess exclaims, one sultry finger at her lips.
		<<elseif $assistantAppearance == "hypergoddess">>
			see her put that dick to work," the goddess exclaims, one sultry finger at her lips.
		<<elseif $assistantAppearance == "loli">>
			play with her dick!" The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance == "preggololi">>
			get that dick in me!" The little girl exclaims happily while caressing her belly and licking her lips.
		<<elseif $assistantAppearance == "schoolgirl">>
			suck that dick," the schoolgirl exclaims, and sticks out her tongue.
		<<else>>
			train that body," she says.
		<</if>>
	<<else>>
		"And I love to fuck futas!"
		<<if $assistantAppearance == "monstergirl">>
			 she shouts, dicks painfully erect.
		<<elseif $assistantAppearance == "shemale">>
			she shouts, cock painfully erect.
		<<elseif $assistantAppearance == "amazon">>
			she howls, and then adds more quietly, "A-and get fucked by futas."
		<<elseif $assistantAppearance == "businesswoman">>
			she exclaims, and then blushes furiously.
		<<elseif ($assistantAppearance == "fairy") || ($assistantAppearance == "pregnant fairy")>>
			she exclaims, flying circles around you.
		<<elseif $assistantAppearance == "goddess">>
			she exclaims, awestruck with anticipation.
		<<elseif $assistantAppearance == "hypergoddess">>
			she exclaims, awestruck with anticipation.
		<<elseif $assistantAppearance == "loli">>
			she exclaims, then blushes beet red when she realizes what she said.
		<<elseif $assistantAppearance == "preggololi">>
			she exclaims, rubbing her bulging belly with anticipation.
		<<elseif $assistantAppearance == "schoolgirl">>
			she exclaims, bouncing with excitement.
		<<else>>
			she exclaims.
		<</if>>
	<</if>>
	"Ahem. I have stored the confirmation code, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>," she notes. "If you wish to take advantage of this promotion, use the slave buying menu to navigate to the appropriate school next week. I have appended a note to that school's entry to remind you."
<</if>>
<</if>>

<</nobr>>\


code:
:: Retrieve [silently]

<<set $activeSlave = $slaves[$i], _ID = $activeSlave.ID, _SL = $slaves.length>>

<<removeJob $activeSlave $returnTo>>
<<switch $returnTo>>
<<case "Pit">>
	<<for _i = 0; _i < $fighterIDs.length; _i++>>
	<<if _ID == $fighterIDs[_i]>>
		<<set _dump = $fighterIDs.pluck([_i], [_i]), _i-->>
	<</if>>
	<</for>>
<<case "Coursing Association">>
	<<set $Lurcher = 0>>
<<case "Arcade">>
	<<set $activeSlave.assignment = "work a glory hole">>
<<case "Master Suite">>
	<<set $activeSlave.assignment = "please you">>
<<case "Cellblock">>
	<<set $activeSlave.assignment = "stay confined">>
<<case "Schoolroom">>
	<<set $activeSlave.assignment = "take classes">>
<<case "Servants' Quarters">>
	<<set $activeSlave.assignment = "be a servant">>
<<case "Dairy">>
	<<set $activeSlave.assignment = "get milked">>
	<<if $dairyRestraintsSetting > 1>>
		<<set $activeSlave.buttplug = "none", $activeSlave.clothes = "no clothing", $activeSlave.collar = "none", $activeSlave.vaginalAccessory = "none">>
	<</if>>
<<case "Brothel">>
	<<set $activeSlave.assignment = "whore">>
<<case "Club">>
	<<set $activeSlave.assignment = "serve the public">>
<</switch>>

<<if ($returnTo != "Pit") && ($returnTo != "Coursing Association")>>
	<<set $slaves[$i] = $activeSlave>>
<</if>>

<<goto $returnTo>>


code:
:: RIE Eligibility Check

<<silently>>

<<set $eventSlave = 0>>

<<set $eligibleSlaves = []>>

<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].assignmentVisible == 1>>
	<<if $slaves[$i].fuckdoll == 0>>
	<<set $eligibleSlaves.push($slaves[$i])>>
	<</if>>
	<</if>>
<</for>>

<<if $eligibleSlaves.length == 0>>
	<<goto "Next Week">>
<<elseif $hostageRescued == 1>>
	<<goto "P hostage acquisition">>
<<else>>
	<<set $eventSlave = 0>>
	<<goto "Random Individual Event">>
<</if>>

<</silently>>


code:
:: Rules Autosurgery [nobr]

<<set $surgeries = []>>

<<for _r = $defaultRules.length-1; _r >= 0; _r-->>
	<<set _currentRule = $defaultRules[_r]>>
	<<if (def _currentRule) && (_currentRule.autoSurgery != 0)>>
		<<set $thisSurgery = _currentRule.surgery>>
		<<set _temp = lastLactationSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.lactation = _temp.surgery.lactation>>
		<</if>>
		<<set _temp = lastLipSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.lips = _temp.surgery.lips>>
		<</if>>
		<<set _temp = lastButtSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.butt = _temp.surgery.butt>>
		<</if>>
		<<set _temp = lastBoobSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.boobs = _temp.surgery.boobs>>
		<</if>>
		<<if ($thisSurgery.hips !== "no default setting") && ($thisSurgery.butt !== "no default setting")>>
			<<if $slaves[$i].hips < -1>>
				<<if $thisSurgery.butt > 2>>
					<<set $thisSurgery.butt = 2>>
				<</if>>
			<<elseif $slaves[$i].hips < 0>>
				<<if $thisSurgery.butt > 4>>
					<<set $thisSurgery.butt = 4>>
				<</if>>
			<<elseif $slaves[$i].hips > 0>>
				<<if $thisSurgery.butt > 8>>
					<<set $thisSurgery.butt = 8>>
				<</if>>
			<<elseif $slaves[$i].hips > 1>>
			<<else>>
				<<if $thisSurgery.butt > 6>>
					<<set $thisSurgery.butt = 6>>
				<</if>>
			<</if>>
		<</if>>
		<<break>>
	<</if>>
<</for>>
<<if ndef $thisSurgery>>
	<<set $thisSurgery = {lactation: "no default setting", cosmetic: 0, accent: "no default setting", shoulders: "no default setting", shouldersImplant: "no default setting", boobs: "no default setting", hips: "no default setting", hipsImplant: "no default setting", butt: "no default setting", faceShape: "no default setting", lips: "no default setting", holes: 0}>>
<</if>>

<<set $seed = 0>>
<<for $seed == 0>>

<<if ($slaves[$i].health <= 20)>>
	<<set $seed = 1>>
<<else>>
<<if ($slaves[$i].lactation == 2) && ($thisSurgery.lactation == 0)>>
	<<set $surgeries.push("surgery to remove her lactation implants")>>
	<<set $slaves[$i].lactation = 0>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].lactation != 2) && ($thisSurgery.lactation == 1)>>
	<<set $surgeries.push("lactation inducing implanted drugs")>>
	<<set $slaves[$i].lactation = 2>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].anus > 3) && ($thisSurgery.cosmetic > 0)>>
	<<set $surgeries.push("a restored anus")>>
	<<set $slaves[$i].anus = 3>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].vagina > 3) && ($thisSurgery.cosmetic > 0)>>
	<<set $surgeries.push("a restored pussy")>>
	<<set $slaves[$i].vagina = 3>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].faceImplant == 0) && ($slaves[$i].face <= 95) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("a nicer face")>>
	<<if $slaves[$i].faceShape is "masculine">><<set $slaves[$i].faceShape to "androgynous">><</if>>
	<<set $slaves[$i].faceImplant to 1>>
	<<set $slaves[$i].face = Math.trunc($slaves[$i].face+20,-100,100)>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].ageImplant != 1) && ($slaves[$i].age >= 25) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("an age lift")>>
	<<set $slaves[$i].ageImplant = 1>>
	<<if $slaves[$i].visualAge > 80>>
		<<set $slaves[$i].visualAge -= 40>>
	<<elseif $slaves[$i].visualAge >= 70>>
		<<set $slaves[$i].visualAge -= 30>>
	<<elseif $slaves[$i].visualAge > 50>>
		<<set $slaves[$i].visualAge -= 20>>
	<<elseif $slaves[$i].visualAge > 36>>
		<<set $slaves[$i].visualAge -= 10>>
	<<else>>
		<<set $slaves[$i].visualAge -= 5>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].voice == 1) && ($slaves[$i].voiceImplant == 0) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("a feminine voice")>>
	<<set $slaves[$i].voice += 1>>
	<<set $slaves[$i].voiceImplant += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].waist >= -10) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("a narrower waist")>>
	<<set $slaves[$i].waist -= 20>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif (($slaves[$i].boobShape == "saggy") || ($slaves[$i].boobShape == "downward-facing")) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("a breast lift")>>
	<<set $slaves[$i].boobShape = "normal">>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif (($slaves[$i].boobShape == "normal") || ($slaves[$i].boobShape == "wide-set")) && ($thisSurgery.cosmetic != 0)>>
	<<if $slaves[$i].boobs > 800>>
		<<set $slaves[$i].boobShape = "torpedo-shaped">>
	<<else>>
		<<set $slaves[$i].boobShape = "perky">>
	<</if>>
	<<set $surgeries.push("more interestingly shaped breasts")>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($thisSurgery.lips == 0) && ($slaves[$i].lipsImplant > 0)>>
	<<set $surgeries.push("surgery to remove her lip implants")>>
	<<set $slaves[$i].lips -= $slaves[$i].lipsImplant>>
	<<set $slaves[$i].lipsImplant = 0>>
	<<if $slaves[$i].oralSkill > 10>>
		<<set $slaves[$i].oralSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].lips <= 95) && ($slaves[$i].lips < $thisSurgery.lips)>>
	<<if $thisSurgery.lips !== "no default setting">>
		<<set $surgeries.push("bigger lips")>>
		<<set $slaves[$i].lipsImplant += 10>>
		<<set $slaves[$i].lips += 10>>
		<<if $slaves[$i].oralSkill > 10>>
			<<set $slaves[$i].oralSkill -= 10>>
		<</if>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].faceImplant == 1) && ($slaves[$i].face <= 95) && ($thisSurgery.cosmetic is 2)>>
	<<set $surgeries.push("a nicer face")>>
	<<if $slaves[$i].faceShape is "masculine">><<set $slaves[$i].faceShape to "androgynous">><</if>>
	<<set $slaves[$i].faceImplant to 2>>
	<<set $slaves[$i].face = Math.trunc($slaves[$i].face+20,-100,100)>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].faceImplant > 0) && ($slaves[$i].face <= 95) && ($surgeryUpgrade == 1) && ($thisSurgery.cosmetic is 2)>>
	<<set $surgeries.push("a nicer face")>>
	<<if $slaves[$i].faceShape is "masculine">><<set $slaves[$i].faceShape to "androgynous">><</if>>
	<<set $slaves[$i].faceImplant to 2>>
	<<set $slaves[$i].face = Math.trunc($slaves[$i].face+20,-100,100)>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].waist >= -95) && ($thisSurgery.cosmetic is 2) && ($seeExtreme == 1)>>
	<<set $surgeries.push("a narrower waist")>>
	<<set $slaves[$i].waist = Math.trunc($slaves[$i].waist-20,-100,100)>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 30.5>><<else>><<set $slaves[$i].health -= 4>><</if>>
<<elseif ($slaves[$i].voice < 3) && ($slaves[$i].voiceImplant == 0) && ($thisSurgery.cosmetic == 2)>>
	<<set $surgeries.push("a bimbo's voice")>>
	<<set $slaves[$i].voice += 1>>
	<<set $slaves[$i].voiceImplant += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($thisSurgery.butt == 0) && ($slaves[$i].buttImplant > 0)>>
	<<set $surgeries.push("surgery to remove her butt implants")>>
	<<set $slaves[$i].butt -= $slaves[$i].buttImplant>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($thisSurgery.boobs == 0) && ($slaves[$i].boobsImplant > 0)>>
	<<set $surgeries.push("surgery to remove her boob implants")>>
	<<set $slaves[$i].boobs -= $slaves[$i].boobsImplant>>
	<<set $slaves[$i].boobsImplant = 0>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].butt <= 3) && ($slaves[$i].butt < $thisSurgery.butt)>>
	<<if $thisSurgery.butt !== "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant = 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].boobs <= 600) && ($slaves[$i].lactation < 2) && ($slaves[$i].boobs+400 <= $thisSurgery.boobs)>>
	<<if $thisSurgery.boobs !== "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 400>>
		<<set $slaves[$i].boobs += 400>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>>
		<<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].boobs <= 600) && ($slaves[$i].lactation < 2) && ($slaves[$i].boobs+200 <= $thisSurgery.boobs)>>
	<<if $thisSurgery.boobs !== "no default setting">>
		<<set $surgeries.push("modestly bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 200>>
		<<set $slaves[$i].boobs += 200>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].butt <= 5) && ($slaves[$i].butt < $thisSurgery.butt)>>
	<<if $thisSurgery.butt !== "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant = 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].boobs <= 2000) && ($slaves[$i].lactation < 2) && ($slaves[$i].boobs+400 < $thisSurgery.boobs)>>
	<<if $thisSurgery.boobs !== "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 400>>
		<<set $slaves[$i].boobs += 400>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].anus > 0) && ($surgeryUpgrade == 1) && ($thisSurgery.holes == 2)>>
	<<set $surgeries.push("a virgin anus")>>
	<<set $slaves[$i].anus = 0>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].vagina > 0) && ($surgeryUpgrade == 1) && ($thisSurgery.holes == 2)>>
	<<set $surgeries.push("a virgin pussy")>>
	<<set $slaves[$i].vagina = 0>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].anus > 1) && ($thisSurgery.holes == 1)>>
	<<set $surgeries.push("a tighter anus")>>
	<<set $slaves[$i].anus = 1>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].vagina > 1) && ($thisSurgery.holes == 1)>>
	<<set $surgeries.push("a tighter pussy")>>
	<<set $slaves[$i].vagina = 1>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].butt <= 8) && ($slaves[$i].butt < $thisSurgery.butt)>>
	<<if $thisSurgery.butt !== "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant = 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].boobs <= 9000) && ($slaves[$i].lactation < 2) && ($slaves[$i].boobs < $thisSurgery.boobs)>>
	<<if $thisSurgery.boobs !== "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 200>>
		<<set $slaves[$i].boobs += 200>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.medicine >= 100>><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<else>>

<<set $seed = 1>>
<</if>>
<</if>>

<</for>>

<<if $surgeries.length > 0>>
	<<set $surgeriesDisplay = "">>
	<<for $j = 0; $j < $surgeries.length; $j++>>
		<<set $seed = $surgeries[$j]>>
		<<set $surgeriesDisplay = ($surgeriesDisplay + $seed)>>
		<<if $j < $surgeries.length-2>>
		<<set $surgeriesDisplay = ($surgeriesDisplay + ", ")>>
		<<elseif $j < $surgeries.length-1>>
		<<if $surgeries.length > 2>>
			<<set $surgeriesDisplay = ($surgeriesDisplay + ", and ")>>
		<<else>>
			<<set $surgeriesDisplay = ($surgeriesDisplay + " and ")>>
		<</if>>
		<</if>>
	<</for>>
	<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>>, ordered to apply surgery, gives $slaves[$i].slaveName @@color:lime;$surgeriesDisplay.@@
<</if>>


code:
:: Rules Facility Remove [nobr]

<<if _currentRule.facilityRemove>>

	<<switch _currentRule.assignFacility>>
	<<case "brothel">>
		<<if $activeSlave.assignment == "work in the brothel">>
			<<if ($Madam == 0) || ($Madam.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $brothelName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "club">>
		<<if $activeSlave.assignment == "serve in the club">>
			<<if ($DJ == 0) || ($DJ.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $clubName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "dairy">>
		<<if $activeSlave.assignment == "work in the dairy">>
			<<if ($Milkmaid == 0) || ($Milkmaid.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $dairyName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "arcade">>
		<<if $activeSlave.assignment == "be confined in the arcade">>
				<<removeJob $activeSlave _currentRule.assignFacility>>
			<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $arcadeName and has been assigned to $activeSlave.assignment
		<</if>>

	<<case "spa">>
		<<if $activeSlave.assignment == "rest in the spa">>
			<<if ($Attendant == 0) || ($Attendant.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $spaName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "clinic">>
		<<if $activeSlave.assignment == "get treatment in the clinic">>
			<<if ($Nurse == 0) || ($Nurse.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $clinicName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "mastersuite">>
		<<if $activeSlave.assignment == "serve in the master suite">>
			<<if ($Concubine == 0) || ($Concubine.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $masterSuiteName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "hgsuite">>
		<<if $activeSlave.assignment == "live with your Head Girl">>
			<<if ($HeadGirl == 0) || ($HeadGirl.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $HGSuiteName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "servantsquarters">>
		<<if $activeSlave.assignment == "work as a servant">>
			<<if ($Stewardess == 0) || ($Stewardess.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $servantsQuartersName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "schoolroom">>
		<<if $activeSlave.assignment == "learn in the schoolroom">>
			<<if ($Schoolteacher == 0) || ($Schoolteacher.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $schoolroomName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>

	<<case "cellblock">>
		<<if $activeSlave.assignment == "be confined in the cellblock">>
			<<if ($Wardeness == 0) || ($Wardeness.ID != $activeSlave.ID)>>
				<<removeJob $activeSlave _currentRule.assignFacility>>
				<<set $activeSlave.assignment = _currentRule.removalAssignment>>

$activeSlave.slaveName has been removed from $cellblockName and has been assigned to $activeSlave.assignment
			<</if>>
		<</if>>
	<</switch>>
<</if>>


code:
:: Rules Slave Deselect Workaround

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Slave Select">>
	<<if ruleSlaveSelected($activeSlave, $currentRule)>>
		<<set $dump = $currentRule.selectedSlaves.pluck($activeSlave.ID)>>
	<</if>>
	<<goto "Rules Slave Select">>
<</nobr>>


code:
:: Rules Slave Exclude

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Assistant">>
<<if ndef $currentRule.excludedSlaves>>
	<<set $currentRule.excludedSlaves to []>>
<</if>>
<<if ($currentRule.selectedSlaves.length < 1) && ($currentRule.excludedSlaves.length < 1)>>
	No slaves excluded from Rule $r

	<<set $Flag = 0>>
	Exclude selected slaves from rule $r:
	<<include "Slave Summary">>
<<else>>
	Slaves excluded from Rule $r:
	<<set $Flag = 1>>
	<<include "Slave Summary">>

	Exclude selected slaves from rule $r:
	<<set $Flag = 0>>
	<<include "Slave Summary">>

[[Do not exclude any slaves|Rules Slave Exclude][$currentRule.excludeSlaves = []]]
<</if>>
<</nobr>>


code:
:: Rules Slave Exclude Workaround

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Slave Exclude">>
	<<if !ruleSlaveExcluded($activeSlave, $currentRule)>>
		<<set $currentRule.excludedSlaves.push($activeSlave.ID)>>
		<<if ruleSlaveSelected($activeSlave, $currentRule)>>
			<<set $dump = $currentRule.selectedSlaves.pluck($activeSlave.ID)>>
		<</if>>
	<</if>>
	<<goto "Rules Slave Exclude">>
<</nobr>>


code:
:: Rules Slave NoExclude Workaround

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Slave Exclude">>
	<<if ruleSlaveExcluded($activeSlave, $currentRule)>>
		<<set $dump = $currentRule.excludedSlaves.pluck($activeSlave.ID)>>
	<</if>>
	<<goto "Rules Slave Exclude">>
<</nobr>>


code:
:: Rules Slave Select

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Assistant">>

<<if ndef $currentRule.selectedSlaves>>
	<<set $currentRule.selectedSlaves to []>>
<</if>>

<<if ((ndef $currentRule.selectedSlaves) || ($currentRule.selectedSlaves.length < 1)) && ((ndef $currentRule.excludedSlaves) || ($currentRule.excludedSlaves.length < 1))>>
	Rule $r currently applied to all slaves.

	<<set $Flag = 0>>
	Apply rule $r to selected slaves:
	<<include "Slave Summary">>
<<elseif ($currentRule.selectedSlaves.length < 1) && ($currentRule.excludedSlaves.length > 0)>>
	Rule $r currently applied to all slaves except excluded slaves.

	<<set $Flag = 0>>
	Apply rule $r to selected slaves:
	<<include "Slave Summary">>
<<else>>
	Rule $r currently applied to:
	<<set $Flag = 1>>
	<<include "Slave Summary">>

	Apply rule $r to selected slaves:
	<<set $Flag = 0>>
	<<include "Slave Summary">>

[[Apply to all slaves|Rules Slave Select][$currentRule.selectedSlaves = []]]
<</if>>
<</nobr>>


code:
:: Rules Slave Select Workaround

<<nobr>>
<<set $nextButton = "Continue">>
<<set $nextLink = "Rules Slave Select">>
	<<if !ruleSlaveSelected($activeSlave, $currentRule)>>
		<<set $currentRule.selectedSlaves.push($activeSlave.ID)>>
		<<if ruleSlaveExcluded($activeSlave, $currentRule)>>
			<<set $dump = $currentRule.excludedSlaves.pluck($activeSlave.ID)>>
		<</if>>
	<</if>>
	<<goto "Rules Slave Select">>
<</nobr>>


code:
:: SA be your Head Girl [nobr]

<<set $HGTimeInGrade += 1>>

<<if $arcologies[0].FSEgyptianRevivalistLaw == 0>>
	helps manage your other slaves. She helps them when they try and fail, and punishes them when they fail to try.
<<else>>
	serves as your Consort. Though she is still your slave, her status is scarcely below that of a citizen. She @@color:green;contributes to your reputation@@ just like a Concubine, and she is @@color:hotpink;conscious@@ of the @@color:mediumaquamarine;trust@@ you place in her.
	<<set $slaves[$i].devotion += 1>>
	<<set $slaves[$i].trust += 1>>
	<<silently>>
	<<include "SA please you">>
	<</silently>>
	<<if $slaves[$i].relationship > 4>>
	<<if $familyTesting == 1>>
		<<if $slaves[$i].relationshipTarget == $Concubine.ID>>
			<<if totalRelatives($slaves[$i]) > 0>>
				<<if $Concubine.mother == $slaves[$i].ID || $Concubine.father == $slaves[$i].ID>>
					Your Concubine is your Consort's daughter-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<elseif $slaves[$i].mother == $Concubine.ID>>
					Your Concubine is your Consort's mother-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<elseif $slaves[$i].father == $Concubine.ID>>
					Your Concubine is your Consort's father-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<elseif areSisters($slaves[$i], $Concubine) == 1>>
					Your Concubine is your Consort's twin-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<elseif areSisters($slaves[$i], $Concubine) == 2>>
					Your Concubine is your Consort's sister-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<elseif areSisters($slaves[$i], $Concubine) == 3>>
					Your Concubine is your Consort's half-sister-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
					<<set $rep += 250>>
				<<else>>
					//Shit went wrong! Post this in a bug report!// This is @@color:red;NOT as it should be.@@
					<<set $rep += 100>>
				<</if>>
			<<else>>
				Your Consort and your Concubine are wives to each other and to Pharaoh. This is @@color:green;as it should be.@@
				<<set $rep += 100>>
			<</if>>
		<<else>>
			<<if totalRelatives($slaves[$i]) > 0>>
				<<for $j to 0; $j < $slaves.length; $j++>>
				<<if $slaves[$i].relationshipTarget == $slaves[$j].ID>>
					<<if $slaves[$j].mother == $slaves[$i].ID || $slaves[$j].father == $slaves[$i].ID>>
					Your Consort has a daughter-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<<elseif $slaves[$i].mother == $slaves[$j].ID>>
					Your Consort has a mother-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<<elseif $slaves[$i].father == $slaves[$j].ID>>
					Your Consort has a father-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<<elseif areSisters($slaves[$i], $slaves[$j]) == 1>>
					Your Consort has a twin-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<<elseif areSisters($slaves[$i], $slaves[$j]) == 2>>
					Your Consort has a sister-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<<elseif areSisters($slaves[$i], $slaves[$j]) == 3>>
					Your Consort has a half-sister-wife. This is @@color:green;as it should be.@@
					<<set $rep += 100>>
					<</if>>
					<<break>>
				<</if>>
				<</for>>
			<</if>>
		<</if>>
	<<else>>
		<<if $slaves[$i].relationshipTarget == $Concubine.ID>>
			<<if $slaves[$i].relationTarget == $Concubine.ID>>
				Your Concubine is your Consort's $slaves[$i].relation-wife. Truly, $arcologies[0].name looks up to you @@color:green;as children to a father.@@
				<<set $rep += 250>>
			<<else>>
				Your Consort and your Concubine are wives to each other and to Pharaoh. This is @@color:green;as it should be.@@
				<<set $rep += 100>>
			<</if>>
		<<elseif $slaves[$i].relationshipTarget == $slaves[$i].relationTarget>>
			Your Consort has a $slaves[$i].relation-wife. This is @@color:green;as it should be.@@
			<<set $rep += 100>>
		<</if>>
	<</if>>
	<</if>>
<</if>>

<<if ($slaves[$i].livingRules == "luxurious") && ($HGSuite == 1)>>
	Being continually trusted with this position @@color:hotpink;increases her devotion to you,@@ and encourages her to @@color:mediumaquamarine;trust you in turn;@@ she's also @@color:hotpink;grateful@@ for her nice suite, which makes her one of the best provided for slaves in the Free Cities.
	<<set $slaves[$i].devotion += 4>>
	<<set $slaves[$i].trust += 4>>
<<elseif ($slaves[$i].livingRules == "luxurious")>>
	Being continually trusted with this position @@color:hotpink;increases her devotion to you@@ and encourages her to @@color:mediumaquamarine;trust you in turn.@@
	<<set $slaves[$i].devotion += 4>>
	<<set $slaves[$i].trust += 4>>
<<elseif ($HGSuite == 1)>>
	She's @@color:hotpink;grateful@@ for her nice suite, which makes her one of the best provided for slaves in the Free Cities. Being continually trusted with this position encourages her to @@color:mediumaquamarine;trust you in turn.@@
	<<set $slaves[$i].devotion += 2>>
	<<set $slaves[$i].trust += 4>>
<<else>>
	Being continually trusted with this position @@color:hotpink;slightly increases her devotion to you,@@ though she harbors some doubts because she isn't allowed a room of her own to set her apart from the other slaves.
	<<set $slaves[$i].devotion += 1>>
<</if>>

<<if ($personalAttention == "HG")>>
	You're cooperating with her this week, working with $assistantName to free up some of her time so she can target more slaves in need of individual attention.
	<<if ($slaves[$i].trust > 95)>>
	She is so trusting of you that she can act as your own right hand, allowing her to oversee your slaves with remarkable efficiency.
	<<else>>
	This arrangement @@color:mediumaquamarine;builds trust@@ between you.
	<<set $slaves[$i].trust += 2>>
	<</if>>
<</if>>

<<if ($HGFormality == 0)>>
	<<if ($slaves[$i].trust > 95)>>
	Every so often, when you're alone, she calls you <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>. She treats your permission to do this as a sacred thing, and @@color:hotpink;loves you for it.@@
	<<set $slaves[$i].devotion += 1>>
	<<else>>
	Your permission to be informal in private @@color:mediumorchid;confuses her@@ a little, since she isn't perfectly confident enough to be comfortable with the idea.
	<<set $slaves[$i].devotion -= 1>>
	<</if>>
<</if>>

<<if $slaves[$i].fetishKnown == 1>>
	<<if $slaves[$i].fetish == "dom">>
		<<if ($slaves[$i].fetishKnown == 1)>>
		<<if ($slaves[$i].fetishStrength <= 95)>>
			Having all the slaves look up to and obey her advances her @@color:lightcoral;dominant tendencies.@@
			<<set $slaves[$i].fetishStrength += 4>>
		<</if>>
		<</if>>
	<<elseif $slaves[$i].fetishStrength > random(20,40)>>
		The sheer variety of sexual situations she sees and participates in @@color:pink;broaden her sexual interests@@ and incline her to take a dominant sexual role.
		<<set $slaves[$i].fetishStrength -= 4>>
	<<else>>
		Having all the slaves look up to and obey her affects her sexuality, turning her into a @@color:lightcoral;bit of a dominatrix.@@
		<<set $slaves[$i].fetish = "dom">>
		<<set $slaves[$i].fetishStrength = 20>>
	<</if>>
<<else>>
	<<if random(1,3) == 1>>
		Having all the slaves look up to and obey her affects her sexuality, turning her into a @@color:lightcoral;bit of a dominatrix.@@
		<<set $slaves[$i].fetish = "dom">>
		<<set $slaves[$i].fetishStrength = 20>>
		<<set $slaves[$i].fetishKnown = 1>>
	<</if>>
<</if>>

<<if $slaves[$i].prestige == 0>>
<<if $HGTimeInGrade+($slaves[$i].intelligence*5)+($slaves[$i].devotion/10)+($slaves[$i].trust/10) > 50>>
	$slaves[$i].slaveName has rendered such long and competent service as your Head Girl that many of your citizens have come to rely on her word as an extension of yours, trusting that if she does something, it's because you trust her to. @@color:green;She has become prestigious on her own merits, a remarkable achievement for a slave!@@
	<<set $slaves[$i].prestige += 1>>
	<<set $slaves[$i].prestigeDesc = "Many citizens respect her long and able service as your Head Girl.">>
<</if>>
<</if>>