code:
:: slave creation widgets [widget nobr]

/%
 Call as <<StartingGirlsWorkaround>>
%/
<<widget "StartingGirlsWorkaround">>
	<<include "Generate New Slave">>
	<<set $startingGirlCopied = 0>>
	<<set $activeSlave.health = 0>>
	<<set $activeSlave.devotion = 0>>
	<<set $activeSlave.trust = 0>>
	<<set $activeSlave.sexualQuirk = "none">>
	<<set $activeSlave.behavioralQuirk = "none">>
	<<set $activeSlave.fetishKnown = 1>>
	<<if $activeSlave.vagina < 0>>
		<<set $activeSlave.ovaries = 0>>
	<<elseif $activeSlave.vagina < 1>>
		<<set $activeSlave.skill.vaginal = 0>>
	<</if>>
	<<if $activeSlave.anus < 1>>
		<<set $activeSlave.skill.anal = 0>>
	<</if>>

	<<set $activeSlave.actualAge = Number($activeSlave.actualAge) || 18>>
	<<set $activeSlave.devotion = Number($activeSlave.devotion) || 0>>
	<<set $activeSlave.trust = Number($activeSlave.trust) || 0>>
	<<if $activeSlave.indenture >= 0>>
		<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208) || 26>>
	<</if>>
	<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274) || 140>>
	<<set $activeSlave.boobs = Math.clamp(Math.trunc($activeSlave.boobs/50)*50, 0, 50000) || 200>>
<</widget>>

/%
 Call as <<SaleDescription>>
%/
<<widget "SaleDescription">>
	<<replace #slaveinfo>>
		<<set $saleDescription = 1>>
		<<include "Long Slave Description">>
	<</replace>>
<</widget>>

<<widget "SlaveCostDescription">>
	<<StartingSlaveCost $activeSlave>>
	<<if $slaveCost > $cash>>
	@@.red;This slave will cost ''<<print cashFormat($slaveCost)>>.''

	You only have: <<print cashFormat($cash)>>@@
	<<else>>
	This slave will cost @@.yellowgreen;''<<print cashFormat($slaveCost)>>.''@@

	You have <<print cashFormat($cash)>>.
	<</if>>
<</widget>>
/%
 Call as <<StartingGirlsCost>>
%/
<<widget "StartingGirlsCost">>

<<replace "#cost">>
<<SlaveCostDescription>>
<</replace>>
<<if $cash >= $slaveCost>>
	<<set $activeSlave.actualAge = Number($activeSlave.actualAge) || 18>>
	<<set $activeSlave.devotion = Number($activeSlave.devotion) || 0>>
	<<set $activeSlave.trust = Number($activeSlave.trust) || 0>>
	<<if $activeSlave.indenture >= 0>>
		<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208) || 26>>
	<</if>>
	<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274) || 140>>
	<<set $activeSlave.boobs = Math.clamp(Math.trunc($activeSlave.boobs/50)*50, 0, 50000) || 200>>
	<<set $slaveWithoutBonuses = $activeSlave>>
	<<if $PC.career != "engineer">>

		<<link "Add this slave">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 1, $careerBonusApplied = 0>>
			<<StartingSlaveCost $activeSlave>>
			<<run cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave)>>
			<<goto "RG AS Dump">>
		<</link>>
		//This will apply your @@.springgreen;career bonus@@ to $him:
		<<if $PC.career == "capitalist">>
			one free level of @@.cyan;prostitution skill.@@
		<<elseif $PC.career == "mercenary">>
			@@.mediumaquamarine;+10 trust.@@
		<<elseif $PC.career == "slaver">>
			@@.hotpink;+10 devotion.@@
		<<elseif $PC.career == "medicine">>
			free @@.lime;basic implants.@@
		<<elseif $PC.career == "celebrity">>
			one free level of @@.cyan;entertainment skill.@@
		<<elseif $PC.career == "gang">>
			@@.green;+5 health@@ and a free level of @@.cyan;combat skill@@
		<<elseif $PC.career == "escort">>
			two free levels of @@.cyan;sex skills,@@ one free level of @@.cyan;prostitution skill,@@ and one free level of @@.cyan;entertainment skill.@@
		<<elseif $PC.career == "servant">>
			@@.mediumaquamarine;+10 trust@@ and @@.hotpink;+10 devotion.@@
		<<elseif $PC.career == "wealth">>
			two free levels of @@.cyan;sex skills.@@
		<<elseif $PC.career == "BlackHat">>
			one free level of @@.cyan;intelligence.@@
		<<else>>
			@@.hotpink;+10 devotion,@@ one free level of @@.cyan;prostitution skill@@ and @@.cyan;entertainment skill,@@ and two free levels of @@.cyan;sex skills.@@
		<</if>>//

		<<link "Add slave without career bonus">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 0, $careerBonusApplied = 0>>
			<<StartingSlaveCost $activeSlave>>
			<<run cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave)>>
			<<goto "RG AS Dump">>
		<</link>>
	<<else>>

		<<link "Add slave">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 0, $careerBonusApplied = 0>>
			<<StartingSlaveCost $activeSlave>>
			<<run cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave)>>
			<<goto "RG AS Dump">>
		<</link>>

	<</if>>
<<else>>

//You lack the necessary funds to add this slave.//
<</if>>

[[Discard this slave and continue|Acquisition]]
<</widget>>

/%
 Call as <<CustomSlaveAge>>
%/
<<widget "CustomSlaveAge">>
	<<replace #age>>
		<<if $customSlave.age < 3>>2- years old.
		<<elseif $customSlave.age < 5>>3-4 years old.
		<<elseif $customSlave.age < 7>>5-6 years old.
		<<elseif $customSlave.age < 10>>7-9 years old.
		<<elseif $customSlave.age < 13>>10-12 years old.
		<<elseif $customSlave.age < 15>>13-14 years old.
		<<elseif $customSlave.age < 18>>15-17 years old.
		<<elseif $customSlave.age < 20>>18-19 years old.
		<<elseif $customSlave.age < 25 && $retirementAge >= 25>>20-24 years old.
		<<elseif $customSlave.age < 25 && $retirementAge >= 20>>20+ years old.
		<<elseif $customSlave.age < 30 && $retirementAge >= 30>>25-29 years old.
		<<elseif $customSlave.age < 30 && $retirementAge >= 25>>25+ years old.
		<<elseif $customSlave.age < 40 && $retirementAge >= 40>>30-39 years old.
		<<elseif $customSlave.age < 40 && $retirementAge >= 30>>30+ years old.
		<<elseif $customSlave.age < 50 && $retirementAge >= 50>>40-49 years old.
		<<elseif $customSlave.age < 50 && $retirementAge >= 40>>40+ years old.
		<<elseif $customSlave.age < 60 && $retirementAge >= 60>>50-59 years old.
		<<elseif $customSlave.age < 60 && $retirementAge >= 50>>50+ years old.
		<<elseif $customSlave.age < 70 && $retirementAge >= 70>>60-69 years old.
		<<elseif $customSlave.age < 70 && $retirementAge >= 60>>60+ years old.
		<<elseif $customSlave.age < 80 && $retirementAge >= 80>>70-79 years old.
		<<elseif $customSlave.age < 80 && $retirementAge >= 70>>70+ years old.
		<<elseif $customSlave.age < 90 && $retirementAge >= 90>>80-89 years old.
		<<elseif $customSlave.age < 90 && $retirementAge >= 80>>80+ years old.
		<<elseif $customSlave.age < 100 && $retirementAge >= 100>>90-99 years old.
		<<elseif $customSlave.age < 100 && $retirementAge >= 90>>90+ years old.
		<<elseif $customSlave.age < 110 && $retirementAge >= 110>>100-109 years old.
		<<elseif $customSlave.age < 110 && $retirementAge >= 100>>100+ years old.
		<<elseif $customSlave.age < 120 && $retirementAge >= 120>>110-119 years old.
		<<elseif $customSlave.age < 120 && $retirementAge >= 110>>110+ years old.
		<<elseif $customSlave.age < 130 && $retirementAge >= 130>>120-129 years old.
		<<elseif $customSlave.age < 130 && $retirementAge >= 120>>120+ years old.
		<<else>>130+ years old.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveHealth>>
%/
<<widget "CustomSlaveHealth">>
	<<replace #health>>
		<<if $customSlave.health == 0>>Healthy.
		<<else>>Extremely healthy.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveMuscles>>
%/
<<widget "CustomSlaveMuscles">>
	<<replace #muscles>>
		<<if $customSlave.muscles > 95>>
			Ripped.
		<<elseif $customSlave.muscles > 50>>
			Muscular.
		<<elseif $customSlave.muscles > 30>>
			Well built.
		<<elseif $customSlave.muscles > 5>>
			Toned.
		<<elseif $customSlave.muscles > -6>>
			Soft.
		<<elseif $customSlave.muscles > -31>>
			Quite weak.
		<<elseif $customSlave.muscles > -51>>
			Rather weak.
		<<elseif $customSlave.muscles > -96>>
			Very weak.
		<<else>>
			Frail.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveLips>>
%/
<<widget "CustomSlaveLips">>
	<<replace #lips>>
		<<if $customSlave.lips <= 10>>Thin lips.
		<<elseif $customSlave.lips <= 20>>Normal lips.
		<<elseif $customSlave.lips <= 40>>Plush lips.
		<<elseif $customSlave.lips <= 70>>Big lips.
		<<elseif $customSlave.lips <= 95>>Huge lips.
		<<else>>Facepussy.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveVoice>>
%/
<<widget "CustomSlaveVoice">>
	<<replace #voice>>
		<<if $customSlave.voice == 3>>High, girly voice.
		<<elseif $customSlave.voice == 2>>Feminine voice.
		<<elseif $customSlave.voice == 1>>Deep voice.
		<<elseif $customSlave.voice == 0>>Mute.
		<<else>>Voice is unimportant.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveHeight>>
%/
<<widget "CustomSlaveHeight">>
	<<replace #height>>
		<<if $customSlave.heightMod == "greatly below average">>Petite.
		<<elseif $customSlave.heightMod == "below average">>Short.
		<<elseif $customSlave.heightMod == "normal">>Average height.
		<<elseif $customSlave.heightMod == "above average">>Tall.
		<<else>>Very tall.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveWeight>>
%/
<<widget "CustomSlaveWeight">>
	<<replace #weight>>
		<<if $customSlave.weight == -50>>Very thin.
		<<elseif $customSlave.weight == -15>>Thin.
		<<elseif $customSlave.weight == 0>>Average weight.
		<<elseif $customSlave.weight == 15>>Chubby.
		<<elseif $customSlave.weight == 50>>Plump.
		<<elseif $customSlave.weight == 100>>Fat.
		<<elseif $customSlave.weight == 150>>Very Fat.
		<<else>>Immobile.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveFace>>
%/
<<widget "CustomSlaveFace">>
	<<replace #face>>
		<<if $customSlave.face < -40>>Very unattractive face.
		<<elseif $customSlave.face < -10>>Unattractive face.
		<<elseif $customSlave.face <= 10>>Average face.
		<<elseif $customSlave.face <= 40>>Attractive face.
		<<elseif $customSlave.face > 40>>Very attractive face.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveRace>>
%/
<<widget "CustomSlaveRace">>
	<<replace #ethnicity>>
		<<textbox "$customSlave.race" $customSlave.race "Custom Slave">>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSkin>>
%/
<<widget "CustomSlaveSkin">>
	<<replace #skin>>
		<<textbox "$customSlave.skin" $customSlave.skin "Custom Slave">>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveBoobs>>
%/
<<widget "CustomSlaveBoobs">>
	<<replace #boobs>>
		<<if $customSlave.boobs == 200>>Flat chest.
		<<elseif $customSlave.boobs <= 500>>Healthy breasts.
		<<elseif $customSlave.boobs <= 800>>Big breasts.
		<<elseif $customSlave.boobs <= 1400>>Huge breasts.
		<<elseif $customSlave.boobs <= 2100>>Giant breasts.
		<<else>>Massive breasts.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveButt>>
%/
<<widget "CustomSlaveButt">>
	<<replace #butt>>
		<<if $customSlave.butt == 1>>Flat buttocks.
		<<elseif $customSlave.butt < 4>>Healthy buttocks.
		<<elseif $customSlave.butt < 6>>Huge buttocks.
		<<else>>Massive buttocks.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSex>>
%/
<<widget "CustomSlaveSex">>
	<<replace #sex>>
		<<if $customSlave.sex == 1>>Female (cock & balls options not applied).
		<<elseif $customSlave.sex == 2>>Male (pussy options not applied).
		<<else>>Futanari (clit options not applied).
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveVirgin>>
%/
<<widget "CustomSlaveVirgin">>
	<<replace #virgin>>
		<<if $customSlave.virgin == 0>>Vaginal virgin.
		<<else>>Virginity not important.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveVagina>>
%/
<<widget "CustomSlaveVagina">>
	<<replace #vagina>>
		<<if $customSlave.vagina == -1>>No vagina.
		<<elseif $customSlave.vagina == 0>>Vaginal virgin.
		<<else>>Normal vagina.
		<</if>>
		<<link "No vagina">>
			<<set $customSlave.vagina = -1, $customSlave.preg = 0, WombFlush($activeSlave), $customSlave.ovaries = 0>>
			<<CustomSlaveVagina>>
		<</link>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveDick>>
%/
<<widget "CustomSlaveDick">>
	<<replace #dick>>
		<<if $customSlave.dick == 0>>No penis.
		<<elseif $customSlave.dick == 2>>Small penis.
		<<else>>Large penis.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveBalls>>
%/
<<widget "CustomSlaveBalls">>
	<<replace #balls>>
		<<if $customSlave.balls == 0>>No testicles.
		<<elseif $customSlave.balls == 2>>Small testicles.
		<<elseif $customSlave.balls == 4>>Large testicles.
		<<else>>Huge Balls.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveClit>>
%/
<<widget "CustomSlaveClit">>
	<<replace #clit>>
		<<if $customSlave.clit == 0>>Normal clitoris.
		<<elseif $customSlave.clit == 1>>Big clitoris.
		<<elseif $customSlave.clit == 3>>Enormous clitoris.
		<<else>>Pseudophallus.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveLabia>>
%/
<<widget "CustomSlaveLabia">>
	<<replace #labia>>
		<<if $customSlave.labia == 0>>Normal labia.
		<<elseif $customSlave.labia == 1>>big labia.
		<<elseif $customSlave.labia == 2>>Huge labia.
		<<else>>Enormous labia.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveClitBalls>>
%/
<<widget "CustomSlaveClitBalls">>
	<<replace #clitballs>>
	<<if $customSlave.dick > 0>>
	<<if $customSlave.balls == 0>>No testicles.<<elseif $customSlave.balls == 2>>Small testicles.<<else>>Large testicles.<</if>>
	<<link "No testicles">>
		<<set $customSlave.balls = 0,$customSlave.clit = 0>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Small testicles">>
		<<set $customSlave.balls = 2,$customSlave.clit = 0>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Large testicles">>
		<<set $customSlave.balls = 4,$customSlave.clit = 0>>
		<<CustomSlaveClitBalls>>
	<</link>>
	<<else>>
	<<if $customSlave.clit == 0>>Normal clitoris.<<elseif $customSlave.clit == 0>>Big clitoris.<<else>>Enormous clitoris.<</if>>
	<<link "Normal clitoris">>
		<<set $customSlave.clit = 0>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Big clitoris">>
		<<set $customSlave.clit = 1>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Enormous clitoris">>
		<<set $customSlave.clit = 2>>
		<<CustomSlaveClitBalls>>
	<</link>>

	<<if $customSlave.labia == 0>>Minimal labia.<<elseif $customSlave.labia == 1>>Normal labia.<<elseif $customSlave.labia == 2>>Huge labia.<<else>>Enormous labia.<</if>>
	<<link "Minimal labia">>
		<<set $customSlave.labia = 0>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Normal labia">>
		<<set $customSlave.labia = 1>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Huge labia">>
		<<set $customSlave.labia = 2>>
		<<CustomSlaveClitBalls>>
	<</link>>
	|
	<<link "Enormous labia">>
		<<set $customSlave.labia = 3>>
		<<CustomSlaveClitBalls>>
	<</link>>
	<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveLube>>
%/
<<widget "CustomSlaveLube">>
	<<replace #lube>>
		<<if $customSlave.vaginaLube == 0>>Dry vagina.
		<<elseif $customSlave.vaginaLube == 1>>Wet vagina.
		<<else>>Sopping wet vagina.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveAnalVirginity>>
%/
<<widget "CustomSlaveAnalVirginity">>
	<<replace #anus>>
		<<if $customSlave.analVirgin == 0>>Anal virgin.
		<<else>>Anal virginity is not important.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveAnus>>
%/
<<widget "CustomSlaveAnus">>
	<<replace #anus>>
		<<if $customSlave.anus == 0>>Anal virgin.
		<<else>>Normal anus.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSkills>>
%/
<<widget "CustomSlaveSkills">>
	<<replace #skills>>
		<<if $customSlave.skills <= 10>>Sexually unskilled.
		<<elseif $customSlave.skills <= 15>>Basic sex skills.
		<<else>>Sexually skilled.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveWhoreSkills>>
%/
<<widget "CustomSlaveWhoreSkills">>
	<<replace #whoreskills>>
		<<if $customSlave.whoreSkills <= 10>>Unskilled at prostitution and entertainment.
		<<elseif $customSlave.whoreSkills <= 15>>Basic prostitution and entertainment skills.
		<<else>>Skilled at prostitution and entertainment.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveCombatSkills>>
%/
<<widget "CustomSlaveCombatSkills">>
	<<replace #combatskills>>
		<<if $customSlave.skill.combat == 0>>Unskilled at combat.
		<<else>>Skilled at combat.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveIntelligence>>
%/
<<widget "CustomSlaveIntelligence">>
	<<replace #intelligence>>
		<<if $customSlave.intelligence >= 3>>Brilliant.
		<<elseif $customSlave.intelligence == 2>>Very smart.
		<<elseif $customSlave.intelligence == 1>>Smart.
		<<elseif $customSlave.intelligence == 0>>Average intelligence.
		<<elseif $customSlave.intelligence == -1>>Stupid.
		<<elseif $customSlave.intelligence == -2>>Very stupid.
		<<else>>Moronic.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveEducation>>
%/
<<widget "CustomSlaveEducation">>
	<<replace #education>>
		<<if $customSlave.intelligenceImplant >= 30>>Well educated.
		<<elseif $customSlave.intelligenceImplant >= 15>>Educated.
		<<else>>Uneducated.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveNationality>>
%/
<<widget "CustomSlaveNationality">>
	<<replace #nationality>>
		Nationality: $customSlave.nationality.
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveEyes>>
%/
<<widget "CustomSlaveEyes">>
	<<replace #eyes>>
		<<if $seeExtreme == 1>>
			<<if $customSlave.eyes == -2>>Blind.
			<<elseif $customSlave.eyes == -1>>Nearsighted.
			<<else>>Normal.
			<</if>>
		<<else>>
			<<if $customSlave.eyes == -1>>Nearsighted.
			<<else>>Normal.
			<</if>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveEars>>
%/
<<widget "CustomSlaveEars">>
	<<replace #hears>>
		<<if $seeExtreme == 1>>
			<<if $customSlave.hears == -2>>Deaf.
			<<elseif $customSlave.hears == -1>>Hard of hearing.
			<<else>>Normal.
			<</if>>
		<<else>>
			<<if $customSlave.hears == -1>>Hard of hearing.
			<<else>>Normal.
			<</if>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSmell>>
%/
<<widget "CustomSlaveSmell">>
	<<replace #smelling>>
		<<if $seeExtreme == 1>>
			<<if $customSlave.smells == -1>>None.
			<<else>>Normal.
			<</if>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveTaste>>
%/
<<widget "CustomSlaveTaste">>
	<<replace #tasting>>
		<<if $seeExtreme == 1>>
			<<if $customSlave.tastes == -1>>None.
			<<else>>Normal.
			<</if>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveAmp>>
%/
<<widget "CustomSlaveAmp">>
	<<replace #amputation>>
		<<if $customSlave.amp == 1>>Limbless.
		<<else>>Limbed.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<GenerateMarketSlave 'market' ['arcology']>>
	If $args[0] is undefined, will generate a kidnapper's market slave.
	If $args[0] is "neighbor", $numArcology is used as the index of which neighbor to use.

%/
<<widget GenerateMarketSlave>>
<<if $args[0]>>
	<<set _market = $args[0]>>
<<else>>
	<<set _market = "kidnappers">>
<</if>>

<<switch _market>>
<<case "corporate">>
	<<if $corpSpecAge == 1>>
		<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
		<<set $activeSlaveOneTimeMaxAge = 19>>
	<<elseif $corpSpecAge == 3>>
		<<if $pedo_mode == 1>>
			<<set $activeSlaveOneTimeMinAge = 24>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge>>
		<<else>>
			<<set $activeSlaveOneTimeMinAge = 36>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge>>
		<</if>>
	<</if>>
	<<set $one_time_age_overrides_pedo_mode = 1>>
	<<if $corpSpecRaces.length > 0>>
		<<set $fixedRace = $corpSpecRaces.random()>>
	<</if>>
	<<if $corpSpecGender == 1>>
		Slaves without pussies are not trained.
		<<include "Generate XX Slave">>
	<<elseif $corpSpecGender == 2>>
		Slaves without dicks are not trained.
		<<include "Generate XY Slave">>
	<<else>>
		Slaves are passed to training regardless of whether they have dicks or pussies.
		<<include "Generate New Slave">>
	<</if>>
	<<set $activeSlave.origin = "She was enslaved and trained by your corporation.">>
	<<set $activeSlave.devotion = random(-30,0)>>
	<<set $activeSlave.trust = random(-45,-25)>>
	<<set $activeSlave.health = random(25,50)>>

	<<if $corpSpecDevotion > 0>>
		<<set $activeSlave.devotion = random(-120,-90) + $corpSpecDevotion * 30>>
		<<if $corpSpecDevotion == 1>>
			It does everything it can to make trainees furious.
		<<elseif $corpSpecDevotion == 2>>
			It makes no effort to tame trainees.
		<<elseif $corpSpecDevotion == 4>>
			It focuses on selecting trainees predisposed towards obedience.
		<<elseif $corpSpecDevotion == 5>>
			It focuses on selecting trainees predisposed towards devotion to their owner.
		<</if>>
	<<else>>
		It does not select trainees based on their initial feelings about slavery.
	<</if>>
	<<if $corpSpecIntelligence == 3>>
		Intelligent slaves have a high priority for training.
		<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [30,100]})>>
	<<elseif $corpSpecIntelligence == 1>>
		Stupid slaves have a high priority for training.
		<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-100,-30]})>>
	<<else>>
		Slaves' intelligence is not given special consideration.
	<</if>>
	<<if $corpSpecAge == 1>>
		Teenage slaves are strongly favored for training.
		/*<<set $activeSlave.age = random(18,19)>>*/
	<<elseif $corpSpecAge == 3>>
		Newly enslaved MILFs are strongly favored for training.
		/*<<set $activeSlave.age = random(36,$retirementAge)>>*/
	<<else>>
		Promising slaves are trained without special sorting based on age.
	<</if>>
	<<if $corpSpecRaces.length == 12>>
		There is no racial element to trainee selection.
	<<elseif $corpSpecRaces.length == 1>>
		<<set _corpSpecRace = $corpSpecRaces.random()>>
		The corporation specializes in <<print _corpSpecRace>> slaves.
	<<else>>
		The corporation selects slaves based on race. /*getting into the specifics of which races exactly is a hellhole I'd rather not jump into*/
	<</if>>
	<<if $corpSpecTrust > 0>>
		<<set $activeSlave.trust = random(-105,-85) + $corpSpecTrust * 20>>
		<<if $corpSpecTrust == 1>>
			The corporation applies extremely brutal slave breaking techniques, uncontrollable sobbing and bloodcurdling screams are heard around the clock.
		<<elseif $corpSpecTrust == 2>>
			The corporation applies brutal slave breaking techniques.
		<<elseif $corpSpecTrust == 4>>
			The corporation applies caring slave breaking techniques.
		<<else>>
			The corporation applies surprisingly caring slave breaking techniques that sometimes convince refugees and similar downtrodden people that slavery is a step up for them.
		<</if>>
	<<else>>
		The corporation applies standard slave breaking techniques.
	<</if>>
	<<if $corpSpecHeight > 0>>
		<<set $activeSlave.height = Math.trunc(Height.random($activeSlave, {limitMult: [$corpSpecHeight - 4, $corpSpecHeight - 2]}))>>
		<<if $corpSpecHeight == 1>>
			The corporation specifically targets very short slaves.
		<<elseif $corpSpecHeight == 2>>
			The corporation targets short slaves.
		<<elseif $corpSpecHeight == 4>>
			The corporation targets tall slaves.
		<<elseif $corpSpecHeight == 5>>
			The corporation specifically targets incredibly tall slaves.
		<</if>>
	<</if>>
	<<if $corpSpecVirgin == 1>>
		The corporation ensures its slaves are virgins.
		<<set $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > 0>>
			<<set $activeSlave.vagina = 0>>
		<</if>>
	<</if>>
	<<if $corpSpecWeight > 0>>
		<<set $activeSlave.weight = random(-85 + $corpSpecWeight * 20, -65 + $corpSpecWeight * 30)>>
		<<if $corpSpecWeight == 1>>
			Trainees are practically starved through a rigorous diet.
		<<elseif $corpSpecWeight == 2>>
			Trainees are put on a diet to get them nice and thin.
		<<elseif $corpSpecWeight == 3>>
			Thin trainees are fattened up; fat trainees are slimmed down.
		<<elseif $corpSpecWeight == 5>>
			Trainees are fattened until they're nice and curvy.
		<<else>>
			Trainees are fed as much as they can stomach.
		<</if>>
	<<else>>
		Only the unhealthiest trainees are fed special diets.
	<</if>>
	<<if $corpSpecMuscle > 0>>
		<<set $activeSlave.muscles = random(-85,-65) + $corpSpecMuscle * 25>>
		<<if $corpSpecMuscle == 1>>
			Trainees are kept physically inactive and frail.
		<<elseif $corpSpecMuscle == 2>>
			Trainees are kept physically weak.
		<<elseif $corpSpecMuscle == 3>>
			Trainees' muscles are kept soft.
		<<elseif $corpSpecMuscle == 4>>
			Trainees are brought up to a good state of physical fitness.
		<<elseif $corpSpecMuscle == 5>>
			Trainees are subjected to punishing workout routines and only sold when ripped.
		<</if>>
	<<else>>
		Trainees are not subjected to any special workout routine.
	<</if>>
	<<if $corpSpecAccent == 1>>
		The corporation teaches its trainees the lingua franca but allows them to retain distinctive accents.
		<<set $activeSlave.accent = Math.clamp($activeSlave.accent, 0, 1)>>
	<<elseif $corpSpecAccent == 2>>
		The corporation teaches its trainees to speak the lingua franca without accent.
		<<set $activeSlave.accent = 0>>
	<<else>>
		The corporation does not expend any special effort teaching language.
	<</if>>
	<<if $corpSpecEducation > 0>>
		<<set $activeSlave.intelligenceImplant = 15 * $corpSpecEducation,
		$activeSlave.skill.whoring = Math.clamp($activeSlave.skill.whoring, 15 * $corpSpecEducation, 100),
		$activeSlave.skill.entertainment = Math.clamp($activeSlave.skill.entertainment, 15 * $corpSpecEducation, 100)>>
		<<if $corpSpecEducation == 1>>
			Its slave students receive basic slave educations.
		<<elseif $corpSpecEducation == 2>>
			Its slave students receive advanced slave educations.
		<</if>>
	<<else>>
		Its slaves are not given special educational attention.
	<</if>>
	<<if $corpSpecSexEd > 0>>
		<<set $activeSlave.skill.oral = Math.clamp($activeSlave.skill.oral, 15 * $corpSpecSexEd, 100)>>
		<<if $activeSlave.anus > 0>>
			<<set $activeSlave.skill.anal = Math.clamp($activeSlave.skill.anal, 15 * $corpSpecSexEd, 100)>>
		<<elseif $activeSlave.anus == 0>>
			<<set $activeSlave.skill.anal = Math.clamp($activeSlave.skill.anal, 15, 100)>>
		<</if>>
		<<if $activeSlave.vagina > 0>>
			<<set $activeSlave.skill.vaginal = Math.clamp($activeSlave.skill.vaginal, 15 * $corpSpecSexEd, 100)>>
		<<elseif $activeSlave.vagina == 0>>
			<<set $activeSlave.skill.vaginal = Math.clamp($activeSlave.skill.vaginal, 15, 100)>>
		<</if>>
		<<if $corpSpecSexEd == 1>>
			Trainees spend many hours learning sexual competence.
		<<elseif $corpSpecSexEd == 2>>
			Trainees spend days learning sexual skills.
		<</if>>
	<<else>>
		No special sexual training is applied.
	<</if>>

	<<if $corpSpecCosmetics == 1>>
		The corporation uses subtle cosmetic surgery to improve its slaves for sale.
		<<if ($activeSlave.anus > 3)>>
			<<set $activeSlave.anus = 3>>
			<<if $activeSlave.skill.anal > 10>><<set $activeSlave.skill.anal -= 10>><</if>>
		<</if>>
		<<if ($activeSlave.vagina > 3)>>
			<<set $activeSlave.vagina = 3>>
			<<if $activeSlave.skill.vaginal > 10>><<set $activeSlave.skill.vaginal -= 10>><</if>>
		<</if>>
		<<if $activeSlave.faceImplant <= 30 && $activeSlave.face <= 95>>
			<<if $activeSlave.faceShape == "masculine">><<set $activeSlave.faceShape = "androgynous">><</if>>
			<<set $activeSlave.faceImplant = 20>>
			<<set $activeSlave.face = Math.clamp($activeSlave.face+20,-100,100)>>
		<</if>>
		<<if ($activeSlave.ageImplant != 1) && ($activeSlave.visualAge >= 25)>>
			<<set $activeSlave.ageImplant = 1>>
			<<AgeImplantAdjustment $activeSlave>>
		<</if>>
		<<if ($activeSlave.voice == 1) && ($activeSlave.voiceImplant == 0)>>
			<<set $activeSlave.voice += 1>>
			<<set $activeSlave.voiceImplant += 1>>
		<</if>>
		<<set $activeSlave.waist = Math.trunc($activeSlave.waist,-100,-15)>>
		<<if (($activeSlave.boobShape == "saggy") || ($activeSlave.boobShape == "downward-facing"))>>
			<<set $activeSlave.boobShape = "normal">>
		<</if>>
		<<if (($activeSlave.boobShape == "normal") || ($activeSlave.boobShape == "wide-set"))>>
			<<if $activeSlave.boobs > 800>><<set $activeSlave.boobShape = "torpedo-shaped">><<else>><<set $activeSlave.boobShape = "perky">><</if>>
		<</if>>
	<<else>>
		The corporation does not use cosmetic surgery to improve its slaves for sale.
	<</if>>
	<<if $corpSpecPussy == 1>>
		The corporation adds pussies where needed.
		<<set $activeSlave.vagina = 0,
		$activeSlave.ovaries = 1>>
	<<elseif $corpSpecPussy == -1>>
		The corporation removes pussies where possible.
		<<set $activeSlave.vagina = -1,
		$activeSlave.ovaries = 0>>
	<</if>>
	<<if $corpSpecDick == 1>>
		The corporation adds dicks where needed.
		<<set $activeSlave.dick = 2,
		$activeSlave.prostate = 1>>
	<<elseif $corpSpecDick == -1>>
		The corporation removes dicks where possible.
		<<set $activeSlave.dick = 0,
		$activeSlave.prostate = 0>>
	<</if>>
	<<if $corpSpecBalls == 1 && $activeSlave.dick > 0>>
		The corporation adds balls where needed.
		<<set $activeSlave.balls = 2>>
	<<elseif $corpSpecBalls == -1>>
		The corporation removes balls where possible.
		<<set $activeSlave.balls = 0,
		$activeSlave.scrotum = 0>>
	<</if>>
	<<if ndef $corpSpecPussy && ndef $corpSpecDick && ndef $corpSpecBalls>>
		The corporation does not reconfigure slave genitalia.
	<</if>>
	<<if $corpSpecHormones == 1>>
		It applies almost universal female hormone therapy.
		<<if ($activeSlave.dick > 0)>>
			<<set $activeSlave.dick = Math.clamp($activeSlave.dick-1, 1, 6)>>
		<</if>>
		<<if ($activeSlave.balls > 0)>>
			<<set $activeSlave.balls = Math.clamp($activeSlave.balls-1, 1, 6)>>
		<</if>>
		<<if ($activeSlave.clit > 0)>>
			<<set $activeSlave.clit = Math.clamp($activeSlave.clit-1, 0, 3)>>
		<</if>>
		<<if ($activeSlave.voice < 3) && ($activeSlave.voice > 0)>>
			<<set $activeSlave.voice = Math.clamp($activeSlave.voice+1, 1, 3)>>
		<</if>>
		<<if ($activeSlave.vagina > -1) && ($activeSlave.ovaries != 0) && ($activeSlave.vaginaLube < 2)>>
			<<set $activeSlave.vaginaLube = Math.clamp($activeSlave.vaginaLube+1, 0, 2)>>
		<</if>>
		<<if (($activeSlave.butt-$activeSlave.buttImplant) < 2)>>
			<<set $activeSlave.butt = Math.clamp($activeSlave.butt+1, 0, 10)>>
		<</if>>
		<<if (($activeSlave.boobs-$activeSlave.boobsImplant) < 500)>>
			<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs+400, 0, 10000)>>
		<</if>>
		<<if $activeSlave.face <= 95>>
			<<set $activeSlave.face = Math.clamp($activeSlave.face+20,-100,100)>>
		<</if>>
		<<if ($activeSlave.faceShape == "masculine")>>
			<<set $activeSlave.faceShape = "androgynous">>
		<<elseif ($activeSlave.faceShape == "androgynous")>>
			<<set $activeSlave.faceShape = "normal">>
		<</if>>
		<<if ($activeSlave.physicalAge < 25)>>
			<<set $activeSlave.shoulders = Math.clamp($activeSlave.shoulders-1, -2, 2)>>
			<<set $activeSlave.hips = Math.clamp($activeSlave.hips+1, -2, 2)>>
		<</if>>
		<<if ($activeSlave.muscles > 30) && ($activeSlave.diet != "muscle building") && ($generalUpgradeMuscle != "toned") && ($generalUpgradeMuscle != "ripped")>>
			<<set $activeSlave.muscles = Math.clamp($activeSlave.muscles-10, 0, 30)>>
		<</if>>
		<<if ($activeSlave.nipples == "tiny")>>
			<<set $activeSlave.nipples = "cute">>
		<</if>>
		<<if ($activeSlave.height > 180)>>
			<<set $activeSlave.height -= random(3,6)>>
		<</if>>
		<<set $activeSlave.devotion += random(5,10)>>
		<<set $activeSlave.trust += random(5,10)>>
		<<set $activeSlave.attrXY = Math.clamp($activeSlave.attrXY+random(5,10), 0, 100)>>
	<<elseif $corpSpecHormones == 2>>
		It applies almost universal male hormone therapy.
		<<if ($activeSlave.dick > 0)>>
			<<set $activeSlave.dick = Math.clamp($activeSlave.dick+1, 1, 6)>>
		<</if>>
		<<if ($activeSlave.balls > 0)>>
			<<set $activeSlave.balls = Math.clamp($activeSlave.balls+1, 1, 6)>>
		<</if>>
		<<if ($activeSlave.clit > 0) && ($activeSlave.dick == 0)>>
			<<set $activeSlave.clit = Math.clamp($activeSlave.clit+1, 0, 3)>>
		<</if>>
		<<if ($activeSlave.voice > 1)>>
			<<set $activeSlave.voice = Math.clamp($activeSlave.voice-1, 1, 3)>>
		<</if>>
		<<if ($activeSlave.vagina > -1) && ($activeSlave.vaginaLube > 0)>>
			<<set $activeSlave.vaginaLube = Math.clamp($activeSlave.vaginaLube-1, 0, 2)>>
		<</if>>
		<<set $activeSlave.butt = Math.clamp($activeSlave.butt-1, 0, 10)>>
		<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs-400, 0, 10000)>>
		<<if $activeSlave.face > 10>>
			<<set $activeSlave.face = Math.clamp($activeSlave.face-20,-100,100)>>
		<</if>>
		<<if ($activeSlave.faceShape == "androgynous")>>
			<<set $activeSlave.faceShape = "masculine">>
		<<else>>
			<<set $activeSlave.faceShape = "androgynous">>
		<</if>>
		<<if ($activeSlave.physicalAge < 25)>>
			<<set $activeSlave.shoulders = Math.clamp($activeSlave.shoulders+1, -2, 2)>>
			<<set $activeSlave.hips = Math.clamp($activeSlave.hips-1, -2, 2)>>
		<</if>>
		<<if ($activeSlave.muscles <= 95) && ($activeSlave.diet != "slimming")>>
			<<set $activeSlave.muscles = Math.clamp($activeSlave.muscles+20, 0, 3)>>
		<</if>>
		<<if ($activeSlave.nipples == "huge")>>
			<<set $activeSlave.nipples = "cute">>
		<</if>>
		<<if ($activeSlave.height < 155)>>
			<<set $activeSlave.height += random(3,6)>>
		<</if>>
		<<set $activeSlave.devotion -= random(5,10)>>
		<<set $activeSlave.trust -= random(5,10)>>
		<<set $activeSlave.attrXX = Math.clamp($activeSlave.attrXX+random(5,10), 0, 100)>>
	<<else>>
		It does not use hormones on a systematic level.
	<</if>>
	<<if $corpSpecInjection > 0>>
		<<if $corpSpecInjection == 1>>
			If anything, hormones are used to reduce asset sizes.
			<<set $activeSlave.lips = random(0, 20),
			$activeSlave.butt = random(1, 2),
			$activeSlave.boobs = 10 * random(30, 60),
			$activeSlave.nipples = either("cute", "tiny")>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.dick = random(1, 2)>>
			<</if>>
			<<if $activeSlave.balls > 0>>
				<<set $activeSlave.balls = random(1, 2)>>
			<</if>>
		<<elseif $corpSpecInjection == 2>>
			Growth hormones are used to correct flat chests and butts.
			<<set $activeSlave.lips = random(25, 45),
			$activeSlave.butt = random(3, 4),
			$activeSlave.boobs = 10 * random(70, 100),
			$activeSlave.nipples = either("cute", "partially inverted")>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.dick = random(3, 4)>>
			<</if>>
			<<if $activeSlave.balls > 0>>
				<<set $activeSlave.balls = random(3, 4)>>
			<</if>>
		<<elseif $corpSpecInjection == 3>>
			Growth hormones are used throughout slave training to ensure expansion.
			<<set $activeSlave.lips = random(35, 55),
			$activeSlave.butt = random(4, 5),
			$activeSlave.boobs = 10 * random(120, 180),
			$activeSlave.nipples = either("cute", "partially inverted")>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.dick = random(4, 5)>>
			<</if>>
			<<if $activeSlave.balls > 0>>
				<<set $activeSlave.balls = random(4, 5)>>
			<</if>>
		<<elseif $corpSpecInjection == 4>>
			Advanced growth hormones are applied on a grand scale.
			<<set $activeSlave.lips = random(55, 85),
			$activeSlave.butt = random(6, 8),
			$activeSlave.boobs = 100 * random(40, 60),
			$activeSlave.nipples = either("huge", "inverted")>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.dick = random(5, 6)>>
			<</if>>
			<<if $activeSlave.balls > 0>>
				<<set $activeSlave.balls = random(5, 6)>>
			<</if>>
		<<elseif $corpSpecInjection == 5>>
			Advanced growth hormones are applied with total focus on increasing slaves' productiveness.
			<<set $activeSlave.lips = random(35, 65),
			$activeSlave.butt = random(4, 6),
			$activeSlave.boobs = 100 * random(60, 80),
			$activeSlave.nipples = either("huge", "inverted")>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.dick = random(6, 8)>>
			<</if>>
			<<if $activeSlave.balls > 0>>
				<<set $activeSlave.balls = random(5, 7)>>
			<</if>>
		<</if>>
	<<else>>
		Growth hormones are not applied.
	<</if>>
	<<if $corpSpecImplants == 1>>
		Slaves are given tasteful breast, butt, and lip implants.
		<<set $activeSlave.buttImplant = 1>>
		<<set $activeSlave.butt = Math.clamp($activeSlave.butt+$activeSlave.buttImplant, 0, 10)>>
		<<set $activeSlave.boobsImplant = 600>>
		<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs+$activeSlave.boobsImplant, 0, 10000)>>
		<<set $activeSlave.lipsImplant = 20>>
		<<set $activeSlave.lips = Math.clamp($activeSlave.lips+$activeSlave.lipsImplant, 0, 55)>>
	<<elseif $corpSpecImplants == 2>>
		Slaves are given absurd breast, butt, and lip implants.
		<<set $activeSlave.buttImplant = 4>>
		<<set $activeSlave.butt = Math.clamp($activeSlave.butt+$activeSlave.buttImplant, 0, 10, $activeSlave.butt+$activeSlave.buttImplant)>>
		<<set $activeSlave.boobsImplant = 2400>>
		<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs+$activeSlave.boobsImplant, 0, 10000)>>
		<<set $activeSlave.lipsImplant = 60>>
		<<set $activeSlave.lips = Math.clamp($activeSlave.lipsImplant+$activeSlave.buttImplant, 0, 100)>>
	<<else>>
		Slaves are not given breast, butt, or lip implants.
	<</if>>
	<<if $corpSpecAmputee == 1>>
		The corporation removes all limbs from its slaves.
		<<set $activeSlave.amp = 1>>
	<</if>>
	<<if $corpSpecMilk == 1>>
		The corporation provides naturally lactating slaves
		<<set $activeSlave.lactation = 1,
		$activeSlave.lactationDuration = 2,
		$activeSlave.lactationAdaptation = 15>>
	<<elseif $corpSpecMilk == 2>>
		The corporation provides slaves with chemically induced lactation.
		<<set $activeSlave.lactation = 2,
		$activeSlave.lactationDuration = 2>>
	<</if>>

<<case "neighbor">>
	<<if ($numArcology < $arcologies.length) && ($numArcology > 0)>>
		<<set _market = $numArcology>>
	<<else>>
		<<set _market = 1>>
	<</if>>

	<<set $activeArcology = $arcologies[0]>>
	<<set $targetArcology = $arcologies[_market]>>
	<<include "Arcology Opinion">>
	<<set $opinion = Math.trunc($opinion/20)>>
	<<set $opinion = Math.clamp($opinion, -10, 10)>>

	<<if $arcologies[_market].FSSubjugationist > 20>>
		<<set $fixedRace = $arcologies[_market].FSSubjugationistRace>>
	<</if>>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from ">>
	<<set $activeSlave.origin += $arcologies[_market].name>>
	<<set $activeSlave.origin += ".">>
	<<set $activeSlave.devotion = -20 + Math.trunc($arcologies[_market].prosperity/10) + random(0,10)>>
	<<set $activeSlave.trust = -20 + Math.trunc($arcologies[_market].prosperity/10) + random(0,10)>>
	<<set $activeSlave.health = -50 + Math.trunc($arcologies[_market].prosperity/25) + random(0,5)>>
	<<if $activeSlave.vagina > 0>>
		<<set $activeSlave.skill.vaginal += Math.clamp($arcologies[_market].prosperity/2, 15, 100)>>
	<</if>>
	<<if $activeSlave.anus > 0>>
		<<set $activeSlave.skill.anal += Math.clamp($arcologies[_market].prosperity/2, 15, 100)>>
	<</if>>
	<<set $activeSlave.skill.oral += Math.clamp($arcologies[_market].prosperity/2, 15, 100)>>
	<<set $activeSlave.attrKnown = 1>>
	<<set $activeSlave.fetishKnown = 1>>
	<<if $activeSlave.accent >= 3>>
		<<if $arcologies[_market].prosperity > random(0,200)>>
			<<set $activeSlave.accent -= 1>>
		<</if>>
	<</if>>
	<<if $arcologies[_market].prosperity > random(0,200)>>
		<<set $activeSlave.sexualFlaw = "none">>
	<</if>>
	<<if $arcologies[_market].prosperity > random(0,200)>>
		<<set $activeSlave.behavioralFlaw = "none">>
	<</if>>
	<<if $arcologies[_market].FSSubjugationist > 20>>
		They're universally $arcologies[_market].FSSubjugationistRace.
	<</if>>

	<<if $arcologies[_market].FSRepopulationFocus > 50>>
		They are exclusively female and all extremely pregnant.
		<<set $activeSlave.ovaries = 1>>
		<<set $activeSlave.vagina = random(0,1,1,1,1,2,2,3,3,3,3)>>
		<<set $activeSlave.dick = 0>>
		<<set $activeSlave.balls = 0>>
		<<set $activeSlave.scrotum = 0>>
		<<set $activeSlave.preg = 0>> /*removing contraception of default slave generation so isFertile can work right*/
		<<if isFertile($activeSlave)>>
			<<set $activeSlave.vagina = random(1,4)>>
			<<set $activeSlave.preg = random(21,39)>>
			<<if random(1,2) == 1 && $seeHyperPreg == 1>>
				<<set $activeSlave.pregType = random(3,29)>>
				<<set $activeSlave.pregAdaptation = 250>>
			<<else>>
				<<set $activeSlave.pregType = random(3,8)>>
				<<set $activeSlave.pregAdaptation = 100>>
			<</if>>
			<<run SetBellySize($activeSlave)>>
		<</if>>
		<<set $activeSlave.lactation = random(0,1)>>
		<<if $activeSlave.lactation > 0>>
			<<set $activeSlave.lactationDuration = 2>>
		<</if>>
	<<elseif $arcologies[_market].FSRestart > 50>>
		They have all been rendered unable to reproduce.
		<<if $activeSlave.ovaries == 1>>
			<<set $activeSlave.preg = -2, $activeSlave.belly = 0, $activeSlave.bellyPreg = 0>>
		<</if>>
		<<if $activeSlave.balls > 0>>
			<<set $activeSlave.balls = 0>>
		<</if>>
		<<if $arcologies[_market].FSRestartResearch == 1>>
			Smart and attractive slaves are beginning to be a rarity lately.
			<<if $activeSlave.face >= 0>>
				<<set $activeSlave.face -= 100>>
			<</if>>
			<<if $activeSlave.intelligence >= 0>>
				<<set $activeSlave.intelligence -= 100>>
			<</if>>
			<<set $activeSlave.chem = random(40,100)>>
			<<set $activeSlave.addict = either(0,0,0,0,0,0,0,0,5,20,20,50,100)>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSGenderRadicalist > 50>>
		They all show signs of intensive hormone therapy.
		<<set $activeSlave.chem += random(10,100)>>
		<<if $activeSlave.dick > 0>>
			<<set $activeSlave.boobs += 100*random(0,4)>>
			<<set $activeSlave.butt += random(0,2)>>
			<<if $activeSlave.hips < 2>>
				<<set $activeSlave.hips += random(0,1)>>
			<</if>>
			<<if $activeSlave.shoulders > -2>>
				<<set $activeSlave.shoulders -= random(0,1)>>
			<</if>>
			<<if $activeSlave.face < 80>>
				<<set $activeSlave.face += random(0,20)>>
			<</if>>
			<<if $activeSlave.faceShape == "masculine">>
				<<if random(0,1) == 0>>
					<<set $activeSlave.faceShape = "androgynous">>
				<</if>>
			<</if>>
			<<if $activeSlave.dick > 2>>
				<<set $activeSlave.dick -= random(0,2)>>
			<</if>>
			<<if $activeSlave.balls > 2>>
				<<set $activeSlave.balls -= random(0,2)>>
			<</if>>
			<<if $arcologies[_market].FSGenderRadicalistResearch == 1 && random(1,100) <= 20>>
				This one has a notably rounded belly for a slave with no vagina.
				<<set $activeSlave.ovaries = 0>>
				<<set $activeSlave.vagina = -1>>
				<<set $activeSlave.mpreg = 1>>
				<<if isFertile($activeSlave)>>
					<<set $activeSlave.preg = random(1,39)>>
					<<set $activeSlave.pregType = setPregType($activeSlave)>>
					<<run SetBellySize($activeSlave)>>
				<</if>>
			<</if>>
		<<else>>
			<<set $activeSlave.boobs -= 100*random(0,2)>>
			<<set $activeSlave.butt -= random(0,1)>>
			<<if $activeSlave.hips > -2>>
				<<set $activeSlave.hips -= random(0,1)>>
			<</if>>
			<<if $activeSlave.shoulders < 2>>
				<<set $activeSlave.shoulders += random(0,1)>>
			<</if>>
			<<if $activeSlave.face >= -80>>
				<<set $activeSlave.face -= random(0,20)>>
			<</if>>
			<<if $activeSlave.faceShape != "androgynous">>
				<<if random(0,1) == 0>>
					<<set $activeSlave.faceShape = "androgynous">>
				<</if>>
			<</if>>
			<<set $activeSlave.clit += random(0,2)>>
			<<set $activeSlave.labia += random(0,1)>>
			<<if $activeSlave.muscles <= 95>>
				<<set $activeSlave.muscles += random(0,20)>>
			<</if>>
		<</if>>
	<<elseif $arcologies[_market].FSGenderFundamentalist > 50>>
		Fertile slaves from there almost never appear without swollen bellies and sensitive nipples.
		<<set $activeSlave.preg = 0>> /*removing contraception of default slave generation so isFertile can work right*/
		<<if isFertile($activeSlave)>>
			<<set $activeSlave.preg = random(1,40)>>
			<<set $activeSlave.pregType = setPregType($activeSlave)>>
			<<run SetBellySize($activeSlave)>>
			<<set $activeSlave.lactation = random(0,1)>>
			<<if $activeSlave.lactation > 0>>
				<<set $activeSlave.lactationDuration = 2>>
			<</if>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSPaternalist > 20>>
		They're often gratifyingly devoted and trusting.
		<<if $activeSlave.devotion < 10>>
			<<set $activeSlave.devotion += random(0,8)>>
		<</if>>
		<<if $activeSlave.trust < 50>>
			<<set $activeSlave.trust += random(0,8)>>
		<</if>>
	<<elseif $arcologies[_market].FSDegradationist > 20>>
		They can be depended upon to be terrified into abject submission.
		<<run DegradingName($activeSlave)>>
		<<if $activeSlave.trust > -10>>
			<<set $activeSlave.trust -= random(0,10)>>
		<</if>>
		<<if random (1,100) > 90>>
			<<set $activeSlave.eyes = -2>>
		<</if>>
		<<if random (1,100) > 90>>
			<<set $activeSlave.hears = -2>>
		<</if>>
		<<if $arcologies[_market].FSRepopulationFocus == "unset" && $arcologies[_market].FSBodyPurist == "unset">>
			<<if isFertile($activeSlave) && random(1,10) == 9>>
				<<set $activeSlave.abortionTat = random(1, (Math.min($activeSlave.physicalAge-$fertilityAge, $activeSlave.physicalAge-$minimumSlaveAge))*2)>>
			<</if>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSBodyPurist > 80>>
		They're quite pristine, free of any genomic damage or addictions regardless of any transformations they've had.
		<<set $activeSlave.chem = 0>>
		<<set $activeSlave.addict = 0>>
	<<elseif $arcologies[_market].FSTransformationFetishist > 80>>
		They vary in terms of what size their implants are, not whether they have them.
		<<set $activeSlave.chem += random(10,100)>>
		<<set $activeSlave.boobsImplant = 200*random(2,20)>>
		<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
		<<set $activeSlave.buttImplant = random(2,5)>>
		<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<<set $activeSlave.lipsImplant = either(10,20)>>
		<<set $activeSlave.lips += $activeSlave.lipsImplant>>
		<<if $arcologies[_market].FSTransformationFetishistResearch == 1 && random(1,100) <= 20>>
			This one's implants are unusually large; a showcase of what $his home arcology is capable of.
			<<set $activeSlave.boobsImplant += 200*random(100,200)>>
			<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
			<<set $activeSlave.buttImplant += random(7,12)>>
			<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSYouthPreferentialist > 20>>
		They're usually on the younger side.
		<<if $activeSlave.actualAge > 30>>
			<<if random(0,1) == 0>>
				<<set $activeSlave.actualAge = random(18,25)>>
				<<set $activeSlave.visualAge = $activeSlave.actualAge>>
				<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
				<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<<if $activeSlave.boobs > 400>>
					<<set $activeSlave.boobs -= 100*random(0,2)>>
				<</if>>
				<<if $activeSlave.butt > 3>>
					<<set $activeSlave.butt -= random(0,2)>>
				<</if>>
			<<elseif $arcologies[_market].FSYouthPreferentialistResearch == 1>>
				<<if $activeSlave.actualAge > 30>>
					Well, all of them certainly look it. Always best to check their ages before buying.
					<<set $activeSlave.visualAge = random(18,25)>>
					<<set $activeSlave.chem += random(10,40)>>
				<</if>>
			<<else>>
				And if they aren't, they sure don't look their age.
				<<set $activeSlave.ageImplant = 1, $activeSlave.faceImplant += random(10,30)>>
				<<AgeImplantAdjustment $activeSlave>>
			<</if>>
		<</if>>
	<<elseif $arcologies[_market].FSMaturityPreferentialist > 20>>
		They're usually on the more mature side.
		<<if $activeSlave.actualAge < 30>>
			<<if random(0,1) == 0>>
				<<set $activeSlave.actualAge = random(36,$retirementAge)>>
				<<set $activeSlave.visualAge = $activeSlave.actualAge>>
				<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
				<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<<if $activeSlave.boobs < 400>>
					<<set $activeSlave.boobs += 100*random(0,2)>>
				<</if>>
				<<if $activeSlave.butt < 3>>
					<<set $activeSlave.butt += random(0,2)>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSSlimnessEnthusiast > 20>>
		They're never overweight, and are often quite lithe.
		<<if $activeSlave.boobs > 400>>
			<<set $activeSlave.boobs -= 100*random(0,2)>>
		<</if>>
		<<if $activeSlave.butt > 3>>
			<<set $activeSlave.butt -= random(0,2)>>
		<</if>>
		<<if $activeSlave.weight > 10>>
			<<set $activeSlave.weight = random(-30,0)>>
		<</if>>
		<<if $arcologies[_market].FSSlimnessEnthusiastResearch == 1 && random(1,100) <= 50>>
			This one is perfectly flat; an ideal showcase of $his home arcology's tastes.
			<<set $activeSlave.boobs = 100>>
			<<set $activeSlave.butt = 0>>
			<<set $activeSlave.weight = random(-30,0)>>
		<</if>>
	<<elseif $arcologies[_market].FSAssetExpansionist > 20>>
		Their butts are usually imposing, but their tits are what's often most impressive.
		<<set $activeSlave.chem += random(10,100)>>
		<<if $activeSlave.boobs < 5000>>
			<<set $activeSlave.boobs += 100*random(5,50)>>
		<</if>>
		<<if $activeSlave.butt < 6>>
			<<set $activeSlave.butt += random(2,4)>>
		<</if>>
		<<if $activeSlave.weight < -10>>
			<<set $activeSlave.weight += random(0,20)>>
		<</if>>
		<<if $arcologies[_market].FSAssetExpansionistResearch == 1 && random(1,100) <= 20>>
			This one is unusually large; a showcase of what $his home arcology is capable of.
			<<set $activeSlave.boobs = 200*random(100,200)>>
			<<set $activeSlave.butt = random(10,20)>>
			<<if $activeSlave.dick > 0 && $seeDicks != 0>>
				<<set $activeSlave.dick = random(20,30)>>
				<<set $activeSlave.balls = random(20,125)>>
			<</if>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSPhysicalIdealist > 20>>
		They're usually quite muscular, some to a truly imposing degree, and they're almost never unhealthy.
		<<set $activeSlave.muscles = random(10,100)>>
		<<if $activeSlave.health < 20>>
			<<set $activeSlave.health += random(0,8)>>
		<</if>>
	<<elseif $arcologies[_market].FSHedonisticDecadence > 20>>
		<<if $arcologies[_market].FSSlimnessEnthusiast > 20>>
			They're quite soft, usually sporting a cute muffin top, and rather laid back.
			<<set $activeSlave.weight = random(10,25)>>
		<<else>>
			They're usually very soft and rather laid back.
			<<set $activeSlave.weight = random(30,180)>>
		<</if>>
		Though they often come with intense fetishes.
		<<set $activeSlave.muscles = random(-50,0)>>
		<<set $activeSlave.trust += random(5,15)>>
		<<set $activeSlave.energy += random(0,10)>>
		<<if $arcologies[_market].FSHedonisticDecadenceResearch == 1>>
			They appear to have greatly enjoyed their stay at $arcologies[_market].name.
			<<set $activeSlave.energy += random(0,10), $activeSlave.trust += random(10,20), $activeSlave.devotion += random(10,20)>>
		<</if>>
		<<if random(0,3) == 0>>
			<<set $activeSlave.behavioralFlaw = "gluttonous">>
		<</if>>
		<<if $activeSlave.fetish == "none">>
			<<set $activeSlave.fetish = either("boobs", "buttslut", "cumslut", "dom", "humiliation", "masochist", "pregnancy", "sadist", "submissive")>>
		<</if>>
		<<set $activeSlave.fetishStrength = random(60,90)>>
		<<if random(1,100) <= 5 && $activeSlave.fetish != "mindbroken">>
			<<switch $activeSlave.fetish>>
			<<case "submissive">>
				<<set $activeSlave.sexualFlaw = "neglectful">>
			<<case "cumslut">>
				<<set $activeSlave.sexualFlaw = "cum addict">>
			<<case "humiliation">>
				<<set $activeSlave.sexualFlaw = "attention whore">>
			<<case "buttslut">>
				<<set $activeSlave.sexualFlaw = "anal addict">>
			<<case "boobs">>
				<<set $activeSlave.sexualFlaw = "breast growth">>
			<<case "pregnancy">>
				<<set $activeSlave.sexualFlaw = "breeder">>
			<<case "dom">>
				<<set $activeSlave.sexualFlaw = "abusive">>
			<<case "sadist">>
				<<set $activeSlave.sexualFlaw = "malicious">>
			<<case "masochist">>
				<<set $activeSlave.sexualFlaw = "self hating">>
			<</switch>>
			<<set $activeSlave.fetishStrength = 100>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSPastoralist > 20>>
		Lactation is nearly universal among them, sometimes in ludicrous quantities. They tend to have huge udders, as well.
		<<set $activeSlave.chem += random(10,100)>>
		<<if $activeSlave.boobs < 5000>>
			<<set $activeSlave.boobs += 100*random(5,50)>>
		<</if>>
		<<if $activeSlave.lactation == 0>>
			<<set $activeSlave.lactation = either(0,1,1,1,1,2)>>
		<</if>>
		<<if $activeSlave.lactation > 0>>
			<<set $activeSlave.lactationDuration = 2>>
		<</if>>
		<<if $activeSlave.weight < -10>>
			<<set $activeSlave.weight += random(0,20)>>
		<</if>>
	<<elseif $arcologies[_market].FSCummunism > 20>>
		Big balls and huge loads are commonplace among them, even if they sometimes lack dicks. They tend to be hard workers, as well.
		<<set $activeSlave.chem += random(10,100)>>
		<<if $arcologies[_market].FSRestart > 50>>
			<<set $activeSlave.dick = 0, $activeSlave.vagina = -1>>
		<</if>>
		<<if $activeSlave.balls < 20>>
			<<set $activeSlave.balls += random(5,20)>>
		<</if>>
		<<set $activeSlave.scrotum = $activeSlave.balls-5>>
		<<set $activeSlave.prostate = either(1,1,1,2,2,3)>>
		<<if $activeSlave.muscles < 30>>
			<<set $activeSlave.muscles += random(0,20)>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSChattelReligionist > 20>>
		They're rarely anything but devoted, and sometimes present interesting peccadilloes.
		<<set $activeSlave.slaveName = setup.chattelReligionistSlaveNames.random()>>
		<<if $activeSlave.devotion < 10>>
			<<set $activeSlave.devotion += random(0,10)>>
		<</if>>
		<<if $activeSlave.devotion < 10>>
			<<set $activeSlave.devotion += random(0,10)>>
		<</if>>
		<<if random(0,1) == 0>>
			<<set $activeSlave.behavioralQuirk = "sinful">>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSRomanRevivalist > 20>>
		They've often seen things that drive any squeamishness out of them.
		<<set $activeSlave.slaveName = setup.romanSlaveNames.random()>>
		<<if random(0,1) == 0>>
			<<set $activeSlave.sexualQuirk = "unflinching">>
		<</if>>
	<<elseif $arcologies[_market].FSAztecRevivalist > 20>>
		They've seen sights that will traumatize almost anyone<<if !canSee($activeSlave)>>, so to speak<</if>>.
		<<set $activeSlave.slaveName = setup.aztecSlaveNames.random()>>
		<<if random(0,1) == 0>>
			<<set $activeSlave.trust = -30>>
		<</if>>
	<<elseif $arcologies[_market].FSEgyptianRevivalist > 20>>
		They've often done things that give them a distinct appetite for perversion.
		<<set $activeSlave.slaveName = setup.ancientEgyptianSlaveNames.random()>>
		<<if random(0,1) == 0>>
			<<set $activeSlave.sexualQuirk = "perverted">>
		<</if>>
	<<elseif $arcologies[_market].FSEdoRevivalist > 20>>
		They have frequently absorbed much culture there.
		<<set $activeSlave.slaveName = setup.edoSlaveNames.random()>>
		<<set $activeSlave.skill.entertainment = Math.clamp($activeSlave.skill.entertainment, 35, 100)>>
	<<elseif $arcologies[_market].FSArabianRevivalist > 20>>
		They've often been part of large harems in which selflessness is prized.
		<<if random(0,1) == 0>>
			<<set $activeSlave.sexualQuirk = "caring">>
		<</if>>
	<<elseif $arcologies[_market].FSChineseRevivalist > 20>>
		They've all passed through a thorough and uncompromising educational system for slaves.
		<<set $activeSlave.intelligenceImplant = 10>>
		<<if $activeSlave.intelligence < 60>>
			<<set $activeSlave.intelligence += random(0,20)>>
		<</if>>
	<</if>>

	<<if $arcologies[_market].FSIncestFetishist > 20>>
		Incest is acceptable, if not preferable to them.
		<<if $activeSlave.sexualQuirk == "none" && $activeSlave.behavioralQuirk == "none">>
			<<if random(0,1) == 0>>
				<<set $activeSlave.sexualQuirk = "perverted">>
			<<else>>
				<<set $activeSlave.behavioralQuirk = "sinful">>
			<</if>>
		<<elseif $activeSlave.sexualQuirk == "none" || $activeSlave.sexualQuirk == "perverted">>
			<<set $activeSlave.sexualQuirk = "perverted">>
		<<else>>
			<<set $activeSlave.behavioralQuirk = "sinful">>
		<</if>>
	<</if>>

	<<if ($arcologies[0].FSDegradationist != "unset") && ($arcologies[_market].FSPaternalist != "unset")>>
		<<set $activeSlave.devotion = random(-90,-60)>>
		<<set $activeSlave.trust = -20>>
		'' $arcologies[_market].name'' is Paternalist, and your arcology is Degradationist. To its slaves, other niceties of social alignment are trivial. They view your arcology as a literal Hell on Earth.
	<<elseif ($arcologies[0].FSDegradationist != "unset") && ($arcologies[_market].FSPaternalist != "unset")>>
		<<set $activeSlave.devotion = random(60,90)>>
		<<set $activeSlave.trust = 20>>
		'' $arcologies[_market].name'' is Degradationist, and your arcology is Paternalist. To its slaves, other niceties of social alignment are trivial. They view your arcology as a promised land.
	<<elseif $opinion != 0>>
		<<set $activeSlave.devotion += $opinion>>
		<<set $activeSlave.trust += $opinion>>
		<<set $activeSlave.devotion = Math.clamp($activeSlave.devotion, -100, 75)>>
		<<set $activeSlave.trust = Math.clamp($activeSlave.trust, -100, 75)>>
		<<if $opinion > 2>>
			Your arcology's close social alignment with '' $arcologies[_market].name'' makes its slaves more accepting of the prospect of life in your arcology, and willing to trust that they'll know how to survive there.
		<<elseif $opinion < -2>>
			Your arcology's very different culture from '' $arcologies[_market].name'''s makes its slaves unhappy with the prospect of life in your arcology, and afraid of what will happen to them there.
		<</if>>
	<</if>>

<<case "heap">>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from a body dump, completely broken.">>
	<<set $activeSlave.devotion = 0>>
	<<set $activeSlave.trust = 0>>
	<<set $activeSlave.career = "a slave">>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-100,0]})>>
	<<set $activeSlave.intelligenceImplant = 0>>
	<<set $activeSlave.health = random(-99,0)>>
	<<set $activeSlave.weight = random(-100,0)>>
	<<set $activeSlave.eyes = either(-2, -1, -1, -1, -1, 1, 1, 1)>>
	<<set $activeSlave.hears = either(-2, -1, -1, -1, -1, 0, 0, 0)>>
	<<if $seeExtreme == 1>>
		<<set $activeSlave.amp = either(0, 0, 0, 0, 0, 0, 1, 1, 1)>>
	<</if>>
	<<if $activeSlave.amp != 1>>
		<<set $activeSlave.heels = either(0, 0, 0, 0, 0, 1, 1)>>
	<</if>>
	<<set $activeSlave.voice = random(0,2)>>
	<<set $activeSlave.face = random(-100,20)>>
	<<if $activeSlave.vagina > -1>>
		<<set $activeSlave.vagina = either(1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 10)>>
		<<set $activeSlave.preg = random(-3,-1)>>
		<<set $activeSlave.belly = 0, $activeSlave.bellyPreg = 0>>
		<<set $activeSlave.counter.vaginal += random(0,300)>>
	<</if>>
	<<set $activeSlave.anus = either(1, 2, 2, 3, 3, 3, 3, 4, 4, 4)>>
	<<if $activeSlave.balls > 1>>
		<<if random(1,100) > 50>>
			<<set $activeSlave.balls = 0>>
		<</if>>
	<</if>>
	<<set $activeSlave.counter.oral += random(0,300)>>
	<<set $activeSlave.counter.anal += random(0,300)>>
	<<if $activeSlave.boobs > 500>>
		<<set $activeSlave.counter.mammary += random(0,300)>>
	<</if>>
	<<set $activeSlave.skill.vaginal = 0>>
	<<set $activeSlave.skill.oral = 0>>
	<<set $activeSlave.skill.anal = 0>>
	<<set $activeSlave.skill.whoring = 0>>
	<<set $activeSlave.skill.entertainment = 0>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.addict = either(0, 0, 0, 10, 10, 20, 30)>>
	<<set $activeSlave.chem = random(0,1000)>>
	<<set $activeSlave.behavioralFlaw = "none">>
	<<set $activeSlave.behavioralQuirk = "none">>
	<<set $activeSlave.sexualFlaw = "none">>
	<<set $activeSlave.sexualQuirk = "none">>
	<<set $activeSlave.fetish = "mindbroken">>
	<<set $activeSlave.fetishStrength = 0>>

<<case "wetware">>
	<<set $fixedNationality = "Stateless">>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from a wetware CPU farm, her body ruined but her mind subjected to a simulated career.">>
	<<set $activeSlave.devotion = 40>>
	<<set $activeSlave.trust = -100>>
	<<set $activeSlave.career = either("a business owner", "a college scout", "a counselor", "a dairy worker", "a doctor", "a house DJ", "a politician", "a prison guard", "a secretary", "a soldier", "a teacher")>>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [20,100]})>>
	<<set $activeSlave.intelligenceImplant = 30>>
	<<set $activeSlave.health = random(-99,-50)>>
	<<set $activeSlave.weight = random(-100,-50)>>
	<<set $activeSlave.muscles = random(-100,-50)>>
	<<set $activeSlave.eyes = -2>>
	<<set $activeSlave.hears = -2>>
	<<if $seeExtreme == 1>>
		<<set $activeSlave.amp = 1>>
	<</if>>
	<<if $activeSlave.amp != 1>>
		<<set $activeSlave.heels = 1>>
	<</if>>
	<<set $activeSlave.voice = 0>>
	<<set $activeSlave.face = random(-100,-50)>>
	<<set $activeSlave.butt = 0>>
	<<if $activeSlave.vagina > -1>>
		<<set $activeSlave.vagina = either(1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 10)>>
		<<set $activeSlave.preg = random(-3,-1)>>
		<<set $activeSlave.counter.vaginal += random(0,300)>>
	<</if>>
	<<set $activeSlave.anus = either(1, 2, 2, 3, 3, 3, 3, 4, 4, 4)>>
	<<if $activeSlave.balls > 1 && random(1,100) > 50>>
		<<set $activeSlave.balls = 0>>
	<</if>>
	<<set $activeSlave.counter.oral += random(0,300)>>
	<<set $activeSlave.counter.anal += random(0,300)>>
	<<if $activeSlave.boobs > 500>>
		<<set $activeSlave.counter.mammary += random(0,300)>>
	<</if>>
	<<set $activeSlave.skill.vaginal = random(50,100)>>
	<<set $activeSlave.skill.oral = random(50,100)>>
	<<set $activeSlave.skill.anal = random(50,100)>>
	<<set $activeSlave.skill.whoring = random(50,100)>>
	<<set $activeSlave.skill.entertainment = random(50,100)>>
	<<switch $activeSlave.career>>
		<<case "a lawyer">>
			<<set $activeSlave.slaveName = "WCPU-HG">>
		<<case "a college scout">>
			<<set $activeSlave.slaveName = "WCPU-RC">>
		<<case "a business owner">>
			<<set $activeSlave.slaveName = "WCPU-MD">>
		<<case "a house DJ">>
			<<set $activeSlave.slaveName = "WCPU-DJ">>
		<<case "a soldier">>
			<<set $activeSlave.slaveName = "WCPU-BG">>
		<<case "a prison guard">>
			<<set $activeSlave.slaveName = "WCPU-WD">>
		<<case "a doctor">>
			<<set $activeSlave.slaveName = "WCPU-NS">>
		<<case "a counselor">>
			<<set $activeSlave.slaveName = "WCPU-AT">>
		<<case "a dairy worker">>
			<<set $activeSlave.slaveName = "WCPU-MK">>
		<<case "a secretary">>
			<<set $activeSlave.slaveName = "WCPU-ST">>
		<<case "a teacher">>
			<<set $activeSlave.slaveName = "WCPU-TE">>
	<</switch>>
	<<set $activeSlave.slaveSurname = "#"+$activeSlave.skill.vaginal+$activeSlave.skill.oral+$activeSlave.skill.anal+$activeSlave.skill.whoring+$activeSlave.skill.entertainment+"-"+$activeSlave.intelligence>>
	<<set $activeSlave.birthName = "", $activeSlave.birthSurname = "">>
	<<if $activeSlave.career == "a soldier">>
		<<set $activeSlave.skill.combat = 1>>
	<<else>>
		<<set $activeSlave.skill.combat = 0>>
	<</if>>
	<<set $activeSlave.addict = either(0, 0, 0, 10, 10, 20, 30)>>
	<<set $activeSlave.chem = random(500,1000)>>
	<<set $activeSlave.behavioralFlaw = "none">>
	<<set $activeSlave.behavioralQuirk = "none">>
	<<set $activeSlave.sexualFlaw = "none">>
	<<set $activeSlave.sexualQuirk = "none">>
	<<set $activeSlave.fetish = "none">>
	<<set $activeSlave.fetishStrength = 0>>

<<case "kidnappers">>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from the kidnappers' slave market, so she was probably forced into slavery.">>
	<<set $activeSlave.devotion -= 5>>
	<<set $activeSlave.trust = random(-45,-25)>>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-90,45]})>>
	<<set $activeSlave.health = random(-80,20)>>
	<<if $activeSlave.vagina > 1 && isFertile($activeSlave)>>
		<<set $activeSlave.preg = either(-2, -1, -1, -1, -1, -1, -1, -1, 1, 20, 40)>>
		<<if $activeSlave.preg > 0>>
			<<set $activeSlave.pregType = setPregType($activeSlave)>>
		<</if>>
		<<run SetBellySize($activeSlave)>>
	<</if>>

<<case "indentures">>
	<<set $oneTimeDisableDisability = 1>>
	<<if $arcologies[0].FSSupremacistLawME == 1>>
		<<set $fixedRace = $arcologies[0].FSSupremacistRace>>
	<<elseif $arcologies[0].FSSubjugationistLawME == 1>>
		<<set _races = setup.filterRacesLowercase.filter(race => race !== $arcologies[0].FSSubjugationistRace)>>
		<<set $fixedRace = _races.random()>>
	<</if>>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You purchased her indenture contract, making her yours for as long as it lasts.">>
	<<set $activeSlave.indentureRestrictions = either(0,1,1,2,2,2,2)>>
	<<if $activeSlave.indentureRestrictions >= 2>>
		<<set $activeSlave.devotion = random(25,45)>>
		<<set $activeSlave.trust = random(-20,20)>>
	<<elseif $activeSlave.indentureRestrictions == 1>>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-45,-25)>>
	<<else>>
		<<set $activeSlave.devotion = random(-45,-25)>>
		<<set $activeSlave.trust = random(-75,-60)>>
	<</if>>
	<<set $activeSlave.indenture = either(26, 52, 104, 156, 208)>>

<<case "hunters">>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from the runaway hunters' slave market after they recaptured her and her original owner did not pay their fee.">>
	<<set $activeSlave.devotion = -20>>
	<<set $activeSlave.trust = random(-15,15)>>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [0,100]})>>
	<<set $activeSlave.intelligenceImplant = 15>>
	<<if $activeSlave.physicalAge >= 12>>
		<<set $activeSlave.teeth = "normal">>
	<</if>>
	<<set $activeSlave.health = random(-10,70)>>
	<<if $activeSlave.vagina > -1>>
		<<set $activeSlave.preg = either(-2, -1, -1, -1, -1, -1, -1, -1, 1, 1)>>
		<<if $activeSlave.physicalAge < $activeSlave.pubertyAgeXX>><<set $activeSlave.preg = -1>><</if>>
		<<if $activeSlave.preg > 0>>
			<<set $activeSlave.pregType = setPregType($activeSlave)>>
		<</if>>
		<<run SetBellySize($activeSlave)>>
		<<set $activeSlave.skill.vaginal = random(15,100)>>
		<<set $activeSlave.vagina = random(1,3)>>
	<</if>>
	<<if $activeSlave.balls > 0>>
	<<if random(1,3) == 1>>
		<<set $activeSlave.balls = 0>>
	<</if>>
	<</if>>
	<<set $activeSlave.skill.combat = either(0, 0, 0, 0, 0, 1)>>
	<<set $activeSlave.skill.entertainment = random(15,100)>>
	<<set $activeSlave.skill.whoring = random(15,100)>>
	<<set $activeSlave.skill.oral = random(15,100)>>
	<<set $activeSlave.skill.anal = random(15,100)>>
	<<set $activeSlave.anus = random(1,3)>>
	<<set $activeSlave.weight = Math.clamp(-25, 25, $activeSlave.weight)>>
	<<set $activeSlave.behavioralFlaw = either("anorexic", "arrogant", "bitchy", "devout", "gluttonous", "hates men", "hates women", "hates women", "liberated", "odd")>>
	<<set $activeSlave.sexualFlaw = either("apathetic", "crude", "hates anal", "hates oral", "hates penetration", "idealistic", "judgemental", "repressed", "shamefast")>>
	<<if random(1,2) == 1>>
		<<set _slaveGen = random(2,8)*200>>
		<<set $activeSlave.boobs += _slaveGen>>
		<<set $activeSlave.boobsImplant += _slaveGen>>
		<<set _slaveGen = random(1,3)>>
		<<set $activeSlave.butt += _slaveGen>>
		<<set $activeSlave.buttImplant += _slaveGen>>
		<<set _slaveGen = either(10,20)>>
		<<set $activeSlave.lips += _slaveGen>>
		<<set $activeSlave.lipsImplant += _slaveGen>>
		<<set $activeSlave.waist = Math.trunc($activeSlave.waist,-100,15)>>
		<<if $activeSlave.face < 40>>
			<<set $activeSlave.faceImplant = 20*random(0,1)>>
			<<set $activeSlave.face = Math.clamp($activeSlave.face+$activeSlave.faceImplant,-100,100)>>
		<</if>>
		<<if $activeSlave.physicalAge >= 30>>
			<<set $activeSlave.ageImplant += random(0,1)>>
			<<if $activeSlave.ageImplant == 1>>
				<<AgeImplantAdjustment $activeSlave>>
			<</if>>
		<</if>>
	<</if>>
	<<if $arcologies[0].FSPaternalistSMR == 0>>
		<<set $activeSlave.heels = 1>>
	<</if>>

<<case "underage raiders">>
	<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
	<<set $activeSlaveOneTimeMaxAge = $fertilityAge>>
	<<set $one_time_age_overrides_pedo_mode = 1>> /% Must not have had their first period. %/
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from the underage raiders' slave market.">>
	<<set $activeSlave.trust -= 25>>
	<<set $activeSlave.health += 20>>
	<<set $activeSlave.career = setup.veryYoungCareers.random()>>
	<<set $activeSlave.birthWeek = 0>>
	<<if $activeSlave.vagina != -1>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.vagina = 0>>
		<<set $activeSlave.trueVirgin = 1>>
		<<set $activeSlave.preg = 0>>
		<<run SetBellySize($activeSlave)>>
	<</if>>
	<<set $activeSlave.skill.anal = 0>>
	<<set $activeSlave.anus = 0>>
	<<set $activeSlave.skill.oral = 0>>
	<<set $activeSlave.skill.whoring = 0>>

<<case "raiders">>
	<<set $activeSlaveOneTimeMinAge = 18>>
	<<set $activeSlaveOneTimeMaxAge = 18>>
	<<set $one_time_age_overrides_pedo_mode = 1>> /% Supposed to have just reached the age of majority. %/
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from the girl raiders' slave market the week she reached her majority.">>
	<<set $activeSlave.trust -= 25>>
	<<set $activeSlave.health += 20>>
	<<set $activeSlave.career = either("a cheerleader", "a farm laborer", "a party girl", "a student", "a student", "a student", "a student", "a student")>>
	<<set $activeSlave.birthWeek = 0>>
	<<if $activeSlave.vagina != -1>>
		<<if random(1,2) == 1>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.vagina = 0>>
		<<set $activeSlave.trueVirgin = 1>>
		<<set $activeSlave.preg = 0>>
		<<run SetBellySize($activeSlave)>>
		<</if>>
	<</if>>
	<<if random(1,2) == 1>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.anus = 0>>
	<</if>>
	<<if random(1,2) == 1>>
		<<set $activeSlave.skill.oral = 0>>
	<</if>>
	<<set $activeSlave.skill.whoring = 0>>

<<case "trainers">>
	<<set $activeSlaveOneTimeMaxAge = 42>>
	<<include "Generate New Slave">>
	<<set $activeSlave.origin = "You bought her from the trainers' slave market after they put her through basic training.">>
	<<set $activeSlave.devotion += 40>>
	<<set $activeSlave.trust += 40>>
	<<set $activeSlave.health += 30>>
	<<if $activeSlave.vagina != -1>>
		<<set $activeSlave.skill.vaginal += 15>>
	<<else>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.clit = 0>>
	<</if>>
	<<if $activeSlave.vagina == 0>>
		<<set $activeSlave.vagina += 1>>
	<</if>>
	<<if $activeSlave.anus == 0>>
		<<set $activeSlave.anus += 1>>
	<</if>>
	<<set $activeSlave.skill.oral += 15>>
	<<set $activeSlave.skill.anal += 15>>
	<<set $activeSlave.fetishKnown = 1>>
	<<if $activeSlave.accent >= 3>>
		<<set $activeSlave.accent -= 1>>
	<</if>>
	<<if random(1,100) > 50>>
		<<set $activeSlave.sexualFlaw = "none">>
	<</if>>
	<<if random(1,100) > 50>>
		<<set $activeSlave.behavioralFlaw = "none">>
	<</if>>

<<case "TSS">>
	<<if $TSS.schoolUpgrade == 1>>
		<<set $activeSlaveOneTimeMinAge = 36>>
	<<else>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
	<</if>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XX Slave">>
	<<set $activeSlave.career = "a slave">>
	<<set $activeSlave.butt = either(1, 2, 2, 3)>>
	<<set $activeSlave.boobs = either(200, 300, 300, 400)>>
	<<if $TSS.schoolUpgrade == 1>>
		<<set $activeSlave.origin = "You bought her fresh from the new Slavegirl School after she was retrained as a slave girl.">>
		<<set $activeSlave.butt += 1>>
		<<set $activeSlave.boobs += 200>>
		<<set $activeSlave.anus = 1>>
		<<set $activeSlave.vagina = 1>>
	<<else>>
		<<set $activeSlave.origin = "You bought her fresh from the Slavegirl School right after her majority.">>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.vagina = 0>>
		<<set $activeSlave.trueVirgin = 1>>
		<<set $activeSlave.birthWeek = 0>>
	<</if>>
	<<set $activeSlave.intelligenceImplant = 30>>
	<<if $activeSlave.physicalAge >= 12>>
		<<set $activeSlave.teeth = "normal">>
	<</if>>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-20,70]})>>
	<<set $activeSlave.devotion = random(25,45)>>
	<<set $activeSlave.trust = random(25,45)>>
	<<set $activeSlave.health = random(50,60)>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.weight = 0>>
	<<set $activeSlave.waist = random(-30,10)>>
	<<set $activeSlave.chem = 20>>
	<<if $TSS.schoolUpgrade == 0>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.skill.oral = 0>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<set $activeSlave.skill.entertainment = 15>>
	<<else>>
		<<set $activeSlave.skill.vaginal = 15>>
		<<set $activeSlave.skill.oral = 15>>
		<<set $activeSlave.skill.anal = 15>>
		<<set $activeSlave.skill.whoring = 15>>
		<<set $activeSlave.skill.entertainment = 15>>
	<</if>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<set $activeSlave.sexualFlaw = either("none")>>
	<<set $activeSlave.behavioralFlaw = either("none")>>
	<<set $activeSlave.hStyle = "tails">>
	<<set $activeSlave.custom.tattoo = "$He has the simple logo of the corporation that operates The Slavegirl School tattooed on $his left cheek.">>

<<case "GRI">>
	<<set $activeSlaveOneTimeMinAge = 16>>
	<<set $activeSlaveOneTimeMaxAge = 19>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XX Slave">>
	<<set $activeSlave.origin = "You bought her from the Growth Research Institute right after her use as a test subject ended.">>
	<<set $activeSlave.career = "a slave">>
	<<set $activeSlave.intelligenceImplant = 0>>
	<<set $activeSlave.devotion = random(-15,-5)>>
	<<set $activeSlave.trust = random(-25,-45)>>
	<<set $activeSlave.chem = 100>>
	<<if $GRI.schoolUpgrade == 1>>
		<<set $activeSlave.health = 200>>
	<<else>>
		<<set $activeSlave.health = random(-80,100)>>
	<</if>>
	<<set $activeSlave.height = random(160,210)>>
	<<set $activeSlave.butt = random(4,10)>>
	<<if $GRI.schoolUpgrade == 2>>
		<<set $activeSlave.boobs = 200*random(15,30)>>
		<<set $activeSlave.lactation = 2, $activeSlave.lactationDuration = 2>>
	<<else>>
		<<set $activeSlave.boobs = 200*random(4,20)>>
	<</if>>
	<<set $activeSlave.nipples = either("huge", "inverted")>>
	<<set $activeSlave.areolae = either(0, 1, 2, 3, 4)>>
	<<set $activeSlave.clit = either(0, 1, 2, 3)>>
	<<set $activeSlave.lips = random(5,85)>>
	<<set $activeSlave.anus = 0>>
	<<set $activeSlave.vagina = 0>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.weight = 0>>
	<<set $activeSlave.waist = random(-20,30)>>
	<<set $activeSlave.skill.vaginal = 0>>
	<<set $activeSlave.skill.oral = 0>>
	<<set $activeSlave.skill.anal = 0>>
	<<set $activeSlave.skill.whoring = 0>>
	<<set $activeSlave.skill.entertainment = 0>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.birthWeek = 0>>
	<<set $activeSlave.behavioralFlaw = either("odd")>>
	<<set $activeSlave.hStyle = "shaved">>
	<<set $activeSlave.hLength = 0>>
	<<set $activeSlave.custom.tattoo = "$He has a barcode that identified $his when she was a test subject at the Growth Research Institute tattooed on $his left cheek.">>

<<case "SCP">>
	<<set $activeSlaveOneTimeMinAge = 16>>
	<<set $activeSlaveOneTimeMaxAge = 19>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XX Slave">>
	<<set $activeSlave.origin = "You bought her from St. Claver Preparatory after she served as a plastic surgeon's passing final exam.">>
	<<set $activeSlave.chem = 20>>
	<<set $activeSlave.career = "a slave">>
	<<if $SCP.schoolUpgrade == 1>>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.intelligence = -60>>
		<<set $activeSlave.devotion = 100>>
		<<set $activeSlave.trust = 100>>
	<<else>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.teeth = "normal">>
		<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-30,60]})>>
		<<set $activeSlave.devotion = random(25,45)>>
		<<set $activeSlave.trust = random(25,45)>>
	<</if>>
	<<set $activeSlave.health = 100>>
	<<set $activeSlave.heightImplant = 1>>
	<<set $activeSlave.height += 10>>
	<<set $activeSlave.buttImplant = (4-$activeSlave.butt)>>
	<<set $activeSlave.butt += $activeSlave.buttImplant>>
	<<set $activeSlave.boobsImplant = (2000-$activeSlave.boobs)>>
	<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
	<<set $activeSlave.nipples = "tiny">>
	<<set $activeSlave.areolae = 0>>
	<<set $activeSlave.clit = 0>>
	<<set $activeSlave.lipsImplant = (20-$activeSlave.lips)>>
	<<set $activeSlave.lips += $activeSlave.lipsImplant>>
	<<set $activeSlave.faceImplant = 40>>
	<<set $activeSlave.face = Math.clamp($activeSlave.face+$activeSlave.faceImplant,-100,100)>>
	<<set $activeSlave.faceShape = "normal">>
	<<set $activeSlave.anus = 0>>
	<<set $activeSlave.vagina = 0>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.weight = -20>>
	<<set $activeSlave.waist = -50>>
	<<if $SCP.schoolUpgrade == 2>>
		<<set $activeSlave.skill.vaginal = 15>>
		<<set $activeSlave.skill.oral = 15>>
		<<set $activeSlave.skill.anal = 15>>
		<<set $activeSlave.skill.whoring = 15>>
		<<set $activeSlave.skill.entertainment = 15>>
	<<else>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.skill.oral = 0>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<set $activeSlave.skill.entertainment = 0>>
	<</if>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<set $activeSlave.birthWeek = 0>>
	<<set $activeSlave.sexualFlaw = either("none")>>
	<<set $activeSlave.behavioralFlaw = either("none")>>
	<<set $activeSlave.hStyle = "tails">>
	<<set $activeSlave.pubicHColor = "blonde">>
	<<set $activeSlave.underArmHColor = "blonde">>
	<<set $activeSlave.eyebrowHColor = "blonde">>
	<<set $activeSlave.race = "white">>
	<<set $activeSlave.skin = "sun tanned">>
	<<set $activeSlave.override_H_Color = 1>>
	<<set $activeSlave.override_Arm_H_Color = 1>>
	<<set $activeSlave.override_Pubic_H_Color = 1>>
	<<set $activeSlave.override_Brow_H_Color = 1>>
	<<set $activeSlave.override_Race = 1>>
	<<set $activeSlave.override_Skin = 1>>
	<<set $activeSlave.custom.tattoo = "$He has the coat of arms of St. Claver Preparatory tattooed on $his left cheek.">>

<<case "LDE">>
	<<set $activeSlaveOneTimeMinAge = 16>>
	<<set $activeSlaveOneTimeMaxAge = 19>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XY Slave">>
	<<set $activeSlave.origin = "You bought her from the innovative École des Enculées right after her graduation.">>
	<<set $activeSlave.career = "a slave">>
	<<set $activeSlave.intelligenceImplant = 0>>
	<<set $activeSlave.chem = 100>>
	<<if $LDE.schoolUpgrade == 1>>
		<<set $activeSlave.devotion = 100>>
		<<set $activeSlave.trust = 100>>
	<<else>>
		<<set $activeSlave.devotion = random(60,75)>>
		<<set $activeSlave.trust = random(55,60)>>
	<</if>>
	<<set $activeSlave.health = random(60,80)>>
	<<set $activeSlave.muscles = 0>>
	<<set $activeSlave.butt = either(4,5)>>
	<<set $activeSlave.face = random(15,55)>>
	<<set $activeSlave.faceShape = "androgynous">>
	<<set $activeSlave.boobs = either(500,650,800)>>
	<<set $activeSlave.waist = -15>>
	<<set $activeSlave.lips = 35>>
	<<if $LDE.schoolUpgrade == 2>>
		<<set $activeSlave.dick = either(3,4)>>
		<<set $activeSlave.balls = either(3,4)>>
		<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum = $activeSlave.balls>><</if>>
	<<else>>
		<<set $activeSlave.dick = either(1,1,1,2)>>
		<<set $activeSlave.balls = either(1,1,1,2)>>
		<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.scrotum = $activeSlave.balls>><</if>>
		<<set $activeSlave.pubertyXY = 0>>
		<<set $activeSlave.pubertyAgeXY = random(24,50)>>
	<</if>>
	<<set $activeSlave.anus = 2>>
	<<set $activeSlave.vagina = -1>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.weight = random(0,20)>>
	<<set $activeSlave.skill.vaginal = 0>>
	<<set $activeSlave.skill.oral = 15>>
	<<set $activeSlave.skill.anal = 100>>
	<<set $activeSlave.skill.whoring = 15>>
	<<set $activeSlave.skill.entertainment = 15>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.birthWeek = 0>>
	<<set $activeSlave.sexualFlaw = "none">>
	<<set $activeSlave.behavioralFlaw = either("none", "odd")>>
	<<set $activeSlave.fetishStrength = either(1, 2)>>
	<<set $activeSlave.fetish = "buttslut">>
	<<set $activeSlave.fetishKnown = 1>><<set $activeSlave.attrKnown = 1>>
	<<set $activeSlave.hStyle = "tails">>
	<<set $activeSlave.hLength = 100>>
	<<set $activeSlave.custom.tattoo = "$He has the buttock-shaped symbol of the École des Enculées that created $his tattooed on $his left cheek.">>

<<case "TGA">>
	<<set $activeSlaveOneTimeMinAge = 16>>
	<<set $activeSlaveOneTimeMaxAge = 19>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XY Slave">>
	<<set $activeSlave.origin = "You bought her fresh from the intense Gymnasium-Academy right after her majority.">>
	<<set $activeSlave.career = "a slave">>
	<<set $activeSlave.intelligenceImplant = 30>>
	<<set $activeSlave.teeth = "normal">>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [-20,60]})>>
	<<set $activeSlave.chem = 20>>
	<<if $TGA.schoolUpgrade == 1>>
		<<set $activeSlave.devotion = 100>>
		<<set $activeSlave.trust = 100>>
	<<else>>
		<<set $activeSlave.devotion = random(25,45)>>
		<<set $activeSlave.trust = random(25,45)>>
	<</if>>
	<<set $activeSlave.health = 100>>
	<<set $activeSlave.muscles = either(20, 50, 50)>>
	<<set $activeSlave.butt = either(2, 2, 3)>>
	<<set $activeSlave.boobs = either(100, 200)>>
	<<set $activeSlave.dick = random(3,5)>>
	<<set $activeSlave.balls = random(3,5)>>
	<<set $activeSlave.anus = 0>>
	<<set $activeSlave.vagina = -1>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.weight = 0>>
	<<set $activeSlave.waist = random(-10,30)>>
	<<set $activeSlave.skill.vaginal = 0>>
	<<set $activeSlave.skill.oral = 0>>
	<<set $activeSlave.skill.anal = 0>>
	<<set $activeSlave.skill.whoring = 0>>
	<<set $activeSlave.skill.entertainment = 0>>
	<<if $TGA.schoolUpgrade == 2>>
		<<set $activeSlave.skill.combat = 1>>
	<<else>>
		<<set $activeSlave.skill.combat = 0>>
	<</if>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<set $activeSlave.birthWeek = 0>>
	<<set $activeSlave.sexualFlaw = either("apathetic", "none")>>
	<<set $activeSlave.behavioralFlaw = either("arrogant", "none", "odd")>>
	<<set $activeSlave.hStyle = "short">>
	<<set $activeSlave.hLength = 2>>
	<<set $activeSlave.custom.tattoo = "$He has the baroque crest of the Gymnasium-Academy that trained $his branded into $his left cheek.">>

<<case "TCR">>
	<<if $TCR.schoolUpgrade == 2 && random(1,100) <= 20>>
		<<set $activeSlaveOneTimeMinAge = $fertilityAge>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.origin = "You bought her from The Cattle Ranch.">>
		<<set $activeSlave.career = "a dairy slave">>
		<<set $activeSlave.slaveName = setup.cowSlaveNames.random()>>
		<<set $activeSlave.slaveSurname = 0>>
		<<set $activeSlave.butt = either(2, 2, 3, 3, 3, 4, 4)>>
		<<set $activeSlave.boobs = (($activeSlave.physicalAge*100)*2)+either(-100, -100, 0, 0, 100, 100, 200, 200, 300, 500)>>
		<<set $activeSlave.lactation = 0>>
		<<set $activeSlave.lactationAdaptation = 0>>
		<<set $activeSlave.lactationDuration = 0>>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.vagina = 0>>
		<<set $activeSlave.trueVirgin = 1>>
		<<set $activeSlave.vaginaLube = either(1, 1, 2)>>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.devotion = -20>>
		<<set $activeSlave.trust = -20>>
		<<set $activeSlave.health = random(20,30)>>
		<<set $activeSlave.preg = 0>>
		<<run SetBellySize($activeSlave)>>
		<<set $activeSlave.hips = either(0, 0, 1, 1, 1, 2)>>
		<<set $activeSlave.weight = random(-20,10)>>
		<<set $activeSlave.waist = random(-30,10)>>
		<<set $activeSlave.muscles = 0>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.skill.oral = 0>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.combat = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.heels = 1>>
		<<set $activeSlave.hStyle = "neat">>
		<<set $activeSlave.collar = "leather with cowbell">>
		<<set $activeSlave.custom.tattoo = "$He has the logo of the Cattle Ranch branded on $his thigh.">>
	<<elseif $TCR.schoolUpgrade == 1 && random(1,100) <= 20>>
		<<set $activeSlaveOneTimeMinAge = $potencyAge+1>>
		<<set $activeSlaveOneTimeMaxAge = 24>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.slaveName = setup.cowSlaveNames.random()>>
		<<set $activeSlave.slaveSurname = 0>>
		<<set $activeSlave.origin = "You bought her from The Cattle Ranch.">>
		<<set $activeSlave.career = "a breeding bull">>
		<<set $activeSlave.butt = either(3, 3, 4, 4, 4, 5, 6)>>
		<<set $activeSlave.boobs = 100>>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.intelligence = -100>>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.devotion = 100>>
		<<set $activeSlave.trust = 100>>
		<<set $activeSlave.health = random(20,30)>>
		<<set $activeSlave.hips = either(1, 1, 1, 2, 2)>>
		<<set $activeSlave.dick = 6>>
		<<set $activeSlave.foreskin = 0>>
		<<set $activeSlave.balls = random(19,30)>>
		<<set $activeSlave.scrotum = 10>>
		<<set $activeSlave.prostate = 2>>
		<<set $activeSlave.weight = random(10,30)>>
		<<set $activeSlave.waist = random(0,100)>>
		<<set $activeSlave.muscles = random(80,100)>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.skill.oral = 0>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.combat = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.heels = 1>>
		<<set $activeSlave.energy = 100>>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.fetishStrength = 10>>
		<<set $activeSlave.fetishKnown = 1>>
		<<set $activeSlave.sexualFlaw = either("none")>>
		<<set $activeSlave.behavioralFlaw = either("none")>>
		<<set $activeSlave.sexualQuirk = either("none")>>
		<<set $activeSlave.behavioralQuirk = either("none")>>
		<<set $activeSlave.hStyle = "neat">>
		<<set $activeSlave.custom.tattoo = "$He has the logo of the Cattle Ranch branded on $his thigh.">>
	<<else>>
		<<set $activeSlaveOneTimeMinAge = 19>>
		<<set $activeSlaveOneTimeMaxAge = 24>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.slaveName = setup.cowSlaveNames.random()>>
		<<set $activeSlave.slaveSurname = 0>>
		<<set $activeSlave.origin = "You bought her from The Cattle Ranch.">>
		<<set $activeSlave.career = "a dairy cow">>
		<<set $activeSlave.butt = either(3, 3, 4, 4, 4, 5, 6)>>
		<<set $activeSlave.boobs = (($activeSlave.physicalAge*100)*2)+either(-100, -100, 0, 0, 100, 100, 200, 200, 300, 500)>>
		<<set $activeSlave.lactation = 1, $activeSlave.lactationDuration = 2>>
		<<set $activeSlave.lactationAdaptation = 100>>
		<<set $activeSlave.anus = 1>>
		<<set $activeSlave.vagina = 3>>
		<<set $activeSlave.vaginaLube = 2>>
		<<set $activeSlave.intelligence = either(-100, -100, -100, -100, -60, -60, -30)>>
		<<set $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.devotion = 100>>
		<<set $activeSlave.trust = 100>>
		<<set $activeSlave.health = random(20,30)>>
		<<set $activeSlave.preg = random(10,40)>>
		<<set $activeSlave.pregType = random(1,5)>>
		<<set $activeSlave.pregKnown = 1>>
		<<run SetBellySize($activeSlave)>>
		<<set $activeSlave.bellySag = 2>>
		<<set $activeSlave.bellySagPreg = 2>>
		<<set $activeSlave.hips = either(1, 1, 1, 2, 2)>>
		<<set $activeSlave.counter.birthsTotal = random(1,7)>>
		<<set $activeSlave.pregAdaptation = 120>>
		<<set $activeSlave.weight = random(20,90)>>
		<<set $activeSlave.waist = random(-10,50)>>
		<<set $activeSlave.muscles = random(60,80)>>
		<<set $activeSlave.chem = 0>>
		<<set $activeSlave.skill.vaginal = 0>>
		<<set $activeSlave.skill.oral = 0>>
		<<set $activeSlave.skill.anal = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.combat = 0>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.heels = 1>>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.fetishStrength = 10>>
		<<set $activeSlave.fetishKnown = 1>>
		<<set $activeSlave.sexualFlaw = either("none")>>
		<<set $activeSlave.behavioralFlaw = either("none")>>
		<<set $activeSlave.sexualQuirk = either("none")>>
		<<set $activeSlave.behavioralQuirk = either("none")>>
		<<set $activeSlave.hStyle = "neat">>
		<<set $activeSlave.collar = "leather with cowbell">>
		<<set $activeSlave.custom.tattoo = "$He has the logo of the Cattle Ranch branded on $his thigh.">>
	<</if>>

<<case "TFS">>
	<<set $activeSlaveOneTimeMinAge = 25>>
	<<set $activeSlaveOneTimeMaxAge = 29>>
	<<set $one_time_age_overrides_pedo_mode = 1>>
	<<set $oneTimeDisableDisability = 1>>
	<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
		<<include "Generate New Slave">>
	<<else>>
		<<include "Generate XY Slave">>
	<</if>>
	<<set $activeSlave.origin = "You bought her from the enigmatic Futanari Sisters after they sold her into slavery.">>
	<<set $activeSlave.career = "a Futanari Sister">>
	<<set $activeSlave.faceShape = either("exotic", "sensual")>>
	<<set $activeSlave.pubertyXY = 1>>
	<<set _sisterAge = random(1,5)>>
	<<if _sisterAge == 1>>
		<<set $activeSlave.intelligence = -60>>
		<<set $activeSlave.hips = 0>>
		<<set $activeSlave.face = either(35,35,35,75,100)>>
		<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
			<<if $activeSlave.genes == "XY">>
				<<set $activeSlave.balls = 6>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<</if>>
		<<elseif $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.balls = 1>>
			<<set $activeSlave.scrotum = 0>>
		<<elseif $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.balls = 6>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<<else>>
			<<set $activeSlave.balls = random(2,3)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<</if>>
		<<set $activeSlave.lips = 10>>
		<<set $activeSlave.weight = 0>>
		<<set $activeSlave.waist = random(-30,10)>>
		<<set $activeSlave.actualAge = random(19,24)>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<set $activeSlave.vagina = 2>>
		<<set $activeSlave.anus = 2>>
		<<set $activeSlave.fetish = "submissive">>
	<<elseif _sisterAge == 2>>
		<<set $activeSlave.intelligence = -30>>
		<<set $activeSlave.hips = 1>>
		<<set $activeSlave.face = either(35,35,35,75,100)>>
		<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
			<<if $activeSlave.genes == "XY">>
				<<set $activeSlave.balls = 7>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<</if>>
		<<elseif $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.balls = 1>>
			<<set $activeSlave.scrotum = 0>>
		<<elseif $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.balls = 6>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<<else>>
			<<set $activeSlave.balls = random(2,3)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<</if>>
		<<set $activeSlave.lips = 0>>
		<<set $activeSlave.weight = 0>>
		<<set $activeSlave.waist = random(-30,10)>>
		<<set $activeSlave.vagina = 2>>
		<<set $activeSlave.anus = 2>>
		<<set $activeSlave.fetish = either("buttslut", "cumslut", "submissive")>>
	<<elseif _sisterAge == 3>>
		<<set $activeSlave.intelligence = 0>>
		<<set $activeSlave.hips = 2>>
		<<set $activeSlave.face = either(35,35,75,75,100)>>
		<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
			<<if $activeSlave.genes == "XY">>
				<<set $activeSlave.balls = 8>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<</if>>
		<<elseif $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.balls = 1>>
			<<set $activeSlave.scrotum = 0>>
		<<elseif $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.balls = 6>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<<else>>
			<<set $activeSlave.balls = random(3,4)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<</if>>
		<<set $activeSlave.lips = random(15,25)>>
		<<set $activeSlave.weight = 20>>
		<<set $activeSlave.waist = random(-30,20)>>
		<<set $activeSlave.actualAge = random(30,34)>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<set $activeSlave.vagina = 2>>
		<<set $activeSlave.anus = 2>>
		<<set $activeSlave.fetish = either("buttslut", "cumslut")>>
	<<elseif _sisterAge == 4>>
		<<set $activeSlave.intelligence = 30>>
		<<set $activeSlave.hips = 2>>
		<<set $activeSlave.face = either(35,75,75,100,100)>>
		<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
			<<if $activeSlave.genes == "XY">>
				<<set $activeSlave.balls = 9>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<</if>>
		<<elseif $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.balls = 1>>
			<<set $activeSlave.scrotum = 0>>
		<<elseif $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.balls = 6>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<<else>>
			<<set $activeSlave.balls = random(4,5)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<</if>>
		<<set $activeSlave.lips = random(25,55)>>
		<<set $activeSlave.weight = 20>>
		<<set $activeSlave.waist = random(-30,20)>>
		<<set $activeSlave.actualAge = random(35,39)>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<set $activeSlave.vagina = 3>>
		<<set $activeSlave.anus = 3>>
		<<set $activeSlave.fetish = either("buttslut", "cumslut", "dom")>>
	<<else>>
		<<set $activeSlave.intelligence = 60>>
		<<set $activeSlave.hips = 2>>
		<<set $activeSlave.face = either(35,75,100,100,100)>>
		<<if $TFS.schoolUpgrade == 3 && $TFS.compromiseWeek+15 <= $week>>
			<<if $activeSlave.genes == "XY">>
				<<set $activeSlave.balls = 10>>
				<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<else>>
				<<set $activeSlave.balls = 1>>
				<<set $activeSlave.scrotum = 0>>
			<</if>>
		<<elseif $TFS.schoolUpgrade == 1>>
			<<set $activeSlave.balls = 1>>
			<<set $activeSlave.scrotum = 0>>
		<<elseif $TFS.schoolUpgrade == 2>>
			<<set $activeSlave.balls = 6>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<<else>>
			<<set $activeSlave.balls = random(5,6)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
		<</if>>
		<<set $activeSlave.lips = random(25,55)>>
		<<set $activeSlave.weight = 50>>
		<<set $activeSlave.waist = random(-50,20)>>
		<<set $activeSlave.actualAge = random(40,42)>>
		<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
		<<set $activeSlave.visualAge = $activeSlave.actualAge>>
		<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<set $activeSlave.vagina = 3>>
		<<set $activeSlave.anus = 3>>
		<<set $activeSlave.fetish = "dom">>
	<</if>>
	<<set $activeSlave.chem = 100+(_sisterAge*50)>>
	<<set $activeSlave.butt = _sisterAge+random(2,4)>>
	<<set $activeSlave.boobs = 50*((10*_sisterAge)+random(10,20))>>
	<<set $activeSlave.dick = _sisterAge+random(1,2)>>
	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
	<<set $activeSlave.preg = -3>>
	<<if $TFS.farmUpgrade > 0>>
		<<set $activeSlave.ovaries = 1>>
		<<set $activeSlave.preg = -1>>
		<<set $activeSlave.pubertyXX = 1>>
		<<if $TFS.farmUpgrade >= 2>>
			<<if $week - $TFS.farmUpgradeAsked < 35>>
				<<set $activeSlave.preg = random(1,($week - $TFS.farmUpgradeAsked))>>
			<<else>>
				<<set $activeSlave.preg = random(1,40)>>
			<</if>>
			<<if $TFS.farmUpgrade == 3>>
				<<set $activeSlave.pregType = random(20,40)>>
				<<set $activeSlave.pregAdaptation = 500>>
			<<else>>
				<<set $activeSlave.pregType = 1>>
			<</if>>
			<<set $activeSlave.pregWeek = $activeSlave.preg>>
			<<set $activeSlave.pregSource = -9>>
		<</if>>
	<</if>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.intelligenceImplant = 30>>
	<<set $activeSlave.teeth = "normal">>
	<<if $TFS.schoolUpgrade == 2>>
		<<set $activeSlave.energy = 100>>
	<<else>>
		<<set $activeSlave.energy = $activeSlave.physicalAge+random(20,30)>>
	<</if>>
	<<set $activeSlave.devotion = random(30,40)>>
	<<set $activeSlave.trust = random(60,75)>>
	<<set $activeSlave.health = random(60,80)>>
	<<set $activeSlave.muscles = 20>>
	<<if $activeSlave.genes == "XY">>
		<<set $activeSlave.shoulders = 1>>
	<</if>>
	<<set $activeSlave.skill.vaginal = 100>>
	<<set $activeSlave.skill.oral = 100>>
	<<set $activeSlave.skill.anal = 100>>
	<<set $activeSlave.skill.whoring = 15>>
	<<set $activeSlave.skill.entertainment = 100>>
	<<set $activeSlave.skill.combat = 0>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<if $TFS.schoolUpgrade == 1>>
		<<set $activeSlave.sexualQuirk = "caring">>
	<</if>>
	<<set $activeSlave.sexualFlaw = either("hates women", "none")>>
	<<set $activeSlave.behavioralFlaw = either("arrogant", "none")>>
	<<set $activeSlave.fetishStrength = 100>>
	<<set $activeSlave.fetishKnown = 0>>
	<<set $activeSlave.attrKnown = 0>>
	<<set $activeSlave.hStyle = "neat">>
	<<set $activeSlave.hLength = 150>>
	<<set $activeSlave.custom.tattoo = "$He has a simple pink heart tattooed on $his right temple.">>
	<<set $activeSlave.trueVirgin = 1>>

<<case "HA">>
	<<set $activeSlaveOneTimeMinAge = 22>>
	<<set $activeSlaveOneTimeMaxAge = 26>>
	<<set $one_time_age_overrides_pedo_mode = 1>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XX Slave">>
	<<set $activeSlave.origin = "You bought her from the prestigious Hippolyta Academy.">>
	<<set $activeSlave.career = "a bodyguard">>
	<<set $activeSlave.intelligenceImplant = 30>>
	<<set $activeSlave.faceShape = either("cute", "normal")>>
	<<set $activeSlave.face = either(35,35,35,50,75,100)>>
	<<set $activeSlave.lips = random(0,25)>>
	<<set $activeSlave.actualAge = random(20,25)>>
	<<set $activeSlave.physicalAge = $activeSlave.actualAge>>
	<<set $activeSlave.visualAge = $activeSlave.actualAge>>
	<<set $activeSlave.ovaryAge = $activeSlave.actualAge>>
	<<set $activeSlave.hips = 0>>
	<<set $activeSlave.vagina = random(0,1)>>
	<<set $activeSlave.anus = random(0,1)>>
	<<set $activeSlave.fetish = "none">>
	<<set $activeSlave.chem = 10 * random(1,3)>>
	<<set $activeSlave.butt = random(2,4)>>
	<<set $activeSlave.boobs = random(3,6) * 100>>
	<<set $activeSlave.preg = 0>>
	<<run SetBellySize($activeSlave)>>
	<<set $activeSlave.teeth = "normal">>
	<<set $activeSlave.devotion = random(60,75)>>
	<<set $activeSlave.trust = random(60,75)>>
	<<set $activeSlave.health = random(60,80)>>
	<<set _minHeight = random(170,180)>>
	<<if $HA.schoolUpgrade == 2>>
		<<set $activeSlave.height = Math.trunc(Math.clamp(Height.random($activeSlave, {limitMult: [2, 15], spread: .1}),_minHeight, 274))>>
		<<set $activeSlave.muscles = random(40,80)>>
	<<else>>
		<<set $activeSlave.height = Math.trunc(Math.clamp(Height.random($activeSlave, {limitMult: [1, 4]}),_minHeight, 274))>>
		<<set $activeSlave.muscles = random(20,40)>>
	<</if>>
	<<if $HA.schoolUpgrade == 3>>
		<<set $activeSlave.weight = either(10,20,20,30,30,40,40,50)>>
		<<set $activeSlave.waist = random(-10,40)>>
	<<else>>
		<<set $activeSlave.weight = -10>>
		<<set $activeSlave.waist = random(-20,10)>>
	<</if>>
	<<set $activeSlave.shoulders = 0>>
	<<if $HA.schoolUpgrade == 1>>
		<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [20,70]})>>
		<<set $activeSlave.skill.vaginal = either(20,20,40)>>
		<<set $activeSlave.skill.oral = either(20,20,40)>>
		<<set $activeSlave.skill.anal = either(20,20,40)>>
		<<set $activeSlave.skill.whoring = either(20,20,40)>>
		<<set $activeSlave.skill.entertainment = either(60,80,80,100)>>
	<<else>>
		<<set $activeSlave.intelligence = random(0,20)>>
		<<set $activeSlave.skill.vaginal = 10>>
		<<set $activeSlave.skill.oral = 10>>
		<<set $activeSlave.skill.anal = 10>>
		<<set $activeSlave.skill.whoring = 10>>
		<<set $activeSlave.skill.entertainment = either(20,40,40,60)>>
	<</if>>
	<<set $activeSlave.skill.combat = 1>>
	<<set $activeSlave.pubicHStyle = "waxed">>
	<<set $activeSlave.underArmHStyle = "waxed">>
	<<set $activeSlave.sexualQuirk = either("caring", "none", "none", "unflinching")>>
	<<set $activeSlave.sexualFlaw = either("apathetic", "judgemental", "none", "none")>>
	<<set $activeSlave.behavioralFlaw = either("arrogant", "none")>>
	<<set $activeSlave.behavioralQuirk = either("confident", "fitness", "none", "none")>>
	<<set $activeSlave.fetishStrength = 0>>
	<<set $activeSlave.fetishKnown = 0>>
	<<set $activeSlave.attrKnown = 0>>
	<<set $activeSlave.hStyle = either("braided", "bun", "neat", "ponytail", "tails")>>
	<<set $activeSlave.hLength = random(5,50)>>
	<<set $activeSlave.clothes = "a nice maid outfit">>
	<<set $activeSlave.custom.tattoo = "$He has the sword and eagle symbol of the Hippolyta Academy tattooed on $his left shoulder.">>

<<case "gangs and smugglers">>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMinAge = 6>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
	<<else>>
		<<set $activeSlaveOneTimeMinAge = 16>>
		<<if $retirementAge > 56>>
			<<set $activeSlaveOneTimeMaxAge = 55>>
		<<else>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge-2>>
		<</if>>
	<</if>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XY Slave">>

	<<set _criminal = setup.gangCriminalPool.random()>>

	<<switch _criminal>>
	<<case "mule">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for smuggling illegal contraband inside her body.">>
		<<set $prisonCrime = "is incarcerated for being a willing drug mule.">>
		<<set $activeSlave.career = "a drug mule">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-100,-25)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(-100, -100, -60, -60, -60, -30, -30)>>
		<<set $activeSlave.health = random(-80,20)>>
		<<set $activeSlave.anus = 4>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.addict = 100>>
	<<case "arms smuggler">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for smuggling arms to forces antagonistic to the Free Cities.">>
		<<set $prisonCrime = "is incarcerated for being an arms dealer.">>
		<<set $activeSlave.career = "an arms dealer">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(-60,25)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,60)>>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(-10,50)>>
		<<set $activeSlave.muscles = random(10,40)>>
	<<case "drug smuggler">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for smuggling drugs into the Free City.">>
		<<set $prisonCrime = "is incarcerated for smuggling drugs.">>
		<<set $activeSlave.career = "a drug smuggler">>
		<<set $activeSlave.devotion = random(-60,-20)>>
		<<set $activeSlave.trust = random(-60,40)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-60,60)>>
		<<set $activeSlave.health = random(-20,20)>>
	<<case "smuggler">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for smuggling goods into the Free City.">>
		<<set $prisonCrime = "is incarcerated for smuggling goods.">>
		<<set $activeSlave.career = "a smuggler">>
		<<set $activeSlave.devotion = random(-80,-20)>>
		<<set $activeSlave.trust = random(-100,40)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,60)>>
		<<set $activeSlave.health = random(-20,40)>>
		<<set $activeSlave.muscles = random(10,40)>>
	<<case "fence">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for dealing in stolen goods.">>
		<<set $prisonCrime = "is incarcerated for buying and selling stolen goods.">>
		<<set $activeSlave.career = "a fence">>
		<<set $activeSlave.devotion = random(-100,-20)>>
		<<set $activeSlave.trust = random(-20,40)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-60,30)>>
		<<set $activeSlave.health = random(-20,60)>>
	<<case "gang murderer">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for gang related murder.">>
		<<set $prisonCrime = "is incarcerated for gang related murders.">>
		<<set $activeSlave.career = "a gang member">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(-30, -20, 0, 0, 20, 40, 60)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(20,80)>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.custom.tattoo = "The prominent emblem of a local gang spans the length of his shoulders.">>
		<<set $activeSlave.skill.combat = 1>>
	<<case "gang assaulter">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for gang related extortion of local businesses.">>
		<<set $prisonCrime = "is incarcerated for gang related activities.">>
		<<set $activeSlave.career = "a gang member">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-100,0)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(40,80)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(10,50)>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.custom.tattoo = "The prominent emblem of a local gang spans the length of his shoulders.">>
		<<set $activeSlave.skill.combat = 1>>
	<<case "gang bruiser">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for a gang related beating of a local businessman.">>
		<<set $prisonCrime = "is incarcerated for gang related activities.">>
		<<set $activeSlave.career = "a gang member">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-100,0)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(60,80)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(10,70)>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.custom.tattoo = "The prominent emblem of a local gang spans the length of his shoulders.">>
		<<set $activeSlave.skill.combat = 1>>
	<<case "gang thief">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for gang related raiding of several local warehouses.">>
		<<set $prisonCrime = "is incarcerated for gang related activities.">>
		<<set $activeSlave.career = "a gang member">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-40,60)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(20,80)>>
		<<set $activeSlave.weight = random(-30,30)>>
		<<set $activeSlave.waist = random(10,70)>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.custom.tattoo = "The prominent emblem of a local gang spans the length of his shoulders.">>
		<<set $activeSlave.skill.combat = 1>>
	<<case "drug peddler">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for gang related drug distribution.">>
		<<set $prisonCrime = "is incarcerated for gang related activities.">>
		<<set $activeSlave.career = "a drug pusher">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-40,60)>>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(20,40)>>
		<<set $activeSlave.chem = 10 * random(3,5)>>
		<<set $activeSlave.custom.tattoo = "The prominent emblem of a local gang spans the length of his shoulders.">>
		<<set $activeSlave.skill.combat = 1>>
	<<case "hitman">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for a series of high profile murders.">>
		<<set $prisonCrime = "is incarcerated for a series of murders-for-hire.">>
		<<set $activeSlave.career = "a hitman">>
		<<set $activeSlave.devotion = random(-75,-50)>>
		<<set $activeSlave.trust = random(-60,25)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,100)>>
		<<set $activeSlave.health = random(-20,60)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(-10,50)>>
		<<set $activeSlave.muscles = random(20,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "assassin">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for a high profile assassination.">>
		<<set $prisonCrime = "is incarcerated for an assassination.">>
		<<set $activeSlave.career = "an assassin">>
		<<set $activeSlave.devotion = -100>>
		<<set $activeSlave.trust = 100>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = 100>>
		<<set $activeSlave.health = random(-20,60)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(20,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "murder">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for repeat murder.">>
		<<set $prisonCrime = "is incarcerated for murder.">>
		<<set $activeSlave.career = "a murderer">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(0,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-40,60)>>
		<<set $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(20,80)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "manslaughter">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for manslaughter.">>
		<<set $prisonCrime = "is incarcerated for manslaughter.">>
		<<set $activeSlave.career = "a criminal">>
		<<set $activeSlave.devotion = random(-20,50)>>
		<<set $activeSlave.trust = random(0,20)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-40,60)>>
		<<set $activeSlave.health = random(-40,0)>>
	<<case "attempted murder">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for attempted murder of a prominent individual.">>
		<<set $prisonCrime = "is incarcerated for an attempted murder.">>
		<<set $activeSlave.career = "a criminal">>
		<<set $activeSlave.devotion = random(-20,50)>>
		<<set $activeSlave.trust = random(0,20)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-100,0)>>
		<<set $activeSlave.health = random(-40,0)>>
	<</switch>>

<<case "military prison">>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMinAge = 12>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
	<<else>>
		<<set $activeSlaveOneTimeMinAge = 18>>
		<<if $retirementAge > 56>>
			<<set $activeSlaveOneTimeMaxAge = 55>>
		<<else>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge-2>>
		<</if>>
	<</if>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate New Slave">>

	/*
	<<if $activeSlave.dick > 0>>
		<<set $activeSlave.chastityPenis = 1>>
	<</if>>
	<<if $activeSlave.vagina > -1>>
		<<set $activeSlave.chastityVagina = 1>>
	<</if>>
	*/

	<<set _criminal = setup.militaryCriminalPool.random()>>

	<<switch _criminal>>
	<<case "spy">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was a spy captured while infiltrating the Free City.">>
		<<set $prisonCrime = "is incarcerated for spying.">>
		<<set $activeSlave.career = "a spy">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = -100>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(20,100)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.health = random(-40,20)>>
		<<set $activeSlave.weight = random(-30,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(20,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "terrorist">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was a terrorist captured when her attempt to destroy a public building and the people within was foiled.">>
		<<set $prisonCrime = "is incarcerated for terrorism.">>
		<<set $activeSlave.career = "a terrorist">>
		<<set $activeSlave.devotion = random(-80,-20)>>
		<<set $activeSlave.trust = -100>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-100,0)>>
		<<set $activeSlave.health = random(-60,20)>>
		<<set $activeSlave.weight = random(-100,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
	<<case "war criminal">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was a soldier imprisoned for committing unspeakable atrocities, even by the standards of an apocalyptic slave trading society.">>
		<<set $prisonCrime = "is incarcerated for a series of war crimes.">>
		<<set $activeSlave.career = "a soldier">>
		<<set $activeSlave.devotion = random(-100,-80)>>
		<<set $activeSlave.trust = random(20,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-20,100)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.health = random(-40,60)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(20,60)>>
		<<set $activeSlave.skill.combat = 1>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
	<<case "deserter">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was a soldier that abandoned her post.">>
		<<set $prisonCrime = "is incarcerated for going A.W.O.L.">>
		<<set $activeSlave.career = "a soldier">>
		<<set $activeSlave.devotion = random(-100,-80)>>
		<<set $activeSlave.trust = random(-100,-80)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-60,40)>>
		<<set $activeSlave.health = random(-40,60)>>
		<<set $activeSlave.weight = random(-50,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "officer">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was an officer that over-extended her forces and was overwhelmed.">>
		<<set $prisonCrime = "is a captured enemy officer.">>
		<<set $activeSlave.career = "a military officer">>
		<<set $activeSlave.devotion = random(-40,20)>>
		<<set $activeSlave.trust = random(-50,0)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,100)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(0,60)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(20,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "specOps">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was a special operations officer that acted on bad intel and ended up captured.">>
		<<set $prisonCrime = "is a captured enemy special operations officer.">>
		<<set $activeSlave.career = "spec ops">>
		<<set $activeSlave.devotion = random(-80,-50)>>
		<<set $activeSlave.trust = random(-100,100)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(60, 80, 100)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.health = random(0,60)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(30,60)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "sniper">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was an enemy sniper that was captured after her company lost to your military might.">>
		<<set $prisonCrime = "is a captured enemy sniper.">>
		<<set $activeSlave.career = "a sniper">>
		<<set $activeSlave.devotion = random(-50,-20)>>
		<<set $activeSlave.trust = random(-100,-80)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(60, 80, 100)>>
		<<set $activeSlave.intelligenceImplant = 20>>
		<<set $activeSlave.health = random(0,20)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(30,60)>>
		<<set $activeSlave.skill.combat = 1>>
		<<if $activeSlave.boobs > 400>>
			<<set $activeSlave.boobs = 400>>
		<</if>>
	<<case "gunner">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was an enemy machine gunner that was captured after her company lost to your military might.">>
		<<set $prisonCrime = "is a captured enemy gunner.">>
		<<set $activeSlave.career = "a soldier">>
		<<set $activeSlave.devotion = random(-50,-20)>>
		<<set $activeSlave.trust = random(-50,-20)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,90)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(0,20)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(50,60)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "soldier">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was an enemy soldier that was captured after her company lost to your military might.">>
		<<set $prisonCrime = "is a captured enemy soldier.">>
		<<set $activeSlave.career = "a soldier">>
		<<set $activeSlave.devotion = random(-100,-20)>>
		<<set $activeSlave.trust = random(-50,20)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(0,60)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(0,40)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(30,60)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "private">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was an enemy grunt that was captured after her company lost to your military might.">>
		<<set $prisonCrime = "is a captured enemy private.">>
		<<set $activeSlave.career = "a private">>
		<<set $activeSlave.devotion = random(-40,-20)>>
		<<set $activeSlave.trust = random(-100,-80)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-90,70)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(0,20)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(10,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<</switch>>

<<case "white collar">>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMinAge = 16>>
		<<set $activeSlaveOneTimeMaxAge = 45>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
	<<else>>
		<<set $activeSlaveOneTimeMinAge = 25>>
		<<if $retirementAge > 66>>
			<<set $activeSlaveOneTimeMaxAge = 65>>
		<<else>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge-2>>
		<</if>>
	<</if>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate New Slave">>

	<<set _criminal = setup.whiteCollarCriminalPool.random()>>

	<<switch _criminal>>
	<<case "racketeering">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " convicted of racketeering.">>
		<<set $prisonCrime = "is incarcerated for racketeering.">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-20,20)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
	<<case "bribery">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " arrested and sentenced for bribing government officials.">>
		<<set $prisonCrime = "is incarcerated for bribery.">>
		<<set $activeSlave.devotion = random(-50,-20)>>
		<<set $activeSlave.trust = random(20,50)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
	<<case "blackmail">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " convicted of blackmail against a sorority of university students, forcing them to do sexual favors.">>
		<<set $prisonCrime = "is incarcerated for blackmail.">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(20,50)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
		<<set $activeSlave.fetish = "sadist">>
		<<set $activeSlave.fetishStrength = 100>>
	<<case "embezzlement">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " involved in a scandal and convicted of embezzlement.">>
		<<set $prisonCrime = "is incarcerated for embezzlement.">>
		<<set $activeSlave.devotion = random(0,20)>>
		<<set $activeSlave.trust = random(-10,10)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
	<<case "fraud">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " convicted of fraud.">>
		<<set $prisonCrime = "is incarcerated for fraud.">>
		<<set $activeSlave.devotion = random(20,40)>>
		<<set $activeSlave.trust = random(20,50)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
	<<case "tax evasion">>
		<<set $activeSlave.career = either("a businessman", "a lawyer", "a stockbroker")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " convicted of tax evasion.">>
		<<set $prisonCrime = "is incarcerated for tax evasion.">>
		<<set $activeSlave.devotion = random(-20,0)>>
		<<set $activeSlave.trust = random(20,50)>>
		<<set $activeSlave.intelligence = random(0,99)>>
		<<set $activeSlave.intelligenceImplant = 15>>
		<<set $activeSlave.health = random(20,60)>>
	<<case "malpractice">>
		<<set $activeSlave.career = either("a doctor", "a nurse", "a physician")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " that took advantage of her position to molest and modify her patients.">>
		<<set $prisonCrime = "is incarcerated for malpractice.">>
		<<set $activeSlave.devotion = random(-50,0)>>
		<<set $activeSlave.trust = random(-100,-50)>>
		<<set $activeSlave.intelligence = random(55,99)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.health = random(-40,20)>>
	<<case "abuse of power">>
		<<set $activeSlave.career = either("a judge", "a lawyer", "a police officer")>>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was " + $activeSlave.career + " that took advantage of her position for her own benefit.">>
		<<set $prisonCrime = "is incarcerated for abuse of power.">>
		<<set $activeSlave.devotion = random(-100,0)>>
		<<set $activeSlave.trust = random(-50,50)>>
		<<set $activeSlave.intelligence = random(60,99)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.health = random(20,60)>>
		<<set $activeSlave.behavioralFlaw = "arrogant">>
	<</switch>>

<<case "low tier criminals">>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMinAge = 6>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
	<<else>>
		<<set $activeSlaveOneTimeMinAge = 16>>
		<<if $retirementAge > 56>>
			<<set $activeSlaveOneTimeMaxAge = 55>>
		<<else>>
			<<set $activeSlaveOneTimeMaxAge = $retirementAge-2>>
		<</if>>
	<</if>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate New Slave">>

	/*
	<<if $activeSlave.dick > 0>>
		<<set $activeSlave.chastityPenis = 1>>
	<</if>>
	<<if $activeSlave.vagina > -1>>
		<<set $activeSlave.chastityVagina = 1>>
	<</if>>
	*/

	<<set _criminal = setup.pettyCriminalPool.random()>>

	<<switch _criminal>>
	<<case "robbery">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for robbery.">>
		<<set $prisonCrime = "is incarcerated for robbery.">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-60,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(-100, -100, -80, -60, -40, -30, -20, -5, 0, 5, 20)>>
		<<set $activeSlave.health = random(-20,20)>>
	<<case "armed robbery">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for armed robbery.">>
		<<set $prisonCrime = "is incarcerated for armed robbery.">>
		<<set $activeSlave.devotion = random(-50,-20)>>
		<<set $activeSlave.trust = random(-20,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,60)>>
		<<set $activeSlave.health = random(-10,20)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(10,40)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "murder">>
		<<if random(1,100) > 70>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for murder. Her actions weigh heavily on her conscience.">>
			<<set $activeSlave.devotion = 0>>
			<<set $activeSlave.trust = 0>>
			<<set $activeSlave.health = random(-60,-20)>>
			<<set $activeSlave.fetish = "mindbroken">>
		<<else>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for murder.">>
			<<set $activeSlave.devotion = random(-50,-20)>>
			<<set $activeSlave.trust = random(-20,60)>>
			<<set $activeSlave.health = random(-10,20)>>
		<</if>>
		<<set $prisonCrime = "is incarcerated for murder.">>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,70)>>
	<<case "arson">>
		<<if random(1,100) > 50>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for arson. Her actions, and those she inadvertently killed, weigh heavily on her conscience.">>
			<<set $activeSlave.devotion = 0>>
			<<set $activeSlave.trust = 0>>
			<<set $activeSlave.health = random(-80,-20)>>
			<<set $activeSlave.fetish = "mindbroken">>
		<<else>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for arson.">>
			<<set $activeSlave.devotion = random(-70,-50)>>
			<<set $activeSlave.trust = random(0,60)>>
			<<set $activeSlave.health = random(-10,20)>>
		<</if>>
		<<set $prisonCrime = "is incarcerated for arson.">>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,70)>>
	<<case "burglary">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for burglary.">>
		<<set $prisonCrime = "is incarcerated for burglary.">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-60,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-100,20)>>
		<<set $activeSlave.health = random(-20,20)>>
	<<case "cat burglar">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for repeat burglary.">>
		<<set $prisonCrime = "is incarcerated for career burglary.">>
		<<set $activeSlave.career = "a cat burglar">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-60,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(60, 80, 100)>>
		<<set $activeSlave.health = random(0,60)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(10,40)>>
	<<case "petty theft">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for petty theft.">>
		<<set $prisonCrime = "is incarcerated for petty theft.">>
		<<set $activeSlave.career = "a thief">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(-100,-60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(-100, -100, -80, -60, -40, -30, -20, -5, 0, 5, 20)>>
		<<set $activeSlave.health = random(-20,20)>>
	<<case "theft">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for theft.">>
		<<set $prisonCrime = "is incarcerated for theft.">>
		<<set $activeSlave.career = "a thief">>
		<<set $activeSlave.devotion = random(-50,0)>>
		<<set $activeSlave.trust = random(-100,-60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,70)>>
		<<set $activeSlave.health = random(-20,20)>>
	<<case "pickpocketing">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for repeat pick-pocketing.">>
		<<set $prisonCrime = "is incarcerated for pick-pocketing.">>
		<<set $activeSlave.career = "a pick-pocket">>
		<<set $activeSlave.devotion = random(-20,0)>>
		<<set $activeSlave.trust = random(-100,-60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,70)>>
		<<set $activeSlave.health = random(-60,0)>>
	<<case "manslaughter">>
		<<if random(1,100) > 60>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for manslaughter. Her actions weigh heavily on her conscience.">>
			<<set $activeSlave.devotion = 0>>
			<<set $activeSlave.trust = 0>>
			<<set $activeSlave.health = random(-80,-20)>>
			<<set $activeSlave.fetish = "mindbroken">>
		<<else>>
			<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for manslaughter.">>
			<<set $activeSlave.devotion = random(-70,-50)>>
			<<set $activeSlave.trust = random(0,60)>>
			<<set $activeSlave.health = random(-10,20)>>
		<</if>>
		<<set $prisonCrime = "is incarcerated for manslaughter.">>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = random(-80,70)>>
	<<case "blackmail">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for blackmail.">>
		<<set $prisonCrime = "is incarcerated for blackmail.">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(-100,-60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = either(60, 80, 100)>>
		<<set $activeSlave.health = random(0,60)>>
	<<case "assault">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for assault.">>
		<<set $prisonCrime = "is incarcerated for assault.">>
		<<set $activeSlave.devotion = random(-70,-50)>>
		<<set $activeSlave.trust = random(-20,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(30,60)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "battery">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for battery.">>
		<<set $prisonCrime = "is incarcerated for battery.">>
		<<set $activeSlave.devotion = random(-100,-70)>>
		<<set $activeSlave.trust = random(20,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(40,60)>>
		<<set $activeSlave.skill.combat = 1>>
	<<case "tax evasion">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for tax evasion.">>
		<<set $prisonCrime = "is incarcerated for tax evasion.">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(0,60)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [0,100]})>>
		<<set $activeSlave.health = random(0,60)>>
	<<case "rape">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for rape.">>
		<<set $prisonCrime = "is incarcerated for rape.">>
		<<set $activeSlave.devotion = random(-100,-50)>>
		<<set $activeSlave.trust = random(-20,80)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.weight = random(-10,10)>>
		<<set $activeSlave.waist = random(-10,10)>>
		<<set $activeSlave.muscles = random(30,60)>>
		<<set $activeSlave.fetish = "sadist">>
		<<set $activeSlave.fetishStrength = 80>>
	<<case "child molestation">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for child molestation.">>
		<<set $prisonCrime = "is incarcerated for child molestation.">>
		<<if $minimumSlaveAge < 13>>
			<<set $activeSlave.devotion = random(-20,0)>>
			<<set $activeSlave.trust = random(-20,0)>>
		<<else>>
			<<set $activeSlave.devotion = random(-50,-20)>>
			<<set $activeSlave.trust = random(-100,0)>>
		<</if>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.muscles = random(10,40)>>
		<<set $activeSlave.fetish = "sadist">>
		<<set $activeSlave.fetishStrength = 80>>
	<<case "child abuse">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for child abuse.">>
		<<set $prisonCrime = "is incarcerated for child abuse.">>
		<<if $minimumSlaveAge < 13>>
			<<set $activeSlave.devotion = random(-20,0)>>
			<<set $activeSlave.trust = random(-20,50)>>
		<<else>>
			<<set $activeSlave.devotion = random(-50,-20)>>
			<<set $activeSlave.trust = random(-50,50)>>
		<</if>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.muscles = random(10,40)>>
		<<set $activeSlave.fetish = "sadist">>
		<<set $activeSlave.fetishStrength = 100>>
		<<set $activeSlave.sexualFlaw = "malicious">>
	<<case "domestic abuse">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for domestic abuse.">>
		<<set $prisonCrime = "is incarcerated for domestic abuse.">>
		<<set $activeSlave.devotion = random(-50,-20)>>
		<<set $activeSlave.trust = random(-100,50)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-10,40)>>
		<<set $activeSlave.muscles = random(10,40)>>
		<<set $activeSlave.fetish = "sadist">>
		<<set $activeSlave.fetishStrength = 50>>
	<<case "illegal immigrant">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for illegal immigration.">>
		<<set $prisonCrime = "is incarcerated for illegally entering the Free City.">>
		<<set $activeSlave.career = "a refugee">>
		<<set $activeSlave.devotion = random(0,20)>>
		<<set $activeSlave.trust = random(-100,-50)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-90,-40)>>
	<<case "mule">>
		<<set $activeSlave.origin = "You purchased her life at a prison sale. She was locked away for smuggling illegal contraband inside her body.">>
		<<set $prisonCrime = "is incarcerated for smuggling drugs in her body.">>
		<<set $activeSlave.career = "a drug mule">>
		<<set $activeSlave.devotion = random(-20,20)>>
		<<set $activeSlave.trust = random(0,25)>>
		<<set $activeSlave.hStyle = "buzzcut">>
		<<set $activeSlave.hLength = 0>>
		<<set $activeSlave.health = random(-80,20)>>
		<<if $activeSlave.ovaries == 1 && $activeSlave.vagina > 0>>
			<<set $activeSlave.vagina = 4>>
			<<set $activeSlave.bellySag += 5>>
		<</if>>
		<<set $activeSlave.anus = 4>>
		<<set $activeSlave.bellySag += 5>>
		<<set $activeSlave.chem = 10 * random(1,3)>>
		<<set $activeSlave.addict = 100>>
	<</switch>>

<<default>>
	Someone messed up. _market is not known.

<</switch>>
<<run generatePronouns($activeSlave)>>
<</widget>>

/%
	Call as <<MarketName 'market' ['arcology']>>
	If $args[0] is undefined, will generate a kidnapper's market slave.
	If $args[0] is "corporate" and $args[1] is undefined, will use neighboring arcology 1.
%/
<<widget MarketName>>
<<if $args[0]>>
	<<set _market = $args[0]>>
<<else>>
	<<set _market = "kidnappers">>
<</if>>

<<switch _market>>
<<case "corporate">>
	your corporation
<<case "neighbor">>
	<<if $args[1]>>
		<<print $arcologies[$args[1]].name>>
	<<else>>
		<<print $arcologies[1].name>>
	<</if>>
<<case "kidnappers">>
	the Kidnappers' Market
<<case "indentures">>
	the Indentures Market
<<case "hunters">>
	the Runaway Hunters' Market
<<case "raiders">>
	the Raiders' Market
<<case "underage raiders">>
	the Raiders' Black Market
<<case "heap">>
	the Flesh Heap as alive as when you purchased them.
<<case "wetware">>
	the Wetware CPU market
<<case "trainers">>
	the Trainers' Market
<<case "TSS">>
	The Slavegirl School
<<case "GRI">>
	Growth Research Institute
<<case "SCP">>
	St. Claver Preparatory
<<case "LDE">>
	L'école des Enculées
<<case "TGA">>
	The Gymnasium-Academy
<<case "TCR">>
	The Cattle Ranch
<<case "TFS">>
	The Futanari Sisters
<<case HA>>
	The Hippolyta Academy
<<case "low tier criminals" "gangs and smugglers" "white collar" "military prison">>
	the prisoner sale
<<default>>
	Someone messed up. _market is not known.

<</switch>>
<</widget>>

/%
	Call as <<MarketNamePeriod 'market' ['arcology']>>
	If $args[0] is undefined, will generate a kidnapper's market slave.
	If $args[0] is "corporate" and $args[1] is undefined, will use neighboring arcology 1.
%/
<<widget MarketNamePeriod>>
<<if $args[0]>>
	<<set _market = $args[0]>>
<<else>>
	<<set _market = "kidnappers">>
<</if>>

<<switch _market>>
<<case "corporate">>
	your corporation.
<<case "neighbor">>
	<<if $args[1]>>
		<<print $arcologies[$args[1]].name>>.
	<<else>>
		<<print $arcologies[1].name>>.
	<</if>>
<<case "kidnappers">>
	the Kidnappers' Market.
<<case "indentures">>
	the Indentures Market.
<<case "hunters">>
	the Runaway Hunters' Market.
<<case "raiders">>
	the Raiders' Market.
<<case "underage raiders">>
	the Raiders' Black Market.
<<case "heap">>
	the Flesh Heap, alive and not dead.
<<case "wetware">>
	the Wetware CPU market.
<<case "trainers">>
	the Trainers' Market.
<<case "TSS">>
	The Slavegirl School.
<<case "GRI">>
	Growth Research Institute.
<<case "SCP">>
	St. Claver Preparatory.
<<case "LDE">>
	L'école des Enculées.
<<case "TGA">>
	The Gymnasium-Academy.
<<case "TCR">>
	The Cattle Ranch.
<<case "TFS">>
	The Futanari Sisters.
<<case HA>>
	The Hippolyta Academy.
<<case "low tier criminals" "gangs and smugglers" "white collar" "military prison">>
	the prisoner sale.
<<default>>
	Someone messed up. _market is not known.

<</switch>>
<</widget>>

/%
 Call as <<JFCSlave>>
%/
<<widget "JFCSlave">>
	<<set $activeSlaveOneTimeMinAge = 20>>
	<<set $activeSlaveOneTimeMaxAge = 36>>
	<<set $one_time_age_overrides_pedo_mode = 1>>
	<<set $oneTimeDisableDisability = 1>>
	<<include "Generate XX Slave">>
	<<set $activeSlave.weight = random(-30,20), $activeSlave.waist = random(-30,10), $activeSlave.face = random(40,60)>>
	<<if $activeSlave.faceShape == "masculine">>
		<<set $activeSlave.faceShape = "sensual">>
	<</if>>
	<<if $activeSlave.boobShape == "saggy" || $activeSlave.boobShape == "downward-facing">>
		<<set $activeSlave.boobShape = "perky">>
	<</if>>
	<<set $activeSlave.eyes = 1, $activeSlave.hears = 0, $activeSlave.voice = 2>>
	<<set $activeSlave.intelligenceImplant = 30, $activeSlave.intelligence = random(20,100)>>
	<<set $activeSlave.trust = 80, $activeSlave.devotion = 80>>
	<<set $activeSlave.health = random(80,95)>>
	<<set $activeSlave.origin = "The Job Fulfillment Center offered her contract to fill your request for a ">>
	<<set $activeSlave.origin += $Role>>
	<<set $activeSlave.origin += ".">>
	<<switch $Role>>
	/* Opens security */
		<<case "Lieutenant Colonel">>
			<<set $activeSlave.devotion = random(96,100), $activeSlave.trust = random(96, 100), $activeSlave.energy = random(96,100), $activeSlave.intelligence = 70, $activeSlave.skill.combat = 1>>
			<<set $activeSlave.career = either("a bodyguard", "a bouncer", "a bounty hunter", "a gang member", "a law enforcement officer", "a mercenary", "a prison guard", "a private detective", "a revolutionary", "a security guard", "a soldier", "a street thug", "a transporter", "an assassin", "an enforcer", "in a militia")>>
		<<case "Bodyguard">>
			<<set $activeSlave.devotion = 90, $activeSlave.muscles = random(30,70), $activeSlave.height = Math.round(Height.random($activeSlave, {skew: 3, spread: .2, limitMult: [1, 4]})), $activeSlave.weight = random(-10,10), $activeSlave.teeth = either("normal", "pointy"), $activeSlave.amp = either(-4, -4, 0, 0, 0, 0), $activeSlave.skill.combat = 1>>
			<<set $activeSlave.career = either("a bodyguard", "a kunoichi", "a law enforcement officer", "a military brat", "a revolutionary", "a soldier", "a transporter", "an assassin", "in a militia")>>
		<<case "Wardeness">>
			<<set $activeSlave.energy = random(80,100), $activeSlave.sexualFlaw = either("malicious", "none", "none", "none", "none"), $activeSlave.fetish = "sadist", $activeSlave.fetishStrength = 100, $activeSlave.muscles = random(50,80), $activeSlave.skill.combat = 1>>
			<<set $activeSlave.career = either("a bouncer", "a bounty hunter", "a gang member", "a mercenary", "a prison guard", "a private detective", "a security guard", "a street thug", "an enforcer")>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,6), $activeSlave.balls = random(3,6), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,1,2,2,3)>>
			<</if>>
	/* Closes Security */
	/* Opens management */
		<<case "Headgirl">>
			<<set $activeSlave.devotion = 90, $activeSlave.trust = 100, $activeSlave.fetish = "dom", $activeSlave.fetishStrength = 100, $activeSlave.energy = random(70,90), $activeSlave.intelligence = random(60,100), $activeSlave.skill.entertainment = 100, $activeSlave.skill.whoring = 100, $activeSlave.skill.anal = 100, $activeSlave.skill.oral = 100, $activeSlave.skill.vaginal = 100, $activeSlave.career = either("a lawyer", "a military officer", "a politician")>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,5), $activeSlave.balls = random(3,6), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,2)>>
			<</if>>
			<<set $activeSlave.vagina = random(3,4)>>
			<<if $AgePenalty == 1>>
				<<set $activeSlave.actualAge = random(36,$retirementAge-5)>>
			<<else>>
				<<set $activeSlave.actualAge = random(20,$retirementAge-5)>>
			<</if>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Teacher">>
			<<set $activeSlave.fetish = "dom", $activeSlave.fetishStrength = 100, $activeSlave.energy = random(70,90), $activeSlave.intelligence = 100, $activeSlave.skill.entertainment = 100, $activeSlave.skill.whoring = 100, $activeSlave.skill.anal = 100, $activeSlave.skill.oral = 100, $activeSlave.skill.vaginal = 100, $activeSlave.face = random(41,90), $activeSlave.career = either("a librarian", "a principal", "a private instructor", "a professor", "a scholar", "a scientist", "a teacher", "a teaching assistant")>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,5), $activeSlave.balls = random(3,6), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,1,2,2,3)>>
			<</if>>
			<<set $activeSlave.actualAge = random(36,$retirementAge-3)>>
			<<set $activeSlave.vagina = random(3,4)>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Nurse">>
			<<set $activeSlave.fetish = "dom", $activeSlave.fetishStrength = 100, $activeSlave.muscles = random(6,50), $activeSlave.face = random(41,90), $activeSlave.sexualQuirk = "caring", $activeSlave.career = either("a doctor", "a medic", "a medical student", "a nurse", "a paramedic"), $activeSlave.intelligence = random(40,90)>>
		<<case "Motherly Attendant">>
			<<set $activeSlave.devotion = 90, $activeSlave.trust = 90, $activeSlave.fetish = "submissive", $activeSlave.fetishStrength = 100, $activeSlave.face = random(60,90)>>
			<<set $activeSlave.career = either("a counselor", "a dispatch officer", "a lifeguard", "a masseuse", "a psychologist", "a therapist"), $activeSlave.counter.birthsTotal = random(1,3), $activeSlave.pregKnown = 1, $activeSlave.preg = random(20,35), $activeSlave.pregWeek = $activeSlave.preg, $activeSlave.pregType = 1>>
			<<run SetBellySize($activeSlave)>>
			<<set $activeSlave.actualAge = random(36,$retirementAge-3)>>
			<<set $activeSlave.vagina = random(3,4)>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Attendant">>
			<<set $activeSlave.devotion = 90, $activeSlave.trust = 90, $activeSlave.fetish = "submissive", $activeSlave.fetishStrength = 100, $activeSlave.eyes = either(-2, 1, 1), $activeSlave.preg = 0, $activeSlave.face = random(60,90), $activeSlave.career = either("a counselor", "a masseuse", "a therapist")>>
			<<set $activeSlave.actualAge = random(26,$retirementAge-3)>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Matron">>
			<<set $activeSlave.devotion = 90, $activeSlave.trust = 90, $activeSlave.sexualQuirk = "caring", $activeSlave.eyes = 1, $activeSlave.counter.birthsTotal = random(2,4), $activeSlave.vagina = 3, $activeSlave.face = random(60,90), $activeSlave.career = either( "a nanny", "a practitioner")>>
			<<set $activeSlave.actualAge = random(24,$retirementAge-3)>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Stewardess">>
			<<set $activeSlave.energy = random(70,90), $activeSlave.fetish = "dom", $activeSlave.fetishStrength = 100, $activeSlave.career = either("a barista", "a bartender", "a caregiver", "a charity worker", "a professional bartender", "a secretary", "a wedding planner", "an air hostess", "an estate agent", "an investor", "an office worker")>>
			<<if $AgePenalty == 1>>
				<<set $activeSlave.actualAge = random(36,$retirementAge-5)>>
			<<else>>
				<<set $activeSlave.actualAge = random(20,$retirementAge-5)>>
			<</if>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Milkmaid">>
			<<set $activeSlave.muscles = random(31,60), $activeSlave.skill.oral = random(31,60), $activeSlave.sexualQuirk = "caring", $activeSlave.behavioralQuirk = "funny", $activeSlave.career = either("a cowgirl", "a dairy worker", "a milkmaid", "a farmer's daughter", "a shepherd", "a veterinarian"), $activeSlave.intelligence = random(20,70)>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,5), $activeSlave.balls = random(4,9), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,1,2)>>
			<</if>>
		<<case "Farmer">>
			<<set $activeSlave.devotion = 80, $activeSlave.trust = 80, $activeSlave.health = random(80,95), $activeSlave.muscles = random(41,70), $activeSlave.sexualQuirk = "caring", $activeSlave.career = either("a farmer", "a farmer's daughter", "a rancher", "a farmhand", "a zookeeper"), $activeSlave.intelligenceImplant = 30, $activeSlave.intelligence = random(20,70), $activeSlave.height = Math.round(Height.random($activeSlave, {skew: 3, spread: .2, limitMult: [1, 4]})), $activeSlave.weight = random(0,30)>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,5), $activeSlave.balls = random(4,9), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,1,2)>>
			<</if>>
			<<if $AgePenalty == 1>>
				<<set $activeSlave.actualAge = random(36,$retirementAge-5)>>
			<<else>>
				<<set $activeSlave.actualAge = random(20,$retirementAge-5)>>
			<</if>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
	/* Closes management */
	/* Opens entertain */
		<<case "DJ">>
			<<set $activeSlave.skill.entertainment = 100, $activeSlave.muscles = random(6,30), $activeSlave.face = random(80,100), $activeSlave.career = either("a classical dancer", "a classical musician", "a dancer", "a house DJ", "a musician", "an aspiring pop star")>>
		<<case "Madam">>
			<<set $activeSlave.skill.whoring = 100, $activeSlave.career = either("a business owner", "a manager", "a pimp", "a procuress", "an innkeeper")>>
			<<if $seeDicks > 0>>
				<<set $activeSlave.dick = random(3,5), $activeSlave.balls = random(3,5), $activeSlave.scrotum = $activeSlave.balls, $activeSlave.prostate = either(1,1,1,2)>>
			<</if>>
			<<if $AgePenalty == 1>>
				<<set $activeSlave.actualAge = random(36,$retirementAge-5)>>
			<<else>>
				<<set $activeSlave.actualAge = random(20,$retirementAge-5)>>
			<</if>>
			<<set $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
		<<case "Concubine">>
			<<set $activeSlave.prestige = 3, $activeSlave.energy = random(80,100), $activeSlave.skill.entertainment = 100, $activeSlave.skill.whoring = 100, $activeSlave.skill.anal = 100, $activeSlave.skill.oral = 100, $activeSlave.skill.vaginal = 100, $activeSlave.face = 100, $activeSlave.devotion = random(90,95), $activeSlave.trust = random(90,100)>>
		/* Closes Entertain */
		<</switch>>
<</widget>>

/%
 % Shows controls for buying and advancing the queue for buying slaves from a school
 % Arguments: none
 % Call as <<buyingFromMarketControls>>
 %/
<<widget "buyingFromMarketControls">>

[["Decline to purchase " + $him + " and check out another slave"|passage()][$slavesSeen += 1]]
<<if $cash >= $slaveCost>>

[["Buy " + $him + " and check out other slaves to order"|passage()][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave),$newSlaves.push($activeSlave), $introType = "multi", $slavesSeen+=1]]
	<<if $newSlaves.length == 0>>

[["Buy " + $his + " slave contract"|New Slave Intro][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave),$nextButton = "Continue",$nextLink = "AS Dump",$returnTo = "Main"]]
	<<else>>

[["Buy " + $him + " and finish your order of slaves"|Bulk Slave Intro][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave), $newSlaves.push($activeSlave)]]
	<</if>>
<<else>>

//You lack the necessary funds to buy this slave.//
<</if>>
<<if $newSlaves.length > 0>>

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

<<if $slaveMarket != "indentures" && $slaveMarket != "neighbor" && $slaveMarket != "heap" && $slaveMarket != "wetware">>
	<<set $applyLaw = 1>>
<</if>>
<<set $saleDescription = 1>><<include "Long Slave Description">>
<</widget>>

/%
 % Shows controls for buying and advancing the queue for buying slaves from a school
 % Arguments:
 % 0: school
 % 1: name for a single slave ("slave", "cow", etc.)
 % 2: name for a bunch of them ("slaves", "cattle", etc.)
 % Call as <<buyingFromSchoolControls $TCR "cow" "cattle">>
 %/
<<widget "buyingFromSchoolControls">>

[["Decline to purchase " + $him + " and check out another " + $args[1]|passage()][$slavesSeen += 1]]
<<if $cash >= $slaveCost>>
	<<set _schoolToBuyFrom = $args[0]>>

[["Buy " + $him + " and check out other " + $args[2] + " to order"|passage()][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave), _schoolToBuyFrom.schoolSale = 0, _schoolToBuyFrom.studentsBought += 1, $newSlaves.push($activeSlave), $introType = "multi", $slavesSeen+=1]]
	<<if $newSlaves.length == 0>>

[["Buy " + $his + " slave contract"|New Slave Intro][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave), _schoolToBuyFrom.schoolSale = 0, _schoolToBuyFrom.studentsBought += 1, $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Main"]]
	<<else>>

[["Buy " + $him + " and finish your order of " + $args[2]|Bulk Slave Intro][cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave), _schoolToBuyFrom.schoolSale = 0, _schoolToBuyFrom.studentsBought += 1, $newSlaves.push($activeSlave)]]
	<</if>>
<<else>>

//You lack the necessary funds to buy this $args[1].//
<</if>>
<<if $newSlaves.length > 0>>

[["Finish your order of " + $args[2]|"Bulk Slave Intro"]]
<</if>>

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