code:
:: Elite Slave [nobr]

<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves">>
<<set $encyclopedia = "Slave Schools">>

You check to see if any potential breeding slaves are on auction. <<if $eliteAuctioned == 1>>There are none available right now, but there probably will be next week.<<else>>

<<set $eliteAuctioned = 1>>

<<if $arcologies[0].FSMaturityPreferentialist > 20>>
	<<set $activeSlaveOneTimeMinAge = 25>>
<<else>>
	<<set $activeSlaveOneTimeMinAge = $fertilityAge>>
<</if>>
<<if $arcologies[0].FSYouthPreferentialist > 20>>
	<<set $activeSlaveOneTimeMaxAge = 23>>
<<else>>
	<<set $activeSlaveOneTimeMaxAge = 40>>
<</if>>
<<set $one_time_age_overrides_pedo_mode = 1>>
<<set $oneTimeDisableDisability = 1>>
<<if $arcologies[0].FSSupremacist != "unset">>
	<<set $fixedRace = $arcologies[0].FSSupremacistRace>>
<<elseif $arcologies[0].FSSubjugationist != "unset">>
	<<set _races = ["amerindian", "asian", "asian", "asian", "asian", "asian", "asian", "black", "black", "indo-aryan", "indo-aryan", "latina", "latina", "latina", "malay", "malay", "middle eastern", "middle eastern", "mixed race", "pacific islander", "semitic", "semitic", "southern european", "southern european", "white", "white", "white", "white", "white", "white", "white", "white", "white"]>>
	<<set _races = _races.delete($arcologies[0].FSSubjugationistRace)>>
	<<set $fixedRace = _races.random()>>
<</if>>
<<set $activeSlave = GenerateNewSlave("XX")>>
<<set $activeSlave.origin = "$He was purchased from a member of the Elite.">>
<<set $activeSlave.career = "a slave">>
<<set $activeSlave.prestige = 1>>
<<set $activeSlave.trust = random(60,100)>>
<<set $activeSlave.devotion = random(60,100)>>
<<if $arcologies[0].FSPetiteAdmiration > 20>>
	<<if !heightPass($activeSlave)>>
		<<set $activeSlave.height = Math.trunc(Height.random($activeSlave, {limitMult: [-4, -2]}))>>
	<</if>>
<<elseif $arcologies[0].FSStatuesqueGlorification > 20>>
	<<if !heightPass($activeSlave)>>
		<<set $activeSlave.height = Math.trunc(Height.random($activeSlave, {limitMult: [3, 5]}))>>
	<</if>>
<</if>>
<<if $arcologies[0].FSPaternalist > 20>>
	<<run setHealth($activeSlave, 100, 0, 0, 0, 0)>>
	<<set $activeSlave.intelligenceImplant = 30>>
<<else>>
	<<run setHealth($activeSlave, jsRandom(10, 60), undefined, undefined, 0)>>
	<<set $activeSlave.intelligenceImplant = either(0,15,30)>>
<</if>>
<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
	<<if $arcologies[0].FSHedonisticDecadence > 20 || $arcologies[0].FSPhysicalIdealistLaw == 1>>
		<<set _weightMax = 30>>
	<<else>>
		<<set _weightMax = 0>>
	<</if>>
<<elseif $arcologies[0].FSPhysicalIdealistLaw == 1>>
	<<set _weightMax = 30>>
<<else>>
	<<set _weightMax = 100>>
<</if>>
<<if $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
		<<set _weightMin = 10>>
	<<else>>
		<<set _weightMin = 95>>
	<</if>>
<<else>>
	<<set _weightMin = -70>>
<</if>>
<<set $activeSlave.weight = random(_weightMin, _weightMax)>>
<<if $arcologies[0].FSPhysicalIdealist > 20>>
	<<if $arcologies[0].FSPhysicalIdealistLaw == 1>>
		<<set _musclesMin = 20>>
		<<set _musclesMax = 50>>
	<<else>>
		<<set _musclesMin = 95>>
		<<set _musclesMax = 100>>
	<</if>>
<<elseif $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $arcologies[0].FSHedonisticDecadenceStrongFat == 1>>
		<<set _musclesMin = 50>>
		<<set _musclesMax = 100>>
	<<else>>
		<<set _musclesMin = -100>>
		<<set _musclesMax = 50>>
	<</if>>
<<else>>
	<<set _musclesMin = -50>>
	<<set _musclesMax = 50>>
<</if>>
<<set $activeSlave.muscles = random(_musclesMin, _musclesMax)>>
<<if $arcologies[0].FSPhysicalIdealist > 20>>
	<<set $activeSlave.height += 5>>
<</if>>
<<run eyeSurgery($activeSlave, "both", "normal")>>
<<set $activeSlave.hears = 0>>
<<if ($activeSlave.weight < -30)>>
	<<set $activeSlave.waist = random(-55,0)>>
<<elseif $activeSlave.physicalAge < 13>>
	<<set $activeSlave.waist = random(-25,25)>>
<<elseif ($activeSlave.weight <= 30)>>
	<<set $activeSlave.waist = random(-45,5)>>
<<elseif ($activeSlave.weight <= 160)>>
	<<set $activeSlave.waist = random(-20,10)>>
<</if>>
<<if $activeSlave.voice < 2>>
	<<set $activeSlave.voice++>>
<</if>>
<<if $activeSlave.accent > 1>>
	<<set $activeSlave.accent = 1>>
<</if>>
<<if $activeSlave.shoulders > 0>>
	<<set $activeSlave.shoulders -= 2>>
<</if>>
<<if $arcologies[0].FSAssetExpansionist > 20>>
	<<set $activeSlave.boobs = (random(50,500) * 100)>>
	<<set $activeSlave.butt = random(6,20)>>
	<<if $arcologies[0].FSTransformationFetishist > 20>>
		<<set $activeSlave.boobsImplant = $activeSlave.boobs-200>>
		<<if $activeSlave.boobsImplant > 10000>>
			<<set $activeSlave.boobsImplantType = "hyper fillable">>
		<<else>>
			<<set $activeSlave.boobsImplantType = "advanced fillable">>
		<</if>>
		<<set $activeSlave.buttImplant = $activeSlave.butt-1>>
		<<if $activeSlave.buttImplant > 9>>
			<<set $activeSlave.buttImplantType = "hyper fillable">>
		<<else>>
			<<set $activeSlave.buttImplantType = "advanced fillable">>
		<</if>>
	<</if>>
<<elseif $arcologies[0].FSSlimnessEnthusiast > 20>>
	<<set $activeSlave.boobs = (random(3,5) * 100)>>
	<<set $activeSlave.butt = random(0,2)>>
	<<if $arcologies[0].FSTransformationFetishist > 20>>
		<<set $activeSlave.boobsImplant = $activeSlave.boobs-50>>
		<<set $activeSlave.boobsImplantType = "normal">>
		<<if $activeSlave.butt > 1>>
			<<set $activeSlave.buttImplant = 1>>
			<<set $activeSlave.buttImplantType = "normal">>
		<</if>>
	<</if>>
<<else>>
	<<set $activeSlave.boobs = (random(5,10) * 100)>>
	<<set $activeSlave.butt = random(3,7)>>
	<<if $arcologies[0].FSTransformationFetishist > 20>>
		<<set $activeSlave.boobsImplant = $activeSlave.boobs-200>>
		<<set $activeSlave.boobsImplantType = "normal">>
		<<set $activeSlave.buttImplant = $activeSlave.butt-1>>
		<<set $activeSlave.buttImplantType = "normal">>
	<</if>>
<</if>>
<<if $arcologies[0].FSTransformationFetishist > 20>>
	<<set $activeSlave.boobShape = "normal">>
<<else>>
	<<set $activeSlave.boobShape = either("perky", "perky", "torpedo-shaped", "wide-set")>>
<</if>>
<<if $activeSlave.nipples == "tiny">>
	<<set $activeSlave.nipples = "puffy">>
<</if>>
<<set $activeSlave.face = 100>>
<<set $activeSlave.faceShape = either("cute", "cute", "exotic", "exotic", "normal", "normal", "sensual", "sensual", "sensual")>>
<<set $activeSlave.lips = random(45,75)>>
<<if $arcologies[0].FSTransformationFetishist > 20>>
	<<set $activeSlave.lips += 25>>
	<<set $activeSlave.lipsImplant = 25>>
<</if>>
<<if $activeSlave.teeth != "normal" && $activeSlave.physicalAge >= 12>>
	<<set $activeSlave.teeth = "normal">>
<</if>>
<<if $activeSlave.vaginaLube == 0>>
	<<set $activeSlave.vaginaLube++>>
<</if>>
<<set $activeSlave.preg = 0>>
<<set $activeSlave.counter.birthsTotal = either(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 4)>>
<<if $arcologies[0].FSPastoralist > 20 || $activeSlave.counter.birthsTotal > 0>>
	<<set $activeSlave.lactation = 1>>
	<<if $arcologies[0].FSPastoralist > 20>>
		<<set $activeSlave.lactationAdaptation = $arcologies[0].FSPastoralist>>
	<<else>>
		<<set $activeSlave.lactationAdaptation = Math.min($activeSlave.counter.birthsTotal*10, 100)>>
	<</if>>
<<else>>
	<<set $activeSlave.lactation = either(0, 0, 0, 0, 1)>>
<</if>>
<<if $activeSlave.lactation > 0>>
	<<set $activeSlave.lactationDuration = 2>>
<</if>>
<<if $activeSlave.counter.birthsTotal > 0>>
	<<set $activeSlave.vagina = random(2,3)>>
	<<set $activeSlave.pregWeek = either(-4, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)>>
<<else>>
	<<set $activeSlave.vagina = random(0,3)>>
	<<set $activeSlave.pregWeek = 0>>
<</if>>
<<if $activeSlave.hips <= 0>>
	<<set $activeSlave.hips = 1>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist > 20>>
	<<set $activeSlave.dick = random(2,5)>>
	<<set $activeSlave.balls = random(2,10)>>
	<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<set $activeSlave.prostate = random(1,3)>>
<</if>>
<<set $activeSlave.makeup = 2>>
<<set $activeSlave.nails = 1>>
<<if $activeSlave.vagina == 0>>
	<<set $activeSlave.skill.vaginal = 30>>
<<else>>
	<<set $activeSlave.skill.vaginal = 60>>
<</if>>
<<if $activeSlave.anus == 0>>
	<<set $activeSlave.skill.anal = 10>>
<<else>>
	<<set $activeSlave.skill.anal = 60>>
<</if>>
<<set $activeSlave.skill.oral = 60>>
<<set $activeSlave.chastityVagina = 1>>
<<set $activeSlave.intelligence = random(51,100)>>
<<if $arcologies[0].FSIntellectualDependency > 20>>
	<<set $activeSlave.energy = 100>>
	<<set $activeSlave.attrXY = 100>>
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>
	<<set $activeSlave.intelligence = Intelligence.random({limitIntelligence: [80, 100]})>>
	<<if $activeSlave.vagina >= 0>>
		<<set $activeSlave.skill.vaginal = 100>>
	<</if>>
	<<set $activeSlave.skill.anal = 100>>
	<<set $activeSlave.skill.oral = 100>>
	<<set $activeSlave.skill.entertainment = 100>>
	<<set $activeSlave.skill.whoring = 100>>
	<<set $activeSlave.intelligenceImplant = 30>>
<</if>>
<<set $activeSlave.attrKnown = 1>>
<<set $activeSlave.fetishKnown = 1>>
<<set $activeSlave.behavioralQuirk = "confident">>
<<set $activeSlave.sexualQuirk = either("caring", "caring", "gagfuck queen", "perverted", "romantic", "romantic", "strugglefuck queen", "tease", "unflinching")>>
<<set $activeSlave.pubertyXX = 1>>
<<set $activeSlave.breedingMark = 1>>

<<set _slaveCost = slaveCost($activeSlave, false, true)>>

It will take <<print cashFormat(_slaveCost)>> to win the auction.

<<if $cash >= _slaveCost>>
	[[Place that bid|New Slave Intro][cashX(forceNeg(_slaveCost), "slaveTransfer", $activeSlave),$nextButton = "Continue",$nextLink = "AS Dump",$returnTo = "Main"]]
<<else>>
	//You lack the necessary funds to place a winning bid.//
<</if>>

<<includeDOM App.Desc.longSlave(V.activeSlave, {market: "Elite Slave"})>>

<</if>>


code:
:: eliteTakeOver [nobr]

<<set $nextButton = " ">>

<<set _pregSurrender = 0>>
/* preg/lobotomization check */
You knew this day would come. Surrounding yourself with powerful people has its boons, but also poses a distinct threat. You've heard them murmuring when you enter the room, you've seen them excuse themselves from your presence, and lately they've been overtly hostile. The Societal Elite have turned on you.

You look up from your desk as the locked door to your office unseals, and a dozen individuals brazenly walk into your view.<<if _S.Bodyguard>><<setLocalPronouns _S.Bodyguard>> _S.Bodyguard.slaveName stands between you and them. A single glare from the leader of the bunch and $he backs off, eyes to the ground.<</if>>

<<if $PC.pregSource == -1 || $PC.pregSource == -6>>
	<<if $PC.refreshmentType == 0>>
		Taking a drag from a fresh $PC.refreshment,
	<<elseif $PC.refreshmentType == 1>>
		Taking a drink of a fresh glass of $PC.refreshment,
	<<elseif $PC.refreshmentType == 2>>
		Taking a bite of a fresh $PC.refreshment,
	<<elseif $PC.refreshmentType == 3>>
		Doing a line of $PC.refreshment,
	<<elseif $PC.refreshmentType == 4>>
		Injecting a hit of $PC.refreshment into your arm,
	<<elseif $PC.refreshmentType == 5>>
		Swallowing a $PC.refreshment,
	<<elseif $PC.refreshmentType == 6>>
		Placing a tab of $PC.refreshment under your tongue,
	<</if>>
	you greet your rather unwelcome guests.

	"You are no longer worthy of being a part of our society. But you carry within you one of our heirs. A conundrum for some, but we have already solved that problem."

	What was that last thing he said? It's getting hard to think right. The $PC.refreshment... Drugged... You collapse onto your desk, unconscious.

	<<if _S.Bodyguard>>
		A sharp pain and a rush of adrenaline drags you back to your senses. Sneaking a peak, you witness _S.Bodyguard.slaveName valiantly trying to protect you, despite <<if hasAnyProstheticLimbs(_S.Bodyguard)>>$his cybernetics being locked down<<else>>the overwhelming odds<</if>>. As $he and their leader struggle closer to your desk, his revolver and a syringe are dislodged onto your desk. It seems drugging you wasn't their first thought. With _S.Bodyguard.slaveName's risky gamble, your fate has fallen back into your hands.
	<<else>>
		You'll spend the rest of your life a breeder to the Societal Elite; blinded and muted. More than a slave, but still less than your master. Life isn't so bad, your two most devoted slaves were taken along to keep you happy, and you are treated quite well, possibilities considered. Though once your eggs dry up, odds are your little remaining usefulness will be at an end. Best not to think too much into it.
		<<set _pregSurrender = 1>>
		<<set $ui = "start">>

		''GAME OVER''
	<</if>>
<<else>>
	The leader reaches into his jacket and extracts a syringe, you recognize it as a powerful drug used in lobotomies, and places it to your left. From his hip he pulls a revolver, six-chambered, and loads five bullets, spins the chamber, and places it to your right.

	"You are no longer worthy of being a part of our society. You know you can't be allowed to spread any information. But we are not merciless; one of our members has taken an interest in having you as her pet. You may choose to lose your mind, and service her until she tires of you, or gamble for your life and serve her anyway. Now decide."
<</if>>

<<if _pregSurrender == 0>>
	<<set $finalChoice = "final stand">>
	The choice is simple — you will not be a slave.

	You decide to make a final stand.

	<<if _S.Bodyguard>>

		<<if $PC.pregSource == -1 || $PC.pregSource == -6>>
			_S.Bodyguard.slaveName is already doing everything in $his power to save you.
		<<else>>
			<<link "Attempt to signal _S.Bodyguard.slaveName, your bodyguard">>
				<<set $finalChoice = "bodyguard">>
				<<replace "#fate">>
					attempt to signal _S.Bodyguard.slaveName, your bodyguard.
				<</replace>>
			<</link>>
		<</if>>
	<</if>>
	<<if $mercenaries >= 1>>

		<<link "Send a message to the leader of the $mercenariesTitle">>
			<<set $finalChoice = "mercenaries">>
			<<replace "#fate">>
				send a message to the leader of the $mercenariesTitle.
			<</replace>>
		<</link>>
	<</if>>
	<<if $SF.Toggle && $SF.Active >= 1>>

 <<set _N = App.SF.SFC()>>
		<<link "Send a message to _N">>
			<<set $finalChoice = "SF">>
			<<replace "#fate">>
				send a message to <<print App.SF.SFC()>>.
			<</replace>>
		<</link>>
	<</if>>
	<<if $PC.pregSource != -1 && $PC.pregSource != -6>>

		<<link "Try and enrage them.">>
			<<set $finalChoice = "enrage">>
			<<replace "#fate">>
				try and enrage them, baiting them into a vulnerable position.
			<</replace>>
		<</link>>
	<</if>>

	<<link "Make a final stand">>
		<<set $finalChoice = "final stand">>
		<<replace "#fate">>
			make a final stand.
		<</replace>>
	<</link>>

	<<link "Give in">>
		<<set $finalChoice = "give in">>
		<<replace "#fate">>
			give in.
		<</replace>>
	<</link>>

	<<link "Confirm">>
		<<goto "eliteTakeOverFight">>
	<</link>>
<</if>>

repo_name: NovX/fc

license: mit


code:
:: eliteTakeOverFight [nobr]

<<set _shoot = 0>>
<<switch $finalChoice>>
<<case "bodyguard">>
	<<set _roll = random(0,100)>>
	<<if $career == "mercenary">>
		As a result of your prior experience as a mercenary you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 100 && _roll > 20>>
		As a result of your mastery of warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 60 && _roll > 30>>
		As a result of your expertness of warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 30 && _roll > 40>>
		As a result of having some skill in warfare you were able to successfully signal _S.Bodyguard.slaveName without the elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 10 && _roll > 50>>
		As a result of having a small amount of skill in warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare < 10 && _roll > 60>>
		By blind luck and what little you remember of your lessons in warfare are were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<else>>
		One of the Elites shouts "What the fuck are you trying to do?" Well, there goes that option.
		<<set _BgSignaled = 0>>
	<</if>>

You then pick up the revolver and quickly take aim.
<<case "mercenaries">>

You send a quick message to the leader of your $mercenariesTitle, about your situation, then you pick up the revolver and quickly take aim.
	<<set $MercenariesMessageSent = 1>>
<<case "SF">>

You send a quick message to <<print App.SF.SFC()>> about your situation, then you pick up the revolver and quickly take aim.
	<<set $SpecialForcesMessageSent = 1>>
<<case "enrage">>
	<<if $PC.career != "wealth" && $PC.career != "engineer" && $PC.career != "medicine">>
		You know exactly what to say in order to enrage them.
		<<set _EliteEnraged = 1>>
	<<elseif random(0,100) > 50>>
		You manage to select the right words to enrage them.
		<<set _EliteEnraged = 1>>
	<<else>>
		You try to enrage them, but your words have had no effect.
		<<set _EliteEnraged = 0>>
	<</if>>

You then pick up the revolver and quickly take aim.
<<case "final stand">>
	You pick up the revolver and quickly take aim.
<<case "give in">>
	You pick up the revolver and hold the barrel to your temple.
<</switch>>

<<if $finalChoice == "give in">>
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>>Screw their plans, you're out of here. <</if>>With a "Bang!" you drop dead.
	<<set $ui = "start">>

	''GAME OVER''
<<else>>
	/* PC shooting */
	/* higher skill means a higher chance to hit due to lower requirements and if the elites are enraged they very slightly become easier targets. */
	/* 5/6 = 83% rounded down is the chance that it was loaded chamber (simplified version based off the Wikipedia article) */

	/* variables: */
	/* Revolver */
	<<set _revolverChambers = 6>>
	<<set _revolverBullets = 5>>
	/*Elites */
	<<set $eliteTotal = 12>>
	<<set $eliteDead = 0>>
	<<set $eliteVegetable = 0>>

	/* To Hit chance */
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>> /* still woozy */
		<<set _toHit = 56>>
	<<elseif $PC.skill.career == "mercenary" || $PC.skill.warfare >= 100>>
		<<set _toHit = 83>>
	<<elseif $PC.skill.warfare >= 60>>
		<<set _toHit = 76>>
	<<elseif $PC.skill.warfare >= 30>>
		<<set _toHit = 67>>
	<<elseif $PC.skill.warfare >= 10>>
		<<set _toHit = 60>>
	<<else>>
		<<set _toHit = 56>>
	<</if>>
	<<if _EliteEnraged == 1>>
		<<set _toHit += 5>>
	<</if>>

	/* shooting */
	/* in the end I removed the messages from the cycle. I don't think having 6 lines of "you shot" is pretty looking. Feel free to re add them in however */
	<<for _i = _revolverChambers; _i > 0; _i-->>
		<<if random(0,100) <= _toHit && _revolverBullets > 0>>
			<<set $eliteDead += 1, _revolverBullets -= 1>>
		<<elseif _revolverBullets > 0>>
			<<set _revolverBullets -= 1>>
		<</if>>
	<</for>>

	<<if $eliteDead >= 1>>

You managed to kill several Elites in rapid succession, leaving the rest in shock and fear.
	<<elseif $eliteDead == 1>>

You managed to kill one Elite, leaving the rest in shock and fear.
	<<else>>

Unfortunately you fail to kill a single Elite.
	<</if>>

	/* syringe shot */
	<<set $eliteVegetable = 0>>
	<<set _druggedThrow = 0>>

	<<if $eliteDead > 0>>
		With $eliteDead Elites dead, you pick up the syringe from the desk and aim for the forehead of another.
	<<else>>
		Having failed to kill them with the revolver, in a desperate move you pick up the syringe from the desk and aim for the forehead of one of the elite.
	<</if>>
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>>But there's two of them... Shaking your head, you realize it's the drugs messing with you. You just need to focus.<</if>>
	<<set _hitRoll = (random(0,100) - _druggedThrow)>>
	<<if $career == "mercenary" && _hitRoll > 0>>
		With your prior history as a mercenary, making the throw is child's play.
		<<set _SyringeHeadShot = 1>>
	<<elseif $PC.skill.warfare >= 100>>
		<<if _hitRoll > 50>>
			As a result of your mastery of warfare you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 60>>
		<<if _hitRoll > 60>>
			As a result of your combat expertise you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 30>>
		<<if _hitRoll > 70>>
			As you have some skill, you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 10>>
		<<if _hitRoll > 80>>
			Your small amount of skill assisted you in making the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare < 10>>
		<<if _hitRoll > 90>>
			By blind luck you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<</if>>
	<<if _SyringeHeadShot == 1>>

		Picking up the spent revolver, you aim for the syringe's plunger.
		<<if $career == "mercenary">>
			With your prior history as a mercenary, making the throw is child's play.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 100 && random(0,100) > 50>>
			As a result of your mastery of warfare you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 60 && random(0,100) > 60>>
			As a result of your expertness of warfare you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 30 && random(0,100) > 70>>
			As you have some skill you successfully made the throw.
		<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 10 && random(0,100) > 80>>
			Your small amount of skill assisted you in making the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare < 10 && random(0,100) > 90>>
			By blind luck you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SpentRevolverHitSyringePlunger = 0>>
		<</if>>
	<</if>>
	<<if _SpentRevolverHitSyringePlunger == 1>>

		<<if random(0,100) > 50>>
			The target dies of nervous system overload brought about by the drug.
			<<set $eliteDead +=1>>
		<<else>>
			The target is still alive but is nothing more than a vegetable.
			<<set $eliteVegetable = 1>>
		<</if>>
	<</if>>
<</if>>

<<set $eliteLeft = $eliteTotal - $eliteDead - $eliteVegetable>>

/* if the player has managed to make enough damage to the Elite and the rep is high enough the citizens will come to save the PC */
/* this is to give reason to exist for the "enrage" and "last stand" option */
/* result							*/
/* $eliteFate:						*/
/*		killed = 0					*/
/*		enslaved = 1				*/
/*		had fun (and enslaved) = 2	*/
<<if _BgSignaled == 1>>
	<<setLocalPronouns _S.Bodyguard>>
	<<run Enunciate(_S.Bodyguard)>>
	_S.Bodyguard.slaveName asks, "<<Master>>, what <<sh>>ould I do with the <<if $eliteLeft < $eliteTotal>>remaining<</if>> 'Elite' left?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $MercenariesMessageSent == 1>>
	It is now that a squad of $mercenariesTitle makes their entrance, pointing their guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	The officer asks, "Your orders, <<= properTitle()>>?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $SpecialForcesMessageSent>>
	It is now that a squad of $SF.Lower makes their entrance, pointing their guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	The officer asks, "Your orders, <<= properTitle()>>?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $BodyguardID != 0>>
	<<setLocalPronouns _S.Bodyguard>>
	<<run Enunciate(_S.Bodyguard)>>
	It is now that _S.Bodyguard.slaveName makes $his entrance, pointing $his guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	$He then asks "<<Master>>, what <<sh>>ould I do with the <<if $eliteLeft < $eliteTotal>>remaining<</if>> 'Elite' left?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $eliteLeft <= 9 && $rep >= 10000>>
	Some of the citizens waiting outside your penthouse to see you hear the ruckus and rush inside, worried. Time seems to freeze for a few seconds, while the remaining Elite recover from their terror and the citizens digest the gory scene in front of them.
	The newcomers are quick to take your side. In little time the Elites, outgunned and outnumbered, are neutralized.

One of the more courageous citizens approaches you and asks "<<= properTitle()>>, what should we do with them?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $finalChoice != "give in">>
	With nothing else left, you remain powerless to stop the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite, who quickly capture and enslave you. Your personal story may continue, but the part of it worthy of retelling has now ended.
	<<set $ui = "start">>

	''GAME OVER''
<</if>>


code:
:: eliteTakeOverResult [nobr]

<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */

<<if _S.Bodyguard>>
	<<setLocalPronouns _S.Bodyguard>>
<</if>>
<<setNonlocalPronouns $seeDicks>>

<<switch $eliteFate>>
<<case 0>>
	<<if $MercenariesMessageSent == 1>>
		The mercenaries open fire as ordered. Shortly after, the conspiring Elite are dead.
	<<elseif $SpecialForcesMessageSent == 1>>
		The soldiers open fire as ordered. Shortly after, the conspiring Elite are dead.
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>
		Your citizens freeze for a second, then obey your orders. Shortly after, the conspiring Elite are dead.
	<<else>>
		Your bodyguard opens fire as ordered. Shortly after, the conspiring Elite are dead.
	<</if>>
<<case 1>>
	<<if random(0,100) > 50>>
		An Elite bites down on a cyanide pill hidden in a false tooth and
		<<if random(0,100) > 75>>
			takes the coward's way out (how predictable), frothing at the mouth.
			<<set $eliteDead += 1>>
		<<else>>
			experiences great pain but unfortunately (for them at least) survives.
		<</if>>
	<</if>>
	<<if $MercenariesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your mercenaries.
	<<elseif $SpecialForcesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your soldiers.
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your loyal citizens.
	<<else>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your bodyguard.
	<</if>>
<<case 2>>
	<<if random(0,100) > 50>>
			An Elite bites down on a cyanide pill hidden in a false tooth and
		<<if random(0,100) > 75>>
			takes the coward's way out (how predictable), frothing at the mouth.
			<<set $eliteDead += 1>>
		<<else>>
			experiences great pain but unfortunately (for them at least) survives.
		<</if>>
	<</if>>
	<<if $MercenariesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured, abused and enslaved.
		The officer is thankful for giving the troops a chance to let off some stream. Two soldiers decide to double team an Elite; one ass fucks while the other facefucks.
		Another soldier takes a particular interest in an Elite and politely asks you
		"<<= properTitle()>>, can I keep _himU?"

			<<link "No">>
				<<replace "#choice1">>
					Your rejection upsets some of them, but their professionalism ensures it isn't visible.
				<</replace>>
			<</link>>
			|
			<<link "Yes">>
				<<set $eliteLeft -= 1>>
				<<run repX(2500, "event")>>
				<<replace "#choice1">>
					For a second your acceptance shocks them. Once they recover they are very grateful. "Thank you <<= properTitle()>>, I'll make sure to look after _himU." Soon the story spreads of the kind arcology owner, enhancing your reputation.
				<</replace>>
			<</link>>

	<<elseif $SpecialForcesMessageSent>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured, abused and enslaved.
		<<if $SF.Depravity <= 0.3>>
			Two soldiers decide to double team an Elite; one gropes _hisU ass while the other gropes _hisU tits.
		<<elseif $SF.Depravity <= 1.2>>
			Two soldiers decide to double team an Elite; one assfucks while the other facefucks.
		<<else>>
			Two soldiers decide to double team an Elite; one breaks out their knife and begins to make little breaks in the Elite's skin while the other soldier facefucks them.
		<</if>>
		Another soldier takes a particular interest in an Elite and politely asks you "<<= properTitle()>>, can I keep _himU?"

			<<link "No">>
				<<set _SFHappyEverAfter = 0>>
				<<replace "#choice1">>
					Your rejection upsets some of them, but their professionalism ensures it isn't visible.
				<</replace>>
			<</link>>
			|
			<<link "Yes">>
				<<set $eliteLeft -= 1, _SFHappyEverAfter = 1>>
				<<run repX(2500, "event")>>
				<<replace "#choice1">>
					For a second your acceptance shocks them. Once they recover they are very grateful. "Thank you <<= properTitle()>>, I'll make sure to look after _himU." Soon the story spreads of the kind arcology owner, enhancing your reputation.
				<</replace>>
			<</link>>

		<<if $SF.MercCon.CanAttend === -2>>
			<<switch $SF.Colonel.Core>>
			<<case "kind">>
				The Colonel is shocked that you would allow her troops to do this but understands that it comes with the territory.<<if _SFHappyEverAfter == 1>> "Thanks for being kind to one of my soldiers."<</if>>
			<<case "brazen" "cruel" "jaded">>
				The Colonel is grateful that you let her troops let off some steam.<<if _SFHappyEverAfter == 1>> "Thanks for being kind to one of my soldiers."<</if>>
			<</switch>>
		<</if>>
		<<set $SF.Depravity += 0.05>>
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>
		<<if $arcologies[0].FSDegradationist != "unset">>
			An evil smile appears on the faces of your loyal citizens, while the surviving Elite freeze in terror. The impromptu festivity will go on for hours, getting more and more depraved.
		<<else>>
			While some citizens respectfully step out, some join you in the fun. The impromptu festivities will go on for hours, getting more and more depraved.
		<</if>>
	<<else>>
		<<if _S.Bodyguard.fetish == "sadist">>_S.Bodyguard.slaveName gets out $his melee weapon and starts to give them many small cuts, the look of pleasure on $his face is evident.<<else>>_S.Bodyguard.slaveName ties them and then gets out $his melee weapon and starts to abuse them; $his face is blank.<</if>>

Shortly after, the terrified <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly brought away to be officially enslaved.
	<</if>>
<</switch>>

<<if $eliteFate >= 1>>
	<<if $eliteVegetable == 1>>
		<<set $eliteLeft-->>
		<<set $activeSlaveOneTimeMinAge = 25>>
		<<set $activeSlaveOneTimeMaxAge = ($retirementAge-2)>>
		<<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>>
		<<if $seeDicks == 0>>
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<elseif $seeDicks == 100>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<<elseif random(1,100) > 50>> /* 50% chance of getting girl or boy */
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<else>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<</if>>
		<<set _origin = "$He was a member of the Societal Elite, captured in their failed attempt at expressing their displeasure.">>
		<<set $activeSlave.origin = _origin>>
		<<set $activeSlave.career = "a well connected individual">>
		<<set $activeSlave.prestige = either(2,2,3)>> /* 33% chance of getting level 3 prestige */
		<<set $activeSlave.prestigeDesc = "$He was once considered influential in society, but now $he's the one getting fucked.">>
		<<set $activeSlave.face = random(70,100)>>
		<<set $activeSlave.devotion = random(-10,-20)>>
		<<set $activeSlave.trust = random(-20,-30)>>
		<<if $activeSlave.boobShape == "saggy" || $activeSlave.boobShape == "downward-facing">>
			<<set $activeSlave.boobShape = either("perky", "torpedo-shaped", "wide-set")>>
		<</if>>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.weight = random(10,75)>>
		<<set $activeSlave.intelligence = random(70,100)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<run setHealth($activeSlave, jsRandom(60, 75), 0, 0, 0, jsRandom(0, 20))>>
		<<set $activeSlave.canRecruit = 0>>
		<<run newSlave($activeSlave)>> /* skip New Slave Intro */
	<</if>>
	<<for _i = $eliteLeft; _i > 0; _i-->>
		<<set $activeSlaveOneTimeMinAge = 25>>
		<<set $activeSlaveOneTimeMaxAge = ($retirementAge-2)>>
		<<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>>
		<<if $seeDicks == 0>>
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<elseif $seeDicks == 100>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<<elseif random(1,100) > 50>> /* 50% chance of getting girl or boy */
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<else>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<</if>>
		<<set _origin = "$He was a member of the Societal Elite, captured in their failed attempt at expressing their displeasure.">>
		<<set $activeSlave.origin = _origin>>
		<<set $activeSlave.career = "a well connected individual">>
		<<set $activeSlave.prestige = either(2,2,3)>>
		<<set $activeSlave.prestigeDesc = "$He was once considered influential in society, but now $he's the one getting fucked.">>
		<<set $activeSlave.face = random(70,100)>>
		<<set $activeSlave.devotion = random(-10,-20)>>
		<<set $activeSlave.trust = random(-20,-30)>>
		<<if $eliteFate == 2 && random(1,100) >= 75>> /* 25% chance of getting mindbroken elites if they were abused */
			<<set $activeSlave.fetish = "mindbroken">>
		<</if>>
		<<if $activeSlave.boobShape == "saggy" || $activeSlave.boobShape == "downward-facing">>
			<<set $activeSlave.boobShape = either("perky", "torpedo-shaped", "wide-set")>>
		<</if>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.weight = random(-30,75)>>
		<<set $activeSlave.intelligence = random(0,60)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<run setHealth($activeSlave, jsRandom(60, 75), 0, 0, 0, jsRandom(0, 20))>>
		<<set $activeSlave.canRecruit = 0>>
		<<set $activeSlave.behavioralFlaw = either("arrogant", "bitchy")>>
		<<run newSlave($activeSlave)>> /* skip New Slave Intro */
	<</for>>
<</if>>

/* clean up */
<<set $failedElite = 0, $eugenicsFullControl = 1>>


code:
:: fat grafting workaround [nobr]

<<set $nextButton = "Finalize fat transfer", $nextLink = "Surgery Degradation">>

Enough graftable body fat was harvested for an additional <<print $availableFat*100>>ccs per breast or an additional <<if getSlave($AS).butt <= 10>><<print $availableFat/2>><<else>><<print $availableFat/5>><</if>> sizes to $his rear. <<if $availableFat == 0>>All fat marked for use<<else>>A total of $availableFat unit<<if $availableFat > 1>>s<</if>> remain<</if>>.

$boobFat units of fat will be added to $his breasts for a size gain of <<print $boobFat*100>>ccs.

<<if $availableFat > 0>>
	[[Increase|fat grafting workaround][$boobFat++, $availableFat--]] |
<<else>>
	No more fat available. |
<</if>>
<<if $boobFat > 0>>
	[[Decrease|fat grafting workaround][$boobFat--, $availableFat++]]
<<else>>
	No fat marked for breast use.
<</if>>

<<if getSlave($AS).butt <= 10>><<print $buttFat*2>><<else>><<print $buttFat*5>><</if>> units of fat will be added to $his ass for a size gain of $buttFat.
<<if getSlave($AS).butt > 10>>

	<<if $availableFat > 0>>
		[[Increase|fat grafting workaround][$buttFat += .2, $availableFat -= 1]] |
	<<else>>
		No more fat available. |
	<</if>>
	<<if $buttFat > 0>>
		[[Decrease|fat grafting workaround][$buttFat -= .2, $availableFat += 1]]
	<<else>>
		No fat marked for ass use.
	<</if>>
<<else>>

	<<if $availableFat > 0>>
		[[Increase|fat grafting workaround][$buttFat += .5, $availableFat -= 1]] |
	<<else>>
		No more fat available. |
	<</if>>
	<<if $buttFat > 0>>
		[[Decrease|fat grafting workaround][$buttFat -= .5, $availableFat += 1]]
	<<else>>
		No fat marked for ass use.
	<</if>>
<</if>>


code:
:: Gene Lab [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Manage Penthouse", $encyclopedia = "The Pharmaceutical Fab.", _PCSkillCheck = Math.min($upgradeMultiplierMedicine, $HackingSkillMultiplier)>>

The Gene Lab

<<if $geneticMappingUpgrade == 1>>
	//The gene lab is fully operational. It is capable of mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to modify a slave's genome should you obtain the data necessary to adjust it.//

	[[Upgrade the genome mapper|Gene Lab][cashX(forceNeg(Math.trunc(500000*$upgradeMultiplierArcology)), "capEx"), $geneticMappingUpgrade = 2]]
	//Costs <<print cashFormat(Math.trunc(500000*$upgradeMultiplierArcology))>>//
<<elseif $geneticMappingUpgrade == 2>>
	//The gene lab is fully operational. It is capable of fully mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to correct (or flaw) a slave's genome, as well as modify it should you obtain the data necessary to adjust it.//
<</if>>

Genetic Modification

<<if $dispensaryUpgrade == 0>>
	//The fabricator must be upgraded before it can produce treatments to alter genes//

<<else>>
	The fabricator is capable of producing treatments to alter a slave's genetic code.

	<<if $arcologies[0].childhoodFertilityInducedNCSResearch == 1>>
		The fabricator is capable of producing treatments to induce NCS.

	<</if>>
	<<if $RapidCellGrowthFormula == 1>>
		The fabricator is capable of producing treatments to accelerate cellular reproduction.

	<</if>>
	<<if $geneticMappingUpgrade >= 2>>
		<<if $geneticFlawLibrary != 1>>
			[[Purchase designs for inducing genetic anomalies|Gene Lab][cashX(forceNeg(100000*_PCSkillCheck), "capEx"), $geneticFlawLibrary = 1]]
			//Costs <<print cashFormat(100000*_PCSkillCheck)>>//

    //Will allow genetic flaws and quirks to be injected into a slave's genome//

		<<else>>
			The fabricator is capable of producing treatments to induce various genetic anomalies.

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

Genetic Harvesting

<<if ($cloningSystem != 1) && ($rep <= 18000*_PCSkillCheck)>>
	//You lack the reputation needed to access methods for human cloning//

<<elseif ($cloningSystem != 1) && ($rep > 18000*_PCSkillCheck)>>
	<<if $organFarmUpgrade == 0>>
		//An organ farm is needed to grow the blank embryo to serve as a clone base//

	<<else>>
		[[Purchase methods for human cloning|Gene Lab][cashX(forceNeg(100000*_PCSkillCheck), "capEx"), $cloningSystem = 1]]
		//Costs <<print cashFormat(100000*_PCSkillCheck)>>//

    //Will allow children to be created with identical base genetics as the source DNA//

	<</if>>
<<elseif ($cloningSystem > 0)>>
	The gene lab is capable of implanting a slave's genetic sequence into a blank embryo to produce a basic clone. [[Make a clone|Cloning Workaround][$donatrix = "Undecided", $receptrix = "Undecided"]]

<</if>>


code:
:: Husk Slave [nobr]

<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $encyclopedia = "Kidnapped Slaves">>
<<if ($huskSlave.dick == 0) && ($huskSlave.vagina == -1)>><<set $huskSlave.vagina = 0>><</if>>

<<if $huskSlaveOrdered == 0>>You lay out a new order for a braindead slave to be put aside for your use.<<else>>You review your posted husk order.<</if>> Your order requests a body with the following characteristics:

<<set $huskSlave.age = Math.clamp($huskSlave.age, $minimumSlaveAge, $retirementAge-1)>>

Age:

<<textbox "$huskSlave.age" $huskSlave.age "Husk Slave">>

Sex:
<<if $huskSlave.sex == 1>>Female.
<<elseif $huskSlave.sex == 2>>Male.
<<elseif $huskSlave.sex == 3>>Futanari.
<</if>>

[[Female|Husk Slave][$huskSlave.sex = 1]]
| [[Male|Husk Slave][$huskSlave.sex = 2]]
| [[Both|Husk Slave][$huskSlave.sex = 3]]

Nationality:

<<textbox "$huskSlave.nationality" $huskSlave.nationality "Husk Slave">>

<<textbox "$huskSlave.race" $huskSlave.race "Husk Slave">>

[[White|Husk Slave][$huskSlave.race = "white"]]
| [[Asian|Husk Slave][$huskSlave.race = "asian"]]
| [[Latina|Husk Slave][$huskSlave.race = "latina"]]
| [[Middle Eastern|Husk Slave][$huskSlave.race = "middle eastern"]]
| [[Black|Husk Slave][$huskSlave.race = "black"]]
| [[Semitic|Husk Slave][$huskSlave.race = "semitic"]]
| [[Southern European|Husk Slave][$huskSlave.race = "southern european"]]
| [[Indo-Aryan|Husk Slave][$huskSlave.race = "indo-aryan"]]
| [[Amerindian|Husk Slave][$huskSlave.race = "amerindian"]]
| [[Pacific Islander|Husk Slave][$huskSlave.race = "pacific islander"]]
| [[Malay|Husk Slave][$huskSlave.race = "malay"]]
| [[Mixed Race|Husk Slave][$huskSlave.race = "mixed race"]]
| [[Not Important|Husk Slave][$huskSlave.race = "not important"]]

Virginity:
<<if $huskSlave.virgin == 0>>Virgin.
<<else>>Not important.
<</if>>

[[Important|Husk Slave][$huskSlave.virgin = 0]]
| [[Not Important|Husk Slave][$huskSlave.virgin = 1]]

Reserving a body will cost <<print cashFormat(10000)>> up front. Canceling an order will refund your money; however, if a delivered body is rejected, your money will not be refunded.
<<if $huskSlaveOrdered == 1>>
	[[Withdraw body order|Main][$huskSlaveOrdered = 0, cashX(10000, "slaveTransfer")]]
<<elseif $cash < 10000>>
	//You lack the credits to place a body reservation.//
<<else>>
	[[Post body order|Main][$huskSlaveOrdered = 1, cashX(-10000, "slaveTransfer")]]
<</if>>


code:
:: Husk Slave Swap [nobr]

<<set $nextButton = "Continue">>
<<set _oldSlave = clone($swappingSlave)>>
<<set _m = $slaveIndices[$swappingSlave.ID]>>

You strap $slaves[_m].slaveName, and the body to which $he will be transferred, into the remote surgery and stand back as it goes to work.
<<BodySwap $slaves[_m] $activeSlave>>
<<set _gps = $genePool.findIndex(function(s) { return s.ID == $slaves[_m].ID; })>>
<<set $genePool[_gps].race = $slaves[_m].race, $genePool[_gps].origRace = $slaves[_m].origRace, $genePool[_gps].skin = $slaves[_m].skin, $genePool[_gps].markings = $slaves[_m].markings, $genePool[_gps].eye.origColor = $slaves[_m].eye.origColor, $genePool[_gps].origHColor = $slaves[_m].origHColor, $genePool[_gps].origSkin = $slaves[_m].origSkin, $genePool[_gps].face = $slaves[_m].face, $genePool[_gps].pubicHStyle = $slaves[_m].pubicHStyle, $genePool[_gps].underArmHStyle = $slaves[_m].underArmHStyle, $genePool[_gps].eyebrowHStyle = $slaves[_m].eyebrowHStyle>> /* special exception to swap genePool since the temporary body lacks an entry. Otherwise we could just call the widget using the genePool entries */

After an honestly impressive procedure, $slaves[_m].slaveName is recovering nicely.

<<BodySwapReaction $slaves[_m] _oldSlave>>

<<set _slaveCost = slaveCost(_oldSlave)>>
<<set _payout = Math.trunc(_slaveCost/3)>>
$slaves[_m].slaveName's old body was bought by the Flesh Heap for <<print cashFormat(_payout)>>.
<<if $slaves[_m].bodySwap > 0>>
	<<set _myBody = $slaves.findIndex(function(s) { return s.origBodyOwnerID == $slaves[_m].ID; })>>
	<<if _myBody != -1>>
		<<set $slaves[_myBody].origBodyOwnerID = 0>>
		<<setLocalPronouns $slaves[_myBody] 2>>
		<<if $slaves[_myBody].fetish != "mindbroken" && $slaves[_myBody].fuckdoll == 0>>
			<<if $slaves[_myBody].devotion > 20>>
				$slaves[_myBody].slaveName is somewhat saddened to see _his2 body leave forever.
			<<elseif $slaves[_myBody].devotion >= -50>>
				$slaves[_myBody].slaveName is @@.mediumorchid;disturbed@@ to find _his2 body is gone for good, damaging _his2 @@.gold;ability to trust you.@@
				<<set $slaves[_myBody].devotion -= 30, $slaves[_myBody].trust -= 30>>
			<<else>>
				$slaves[_myBody].slaveName is @@.mediumorchid;deeply upset@@ that _he2'll never see _his2 body again. With so little left, _he2 finds it easy to take vengeance by @@.orangered;completely rejecting your ownership of _him2.@@
				<<set $slaves[_myBody].devotion -= 50, $slaves[_myBody].trust = 100>>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<<set $slaves[_m].bodySwap++>>
<<run cashX(_payout, "slaveTransfer")>>
<<set $activeSlave = 0, $swappingSlave = 0>>


code:
:: husk Slave Swap Workaround [nobr]

<<if $activeSlave.tankBaby != 3>>
	<<set $nextButton = "Abort Operation", $nextLink = "Scheduled Event", $returnTo = "Scheduled Event">>
<<else>>
	<<set $nextButton = "Abort Operation", $nextLink = "Main", $returnTo = "Incubator">>
<</if>>

"This operation is neither simple nor is it perfected. There are extreme health risks involved and no guarantee of success. Strap a slave into your remote surgery to consent to the operation. Indentured servants<<if ($incubator > 0) || ($nurseryChildren)>> and slaves with reserved children<</if>> are not eligible."

//Select the slave whose mind will be transferred into the waiting husk. Amputated slaves must not be wearing prosthetics. This operation will cost <<print cashFormat(10000)>>.//

__Select an eligible slave:__
<<for _i = 0; _i < $slaves.length; _i++>>
	<<capture _i>>
		<<if isSlaveAvailable($slaves[_i])>>
			<<if $slaves[_i].fuckdoll == 0>>
				<<if !hasAnyProstheticLimbs($slaves[_i])>>
					<<if $slaves[_i].indenture == -1>>
						<<if $slaves[_i].breedingMark == 0 || $propOutcome == 0 || $eugenicsFullControl == 1 || $arcologies[0].FSRestart == "unset">>
							<<if WombReserveCount($slaves[_i]) == 0>>
								<<if $slaves[_i].ID != $AS>>
									<<set _name = SlaveFullName($slaves[_i])>>

[[_name|Husk Slave Swap][$swappingSlave = $slaves[_i], cashX(-10000, "slaveSurgery", $slaves[_i])]]
								<</if>>
							<</if>>
						<</if>>
					<</if>>
				<</if>>
			<</if>>
		<</if>>
	<</capture>>
<</for>>


code:
:: Implant Manufactory [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Manage Penthouse", $encyclopedia = "The Pharmaceutical Fab.", _PCSkillCheck = Math.min($upgradeMultiplierMedicine, $HackingSkillMultiplier)>>

The Implant Manufactory

	The implant manufactory is running smoothly. It can cheaply produce advanced implants and has freed you from relying on outside sources for specialty implants. It can easily produce more complex implants should you obtain the schematics necessary to build them.

Implant Production

The manufactory is capable of producing customized fillable implants.

<<if ($meshImplants != 1) && ($rep <= 10000*_PCSkillCheck)>>

		You lack the reputation to access plans for supportive breast implants.

<<elseif ($meshImplants != 1) && ($rep > 10000*_PCSkillCheck)>>

		[[Purchase plans for supportive mesh breast implants|Implant Manufactory][cashX(forceNeg(40000*_PCSkillCheck), "capEx"), $meshImplants = 1]]

			Costs <<print cashFormat(40000*_PCSkillCheck)>>

				Will allow the construction of organic and supportive mesh breast implants.

<<elseif ($meshImplants > 0)>>

The manufactory is capable of producing supportive mesh breast implants.

<</if>>

<<if $UterineRestraintMesh == 1>>

The manufactory is capable of producing supportive mesh uterine implants.

<</if>>

<<if ($bellyImplants == 0) && ($rep <= 2000*_PCSkillCheck)>>

You lack the reputation to access experimental fillable abdominal implants.

<<elseif ($bellyImplants == 0) && ($rep > 2000*_PCSkillCheck)>>

		[[Purchase schematics for fillable abdominal implants|Implant Manufactory][cashX(forceNeg(30000*_PCSkillCheck), "capEx"), $bellyImplants = 1]]

			Costs <<print cashFormat(30000*_PCSkillCheck)>>

				Will allow the construction of fillable abdominal implants for the autosurgery.

<<elseif ($bellyImplants > 0)>>

The manufactory is capable of crafting fillable abdominal implants.

	<<if ($bellyImplants == 1) && ($cervixImplants == 0) && ($rep <= 6000*_PCSkillCheck)>> /* show only after belly implants already researched */

You lack the reputation to access experimental cervix filter micropumps schematics for abdominal implants.

	<<elseif ($bellyImplants == 1) && ($cervixImplants == 0) && ($rep > 6000 * _PCSkillCheck)>> /* nanotech like technology much more impressive and costly than simple implant */

			[[Purchase schematics for cervix filter micropumps|Implant Manufactory][cashX(forceNeg(70000*_PCSkillCheck), "capEx"), $cervixImplants = 1]]

				Costs <<print cashFormat(70000*_PCSkillCheck)>>

					Will allow the construction of cervix filter micropumps for fillable abdominal implants using the autosurgery.

	<<elseif ($cervixImplants == 1) && ($rep <= 8000*_PCSkillCheck)>>

The manufactory is capable of crafting cervix filter micropumps for fillable abdominal implants.

			You lack the reputation to obtain conversion kits for rectal filter micropumps.

	<<elseif ($cervixImplants == 1) && ($rep > 8000*_PCSkillCheck)>>

The manufactory is capable of crafting cervix filter micropumps for fillable abdominal implants.

			[[Purchase conversion kits for rectal filter micropumps|Implant Manufactory][cashX(forceNeg(60000*_PCSkillCheck), "capEx"), $cervixImplants = 2]]

				Costs <<print cashFormat(60000*_PCSkillCheck)>>

					Will allow the construction of the anal equivalent of the cervix micropumps using the autosurgery.

	<<elseif ($cervixImplants > 1)>>

The manufactory is capable of crafting cervix and rectal filter micropumps for fillable abdominal implants.

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

<<if $seePreg != 0>>

Fertility Implants

	<<if $fertilityImplant == 1>>

The manufactory is capable of crafting fertility enhancing implants for ovaries.

	<<elseif $fertilityImplant == 0 && ($rep <= 3000*_PCSkillCheck)>>

			You lack the reputation to access fertility boosting ovarian implants.

	<<else>>

			[[Purchase schematics for fertility enhancing ovarian implants|Implant Manufactory][cashX(forceNeg(10000*_PCSkillCheck), "capEx"), $fertilityImplant = 1]]

				Costs <<print cashFormat(10000*_PCSkillCheck)>>

					Will allow the construction of implants that encourage multiple eggs being released during ovulation.

	<</if>>

	<<if $sympatheticOvaries == 1>>

The manufactory is capable of crafting implants that synchronize ovum release.

	<</if>>

	<<if $seeHyperPreg == 1 && $seeExtreme == 1>>
		<<if ($permaPregImplant == 0) && ($rep <= 4000*_PCSkillCheck)>>

You lack the reputation to access experimental pregnancy generator schematics.

		<<elseif ($permaPregImplant == 0) && ($rep > 4000*_PCSkillCheck)>>

				[[Purchase schematics for an experimental implantable pregnancy generator|Implant Manufactory][cashX(forceNeg(40000*_PCSkillCheck), "capEx"), $permaPregImplant = 1]]

					Costs <<print cashFormat(40000*_PCSkillCheck)>>

						Will allow the construction of implants that force perpetual pregnancy.

		<<elseif ($permaPregImplant > 0)>>

The manufactory is capable of crafting pregnancy generators.

		<</if>>
		<<if $PGHack == 1>>

			The tools required to hack the firmware of basic pregnancy generator implants have been produced by the manufactory for use in the remote surgery.

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

<</if>>

Fluid Production Implants

<<if ($prostateImplants != 1) && ($rep <= 3000*_PCSkillCheck)>>

You lack the reputation to access plans for prostate implants.

<<elseif ($prostateImplants != 1) && ($rep > 3000*_PCSkillCheck)>>

		[[Purchase plans for ejaculation enhancing prostate implants|Implant Manufactory][cashX(forceNeg(30000*_PCSkillCheck), "capEx"), $prostateImplants = 1]]

			Costs <<print cashFormat(30000*_PCSkillCheck)>>

				Will allow the construction of a prostate implant designed to stimulate fluid production for massive ejaculations. Beware of leaking and dehydration.

<<elseif ($prostateImplants > 0)>>

The manufactory is capable of producing ejaculation enhancing prostate implants.

<</if>>


code:
:: Incubator [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Incubator", $encyclopedia = "The Incubation Facility">>
<<set $targetAge = Number($targetAge) || $minimumSlaveAge>>
<<set $targetAge = Math.clamp($targetAge, $minimumSlaveAge, 42)>>

<<if $incubatorName != "the Incubator">>
	<<set $incubatorNameCaps = $incubatorName.replace("the ", "The ")>>
<</if>>
<<if $incubatorImprintSetting == 0>><<set $incubatorImprintSetting = "trust">><</if>>

<<set $readySlaves = 0, $readySlave = 0, $incubatorSlaves = $tanks.length, _freeTanks = $incubator - $incubatorSlaves, _SL = $slaves.length, _eligibility = 0, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>

$incubatorNameCaps is a clean, cold hall designed to be lined with tanks and their connected monitoring systems.

<<if $incubatorSlaves > 2>>
	It's well used. The hum of active tanks fill the air.
<<elseif $incubatorSlaves > 0>>
	It's barely used; most of the tanks lie dormant.
<<else>>
	It's empty and quiet.

		[[Decommission the incubator|Main][$incubator = 0, $incubatorUpgradeSpeed = 5, $incubatorUpgradeWeight = 0, $incubatorUpgradeMuscles = 0, $incubatorUpgradeReproduction = 0, $incubatorUpgradeGrowthStims = 0, $incubatorWeightSetting = 0, $incubatorMusclesSetting = 0, $incubatorReproductionSetting = 0, $incubatorGrowthStimsSetting = 0, $tanks = []]]

<</if>>

It can support $incubator child<<if $incubator != 1>>ren<</if>>. There <<if $incubatorSlaves == 1>>is<<else>>are<</if>> currently $incubatorSlaves tank<<if $incubatorSlaves != 1>>s<</if>> in use in $incubatorName.
[[Add another incubation tank|Incubator][cashX(forceNeg(Math.trunc(60000*$upgradeMultiplierArcology)), "capEx"), $incubator += 1]] //Costs <<print cashFormat(Math.trunc(60000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<if _freeTanks == 0>>
	All of the tanks are currently occupied by growing children.
<<elseif $incubator > 1 && $reservedChildren < _freeTanks>>
	[[Remove an incubation tank|Incubator][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $incubator -= 1]] //Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> and will reduce upkeep costs//
<</if>>

Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of $incubator tanks, <<print _freeTanks>> <<if _freeTanks == 1>>is<<else>>are<</if>> unoccupied. Of those, $reservedChildren <<if $reservedChildren == 1>>tank is<<else>>tanks are<</if>> reserved.
/*
** With hundreds of slaves, navigating the Incubator room was giving me as much of a headache as other lists.
** So, I borrowed the sorting list and dropped a few options here.
*/
<<if (0 < _SL)>>
	<<set $sortIncubatorList = $sortIncubatorList || 'Unsorted'>>

//Sorting:// ''$sortIncubatorList.''
	<<link "Sort by Name">>
		<<set $sortIncubatorList = 'Name'>>
		<<replace "#qlIncubatorSort">>$sortIncubatorList<</replace>>
		<>
	<</link>> |
	<<link "Sort by Reserved Incubator Spots">>
		<<set $sortIncubatorList = 'Reserved Incubator Spots'>>
		<<replace "#qlIncubatorSort">>$sortIncubatorList<</replace>>
		<>
	<</link>> |
	<<link "Sort by Pregnancy Week">>
		<<set $sortIncubatorList = 'Pregnancy Week'>>
		<<replace "#qlIncubatorSort">>$sortIncubatorList<</replace>>
		<>
	<</link>> |
	<<link "Sort by Number of Children">>
		<<set $sortIncubatorList = 'Number of Children'>>
		<<replace "#qlIncubatorSort">>$sortIncubatorList<</replace>>
		<>
	<</link>>

<</if>>

<<for _u = 0; _u < _SL; _u++>>
	<<setLocalPronouns $slaves[_u]>>
	<<if $slaves[_u].preg > 0 && $slaves[_u].broodmother == 0 && $slaves[_u].pregKnown == 1 && $slaves[_u].eggType == "human">>
		<<if ($slaves[_u].assignment == "work in the dairy" && $dairyPregSetting > 0) || $activeSlave.assignment == "be your agent" || $activeSlave.assignment == "live with your agent">>
		<<else>>
			<<set _slaveId = "slave-" + $slaves[_u].ID>>
			<<set _WL = $slaves[_u].womb.length>>
			<<set _reservedIncubator = WombReserveCount($slaves[_u], "incubator")>>
			<<set _reservedNursery = WombReserveCount($slaves[_u], "nursery")>>
			<<set _pregWeek = $slaves[_u].pregWeek>>
			<<set _slaveName = SlaveFullName($slaves[_u])>>

			<<= App.UI.slaveDescriptionDialog($slaves[_u])>> is $slaves[_u].pregWeek week<<if $slaves[_u].pregWeek > 1>>s<</if>> pregnant with
			<<if $slaves[_u].pregSource == 0 || $slaves[_u].preg <= 5>>someone's<<if $slaves[_u].preg <= 5>>, though it is too early to tell whose,<</if>>
			<<elseif $slaves[_u].pregSource == -1>>your
			<<elseif $slaves[_u].pregSource == -2>>a citizen's
			<<elseif $slaves[_u].pregSource == -3>>your Master's
			<<elseif $slaves[_u].pregSource == -4>>another arcology owner's
			<<elseif $slaves[_u].pregSource == -5>>your client's
			<<elseif $slaves[_u].pregSource == -6>>the Societal Elite's
			<<elseif $slaves[_u].pregSource == -7>>the lab's
			<<elseif $slaves[_u].pregSource == -9>>the Futanari Sisters'
			<<else>>
				<<set _t = $slaveIndices[$slaves[_u].pregSource]>>
				<<if def _t>>
					<<print $slaves[_t].slaveName>>'s
				<</if>>
			<</if>>
			<<if _WL > 1>>_WL babies<<else>>baby<</if>>.
			<<if _reservedIncubator > 0>>
				<<set _childrenReserved = 1>>
				<<if _WL == 1>>
					$His child will be placed in $incubatorName.
				<<elseif _reservedIncubator < _WL>>
					_reservedIncubator of $his children will be placed in $incubatorName.
				<<elseif _WL == 2>>
					Both of $his children will be placed in $incubatorName.
				<<else>>
					All _reservedIncubator of $his children will be placed in $incubatorName.
				<</if>>
				<<if (_reservedIncubator + _reservedNursery < _WL) && ($reservedChildren < _freeTanks)>>

					<<if $pregnancyMonitoringUpgrade == 1>>
						<<print "[[Inspect pregnancy|Analyze Pregnancy][$i = " + _u + "; $activeSlave = $slaves[$i]]] | ">>
					<</if>>
					<<print "[[Keep another child|Incubator][WombAddToGenericReserve($slaves[" + _u + "], 'incubator', 1)]]">>
					<<if _reservedIncubator > 0>>
						| <<print "[[Keep one less child|Incubator][WombCleanGenericReserve($slaves[" + _u + "], 'incubator', 1)]]">>
					<</if>>
					<<if _reservedIncubator > 1>>
						| <<print "[[Keep none of " + $his + " children|Incubator][WombCleanGenericReserve($slaves[" + _u + "], 'incubator', 9999)]]">>
					<</if>>
					<<if ($reservedChildren + _WL - _reservedIncubator) <= _freeTanks>>
						| <<print "[[Keep the rest of " + $his + " children|Incubator][WombAddToGenericReserve($slaves[" + _u + "], 'incubator', 9999)]]">>
					<</if>>
				<<elseif (_reservedIncubator == _WL) || ($reservedChildren == _freeTanks) || (_reservedIncubator + _reservedNursery == _WL)>>

					<<if $pregnancyMonitoringUpgrade == 1>>
						<<print "[[Inspect pregnancy|Analyze Pregnancy][$i = " + _u + "; $activeSlave = $slaves[$i]]] | ">>
					<</if>>
					<<print "[[Keep one less child|Incubator][WombCleanGenericReserve($slaves[" + _u + "], 'incubator', 1)]]">>
					<<if _reservedIncubator > 1>>
						| <<print "[[Keep none of " + $his + " children|Incubator][WombCleanGenericReserve($slaves[" + _u + "], 'incubator', 9999)]]">>
					<</if>>
				<</if>>
			<<elseif ($reservedChildren < _freeTanks)>>
				<<if _WL - _reservedNursery == 0>>
					//$His children are already reserved for $nurseryName//

					<<if $pregnancyMonitoringUpgrade == 1>>
						<<print "[[Inspect pregnancy|Analyze Pregnancy][$i = " + _u + "; $activeSlave = $slaves[$i]]] | ">>
					<</if>>
					<<print "[[Keep " + $his + " " + ((_WL > 1) ? "children" : "child") + " here instead|Incubator][WombChangeReserveType($slaves[" + _u + "], 'nursery', 'incubator')]]">>
				<<else>>
					You have <<if _freeTanks == 1>>an<</if>> @@.lime;available aging tank<<if _freeTanks > 1>>s<</if>>.@@

					<<if $pregnancyMonitoringUpgrade == 1>>
						<<print "[[Inspect pregnancy|Analyze Pregnancy][$i = " + _u + "; $activeSlave = $slaves[$i]]] | ">>
					<</if>>
					<<print "[[Keep "+ ((_WL > 1) ? "a" : "the") +" child|Incubator][WombAddToGenericReserve($slaves[" + _u + "], 'incubator', 1)]]">>
					<<if (_WL > 1) && ($reservedChildren + _WL - _reservedIncubator) <= _freeTanks>>
						| <<print "[[Keep all of " + $his + " children|Incubator][WombAddToGenericReserve($slaves[" + _u + "], 'incubator', 9999)]]">>
					<</if>>
				<</if>>
			<<elseif $reservedChildren == _freeTanks>>

				<<if $pregnancyMonitoringUpgrade == 1>>
					<<print "[[Inspect pregnancy|Analyze Pregnancy][$i = " + _u + "; $activeSlave = $slaves[$i]]] | ">>
				<</if>>
				You have @@.red;no room for $his offspring.@@
			<</if>>
			<<set _eligibility = 1>>

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

<>
<<if _eligibility == 0>>

	//You have no pregnant slaves bearing eligible children.//
<</if>>
<<if $PC.pregKnown == 1 && ($arcologies[0].FSRestart == "unset" || $eugenicsFullControl == 1 || ($PC.pregSource != -1 && $PC.pregSource != -6))>>
	<<set _WL = $PC.womb.length>>
	<<set _reservedIncubator = WombReserveCount($PC, "incubator")>>
	<<set _reservedNursery = WombReserveCount($PC, "nursery")>>

''@@.pink;You're pregnant@@'' and going to have
		<<if _WL == 1>>
			a baby.
		<<else>>
			<<print pregNumberName(_WL, 2)>>.
		<</if>>
	<<if (_reservedIncubator > 0)>>
		<<set _childrenReserved = 1>>
		<<if _WL == 1>>
			Your child will be placed in $incubatorName.
		<<elseif _reservedIncubator < _WL>>
			_reservedIncubator of your children will be placed in $incubatorName.
		<<elseif _WL == 2>>
			Both of your children will be placed in $incubatorName.
		<<else>>
			All _reservedIncubator of your children will be placed in $incubatorName.
		<</if>>
		<<if (_reservedIncubator < _WL) && ($reservedChildren < _freeTanks) && (_reservedIncubator - _reservedNursery > 0)>>

			<<if $pregnancyMonitoringUpgrade == 1>>
				<<print "[[Inspect pregnancy|Analyze PC Pregnancy]] | ">>
			<</if>>
			<<print "[[Keep another child|Incubator][WombAddToGenericReserve($PC, 'incubator', 1)]]">>
			<<if _reservedIncubator > 0>>
				| <<print "[[Keep one less child|Incubator][WombCleanGenericReserve($PC, 'incubator', 1)]]">>
			<</if>>
			<<if _reservedIncubator > 1>>
				| <<print "[[Keep none of your children|Incubator][WombCleanGenericReserve($PC, 'incubator', 9999)]]">>
			<</if>>
			<<if ($reservedChildren + _WL - _reservedIncubator) <= _freeTanks>>
				| <<print "[[Keep the rest of your children|Incubator][WombAddToGenericReserve($PC, 'incubator', 9999)]]">>
			<</if>>
		<<elseif (_reservedIncubator == _WL) || ($reservedChildren == _freeTanks) || (_reservedIncubator - _reservedNursery >= 0)>>

			<<if $pregnancyMonitoringUpgrade == 1>>
				<<print "[[Inspect pregnancy|Analyze PC Pregnancy]] | ">>
			<</if>>
			<<print "[[Keep one less child|Incubator][_reservedIncubator -= 1, $reservedChildren -= 1]]">>
			<<if _reservedIncubator > 1>>
				| <<print "[[Keep none of your children|Incubator][WombCleanGenericReserve($PC, 'incubator', 9999)]]">>
			<</if>>
		<</if>>
	<<elseif $reservedChildren < _freeTanks>>
		<<if _WL - _reservedNursery == 0>>
			//Your child<<if _WL > 0>>ren are<<else>>is<</if>> already reserved for $nurseryName//
			<<print "[[Keep your" + ((_WL > 1) ? "children" : "child") + " here instead|Incubator][WombChangeReserveType($PC, 'nursery', 'incubator')]]">>
		<<else>>
			You have <<if _freeTanks == 1>>an<</if>> @@.lime;available aging tank<<if _freeTanks > 1>>s<</if>>.@@

			<<if $pregnancyMonitoringUpgrade == 1>>
				<<print "[[Inspect pregnancy|Analyze PC Pregnancy]] | ">>
			<</if>>
			<<print "[[Keep " + ((_WL > 1) ? "a" : "your") +" child|Incubator][WombAddToGenericReserve($PC, 'incubator', 1)]]">>
			<<if (_WL > 1) && ($reservedChildren + _WL - _reservedIncubator) <= _freeTanks>>
				| [[Keep all of your children|Incubator][WombAddToGenericReserve($PC, 'incubator', 9999)]]
			<</if>>
		<</if>>
	<<elseif $reservedChildren == _freeTanks>>

		<<if $pregnancyMonitoringUpgrade == 1>>
			<<print "[[Inspect pregnancy|Analyze PC Pregnancy]] | ">>
		<</if>>
		You have @@.red;no room for your offspring.@@
	<</if>>
<</if>>
<<if $reservedChildren != 0 || _childrenReserved == 1>> /* the oops I made it go negative somehow button */

	<<link "Clear all reserved children">>
		<<for _u = 0; _u < _SL; _u++>>
			<<if WombReserveCount($slaves[_u], "incubator") != 0>>
				<<set WombCleanGenericReserve($slaves[_u], 'incubator', 9999)>>
			<</if>>
		<</for>>
		<<set WombCleanGenericReserve($PC, 'incubator', 9999)>>
		<<goto "Incubator">>
	<</link>>
<</if>>

Target age for release: <<textbox "$targetAge" $targetAge "Incubator">> [[Minimum Legal Age|Incubator][$targetAge = $minimumSlaveAge]] | [[Average Age of Fertility|Incubator][$targetAge = $fertilityAge]] | [[Average Age of Potency|Incubator][$targetAge = $potencyAge]] | [[Legal Adulthood|Incubator][$targetAge = 18]]
//Setting will not be applied to tanks in use.//

<<if $incubatorBulkRelease == 1>>
	Released children will be handled in bulk and not receive personal attention.
	[[Individual release|Incubator][$incubatorBulkRelease = 0]]
<<else>>
	Released children will be seen to personally.
	[[Bulk release|Incubator][$incubatorBulkRelease = 1]]
<</if>>

<<if $incubatorUpgradeSpeed == 52>>
	It has been upgraded with perfected growth accelerants; children grow at the rate of 1 week to 1 year.
<<elseif $incubatorUpgradeSpeed == 18>>
	It has been upgraded with advanced experimental growth accelerants; children grow at the rate of 3 weeks to 1 year. [[Fund speculative research into maximizing growth rate|Incubator][cashX(forceNeg(Math.trunc(500000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeSpeed = 52]] //Costs <<print cashFormat(Math.trunc(500000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<elseif $incubatorUpgradeSpeed == 9>>
	It has been upgraded with advanced growth accelerants; children grow at the rate of 6 weeks to 1 year. [[Fund research into increasing growth rate even further|Incubator][cashX(forceNeg(Math.trunc(75000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeSpeed = 18]] //Costs <<print cashFormat(Math.trunc(75000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<elseif $incubatorUpgradeSpeed == 6>>
	It has been upgraded with growth accelerants; children grow at the rate of 9 weeks to 1 year. [[Further upgrade the incubators with specialized stem cells to speed growth|Incubator][cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeSpeed = 9]] //Costs <<print cashFormat(Math.trunc(30000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<elseif $incubatorUpgradeSpeed == 5>>
	The incubation tanks are basic; children grow at the rate of 12 weeks to 1 year. [[Upgrade the incubators with growth accelerating drugs|Incubator][cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeSpeed = 6]] //Costs <<print cashFormat(Math.trunc(30000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $incubatorUpgradeWeight == 1>>
	Advanced caloric monitoring systems have been installed in the tanks to monitor and maintain a developing child's weight.
<<else>>
	There are no systems in place to control a growing child's weight; they will likely come out emaciated from the rapid growth. [[Upgrade the growth tanks with weight monitoring systems|Incubator][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeWeight = 1]] //Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $incubatorUpgradeMuscles == 1>>
	Advanced monitoring and steroid injection systems have been installed in the tanks to monitor and maintain a developing child's musculature.
<<else>>
	There are no systems in place to control a growing child's musculature; they will likely come out frail and weak from the rapid growth. [[Upgrade the growth tanks with muscle monitoring systems|Incubator][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeMuscles = 1]] //Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $incubatorUpgradeReproduction == 1>>
	Advanced monitoring and hormone injection systems have been installed in the tanks to influence a developing child's reproductive organs.
<<else>>
	There are no systems in place to control a growing child's reproductive capability. [[Upgrade the growth tanks with hormone monitoring systems|Incubator][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeReproduction = 1]] //Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $incubatorUpgradeOrgans == 1>>
	Surgical tools have been added to the tank to be able to extract tissue samples from the occupant.
<<elseif $organFarmUpgrade >= 1>>
	The tanks lack the ability to extract tissue samples to be used by the organ fabricator. [[Upgrade the growth tanks with surgical extraction tools|Incubator][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeOrgans = 1]] //Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<else>>
	The tanks lack the ability to extract tissue samples and the dispensary lacks the ability to make use of them to fabricate organs.
<</if>>

<<if $incubatorUpgradeGrowthStims == 1>>
	Advanced monitoring and stimulant injection systems have been installed in the tanks to monitor and maintain a developing child's height.
<<elseif $growthStim == 1>>
	There are no systems in place to control a growing child's height. [[Upgrade the growth tanks with stimulants injection systems|Incubator][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradeGrowthStims = 1]] //Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<<else>>
	There are no systems in place to control a growing child's height and you lack the capability to fabricate growth stimulants.
<</if>>

<<if $minimumSlaveAge <= 6 && ($arcologies[0].FSRepopulationFocus >=60 || $BlackmarketPregAdaptation == 1) >> /*Main prerequisite - stable repopulation FS OR documentation purchased from black market. And age gate. */

	<<if $incubatorUpgradePregAdaptation == 1>>
		The incubators have been upgraded with special set of manipulators, probes, nozzles and syringes coupled together with specific programs to take advantage of the accelerated growth to heighten viable reproductive capacity. These include injections of specialized serums and mechanical manipulation of the reproductive system and associated tissues, organs, muscles and bones.
	<<else>>
		The highly controlled environment inside incubation tube coupled with the greatly accelerated growth process is the perfect opportunity to push the boundaries of a body's ability to sustain pregnancy. This will include injections of specialized serums and mechanical manipulation of their reproductive system through a special set of manipulators, probes, nozzles and syringes supervised by a powerful monitoring program. Costly to maintain.

		<<if $incubatorUpgradeReproduction < 1>> /* Now with reports - what is lacking for construction */
			$incubatorNameCaps lacks advanced monitoring and hormone injection systems. Construction not possible.
		<<elseif $incubatorUpgradeOrgans < 1>>
			$incubatorNameCaps lacks the ability to extract tissue samples. Construction not possible.
		<<elseif $dispensaryUpgrade < 1>>
			$incubatorNameCaps lacks a connection to an advanced pharmaceutical fabricator. Cutting-edge targeted serums production needed as integral part. Construction not possible.
		<<elseif $bellyImplants < 1>>
			$incubatorNameCaps lacks a connection with an implant manufacturing to construct fillable abdominal implants to simulate expansion. Construction not possible.
		<<elseif $incubatorUpgradeGrowthStims < 1>>
			$incubatorNameCaps lacks advanced monitoring and stimulant injection systems. Construction not possible.
		<<else>>
			[[Manufacture and install this subsystem|Incubator][cashX(forceNeg(Math.trunc(2000000*$upgradeMultiplierArcology)), "capEx"), $incubatorUpgradePregAdaptation = 1]] //Costs <<print cashFormat(Math.trunc(2000000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
		<</if>>
	<</if>>

<</if>>

<<if $incubatorImprintSetting == "terror">>
	The imprinting system is currently focused on making them devoted but fearful of you. The imprinting cycle is locked upon incubation start.
	<<if $bodyswapAnnounced == 1>>

[[Switch the system to focus on preparation for body-swapping|Incubator][$incubatorImprintSetting = "husk"]]
	<</if>>

[[Switch the system to focus on attachment|Incubator][$incubatorImprintSetting = "trust"]]
<<elseif $incubatorImprintSetting == "trust">>
	The imprinting system is currently focused on making them devoted and trusting of you. The imprinting cycle is locked upon incubation start.
	<<if $bodyswapAnnounced == 1>>

[[Switch the system to focus on preparation for body-swapping|Incubator][$incubatorImprintSetting = "husk"]]
	<</if>>

[[Switch the system to focus on dependence|Incubator][$incubatorImprintSetting = "terror"]]
<<else>>
	The imprinting system is currently focused on producing complete vegetables ready to be used as hosts for body swapping. The imprinting cycle is locked upon incubation start.

[[Switch the system to focus on dependence|Incubator][$incubatorImprintSetting = "terror"]]

[[Switch the system to focus on attachment|Incubator][$incubatorImprintSetting = "trust"]]
<</if>>
//Only affects new infants//

<<if $incubatorSlaves > 0>>

''Children in $incubatorName''

<<for $i = 0; $i < $incubatorSlaves; $i++>>
	<<capture $i>>
		<<setLocalPronouns $tanks[$i]>>

@@.pink;$tanks[$i].slaveName@@ occupies this tank.
		<<if $geneticMappingUpgrade >= 1>>
			$He is a <<if $tanks[$i].genes == "XX">>female<<else>>male<</if>> of $tanks[$i].race descent with <<print App.Desc.eyesColor($tanks[$i])>>, $tanks[$i].hColor hair and $tanks[$i].skin skin. Given $his parentage, $he is considered $tanks[$i].nationality.
		<<else>>
			$He appears to be <<if $tanks[$i].genes == "XX">>a natural girl<<else>>a natural boy<</if>>, with $tanks[$i].hColor hair<<if getBestVision($tanks[$i]) === 0>> and <<print App.Desc.eyesColor($tanks[$i])>>.<<else>>. $He most likely will be blind.<</if>>
		<</if>>
		Statistical projections indicates that once released $he will be around <<= heightToEitherUnit($tanks[$i].height + random(-5,5))>> tall. Most likely $he will be
			<<if $tanks[$i].weight <= 30 && $tanks[$i].weight >= -30>>
				at a healthy weight and
			<<elseif $tanks[$i].weight >= 31 && $tanks[$i].weight <= 95>>
				quite overweight and
			<<elseif $tanks[$i].weight >= 96>>
				very overweight and
			<<elseif $tanks[$i].weight <= -31 && $tanks[$i].weight >= -95>>
				quite thin and
			<<elseif $tanks[$i].weight <= -96>>
				very thin and
			<</if>>
			<<if $tanks[$i].muscles <= 5 && $tanks[$i].muscles >= -5>>
				with a normal musculature.
			<<elseif $tanks[$i].muscles >= 6 && $tanks[$i].muscles <= 30>>
				quite toned.
			<<elseif $tanks[$i].muscles >= 31 && $tanks[$i].muscles <= 95>>
				quite muscular.
			<<elseif $tanks[$i].muscles >= 96>>
				with a powerful musculature.
			<<elseif $tanks[$i].muscles <= -6 && $tanks[$i].muscles >= -30>>
				quite weak.
			<<elseif $tanks[$i].muscles <= -31 && $tanks[$i].muscles >= -95>>
				very weak.
			<<elseif $tanks[$i].muscles <= -96>>
				extremely weak.
			<</if>>
			$His breasts are projected to be
			<<if $tanks[$i].boobs <= 299>>
				of small size,
			<<elseif $tanks[$i].boobs <= 799>>
				of normal size,
			<<elseif $tanks[$i].boobs <= 1799>>
				of generous size,
			<<elseif $tanks[$i].boobs <= 3249>>
				of incredible size,
			<<else>>
				of humongous size,
			<</if>>
			while $his rear will be
			<<if $tanks[$i].butt <= 3>>
				a healthy size.
			<<elseif $tanks[$i].butt <= 6>>
				quite impressive.
			<<elseif $tanks[$i].butt <= 9>>
				very impressive.
			<<else>>
				immense.
			<</if>>
			<<if $tanks[$i].dick > 0>>
				<<if $tanks[$i].dick <= 3>>
					The latest analysis reported $his dick will end up being around the average
				<<elseif $tanks[$i].dick >= 4 && $tanks[$i].dick <= 6>>
					The latest analysis reported $his dick will end up being above average
				<<elseif $tanks[$i].dick >= 7 && $tanks[$i].dick <= 9>>
					The latest analysis reported $his dick will end up being far above the average
				<<else>>
					The latest analysis reported $his dick will end up being of monstrous size
				<</if>>
			<</if>>
			<<if $tanks[$i].balls > 0>>
				<<if $tanks[$i].balls <= 3>>
					and $his testicles will reach a normal size.
				<<elseif $tanks[$i].balls >= 4 && $tanks[$i].balls <= 6>>
					and $his testicles will be of remarkable size.
				<<elseif $tanks[$i].balls >= 7 && $tanks[$i].balls <= 9>>
					and $his testicles will reach an impressive size.
				<<else>>
					and $his testicles will reach a monstrous size.
				<</if>>
			<</if>>
			<<if $tanks[$i].pubertyXX == 1 && $tanks[$i].ovaries == 1>>
				Scanners report $his womb is fertile.
			<<else>>
				Scanners report $he is not fertile,
				<<if $tanks[$i].pubertyXX == 0>>
					as $he has not yet entered puberty.
				<<else>>
					as it appears $his womb is sterile.
				<</if>>
			<</if>>
			<<if ($incubatorPregAdaptationSetting == 1 && $tanks[$i].genes == "XX") || ($incubatorPregAdaptationSetting == 2 && $tanks[$i].genes == "XY") || $incubatorPregAdaptationSetting == 3 >>
				There are probes and tubes inserted inside $his reproductive organs so $incubatorName may work on them.
				<<set _safeCC = ($tanks[$i].pregAdaptation - 5) * 2000>>
				<<if _safeCC > 300000>> /* Some bigger size descriptions may be unreachable by normal game mechanics, so they are here just in case.*/
					$His bloated form looks more like an overinflated beachball made of the overstretched skin of $his belly with $his relative tiny body attached to its side. $He is completely dominated by it now. The process has gone too far, so $his body can't maintain its form with the belly as part of abdominal cavity. Now $his skin, tissues and muscles have stretched enough for $his belly to expand outside of any physical boundaries and appear more an attachment to $his body, rather than part of it.
				<<elseif _safeCC > 150000>>
					$His body looks almost spherical, having been grotesquely inflated with the stimulator sacks inserted into $his internals. The incubator constantly maintains high pressure inside $him, forcing the displacement of $his organs and stretching skin, tissues, and muscles. Even $his chest forced to become a part of the top of $his belly, having been pushed forward from the overwhelming volume inside.
				<<elseif _safeCC > 75000>>
					$His belly has become so huge that can be easily compared with belly of a woman ready to birth quintuplets. It pulses from the pressure applied within by the incubator probes.
				<<elseif _safeCC > 45000>>
					$His belly, in the current state, would look normal on a woman who was ready to birth triplets. On $his still growing form, it's something completely out of the ordinary.
				<<elseif _safeCC > 30000>>
					$His belly looks like it contains full sized twins, ready to be birthed.
				<<elseif _safeCC > 15000>>
					$His belly has reached the size of full term pregnancy.
				<<elseif _safeCC > 10000>>
					$His belly has inflated to the size of late term pregnancy; its skin shines from the tension.
				<<elseif _safeCC > 5000>>
					$His belly resembles a mid term pregnancy; it pulses slightly from the expansion and contraction of expandable sacks tipping the incubator probes.
				<<elseif _safeCC > 1500>>
					$His belly slightly bulges and rhythmically expands and contracts to the cycles of $his stimulation as the incubator inflates and deflates expandable sacks on its probes within $his body cavity. With the correct serums applied, this should allow it to stretch the skin, tissues, and muscles of $his belly to better to tolerate the displacement of internal organs caused by fetal growth.
				<</if>>
			<</if>>
		<<if $tanks[$i].growTime <= 0>>
			<<set $readySlaves = 1>>

$He is ready to be released from $his tank.
		<<else>>
			<<set _weekDisplay = Math.round($tanks[$i].growTime/$incubatorUpgradeSpeed)>>

$His growth is currently being accelerated. $He will be ready for release in about _weekDisplay week<<if _weekDisplay > 1>>s<</if>>.
		<</if>>

		<<if $tanks[$i].tankBaby != 3>>
			The tank is imprinting $him with basic life and sexual skills, though $he will still be very naïve and inexperienced on release.
			<<if $tanks[$i].tankBaby == 2>>
				The majority of $his indoctrination involves painting the world as a terrible place where only horror awaits $him should $he not obey $his owner.
			<<else>>
				The majority of $his indoctrination involves painting the world as a wonderful place only if $he is unconditionally devoted to, and absolutely trusting of, $his owner.
			<</if>>
		<<else>>
			The tank keeps $him a braindead husk on a complete life-support.
		<</if>>
		<<if $incubatorUpgradeWeight == 1>>

			<<if $incubatorWeightSetting == 1>>
				$His weight is not being properly managed, saving costs but likely causing excessive weight gain.
			<<elseif $incubatorWeightSetting == 2>>
				$His weight is being carefully managed; $he will be released at a healthy weight.
			<<elseif $incubatorWeightSetting == 0>>
				Weight management systems are offline; $he will likely be malnourished.
			<</if>>
		<</if>>
		<<if $incubatorUpgradeMuscles == 1>>

			<<if $incubatorMusclesSetting == 2>>
				$His strength levels are purposefully set higher than recommended; $he is likely to have excessive musculature.
			<<elseif $incubatorMusclesSetting == 1>>
				$His musculature is being carefully managed; $he will be released with near normal strength.
			<<elseif $incubatorMusclesSetting == 0>>
				Strength management systems are offline; $he will likely be released extremely weak.
			<</if>>
		<</if>>
		<<if $incubatorUpgradeGrowthStims == 1>>

			<<if $incubatorGrowthStimsSetting == 2>>
				$He is being injected with higher than recommended doses of stimulants; $he is likely to be much taller than expected.
			<<elseif $incubatorGrowthStimsSetting == 1>>
				$He is injected with the recommended dosage of stimulants; $he will grow to $his full expected height.
			<<elseif $incubatorGrowthStimsSetting == 0>>
				Growth stimulant injection systems are offline; $he will develop normally.
			<</if>>
		<</if>>
		<<if $incubatorUpgradeReproduction == 1>>

			<<if $incubatorReproductionSetting == 2>>
				$His hormone levels are purposefully set higher than recommended; $his reproductive systems are likely to be over-active.
			<<elseif $incubatorReproductionSetting == 1>>
				$His hormone levels are being carefully managed; $he will be released with fully functional reproductive organs.
			<<elseif $incubatorReproductionSetting == 0>>
				Reproduction management systems are offline; $he will undergo normal puberty.
			<</if>>
			<<if ($incubatorPregAdaptationSetting == 1 && $tanks[$i].genes == "XX") || ($incubatorPregAdaptationSetting == 2 && $tanks[$i].genes == "XY") ||$incubatorPregAdaptationSetting == 3 >> /* Should be visible only after incubatorUpgradeReproduction is installed and activated*/

				$His reproductive organs are getting <<if $tanks[$i].incubatorPregAdaptationPower == 1>>an advanced<<elseif $tanks[$i].incubatorPregAdaptationPower == 2>>an intensive<<elseif $tanks[$i].incubatorPregAdaptationPower == 3>>an extreme<<else>>a standard<</if>> course of mechanical and hormonal therapy to become adapted for future use.
			<</if>>
		<</if>>

Rename $him: <<textbox "_tempName" _tempName >> [[Apply |Incubator][$tanks[$i].slaveName = _tempName]] // Given name only //
		<<if $cheatMode == 1>>

''Cheatmode:''
			<<link "Retrieve immediately">>
				<<set $incubatorOldID = $tanks[$i].ID>>
				<<set $readySlave = $tanks[$i]>>
				<<run $tanks.splice($i, 1)>>
				<<goto "Incubator Retrieval Workaround">>
			<</link>>
		<</if>>
		<<if ($incubatorUpgradeOrgans == 1) && ($tanks[$i].tankBaby!= 3)>>

			You can extract a sample and prepare a new organ for $him to be implanted once $he exits $his tank.
			<<set _newOrgan = 0>>
			<<set $tankOrgans = {
				ovaries: 0,
				penis: 0,
				testicles:0,
				rightEye: 0,
				leftEye: 0,
				voiceBox: 0}>>
			<<for _i = 0; _i < $incubatorOrgans.length; _i++>>
				<<if $tanks[$i].ID == $incubatorOrgans[_i].ID>>
					<<if $incubatorOrgans[_i].type == "ovaries">>
						<<set $tankOrgans.ovaries = 1>>
					<</if>>
					<<if $incubatorOrgans[_i].type == "testicles">>
						<<set $tankOrgans.testicles = 1>>
					<</if>>
					<<if $incubatorOrgans[_i].type == "penis">>
						<<set $tankOrgans.penis = 1>>
					<</if>>
					<<if $incubatorOrgans[_i].type == "rightEye">>
						<<set $tankOrgans.rightEye = 1>>
					<</if>>
					<<if $incubatorOrgans[_i].type == "leftEye">>
						<<set $tankOrgans.leftEye = 1>>
					<</if>>
					<<if $incubatorOrgans[_i].type == "voicebox">>
						<<set $tankOrgans.voicebox = 1>>
					<</if>>
				<</if>>
			<</for>>
			<<if $tanks[$i].genes == "XX">>
				Being a natural girl, $he possesses a functional vagina and ovaries. You can:
			<<else>>
				Being a natural boy, $he possesses a functional penis and balls. You can:
			<</if>>

			<<if $tanks[$i].ovaries == 0>>
				<<if $tankOrgans.ovaries != 1>>
					<<link "Prepare ovaries">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "ovaries")>>
						<<goto "Incubator">>
					<</link>>
				<<else>>
					@@.detail;Ovaries are already prepared.@@
				<</if>>
			<</if>>
			<<if $tanks[$i].dick == 0>>
				<<if $tankOrgans.penis != 1>>
					<<link "Prepare penis">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "penis")>>
						<<goto "Incubator">>
					<</link>>
				<<else>>
					@@.detail;A penis is already prepared.@@
				<</if>>
			<</if>>
			<<if $tanks[$i].balls == 0>>
				|
				<<if $tankOrgans.testicles != 1>>
					<<link "Prepare testicles">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "testicles")>>
						<<goto "Incubator">>
					<</link>>
				<<else>>
					@@.detail;Testicles are already prepared.@@
				<</if>>
			<</if>>
			<<if getLeftEyeVision($tanks[$i]) === 0 || getRightEyeVision($tanks[$i]) === 0>>

				<<set _both = getLeftEyeVision($tanks[$i]) === 0 && getRightEyeVision($tanks[$i]) === 0>>
				<<if _both>>
					$He appears to be blind in both eyes:
				<<elseif getLeftEyeVision($tanks[$i]) === 0>>
					$He appears to be blind in $his left eye:
				<<else>>
					$He appears to be blind in $his right eye:
				<</if>>
				<<set _unprepared = 0>>
				<<if getLeftEyeVision($tanks[$i]) === 0 && $tankOrgans.leftEye != 1>>
					<<link "Prepare left eye">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "leftEye")>>
						<<goto "Incubator">>
					<</link>>
					<<set _unprepared++>>
				<</if>>
				<<if getRightEyeVision($tanks[$i]) === 0 && $tankOrgans.rightEye != 1>>
					<<if _unprepared > 0>> | <</if>>
					<<link "Prepare right eye">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "rightEye")>>
						<<goto "Incubator">>
					<</link>>
					<<set _unprepared++>>
				<</if>>
				<<if _both && _unprepared === 2>>
					|
					<<link "Prepare both eyes">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "leftEye"), App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "rightEye")>>
						<<goto "Incubator">>
					<</link>>
				<</if>>
				<<if _both && _unprepared === 0>> @@.detail;Both eyes are already prepared.@@
				<<elseif $tankOrgans.leftEye == 1>> @@.detail;A left eye is already prepared.@@
				<<elseif $tankOrgans.rightEye == 1>> @@.detail;A right eye is already prepared.@@
				<</if>>
			<</if>>
			<<if $tanks[$i].voice == 0>>

$He appears to be mute:
				<<if $tankOrgans.voicebox != 1>>
					<<link "Prepare vocal cords">>
						<<run App.Medicine.OrganFarm.growIncubatorOrgan($tanks[$i], "voicebox")>>
						<<goto "Incubator">>
					<</link>>
				<<else>>
					@@.detail;Vocal cords are already prepared.@@
				<</if>>
			<</if>>
		<</if>>
	<</capture>>
<</for>>
<</if>>

<<if $incubatorUpgradeWeight == 1>>
	<<if $incubatorWeightSetting == 1>>
		Weight is not being properly managed; excessive weight gain is likely. [[Monitor|Incubator][$incubatorWeightSetting = 2]] | [[Disable|Incubator][$incubatorWeightSetting = 0]]
	<<elseif $incubatorWeightSetting == 2>>
		Weight is being carefully managed; children will be released at a healthy weight. [[Estimate only|Incubator][$incubatorWeightSetting = 1]] | [[Disable|Incubator][$incubatorWeightSetting = 0]]
	<<elseif $incubatorWeightSetting == 0>>
		Weight management systems are offline; children will likely be malnourished. [[Activate|Incubator][$incubatorWeightSetting = 2]]
	<</if>>
<</if>>

<<if $incubatorUpgradeMuscles == 1>>
	<<if $incubatorMusclesSetting == 2>>
		Strength levels are purposefully set higher than recommended; excessive muscle gain is likely. [[Limit|Incubator][$incubatorMusclesSetting = 1]] | [[Disable|Incubator][$incubatorMusclesSetting = 0]]
	<<elseif $incubatorMusclesSetting == 1>>
		Musculature is being carefully managed; children will be released with near normal strength. [[Overload|Incubator][$incubatorMusclesSetting = 2]] | [[Disable|Incubator][$incubatorMusclesSetting = 0]]
	<<elseif $incubatorMusclesSetting == 0>>
		Strength management systems are offline; children will likely be released extremely weak. [[Activate|Incubator][$incubatorMusclesSetting = 1]]
	<</if>>
<</if>>

<<if $incubatorUpgradeReproduction == 1>>
	<<if $incubatorReproductionSetting == 2>>
		Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. [[Limit|Incubator][$incubatorReproductionSetting = 1]] | [[Disable|Incubator][$incubatorReproductionSetting = 0]]
	<<elseif $incubatorReproductionSetting == 1>>
		Hormone levels are being carefully managed; children will be released with fully functional reproductive organs. [[Overload|Incubator][$incubatorReproductionSetting = 2]] | [[Disable|Incubator][$incubatorReproductionSetting = 0]]
	<<elseif $incubatorReproductionSetting == 0>>
		Reproduction management systems are offline; children will undergo normal puberty. [[Activate|Incubator][$incubatorReproductionSetting = 1]]
	<</if>>
	<<if $incubatorUpgradePregAdaptation == 1>> /* Should be visible only after incubatorUpgradeReproduction is installed */

		<<if $incubatorPregAdaptationSetting == 3>>
			Pregnancy adaptation system online: All.
			[[Females|Incubator][$incubatorPregAdaptationSetting = 1]] | [[Males|Incubator][$incubatorPregAdaptationSetting = 2]] | [[Disable|Incubator][$incubatorPregAdaptationSetting = 0]]
		<<elseif $incubatorPregAdaptationSetting == 2>>
			Pregnancy adaptation system online: Males only.
			[[All|Incubator][$incubatorPregAdaptationSetting = 3]] | [[Females|Incubator][$incubatorPregAdaptationSetting = 1]] | [[Disable|Incubator][$incubatorPregAdaptationSetting = 0]]
		<<elseif $incubatorPregAdaptationSetting == 1>>
			Pregnancy adaptation system online: Females only.
			[[All|Incubator][$incubatorPregAdaptationSetting = 3]] | [[Males|Incubator][$incubatorPregAdaptationSetting = 2]] | [[Disable|Incubator][$incubatorPregAdaptationSetting = 0]]
		<<else>>
			Pregnancy adaptation system offline.
			[[All|Incubator][$incubatorPregAdaptationSetting = 3]] | [[Females|Incubator][$incubatorPregAdaptationSetting = 1]] | [[Males|Incubator][$incubatorPregAdaptationSetting = 2]]
		<</if>>
	<</if>>
	<<if $incubatorUpgradePregAdaptation == 1 && $incubatorPregAdaptationSetting > 0>> /* Should be visible only after incubatorUpgradeReproduction is installed and turned on*/

		<<if $incubatorPregAdaptationPower == 1>>
			Pregnancy adaptation programmed to advanced procedures. Up to triplet pregnancy should be safe for the subjects.
			[[Standard|Incubator][$incubatorPregAdaptationPower = 0]] | [[Intensive|Incubator][$incubatorPregAdaptationPower = 2]] | [[Extreme|Incubator][$incubatorPregAdaptationPower = 3]]
		<<elseif $incubatorPregAdaptationPower == 2>>
			Pregnancy adaptation programmed to intensive procedures. Up to octuplet pregnancy should be possible for the subjects. Warning! Side effects may occur to health and mental condition.
			[[Standard|Incubator][$incubatorPregAdaptationPower = 0]] | [[Advanced|Incubator][$incubatorPregAdaptationPower = 1]] | [[Extreme|Incubator][$incubatorPregAdaptationPower = 3]]
		<<elseif $incubatorPregAdaptationPower == 3>>
			Pregnancy adaptation programmed to extreme procedures. Normally unsustainable pregnancies may be possible for some subjects. Actual capacity will vary with genetic and other individual conditions. WARNING! Extreme side effects may occur to health and mental condition!
			[[Standard|Incubator][$incubatorPregAdaptationPower = 0]] | [[Advanced|Incubator][$incubatorPregAdaptationPower = 1]] | [[Intensive|Incubator][$incubatorPregAdaptationPower = 2]]
		<<else>>
			Pregnancy adaptation programmed to standard procedures. Normal pregnancy should be safe for subjects.
			[[Advanced|Incubator][$incubatorPregAdaptationPower = 1]] | [[Intensive|Incubator][$incubatorPregAdaptationPower = 2]] | [[Extreme|Incubator][$incubatorPregAdaptationPower = 3]]
		<</if>>

		//Due to the high complexity and steep risks of the procedure, settings will not be changed on tanks in use.//
	<</if>>
<</if>>

<<if $incubatorUpgradeGrowthStims == 1>>
	<<if $incubatorGrowthStimsSetting == 2>>
		Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. [[Limit|Incubator][$incubatorGrowthStimsSetting = 1]] | [[Disable|Incubator][$incubatorGrowthStimsSetting = 0]]
	<<elseif $incubatorGrowthStimsSetting == 1>>
		Children are injected with the recommended dosage of stimulants; they will grow to their full expected height. [[Overload|Incubator][$incubatorGrowthStimsSetting = 2]] | [[Disable|Incubator][$incubatorGrowthStimsSetting = 0]]
	<<elseif $incubatorGrowthStimsSetting == 0>>
		Growth stimulant injection systems are offline; children will develop normally. [[Activate|Incubator][$incubatorGrowthStimsSetting = 1]]
	<</if>>
<</if>>

<<if $readySlaves == 1>>
	<<if $incubatorBulkRelease == 1>>
		<<set $newSlavePool = []>>
		<<for _inc = 0; _inc < $tanks.length; _inc++>>
			<<if $tanks[_inc].growTime <= 0>>
				<<set $incubatorOldID = $tanks[_inc].ID>> /* single slave case */
				<<set _tempObject = {object: $tanks[_inc], ID: $tanks[_inc].ID}>>
				<<set $newSlavePool.push(clone(_tempObject))>>
				<<run $tanks.splice(_inc, 1)>>
				<<set _inc-->>
			<</if>>
		<</for>>
		<<if $newSlavePool.length == 1>>
			<<set $readySlave = $newSlavePool[0].object>>
			<<set $newSlavePool = 0>>
		<</if>>
	<<else>>
		<<for _inc = 0; _inc < $incubatorSlaves; _inc++>>
			<<if $tanks[_inc].growTime <= 0>>
				<<set $incubatorOldID = $tanks[_inc].ID>>
				<<set $readySlave = $tanks[_inc]>>
				<<run $tanks.splice(_inc, 1)>>
				<<break>>
			<</if>>
		<</for>>
	<</if>>
	<<goto "Incubator Retrieval Workaround">>
<</if>>

Rename $incubatorName: <<textbox "$incubatorName" $incubatorName "Incubator">> //Use a noun or similar short phrase//