code:
:: Generate New Slave [nobr]

<<if (random(0,99) < $seeDicks)>>
	<<include "Generate XY Slave">>
<<elseif ($seeDicks > 0)>>
	<<if ($arcologies[0].FSGenderFundamentalistSMR == 1 || $arcologies[0].FSRepopulationFocusSMR == 1)>>
	<<set $seed = 90>>
	<<elseif ($arcologies[0].FSGenderRadicalist != "unset")>>
	<<set $seed = 50>>
	<<else>>
	<<set $seed = 80>>
	<</if>>
	<<if (random(1,100) > $seed) && (random(0,99) < $seeDicks)>>
	<<include "Generate XY Slave">>
	<<else>>
	<<include "Generate XX Slave">>
	<</if>>
<<else>>
	<<include "Generate XX Slave">>
<</if>>

repo_name: Drosil/fc

license: mit


code:
:: Generate XX Slave [nobr]

<<BaseSlave>>
/*missed variables - getting tired of this shit */
<<set $activeSlave.vaginaLube = 1, $activeSlave.ovaries = 1, $activeSlave.canRecruit = 1>>

<<if $activeSlaveOneTimeMaxAge > 998>>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
	<<else>>
		<<set $activeSlaveOneTimeMaxAge = 42>>
	<</if>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0 && $activeSlaveOneTimeMaxAge > 18>>
	<<set $activeSlaveOneTimeMaxAge = 18>>
<</if>>
<<if $retirementAge < $activeSlaveOneTimeMaxAge>>
	<<set $activeSlaveOneTimeMaxAge = ($retirementAge-1)>>
<</if>>
<<if $activeSlaveOneTimeMinAge < $minimumSlaveAge>>
	<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0>>
	<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<</if>>
<<if $activeSlaveOneTimeMaxAge < $activeSlaveOneTimeMinAge>>
	<<set $activeSlaveOneTimeMaxAge = $activeSlaveOneTimeMinAge>>
<</if>>
<<if ($activeSlaveOneTimeMaxAge >= 30) && ($FSMaturityPreferentialist != "unset")>>
	<<set $activeSlaveOneTimeMaxAge = ($activeSlaveOneTimeMaxAge + 10)>>
<</if>>
<<set $activeSlave.actualAge = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<set $activeSlaveOneTimeMinAge = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<if ($FSYouthPreferentialist != "unset") && ($FSYouthPreferentialist >= random (1, 100))>>
	<<set $activeSlave.actualAge = Math.min($activeSlave.actualAge, $activeSlaveOneTimeMinAge)>>
<<elseif ($FSMaturityPreferentialist != "unset") && ($FSMaturityPreferentialist >= random (1, 100))>>
	<<set $activeSlave.actualAge = Math.max($activeSlave.actualAge, $activeSlaveOneTimeMaxAge)>>
<</if>>
<<if $activeSlave.actualAge >= $retirementAge>>
	<<set $activeSlave.actualAge = ($retirementAge-2)>>
<</if>>
<<set $activeSlaveOneTimeMinAge = 0>>
<<set $activeSlaveOneTimeMaxAge = 999>>
<<set $one_time_age_overrides_pedo_mode = 0>>
<<set $activeSlave.visualAge = $activeSlave.actualAge>>
<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
<<set $activeSlave.age = $activeSlave.actualAge>> /*compatibility*/
<<set $activeSlave.pubertyAgeXX = $fertilityAge>>
<<if $activeSlave.ovaries == 1>>
	<<if $activeSlave.physicalAge >= $activeSlave.pubertyAgeXX>>
		<<set $activeSlave.pubertyXX = 1>>
	<<else>>
		<<set $activeSlave.pubertyXX = 0>>
	<</if>>
<<else>>
	<<set $activeSlave.pubertyXX = 0>>
<</if>>
<<set $activeSlave.pubertyAgeXY = $potencyAge>>
<<if $activeSlave.balls > 0>>
	<<if $activeSlave.physicalAge >= $activeSlave.pubertyAgeXY>>
		<<set $activeSlave.pubertyXY = 1>>
	<<else>>
		<<set $activeSlave.pubertyXY = 0>>
	<</if>>
<<else>>
	<<set $activeSlave.pubertyXY = 0>>
<</if>>

<<set $activeSlave.ID = $IDNumber++>>
<<set $activeSlave.weekAcquired = $week>>

<<set $seed = random(1,100)>>
<<if $seed > 98>>
	<<set $activeSlave.intelligence = 3>>
<<elseif $seed > 85>>
	<<set $activeSlave.intelligence = 2>>
<<elseif $seed > 65>>
	<<set $activeSlave.intelligence = 1>>
<<elseif $seed > 35>>
	<<set $activeSlave.intelligence = 0>>
<<elseif $seed > 15>>
	<<set $activeSlave.intelligence = -1>>
<<elseif $seed > 5>>
	<<set $activeSlave.intelligence = -2>>
<<else>>
	<<set $activeSlave.intelligence = -3>>
<</if>>
<<if random(1,100) < 50+(20*$activeSlave.intelligence)>>
	<<set $activeSlave.intelligenceImplant = 1>>
<</if>>

<<if $AgePenalty == 1>>
	<<if ($activeSlave.actualAge < 16)>>
		<<set $activeSlave.career = setup.veryYoungCareers.random()>>
	<<elseif ($activeSlave.actualAge <= 24)>>
		<<set $activeSlave.career = setup.youngCareers.random()>>
	<<elseif ($activeSlave.intelligenceImplant == 1)>>
		<<set $activeSlave.career = setup.educatedCareers.random()>>
	<<else>>
		<<set $activeSlave.career = setup.uneducatedCareers.random()>>
	<</if>>
<<else>>
	<<if ($activeSlave.actualAge < 16)>>
		<<set $activeSlave.career = setup.veryYoungCareers.random()>>
	<<elseif ($activeSlave.intelligenceImplant == 1)>>
		<<set $activeSlave.career = setup.educatedCareers.random()>>
	<<elseif ($activeSlave.actualAge <= 24)>>
		<<set $activeSlave.career = setup.youngCareers.random()>>
	<<else>>
		<<set $activeSlave.career = setup.uneducatedCareers.random()>>
	<</if>>
<</if>>

<<set $activeSlave.vaginalSkill = random(0,15)>>
<<set $activeSlave.analSkill = random(0,15)>>
<<set $activeSlave.oralSkill = random(0,15)>>
<<set $activeSlave.entertainSkill = random(0,15)>>
<<set $activeSlave.whoreSkill = random(0,15)>>

<<set $activeSlave.energy = random(1,85)>>
<<RandomizeAttraction>>
<<set $activeSlave.fetishStrength = random(0,90)>>
<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "submissive", "submissive", "cumslut", "humiliation", "humiliation", "buttslut", "boobs", "pregnancy", "dom", "sadist", "masochist")>>

<<set $activeSlave.behavioralFlaw = either("none", "none", "none", "arrogant", "bitchy", "odd", "hates men", "hates women", "hates women", "anorexic", "gluttonous", "devout", "liberated")>>
<<if ($activeSlave.behavioralFlaw is "devout")>>
	<<set $activeSlave.sexualFlaw = either("none", "repressed",  "shamefast", "apathetic", "crude", "judgemental")>>
<<else>>
	<<set $activeSlave.sexualFlaw = either("none", "none", "none", "none", "hates oral", "hates anal", "hates penetration", "repressed", "idealistic", "shamefast", "apathetic", "crude", "judgemental")>>
<</if>>
<<if ($activeSlave.behavioralFlaw == "none") && random(1,10) == 1>>
	<<set $activeSlave.behavioralQuirk = either("confident", "cutting", "funny", "adores women", "adores men", "fitness", "insecure", "sinful", "advocate")>>
<</if>>
<<if ($activeSlave.sexualFlaw == "none") && random(1,10) == 1>>
	<<set $activeSlave.sexualQuirk = either("gagfuck queen", "painal queen", "strugglefuck queen", "tease", "romantic", "perverted", "caring", "unflinching", "size queen")>>
<</if>>

<<set $activeSlave.health = random(-50,50)>>

<<set $activeSlave.devotion = random(-90,-60)>>
<<set $activeSlave.trust = random(-45,-25)>>

/% Begin height replacement section. %/
/% Since we use nationality for height effects we need to initialize it now instead of later on like in vanilla Free Cities. %/
<<if $fixedNationality == 0>>
	<<set $activeSlave.nationality = $nationalities.random()>>
<<else>>
	<<set $activeSlave.nationality = $fixedNationality>>
<</if>>
<<NationalityToRace $activeSlave>>
/* Corporate slavegen with race selection */
<<if passage() == "Corporate Market" && ($captureUpgradeRace != "unselected") && ($captureUpgradeRace != "none")>>
	<<if $captureUpgradeRace == "mixed race">>
		<<set $activeSlave.race = "mixed race">>
	<<else>>
		<<set _capUpgradeCheck = setup[$captureUpgradeRace.toLowerCase().replace(/[ -]/g, '')+'Nationalities']>>
		<<set _capUpgradeNationalities = []>>
		<<for _u = 0; _u < _capUpgradeCheck.length; _u++>>
			<<set _capNation = _capUpgradeCheck[_u]>>
			<<if $nationalities.includes(_capNation)>>
				<<set _capUpgradeNationalities.push(_capNation)>>
			<</if>>
		<</for>>
		<<if _capUpgradeNationalities.length > 0>>
			<<set $activeSlave.nationality = _capUpgradeNationalities.random(), $activeSlave.race = $captureUpgradeRace>>
		<<else>>
			<<set $activeSlave.nationality = _capUpgradeCheck.random(), $activeSlave.race = $captureUpgradeRace>>
		<</if>>
	<</if>>
	<<if $activeSlave.race != $captureUpgradeRace>>
		<<set $activeSlave.race = $captureUpgradeRace>>
	<</if>>
<</if>>
/*end Corporate slavegen with race selection */
<<NationalityToName $activeSlave>>
<<NationalityToAccent $activeSlave>>

<<set $activeSlave.height = Math.round(Height.random($activeSlave))>>

<<if $activeSlave.height >= Height.mean($activeSlave) * 170/162.5>>
	<<set $activeSlave.hips = either(-1, 0, 0, 1, 1, 2, 2)>>
	<<set $activeSlave.shoulders = either(-1, -1, 0, 0, 0, 1)>>
<<else>>
	<<set $activeSlave.hips = either(-1, 0, 0, 0, 1, 1, 2)>>
	<<set $activeSlave.shoulders = either(-2, -1, -1, 0, 0, 1)>>
<</if>>
/% End height replacement section. %/

<<set $activeSlave.weight = random(-100,180)>>
<<if ($activeSlave.weight < -30)>>
	<<set $activeSlave.waist = random(-55,0)>>
<<elseif ($activeSlave.weight <= 30)>>
	<<set $activeSlave.waist = random(-45,45)>>
<<elseif $activeSlave.physicalAge < 13>>
	<<set $activeSlave.waist = random(-25,25)>>
<<elseif ($activeSlave.weight <= 160)>>
	<<set $activeSlave.waist = random(0,55)>>
<<else>>
	<<set $activeSlave.waist = random(50,100)>>
<</if>>

<<if ($activeSlave.physicalAge > random(0,100))>>
	<<set $activeSlave.eyes = -1>>
	<<if random(0,100) > 90>>
		<<set $activeSlave.eyes = -2>>
	<</if>>
<</if>>

<<if ($activeSlave.intelligenceImplant == 1) && ($activeSlave.accent >= 3) && (3+$activeSlave.intelligence) > random(0, 6)>>
	<<set $activeSlave.accent -= 1>>
<</if>>

<<set $seed = 4+$activeSlave.intelligence+$activeSlave.intelligenceImplant>>
<<if "American" == $activeSlave.nationality>>
	<<set $seed += 2>>
<<elseif ["Australian", "Austrian", "Belgian", "British", "Canadian", "Czech", "Danish", "Dutch", "Estonian", "Finnish", "French", "German", "Hungarian", "Icelandic", "Irish", "Israeli", "Italian", "Japanese", "Korean", "Lithuanian", "a New Zealander", "Norwegian", "Polish", "Portuguese", "Romanian", "Slovak", "Spanish", "Swedish", "Swiss"].includes($activeSlave.nationality)>>
<<else>>
	<<set $seed -= 2>>
<</if>>
<<if random(1,$seed) == 1>>
	<<set $activeSlave.teeth = "crooked">>
<</if>>

<<switch $activeSlave.race>>
<<case "black">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3, 4, 4)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(150)>>
	<<set $activeSlave.lips = random(5,30)>>
	<<set $activeSlave.skin = either("black", "brown", "light brown")>>
	<<set $activeSlave.hColor = either("black", "black", "black", "brown")>>
	<<set $activeSlave.hStyle = either("neat", "crinkled")>>
<<case "white">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3, 4)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(50)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<if $activeSlave.nationality == "German">>
		<<set $activeSlave.skin = either("pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "blue", "blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "blonde", "blonde", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Icelandic">>
		<<set $activeSlave.skin = either("pale", "pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "blue", "blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "blonde", "blonde", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Irish">>
		<<set $activeSlave.skin = either("pale", "pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "green", "green", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "red", "red", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Scottish">>
		<<set $activeSlave.skin = either("pale", "fair", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "brown", "green", "green", "green")>>
		<<set $activeSlave.hColor = either("black", "black", "blonde", "red", "red", "red", "brown")>>
	<<else>>
		<<set $activeSlave.skin = either("pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "red", "brown")>>
	<</if>>
	<<set $activeSlave.hStyle = "neat">>
<<case "latina">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3, 4)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(0)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("olive", "brown", "light brown")>>
	<<set $activeSlave.hColor = either("black", "black", "brown", "brown")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "indo-aryan" "malay" "pacific islander" "amerindian">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(0)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("dark", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "asian">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(-100)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "middle eastern" "semitic" "southern european">>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(0)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<default>>
	<<set $activeSlave.butt = either(1, 2, 2, 3, 3, 4)>>
	<<set $activeSlave.boobs = BoobGenerator.rollBreast(0)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "light")>>
	<<set $activeSlave.hColor = either("black", "black", "black", "black", "brown", "brown", "blonde", "red")>>
	<<set $activeSlave.hStyle = "neat">>
<</switch>>
<<if ($activeSlave.skin == "pale") || ($activeSlave.skin == "fair")>>
	<<if random(1,4) == 1>>
	<<set $activeSlave.markings = either("freckles", "freckles", "freckles", "heavily freckled", "beauty mark", "beauty mark", "birthmark", "birthmark")>>
	<</if>>
<<elseif random(1,8) == 1>>
	<<set $activeSlave.markings = either("beauty mark", "birthmark")>>
<</if>>

<<set $activeSlave.origEye = $activeSlave.eyeColor>>
<<set $activeSlave.origHColor = $activeSlave.hColor>>
<<set $activeSlave.origSkin = $activeSlave.skin>>
<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
<<set $activeSlave.pubicHStyle = either("hairless", "bald", "bald", "waxed", "waxed", "waxed", "waxed", "waxed", "waxed", "in a strip", "in a strip", "in a strip", "in a strip", "in a strip", "neat", "neat", "neat", "neat", "neat", "bushy in the front and neat in the rear", "bushy in the front and neat in the rear", "bushy in the front and neat in the rear", "bushy in the front and neat in the rear", "bushy", "bushy", "bushy", "bushy", "bushy", "very bushy", "very bushy")>>
<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
<<set $activeSlave.underArmHStyle = either("hairless", "bald", "bald", "waxed", "waxed", "waxed", "waxed", "shaved", "shaved", "shaved", "shaved", "shaved", "neat", "neat", "neat", "neat", "neat", "bushy", "bushy", "bushy")>>
<<if ($activeSlave.pubicHStyle == "hairless" || $activeSlave.underArmHStyle == "hairless") && random(1,100) > 40>>
	<<set $activeSlave.pubicHStyle = "hairless", $activeSlave.underArmHStyle = "hairless">>
<</if>>

/*LM*/
<<if ($activeSlave.physicalAge <= 10)>>
	<<set $activeSlave.boobs = either(100)>>
<<elseif ($activeSlave.physicalAge == 11)>>
	<<set $activeSlave.boobs = either(100, 100, 150, 150, 150, 300)>>
<<elseif ($activeSlave.physicalAge == 12)>>
	<<set $activeSlave.boobs = either(100, 100, 150, 150, 150, 200, 200, 300)>>
<<elseif ($activeSlave.physicalAge == 13)>>
	<<set $activeSlave.boobs = either(100, 150, 200, 200, 300, 300, 300, 400)>>
<<elseif ($activeSlave.physicalAge == 14)>>
	<<set $activeSlave.boobs = either(100 ,150, 200, 300, 300, 300, 350, 400, 400)>>
<<elseif ($activeSlave.physicalAge == 15)>>
	<<set $activeSlave.boobs = either(150 ,200, 300, 300, 300, 350, 350, 350, 400, 400, 450, 450)>>
<</if>>

<<if ($activeSlave.physicalAge <= 11)>>
	<<set $activeSlave.butt = either(1, 1, 1, 1, 1, 1, 1)>>
<<elseif ($activeSlave.physicalAge <= 12)>>
	<<set $activeSlave.butt = either(1, 1, 1, 1, 1, 2, 2)>>
<<elseif ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.butt = either(1, 1, 1, 1, 2, 2, 2)>>
<<elseif ($activeSlave.physicalAge <= 14)>>
	<<set $activeSlave.butt = either(1, 1, 1, 2, 2, 2, 3)>>
<<elseif ($activeSlave.physicalAge <= 15)>>
	<<set $activeSlave.butt = either(1, 1, 2, 2, 2, 2, 3)>>
<</if>>
/*end LM*/

<<if ($weightAffectsAssets != 0)>>
	<<if $activeSlave.weight < -10 && $activeSlave.butt > 1>>
		<<set $activeSlave.butt -= 1>>
	<<elseif $activeSlave.weight > 100 && $activeSlave.butt < 6>>
		<<set $activeSlave.butt += random(1,2)>>
	<<elseif $activeSlave.weight > 10 && $activeSlave.butt < 4>>
		<<set $activeSlave.butt += 1>>
	<</if>>

	<<if $activeSlave.weight < -10 && $activeSlave.boobs > 200>>
		<<set $activeSlave.boobs -= 100>>
	<<elseif $activeSlave.weight > 190 && $activeSlave.boobs < 3000>>
		<<set $activeSlave.boobs += (random(3,8)*100)>>
	<<elseif $activeSlave.weight > 160 && $activeSlave.boobs < 1500>>
		<<set $activeSlave.boobs += (random(2,6)*100)>>
	<<elseif $activeSlave.weight > 130 && $activeSlave.boobs < 1500>>
		<<set $activeSlave.boobs += (random(1,4)*100)>>
	<<elseif $activeSlave.weight > 95 && $activeSlave.boobs < 1200>>
		<<set $activeSlave.boobs += (random(1,3)*100)>>
	<<elseif $activeSlave.weight > 30 && $activeSlave.boobs < 1000>>
		<<set $activeSlave.boobs += 100>>
	<</if>>
<</if>>

<<set $seed = []>>
<<if $activeSlave.boobs > 250 && $activeSlave.boobs < 800>>
	<<set $seed.push("perky")>>
	<<set $seed.push("downward-facing")>>
<</if>>
<<if $activeSlave.boobs > 400 && $activeSlave.boobs < 1200>>
	<<set $seed.push("torpedo-shaped")>>
	<<set $seed.push("wide-set")>>
<</if>>
<<if $activeSlave.boobs > 800 && $activeSlave.physicalAge > random(10,50)>>
	<<set $seed.push("saggy")>>
<</if>>
<<if $seed.length == 1>>
	<<if random(1,2) != 1>>
	<<set $activeSlave.boobShape = $seed.random()>>
	<</if>>
<<elseif $seed.length > 1>>
	<<if random(1,3) != 1>>
	<<set $activeSlave.boobShape = $seed.random()>>
	<</if>>
<</if>>

<<set $activeSlave.earPiercing = either(0,1)>>
<<set $activeSlave.nosePiercing = either(0,0,0,1)>>
<<set $activeSlave.eyebrowPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.clitPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.lipsPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.navelPiercing = either(0,0,0,1)>>
<<set $activeSlave.nipplesPiercing = either(0,0,0,1)>>

<<set $activeSlave.face = random(-60,60)>>
<<if random(0,2) == 1>><<set $activeSlave.face = random(-10,10)>><</if>>
<<if $activeSlave.physicalAge > 40>>
	<<set $activeSlave.face -= random(0,20)>>
<<elseif $activeSlave.physicalAge > 35>>
	<<set $activeSlave.face -= random(0,10)>>
<<elseif $activeSlave.physicalAge <= 20>>
	<<set $activeSlave.face += random(0,20)>>
<<elseif $activeSlave.physicalAge <= 25>>
	<<set $activeSlave.face += random(0,10)>>
<</if>>
<<if $activeSlave.physicalAge > 10>>
	<<set $activeSlave.faceShape = either("androgynous", "cute", "sensual", "exotic", "normal", "normal")>>
<<else>>
	<<set $activeSlave.faceShape = either("androgynous", "androgynous", "cute", "cute", "sensual", "exotic", "normal", "normal")>>
<</if>>
<<switch $activeSlave.faceShape>>
<<case "sensual" "cute">>
	<<set $activeSlave.face += random(0,20)>>
<<case "exotic" "androgynous">>
	<<set $activeSlave.face += random(-10,10)>>
<<case "masculine">>
	<<set $activeSlave.face += random(-10,0)>>
<</switch>>

<<if $activeSlave.boobs < 250>>
	<<set $activeSlave.nipples = either("tiny", "tiny", "tiny", "tiny", "cute", "cute", "puffy", "partially inverted")>>
<<elseif $activeSlave.boobs < 500>>
	<<set $activeSlave.nipples = either("tiny", "cute", "cute", "cute", "puffy", "partially inverted")>>
<<elseif $activeSlave.boobs < 1000>>
	<<set $activeSlave.nipples = either("tiny", "cute", "cute", "cute", "puffy", "puffy", "partially inverted", "inverted")>>
<<else>>
	<<set $activeSlave.nipples = either("cute", "puffy", "partially inverted", "inverted", "huge")>>
<</if>>

<<set $activeSlave.vagina = either(0, 0, 1, 1, 1)>>
<<if $activeSlave.actualAge < 20>>
	<<set $activeSlave.vagina = either(0, 1)>>
<</if>>
<<if $activeSlave.actualAge > 30>>
	<<set $activeSlave.vagina = either(1, 1, 1, 1, 2)>>
<</if>>
<<if $activeSlave.vagina == 0>>
	<<set $activeSlave.vaginalSkill = 0>>
<</if>>
<<if $activeSlave.energy < random(1,80)>>
	<<set $activeSlave.vaginaLube = 0>>
<<elseif $activeSlave.physicalAge > random(35,60)>>
	<<set $activeSlave.vaginaLube = 0>>
<</if>>

<<set $activeSlave.clit = either(0, 0, 0, 0, 0, 0, 1, 1, 2)>>
<<set $activeSlave.labia = either(0, 0, 0, 1, 1, 1, 1, 2, 2, 3)>>
<<set $activeSlave.foreskin = random(0,4)>>

<<set $activeSlave.voice = either(1, 2, 2, 2, 2, 2, 2, 3, 3, 3)>>

<<set $activeSlave.anus = either(0, 0, 1, 1, 2)>>
<<set $activeSlave.analArea = $activeSlave.anus + either(0, 0, 0, 1)>>

<<if $activeSlave.anus == 0>>
	<<set $activeSlave.analSkill = 0>>
<<elseif random(1,4) == 1>>
	<<set $activeSlave.anusTat = "bleached">>
<</if>>

/%pedoshit%/
<<if $activeSlave.physicalAge <= 11>>
  <<set $activeSlave.hips = either(-2, -2, -1, -1, 0)>>
<<elseif $activeSlave.physicalAge <= 13>>
  <<set $activeSlave.hips = either(-2, -1, -1, 0, 1)>>
<</if>>
<<if $activeSlave.physicalAge <= 13>>
	<<set $activeSlave.vagina = either(0, 0, 0, 0, 0, 0, 0, 1)>>
<<elseif $activeSlave.physicalAge <= 15>>
	<<set $activeSlave.vagina = either(0, 0, 0, 0, 0, 1, 1)>>
<<elseif $activeSlave.physicalAge <= 17>>
	<<set $activeSlave.vagina = either(0, 0, 0, 1, 1, 1)>>
<</if>>

<<if $activeSlave.vagina == 0>>
	<<set $activeSlave.vaginalSkill = 0>>
<</if>>

<<if ($activeSlave.physicalAge <= 11)>>
	<<set $activeSlave.clit = either(0, 0, 0, 0, 0, 0, 0, 0, 1)>>
<<elseif ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.clit = either(0, 0, 0, 0, 0, 0, 0, 1, 1)>>
<<elseif ($activeSlave.physicalAge <= 15)>>
	<<set $activeSlave.clit = either(0, 0, 0, 0, 0, 0, 0, 1, 2)>>
<</if>>

<<if ($activeSlave.physicalAge <= 11)>>
	<<set $activeSlave.labia = either(0, 0, 0, 0, 0, 0, 0, 1, 1)>>
<<elseif ($activeSlave.physicalAge <= 12)>>
	<<set $activeSlave.labia = either(0, 0, 0, 0, 0, 0, 1, 1, 1)>>
<<elseif ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.labia = either(0, 0, 0, 0, 0, 1, 1, 1, 1)>>
<<elseif ($activeSlave.physicalAge <= 14)>>
	<<set $activeSlave.labia = either(0, 0, 0, 0, 1, 1, 1, 1, 2)>>
<<elseif ($activeSlave.physicalAge <= 15)>>
	<<set $activeSlave.labia = either(0, 0, 0, 1, 1, 1, 1, 2, 2)>>
<</if>>

<<if ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.voice = either(2, 2, 2, 3, 3, 3, 3, 3, 3)>>
<<elseif ($activeSlave.physicalAge <= 16)>>
	<<set $activeSlave.voice = either(2, 2, 2, 2, 2, 3, 3, 3, 3)>>
<</if>>

<<if passage() == "Slave Markets" && $slaveMarket == "corporate">>
	<<if ($captureUpgradeRace != "unselected") && ($captureUpgradeRace != "none")>>
	<<if $activeSlave.race != $captureUpgradeRace>>
        <<set $slaveMarket = "corporate">>
        <<goto "Slave Markets">>
	<</if>>
	<</if>>
<</if>>


code:
:: Generate XY Slave [nobr]

<<BaseSlave>>
/% Defaults that differ from the old template %/
<<set $activeSlave.genes = "XY", $activeSlave.hLength = 10, $activeSlave.prostate = 1, $activeSlave.canRecruit = 1>>

<<set $activeSlave.publicCount = 0>>
<<if $activeSlaveOneTimeMaxAge > 998>>
  <<if $pedo_mode == 1>>
    <<set $activeSlaveOneTimeMaxAge = 18>>
  <<else>>
    <<set $activeSlaveOneTimeMaxAge = 42>>
  <</if>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0 && $activeSlaveOneTimeMaxAge > 18>>
    <<set $activeSlaveOneTimeMaxAge = 18>>
<</if>>
<<if $retirementAge < $activeSlaveOneTimeMaxAge>>
    <<set $activeSlaveOneTimeMaxAge = ($retirementAge-1)>>
<</if>>
<<if $activeSlaveOneTimeMinAge < $minimumSlaveAge>>
  <<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0>>
  <<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<</if>>
<<if $activeSlaveOneTimeMaxAge < $activeSlaveOneTimeMinAge>>
  <<set $activeSlaveOneTimeMaxAge = $activeSlaveOneTimeMinAge>>
<</if>>
<<if ($activeSlaveOneTimeMaxAge >= 30) && ($FSMaturityPreferentialist != "unset")>>
  <<set $activeSlaveOneTimeMaxAge = ($activeSlaveOneTimeMaxAge + 10)>>
<</if>>
<<set $activeSlave.actualAge = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<set $activeSlaveOneTimeMinAge = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<if ($FSYouthPreferentialist != "unset") && ($FSYouthPreferentialist >= random (1, 100))>>
  <<set $activeSlave.actualAge = Math.min($activeSlave.actualAge, $activeSlaveOneTimeMinAge)>>
<<elseif ($FSMaturityPreferentialist != "unset") && ($FSMaturityPreferentialist >= random (1, 100))>>
  <<set $activeSlave.actualAge = Math.max($activeSlave.actualAge, $activeSlaveOneTimeMaxAge)>>
<</if>>
<<if $activeSlave.actualAge >= $retirementAge>>
	<<set $activeSlave.actualAge = ($retirementAge-2)>>
<</if>>
<<set $activeSlaveOneTimeMinAge = 0>>
<<set $activeSlaveOneTimeMaxAge = 999>>
<<set $one_time_age_overrides_pedo_mode = 0>>
<<set $activeSlave.visualAge = $activeSlave.actualAge>>
<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
<<set $activeSlave.age = $activeSlave.actualAge>> /*compatibility*/
<<set $activeSlave.pubertyAgeXX = $fertilityAge>>
<<if $activeSlave.ovaries == 1>>
	<<if $activeSlave.physicalAge >= $activeSlave.pubertyAgeXX>>
		<<set $activeSlave.pubertyXX = 1>>
	<<else>>
		<<set $activeSlave.pubertyXX = 0>>
	<</if>>
<<else>>
	<<set $activeSlave.pubertyXX = 0>>
<</if>>
<<set $activeSlave.ID = $IDNumber++>>
<<set $activeSlave.weekAcquired = $week>>

<<set $seed = random(1,100)>>
<<if $seed > 98>>
	<<set $activeSlave.intelligence = 3>>
<<elseif $seed > 85>>
	<<set $activeSlave.intelligence = 2>>
<<elseif $seed > 65>>
	<<set $activeSlave.intelligence = 1>>
<<elseif $seed > 35>>
	<<set $activeSlave.intelligence = 0>>
<<elseif $seed > 15>>
	<<set $activeSlave.intelligence = -1>>
<<elseif $seed > 5>>
	<<set $activeSlave.intelligence = -2>>
<<else>>
	<<set $activeSlave.intelligence = -3>>
<</if>>

<<if random(1,100) < 50+(20*$activeSlave.intelligence)>>
	<<set $activeSlave.intelligenceImplant = 1>>
<</if>>
<<if $AgePenalty == 1>>
	<<if ($activeSlave.actualAge < 16)>>
		<<set $activeSlave.career = setup.veryYoungCareers.random()>>
	<<elseif ($activeSlave.actualAge <= 24)>>
		<<set $activeSlave.career = setup.youngCareers.random()>>
	<<elseif ($activeSlave.intelligenceImplant == 1)>>
		<<set $activeSlave.career = setup.educatedCareers.random()>>
	<<else>>
		<<set $activeSlave.career = setup.uneducatedCareers.random()>>
	<</if>>
<<else>>
	<<if ($activeSlave.actualAge < 16)>>
		<<set $activeSlave.career = setup.veryYoungCareers.random()>>
	<<elseif ($activeSlave.intelligenceImplant == 1)>>
		<<set $activeSlave.career = setup.educatedCareers.random()>>
	<<elseif ($activeSlave.actualAge <= 24)>>
		<<set $activeSlave.career = setup.youngCareers.random()>>
	<<else>>
		<<set $activeSlave.career = setup.uneducatedCareers.random()>>
	<</if>>
<</if>>

<<set $activeSlave.vaginalSkill = 0>>
<<set $activeSlave.analSkill = random(0,15)>>
<<set $activeSlave.oralSkill = random(0,15)>>
<<set $activeSlave.entertainSkill = random(0,15)>>
<<set $activeSlave.whoreSkill = random(0,15)>>

<<set $activeSlave.energy = random(15,90)>>
<<RandomizeAttraction>>
<<set $activeSlave.fetishStrength = random(0,90)>>
<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "submissive", "cumslut", "humiliation", "buttslut", "buttslut", "boobs", "dom", "sadist", "masochist")>>

<<set $activeSlave.behavioralFlaw = either("none", "none", "none", "arrogant", "bitchy", "odd", "hates men", "hates men", "hates men", "hates women", "anorexic", "gluttonous", "devout", "liberated")>>
<<if ($activeSlave.behavioralFlaw is "devout")>>
	<<set $activeSlave.sexualFlaw = either("none", "repressed",  "shamefast", "apathetic", "crude", "judgemental")>>
<<else>>
	<<set $activeSlave.sexualFlaw = either("none", "none", "none", "none", "hates oral", "hates anal", "hates anal", "repressed", "idealistic", "shamefast", "apathetic", "crude", "judgemental")>>
<</if>>
<<if ($activeSlave.behavioralFlaw == "none") && random(1,10) == 1>>
	<<set $activeSlave.behavioralQuirk = either("confident", "cutting", "funny", "adores women", "adores men", "fitness", "insecure", "sinful", "advocate")>>
<</if>>
<<if ($activeSlave.sexualFlaw == "none") && random(1,10) == 1>>
	<<set $activeSlave.sexualQuirk = either("gagfuck queen", "painal queen", "strugglefuck queen", "tease", "romantic", "perverted", "caring", "unflinching", "size queen")>>
<</if>>

<<set $activeSlave.health = random(-50,50)>>

<<set $activeSlave.devotion = random(-90,-60)>>
<<set $activeSlave.trust = random(-45,-25)>>

/% Begin height replacement section. %/
<<if ($activeSlave.physicalAge > random(0,100))>>
	<<set $activeSlave.eyes = -1>>
	<<if random(0,100) > 90>>
		<<set $activeSlave.eyes = -2>>
	<</if>>
<</if>>

/% Since we use nationality for height effects we need to initialize it now instead of later on like in vanilla Free Cities. %/

<<if $fixedNationality == 0>>
	<<set $activeSlave.nationality = $nationalities.random()>>
<<else>>
	<<set $activeSlave.nationality = $fixedNationality>>
<</if>>
<<NationalityToRace $activeSlave>>
/* Corporate slavegen with race selection */
<<if passage() == "Corporate Market" && ($captureUpgradeRace != "unselected") && ($captureUpgradeRace != "none")>>
	<<if $captureUpgradeRace == "mixed race">>
		<<set $activeSlave.race = "mixed race">>
	<<else>>
		<<set _capUpgradeCheck = setup[$captureUpgradeRace.toLowerCase().replace(/[ -]/g, '')+'Nationalities']>>
		<<set _capUpgradeNationalities = []>>
		<<for _u = 0; _u < _capUpgradeCheck.length; _u++>>
			<<set _capNation = _capUpgradeCheck[_u]>>
			<<if $nationalities.includes(_capNation)>>
				<<set _capUpgradeNationalities.push(_capNation)>>
			<</if>>
		<</for>>
		<<if _capUpgradeNationalities.length > 0>>
			<<set $activeSlave.nationality = _capUpgradeNationalities.random(), $activeSlave.race = $captureUpgradeRace>>
		<<else>>
			<<set $activeSlave.nationality = _capUpgradeCheck.random(), $activeSlave.race = $captureUpgradeRace>>
		<</if>>
	<</if>>
	<<if $activeSlave.race != $captureUpgradeRace>>
		<<set $activeSlave.race = $captureUpgradeRace>>
	<</if>>
<</if>>
/* end Corporate slavegen with race selection */
<<NationalityToName $activeSlave>>
<<NationalityToAccent $activeSlave>>

<<set $activeSlave.height = Math.round(Height.random($activeSlave))>>
<<if $activeSlave.physicalAge <= 13>>
	<<if $activeSlave.height > Height.mean($activeSlave) * 170/172.5>>
	  <<set $activeSlave.hips = either(-2, -1, -1, 0, 1)>>
	  <<set $activeSlave.shoulders = either(-1, -1, 0, 0, 0, 1)>>
	<<else>>
	  <<set $activeSlave.hips = either(-2, -2, -1, -1, 0)>>
	  <<set $activeSlave.shoulders = either(-2, -1, -1, 0, 0, 1)>>
	<</if>>
<<else>>
	<<if $activeSlave.height >= Height.mean($activeSlave) * 170/172.5>>
		<<set $activeSlave.hips = either(-2, -1, -1, 0, 1)>>
		<<set $activeSlave.shoulders = either(-1, 0, 1, 1, 2, 2)>>
	<<else>>
		<<set $activeSlave.hips = either(-2, -2, -1, -1, 0)>>
		<<set $activeSlave.shoulders = either(-1, 0, 0, 1, 1, 2)>>
	<</if>>
<</if>>
/% End height replacement section. %/

<<set $activeSlave.weight = random(-100, 180)>>
<<if ($activeSlave.weight < -30)>>
	<<set $activeSlave.waist = random(-45,45)>>
<<elseif ($activeSlave.weight <= 30)>>
	<<set $activeSlave.waist = random(-15,65)>>
<<elseif $activeSlave.physicalAge < 13>>
	<<set $activeSlave.waist = random(-15,25)>>
<<elseif ($activeSlave.weight <= 160)>>
	<<set $activeSlave.waist = random(5,100)>>
<<else>>
	<<set $activeSlave.waist = random(50,100)>>
<</if>>

<<if ($activeSlave.intelligenceImplant == 1) && ($activeSlave.accent >= 3) && (3+$activeSlave.intelligence) > random(0,6)>>
	<<set $activeSlave.accent -= 1>>
<</if>>

<<set $seed = 4+$activeSlave.intelligence+$activeSlave.intelligenceImplant>>
<<if "American" == $activeSlave.nationality>>
	<<set $seed += 2>>
<<elseif ["Australian", "Austrian", "Belgian", "British", "Canadian", "Czech", "Danish", "Dutch", "Estonian", "Finnish", "French", "German", "Hungarian", "Icelandic", "Irish", "Israeli", "Italian", "Japanese", "Korean", "Lithuanian", "a New Zealander", "Norwegian", "Polish", "Portuguese", "Romanian", "Slovak", "Spanish", "Swedish", "Swiss"].includes($activeSlave.nationality)>>
<<else>>
	<<set $seed -= 2>>
<</if>>
<<if random(1,$seed) == 1>>
	<<set $activeSlave.teeth = "crooked">>
<</if>>

<<switch $activeSlave.race>>
<<case "black">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,30)>>
	<<set $activeSlave.skin = either("black", "brown", "light brown")>>
	<<set $activeSlave.hColor = either("black", "black", "black", "brown")>>
	<<set $activeSlave.hStyle = either("neat", "crinkled")>>
<<case "white">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<if $activeSlave.nationality == "German">>
		<<set $activeSlave.skin = either("pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "blue", "blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "blonde", "blonde", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Icelandic">>
		<<set $activeSlave.skin = either("pale", "pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "blue", "blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "blonde", "blonde", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Irish">>
		<<set $activeSlave.skin = either("pale", "pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "green", "green", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "red", "red", "red", "brown")>>
	<<elseif $activeSlave.nationality == "Scottish">>
		<<set $activeSlave.skin = either("pale", "fair", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "brown", "green", "green", "green")>>
		<<set $activeSlave.hColor = either("black", "black", "blonde", "red", "red", "red", "brown")>>
	<<else>>
		<<set $activeSlave.skin = either("pale", "tanned", "fair")>>
		<<set $activeSlave.eyeColor = either("blue", "brown", "green")>>
		<<set $activeSlave.hColor = either("black", "blonde", "red", "brown")>>
	<</if>>
	<<set $activeSlave.hStyle = "neat">>
<<case "latina">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("olive", "brown", "light brown", "tanned", "fair")>>
	<<set $activeSlave.hColor = either("black", "black", "brown", "brown")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "indo-aryan" "malay" "pacific islander" "amerindian">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("dark", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "asian">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<case "middle eastern" "semitic" "southern european">>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "tanned", "light")>>
	<<set $activeSlave.hColor = either("black")>>
	<<set $activeSlave.hStyle = "neat">>
<<default>>
	<<set $activeSlave.butt = either(1, 1, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200, 200, 300, 300, 400, 500)>>
	<<set $activeSlave.lips = random(5,25)>>
	<<set $activeSlave.skin = either("pale", "dark", "light")>>
	<<set $activeSlave.hColor = either("black", "black", "black", "black", "brown", "brown", "blonde", "red")>>
	<<set $activeSlave.hStyle = "neat">>
<</switch>>
<<if $activeSlave.physicalAge > 55>>
	<<if random(1,100) > 40>>
		<<set $activeSlave.hStyle = "bald", $activeSlave.bald = 1>>
	<</if>>
<</if>>
<<if ($activeSlave.skin == "pale") || ($activeSlave.skin == "fair")>>
	<<if random(1,4) == 1>>
	<<set $activeSlave.markings = either("freckles", "freckles", "freckles", "heavily freckled", "beauty mark", "beauty mark", "birthmark", "birthmark")>>
	<</if>>
<<elseif random(1,8) == 1>>
	<<set $activeSlave.markings = either("beauty mark", "birthmark")>>
<</if>>

<<set $activeSlave.origEye = $activeSlave.eyeColor>>
<<set $activeSlave.origHColor = $activeSlave.hColor>>
<<set $activeSlave.origSkin = $activeSlave.skin>>
<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
<<set $activeSlave.pubicHStyle = either("hairless", "bald", "bald", "waxed", "waxed", "waxed", "waxed", "waxed", "waxed", "in a strip", "in a strip", "in a strip", "neat", "neat", "neat", "neat", "neat", "neat", "bushy in the front and neat in the rear", "bushy in the front and neat in the rear", "bushy in the front and neat in the rear", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "very bushy", "very bushy")>>
<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
<<set $activeSlave.underArmHStyle = either("hairless", "bald", "bald", "waxed", "waxed", "waxed", "waxed", "shaved", "shaved", "shaved", "shaved", "shaved", "neat", "neat", "neat", "neat", "neat", "neat", "neat", "bushy", "bushy", "bushy", "bushy", "bushy")>>
<<if ($activeSlave.pubicHStyle == "hairless" || $activeSlave.underArmHStyle == "hairless") && random(1,100) > 40>>
	<<set $activeSlave.pubicHStyle = "hairless", $activeSlave.underArmHStyle = "hairless">>
<</if>>

<<if ($weightAffectsAssets != 0)>>
	<<if $activeSlave.weight < -10 && $activeSlave.butt > 1>>
		<<set $activeSlave.butt -= 1>>
	<<elseif $activeSlave.weight > 100 && $activeSlave.butt < 6>>
		<<set $activeSlave.butt += random(1,2)>>
	<<elseif $activeSlave.weight > 10 && $activeSlave.butt < 4>>
		<<set $activeSlave.butt += 1>>
	<</if>>

	<<if $activeSlave.weight < -10 && $activeSlave.boobs > 200>>
		<<set $activeSlave.boobs -= 100>>
	<<elseif $activeSlave.weight > 190 && $activeSlave.boobs < 3000>>
		<<set $activeSlave.boobs += (random(3,8)*100)>>
	<<elseif $activeSlave.weight > 160 && $activeSlave.boobs < 1500>>
		<<set $activeSlave.boobs += (random(2,6)*100)>>
	<<elseif $activeSlave.weight > 130 && $activeSlave.boobs < 1500>>
		<<set $activeSlave.boobs += (random(1,4)*100)>>
	<<elseif $activeSlave.weight > 95 && $activeSlave.boobs < 1200>>
		<<set $activeSlave.boobs += (random(1,3)*100)>>
	<<elseif $activeSlave.weight > 30 && $activeSlave.boobs < 1000>>
		<<set $activeSlave.boobs += 100>>
	<</if>>
<</if>>

<<set $seed = []>>
<<if $activeSlave.boobs > 250 && $activeSlave.boobs < 800>>
	<<set $seed.push("perky")>>
	<<set $seed.push("downward-facing")>>
<</if>>
<<if $activeSlave.boobs > 400 && $activeSlave.boobs < 1200>>
	<<set $seed.push("torpedo-shaped")>>
	<<set $seed.push("wide-set")>>
<</if>>
<<if $activeSlave.boobs > 800 && $activeSlave.physicalAge > random(10,50)>>
	<<set $seed.push("saggy")>>
<</if>>
<<if $seed.length == 1>>
	<<if random(1,2) != 1>>
	<<set $activeSlave.boobShape = $seed.random()>>
	<</if>>
<<elseif $seed.length > 1>>
	<<if random(1,3) != 1>>
	<<set $activeSlave.boobShape = $seed.random()>>
	<</if>>
<</if>>

<<set $activeSlave.earPiercing = either(0,0,0,1)>>
<<set $activeSlave.nosePiercing = either(0,0,0,0,1)>>
<<set $activeSlave.eyebrowPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.dickPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.lipsPiercing = either(0,0,0,0,0,1)>>
<<set $activeSlave.navelPiercing = either(0,0,0,0,1)>>
<<set $activeSlave.nipplesPiercing = either(0,0,0,0,1)>>

<<set $activeSlave.face = random(-70,20)>>
<<if random(0,2) == 1>><<set $activeSlave.face = random(-40,-10)>><</if>>
<<if $activeSlave.physicalAge > 40>>
	<<set $activeSlave.face -= random(0,20)>>
<<elseif $activeSlave.physicalAge > 35>>
	<<set $activeSlave.face -= random(0,10)>>
<<elseif $activeSlave.physicalAge <= 20>>
	<<set $activeSlave.face += random(0,20)>>
<<elseif $activeSlave.physicalAge <= 25>>
	<<set $activeSlave.face += random(0,10)>>
<</if>>
<<if $activeSlave.physicalAge >= 17>>
	<<set $activeSlave.faceShape = either("masculine", "masculine", "masculine", "androgynous")>>
<<elseif $activeSlave.physicalAge >= 15>>
	<<set $activeSlave.faceShape = either("masculine", "masculine", "masculine", "masculine", "masculine", "masculine", "masculine", "masculine", "androgynous", "sensual", "exotic", "normal")>>
<<elseif $activeSlave.physicalAge >= 13>>
	<<set $activeSlave.faceShape = either("masculine", "masculine", "masculine", "androgynous", "cute", "sensual", "exotic", "normal")>>
<<elseif $activeSlave.physicalAge >= 11>>
	<<set $activeSlave.faceShape = either("masculine", "androgynous", "cute", "sensual", "exotic", "normal", "normal")>>
<<else>>
	<<set $activeSlave.faceShape = either("androgynous", "androgynous", "cute", "cute", "sensual", "exotic", "normal", "normal")>>
<</if>>
<<switch $activeSlave.faceShape>>
<<case "sensual" "cute">>
	<<set $activeSlave.face += random(0,20)>>
<<case "exotic" "androgynous">>
	<<set $activeSlave.face += random(-10,10)>>
<<case "masculine">>
	<<set $activeSlave.face += random(-10,0)>>
<</switch>>

<<if $activeSlave.boobs < 250>>
	<<set $activeSlave.nipples = either("tiny", "tiny", "tiny", "tiny", "cute", "cute", "puffy", "partially inverted")>>
<<elseif $activeSlave.boobs < 500>>
	<<set $activeSlave.nipples = either("tiny", "cute", "cute", "cute", "puffy", "partially inverted")>>
<<elseif $activeSlave.boobs < 1000>>
	<<set $activeSlave.nipples = either("tiny", "cute", "cute", "cute", "puffy", "puffy", "partially inverted", "inverted")>>
<<else>>
	<<set $activeSlave.nipples = either("cute", "puffy", "partially inverted", "inverted", "huge")>>
<</if>>

<<set $activeSlave.vagina = -1>>
<<set $activeSlave.clit = 0>>
<<set $activeSlave.preg = 0>>

<<set $activeSlave.dick = either(1, 2, 2, 2, 3, 3, 3, 4, 4, 5)>>
<<if $seeExtreme == 1>>
	<<set $activeSlave.balls = either(0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5)>>
<<else>>
	<<set $activeSlave.balls = either(1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5)>>
<</if>>
<<set $activeSlave.scrotum = $activeSlave.balls>>

<<set $activeSlave.pubertyAgeXY = $potencyAge>>
<<if $activeSlave.balls > 0>>
	<<if $activeSlave.physicalAge >= $activeSlave.pubertyAgeXY>>
		<<set $activeSlave.pubertyXY = 1>>
	<<else>>
		<<set $activeSlave.pubertyXY = 0>>
	<</if>>
<<else>>
	<<set $activeSlave.pubertyXY = 0>>
<</if>>

/% Begin circumcision rate replacement section. %/
/% The default rate of 50% is wildly unrepresentative, and there is extreme regional variation. %/
/%
 What we want is the prevalence among newborns, since this game
 happens about 20 years in the future, but we'll use this lacking
 something better.
 https://pophealthmetrics.biomedcentral.com/articles/10.1186/s12963-016-0073-5
 Right now we mostly just break it down by country.
 It would be better to break it down by both country
 and race if statistics are available.
%/
<<if ($seeCircumcision == 0)>>
	<<set $activeSlave.foreskin = $activeSlave.dick + random(0,1)>>
<<else>>
	/% Temporarily use activeSlave.foreskin to store the chance of circumcision. %/
	<<switch $activeSlave.nationality>>
	<<case "Iranian" "Moroccan" "Afghan" "Tunisian">>
		<<set $activeSlave.foreskin = 100>>
	<<case "Turkish" "Nigerian" "Iraqi" "Yemeni" "Jordanian" "Gabonese" "Tajik">>
		<<set $activeSlave.foreskin = 99>>
	<<case "Algerian" "Maldivian" "Azerbaijani">>
		<<set $activeSlave.foreskin = 98>>
	<<case "Saudi" "Uzbek" "Libyan" "Djiboutian">>
		<<set $activeSlave.foreskin = 97>>
	<<case "Congolese" "Pakistani" "Nigerien" "Turkmen">>
		/% Population-weighted average of Democratic Republic of Congo and Republic of Congo %/
		<<set $activeSlave.foreskin = 96>>
	<<case "Egyptian" "Tuvaluan" "Malagasy" "Nauruan" "a Cook Islander" "Niuean" "Palauan" "Samoan" "a Solomon Islander" "Tongan" "Ni-Vanuatu">>
		<<set $activeSlave.foreskin = 95>>
	<<case "Cameroonian">>
		<<set $activeSlave.foreskin = 94>>
	<<case "Indonesian" "Bangladeshi" "Syrian">>
		<<set $activeSlave.foreskin = 93>>
	<<case "Israeli" "Ghanan" "Ethiopian" "Filipina" "Kosovan">>
		<<set $activeSlave.foreskin = 92>>
	<<case "Kenyan" "Kyrgyz" "Palestinian">>
		<<set $activeSlave.foreskin = 91>>
	<<case "Omani">>
		<<set $activeSlave.foreskin = 88>>
	<<case "Malian" "Kuwaiti">>
		<<set $activeSlave.foreskin = 86>>
	<<case "Bahraini">>
		<<set $activeSlave.foreskin = 81>>
	<<case "American" "Qatari">>
		<<set $activeSlave.foreskin = 77>>
	<<case "Emirati">>
		<<set $activeSlave.foreskin = 76>>
	<<case "Tanzanian">>
		<<set $activeSlave.foreskin = 72>>
	<<case "Malaysian" "Burundian">>
		<<set $activeSlave.foreskin = 61>>
	<<case "Lebanese">>
		<<set $activeSlave.foreskin = 60>>
	<<case "Kazakh" "Fijian">>
		<<set $activeSlave.foreskin = 56>>
	<<case "Korean" "Bruneian">>
		/% Population-weighted average of South Korea and North Korea. %/
		<<set $activeSlave.foreskin = 52>>
	<<case "Albanian">>
		<<set $activeSlave.foreskin = 48>>
	<<case "South African">>
		<<set $activeSlave.foreskin = 45>>
	<<case "Dominican">>
		<<set $activeSlave.foreskin = 43>>
	<<case "Bosnian">>
		<<set $activeSlave.foreskin = 42>>
	<<case "Mexican">>
		<<set $activeSlave.foreskin = 38>>
	<<case "Sudanese">>
		/% Population-weighted average of Sudan and South Sudan. %/
		<<set $activeSlave.foreskin = 36>>
	<<case "Macedonian">>
		<<set $activeSlave.foreskin = 34>>
	<<case "a New Zealander">>
		<<set $activeSlave.foreskin = 33>>
	<<case "Scottish">>
		<<set $activeSlave.foreskin = 28>>
	<<case "Ugandan" "Australian">>
		<<set $activeSlave.foreskin = 27>>
	<<case "Belgian" "Thai" "Cypriot">>
		<<set $activeSlave.foreskin = 23>>
	<<case "British">>
		<<set $activeSlave.foreskin = 21>>
	<<case "Puerto Rican">>
		<<set $activeSlave.foreskin = 20>>
	<<case "Montenegrin">>
		<<set $activeSlave.foreskin = 19>>
	<<case "Singaporean" "Surinamese">>
		<<set $activeSlave.foreskin = 15>>
	<<case "Jamaican" "French" "Chinese" "Indian">>
		<<set $activeSlave.foreskin = 14>>
	<<case "Zambian" "Bulgarian">>
		<<set $activeSlave.foreskin = 13>>
	<<case "Russian" "French Guianan" "Guyanese">>
		<<set $activeSlave.foreskin = 12>>
	<<case "German">>
		<<set $activeSlave.foreskin = 11>>
	<<case "Belarusian" "Georgian" "Papua New Guinean">>
		<<set $activeSlave.foreskin = 10>>
	<<case "Zimbabwean" "Japanese">>
		<<set $activeSlave.foreskin = 9>>
	<<case "Taiwanese" "Slovene" "Sri Lankan">>
		<<set $activeSlave.foreskin = 8>>
	<<case "Haitian" "Spanish">>
		<<set $activeSlave.foreskin = 7>>
	<<case "Dutch" "Austrian" "Swiss" "East Timorese" "Trinidadian">>
		<<set $activeSlave.foreskin = 6>>
	<<case "Danish" "Swedish" "Greek" "a Liechtensteiner">>
		<<set $activeSlave.foreskin = 5>>
	<<case "Peruvian" "Serbian" "Nepalese" "Burmese" "Cambodian" "Mongolian">>
		<<set $activeSlave.foreskin = 4>>
	<<case "Italian" "Norwegian" "Argentinian">>
		<<set $activeSlave.foreskin = 3>>
	<<case "Ukrainian" "Luxembourgian" "Vincentian">>
		<<set $activeSlave.foreskin = 2>>
	<<case "Portuguese" "Hungarian" "Irish" "Finnish" "Brazilian" "Bermudian" "Uruguayan" "Monégasque" "Andorran" "Croatian" "Moldovan" "Panamanian" "Barbadian" "Bhutanese" "Seychellois">>
			<<set $activeSlave.foreskin = 1>>
	<<case 	"Cuban" "Guatemalan" "Chilean" "Bolivian" "Venezuelan" "Lithuanian" "Slovak" "Czech" "Romanian" "Estonian" "Icelandic" "Polish" "Colombian"
			"Armenian" "Vietnamese" "Sammarinese" "Marshallese" "Greenlandic" "Belizean" "Costa Rican" "Salvadoran" "Micronesian" "Grenadian" "Honduran"
			"I-Kiribati" "Laotian" "Maltese" "Nicaraguan" "Antiguan" "Bahamian" "Dominiquais" "Ecuadorian" "Latvian" "Paraguayan" "Kittitian" "Vatican"
			"Saint Lucian">>
		<<set $activeSlave.foreskin = 0>>
	<<default>>
		/% Some overlooked country, or possibly stateless. Use global average. %/
		<<set $activeSlave.foreskin = 38>>
	<</switch>>
	/% Second pass for minorities in other countries. %/
	<<if ($activeSlave.race == "middle eastern") && ($activeSlave.foreskin < 76)>>
		<<set $activeSlave.foreskin = 76>>
	<</if>>
	<<if ($activeSlave.race == "semitic") && ($activeSlave.foreskin < 90)>>
		<<set $activeSlave.foreskin = 90>>
	<</if>>
	/% Chance activeSlave.foreskin back to the normal meaning. %/
	<<if (random(0,99) < $activeSlave.foreskin)>>
		<<set $activeSlave.foreskin = 0>>
	<<else>>
		<<set $activeSlave.foreskin = $activeSlave.dick + random(0,1)>>
	<</if>>
<</if>>
/% End circumcision rate replacement section. %/
<<if $activeSlave.balls == 0>>
	<<if random(0,1) == 1 && $activeSlave.faceShape == "masculine">>
		<<set $activeSlave.faceShape = either("androgynous", "cute")>>
	<</if>>
<<else>>
	<<set $activeSlave.scrotum = $activeSlave.balls + either(0, 0, 1)>>
<</if>>

<<if $activeSlave.balls > 2>>
	<<set $activeSlave.voice = 1>>
<<elseif $activeSlave.balls > 0>>
	<<set $activeSlave.voice = either(1, 1, 2)>>
<<else>>
	<<set $activeSlave.voice = either(1, 2, 2)>>
<</if>>

<<if $activeSlave.attrXY > 0>>
	<<set $activeSlave.anus = either(0, 1, 2)>>
<<else>>
	<<set $activeSlave.anus = either(0, 0, 0, 1, 1, 2)>>
<</if>>
<<set $activeSlave.analArea = $activeSlave.anus + either(0, 0, 0, 1)>>

<<if $activeSlave.anus == 0>>
	<<set $activeSlave.analSkill = 0>>
<<elseif random(1,4) == 1>>
	<<set $activeSlave.anusTat = "bleached">>
<</if>>

/%pedoshit%/
<<if $activeSlave.physicalAge <= 13>>
	<<set $activeSlave.dick = either(1, 1, 1, 1, 2, 2, 2, 3)>>
	<<set $activeSlave.balls = either(0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3)>>
	<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<set $activeSlave.anus = either(0, 0, 0, 0, 0, 1)>>
<<elseif $activeSlave.physicalAge <= 15>>
	<<set $activeSlave.dick = either(1, 1, 1, 2, 2, 2, 3)>>
	<<set $activeSlave.balls = either(0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4)>>
	<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<set $activeSlave.anus = either(0, 0, 0, 0, 1, 1, 1)>>
<<elseif $activeSlave.physicalAge <= 17>>
	<<set $activeSlave.dick = either(1, 1, 2, 2, 3, 3)>>
	<<set $activeSlave.balls = either(0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5)>>
	<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<set $activeSlave.anus = either(0, 0, 0, 1, 1, 1)>>
<</if>>

<<if ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.butt = either(1, 1, 1, 2, 2, 3, 3, 4)>>
<</if>>

<<if ($activeSlave.physicalAge <= 11)>>
	<<set $activeSlave.voice = either(2, 2, 2, 3, 3, 3, 3, 3, 3)>>
<<elseif ($activeSlave.physicalAge <= 13)>>
	<<set $activeSlave.voice = either(1, 1, 2, 2, 2, 2, 2, 3, 3)>>
<<elseif ($activeSlave.physicalAge <= 16)>>
	<<set $activeSlave.voice = either(1, 1, 1, 2, 2, 2, 2, 2, 3)>>
<</if>>

<<if $activeSlave.actualAge >= 18 && random(1,100) < 3>>
	<<set $activeSlave.vasectomy = 1>>
<</if>>

<<if passage() == "Slave Markets" && $slaveMarket == "corporate">>
	<<if ($captureUpgradeRace != "unselected") && ($captureUpgradeRace != "none")>>
	<<if $activeSlave.race != $captureUpgradeRace>>
        <<set $slaveMarket = "corporate">>
        <<goto "Slave Markets">>
	<</if>>
	<</if>>
<</if>>


code:
:: Growth Research Institute [nobr]

<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $showEncyclopedia = 1, $encyclopedia = "Slave Schools">>
/* Multi-Purchase Support */
<<if ndef $newSlaves>><<set $newSlaves = []>><</if>>
<<if $newSlaves.length > 0>>
	<<set $nextButton = "Continue", $nextLink = "Bulk Slave Intro", $slaveMarket = "GRI", $returnTo = "Main", $newSlaveIndex = 0>>
<</if>>

//The Growth Research Institute (GRI) is not primarily a slave school at all, but rather the world leader in female growth hormone development. It operates research centers in the Free Cities to avoid traditional medical research laws. GRI runs several slave schools to raise healthy, unmodified subjects for use in trials. After a year of experimental hormone treatment they are sold. <<if $GRI.schoolUpgrade != 0>>

You have endowed <<if $GRI.schoolUpgrade == 1>>a research focus on advanced curatives, most subjects now leave the GRI at unnatural levels of vitality.<<else>>a research focus on milk production, subjects' breasts are bigger and milkier than ever.<</if>> As a major <<if $PC.title == 0>>benefactrix<<else>>benefactor<</if>> of the institution, you also receive a discount on them.<</if>>//

GRI offers a fresh graduate for inspection via video call. The interview takes place in the graduate's bare-metal holding cell. Disturbingly, it is strongly reminiscent of an enclosure for a lab animal, only scaled up to contain a lab animal of human dimensions.

<<GenerateMarketSlave "GRI">>
<<slaveCost $activeSlave>>
<<if $GRI.schoolSale != 0>>
	<<set $slaveCost = Math.trunc($slaveCost*0.5)>>
<<elseif $GRI.schoolUpgrade != 0>>
	<<set $slaveCost = Math.trunc($slaveCost*0.8)>>
<</if>>
<<if $slavesSeen > $slaveMarketLimit>><<set $slaveCost += Math.trunc($slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1))>><</if>>

The price is ¤<<print $slaveCost>>.<<if $slavesSeen > $slaveMarketLimit>> You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.<</if>>

<<if $cash >= $slaveCost>>

[[Buy her and check out other slaves to order|Growth Research Institute][$cash -= $slaveCost, $GRI.schoolSale = 0, $GRI.studentsBought += 1, $newSlaves.push($activeSlave), $introType = "multi", $slavesSeen+=1]]
	<<if $newSlaves.length == 0>>

[[Buy her slave contract|New Slave Intro][$cash -= $slaveCost, $GRI.schoolSale = 0, $GRI.studentsBought += 1, $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Main"]]
	<<else>>

[[Buy her and Finish your order of slaves|Bulk Slave Intro][$cash -= $slaveCost, $GRI.schoolSale = 0, $GRI.studentsBought += 1, $newSlaves.push($activeSlave)]]
	<</if>>
<<else>>
	//You lack the necessary funds to buy this slave.//
<</if>>

[[Decline to purchase her and check out another slave|Growth Research Institute][$slavesSeen += 1]]
<<if $newSlaves.length > 0>>

[[Finish your order of slaves|Bulk Slave Intro]]
<</if>>

<<set $saleDescription = 1>><<include "Long Slave Description">>


code:
:: Head Girl Suite [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Head Girl Suite", $showEncyclopedia = 1, $encyclopedia = "Head Girl Suite", $HGSuiteSlaves = $HGSuiteiIDs.length, _SL = $slaves.length>>
<<showallAssignmentFilter>>
<<if $HGSuiteName != "the Head Girl Suite">>
	<<set $HGSuiteNameCaps = $HGSuiteName.replace("the ", "The ")>>
<</if>>

<<set _i = $slaves.findIndex(function(s) { return s.assignment == "live with your Head Girl"; })>>

<<if $HeadGirl == 0>>
	You have no Head Girl appointed to live in $HGSuiteName.
<<elseif $HGSuiteSlaves > 0>>
	Your Head Girl $HeadGirl.slaveName has $slaves[_i].slaveName living in $HGSuiteName with her, as her servant, assistant, and sexual appliance.
<<else>>
	Your Head Girl $HeadGirl.slaveName lives alone in her handsome suite.
<</if>>

//Any slave assigned to live with your Head Girl will become, for most practical purposes, her slave.//

<<if $HGSuiteEquality == 1>>
	The two slaves living in $HGSuiteName are ''equals,'' and will alternate weeks as Head Girl and Head Girl's bitch. [[Stop|Head Girl Suite][$HGSuiteEquality = 0]]
<<else>>
	The current Head Girl will ''remain Head Girl.'' [[Have them alternate|Head Girl Suite][$HGSuiteEquality = 1,$HGSuiteSurgery = 0,$HGSuiteDrugs = 0,$HGSuiteHormones = 0]] //This will only take effect if the other girl is an appropriate candidate//

	<<if $HGSuiteSurgery == 1>>
	She is ''allowed'' to use surgical modification on her slave. [[Disallow|Head Girl Suite][$HGSuiteSurgery = 0]]
	<<else>>
	She is ''not allowed'' to use surgical modification on her slave. [[Allow|Head Girl Suite][$HGSuiteSurgery = 1]]
	<</if>>

	<<if $HGSuiteDrugs == 1>>
	She is ''allowed'' to use growth hormones on her slave. [[Disallow|Head Girl Suite][$HGSuiteDrugs = 0]]
	<<else>>
	She is ''not allowed'' to use growth hormones on her slave. [[Allow|Head Girl Suite][$HGSuiteDrugs = 1]]
	<</if>>

	<<if $HGSuiteHormones == 1>>
	She is ''allowed'' to customize her slave with hormone treatments. [[Disallow|Head Girl Suite][$HGSuiteHormones = 0]]
	<<else>>
	She is ''not allowed'' to customize her slave with hormone treatments. [[Allow|Head Girl Suite][$HGSuiteHormones = 1]]
	<</if>>
<</if>>

<<if $HGSuiteSlaves > 0>>

''Bring the Head Girl's girl out of $HGSuiteName:''
	<<set $Flag = 1>>
	<<include "Slave Summary">>
<</if>>

<<if ($slaves.length > $HGSuiteSlaves) && ($HGSuiteSlaves < 1)>>

''Assign a slave to the Head Girl:''

	<<assignmentFilter>>

		<<showallAssignmentFilter>>
		<<set $Flag = 0>>
		<<include "Slave Summary">>
		<<resetAssignmentFilter>>

<</if>>

Rename $HGSuiteName: <<textbox "$HGSuiteName" $HGSuiteName "Head Girl Suite">> //Use a noun or similar short phrase//


code:
:: HG Application [nobr]

<<if ndef $HGSeverity>>
	<<set $HGSeverity = 0>>
<</if>>
<<set _effectiveness = 15+$HeadGirl.actualAge+($HeadGirl.intelligence*10)-($HeadGirl.accent*5)+($HGSeverity*10)+($activeSlave.intelligence*10)-($activeSlave.accent*5)>>
<<if $AgePenalty == 0>>
	<<set _effectiveness += Math.max(0,(30-$HeadGirl.actualAge))>>
<</if>>
<<if $HeadGirl.sexualFlaw == "abusive" && $HGSeverity >= 0>>
	<<set _effectiveness += 10>>
<</if>>
<<set $activeSlave.tired = 1>>

    ''Your head girl __@@.pink;$HeadGirl.slaveName@@__'' notices that ''__@@.pink;$activeSlave.slaveName@@__''
<<switch $HGtraining>>
<<case "health">>
	is unwell.
<<case "obedience">>
	is disobedient.
<<case "paraphilia">>
	has a paraphilia.
<<case "flaw">>
	has an unpleasant flaw worth fixing.
<<case "soften">>
	has an unpleasant flaw that she can try to soften into a unique quirk.
<<case "oral skill">>
	isn't as orally skilled as she is.
<<case "anal skill">>
	isn't as skilled at taking anal as she is.
<<case "fuck skill">>
	isn't as skilled at vaginal intercourse as she is.
<<case "whore skill">>
	isn't as skilled at the fine art of sex for money as she is.
<<case "entertain skill">>
	isn't as skilled at entertainment as she is.
<</switch>>

<<if $HGtraining == "health">>

She helps $activeSlave.slaveName however she can. The tender care has @@.green;improved $activeSlave.slaveName's health.@@
<<set $activeSlave.health += 10>>

<<else>>

<<if $HeadGirl.career == "an arcology owner">>
	She was once an arcology owner herself, making her truly peerless as a Head Girl.
	<<set _effectiveness += 50>>
<<elseif setup.HGCareers.includes($HeadGirl.career)>>
	She was used to giving commands and being obeyed in her life before she was a slave, experience she can call on now.
	<<set _effectiveness += 5>>
<</if>>

<<if $HeadGirl.actualAge > 30>>
	Her age and experience help her as she works with $activeSlave.slaveName.
<<elseif $HeadGirl.actualAge < 25 && $AgePenalty > 0>>
	Her youth and inexperience impede her as she works with $activeSlave.slaveName.
<</if>>

<<if $HeadGirl.accent >= 3>>
	She does her best to give orders in $language, but has to resort to a lot of unseemly gesticulation and shouting, making her much less effective.
<<elseif $HeadGirl.accent == 2>>
	Her heavy $HeadGirl.nationality accent impedes her clarity in $language, making her somewhat less effective.
<</if>>

<<if ($HGtraining == "obedience") || ($HGtraining == "flaw") || ($HGtraining == "soften")>>
	<<if $HeadGirl.intelligence > 1>>
		<<if $activeSlave.intelligence > 1>>
			She needs her wits about her to mold $activeSlave.slaveName, who's quite intelligent herself.
		<<elseif $activeSlave.intelligence >= -1>>
			Her intelligence helps her mold $activeSlave.slaveName.
		<<else>>
			Molding $activeSlave.slaveName is very easy, especially for a smart Head Girl like her.
		<</if>>
	<</if>>
<<else>>
	<<if $HeadGirl.intelligence > 1>>
		<<if $activeSlave.intelligence > 1>>
			Both slaves are quite intelligent, making her job much easier.
		<<elseif $activeSlave.intelligence >= -1>>
			She's quite intelligent and can teach $activeSlave.slaveName well.
		<<else>>
			She needs all her considerable intelligence to get through to the idiot she has to teach.
		<</if>>
	<</if>>
<</if>>

<<if $HGSeverity > 0>>
	Your directives encourage her to rape any slave that fails in the slightest way, a task she approaches
	<<if $HeadGirl.sexualFlaw == "abusive">>
		eagerly, since she prefers to take her pleasure without consent.
	<<elseif $HeadGirl.fetish == "sadist">>
		with sadistic enthusiasm.
	<<elseif $HeadGirl.fetish == "dom">>
		with confidence.
	<<elseif $HeadGirl.energy > 95>>
		as a convenient way to
		<<if ($HeadGirl.balls > 0)>>
			drain her perpetually overfilled balls into a series of spasming holes.
		<<else>>
			sate her excess sexual appetite.
		<</if>>
	<<else>>
		dutifully.
	<</if>>
	<<if $activeSlave.vagina == 0>>
		In $activeSlave.slaveName's case, she's careful to limit her sexual abuse to things that won't take the girl's virginity. The slave
	<<elseif $activeSlave.anus == 0>>
		She's careful to molest $activeSlave.slaveName in ways that don't involve penetrating her virgin ass. The slave
	<<else>>
		$activeSlave.slaveName
	<</if>>
	<<if $activeSlave.devotion > 50>>
		accepts the abuse, believing she deserves to be raped.
	<<elseif $activeSlave.devotion >= -20>>
		is @@.gold;frightened@@ by the unceasing abuse.
		<<set $activeSlave.trust -= 1>>
	<<else>>
		@@.mediumorchid;hates@@ and @@.gold;fears@@ the constant abuse.
		<<set $activeSlave.trust -= 1>>
		<<set $activeSlave.devotion -= 1>>
	<</if>>
	$HeadGirl.slaveName makes sure her victim hates it, every time, and $activeSlave.slaveName can't help but do her very best to avoid this treatment.
<<elseif $HGSeverity == 0>>
	You allow her to use her own judgment when punishing failures,
	<<if $HeadGirl.sexualFlaw == "abusive">>
		and she usually decides in favor of forcing misbehaving slaves to get her off.
	<<elseif $HeadGirl.fetish == "sadist">>
		permission the sadist uses for her own gratification.
	<<elseif $HeadGirl.fetish == "dom">>
		which the dominant girl uses confidently.
	<<elseif $HeadGirl.energy > 95>>
		which she uses to
		<<if ($HeadGirl.balls > 0)>>
			force her subordinates to keep her balls drained.
		<<else>>
			extract the constant sexual favors her libido demands.
		<</if>>
	<<else>>
		and she does her best to be fair.
	<</if>>
	$activeSlave.slaveName
	<<if $activeSlave.devotion > 50>>
		is @@.mediumaquamarine;grateful@@ that she is punished justly when she makes mistakes.
		<<set $activeSlave.trust += 1>>
	<<elseif $activeSlave.devotion >= -20>>
		does her best to learn quickly and avoid punishment.
	<<else>>
		is @@.gold;scared@@ by her inability to get away with the smallest disobedience.
		<<set $activeSlave.trust -= 1>>
	<</if>>
<<else>>
	You require her to use respect when punishing; she does her best to motivate, but is unable to use real fear as a tool. $activeSlave.slaveName understands this, and @@.mediumaquamarine;trusts@@ that if she fails, the consequences won't be too awful.
	<<set $activeSlave.trust += 1>>
<</if>>

<<if $HGtraining == "obedience">>

<<set _effectiveness -= $activeSlave.intelligence*15>>
<<set $activeSlave.trust -= Math.ceil(_effectiveness/4)>>
<<if $activeSlave.devotion < -50>>
	She helps watch and restrain the rebellious $activeSlave.slaveName, helping wear her down, @@.gold;breaking $activeSlave.slaveName's rebelliousness.@@
<<elseif $activeSlave.devotion < -20>>
	She keeps $activeSlave.slaveName constantly aware of her slavery, @@.gold;breaking $activeSlave.slaveName's resistance.@@
<<else>>
	She acts as another pair of eyes watching $activeSlave.slaveName and metes out punishments, @@.gold;improving $activeSlave.slaveName's servitude.@@
<</if>>

<<elseif $HGtraining == "paraphilia">>

<<set _effectiveness -= $activeSlave.intelligence*15>>
<<set $activeSlave.training += _effectiveness>>
    $HeadGirl.slaveName does her best to get $activeSlave.slaveName past it with punishments and rewards,
<<if $activeSlave.training > 100>>
	and @@.green;resolves $activeSlave.slaveName's paraphilia.@@
	<<set $activeSlave.training = 0>>
	<<set $activeSlave.sexualFlaw = "none">>
<<else>>
		and makes partial progress.
<</if>>

<<elseif $HGtraining == "flaw">>

<<set _effectiveness -= $activeSlave.intelligence*15>>
<<set $activeSlave.training += _effectiveness>>
$HeadGirl.slaveName punishes $activeSlave.slaveName whenever she catches her indulging in her bad habits,
<<if $activeSlave.training > 100>>
	and @@.green;fixes $activeSlave.slaveName's flaw.@@
	<<set $activeSlave.training = 0>>
	<<if $activeSlave.behavioralFlaw != "none">>
		<<set $activeSlave.behavioralFlaw = "none">>
	<<elseif $activeSlave.sexualFlaw != "none">>
		<<set $activeSlave.sexualFlaw = "none">>
	<</if>>
<<else>>
		and makes partial progress.
<</if>>

<<elseif $HGtraining == "soften">>

<<set _effectiveness -= $activeSlave.intelligence*15>>
<<set $activeSlave.training += _effectiveness>>
She punishes $activeSlave.slaveName whenever she sees her breaking the rules yet does her best to retain what makes the slave special,
<<if $activeSlave.training > 150>>
	<<set $activeSlave.training = 0>>
	and successfully @@.green;softens $activeSlave.slaveName's flaw.@@
	<<if $activeSlave.behavioralFlaw != "none">>
		<<SoftenBehavioralFlaw $activeSlave>>
	<<elseif $activeSlave.sexualFlaw != "none">>
		<<SoftenSexualFlaw $activeSlave>>
	<</if>>
<<else>>
	and makes partial progress.
<</if>>

<<elseif $HGtraining == "oral skill">>

<<set $activeSlave.training = 0>>
<<if ($HeadGirl.fetish == "cumslut") && ($HeadGirl.fetishStrength > 60)>>
	In spare moments she teaches $activeSlave.slaveName how to suck cocks, cunts, and assholes. Her enthusiasm for oral sex is infectious. $activeSlave.slaveName's oral skills have improved.
	<<set $skillIncrease = random(5,10)>><<OralSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.dick > 0) && canAchieveErection($HeadGirl) && $HeadGirl.dickAccessory != ("chastity")>>
	In spare moments she teaches $activeSlave.slaveName how to suck cocks, cunts, and assholes. Your head girl uses her penis as an effective teaching tool. $activeSlave.slaveName's oral skills have improved.
	<<set $skillIncrease = random(5,10)>><<OralSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.clit > 2)>>
	In spare moments she teaches $activeSlave.slaveName how to suck cocks, cunts, and assholes. Your head girl uses her pseudophallus-sized clit as an effective teaching tool. $activeSlave.slaveName's oral skills have improved.
	<<set $skillIncrease = random(5,10)>><<OralSkillIncrease $activeSlave>>
<<else>>
	In spare moments she teaches $activeSlave.slaveName how to suck cocks, cunts, and assholes. $activeSlave.slaveName's oral skills have improved.
<</if>>
<<set $skillIncrease = Math.ceil(_effectiveness/10)>><<OralSkillIncrease $activeSlave>>

<<elseif $HGtraining == "anal skill">>

<<set $activeSlave.training = 0>>
<<if ($HeadGirl.fetish == "buttslut") && ($HeadGirl.fetishStrength > 60)>>
	In spare moments she teaches $activeSlave.slaveName how to take it up the ass. Your head girl's enthusiasm for backdoor loving is infectious. $activeSlave.slaveName's anal skills have improved.
	<<set $skillIncrease = random(5,10)>><<AnalSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.dick > 0) && canAchieveErection($HeadGirl) && $HeadGirl.dickAccessory != ("chastity")>>
	In spare moments she teaches $activeSlave.slaveName how to take a dick up the butt. Your head girl uses her penis as an effective teaching tool. $activeSlave.slaveName's anal skills have improved.
	<<set $skillIncrease = random(5,10)>><<AnalSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.clit > 2)>>
	In spare moments she teaches $activeSlave.slaveName how to take a phallus up the butt. Your head girl uses her pseudophallus-sized clit as an effective teaching tool. $activeSlave.slaveName's anal skills have improved.
	<<set $skillIncrease = random(5,10)>><<AnalSkillIncrease $activeSlave>>
<<else>>
	In spare moments she teaches $activeSlave.slaveName how to take a dick up the butt. $activeSlave.slaveName's anal skills have improved.
<</if>>
<<set $skillIncrease = Math.ceil(_effectiveness/10)>><<AnalSkillIncrease $activeSlave>>

<<elseif $HGtraining == "fuck skill">>

<<set $activeSlave.training = 0>>
<<if ($HeadGirl.energy > 95)>>
	In spare moments she teaches $activeSlave.slaveName how to take a dick. Your head girl's enthusiasm for sex is infectious. $activeSlave.slaveName's vanilla sex skills have improved.
	<<set $skillIncrease = random(5,10)>><<VaginalSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.dick > 0) && canAchieveErection($HeadGirl) && $HeadGirl.dickAccessory != ("chastity")>>
	In spare moments she teaches $activeSlave.slaveName how to take a dick. Your head girl uses her penis as an effective teaching tool. $activeSlave.slaveName's vanilla sex skills have improved.
	<<set $skillIncrease = random(5,10)>><<VaginalSkillIncrease $activeSlave>>
<<elseif ($HeadGirl.clit > 2)>>
	In spare moments she teaches $activeSlave.slaveName how to take a phallus. Your head girl uses her pseudophallus-sized clit as an effective teaching tool. $activeSlave.slaveName's vanilla sex skills have improved.
	<<set $skillIncrease = random(5,10)>><<VaginalSkillIncrease $activeSlave>>
<<else>>
	In spare moments she teaches $activeSlave.slaveName how to take a dick. $activeSlave.slaveName's vanilla sex skills have improved.
<</if>>
<<set $skillIncrease = Math.ceil(_effectiveness/10)>><<VaginalSkillIncrease $activeSlave>>

<<elseif $HGtraining == "whore skill">>

<<set $activeSlave.training = 0>>
In spare moments she teaches $activeSlave.slaveName how to prostitute herself. $activeSlave.slaveName's whoring skills have improved.
<<set $skillIncrease = Math.ceil(_effectiveness/10)>><<WhoreSkillIncrease $activeSlave>>

<<elseif $HGtraining == "entertain skill">>

<<set $activeSlave.training = 0>>
<<if ($HeadGirl.fetish == "humiliation") && ($HeadGirl.fetishStrength > 60)>>
	In spare moments she teaches $activeSlave.slaveName how to entertain. Your head girl's enthusiasm for public display is infectious. $activeSlave.slaveName's entertainment skills have improved.
	<<set $skillIncrease = random(5,10)>><<EntertainSkillIncrease $activeSlave>>
<<else>>
	In spare moments she teaches $activeSlave.slaveName how to entertain. $activeSlave.slaveName's entertainment skills have improved.
<</if>>
<<set $skillIncrease = Math.ceil(_effectiveness/10)>><<EntertainSkillIncrease $activeSlave>>

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

<<if ($activeSlave.devotion >= -20)>>
<<if ($activeSlave.attrKnown == 0)>>
	<<set $activeSlave.attrKnown = 1>>
	$HeadGirl.slaveName also investigates the slave's basic sexual orientation, finding that she is
	<<if ($activeSlave.attrXY <= 40)>>
		@@.red;disgusted by men@@
	<<elseif ($activeSlave.attrXY <= 60)>>
		indifferent to men
	<<elseif ($activeSlave.attrXY <= 80)>>
		@@.green;attracted to men@@
	<<else>>
		@@.green;intensely attracted to men@@
	<</if>>
	and
	<<if ($activeSlave.attrXX <= 40)>>
		@@.red;disgusted by women.@@
	<<elseif ($activeSlave.attrXX <= 60)>>
		indifferent to women.
	<<elseif ($activeSlave.attrXX <= 80)>>
		@@.green;attracted to women.@@
	<<else>>
		@@.green;intensely attracted to women.@@
	<</if>>
<</if>>
<</if>>

<<if $activeSlave.devotion >= -20>>
<<if $activeSlave.genes == "XY">>
<<if $activeSlave.attrXY <= 35>>
	<<set _piercingForbidden = 0>>
	<<for _i = 0; _i < 1; _i++>>
		<<if $activeSlave.earPiercing == 0>>
			<<set $activeSlave.earPiercing = 1>>
			<<RulesDeconfliction $activeSlave>>
			<<if $activeSlave.earPiercing != $slaveAfterRA.earPiercing>>
				<<set _piercingForbidden = 1, $activeSlave.earPiercing = 0>>
			<<else>>
				$HeadGirl.slaveName knows that $activeSlave.slaveName needs help adjusting to life as a slave girl, so she has the slave's ears pierced. A little feminine touch can make a big difference.
				<<set $cash -= $modCost>>
				<<break>>
			<</if>>
		<</if>>
		<<if $activeSlave.nosePiercing == 0>>
			<<set $activeSlave.nosePiercing = 1>>
			<<RulesDeconfliction $activeSlave>>
			<<if $activeSlave.nosePiercing != $slaveAfterRA.nosePiercing>>
				<<set _piercingForbidden = 1, $activeSlave.nosePiercing = 0>>
			<<else>>
				$HeadGirl.slaveName knows that $activeSlave.slaveName needs help adjusting to life as a slave girl, so she gives the slave a cute little nose piercing. It should help $activeSlave.slaveName see herself as a bit more feminine.
				<<set $cash -= $modCost>>
				<<break>>
			<</if>>
		<</if>>
		<<if $activeSlave.eyebrowPiercing == 0>>
			<<set $activeSlave.eyebrowPiercing = 1>>
			<<RulesDeconfliction $activeSlave>>
			<<if $activeSlave.eyebrowPiercing != $slaveAfterRA.eyebrowPiercing>>
				<<set _piercingForbidden = 1, $activeSlave.eyebrowPiercing = 0>>
			<<else>>
				$HeadGirl.slaveName knows that $activeSlave.slaveName needs help adjusting to life as a slave girl, so she gives the slave a cute little eyebrow piercing. A slutty touch for a teenage girl should help her feel a little hungrier for cock.
				<<set $cash -= $modCost>>
				<<break>>
			<</if>>
		<</if>>
		<<if $activeSlave.lipsPiercing == 0>>
			<<set $activeSlave.lipsPiercing = 1>>
			<<RulesDeconfliction $activeSlave>>
			<<if $activeSlave.lipsPiercing != $slaveAfterRA.lipsPiercing>>
				<<set _piercingForbidden = 1, $activeSlave.lipsPiercing = 0>>
			<<else>>
				$HeadGirl.slaveName knows that $activeSlave.slaveName needs help adjusting to life as a slave girl, so she has the slave's lower lip pierced. Her mouth is for pleasing penises now, so it'll help her if it looks like it.
				<<set $cash -= $modCost>>
				<<break>>
			<</if>>
		<</if>>
		<<if $activeSlave.navelPiercing == 0>>
			<<set $activeSlave.navelPiercing = 1>>
			<<RulesDeconfliction $activeSlave>>
			<<if $activeSlave.navelPiercing != $slaveAfterRA.navelPiercing>>
				<<set _piercingForbidden = 1, $activeSlave.navelPiercing = 0>>
			<<else>>
				$HeadGirl.slaveName knows that $activeSlave.slaveName needs help adjusting to life as a slave girl, so she has the slave's navel pierced. The prettier her lower half looks, the less reluctant she should feel to take it up the butt.
				<<set $cash -= $modCost>>
				<<break>>
			<</if>>
		<</if>>
		<<break>>
	<</for>>
	<<if _piercingForbidden>>
		$HeadGirl.slaveName thinks some cute piercings might help $activeSlave.slaveName adjust to life as a slave girl, but she also knows you have rules applied to this slave that forbid it.
	<</if>>
<</if>>
<</if>>
<</if>>

<<set _hgtarget = $slaves.findIndex(function(s) { return s.ID == $activeSlave.ID; })>>
<<set $slaves[_hgtarget] = $activeSlave>> /* save changes */


code:
:: HG Select [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $showEncyclopedia = 1, $encyclopedia = "Head Girl">>
<<showallAssignmentFilter>>

Head Girl Management

<<set _HGName = "Your Head Girl">>
<<if ($HeadGirl != 0)>>
	<<set _i = $slaves.findIndex(function(s) { return s.ID == $HeadGirl.ID; })>>
	<<set $HeadGirl = $slaves[_i]>>
	<<switch $HeadGirl.nationality>>
	<<case "Chinese" "Japanese" "Korean" "Cambodian" "Vietnamese" "Hungarian" "Mongolian">>
		<<if $HeadGirl.slaveSurname>>
			<<set _HGName = $HeadGirl.slaveSurname + " " + $HeadGirl.slaveName>>
		<<else>>
			<<set _HGName = $HeadGirl.slaveName>>
		<</if>>
	<<default>>
		<<set _HGName = $HeadGirl.slaveName>>
		<<if $HeadGirl.slaveSurname>><<set _HGName += " " + $HeadGirl.slaveSurname>><</if>>
	<</switch>>
	''__@@.pink;_HGName@@__'' is serving as your Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort; it is her role to serve and comfort you at your side, in addition to performing normal head girl duties<</if>>.

<</if>>

__Slave training__

//_HGName will prioritize enabled items in the following order.//

<<if $headGirlTrainsHealth>><<checkbox "$headGirlTrainsHealth" 0 1 checked>><<else>><<checkbox "$headGirlTrainsHealth" 0 1>><</if>>
Health

<<if $headGirlTrainsFlaws>><<checkbox "$headGirlTrainsFlaws" 0 1 checked>><<else>><<checkbox "$headGirlTrainsFlaws" 0 1>><</if>>
Flaws
<<if $headGirlSoftensFlaws>><<checkbox "$headGirlSoftensFlaws" 0 1 checked>><<else>><<checkbox "$headGirlSoftensFlaws" 0 1>><</if>>
Soften

<<if $headGirlTrainsParaphilias>><<checkbox "$headGirlTrainsParaphilias" 0 1 checked>><<else>><<checkbox "$headGirlTrainsParaphilias" 0 1>><</if>>
Paraphilias

<<if $headGirlTrainsObedience>><<checkbox "$headGirlTrainsObedience" 0 1 checked>><<else>><<checkbox "$headGirlTrainsObedience" 0 1>><</if>>
Obedience

<<if $headGirlTrainsSkills>><<checkbox "$headGirlTrainsSkills" 0 1 checked>><<else>><<checkbox "$headGirlTrainsSkills" 0 1>><</if>>
Skills

__Training methods__

_HGName will be
<<if ($HGSeverity > 0)>>
	''aggressive'' when punishing, with rape strongly encouraged. [[Moderate|HG Select][$HGSeverity = 0]]
<<elseif ($HGSeverity == 0)>>
	''moderate'' when punishing, carefully selecting appropriate consequences. [[Be aggressive|HG Select][$HGSeverity = 1]] | [[Restrict her|HG Select][$HGSeverity = -1]]
<<else>>
	''respectful'' when punishing, treating slaves decently. [[Be stricter|HG Select][$HGSeverity = 0]]
<</if>>

_HGName is
<<if $HGPiercings>>
	''allowed'' to use piercings as a tool to improve slaves' attitudes. [[Disallow|HG Select][$HGPiercings = 0]]
<<else>>
	''not allowed'' to use piercings as a tool to improve slaves' attitudes. [[Allow|HG Select][$HGPiercings = 1]]
<</if>>

__Behavior towards you__

_HGName
<<if ($HGFormality != 0)>>
	will be ''formal'': she will always call you <<if $PC.title == 1>>Master<<else>>Mistress<</if>>, just like any other slave.	[[Allow private informality|HG Select][$HGFormality = 0]]
<<else>>
	is allowed to be ''informal'': in private, she may call you <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>. [[Maintain complete formality|HG Select][$HGFormality = 1]]
<</if>>

<<if $HeadGirl != 0>>
<<if $universalRulesImpregnation == "HG">>

_HGName is responsible for impregnating fertile slaves.
	<<set $HGCum = 2+Math.trunc(($HeadGirl.balls/4)+($HeadGirl.energy/95)+($HeadGirl.health/95))>>
	<<if canPenetrate($HeadGirl) && $HeadGirl.pubertyXY == 1>>
		To maximize the chances of impregnation, she will fuck fertile pussies frequently during the week. $HeadGirl.slaveName can service $HGCum slaves this way.
		<<if $HeadGirl.devotion > 95>>She loves you so much she'll fuck them until she's sore.<<else>>If she were more devoted to you, she might be able to drive herself to get hard and service one more.<</if>>
		<<if $HeadGirl.balls >= 120>>Her unreal balls produce nearly an endless supply of semen; her ability to impregnate is almost limitless.<<elseif $HeadGirl.balls >= 80>>Her inhuman balls produce so much semen she can easily impregnate twenty girls in one sitting.<<elseif $HeadGirl.balls >= 50>>Her giant balls produce so much semen she can easily impregnate twelve girls in one sitting.<<elseif $HeadGirl.balls >= 25>>Her oversized balls produce so much semen she can cum repeatedly in a single session.<<elseif $HeadGirl.balls >= 5>>Her big balls produce so much semen she can cum more before she's drained.<<else>>Bigger balls would let her cum more before she's drained.<</if>>
		<<if $HeadGirl.health > 95>>Her wonderful health lets her get hard and stay hard all the time.<<else>>If her health were perfect, she might be able to get hard more often.<</if>>
		<<if $HeadGirl.energy > 95>>Her nymphomania drives her to go above and beyond in this.<<else>>A more powerful sex drive could reduce her refractory period.<</if>>
	<<else>>
		However, $HeadGirl.slaveName cannot perform this duty.
	<</if>>
	[[Rescind her impregnation responsibility|HG Select][$universalRulesImpregnation = "none"]] | [[See to it yourself|HG Select][$universalRulesImpregnation = "PC"]]
<<else>>
	<<if canPenetrate($HeadGirl) && $HeadGirl.pubertyXY == 1>>

_HGName is capable of impregnating slaves, but it's not part of her responsibilities. [[Assign her to impregnate|HG Select][$universalRulesImpregnation = "HG"]]
	<</if>>
<</if>>
<</if>>

''Appoint a head girl from among your devoted slaves:''

[[None|HG Workaround][$i = -1]]

<<assignmentFilter>>

	<<showallAssignmentFilter>>
	<<include "Slave Summary">>
	<<resetAssignmentFilter>>


code:
:: HG Workaround [silently]

<<if $HeadGirl != 0>>
	<<removeJob $HeadGirl "be your Head Girl">>
<</if>>
<<if $i > -1>>
	<<assignJob $slaves[$i] "be your Head Girl">>
	<<set $HeadGirl = $slaves[$i]>>
<</if>>

<<set $HGTimeInGrade = 0>>

<<goto "Main">>


code:
:: Hole Workaround [silently]

<<assignJob $slaves[$i] "work a glory hole">>

<<goto "Main">>


code:
:: Household Liquidator [nobr]

<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $showEncyclopedia = 1, $encyclopedia = "Household Liquidations">>

<<if random(1,100) > 50>>

The household liquidator is offering a set of siblings for sale. As usual, you will only be permitted to inspect the older, but there is a guarantee that the younger will be similar.

<<include "Generate New Slave">>
<<set $activeSlave.origin = "You bought her from the household liquidator.">>

<<set $activeSlave.devotion = random(-75,-25)>>
<<set $activeSlave.trust = random(-45,-25)>>
<<set $activeSlave.oldDevotion = $activeSlave.devotion>>
<<set $activeSlave.oldTrust = $activeSlave.trust>>
<<set $activeSlave.health = random(-50,20)>>
<<if $familyTesting == 1>>
	<<set $activeSlave.mother = $missingParentID>>
	<<set $missingParentID-->>
	<<set $activeSlave.father = $missingParentID>>
	<<set $missingParentID-->>
	<<set $activeSlave.canRecruit = 0>>
<<else>>
	<<set $activeSlave.relation = "sister">>
	<<set $activeSlave.relationTarget = $activeSlave.ID + 1000>>
<</if>>

<<slaveCost $activeSlave>>

The price is ¤<<print $slaveCost*3>>.

<<if $cash >= $slaveCost*3>>
	[[Buy their slave contract|Siblings Workaround][$cash -= $slaveCost*3,$nextButton = "Continue",$nextLink = "Main"]]
<<else>>
	//You lack the necessary funds to buy these slaves.//
<</if>>

[[Decline to purchase them and check out another set of slaves|Household Liquidator][$slavesSeen += 2]]

<<set $saleDescription = 1, $applyLaw = 1>><<include "Long Slave Description">>

<<elseif random(1,100) > 20>>

The household liquidator is offering a mother and her daughter for sale. As usual, you will only be permitted to inspect the mother, but there is a guarantee that the daughter will be similar.

/% Begin younger mothers submod. %/
<<set $activeSlaveOneTimeMinAge = $fertilityAge + $minimumSlaveAge>>
<<set $activeSlaveOneTimeMaxAge = 42>>
<<set $one_time_age_overrides_pedo_mode = 1>> /% Old enough to have a daughter who can be a slave. %/
/% End younger mothers submod. %/
<<include "Generate New Slave">>
<<set $activeSlave.origin = "You bought her from the household liquidator.">>

<<set $activeSlave.devotion = random(-75,-25)>>
<<set $activeSlave.trust = random(-45,-25)>>
<<set $activeSlave.oldDevotion = $activeSlave.devotion>>
<<set $activeSlave.oldTrust = $activeSlave.trust>>
<<set $activeSlave.health = random(-50,20)>>
<<set $activeSlave.boobs += 100>>
<<set $activeSlave.butt += 1>>
<<if $activeSlave.vagina > -1>><<set $activeSlave.vagina += 1>><</if>>
<<set $activeSlave.birthsTotal = 1>>
<<if $familyTesting == 1>>
	<<set $activeSlave.canRecruit = 0>>
<<else>>
	<<set $activeSlave.relation = "mother">>
	<<set $activeSlave.relationTarget = $activeSlave.ID + 1000>>
<</if>>

<<slaveCost $activeSlave>>
<<if $slavesSeen > $slaveMarketLimit>><<set $slaveCost += Math.trunc($slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1))>><</if>>

The price is ¤<<print $slaveCost*3>>.<<if $slavesSeen > $slaveMarketLimit>> You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.<</if>>

<<if $cash >= $slaveCost*3>>
	[[Buy their slave contract|Mother Daughter Workaround][$cash -= $slaveCost*3,"Continue",$nextLink = "Main"]]
<<else>>
	//You lack the necessary funds to buy these slaves.//
<</if>>

[[Decline to purchase them and check out another set of slaves|Household Liquidator][$slavesSeen += 2]]

<<set $saleDescription = 1>>
<<set $applyLaw = 1>>
<<include "Long Slave Description">>
<<set $saleDescription = 0>>

<<else>>

The household liquidator is offering something special: twins. The markup is huge, but the merchandise isn't something you see every day.

<<include "Generate New Slave">>
<<set $activeSlave.origin = "You bought her from the household liquidator.">>

<<set $activeSlave.devotion = random(-75,-25)>>
<<set $activeSlave.trust = random(-45,-25)>>
<<set $activeSlave.oldDevotion = $activeSlave.devotion>>
<<set $activeSlave.oldTrust = $activeSlave.trust>>
<<set $activeSlave.health = random(-50,20)>>
<<if $familyTesting == 1>>
	<<set $activeSlave.mother = $missingParentID>>
	<<set $missingParentID-->>
	<<set $activeSlave.father = $missingParentID>>
	<<set $missingParentID-->>
	<<set $activeSlave.canRecruit = 0>>
<<else>>
	<<set $activeSlave.relation = "twin">>
	<<set $activeSlave.relationTarget = $activeSlave.ID + 1000>>
<</if>>
<<slaveCost $activeSlave>>

The price is ¤<<print $slaveCost*4>>.<<if $slavesSeen > $slaveMarketLimit>> You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.<</if>>

<<if $cash >= $slaveCost*4>>
	[[Buy their slave contract|Twins Workaround][$cash -= $slaveCost*4,$nextButton = "Continue",$nextLink = "Main"]]
<<else>>
	//You lack the necessary funds to buy these slaves.//
<</if>>

[[Decline to purchase them and check out another set of slaves|Household Liquidator][$slavesSeen += 2]]

<<set $saleDescription = 1>>
<<set $applyLaw = 1>>
<<include "Long Slave Description">>
<<set $saleDescription = 0>>

<</if>>


code:
:: Import Rule [nobr]

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

//Paste the code into the text box and click Apply//

	''Enter a rule to import.''

	<<set _tempRule = "">>
	<<textbox "_tempRule" _tempRule>>

<<link "Apply">>
	<<if (def _tempRule) && (_tempRule !== "")>>
		<<set _tempRule = eval('({' + _tempRule + '})')>>
		<<if (def _tempRule.condition) && (ndef _tempRule.condition.id) && (ndef _tempRule.condition.first) && (ndef _tempRule.condition.second)>>
			<<set _tempRule.condition = parseCondition(_tempRule.condition)>>
			<<if _tempRule.condition != null && _tempRule.condition.expr != null>>
				<<set _tempRule.condition = optimizeExpr(_tempRule.condition.expr)>>
			<<else>>
				<<unset _tempRule.condition>>
			<</if>>
		<</if>>

		<<if (def _tempRule.condition)>>
			/* pick an ID higher than the highest ID of any existing rule */
			<<for _tempRule.ID = 0, _r = 0; _r < $defaultRules.length; _r++>>
				<<set _tempRule.ID = Math.max(_tempRule.ID, $defaultRules[_r].ID + 1)>>
			<</for>>

			<<set $defaultRules.push(_tempRule)>> /* add the new rule to the end of the list (lowest priority) */

			<<set $currentRule = _tempRule>> /* view new rule when returning to RA; clear input box */

			<<replace #importmsg>>
				''Rule imported successfully!''
			<</replace>>
			<<replace #textbox>>
				<<set _tempRule = "">>
				<<textbox "_tempRule" _tempRule>>
			<</replace>>
		<<else>>
			<<replace #importmsg>>
				''Parsing failed. Rule not imported!''
			<</replace>>
		<</if>>
	<<else>>
		<<replace #importmsg>>
			''Enter a rule to import.''
		<</replace>>
	<</if>>
	<<unset _tempRule>>
<</link>>

<<link "Back to Rules Assistant">>
	<<goto "Rules Assistant">>
<</link>>


code:
:: Increment Piercings

<<if $activeSlave.nipplesPiercing < 2>>
	<<set $activeSlave.nipplesPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.clitPiercing < 2>>
	<<set $activeSlave.clitPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.vagina != -1>>
<<if $activeSlave.vaginaPiercing < 2>>
	<<set $activeSlave.vaginaPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>
<</if>>

<<if $activeSlave.dick > 0>>
<<if $activeSlave.dickPiercing < 2>>
	<<set $activeSlave.dickPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>
<</if>>

<<if $activeSlave.anusPiercing < 2>>
	<<set $activeSlave.anusPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.lipsPiercing < 2>>
	<<set $activeSlave.lipsPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.tonguePiercing < 2>>
	<<set $activeSlave.tonguePiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.earPiercing < 2>>
	<<set $activeSlave.earPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.nosePiercing < 2>>
	<<set $activeSlave.nosePiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.eyebrowPiercing < 2>>
	<<set $activeSlave.eyebrowPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.navelPiercing < 2>>
	<<set $activeSlave.navelPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.areolaePiercing < 1>>
	<<set $activeSlave.areolaePiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<if $activeSlave.corsetPiercing < 1>>
	<<set $activeSlave.corsetPiercing += 1>>
	<<set $cash -= $modCost>>
	<<set $degradation += 1>>
<</if>>

<<goto "Body Modification">>