code:
:: Hotswap Prosthetics [nobr]

<<set $activeLimbs = $limbs.find(function(s) { return s.ID == $activeSlave.ID; })>>
<<if $activeSlave.amp < 0>>
	<<set _oldLimbs = {type: 0, armsTat: 0, legsTat: 0}>>
	<<set _oldLimbs.type = $activeSlave.amp, _oldLimbs.armsTat = $activeSlave.armsTat, _oldLimbs.legsTat = $activeSlave.legsTat>>
<<else>>
	<<unset _oldLimbs>>
<</if>>
<<set _readyLimbs = []>>
<<for _hsp = 0; _hsp < $activeSlave.readyLimbs.length; _hsp++>>
	<<set _readyLimbs.push($activeSlave.readyLimbs[_hsp].type)>>
<</for>>

	__Swap out $his prosthetics__:
	<<if $activeSlave.amp < 0>>
		<<link "Remove current prostheses">>
			<<set $activeSlave.amp = 1, $activeSlave.armsTat = 0, $activeSlave.legsTat = 0>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>> |
	<</if>>

	<<if $activeSlave.amp == -1>>
		Basic P-limbs equipped
	<<elseif _readyLimbs.includes(-1)>>
		<<link "A basic set">>
			<<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -1; })>>
			<<set _newLimbs = $activeSlave.readyLimbs[_hsp]>>
			<<set $activeSlave.amp = -1, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1)>>
			<<if def _oldLimbs>>
				<<set $activeSlave.readyLimbs.push(_oldLimbs)>>
			<</if>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>>
	<<elseif def $activeLimbs && $activeLimbs.type == "simple" && $activeSlave.ID == $activeLimbs.ID>>
		//Basic P-limbs being built
	<<else>>
		//Basic prostheses unavailable
	<</if>>|

	<<if $activeSlave.amp == -2>>
		Sex focused P-limbs equipped
	<<elseif _readyLimbs.includes(-2)>>
		<<link "A sex focused set">>
			<<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -2; })>>
			<<set _newLimbs = $activeSlave.readyLimbs[_hsp]>>
			<<set $activeSlave.amp = -2, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1)>>
			<<if def _oldLimbs>>
				<<set $activeSlave.readyLimbs.push(_oldLimbs)>>
			<</if>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>>
	<<elseif def $activeLimbs && $activeLimbs.type == "sex" && $activeSlave.ID == $activeLimbs.ID>>
		//Sex focused P-limbs being built
	<<else>>
		//Sex focused prostheses unavailable
	<</if>>|

	<<if $activeSlave.amp == -3>>
		Natural looking P-limbs equipped
	<<elseif _readyLimbs.includes(-3)>>
		<<link "A natural looking set">>
			<<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -3; })>>
			<<set _newLimbs = $activeSlave.readyLimbs[_hsp]>>
			<<set $activeSlave.amp = -3, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1)>>
			<<if def _oldLimbs>>
				<<set $activeSlave.readyLimbs.push(_oldLimbs)>>
			<</if>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>>
	<<elseif def $activeLimbs && $activeLimbs.type == "beauty" && $activeSlave.ID == $activeLimbs.ID>>
		//Natural looking P-limbs being built
	<<else>>
		//Natural looking prostheses unavailable
	<</if>>|

	<<if $activeSlave.amp == -4>>
		Combat P-limbs equipped
	<<elseif _readyLimbs.includes(-4)>>
		<<link "Military grade arms">>
			<<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -4; })>>
			<<set _newLimbs = $activeSlave.readyLimbs[_hsp]>>
			<<set $activeSlave.amp = -4, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1)>>
			<<if def _oldLimbs>>
				<<set $activeSlave.readyLimbs.push(_oldLimbs)>>
			<</if>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>>
	<<elseif def $activeLimbs && $activeLimbs.type == "combat" && $activeSlave.ID == $activeLimbs.ID>>
		//Combat P-limbs being built
	<<else>>
		//Combat prostheses unavailable
	<</if>>|

	<<if $activeSlave.amp == -5>>
		Cybernetic P-limbs equipped
	<<elseif _readyLimbs.includes(-5)>>
		<<link "Advanced cybernetics">>
			<<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -5; })>>
			<<set _newLimbs = $activeSlave.readyLimbs[_hsp]>>
			<<set $activeSlave.amp = -5, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>>
			<<set $activeSlave.readyLimbs.splice(_hsp, 1)>>
			<<if def _oldLimbs>>
				<<set $activeSlave.readyLimbs.push(_oldLimbs)>>
			<</if>>
			<<replace "#LimbOptions">>
			<<include "Hotswap Prosthetics">>
			<</replace>>
		<</link>>
	<<elseif def $activeLimbs && $activeLimbs.type == "cyber" && $activeSlave.ID == $activeLimbs.ID>>
		//Cybernetic P-limbs being built
	<<else>>
		//Cybernetic prostheses unavailable
	<</if>>


code:
:: Husk Slave [nobr]

<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $showEncyclopedia = 1, $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"]]

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>>

repo_name: Echoart/fc


code:
:: Husk Slave Swap [nobr]

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

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].origEye = $slaves[_m].origEye, $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>>

<<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 she'll never see _his2 body again. With so little left, she 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]

<<set $nextButton = "Abort Operation", $nextLink = "Scheduled Event", $returnTo = "Scheduled Event">>

"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) || ($nurseryBabies)>> and slaves with reserved children<</if>> not eligible."

//Select the slave whose mind will be transferred into the waiting husk.<<if $cyberMod == 1>> Amputated slaves must not be wearing prosthetics.<</if>> 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 $slaves[_i].amp >= 0>>
	<<if $slaves[_i].indenture == -1>>
	<<if $slaves[_i].breedingMark == 0 || $propOutcome == 0>>
	<<if WombReserveCount($slaves[_i]) == 0>>
	<<if $slaves[_i].ID != $activeSlave.ID>>
		<<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]

<<set $HackingSkillMultiplier = HSM()>>
<<set $nextButton = "Back", $nextLink = "Manage Penthouse", $showEncyclopedia = 1, $encyclopedia = "The Pharmaceutical Fab.", _PCSkillCheck = Math.max($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]

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

<<if $incubatorName != "the Incubator">>
	<<set $incubatorNameCaps = $incubatorName.replace("the ", "The ")>>
<</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 <<if $incubator == 1>>child<<else>>children<</if>>. Currently $incubatorSlaves tanks are in use.
[[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>>
	<<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])>>

		<<print "[[_slaveName|Long Slave Description][$activeSlave = $slaves[" + _u + "], $nextLink = passage()]]">> is $slaves[_u].pregWeek weeks 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
		<<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)>>

				<<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)>>

				<<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//

				<<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>>.@@

				<<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>>

			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 && $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
		<<switch _WL>>
		<<case 1>>
			a baby.
		<<case 2>>
			twins.
		<<case 3>>
			triplets.
		<<case 4>>
			quadruplets.
		<<case 5>>
			quintuplets.
		<<case 6>>
			sextuplets.
		<<case 7>>
			septuplets.
		<<case 8>>
			octuplets.
		<</switch>>
	<<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)>>

			<<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)>>

			<<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>>.@@

			<<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>>

		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 $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 rapidly growing. [[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 rapidly growing. [[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 $incubatorImprintSetting == "terror">>
	The imprinting system is currently focused on making them devoted but fearful of you. The imprinting cycle is locked upon incubation start.
	[[Switch the system to focus on attachment|Incubator][$incubatorImprintSetting = "trust"]] //Only affects new infants//
<<else>>
	The imprinting system is currently focused on making them devoted and trusting of you. The imprinting cycle is locked upon incubation start.
	[[Switch the system to focus on dependence|Incubator][$incubatorImprintSetting = "terror"]] //Only affects new infants//
<</if>>

<<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 $tanks[$i].eyeColor eyes, $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 $tanks[$i].eyes != -2>> and $tanks[$i].eyeColor eyes.<<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 <= 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>>
					it appears $his womb is sterile.
				<</if>>
			<</if>>
		<<if $tanks[$i].growTime <= 0>>
			<<set $readySlaves = 1>>

$He is ready to be released from $his tank.
		<<else>>

$His growth is currently being accelerated. $He will be ready for release in about <<print Math.round($tanks[$i].growTime/$incubatorUpgradeSpeed)>> weeks.
		<</if>>

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>>
		<<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; excessive muscle gain likely.
			<<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; exceeding expected final height is likely.
			<<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; over-active reproductive systems likely.
			<<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>>

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>>

			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,
				eyes: 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 == "eyes">>
						<<set $tankOrgans.eyes = 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 && $tankOrgans.ovaries != 1>>
				<<link "Prepare ovaries">>
					<<run cashX(-10000, "incubator", $tanks[$i])>>
					<<set _newOrgan = {type: "ovaries", weeksToCompletion: "10", ID: 0}>>
					<<set _newOrgan.ID = $tanks[$i].ID>>
					<<set $incubatorOrgans.push(_newOrgan)>>
					<<goto "Incubator">>
				<</link>>
			<</if>>
			<<if $tanks[$i].dick == 0 && $tankOrgans.penis != 1>>
				<<link "Prepare penis">>
					<<run cashX(-5000, "incubator", $tanks[$i])>>
					<<set _newOrgan = {type: "penis", weeksToCompletion: "5", ID: 0}>>
					<<set _newOrgan.ID = $tanks[$i].ID>>
					<<set $incubatorOrgans.push(_newOrgan)>>
					<<goto "Incubator">>
				<</link>>
			<</if>>
			<<if $tanks[$i].balls == 0 && $tankOrgans.testicles != 1>>
				|
				<<link "Prepare testicles">>
					<<run cashX(-5000, "incubator", $tanks[$i])>>
					<<set _newOrgan = {type: "testicles", weeksToCompletion: "10", ID: 0}>>
					<<set _newOrgan.ID = $tanks[$i].ID>>
					<<set $incubatorOrgans.push(_newOrgan)>>
					<<goto "Incubator">>
				<</link>>
			<</if>>
			<<if $tanks[$i].eyes == -2 && $tankOrgans.eyes != 1>>

$He appears to be blind:
				<<link "Prepare eyes">>
					<<run cashX(-10000, "incubator", $tanks[$i])>>
					<<set _newOrgan = {type: "eyes", weeksToCompletion: "10", ID: 0}>>
					<<set _newOrgan.ID = $tanks[$i].ID>>
					<<set $incubatorOrgans.push(_newOrgan)>>
					<<goto "Incubator">>
				<</link>>
			<</if>>
			<<if $tanks[$i].voice == 0 && $tankOrgans.voicebox != 1>>

It appears $he was born a mute:
				<<link "Prepare vocal cords">>
					<<run cashX(-5000, "incubator", $tanks[$i])>>
					<<set _newOrgan = {type: "voicebox", weeksToCompletion: "5", ID: 0}>>
					<<set _newOrgan.ID = $tanks[$i].ID>>
					<<set $incubatorOrgans.push(_newOrgan)>>
					<<goto "Incubator">>
				<</link>>
			<</if>>
		<</if>>
	<</capture>>
<</for>>
<</if>>

<<if $incubatorUpgradeWeight == 1>>
	<<if $incubatorWeightSetting == 1>>
		Weight is not being properly managed, saving costs but likely causing excessive weight gain. [[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 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 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>>

<<if $incubatorUpgradeGrowthStims == 1>>
	<<if $incubatorGrowthStimsSetting == 2>>
		$He is 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>>
		$He is injected with the recommended dosage of stimulants; $he will grow to $his full expected height. [[Overload|Incubator][$incubatorGrowthStimsSetting = 2]] | [[Disable|Incubator][$incubatorGrowthStimsSetting = 0]]
	<<elseif $incubatorGrowthStimsSetting == 0>>
		Growth stimulant injection systems are offline; $he will develop normally. [[Activate|Incubator][$incubatorGrowthStimsSetting = 1]]
	<</if>>
<</if>>

<<if $readySlaves == 1>>
	<<for $i = 0; $i < $incubatorSlaves; $i++>>
		<<if $tanks[$i].growTime <= 0>>
			<<set $incubatorOldID = $tanks[$i].ID>>
			<<set $readySlave = $tanks[$i]>>
			<<run $tanks.splice($i, 1)>>
			<<break>>
		<</if>>
	<</for>>
	<<goto "Incubator Retrieval Workaround">>
<</if>>

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


code:
:: Incubator Report [nobr]

<<set $incubatorSlaves = 0>>

<<for _inc = 0; _inc < $tanks.length; _inc++>>
	<<set $tanks[_inc].birthWeek += 1>>
	<<if $tanks[_inc].birthWeek >= 52>>
		<<set $tanks[_inc].birthWeek = 0>>
		<<if $seeAge == 1>>
			<<set $tanks[_inc].actualAge++, $tanks[_inc].ovaryAge++>>
		<</if>>
	<</if>>
	<<set $incubatorSlaves += 1>>
	<<if $tanks[_inc].growTime > 0>>
		<<set $tanks[_inc].growTime -= $incubatorUpgradeSpeed>>

@@.pink;<<print $tanks[_inc].slaveName>>'s@@ growth is currently being accelerated. $He <<if Math.round($tanks[_inc].growTime/$incubatorUpgradeSpeed) <= 0>>is @@.lime;ready for release.@@ $He will be ejected from $his tank upon your approach<<else>>will be ready for release in about <<print Math.round($tanks[_inc].growTime/$incubatorUpgradeSpeed)>> weeks<</if>>.
	<<else>>
		@@.pink;$tanks[_inc].slaveName@@ is @@.lime;ready for release.@@ $He will be ejected from $his tank upon your approach.
	<</if>>

	<<if $incubatorUpgradeWeight == 1>>

		<<if $incubatorWeightSetting == 1>>
			<<if $tanks[_inc].weight < 200>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight += 70>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight += 40>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight += 20>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight += 10>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight += 5>>
				<</if>>
			<</if>>
			The weight monitoring systems are overloading $his intake causing @@.red;rapid weight gain.@@
		<<elseif $incubatorWeightSetting == 2>>
			<<if $tanks[_inc].weight > 10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight -= 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight -= 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight -= 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight -= 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight -= 1>>
				<</if>>
				The weight monitoring systems detect $he is overweight and @@.green;decrease $his caloric intake.@@
			<<elseif $tanks[_inc].weight < -10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight += 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight += 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight += 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight += 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight += 1>>
				<</if>>
				The weight monitoring systems detect $he is underweight and @@.green;increase $his caloric intake.@@
			<<else>>
				$He is @@.lime;currently a healthy weight;@@ efforts will be made to maintain it.
			<</if>>
		<<elseif $incubatorWeightSetting == 0>>
			<<if $tanks[_inc].weight > -100>>
				$His developing body @@.red;quickly sheds its gained weight.@@
				<<set $tanks[_inc].weight -= 40>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].weight > -100>>
			$His developing body @@.red;quickly sheds its gained weight.@@
			<<set $tanks[_inc].weight -= 40>>
		<</if>>
	<</if>>

	<<if $incubatorUpgradeMuscles == 1>>

		<<if $incubatorMusclesSetting == 2>>
			<<if $tanks[_inc].muscles < 100>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles += 70>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles += 40>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles += 20>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles += 10>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles += 5>>
				<</if>>
			<</if>>
			The strength monitoring systems are overloading $him with steroids causing @@.green;rapid muscle development.@@
		<<elseif $incubatorMusclesSetting == 1>>
			<<if $tanks[_inc].muscles > 10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles -= 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles -= 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles -= 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles -= 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles-->>
				<</if>>
				The strength monitoring systems detect $he is overly muscular and @@.green;decrease $his steroid dosage.@@
			<<elseif $tanks[_inc].muscles < -10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles += 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles += 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles += 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles += 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles++>>
				<</if>>
				The strength monitoring systems detect $he is weak and @@.green;increase $his steroid dosage.@@
			<<else>>
				$He has @@.lime;a healthy musculature;@@ efforts will be made to maintain it.
			<</if>>
		<<elseif $incubatorMusclesSetting == 0>>
			<<if $tanks[_inc].muscles > -100>>
				$His developing body @@.red;quickly loses its gained muscle.@@
				<<set $tanks[_inc].muscles -= 40>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].muscles > -100>>
			$His developing body @@.red;quickly loses its gained muscle.@@
			<<set $tanks[_inc].muscles -= 40>>
		<</if>>
	<</if>>

	<<if $incubatorUpgradeGrowthStims == 1 && $incubatorGrowthStimsSetting != 0>>

		<<set _heightLimit = Math.trunc(Math.clamp((Height.mean($tanks[_inc]) * 1.25),0,274))>>
		<<set _heightLimitAge = Height.forAge($tanks[_inc].height, $tanks[_inc])>>
		<<if $tanks[_inc].geneMods.NCS == 1>>
			/*
			** NCS should block physical growth beyond that of a toddler, but some players might like
			** a little more or less. So using $minimumSlaveAge or 8, whichever is lesser.
			*/
			<<set _limitAge = Math.min(8, $minimumSlaveAge)>>
			<<set _heightLimitAge = Height.forAge($tanks[_inc].height, _limitAge, $tanks[_inc].genes)>>
			<<set _heightLimit = _heightLimitAge>>
		<</if>>
		<<if $tanks[_inc].height >= _heightLimit>>
			The monitoring system detects $his body is not able to support further increases in height, so it carefully regulates stimulant injections to @@.yellow;maintain $his current stature.@@
			<<set $tanks[_inc].height = _heightLimit>>
		<<elseif $incubatorGrowthStimsSetting == 2>>
			<<if $tanks[_inc].geneMods.NCS == 1>>
				The monitoring system floods $his body with growth stimulants, but $his @@.orange;NCS prevents an increase in $his growth rate.@@
				<<set $tanks[_inc].height = _heightLimitAge>>
			<<else>>
				The monitoring system floods $his body with growth stimulants, causing @@.green;a sharp increase in growth rate.@@
				<<if $incubatorWeightSetting >= 1 && $incubatorMusclesSetting <= 1 && $incubatorReproductionSetting <= 1>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(3,6)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(2,5)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(1,2)>>
					<</if>>
				<<else>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(2,5)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(1,2)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(0,1)>>
					<</if>>
				<</if>>
			<</if>>
		<<elseif $incubatorGrowthStimsSetting == 1>>
			<<if $tanks[_inc].geneMods.NCS == 1>>
				The monitoring system detects $he is near the expected height for $his @@.orange;NCS@@ condition, so it carefully regulates stimulants injections to @@.yellow;maintain $his current stature.@@
				<<set $tanks[_inc].height = _heightLimitAge>>
			<<elseif $tanks[_inc].height > _heightLimitAge>>
				The monitoring system detects $he is near the expected height, so it carefully regulates stimulants injections to @@.yellow;maintain $his current stature.@@
				<<if random(1,10) == 10>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,2)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(0,1)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(0,1)>>
					<</if>>
				<</if>>
			<<else>>
				The monitoring system detects $his body is capable of developing more rapidly and @@.green;increases $his growth stimulant dosage.@@
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].height += random(1,4)>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].height += random(1,3)>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].height += random(1,2)>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].height += random(0,1)>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].height += random(0,1)>>
				<</if>>
			<</if>>
		<</if>>
		<<set $tanks[_inc].height = Math.clamp($tanks[_inc].height, 0, _heightLimit)>>
	<<else>>

		With the growth stimulant injections offline, $his body is left to develop naturally.
	<</if>>

	<<if $incubatorUpgradeReproduction == 1>>

		<<if $incubatorReproductionSetting == 2>>
			$His developing body is being flooded with hormones.
			<<if $incubatorWeightSetting == 1>>
				Combined with the abundant food provided to $him, $his body grows rapidly.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(25,45)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(3,8)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 2000>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips += 2>>
						<</if>>
						<<if $tanks[_inc].butt < 12 && random(1,100) > 30>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 4>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 500>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 60>>
							The excess estrogen-laced growth hormones @@.green;causes $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear grow fatter.@@
							<<set $tanks[_inc].butt += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12 && random(1,100) > 60>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 40>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 16>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 4>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 9>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 4>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<<elseif $incubatorWeightSetting == 2>>
				Combined with the healthy food provided to $him, $his body grows readily.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(15,25)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(2,6)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 1000>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 500>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8 && random(1,100) > 60>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 3>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<<else>>
				Since $his body has little to work with, $his growth is fairly minor.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(10,15)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(2,4)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 700>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips += 2>>
						<</if>>
						<<if $tanks[_inc].butt < 6 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 50>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly grow $his breasts.@@
							<<set $tanks[_inc].boobs += 20>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly grow $his breasts.@@
							<<set $tanks[_inc].boobs += 10>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 6>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 90>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<</if>>
		<<elseif $incubatorReproductionSetting == 1>>
			$His hormone levels are being carefully managed, @@.green;encouraging early puberty.@@
			<<if $tanks[_inc].ovaries == 1>>
				<<set $tanks[_inc].pubertyXX = 1>>
				<<set $tanks[_inc].hormoneBalance = 250>>
				<<if $tanks[_inc].geneMods.NCS == 1>>
					/* NCS blocks hormonal growth of all secondary sexual characteristics */
					$His @@.orange;NCS blocks growth@@ despite the added estrogen.
				<<else>>
					<<if $tanks[_inc].boobs < 400 && random(1,100) > 60>>
						The added estrogen @@.green;causes $his breasts to swell.@@
						<<set $tanks[_inc].boobs += 50>>
					<</if>>
					<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
						The added estrogen @@.green;causes $his hips to widen.@@
						<<set $tanks[_inc].hips++>>
					<</if>>
					<<if $tanks[_inc].butt < 5 && random(1,100) > 80>>
						The added estrogen @@.green;causes $his butt to grow.@@
						<<set $tanks[_inc].butt++>>
					<</if>>
				<</if>>
			<<elseif $tanks[_inc].balls > 0>>
				<<set $tanks[_inc].pubertyXY = 1>>
				<<set $tanks[_inc].hormoneBalance = -250>>
				<<if $tanks[_inc].geneMods.NCS == 1>>
					/* NCS blocks hormonal growth of all secondary sexual characteristics */
					$His @@.orange;NCS blocks all growth@@ despite the added testosterone.
				<<else>>
					<<if $tanks[_inc].balls < 3 && random(1,100) > 80>>
						The added testosterone @@.green;causes $his balls to swell.@@
						<<set $tanks[_inc].balls++>>
					<</if>>
					<<if $tanks[_inc].dick < 3 && random(1,100) > 60>>
						The added testosterone @@.green;causes $his penis to grow.@@
						<<set $tanks[_inc].dick++>>
					<</if>>
				<</if>>
			<</if>>
		<<else>>
			<<if $tanks[_inc].hormoneBalance > 100>>
				<<set $tanks[_inc].hormoneBalance -= 50>>
			<<elseif $tanks[_inc].hormoneBalance < -100>>
				<<set $tanks[_inc].hormoneBalance += 50>>
			<</if>>
			<<if $tanks[_inc].balls > 0>>
				<<if $tanks[_inc].balls > 1>>
					<<set $tanks[_inc].balls -= 5>>
				<</if>>
				<<if $tanks[_inc].dick > 1>>
					<<set $tanks[_inc].dick -= 5>>
				<</if>>
				<<if $tanks[_inc].balls <= 0>>
					<<set $tanks[_inc].balls = 1>>
				<</if>>
				<<if $tanks[_inc].dick <= 0>>
					<<set $tanks[_inc].dick = 1>>
				<</if>>
			<</if>>
			<<if $tanks[_inc].boobs > 0>>
				<<set $tanks[_inc].boobs -= 500>>
			<</if>>
			<<if $tanks[_inc].butt > 0>>
				<<set $tanks[_inc].butt -= 4>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].hormoneBalance > 100>>
			<<set $tanks[_inc].hormoneBalance -= 50>>
		<<elseif $tanks[_inc].hormoneBalance < -100>>
			<<set $tanks[_inc].hormoneBalance += 50>>
		<</if>>
		<<if $tanks[_inc].balls > 0>>
			<<if $tanks[_inc].balls > 1>>
				<<set $tanks[_inc].balls -= 5>>
			<</if>>
			<<if $tanks[_inc].dick > 1>>
				<<set $tanks[_inc].dick -= 5>>
			<</if>>
			<<if $tanks[_inc].balls <= 0>>
				<<set $tanks[_inc].balls = 1>>
			<</if>>
			<<if $tanks[_inc].dick <= 0>>
				<<set $tanks[_inc].dick = 1>>
			<</if>>
		<</if>>
		<<if $tanks[_inc].boobs > 0>>
			<<set $tanks[_inc].boobs -= 500>>
		<</if>>
		<<if $tanks[_inc].butt > 0>>
			<<set $tanks[_inc].butt -= 4>>
		<</if>>
	<</if>>

	<<if $incubatorReproductionSetting == 2>>
		<<set $tanks[_inc].energy = 80, $tanks[_inc].need = 100>>
	<<elseif $incubatorReproductionSetting == 1>>
		<<set $tanks[_inc].energy = 50, $tanks[_inc].need = 20>>
	<<else>>
		<<set $tanks[_inc].energy = 0, $tanks[_inc].need = 0>>
	<</if>>

	<<set $tanks[_inc].weight = Math.clamp($tanks[_inc].weight, -100, 200)>>
	<<set $tanks[_inc].muscles = Math.clamp($tanks[_inc].muscles, -100, 100)>>
	<<set $tanks[_inc].dick = Math.clamp($tanks[_inc].dick, 0, 10)>>
	<<set $tanks[_inc].hips = Math.clamp($tanks[_inc].hips, -2, 2)>>
	<<set $tanks[_inc].balls = Math.clamp($tanks[_inc].balls, 0, 40)>>
	<<set $tanks[_inc].boobs = Math.clamp($tanks[_inc].boobs, 0, 30000)>>
	<<set $tanks[_inc].height = Math.clamp($tanks[_inc].height, 0, 274)>>
	<<set $tanks[_inc].hormoneBalance = Math.clamp($tanks[_inc].hormoneBalance, -500, 500)>>

<</for>>
/*
<<if $incubatorSlaves == 0>>
$incubatorNameCaps is currently unused.
<</if>>
*/


code:
:: Incubator Retrieval Workaround [nobr]

<<setLocalPronouns $readySlave>>
$readySlave.slaveName has been discharged from $incubatorName and is ready for $his first ever inspection.

<<set $activeSlave = $readySlave>>
<<set $saleDescription = 0, $applyLaw = 0>>
<<set $incubatorSlaves-->>
<<include "Long Slave Description">>
<<run newSlave($activeSlave)>>
<<set $nextLink = "AS Dump">>
<<set $returnTo = "Main">>
<<if $incubatorOrgans.length > 0>>
	<<for _i = 0; _i < $incubatorOrgans.length; _i++>>
		<<if $incubatorOrgans[_i].ID == $incubatorOldID>>
			<<set _newOrgan = {type: $incubatorOrgans[_i].type, weeksToCompletion: $incubatorOrgans[_i].weeksToCompletion, ID: $activeSlave.ID}>>
			<<if _newOrgan.weeksToCompletion <= 0>>
				<<set $completedOrgans.push($incubatorOrgans[_i])>>
			<<else>>
				<<set $organs.push(_newOrgan)>>
			<</if>>
			<<set $incubatorOrgans.deleteAt(_i), _i-->>
		<</if>>
	<</for>>
<</if>>
<<include "New Child Intro">>


code:
:: Incubator Workaround [nobr]

<<if $tanks.length < $incubator>>
	<<set $activeSlave.growTime = Math.trunc($targetAge*52)>>
	<<set $tanks.push($activeSlave)>>
	<<set $incubatorSlaves++>>
<</if>>


code:
:: KillSlave [nobr]

<<set _qualifiedFS = []>>
<<if $arcologies[0].FSRomanRevivalist != "unset">>
	<<set _qualifiedFS.push("roman revivalist"), _weapon = 'gladius'>>
<<elseif $arcologies[0].FSAztecRevivalist != "unset">>
	<<set _qualifiedFS.push("aztec revivalist"), _weapon = 'Tecpatl'>>
<<elseif $arcologies[0].FSEgyptianRevivalist != "unset">>
	<<set _qualifiedFS.push("egyptian revivalist"), _weapon = 'kopesh'>>
<<elseif $arcologies[0].FSEdoRevivalist != "unset">>
	<<set _qualifiedFS.push("edo revivalist"), _weapon = 'katana'>>
<<elseif $arcologies[0].FSArabianRevivalist != "unset">>
	<<set _qualifiedFS.push("arabian revivalist"), _weapon = 'scimitar'>>
<<elseif $arcologies[0].FSChineseRevivalist != "unset">>
	<<set _qualifiedFS.push("chinese revivalist"), _weapon = 'jian'>>
<</if>>

<<if _qualifiedFS.length < 1>>
	<<set _weapon = 'handgun'>>
<</if>>

<<if canWalk($activeSlave)>>
	You call $activeSlave.slaveName into your office.
<<else>>
	You have $activeSlave.slaveName brought into your office.
<</if>>

	$He looks at you
<<if $activeSlave.fetish != "mindbroken">>with
	<<if $activeSlave.devotion > 50>>
		adoration
	<<elseif ($activeSlave.devotion) > 20 && ($activeSlave.devotion <= 50)>>
		a calm acceptance
	<<elseif ($activeSlave.devotion >= -20) && ($activeSlave.devotion <= 20)>>
		apprehension
	<<elseif $activeSlave.devotion < -20>>
		hatred
	<</if>>
<<else>>
	blankly
<</if>>
 and waits for you to continue. You tell $him that you've gotten tired of having $him around and that you have decided it is time you got rid of $him.

<<if $activeSlave.fetish != "mindbroken">> $His expression changes to one of <</if>>
<<if $activeSlave.fetish != "mindbroken">>
	<<if $activeSlave.devotion > 50>>
		pure sorrow
	<<elseif ($activeSlave.devotion) > 20 && ($activeSlave.devotion <= 50)>>
		sadness
	<<else>>
		relief
	<</if>>
	until
<<else>>
	$He just nods dumbly and continues to watch you with a vacant expression, even as
<</if>>

 you reach behind your desk and pull out your trusty _weapon,

<<if $activeSlave.fetish != "mindbroken">>
	at which point abject fear fills $his face. $He immediately <<if canWalk($activeSlave)>>drops to $his knees and <</if>>begins openly begging for you to have mercy.
<<else>>
	to which $he still doesn't respond.
<</if>>

<<if $killChoice == -1>>

<<link "Kill $him" "KilledSlave">><<set $killChoice = 0>><</link>>

<<link "Have mercy on $him" "KilledSlave">><<set $killChoice = 1>><</link>>
	<<if ($activeSlave.assignment != "guard you") && ($pit > 0)>>
		<<if ($pitLethal == 1)>>

<<link "Let $him win $his life in combat" "KilledSlave">><<set $killChoice = 2>><</link>>
		<<else>>

//You must allow lethal fights in $pitName to have $activeSlave.slaveName fight your bodyguard for $his life//
		<</if>>
	<</if>>

<<else>>
	You abruptly cut $his begging short as you realize $slaveFightingBG.slaveName is already fighting your bodyguard $Bodyguard.slaveName for $his life this week. [[Cancel the fight|KillSlave][$killChoice = -1]]
<</if>>


code:
:: KilledSlave [nobr]

<<if $killChoice <= 0>>
<<setLocalPronouns $Bodyguard 2>>

<<set _qualifiedFS = []>>
<<if $arcologies[0].FSRomanRevivalist != "unset">>
	<<set _qualifiedFS.push("roman revivalist"), _weapon = 'gladius'>>
<<elseif $arcologies[0].FSAztecRevivalist != "unset">>
	<<set _qualifiedFS.push("aztec revivalist"), _weapon = 'Tecpatl'>>
<<elseif $arcologies[0].FSEgyptianRevivalist != "unset">>
	<<set _qualifiedFS.push("egyptian revivalist"), _weapon = 'kopesh'>>
<<elseif $arcologies[0].FSEdoRevivalist != "unset">>
	<<set _qualifiedFS.push("edo revivalist"), _weapon = 'katana'>>
<<elseif $arcologies[0].FSArabianRevivalist != "unset">>
	<<set _qualifiedFS.push("arabian revivalist"), _weapon = 'scimitar'>>
<<elseif $arcologies[0].FSChineseRevivalist != "unset">>
	<<set _qualifiedFS.push("chinese revivalist"), _weapon = 'jian'>>
<</if>>

You simply smile at $him and tell $him not to worry as you continue

<<if _qualifiedFS.length > 0>>
	sharpening your _weapon.
<<else>>
	threading on a suppressor.
<</if>>

$activeSlave.slaveName gives an audible sigh of relief and begins to thank you profusely, though $his thanks are cut short as the sound of

<<if _qualifiedFS.length > 0>>
	a sharp edge slicing though flesh
<<else>>
	a suppressed gunshot
<</if>>

	rings through the room. You have another servant clean up the mess as you continue with what you were previously doing.

	<<if $familyTesting == 1>>
			<<for _ss = 0; _ss < $slaves.length; _ss++>>
				<<if $activeSlave.mother == $slaves[_ss].ID>>
					$slaves[_ss].slaveName is @@.mediumorchid;grieved@@ that you have killed $his daughter.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 30>>
				<</if>>
				<<if $activeSlave.father == $slaves[_ss].ID>>
					$slaves[_ss].slaveName is @@.mediumorchid;disappointed@@ that you have killed $his daughter.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 20>>
				<</if>>
				<<if $activeSlave.ID == $slaves[_ss].father>>
					$slaves[_ss].slaveName is @@.mediumorchid;saddened@@ that you have killed $his father.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 20>>
				<</if>>
				<<if $activeSlave.ID == $slaves[_ss].mother>>
					$slaves[_ss].slaveName is @@.mediumorchid;grieved@@ that you have killed $his mother.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 30>>
				<</if>>
				<<switch areSisters($activeSlave, $slaves[_ss])>>
				<<case 1>>
					$slaves[_ss].slaveName is @@.mediumorchid;devastated@@ that you have killed $his twin.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 30>>
				<<case 2>>
					$slaves[_ss].slaveName is @@.mediumorchid;grieved@@ that you have killed $his sister.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 30>>
				<<case 3>>
					$slaves[_ss].slaveName is @@.mediumorchid;disheartened@@ that you have killed $his half-sister.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 20>>
				<</switch>>
			<</for>>
		<<else>>
			<<if $activeSlave.relation != 0>>
				<<set _ss = $slaveIndices[$activeSlave.relationTarget]>>
				<<if def _ss && $slaves[_ss].fetish != "mindbroken">>
					$slaves[_ss].slaveName is @@.mediumorchid;grieved@@ that you have killed $his $activeSlave.relation.
					<<run clearSummaryCache($slaves[_ss])>>

					<<set $slaves[_ss].devotion -= 30>>
					<<set $display = 1>>
				<</if>>
			<</if>>
		<</if>>
		<<if $activeSlave.relationship > 0>>
			<<set _ss = $slaveIndices[$activeSlave.relationshipTarget]>>
			<<if def _ss && $slaves[_ss].fetish != "mindbroken">>
				$slaves[_ss].slaveName is @@.mediumorchid;grieved@@ that you have killed $his best source of comfort and companionship in a life of bondage.
				<<run clearSummaryCache($slaves[_ss])>>

				<<set $slaves[_ss].devotion -= $slaves[_ss].relationship*10>>
				<<set $display = 1>>
			<</if>>
		<<elseif $activeSlave.relationship == -3>>
			Killing one of your slave wives is @@.red;socially unacceptable.@@ In addition, your other devoted slaves are @@.gold;worried@@ that you may not respect their status.
			<<run clearSummaryCache()>>

			<<set $rep -= 200>>
			<<set $display = 1>>
			<<for _ss = 0; _ss < $slaves.length; _ss++>>
				<<if $slaves[_ss].devotion > 50>>
					<<set $slaves[_ss].trust -= 10>>
				<</if>>
			<</for>>
		<</if>>
		<<if $activeSlave.rivalry != 0>>
			<<set _ss = $slaveIndices[$activeSlave.rivalryTarget]>>
			<<if def _ss && $slaves[_ss].fetish != "mindbroken">>
				$slaves[_ss].slaveName is @@.hotpink;pleased@@ that $he won't have to see $his rival any more.
				<<run clearSummaryCache($slaves[_ss])>>

				<<set $slaves[_ss].devotion += $slaves[_ss].rivalry*3>>
				<<set $display = 1>>
			<</if>>
		<</if>>

		<<include "Remove activeSlave">>
		<<set $nextLink = "AS Dump">>

/* TODO: this will DEFINTELY need balancing */
<<elseif $killChoice == 1>>
	    You make a show of considering sparing $his life, then, with a heavy sigh, unbuckle your pants and sit down at your desk. You beckon to $him, and $he just about trips over $himself as $he hastily makes $his way over to you. $His blowjob isn't the best you've ever had, $him @@.gold;sobbing@@ as much as $he is; but $his enthusiasm more than makes up for it. After you finish deep in $his throat, $he sits back and wipes away $his tears, sniffling and @@.hotpink;thanking you again@@ for giving $him another chance.
	<<if $activeSlave.devotion <= 30>>
		<<set $activeSlave.devotion = 30>>
	<<else>>
		<<set $activeSlave.devotion += 20>>
	<</if>>
	<<set $activeSlave.trust = -100>>

<<elseif $killChoice == 2>>
	You tell $him that you'll let your bodyguard $Bodyguard.slaveName decide $his fate — if $he wants to live, $he'll have to beat _him2 in hand-to-hand combat in $pitName.
	<<if $activeSlave.combatSkill == 0>>
		The fear on $his face is palpable, though $he nods slowly and agrees, not seeing another choice.
	<<else>>
		$He nods $his head and straightens up, as though mentally preparing $himself for the fight for $his life.
	<</if>>

	<<set $slaveFightingBG = $activeSlave, $pitAnimal = 0>>
<</if>>