code:
:: RES Failure

<<nobr>>

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

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

<<set $rep -= 200>>
<<set $AProsperity -= 2>>
<<set $slavesToAdd to 5>>
<<if $RESFailure is "TSS">>
	<<set $TSS.schoolPresent to 0>>
	<<set $TSS.subsidy to 0>>
	<<set $TSS.schoolProsperity to 0>>
	<<set $TSS.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.career to "a slave">>
		<<set $activeSlave.butt to either(1, 2, 2, 3)>>
		<<set $activeSlave.boobs to either(200, 300, 300, 400)>>
		<<if $TSS.schoolUpgrade == 1>>
			<<set $activeSlave.origin to "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 to 1>>
			<<set $activeSlave.vagina to 1>>
			<<set $activeSlave.actualAge to random(36,42)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<else>>
			<<set $activeSlave.origin to "She was given to you by a failed branch campus of The Slavegirl School right after her majority.">>
			<<set $activeSlave.anus to 0>>
			<<set $activeSlave.vagina to 0>>
			<<set $activeSlave.actualAge to 18>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<</if>>
		<<set $activeSlave.intelligenceImplant to 1>>
		<<set $activeSlave.teeth to "normal">>
		<<set $activeSlave.intelligence to 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 to 0>>
		<<set $activeSlave.weight to 0>>
		<<set $activeSlave.chem to 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 to "waxed">>
		<<set $activeSlave.sexualFlaw to either("none")>>
		<<set $activeSlave.behavioralFlaw to either("none")>>
		<<set $activeSlave.hStyle to "tails">>
		<<set $activeSlave.customTat to "She has the simple logo of the corporation that operates The Slavegirl School tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure is "GRI">>
	<<set $GRI.schoolPresent to 0>>
	<<set $GRI.subsidy to 0>>
	<<set $GRI.schoolProsperity to 0>>
	<<set $GRI.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.origin to "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 to "a slave">>
		<<set $activeSlave.intelligenceImplant to 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 to random(150,190)>>
		<<set $activeSlave.butt to random(4,10)>>
		<<if $GRI.schoolUpgrade == 2>>
			<<set $activeSlave.boobs to 200*random(15,30)>>
			<<set $activeSlave.lactation to 2>>
		<<else>>
			<<set $activeSlave.boobs to 200*random(4,20)>>
		<</if>>
		<<set $activeSlave.nipples to either("inverted", "huge")>>
		<<set $activeSlave.areolae to either(0, 1, 2, 3)>>
		<<set $activeSlave.clit to either(0, 1, 2, 3)>>
		<<set $activeSlave.lips to random(5,85)>>
		<<set $activeSlave.anus to 0>>
		<<set $activeSlave.vagina to 0>>
		<<set $activeSlave.preg to 0>>
		<<set $activeSlave.weight to 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 to "waxed">>
		<<set $activeSlave.actualAge to 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.behavioralFlaw to either("odd")>>
		<<set $activeSlave.hStyle to "shaved">>
		<<set $activeSlave.hLength to 0>>
		<<set $activeSlave.customTat to "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 is "SCP">>
	<<set $SCP.schoolPresent to 0>>
	<<set $SCP.subsidy to 0>>
	<<set $SCP.schoolProsperity to 0>>
	<<set $SCP.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.origin to "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 to 20>>
		<<set $activeSlave.career to "a slave">>
		<<if $SCP.schoolUpgrade == 1>>
			<<set $activeSlave.intelligenceImplant to 0>>
			<<set $activeSlave.intelligence to -2>>
			<<set $activeSlave.devotion = 20>>
			<<set $activeSlave.trust = 20>>
		<<else>>
			<<set $activeSlave.intelligenceImplant to 1>>
			<<set $activeSlave.teeth to "normal">>
			<<set $activeSlave.intelligence to 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 to 1>>
		<<set $activeSlave.height += 10>>
		<<set $activeSlave.buttImplant to (4-$activeSlave.butt)>>
		<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<<set $activeSlave.boobsImplant to (2000-$activeSlave.boobs)>>
		<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
		<<set $activeSlave.nipples to "tiny">>
		<<set $activeSlave.areolae to 0>>
		<<set $activeSlave.clit to 0>>
		<<set $activeSlave.lipsImplant to (75-$activeSlave.lips)>>
		<<set $activeSlave.lips += $activeSlave.lipsImplant>>
		<<set $activeSlave.faceImplant to (2-$activeSlave.face)>>
		<<set $activeSlave.face += $activeSlave.faceImplant>>
		<<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 to "waxed">>
		<<set $activeSlave.actualAge to 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw to either("none")>>
		<<set $activeSlave.behavioralFlaw to either("none")>>
		<<set $activeSlave.hStyle to "tails">>
		<<set $activeSlave.hColor to "blonde">>
		<<set $activeSlave.pubicHColor to "blonde">>
		<<if $activeSlave.race != "white">><<set $activeSlave.race to "surgically altered to look white">><</if>>
		<<set $activeSlave.skin to "tanned">>
		<<set $activeSlave.customTat to "She has the coat of arms of St. Claver Preparatory tattooed on her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<elseif $RESFailure is "LDE">>
	<<set $LDE.schoolPresent to 0>>
	<<set $LDE.subsidy to 0>>
	<<set $LDE.schoolProsperity to 0>>
	<<set $LDE.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin to "She was given to you by a failed branch campus of the innovative École des Enculées right after her graduation.">>
		<<set $activeSlave.career to "a slave">>
		<<set $activeSlave.intelligenceImplant to 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 to either(1,2)>>
		<<set $activeSlave.boobs to either(500,650,800)>>
		<<set $activeSlave.waist to 1>>
		<<set $activeSlave.lips to 35>>
		<<if $LDE.schoolUpgrade == 2>>
			<<set $activeSlave.balls to either(3,4)>>
			<<set $activeSlave.dick to either(3,4)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum to $activeSlave.balls>><</if>>
		<<else>>
			<<set $activeSlave.dick to either(1,1,1,2)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum to $activeSlave.balls>><</if>>
			<<set $activeSlave.balls to either(1,1,1,2)>>
		<</if>>
		<<set $activeSlave.anus to 2>>
		<<set $activeSlave.vagina to -1>>
		<<set $activeSlave.preg to 0>>
		<<set $activeSlave.weight to 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 to "waxed">>
		<<set $activeSlave.actualAge to 19>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw to "none">>
		<<set $activeSlave.behavioralFlaw to either("none", "odd")>>
		<<set $activeSlave.fetishStrength to either(1, 2)>>
		<<set $activeSlave.fetish to "buttslut">>
		<<set $activeSlave.fetishKnown to 1>><<set $activeSlave.attrKnown to 1>>
		<<set $activeSlave.hStyle to "tails">>
		<<set $activeSlave.hLength = 100>>
		<<set $activeSlave.customTat to "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 is "TGA">>
	<<set $TGA.schoolPresent to 0>>
	<<set $TGA.subsidy to 0>>
	<<set $TGA.schoolProsperity to 0>>
	<<set $TGA.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd; $i++>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin to "She was given to you by a failed branch campus of the intense Gymnasium-Academy right after her majority.">>
		<<set $activeSlave.career to "a slave">>
		<<set $activeSlave.intelligenceImplant to 1>>
		<<set $activeSlave.teeth to "normal">>
		<<set $activeSlave.intelligence to either (-1, 0, 1, 2)>>
		<<set $activeSlave.chem to 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 to either(20, 50, 50)>>
		<<set $activeSlave.butt to either(2, 2, 3)>>
		<<set $activeSlave.boobs to either(100, 200)>>
		<<set $activeSlave.dick to random(3,5)>>
		<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum to $activeSlave.balls>><</if>>
		<<set $activeSlave.balls to random(3,5)>>
		<<set $activeSlave.anus to 0>>
		<<set $activeSlave.vagina to -1>>
		<<set $activeSlave.preg to 0>>
		<<set $activeSlave.weight to 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 to "waxed">>
		<<set $activeSlave.actualAge to 18>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.sexualFlaw to either("none", "apathetic")>>
		<<set $activeSlave.behavioralFlaw to either("none", "arrogant", "odd")>>
		<<set $activeSlave.hStyle to "short">>
		<<set $activeSlave.hLength to 2>>
		<<set $activeSlave.customTat to "She has the baroque crest of the Gymnasium-Academy that trained her branded into her left cheek.">>
		<<AddSlave $activeSlave>>
	<</for>>
<<else>>
	<<set $TFS.schoolPresent to 0>>
	<<set $TFS.subsidy to 0>>
	<<set $TFS.schoolProsperity to 0>>
	<<set $TFS.schoolAnnexed to 1>>
	<<for $i to 0; $i < $slavesToAdd-1; $i++>>
		<<set $seed to random(1,4)>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.origin to "She was a Futanari Sister until you engineered her early enslavement.">>
		<<set $activeSlave.career to "a Futanari Sister">>
		<<set $activeSlave.faceShape to 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(1,1,1,2,3)>>
			<<set $activeSlave.boobs = 100*random(12,20)>>
			<<set $activeSlave.dick to random(2,3)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls to 1>>
				<<set $activeSlave.scrotum to 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls to 6>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls to random(2,3)>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to 0>>
			<<set $activeSlave.weight to 0>>
			<<set $activeSlave.actualAge to 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(1,1,2,2,3)>>
			<<set $activeSlave.boobs = 100*random(20,32)>>
			<<set $activeSlave.dick to random(3,4)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls to 1>>
				<<set $activeSlave.scrotum to 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls to 6>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls to random(3,4)>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to random(15,25)>>
			<<set $activeSlave.weight to 20>>
			<<set $activeSlave.actualAge to 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(1,2,2,3,3)>>
			<<set $activeSlave.boobs = 100*random(32,42)>>
			<<set $activeSlave.dick to random(4,5)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls to 1>>
				<<set $activeSlave.scrotum to 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls to 6>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls to random(4,5)>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to random(25,55)>>
			<<set $activeSlave.weight to 20>>
			<<set $activeSlave.actualAge to random(35,39)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina to 3>>
			<<set $activeSlave.anus to 3>>
			<<set $activeSlave.fetish to 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(1,2,3,3,3)>>
			<<set $activeSlave.boobs = 100*random(44,60)>>
			<<set $activeSlave.dick to random(5,6)>>
			<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
			<<if $TFS.schoolUpgrade == 1>>
				<<set $activeSlave.balls to 1>>
				<<set $activeSlave.scrotum to 0>>
			<<elseif $TFS.schoolUpgrade == 2>>
				<<set $activeSlave.balls to 6>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls to random(5,6)>>
				<<set $activeSlave.scrotum to $activeSlave.balls>>
			<</if>>
			<<set $activeSlave.lips to random(25,55)>>
			<<set $activeSlave.weight to 50>>
			<<set $activeSlave.actualAge to random(40,42)>>
			<<set $activeSlave.visualAge = $activeSlave.actualAge>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
			<<set $activeSlave.vagina to 3>>
			<<set $activeSlave.anus to 3>>
			<<set $activeSlave.fetish to "dom">>
		<</if>>
		<<if $TFS.farmUpgrade == 1>>
			<<set $activeSlave.ovaries to 1>>
			<<if $TFS.farmUpgrade == 2>>
				<<set $activeSlave.preg to random(1,35)>>
			<</if>>
		<</if>>
		<<set $activeSlave.intelligenceImplant to 1>>
		<<set $activeSlave.teeth to "normal">>
		<<if $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.energy = 100>>
		<<else>>
			<<set $activeSlave.energy to $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 to 1>>
		<<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 to "waxed">>
		<<if $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.sexualQuirk to "caring">>
		<</if>>
		<<set $activeSlave.sexualFlaw to either("none", "hates women")>>
		<<set $activeSlave.behavioralFlaw to either("none", "arrogant")>>
		<<set $activeSlave.fetishStrength = 100>>
		<<set $activeSlave.fetishKnown to 0>>
		<<set $activeSlave.attrKnown to 0>>
		<<set $activeSlave.hStyle to "neat">>
		<<set $activeSlave.hLength to 150>>
		<<set $activeSlave.customTat to "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 to 3>>
	<<set $activeSlave.boobs = 100*random(44,60)>>
	<<set $activeSlave.dick to random(5,6)>>
	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin to $activeSlave.dick>><</if>>
	<<if $TFS.schoolUpgrade == 1>>
		<<set $activeSlave.balls to 1>>
		<<set $activeSlave.scrotum to 0>>
	<<elseif $TFS.schoolUpgrade == 2>>
		<<set $activeSlave.balls to 6>>
		<<set $activeSlave.scrotum to $activeSlave.balls>>
	<<else>>
		<<set $activeSlave.balls to random(5,6)>>
		<<set $activeSlave.scrotum to $activeSlave.balls>>
	<</if>>
	<<set $activeSlave.lips to random(25,55)>>
	<<set $activeSlave.weight to 50>>
	<<set $activeSlave.actualAge to random(40,42)>>
	<<set $activeSlave.visualAge = $activeSlave.actualAge>>
	<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
	<<set $activeSlave.vagina to 3>>
	<<set $activeSlave.anus to 3>>
	<<set $activeSlave.fetish to "dom">>
	<<if $TFS.farmUpgrade == 1>>
		<<set $activeSlave.ovaries to 1>>
		<<if $TFS.farmUpgrade == 2>>
			<<set $activeSlave.preg to random(1,35)>>
		<</if>>
	<</if>>
	<<set $activeSlave.intelligenceImplant to 1>>
	<<set $activeSlave.teeth to "normal">>
	<<if $TFS.schoolUpgrade == 2>>
		<<set $activeSlave.energy = 100>>
	<<else>>
		<<set $activeSlave.energy to $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 to 1>>
	<<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 to "waxed">>
	<<if $TFS.schoolUpgrade == 1>>
		<<set $activeSlave.sexualQuirk to "caring">>
	<</if>>
	<<set $activeSlave.sexualFlaw to either("none", "hates women")>>
	<<set $activeSlave.behavioralFlaw to either("none", "arrogant")>>
	<<set $activeSlave.fetishStrength = 100>>
	<<set $activeSlave.fetishKnown to 0>>
	<<set $activeSlave.attrKnown to 0>>
	<<set $activeSlave.hStyle to "neat">>
	<<set $activeSlave.hLength to 150>>
	<<set $activeSlave.customTat to "She has a simple pink heart tattooed on her right temple.">>
	<<AddSlave $activeSlave>>
<</if>>

<<if $RESFailure is "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 is "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 is "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 is "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 is "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 is "TFS">>
<<link "Rape her">>
	<<replace "#result">>
	<<nobr>>
	<<for $i to 0; $i < $slaves.length; $i++>>
	<<if ($slaves[$i].origin is "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 to 0; $i < $slaves.length; $i++>>
	<<if $RESFailure is "TSS">>
		<<if ($slaves[$i].origin is "She was given to you by a failed branch campus of The Slavegirl School right after her majority.") || ($slaves[$i].origin is "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 is "GRI">>
		<<if $slaves[$i].origin is "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 is "SCP">>
		<<if $slaves[$i].origin is "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 is "LDE">>
		<<if $slaves[$i].origin is "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 is "TGA">>
		<<if $slaves[$i].origin is "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 is "She was the leader of your arcology's Futanari Sisters until you engineered her community's failure and enslavement.") || ($slaves[$i].origin is "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 to "Continue", $nextLink to "RIE Eligibility Check">>

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

<<if $RESMove is "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 is "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 is "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 is "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 is "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 is "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 is "monstergirl">>
		her monstergirl avatar rather cutely using her fingers, the tips of her tentacle hair, and her dickheads to count:
	<<elseif $assistantAppearance is "shemale">>
		her shemale avatar ditzily using her fingers to keep count:
	<<elseif $assistantAppearance is "amazon">>
		her amazon avatar using a bone abacus to do sums while counting out loud gruffly:
	<<elseif $assistantAppearance is "businesswoman">>
		her businesswoman avatar projecting maturely sexy confidence as she runs the numbers:
	<<elseif $assistantAppearance is "fairy">>
		her fairy avatar conjures a bunch of colored lights to keep count:
	<<elseif $assistantAppearance is "pregnant fairy">>
		her pregnant fairy avatar conjures a bunch of colored lights to keep count:
	<<elseif $assistantAppearance is "goddess">>
		her goddess avatar keeping count by picking the petals off flowers in her hair:
	<<elseif $assistantAppearance is "hypergoddess">>
		her goddess avatar keeping count based off the number of contractions running through her huge belly:
	<<elseif $assistantAppearance is "loli">>
		her loli avatar carefully counts the numbers off on her fingers:
	<<elseif $assistantAppearance is "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 is "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 is "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 is "TSS") || ($RESMove is "SCP")>>
		"Just think of
		<<if $assistantAppearance is "monstergirl">>
			all those virgin schoolgirl holes," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "shemale">>
			all those fresh schoolgirls, all innocent, and..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "amazon">>
			all those nice girls," her avatar blushes.
		<<elseif $assistantAppearance is "businesswoman">>
			all that potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance is "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 is "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 is "goddess">>
			all those virgin bodies to share..." her avatar murmurs, rubbing a hand over her belly.
		<<elseif $assistantAppearance is "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 is "loli">>
			all those new girls!" her avatar exclaims.
		<<elseif $assistantAppearance is "preggololi">>
			all those fresh girls! her avatar exclaims with a grin.
		<<elseif $assistantAppearance is "schoolgirl">>
			all those cute schoolgirls like me!" her avatar trills.
		<<else>>
			all those nice girls," she says.
		<</if>>
	<<elseif $RESMove is "GRI">>
		"Just think of
		<<if $assistantAppearance is "monstergirl">>
			the tits, and the asses, and the lips," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "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 is "amazon">>
			all those meaty girls," her avatar blushes.
		<<elseif $assistantAppearance is "businesswoman">>
			all that milking potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance is "fairy">>
			all that sweet, tasty milk!" her avatar squeaks, licking her lips and dripping with arousal.
		<<elseif $assistantAppearance is "pregnant fairy">>
			all that sweet, tasty mama milk!" her avatar squeaks, licking her lips and dripping with arousal.
		<<elseif $assistantAppearance is "goddess">>
			all those luscious, heavy tits," her avatar says, hefting one of her own.
		<<elseif $assistantAppearance is "hypergoddess">>
			all those luscious, heavy tits," her avatar says, hefting one of her own.
		<<elseif $assistantAppearance is "loli">>
			those tits!" her avatar says while cupping her flat chest.
		<<elseif $assistantAppearance is "loli">>
			those tits!" her avatar says while cupping her barely there chest.
		<<elseif $assistantAppearance is "schoolgirl">>
			those titties!" her avatar trills.
		<<else>>
			those ridiculous assets," she says.
		<</if>>
	<<elseif $RESMove is "LDE">>
		"Just think of
		<<if $assistantAppearance is "monstergirl">>
			their soft anuses. I could fit both of my dicks in one of them," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "shemale">>
			those soft young butthole sluts..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "amazon">>
			their soft - I mean their submissive - you know, how they take..." her avatar trails off, blushing.
		<<elseif $assistantAppearance is "businesswoman">>
			all that whoring potential," her avatar says, looking aroused at the possibilities.
		<<elseif $assistantAppearance is "fairy">>
			all those soft, squeezable butts!," her avatar squeaks, shaking to and fro while she hugs herself.
		<<elseif $assistantAppearance is "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 is "goddess">>
			those servile little cuties!" her avatar exclaims, practically giggling.
		<<elseif $assistantAppearance is "hypergoddess">>
			those servile little cuties!  They could really use some cute little bellies!" her avatar exclaims, practically giggling.
		<<elseif $assistantAppearance is "loli">>
			those fat butts!" her avatar exclaims cheerfully.
		<<elseif $assistantAppearance is "preggololi">>
			those fat butts!" her avatar exclaims cheerfully.
		<<elseif $assistantAppearance is "schoolgirl">>
			those soft little bitches!" her avatar trills.
		<<else>>
			those bottoms," she says.
		<</if>>
	<<elseif $RESMove is "TGA">>
		"Just think of
		<<if $assistantAppearance is "monstergirl">>
			their sweaty bodies," she concludes, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "shemale">>
			those muscly bodies, all sweaty and..." she trails off, her avatar starting to masturbate.
		<<elseif $assistantAppearance is "amazon">>
			how they can fight!" she concludes, more loudly than is really necessary.
		<<elseif $assistantAppearance is "businesswoman">>
			all that bodyguard potential," her avatar says, looking aroused at the possibilities.
		<<elseif ($assistantAppearance is "fairy") or ($assistantAppearance is "pregnant fairy")>>
			those big, strong, sweaty, sexy bodies!" her avatar squeaks, looking beet red and breathing heavily.
		<<elseif $assistantAppearance is "goddess">>
			all those hard, strong, rippling..." she trails off, too breathless to be specific.
		<<elseif $assistantAppearance is "hypergoddess">>
			all those hard, strong, rippling..." she trails off, too breathless to be specific.
		<<elseif $assistantAppearance is "loli">>
			those muscles!" she exclaims.
		<<elseif $assistantAppearance is "preggololi">>
			those muscles!" she exclaims.
		<<elseif $assistantAppearance is "schoolgirl">>
			those cute bitches!" her avatar trills.
		<<else>>
			how well trained they always are," she says.
		<</if>>
	<<else>>
		<<if $assistantAppearance is "monstergirl">>
			<<if $assistantName is "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 is "shemale">>
			<<if $assistantName is "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They almost make me want a pussy, too."
		<<elseif $assistantAppearance is "amazon">>
			<<if $assistantName is "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "I like them."
		<<elseif $assistantAppearance is "businesswoman">>
			<<if $assistantName is "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 is "fairy") or ($assistantAppearance is "pregnant fairy")>>
			<<if $assistantName is "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "If only I could get a taste myself."
		<<elseif $assistantAppearance is "goddess">>
			<<if $assistantName is "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They truly have the best of both worlds."
		<<elseif $assistantAppearance is "hypergoddess">>
			<<if $assistantName is "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> pauses and then says seriously, "They truly have the best of both worlds."
		<<elseif $assistantAppearance is "loli">>
			<<if $assistantName is "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 is "preggololi">>
			<<if $assistantName is "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 is "schoolgirl">>
			<<if $assistantName is "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 is "TSS") || ($RESMove is "SCP)") || ($RESMove is "LDE") || ($RESMove is "TGA")>>
	school's
<<elseif $RESMove is "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 is "TSS">>
			<<set $TSS.schoolPresent to 1>>
		<<elseif $RESMove is "GRI">>
			<<set $GRI.schoolPresent to 1>>
		<<elseif $RESMove is "SCP">>
			<<set $SCP.schoolPresent to 1>>
		<<elseif $RESMove is "LDE">>
			<<set $LDE.schoolPresent to 1>>
		<<elseif $RESMove is "TGA">>
			<<set $TGA.schoolPresent to 1>>
		<<else>>
			<<set $TFS.schoolPresent to 1>>
		<</if>>
	<</replace>>
<</link>> <<if ($RESMove is "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>>

repo_name: DankWolf/fc


code:
:: RES Sale

<<nobr>>

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

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

You receive a personal call from
<<if $RESSale is "TSS">>
	The Slavegirl School, a rising slave training organization known for its reliably unremarkable products, offered at a competitive price.
<<elseif $RESSale is "GRI">>
	The Growth Research Institute, a drug development group breaking new ground on human experimentation.
<<elseif $RESSale is "SCP">>
	St. Claver Preparatory, an unusual combination of slave school and implant surgery training institution.
<<elseif $RESSale is "LDE">>
	L'Ecole des Enculees, an innovative slave school making new and interesting developments in sodomy.
<<elseif $RESSale is "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 is "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 is "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 is "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 is "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 is "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 is "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 is "TSS") || ($RESSale is "SCP")>>
		"And I would love to
		<<if $assistantAppearance is "monstergirl">>
			break both her virgin holes at once," the monstergirl exclaims, and shakes her dicks for emphasis.
		<<elseif $assistantAppearance is "shemale">>
			wreck her virgin asshole," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance is "amazon">>
			fist her virgin cunt," the amazon exclaims, and helpfully raises the fist in question.
		<<elseif $assistantAppearance is "businesswoman">>
			sell her fresh pussy to the highest bidder," the businesswoman exclaims.
		<<elseif $assistantAppearance is "fairy">>
			play with her clit and lap up those sweet virgin juices!" the fairy exclaims, licking her lips.
		<<elseif $assistantAppearance is "pregnant fairy">>
			play with her clit and lap up those sweet motherly juices!" the fairy exclaims, licking her lips.
		<<elseif $assistantAppearance is "goddess">>
			teach her all about being a real woman," the goddess exclaims, rubbing her belly in anticipation.
		<<elseif $assistantAppearance is "hypergoddess">>
			teach her all about being a real woman," the goddess exclaims, rubbing her massive belly in anticipation.
		<<elseif $assistantAppearance is "loli">>
			play with her!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance is "preggololi">>
			play with her!"  The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance is "schoolgirl">>
			make out with her. She's cute!" the schoolgirl exclaims.
		<<else>>
			fuck her virgin holes," she says.
		<</if>>
	<<elseif $RESSale is "GRI">>
		"And I would love to
		<<if $assistantAppearance is "monstergirl">>
			get my tentacles on those tits," the monstergirl exclaims.
		<<elseif $assistantAppearance is "shemale">>
			fuck those titties," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance is "amazon">>
			put her out to pasture," the amazon exclaims, indicating the skin of milk on her belt.
		<<elseif $assistantAppearance is "businesswoman">>
			put that cow in the dairy," the businesswoman exclaims.
		<<elseif $assistantAppearance is "fairy">>
			bounce on those nipples until they fill me with milk!" the fairy exclaims, rubbing her belly.
		<<elseif $assistantAppearance is "pregnant fairy">>
			bounce on those nipples until my babies are fed!" the fairy exclaims, rubbing her swollen belly.
		<<elseif $assistantAppearance is "goddess">>
			taste those bountiful breasts," the goddess exclaims, licking her lips.
		<<elseif $assistantAppearance is "hypergoddess">>
			taste those bountiful breasts," the goddess exclaims, licking her lips.
		<<elseif $assistantAppearance is "loli">>
			play with her tits!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance is "preggololi">>
			play with her tits!"  The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance is "schoolgirl">>
			suck on those titties!" the schoolgirl exclaims.
		<<else>>
			make those breasts bounce," she says.
		<</if>>
	<<elseif $RESSale is "LDE">>
		"And I would love to
		<<if $assistantAppearance is "monstergirl">>
			shove both my cocks up there," the monstergirl exclaims.
		<<elseif $assistantAppearance is "shemale">>
			fuck that butt even bigger," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance is "amazon">>
			fist that butthole," the amazon exclaims, and helpfully raises the fist in question.
		<<elseif $assistantAppearance is "businesswoman">>
			see how many customers that asshole can bear," the businesswoman exclaims.
		<<elseif $assistantAppearance is "fairy">>
			use that butt as a pillow!," the fairy exclaims.
		<<elseif $assistantAppearance is "pregnant fairy">>
			see if I can impregnate her butt!," the fairy exclaims.
		<<elseif $assistantAppearance is "goddess">>
			see just how obedient she really is," the goddess exclaims, flexing a hand for emphasis.
		<<elseif $assistantAppearance is "hypergoddess">>
			see just how obedient she really is," the goddess exclaims, flexing a hand for emphasis.
		<<elseif $assistantAppearance is "loli">>
			play with her big butt!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance is "preggololi">>
			play with her big butt!"  The little girl exclaims happily while caressing her belly.
		<<elseif $assistantAppearance is "schoolgirl">>
			lick her big soft behind," the schoolgirl exclaims, and sticks out her tongue.
		<<else>>
			fuck that ass," she says.
		<</if>>
	<<elseif $RESSale is "TGA">>
		"And I would love to
		<<if $assistantAppearance is "monstergirl">>
			shove both my cocks up her virgin anus," the monstergirl exclaims.
		<<elseif $assistantAppearance is "shemale">>
			fuck that virgin asshole," the shemale exclaims, and starts to jack off.
		<<elseif $assistantAppearance is "amazon">>
			finger fuck her virgin ass," the amazon exclaims, and helpfully raises the fingers in question.
		<<elseif $assistantAppearance is "businesswoman">>
			sell her anal virginity to the highest bidder," the businesswoman exclaims.
		<<elseif $assistantAppearance is "fairy">>
			give the dick a great big hug and suckle out all the precum!" the fairy exclaims, rubbing her legs together.
		<<elseif $assistantAppearance is "pregnant fairy">>
			play meet the baby! ...Well, maybe just with you, <<if ($PC.title is 0)>>Big Sis.<<else>>Big Bro." the fairy exclaims, rubbing her legs together.
		<<elseif $assistantAppearance is "goddess">>
			see her put that dick to work," the goddess exclaims, one sultry finger at her lips.
		<<elseif $assistantAppearance is "hypergoddess">>
			see her put that dick to work," the goddess exclaims, one sultry finger at her lips.
		<<elseif $assistantAppearance is "loli">>
			play with her dick!"  The little girl exclaims happily while jumping up and down.
		<<elseif $assistantAppearance is "preggololi">>
			get that dick in me!"  The little girl exclaims happily while caressing her belly and licking her lips.
		<<elseif $assistantAppearance is "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 is "monstergirl">>
			 she shouts, dicks painfully erect.
		<<elseif $assistantAppearance is "shemale">>
			she shouts, cock painfully erect.
		<<elseif $assistantAppearance is "amazon">>
			she howls, and then adds more quietly, "A-and get fucked by futas."
		<<elseif $assistantAppearance is "businesswoman">>
			she exclaims, and then blushes furiously.
		<<elseif ($assistantAppearance is "fairy") or ($assistantAppearance is "pregnant fairy")>>
			she exclaims, flying circles around you.
		<<elseif $assistantAppearance is "goddess">>
			she exclaims, awestruck with anticipation.
		<<elseif $assistantAppearance is "hypergoddess">>
			she exclaims, awestruck with anticipation.
		<<elseif $assistantAppearance is "loli">>
			she exclaims, then blushes beet red when she realizes what she said.
		<<elseif $assistantAppearance is "preggololi">>
			she exclaims, rubbing her bulging belly with anticipation.
		<<elseif $assistantAppearance is "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

<<set $activeSlave = $slaves[$i], _ID = $activeSlave.ID>>
<<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 "Head Girl Suite">>
	<<set $activeSlave.assignment = "rest">>
<<case "Master Suite">>
	<<set $activeSlave.assignment = "please you">>
<<case "Clinic">>
	<<set $activeSlave.assignment = "rest">>
<<case "Spa">>
	<<set $activeSlave.assignment = "rest">>
<<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 $activeSlave.assignmentVisible = 1, $activeSlave.choosesOwnAssignment = 0, $slaves[$i] = $activeSlave>>
<</if>>
<<goto $returnTo>>


code:
:: RIE Eligibility Check

<<silently>>

<<set $eventSlave = 0>>

<<set $eligibleSlaves = []>>

<<for $i to 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 to $defaultRules.length-1; _r >= 0; _r-->>
	<<set _currentRule to $defaultRules[_r]>>
	<<if (def _currentRule) && (_currentRule.autoSurgery != 0)>>
		<<set $thisSurgery to _currentRule.surgery>>
		<<set _temp to lastLactationSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.lactation = _temp.surgery.lactation>>
		<</if>>
		<<set _temp to lastLipSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.lips = _temp.surgery.lips>>
		<</if>>
		<<set _temp to lastButtSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.butt = _temp.surgery.butt>>
		<</if>>
		<<set _temp to lastBoobSurgeryRule($slaves[$i], $defaultRules)>>
		<<if _temp != null>>
			<<set $thisSurgery.boobs = _temp.surgery.boobs>>
		<</if>>
		<<if ($thisSurgery.hips isnot "no default setting") && ($thisSurgery.butt isnot "no default setting")>>
			<<if $slaves[$i].hips < -1>>
				<<if $thisSurgery.butt > 2>>
					<<set $thisSurgery.butt to 2>>
				<</if>>
			<<elseif $slaves[$i].hips < 0>>
				<<if $thisSurgery.butt > 4>>
					<<set $thisSurgery.butt to 4>>
				<</if>>
			<<elseif $slaves[$i].hips > 0>>
				<<if $thisSurgery.butt > 8>>
					<<set $thisSurgery.butt to 8>>
				<</if>>
			<<elseif $slaves[$i].hips > 1>>
			<<else>>
				<<if $thisSurgery.butt > 6>>
					<<set $thisSurgery.butt to 6>>
				<</if>>
			<</if>>
		<</if>>
		<<break>>
	<</if>>
<</for>>
<<if ndef $thisSurgery>>
	<<set $thisSurgery to {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 to 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 to 0>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 2>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 3>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 3>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].faceImplant == 0) && ($slaves[$i].face < 3) && ($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 += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].ageImplant != 1) && ($slaves[$i].physicalAge >= 25) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("an age lift")>>
	<<set $slaves[$i].ageImplant to 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.career is "medicine">><<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.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].waist == 0) && ($thisSurgery.cosmetic != 0)>>
	<<set $surgeries.push("a narrower waist")>>
	<<set $slaves[$i].waist to 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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.career is "medicine">><<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.career is "medicine">><<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.career is "medicine">><<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 isnot "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.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].faceImplant == 1) && ($slaves[$i].face < 3) && ($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 += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].faceImplant > 0) && ($slaves[$i].face < 3) && ($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 += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
<<elseif ($slaves[$i].waist == 1) && ($thisSurgery.cosmetic is 2) && ($seeExtreme == 1)>>
	<<set $surgeries.push("a narrower waist")>>
	<<set $slaves[$i].waist to 2>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<set $slaves[$i].health -= 30.5>><<else>><<set $slaves[$i].health -= 4>><</if>>
<<elseif ($slaves[$i].voice < 3) && ($slaves[$i].voiceImplant == 0) && ($thisSurgery.cosmetic is 2)>>
	<<set $surgeries.push("a bimbo's voice")>>
	<<set $slaves[$i].voice += 1>>
	<<set $slaves[$i].voiceImplant += 1>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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.career is "medicine">><<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.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant to 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 400>>
		<<set $slaves[$i].boobs += 400>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">>
		<<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 isnot "no default setting">>
		<<set $surgeries.push("modestly bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 200>>
		<<set $slaves[$i].boobs += 200>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant to 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 400>>
		<<set $slaves[$i].boobs += 400>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<set $slaves[$i].health -= 5>><<else>><<set $slaves[$i].health -= 10>><</if>>
	<</if>>
<<elseif ($slaves[$i].anus > 0) && ($surgeryUpgrade == 1) && ($thisSurgery.holes is 2)>>
	<<set $surgeries.push("a virgin anus")>>
	<<set $slaves[$i].anus to 0>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 0>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 1>>
	<<if $slaves[$i].analSkill > 10>>
		<<set $slaves[$i].analSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 to 1>>
	<<if $slaves[$i].vaginalSkill > 10>>
		<<set $slaves[$i].vaginalSkill -= 10>>
	<</if>>
	<<set $cash -= $surgeryCost>>
	<<if $PC.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("a bigger butt")>>
		<<set $slaves[$i].buttImplant to 1>>
		<<set $slaves[$i].butt += 1>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<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 isnot "no default setting">>
		<<set $surgeries.push("bigger boobs")>>
		<<set $slaves[$i].boobsImplant += 200>>
		<<set $slaves[$i].boobs += 200>>
		<<set $cash -= $surgeryCost>>
		<<if $PC.career is "medicine">><<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 to "">>
	<<for $j to 0; $j < $surgeries.length; $j++>>
		<<set $seed to $surgeries[$j]>>
		<<set $surgeriesDisplay to ($surgeriesDisplay + $seed)>>
		<<if $j < $surgeries.length-2>>
		<<set $surgeriesDisplay to ($surgeriesDisplay + ", ")>>
		<<elseif $j < $surgeries.length-1>>
		<<if $surgeries.length > 2>>
			<<set $surgeriesDisplay to ($surgeriesDisplay + ", and ")>>
		<<else>>
			<<set $surgeriesDisplay to ($surgeriesDisplay + " and ")>>
		<</if>>
		<</if>>
	<</for>>
	<<if $assistantName is "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 is "work in the brothel">>
			<<if ($Madam == 0) || ($Madam.ID != $activeSlave.ID)>>
				<<set $activeSlave.assignment to _currentRule.removalAssignment>>
				<<set $activeSlave.assignmentVisible to 1>>

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

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

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

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

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

	<<case "arcade">>
		<<if $activeSlave.assignment is "be confined in the arcade">>
			<<set $activeSlave.assignment to _currentRule.removalAssignment>>
			<<set $activeSlave.assignmentVisible to 1>>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<</nobr>>


code:
:: Rules Slave Deselect Workaround

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


code:
:: Rules Slave Exclude

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

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

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

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


code:
:: Rules Slave Exclude Workaround

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


code:
:: Rules Slave NoExclude Workaround

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


code:
:: Rules Slave Select

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

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

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

	<<set $Flag to 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 to 0>>
	Apply rule $r to selected slaves:
	<<include "Slave Summary">>
<<else>>
	Rule $r currently applied to:
	<<set $Flag to 1>>
	<<include "Slave Summary">>

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

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


code:
:: Rules Slave Select Workaround

<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to "Rules Slave Select">>
	<<if !ruleSlaveSelected($activeSlave, $currentRule)>>
		<<set $currentRule.selectedSlaves.push($activeSlave.ID)>>
		<<if ruleSlaveExcluded($activeSlave, $currentRule)>>
			<<set $dump to $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 is $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 is $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 is $Concubine.ID>>
			<<if $slaves[$i].relationTarget is $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 is $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 is "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 is "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 is "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 is "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 to "Many citizens respect her long and able service as your Head Girl.">>
<</if>>
<</if>>