:: Generate Child [nobr]

<<if $mom != 0>>
	<<set $mergeMom = 0>>
	<<set $mergeDad = 0>>
	<<for $m = 0; $m < $genePool.length; $m++>>
		<<if $mom.ID == $genePool[$m].ID>>
			<<set $mergeMom = $genePool[$m]>>
		<</if>>
		<<if $mom.pregSource == $genePool[$m].ID>>
			<<set $mergeDad = $genePool[$m]>>
		<</if>>
	<</for>>
	<<if $mom.pregSource == -1>>
		<<set $mergeDad = $PC>>
	<<elseif $mom.pregSource == 0 || $mom.pregSource < -1>>
		<<set $mergeDad = $mergeMom>>
	<</if>>
<</if>>
		
<<set $activeSlaveOneTimeMinAge = $targetAge>>
<<set $activeSlaveOneTimeMaxAge = $targetAge>>
<<set $one_time_age_overrides_pedo_mode = 1>>

<<if $babyGender == 1>>
	<<include "Generate XX Slave">>
	<<if $PC.pregSource < 1>>
		<<set $activeSlave.slaveName = "Your daughter">>
		<<set $activeSlave.mother = -1>>
		<<if $PC.pregSource != -6>>
			<<set $activeSlave.father = $missingParentID>>
			<<set $missingParentID-->>
			<<set $activeSlave.nationality = "Stateless">>
		<<else>>
			<<set $activeSlave.father = -1>>
			<<set $activeSlave.nationality = $PC.nationality>>
		<</if>>
		<<if $PC.pregSource == -2 && $arcologies[0].FSSupremacist != "unset">>
			<<set $activeSlave.race = either($PC.race, $arcologies[0].FSSubjugationistRace, $arcologies[0].FSSubjugationistRace)>>
			<<if $PC.race != $arcologies[0].FSSubjugationistRace>>
				<<if random(1,100) > 50>>
					<<set $activeSlave.race = "mixed race">>
				<</if>>
			<</if>>
		<<else>>
			<<set $activeSlave.race = $PC.race>>
		<</if>>
		<<set $activeSlave.skin = $PC.origSkin>>
		<<set $activeSlave.eyeColor = either($PC.origEye, "brown", "blue", "brown", "green", "hazel", "green")>>
		<<set $activeSlave.hColor = either($PC.origHColor, "brown", "blonde", "black", "brown")>>
		<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
		<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
		<<set $activeSlave.sexualFlaw = "none">>
		<<set $activeSlave.sexualQuirk = "none">>
		<<set $activeSlave.behavioralFlaw = "none">>
		<<set $activeSlave.behavioralQuirk = "none">>
		<<set $activeSlave.fetish = "none">>
		<<if $PC.markings != "none" && random(1,100) > 50>>
			<<set $activeSlave.markings = $PC.markings>>
		<</if>>
	<<else>>
		<<for $m = 0; $m < $genePool.length; $m++>>
			<<if $PC.pregSource == $genePool[$m].ID>>
				<<set $mergeDad = $genePool[$m]>>
				<<break>>
			<</if>>
		<</for>>
		<<set $activeSlave.slaveName = String("Your and " + $mergeDad.slaveName + "'s daughter")>>
		<<set $activeSlave.mother = -1>>
		<<set $activeSlave.father = $mergeDad.ID>>
		<<if $PC.nationality == $mergeDad.nationality>>
			<<set $activeSlave.nationality = $mergeDad.nationality>>
		<<else>>
			<<set $activeSlave.nationality = "Stateless">>
		<</if>>
		<<if $PC.race == $mergeDad.race>>
			<<set $activeSlave.race = $mergeDad.race>>
		<<elseif random(1,4) == 4>>
			<<set $activeSlave.race = either($PC.race, $mergeDad.race)>>
		<<else>>
			<<set $activeSlave.race = "mixed race">>
		<</if>>
		<<if $PC.origSkin == $mergeDad.origSkin>>
			<<set $activeSlave.skin = $PC.origSkin>>
		<<else>>
			<<GenSkinTone $PC $mergeDad>>
		<</if>>
		<<if $PC.origEye == $mergeDad.origEye>>
			<<set $activeSlave.eyeColor = $PC.origEye>>
		<<elseif $PC.origEye == "red" || $PC.origEye == "pale red" || $PC.origEye == "light red" || $PC.origEye == "pale gray">>
			<<set $activeSlave.eyeColor = $mergeDad.origEye>>
		<<elseif $mergeDad.origEye == "red" || $mergeDad.origEye == "pale red" || $mergeDad.origEye == "light red" || $mergeDad.origEye == "pale gray" || $mergeDad.origEye == "milky white">>
			<<set $activeSlave.eyeColor = $PC.origEye>>
		<<elseif $PC.origEye == "blue">>
			<<if random(1,4) == 2>>
				<<set $activeSlave.eyeColor = $PC.origEye>>
			<<else>>
				<<set $activeSlave.eyeColor = $mergeDad.origEye>>
			<</if>>
		<<elseif $mergeDad.origEye == "blue">>
			<<if random(1,4) == 2>>
				<<set $activeSlave.eyeColor = $mergeDad.origEye>>
			<<else>>
				<<set $activeSlave.eyeColor = $PC.origEye>>
			<</if>>
		<<else>>
			<<set $activeSlave.eyeColor = either($PC.origEye, $mergeDad.origEye)>>
		<</if>>
		<<if $PC.origHColor == $mergeDad.origHColor>>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $PC.origHColor == "black">>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $mergeDad.origHColor == "black">>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<<elseif $PC.origHColor == "brown">>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $mergeDad.origHColor == "brown">>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<<elseif $PC.origHColor == "white">>
			<<if random(1,100) == 69>>
				<<set $activeSlave.hColor = $PC.origHColor>>
			<<else>>
				<<set $activeSlave.hColor = $mergeDad.origHColor>>
			<</if>>
		<<elseif $mergeDad.origHColor == "white">>
			<<if random(1,100) == 69>>
				<<set $activeSlave.hColor = $PC.origHColor>>
			<<else>>
				<<set $activeSlave.hColor = $mergeDad.origHColor>>
			<</if>>
		<<else>>
			<<set $activeSlave.hColor = either($PC.origHColor, $mergeDad.origHColor)>>
		<</if>>
		<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
		<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
		<<if $mergeDad.underArmHStyle == "hairless">>
			<<if random(1,5) == 3>>
				<<set $activeSlave.underArmHStyle = "hairless">>
			<</if>>
		<</if>>
		<<if $mergeDad.pubicHStyle == "hairless">>
			<<if random(1,5) == 3>>
				<<set $activeSlave.pubicHStyle = "hairless">>
			<</if>>
		<</if>>
		<<set $activeSlave.sexualFlaw = either("none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
		<<set $activeSlave.sexualQuirk = either("none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
		<<set $activeSlave.behavioralFlaw = either("none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
		<<set $activeSlave.behavioralQuirk = either("none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
		<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", $mergeDad.fetish)>>
		<<if $activeSlave.markings == "none">>
			<<set $activeSlave.markings = either($PC.markings, $mergeDad.markings, "none", "none")>>
		<</if>>
	<</if>>
	<<set $activeSlave.slaveSurname = $PC.surname>>
<<elseif $babyGender == 2>>
	<<include "Generate XY Slave">>
	<<if $PC.pregSource < 1>>
		<<set $activeSlave.slaveName = "Your son">>
		<<set $activeSlave.mother = -1>>
		<<if $PC.pregSource != -6>>
			<<set $activeSlave.father = $missingParentID>>
			<<set $missingParentID-->>
			<<set $activeSlave.nationality = "Stateless">>
		<<else>>
			<<set $activeSlave.father = -1>>
			<<set $activeSlave.nationality = $PC.nationality>>
		<</if>>
		<<if $PC.pregSource == -2 && $arcologies[0].FSSupremacist != "unset">>
			<<set $activeSlave.race = either($PC.race, $arcologies[0].FSSubjugationistRace, $arcologies[0].FSSubjugationistRace)>>
			<<if $PC.race != $arcologies[0].FSSubjugationistRace>>
				<<if random(1,100) > 50>>
					<<set $activeSlave.race = "mixed race">>
				<</if>>
			<</if>>
		<<else>>
			<<set $activeSlave.race = $PC.race>>
		<</if>>
		<<set $activeSlave.skin = $PC.origSkin>>
		<<set $activeSlave.eyeColor = either($PC.origEye, "brown", "blue", "brown", "green", "hazel", "green")>>
		<<set $activeSlave.hColor = either($PC.origHColor, "brown", "blonde", "black", "brown")>>
		<<set $activeSlave.pubicHColor = $PC.origHColor>>
		<<set $activeSlave.underArmHColor = $PC.origHColor>>
		<<set $activeSlave.sexualFlaw = "none">>
		<<set $activeSlave.sexualQuirk = "none">>
		<<set $activeSlave.behavioralFlaw = "none">>
		<<set $activeSlave.behavioralQuirk = "none">>
		<<set $activeSlave.fetish = "none">>
		<<if $PC.markings != "none" && random(1,100) > 50>>
			<<set $activeSlave.markings = $PC.markings>>
		<</if>>
	<<else>>
		<<for $m = 0; $m < $genePool.length; $m++>>
			<<if $PC.pregSource == $genePool[$m].ID>>
				<<set $mergeDad = $genePool[$m]>>
				<<break>>
			<</if>>
		<</for>>
		<<set $activeSlave.slaveName = String("Your and " + $mergeDad.slaveName + "'s son")>>
		<<set $activeSlave.mother = -1>>
		<<set $activeSlave.father = $mergeDad.ID>>
		<<if $PC.nationality == $mergeDad.nationality>>
			<<set $activeSlave.nationality = $mergeDad.nationality>>
		<<else>>
			<<set $activeSlave.nationality = "Stateless">>
		<</if>>
		<<if $PC.race == $mergeDad.race>>
			<<set $activeSlave.race = $mergeDad.race>>
		<<elseif random(1,4) == 4>>
			<<set $activeSlave.race = either($PC.race, $mergeDad.race)>>
		<<else>>
			<<set $activeSlave.race = "mixed race">>
		<</if>>
		<<if $PC.origSkin == $mergeDad.origSkin>>
			<<set $activeSlave.skin = $PC.origSkin>>
		<<else>>
			<<GenSkinTone $PC $mergeDad>>
		<</if>>
		<<if $PC.origEye == $mergeDad.origEye>>
			<<set $activeSlave.eyeColor = $PC.origEye>>
		<<elseif $PC.origEye == "red" || $PC.origEye == "pale red" || $PC.origEye == "light red" || $PC.origEye == "pale gray">>
			<<set $activeSlave.eyeColor = $mergeDad.origEye>>
		<<elseif $mergeDad.origEye == "red" || $mergeDad.origEye == "pale red" || $mergeDad.origEye == "light red" || $mergeDad.origEye == "pale gray" || $mergeDad.origEye == "milky white">>
			<<set $activeSlave.eyeColor = $PC.origEye>>
		<<elseif $PC.origEye == "blue">>
			<<if random(1,4) == 2>>
				<<set $activeSlave.eyeColor = $PC.origEye>>
			<<else>>
				<<set $activeSlave.eyeColor = $mergeDad.origEye>>
			<</if>>
		<<elseif $mergeDad.origEye == "blue">>
			<<if random(1,4) == 2>>
				<<set $activeSlave.eyeColor = $mergeDad.origEye>>
			<<else>>
				<<set $activeSlave.eyeColor = $PC.origEye>>
			<</if>>
		<<else>>
			<<set $activeSlave.eyeColor = either($PC.origEye, $mergeDad.origEye)>>
		<</if>>
		<<if $PC.origHColor == $mergeDad.origHColor>>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $PC.origHColor == "black">>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $mergeDad.origHColor == "black">>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<<elseif $PC.origHColor == "brown">>
			<<set $activeSlave.hColor = $PC.origHColor>>
		<<elseif $mergeDad.origHColor == "brown">>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<<elseif $PC.origHColor == "white">>
			<<if random(1,100) == 69>>
				<<set $activeSlave.hColor = $PC.origHColor>>
			<<else>>
				<<set $activeSlave.hColor = $mergeDad.origHColor>>
			<</if>>
		<<elseif $mergeDad.origHColor == "white">>
			<<if random(1,100) == 69>>
				<<set $activeSlave.hColor = $PC.origHColor>>
			<<else>>
				<<set $activeSlave.hColor = $mergeDad.origHColor>>
			<</if>>
		<<else>>
			<<set $activeSlave.hColor = either($PC.origHColor, $mergeDad.origHColor)>>
		<</if>>
		<<if $mergeDad.underArmHStyle == "hairless">>
			<<if random(1,5) == 3>>
				<<set $activeSlave.underArmHStyle = "hairless">>
			<</if>>
		<</if>>
		<<if $mergeDad.pubicHStyle == "hairless">>
			<<if random(1,5) == 3>>
				<<set $activeSlave.pubicHStyle = "hairless">>
			<</if>>
		<</if>>
		<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
		<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
		<<set $activeSlave.sexualFlaw = either("none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
		<<set $activeSlave.sexualQuirk = either("none", "none", "none", "none", "none", $mergeDad.sexualQuirk)>>
		<<set $activeSlave.behavioralFlaw = either("none", "none", "none", "none", "none", $mergeDad.behavioralFlaw)>>
		<<set $activeSlave.behavioralQuirk = either("none", "none", "none", "none", "none", $mergeDad.behavioralQuirk)>>
		<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", $mergeDad.fetish)>>
		<<if $activeSlave.markings == "none">>
			<<set $activeSlave.markings = either($PC.markings, $mergeDad.markings, "none", "none")>>
		<</if>>
	<</if>>
	<<set $activeSlave.slaveSurname = $PC.surname>>
<<else>>
	<<if $seeDicks == 100>>
		<<include "Generate XY Slave">>
	<<elseif $seeDicks == 0>>
		<<include "Generate XX Slave">>
	<<else>>
		<<if random(0,100) >= 30>>
			<<include "Generate XX Slave">>
		<<else>>
			<<include "Generate XY Slave">>
		<</if>>
	<</if>>
	<<set $activeSlave.mother = $mergeMom.ID>>
	<<if $mom.pregSource > 0>>
		<<set $activeSlave.father = $mergeDad.ID>>
		<<set $activeSlave.slaveName = String($mom.slaveName + " and " + $mergeDad.slaveName + "'s child")>>
		<<if def $mom.slaveSurname && $mom.slaveSurname != "">><<set $activeSlave.slaveSurname = $mom.slaveSurname>><<elseif def $mergeDad.slaveSurname && $mergeDad.slaveSurname != "">><<set $activeSlave.slaveSurname = $mergeDad.slaveSurname>><<else>><<set $activeSlave.slaveSurname = 0>><</if>>
	<<elseif $mom.pregSource == -1>>
		<<set $activeSlave.father = -1>>
		<<set $activeSlave.slaveName = String($mom.slaveName + " and my child")>>
		<<set $activeSlave.slaveSurname = $PC.surname>>
	<<else>>
		<<set $activeSlave.father = $missingParentID>>
		<<set $missingParentID-->>
		<<set $activeSlave.slaveName = String($mom.slaveName + "'s slut child")>>
		<<if def $mom.slaveSurname && $mom.slaveSurname != "">><<set $activeSlave.slaveSurname = $mom.slaveSurname>><<else>><<set $activeSlave.slaveSurname = 0>><</if>>
	<</if>>
	<<if $mergeMom.nationality == $mergeDad.nationality>>
		<<set $activeSlave.nationality = $mergeDad.nationality>>
	<<else>>
		<<set $activeSlave.nationality = "Stateless">>
	<</if>>
	<<if $mergeMom.race == $mergeDad.race>>
		<<set $activeSlave.race = $mergeDad.race>>
	<<elseif random(1,4) == 4>>
		<<set $activeSlave.race = either($mergeMom.race, $mergeDad.race)>>
	<<else>>
		<<set $activeSlave.race = "mixed race">>
	<</if>>
	<<if $mom.pregSource == -2 && $arcologies[0].FSSupremacist != "unset">>
		<<set $activeSlave.race = either($mergeMom.race, $arcologies[0].FSSubjugationistRace, $arcologies[0].FSSubjugationistRace)>>
		<<if $mergeMom.race != $arcologies[0].FSSubjugationistRace>>
			<<if random(1,100) > 50>>
				<<set $activeSlave.race = "mixed race">>
			<</if>>
		<</if>>
	<</if>>
	<<if $mergeMom.origSkin == $mergeDad.origSkin>>
		<<set $activeSlave.skin = $mergeMom.origSkin>>
	<<else>>
		<<GenSkinTone $mergeMom $mergeDad>>
	<</if>>
	<<if $mergeMom.origEye == $mergeDad.origEye>>
		<<set $activeSlave.eyeColor = $mergeMom.origEye>>
	<<elseif $mergeMom.origEye == "red" || $mergeMom.origEye == "pale red" || $mergeMom.origEye == "light red" || $mergeMom.origEye == "pale gray" || $mergeMom.origEye == "milky white">>
		<<set $activeSlave.eyeColor = $mergeDad.origEye>>
	<<elseif $mergeDad.origEye == "red" || $mergeDad.origEye == "pale red" || $mergeDad.origEye == "light red" || $mergeDad.origEye == "pale gray" || $mergeDad.origEye == "milky white">>
		<<set $activeSlave.eyeColor = $mergeMom.origEye>>
	<<elseif $mergeMom.origEye == "blue">>
		<<if random(1,4) == 2>>
			<<set $activeSlave.eyeColor = $mergeMom.origEye>>
		<<else>>
			<<set $activeSlave.eyeColor = $mergeDad.origEye>>
		<</if>>
	<<elseif $mergeDad.origEye == "blue">>
		<<if random(1,4) == 2>>
			<<set $activeSlave.eyeColor = $mergeDad.origEye>>
		<<else>>
			<<set $activeSlave.eyeColor = $mergeMom.origEye>>
		<</if>>
	<<else>>
		<<set $activeSlave.eyeColor = either($mergeMom.origEye, $mergeDad.origEye)>>
	<</if>>
	<<if $mom.pregSource == -2 || $mom.pregSource == 0>>
		<<set $activeSlave.eyeColor = either($mergeMom.origEye, "brown", "blue", "brown", "green", "hazel", "green")>>
	<</if>>
	<<if $mergeMom.origHColor == $mergeDad.origHColor>>
		<<set $activeSlave.hColor = $mergeMom.origHColor>>
	<<elseif $mergeMom.origHColor == "black">>
		<<set $activeSlave.hColor = $mergeMom.origHColor>>
	<<elseif $mergeDad.origHColor == "black">>
		<<set $activeSlave.hColor = $mergeDad.origHColor>>
	<<elseif $mergeMom.origHColor == "brown">>
		<<set $activeSlave.hColor = $mergeMom.origHColor>>
	<<elseif $mergeDad.origHColor == "brown">>
		<<set $activeSlave.hColor = $mergeDad.origHColor>>
	<<elseif $mergeMom.origHColor == "white">>
		<<if random(1,100) == 69>>
			<<set $activeSlave.hColor = $mergeMom.origHColor>>
		<<else>>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<</if>>
	<<elseif $mergeDad.origHColor == "white">>
		<<if random(1,100) == 69>>
			<<set $activeSlave.hColor = $mergeDad.origHColor>>
		<<else>>
			<<set $activeSlave.hColor = $mergeMom.origHColor>>
		<</if>>
	<<else>>
		<<set $activeSlave.hColor = either($mergeMom.origHColor, $mergeDad.origHColor)>>
	<</if>>
	<<if $mom.pregSource == -2 || $mom.pregSource == 0>>
		<<set $activeSlave.hColor = either($mergeMom.origHColor, "brown", "blonde", "black", "brown", "black", "brown", "black")>>
	<</if>>
	<<if $mergeDad.underArmHStyle == "hairless" && $mergeMom.underArmHStyle == "hairless">>
		<<set $activeSlave.underArmHStyle = "hairless">>
	<<elseif $mergeDad.underArmHStyle == "hairless" || $mergeMom.underArmHStyle == "hairless">>
		<<if random(1,5) == 3>>
			<<set $activeSlave.underArmHStyle = "hairless">>
		<</if>>
	<</if>>
	<<if $mergeDad.pubicHStyle == "hairless" && $mergeMom.pubicHStyle == "hairless">>
		<<set $activeSlave.pubicHStyle = "hairless">>
	<<elseif $mergeDad.pubicHStyle == "hairless" || $mergeMom.pubicHStyle == "hairless">>
		<<if random(1,5) == 3>>
			<<set $activeSlave.pubicHStyle = "hairless">>
		<</if>>
	<</if>>
	<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
	<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
	<<set $activeSlave.sexualFlaw = either($mergeMom.sexualFlaw, "none", "none", "none", "none", "none", $mergeDad.sexualFlaw)>>
	<<set $activeSlave.sexualQuirk = either($mergeMom.sexualQuirk, "none", "none", "none", "none", "none", $mergeDad.sexualQuirk)>>
	<<set $activeSlave.behavioralFlaw = either($mergeMom.behavioralFlaw, "none", "none", "none", "none", "none", $mergeDad.behavioralFlaw)>>
	<<set $activeSlave.behavioralQuirk = either($mergeMom.behavioralQuirk, "none", "none", "none", "none", "none", $mergeDad.behavioralQuirk)>>
	<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", $mergeDad.fetish, $mergeMom.fetish)>>
	<<if $activeSlave.markings == "none">>
		<<set $activeSlave.markings = either($mergeMom.markings, $mergeDad.markings, "none", "none")>>
	<</if>>
	<<if $mom.addict > 0>>
		<<set $activeSlave.addict = Math.trunc($mom.addict/2)>>
	<</if>>
<</if>>

<<set $activeSlave.actualAge = 0>>
<<set $activeSlave.birthWeek = 0>>
<<set $activeSlave.weight = -100>>
<<set $activeSlave.muscles = -100>>
<<set $activeSlave.boobs = 0>>
<<set $activeSlave.butt = 0>>
<<set $activeSlave.energy = 0>>
<<set $activeSlave.anus = 0>>
<<set $activeSlave.chem = 990>>
<<if $activeSlave.vagina > -1>>
	<<set $activeSlave.vagina = 0>>
<</if>>
<<if $activeSlave.dick > 0>>
	<<set $activeSlave.foreskin = 1>>
	<<set $activeSlave.balls = 1>>
	<<set $activeSlave.scrotum = 1>>
<</if>>
<<if $activeSlave.fetish != "none">>
	<<set $activeSlave.fetishStrength = 20>>
<</if>>

/* Int and facial attractiveness changes to bolster eugenics and add negatives for excessive inbreeding */
<<if $activeSlave.mother == -1 && $PC.pregSource == -1>>
	<<set $activeSlave.face = random(50,100)>>
	<<set $activeSlave.intelligence = either(2, 2, 2, 2, 3, 3)>>
<<elseif $activeSlave.mother == -1>>
	<<if $PC.pregSource > 0>>
		<<if $mergeDad.face < $PC.face>>
			<<set $activeSlave.face = random($mergeDad.face, $PC.face)>>
		<<else>>
			<<set $activeSlave.face = random(0,$PC.face)>>
		<</if>>
		<<if $activeSlave.face < 40>>
			<<set $activeSlave.face += random(5,20)>>
		<</if>>
		<<if $mergeDad.intelligence < $PC.intelligence>>
			<<set $activeSlave.intelligence = random($mergeDad.intelligence, $PC.intelligence)>>
		<<else>>
			<<set $activeSlave.intelligence = $PC.intelligence>>
		<</if>>
		<<if $activeSlave.intelligence < 2>>
			<<set $activeSlave.intelligence += 1>>
		<</if>>
	<<else>>
		<<set $activeSlave.face =random(20,100)>>
		<<set $activeSlave.intelligence = either(1, 2, 2, 2, 2, 3, 3)>>
	<</if>>
<<elseif $activeSlave.father == -1 && $mom > 0>>
	<<if $mom.breedingMark == 1>>
		<<set $activeSlave.face = random(60,100)>>
		<<set $activeSlave.intelligence = either(2, 2, 2, 2, 3, 3)>>
	<<else>>
		<<if $PC.face > $mergeMom.face>>
			<<set $activeSlave.face = random($mergeMom.face, $PC.face)>>
		<<else>>
			<<set $activeSlave.face = either($mergeMom.face-10, $mergeMom.face+10)>>
		<</if>>
		<<if $PC.intelligence > $mergeMom.intelligence>>
			<<set $activeSlave.intelligence = random($mergeMom.intelligence, $PC.intelligence)>>
		<<else>>
			<<set $activeSlave.intelligence = $mergeMom.intelligence>>
		<</if>>
		<<if $inbreeding == 1>>
			<<if $activeSlave.face > -100 && random(1,100) > 60>>
				<<set $activeSlave.face -= random(2,20)>>
			<</if>>
			<<if $activeSlave.intelligence > -3 && random(1,100) < 40>>
				<<set $activeSlave.intelligence -= 1>>
				<<if $activeSlave.intelligence > -3 && random(1,100) < 20>>
					<<set $activeSlave.intelligence -= 1>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<<else>>
	<<if $mergeDad.face < $mergeMom.face>>
		<<set $activeSlave.face = random($mergeDad.face, $mergeMom.face)>>
	<<elseif $mergeDad.face > $mergeMom.face>>
		<<set $activeSlave.face = random($mergeMom.face, $mergeDad.face)>>
	<<else>>
		<<set $activeSlave.face = $mergeMom.face>>
	<</if>>
	<<if $mergeDad.intelligence < $mergeMom.intelligence>>
		<<set $activeSlave.intelligence = random($mergeDad.intelligence, $mergeMom.intelligence)>>
	<<elseif $mergeDad.intelligence > $mergeMom.intelligence>>
		<<set $activeSlave.intelligence = random($mergeMom.intelligence, $mergeDad.intelligence)>>
	<<else>>
		<<set $activeSlave.intelligence = $mergeMom.intelligence>>
	<</if>>
	<<if $inbreeding == 1>>
		<<if $activeSlave.face > -100 && random(1,100) < 50>>
			<<set $activeSlave.face -= random(5,20)>>
		<</if>>
		<<if $activeSlave.intelligence > -3 && random(1,100) < 50>>
			<<set $activeSlave.intelligence -= 1>>
				<<if $activeSlave.intelligence > -3 && random(1,100) < 30>>
					<<set $activeSlave.intelligence -= 1>>
				<</if>>
		<</if>>
	<</if>>
<</if>>

<<set $activeSlave.areolaePiercing = 0>>
<<set $activeSlave.face = Math.clamp($activeSlave.face, -100, 100)>>
<<set $activeSlave.corsetPiercing = 0>>
<<set $activeSlave.boobsImplant = 0>>
<<set $activeSlave.boobsImplantType = 0>>
<<set $activeSlave.nipplesPiercing = 0>>
<<set $activeSlave.areolaePiercing = 0>>
<<set $activeSlave.lactation = 0>>
<<set $activeSlave.hipsImplant = 0>>
<<set $activeSlave.buttImplant = 0>>
<<set $activeSlave.buttImplantType = 0>>
<<set $activeSlave.lipsImplants = 0>>
<<set $activeSlave.lipsPiercing = 0>>
<<set $activeSlave.tonguePiercing = 0>>
<<set $activeSlave.vaginaPiercing = 0>>
<<set $activeSlave.preg = 0>>
<<set $activeSlave.pregType = 0>>
<<set $activeSlave.pregKnown = 0>>
<<set $activeSlave.belly = 0>>
<<set $activeSlave.bellyPreg = 0>>
<<set $activeSlave.bellyFluid = 0>>
<<set $activeSlave.bellyImplant = -1>>
<<set $activeSlave.clitPiercing = 0>>
<<set $activeSlave.dickPiercing = 0>>
<<set $activeSlave.makeup = 0>>
<<set $activeSlave.nails = 0>>
<<set $activeSlave.earPiercing = 0>>
<<set $activeSlave.nosePiercing = 0>>
<<set $activeSlave.eyebrowPiercing = 0>>
<<set $activeSlave.stampTat = 0>>
<<set $activeSlave.bellyTat = 0>>
<<set $activeSlave.anusPiercing = 0>>
<<set $activeSlave.anusTat = 0>>
<<set $activeSlave.shouldersTat = 0>>
<<set $activeSlave.armsTat = 0>>
<<set $activeSlave.legsTat = 0>>
<<set $activeSlave.backTat = 0>>
<<set $activeSlave.combatSkill = 0>>
<<set $activeSlave.whoreSkill = 0>>
<<set $activeSlave.entertainSkill = 0>>
<<set $activeSlave.oralSkill = 0>>
<<set $activeSlave.analSkill = 0>>
<<set $activeSlave.vaginalSkill = 0>>
<<set $activeSlave.accent = 4>>
<<set $activeSlave.canRecruit = 0>>
<<set $activeSlave.hStyle = "long">>
<<set $activeSlave.hLength = 300>>
<<if $activeSlave.pubicHStyle != "hairless">>
	<<set $activeSlave.pubicHStyle = either("bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless")>>
<</if>>
<<if $activeSlave.underArmHStyle != "hairless">>
	<<set $activeSlave.underArmHStyle = either("bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless")>>
<</if>>
<<if $activeSlave.fetish == "mindbroken">>
	<<set $activeSlave.fetish = "none">>
<</if>>
<<if $incubatorImprintSetting == "terror">>
	<<set $activeSlave.origin = "Shortly after birth, she was sealed in an aging tank until she was of age. She knows only of the terror that awaits her should she not obey her master.">>
<<else>>
	<<set $activeSlave.origin = "Shortly after birth, she was sealed in an aging tank until she was of age. She knows nothing of the world outside of what the tank imprinted her with.">>
<</if>>
<<set $activeSlave.career = "a slave since birth">>
<<set $activeSlave.birthName =  $activeSlave.slaveName>>
<<set $activeSlave.birthSurname = $activeSlave.slaveSurname>>
<<set $activeSlave.intelligenceImplant = 0>>
<<set $activeSlave.navelPiercing = 0>>
<<set $activeSlave.devotion = 0>>
<<set $activeSlave.trust = 0>>
<<set $activeSlave.weekAcquired = $week>>
<<if $activeSlave.nationality == "Stateless">>
	<<if $arcologies[0].FSRomanRevivalist > 90>>
		<<set $activeSlave.nationality = "Roman Revivalist">>
	<<elseif $arcologies[0].FSAztecRevivalist > 90>>
		<<set $activeSlave.nationality = "Aztec Revivalist">>
	<<elseif $arcologies[0].FSEgyptianRevivalist > 90>>
		<<set $activeSlave.nationality = "Ancient Egyptian Revivalist">>
	<<elseif $arcologies[0].FSEdoRevivalist > 90>>
		<<set $activeSlave.nationality = "Edo Revivalist">>
	<<elseif $arcologies[0].FSArabianRevivalist > 90>>
		<<set $activeSlave.nationality = "Arabian Revivalist">>
	<<elseif $arcologies[0].FSChineseRevivalist > 90>>
		<<set $activeSlave.nationality = "Ancient Chinese Revivalist">>
	<</if>>
<</if>>

<<set $mergeMom = 0>>
<<set $mergeDad = 0>>
