:: Nursery [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Nursery", $showEncyclopedia = 1, $encyclopedia = "Nursery", $nurserySlaves = $NurseryiIDs.length, $Flag = 0>>
<<set $targetAgeNursery = Number($targetAgeNursery) || $minimumSlaveAge>>
<<set $targetAgeNursery = Math.clamp($targetAgeNursery, $minimumSlaveAge, 42)>>

<<if $nurseryName != "the Nursery">>
	<<set $nurseryNameCaps = $nurseryName.replace("the ", "The ")>>
<</if>>

<<set $nurseryBabies = $cribs.length, $freeCribs = $nursery - $nurseryBabies, _SL = $slaves.length, _eligibility = 0>>

<<nurseryAssignmentFilter>>
$nurseryNameCaps
<<switch $nurseryDecoration>>
<<case "Roman Revivalist">>
    is run with the Roman dream in mind, with wide open windows exposing the babies to the elements. The sleek marble halls bring a sense of serenity and duty as wet nurses wander the halls.
<<case "Aztec Revivalist">>
    is lined head to toe in illustrious Aztec gold. Tiny but notable subscripts lay in plaques to honor the mothers who died giving birth, the children of said mothers, alive or dead, are tirelessly watched over to tend to their every need.
<<case "Egyptian Revivalist">>
    is decorated by sleek, sandstone tablets, golden statues, and even grander Egyptian wall sculptures, many of them depicting the conception, birth, and raising of a child. Each babe is reverently wrapped in linen covers as they drift to sleep to the stories of mighty pharaohs and prosperous palaces.
<<case "Edo Revivalist">>
    is minimalistic in nature, but the errant paintings of cherry blossoms and vibrant Japanese maples give a certain peaceful air as the caretakers do their duties.
<<case "Arabian Revivalist">>
    is decorated wall to wall with splendorous carvings and religious Hamsas meant to protect the fostering children.
<<case "Chinese Revivalist">>
    is ripe with Chinese spirit. Depictions of colorful dragons and oriental designs grace the halls, rooms, and cribs of the babies who reside inside.
<<case "Chattel Religionist">>
    is decorated with childish religious cartoons and artistic tapestries of slaves bowing in submission, their themes always subsiding varying degrees of sexual worship. The caretakers that wander the halls obediently wear their habits, and never waste a moment to tenderly lull the children to sleep with stories of their prophet.
<<case "Degradationist">>
    is bare and sullen. The cries of the neglected children destined for slavery trying to find comfort in their burlap coverings echo the halls, while those that await freedom are raised among luxury and are taught to look down on their less fortunate peers.
<<case "Repopulation Focus">>
    is designed to be very open and public; a showing testament to your arcology's repopulation efforts. For those old enough to support them, they are strapped with big, but body warming, empathy bellies as to remind them of their destiny.
<<case "Eugenics">>
    is of utmost quality without a single pleasantry missing -- if the parents are of the elite blood of course. While there are rare stragglers of unworthy genes, the child populace overall is pampered with warm rooms and plentiful small toys.
<<case "Asset Expansionist">>
    is not so much decorated as it is intelligently staffed. Every passerby, slave or not, burns the image of their jiggling asses and huge, wobbling tits into the minds of the children.
<<case "Transformation Fetishist">>
    is kept simple and clean. From their toys down to the nursemaids, the babies are exposed to the wonders of body transformation whenever possible.
<<case "Gender Radicalist">>
    is decorated by cheery cartoon depictions of slaves of many shapes, sizes, and genitals, all of them undeniably feminine. The elated smiles and yips of the nurses getting reamed constantly instill the appreciation of nice, pliable buttholes.
<<case "Gender Fundamentalist">>
    is simply designed and painted with soft feminine colors. The staff heavily encourage the children to play dress up and house, subtly sculpting their minds to proper gender norms and properly put them in line if they try to do otherwise.
<<case "Physical Idealist">>
    is furnished with kiddy health books and posters; their caretakers making painstakingly sure that the importance is drilled into their heads at a young age. Their food is often littered with vitamins and supplements to keep the children growing strong.
<<case "Supremacist">>
    is designed and structured to give those of $arcologies[0].FSSupremacistRace ethnicity the limelight of the nursery, while the others stay sectioned off and neglected to the world.
<<case "Subjugationist">>
    is made to foster and raise the young children of $arcologies[0].FSSubjugationistRace ethnicity. They are reminded of their place with every failure and are encouraged to submissively follow their stereotypes at a young ripe age.
<<case "Paternalist">>
    is well-stocked and by Paternalistic customs, constantly swaddle the children with love and attention. With the warm colors and sound of child laughter, to the untrained eye, the children actually seem free.
<<case "Pastoralist">>
    is decorated to make the children grow up thinking that a life focused on breast milk, cum, and other human secretions are part of the norm. The milky tits swaying above their cow-patterned cribs certainly help with that.
<<case "Maturity Preferentialist">>
    decorations remind the kids to respect those curvy and mature. The older nurserymaids are always flattered whenever the children try to act like adults and take care of the younger toddlers for them.
<<case "Youth Preferentialist">>
    is making young children the center of attention, their rooms supplied with plenty of toys, blankets, and surrogate mothers at their beck and call.
<<case "Body Purist">>
    is decorated to be very clean cut and sterilized with perfect corners and curves; symbolic of the human figure. Nurserymaids are encouraged to show off their natural assets to show the children what the appropriate body should be.
<<case "Slimness Enthusiast">>
    constantly encourages the kids to try and keep their slim and cute physiques. They are given perfectly metered meals to make this possible.
<<case "Hedonistic">>
    would make any toddler drool in amazement. Meals and naps every other hour, cribs stalked with toys and blankets, and plush slaves carry them to and fro without preamble. A delicious layer of baby fat is the ideal figure of a baby, and they couldn't be happier.
<<default>>
    is as comfortable and child-friendly as it needs to be. They have everything they need to grow into a proper slave.
<</switch>>

<<if $nurserySlaves > 2>>
	$nurseryNameCaps is bustling with activity. Nannies are busily moving about, feeding babies and changing diapers.
<<elseif $nurserySlaves > 0>>
	$nurseryNameCaps is working steadily. Nannies are moving about, cleaning up and feeding hungry children.
<<elseif $Matron != 0>>
	$Matron.slaveName is alone in $nurseryName, and has nothing to do but keep the place clean and look after the children.
<<else>>
	$nurseryNameCaps is empty and quiet. <<link "Decommission the Nursery" "Main">><<set $nursery = 0, $nurseryNannies = 0, $nurseryDecoration = "standard", $cribs = [], $reservedChildrenNursery = 0>><<for _i = 0; _i < $slaves.length; _i++>><<set $slaves[_i].reservedChildrenNursery = 0>><</for>><</link>>
<</if>>

<<if $nurserySlaves > 0>>
	<<if $Matron != 0>><<set _X = 1>><<else>><<set _X = 0>><</if>>
	<<set _NewPop = $nurserySlaves+$dormitoryPopulation+_X>>
	<<link "Remove all slaves" "Nursery">>
		<<if $Matron != 0>>
			<<= assignJob($Matron, "rest")>>
		<</if>>
		<<for $nurserySlaves > 0>>
			<<= assignJob($slaves[$slaveIndices[$NurseryiIDs[0]]], "rest")>>
		<</for>>
	<</link>>
	<<if _NewPop > $dormitory>>
		@@.red;Dormitory capacity will be exceeded.@@
	<</if>>
<</if>>

<br>It can support $nurseryNannies nannies. Currently there <<if $nurserySlaves == 1>>is<<else>>are<</if>> $nurserySlaves nann<<if $nurserySlaves != 1>>ies<<else>>y<</if>> at $nurseryName. 
<<if $nurseryNannies < 5>>
	[[Expand the nursery|Nursery][$cash -= 1000*$upgradeMultiplierArcology, $nurseryNannies += 1]] //Costs <<print cashFormat(1000*$upgradeMultiplierArcology)>>//
<<else>>
	//$nurseryNameCaps can support a maximum of 5 slaves//
<</if>>

<br><br>
<<if $Matron != 0>>
	<<set $Flag = 2>>
	<<include "Slave Summary">>
<<else>>
	You do not have a slave serving as a Matron. [[Appoint one|Matron Select]]
<</if>>

<br><br>
<<if ($nurseryNannies <= $nurserySlaves)>>
	''$nurseryNameCaps is full and cannot hold any more slaves''
<<elseif ($slaves.length > $nurserySlaves)>>
	<<link "''Send a slave to $nurseryName''">>
		<<replace #ComingGoing>>
			<<resetAssignmentFilter>>
			<<set $Flag = 0>>
			<<include "Slave Summary">>
		<</replace>>
	<</link>>
<</if>>

<<if $nurserySlaves > 0>>
	| <<link "''Bring a slave out of $nurseryName''">>
		<<replace #ComingGoing>>
			<<nurseryAssignmentFilter>>
			<<set $Flag = 1>>
			<<include "Slave Summary">>
			<<resetAssignmentFilter>>
		<</replace>>
	<</link>>
<<else>>
	<br><br>//$nurseryNameCaps is empty for the moment.<br>//
<</if>>

<br><br>
<<assignmentFilter >>
<span id="ComingGoing">
	<<nurseryAssignmentFilter>>
	<<set $Flag = 1>>
	<<include "Slave Summary">>
	<<resetAssignmentFilter>>
</span><br>

<br>It can support $nursery child<<if $nursery > 1>>ren<</if>>. Currently $nurseryBabies rooms are in use.
<<if $nursery < 50>>
	[[Add another room|Nursery][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $nursery += 5]] //Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
	<<if $freeCribs == 0>>
		All of the rooms are currently occupied by growing children.
	<</if>>
<<else>>
	//$nurseryNameCaps can support a maximum of 50 children//
<</if>>
	<<if $nursery > 1 && $reservedChildrenNursery < $freeCribs>>
		[[Remove a room|Nursery][$cash -= Math.trunc(1000*$upgradeMultiplierArcology), $nursery -= 5]] //Costs <<print cashFormat(Math.trunc(1000*$upgradeMultiplierArcology))>> and will reduce upkeep costs//
	<</if>>

<<if $nurseryBabies > 0>>	/* not really sure what the best way to add in a window for the children would be */
<br><br>''Children in $nurseryName''
<</if>>

<br><br>
Reserve an eligible mother-to-be's child to be placed in a room upon birth. Of $nursery rooms, <<print $freeCribs>> <<if $freeCribs == 1>>is<<else>>are<</if>> unoccupied. Of those, $reservedChildrenNursery room<<if $reservedChildrenNursery == 1>> is<<else>>s are<</if>> reserved.

<<if (0 < _SL)>>
		<<set $sortNurseryList = $sortNurseryList || 'Unsorted'>>
		<br/>//Sorting:// ''<span id="qlNurserySort">$sortNurseryList</span>.''
		<<link "Sort by Name">>
				<<set $sortNurseryList = 'Name'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<<script>>
						sortNurseryPossiblesByName();
				<</script>>
		<</link>> |
		<<link "Sort by Reserved Nursery Spots">>
				<<set $sortNurseryList = 'Reserved Nursery Spots'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<<script>>
						sortNurseryPossiblesByReservedSpots();
				<</script>>
		<</link>> |
		<<link "Sort by Pregnancy Week">>
				<<set $sortNurseryList = 'Pregnancy Week'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<<script>>
						sortNurseryPossiblesByPregnancyWeek();
				<</script>>
		<</link>> |
		<<link "Sort by Number of Children">>
				<<set $sortNurseryList = 'Number of Children'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<<script>>
						sortNurseryPossiblesByPregnancyCount();
				<</script>>
		<</link>>
		<br/>
<</if>>
<div id="qlNursery">
<<for _u = 0; _u < _SL; _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 _pregCount = $slaves[_u].pregType>>
		<<set _reservedSpots = $slaves[_u].reservedChildrenNursery>>
		<<set _pregWeek = $slaves[_u].pregWeek>>
		<<set _slaveName = getSlaveDisplayName($slaves[_u])>>
		<div class="possible" @id="_slaveId" @data-preg-count="_pregCount" @data-reserved-spots="_reservedSpots" @data-preg-week="_pregWeek" @data-name="_slaveName">
		<<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 $slaves[_u].pregType > 1>>$slaves[_u].pregType babies<<else>>baby<</if>>.
		<<if $slaves[_u].reservedChildrenNursery > 0>>
			<<set _childrenReservedNursery = 1>>
			<<if $slaves[_u].pregType == 1>>
				Her child will be placed in $nurseryName.
			<<elseif $slaves[_u].reservedChildrenNursery < $slaves[_u].pregType>>
				$slaves[_u].reservedChildrenNursery of her children will be placed in $nurseryName.
			<<elseif $slaves[_u].pregType == 2>>
				Both of her children will be placed in $nurseryName.
			<<else>>
				All $slaves[_u].reservedChildrenNursery of her children will be placed in $nurseryName.
			<</if>>
			<<if ($slaves[_u].reservedChildren + $slaves[_u].reservedChildrenNursery < $slaves[_u].pregType)  && ($reservedChildrenNursery < $freeCribs)>>
				<br>&nbsp;&nbsp;&nbsp;&nbsp;
				<<print "[[Keep another child|Nursery][$slaves[" + _u + "].reservedChildrenNursery += 1, $reservedChildrenNursery += 1]]">>
				<<if $slaves[_u].reservedChildrenNursery > 0>>
					| <<print "[[Keep one less child|Nursery][$slaves[" + _u + "].reservedChildrenNursery -= 1, $reservedChildrenNursery -= 1]]">>
				<</if>>
				<<if $slaves[_u].reservedChildrenNursery > 1>>
					| <<print "[[Keep none of her children|Nursery][$reservedChildrenNursery -= $slaves[" + _u + "].reservedChildrenNursery, $slaves[" + _u + "].reservedChildrenNursery = 0]]">>
				<</if>>
				<<if ($reservedChildrenNursery + $slaves[_u].pregType - $slaves[_u].reservedChildrenNursery) <= $freeCribs>>
					| <<print "[[Keep the rest of her children|Nursery][$reservedChildrenNursery += ($slaves[" + _u + "].pregType - $slaves[" + _u + "].reservedChildrenNursery), $slaves[" + _u + "].reservedChildrenNursery = $slaves[" + _u + "].pregType, $slaves[" + _u + "].reservedChildren = 0]]">>
				<</if>>
			<<elseif ($slaves[_u].reservedChildrenNursery == $slaves[_u].pregType) || ($reservedChildrenNursery == $freeCribs) || ($slaves[_u].reservedChildren + $slaves[_u].reservedChildrenNursery == $slaves[_u].pregType)>>
				<br>&nbsp;&nbsp;&nbsp;&nbsp;
				<<print "[[Keep one less child|Nursery][$slaves[" + _u + "].reservedChildrenNursery -= 1, $reservedChildrenNursery -= 1]]">>
				<<if $slaves[_u].reservedChildrenNursery > 1>>
					| <<print "[[Keep none of her children|Nursery][$reservedChildrenNursery -= $slaves[" + _u + "].reservedChildrenNursery, $slaves[" + _u + "].reservedChildrenNursery = 0]]">>
				<</if>>
			<</if>>
		<<elseif $reservedChildrenNursery < $freeCribs>>
			<<if $slaves[_u].pregType - $slaves[_u].reservedChildren == 0>>
				//$His children are already reserved for $incubatorName//
				<br>&nbsp;&nbsp;&nbsp;&nbsp;
				<<print "[[Keep " + $his + " " + (($slaves[_u].pregType > 1) ? "children" : "child") + " here instead|Nursery][$slaves[" + _u + "].reservedChildrenNursery += $slaves[" + _u + "].pregType, $slaves[" + _u + "].reservedChildren = 0]]">>
			<<else>>
				You have <<if $freeCribs == 1>>an<</if>> @@.lime;available room<<if $freeCribs > 1>>s<</if>>.@@
				<br>&nbsp;&nbsp;&nbsp;&nbsp;
				<<print "[[Keep "+ (($slaves[_u].pregType > 1) ? "a" : "the") + " child|Nursery][$slaves[" + _u + "].reservedChildrenNursery += 1, $reservedChildrenNursery += 1]]">>
				<<if ($slaves[_u].pregType > 1) && ($reservedChildrenNursery + $slaves[_u].pregType - $slaves[_u].reservedChildrenNursery) <= $freeCribs>>
					| <<print "[[Keep all of " + $his + " children|Nursery][$reservedChildrenNursery += $slaves["+ _u + "].pregType, $slaves[" + _u + "].reservedChildrenNursery += $slaves["+ _u +"].pregType, $slaves[" + _u + "].reservedChildren = 0]]">>
				<</if>>
			<</if>>
		<<elseif $reservedChildrenNursery == $freeCribs>>
			<br>&nbsp;&nbsp;&nbsp;&nbsp;
			You have @@.red;no room for her offspring.@@
		<</if>>
		<<set _eligibility = 1>>
		</div>
	<</if>>
	<</if>>
<</for>>
</div>
<<script>>
		$('div#qlNursery').ready(sortNurseryPossiblesByPreviousSort);
<</script>>
<<if _eligibility == 0>>
	<br>
	//You have no pregnant slaves bearing eligible children.//
<</if>>
<<if $PC.pregKnown == 1 && $PC.pregSource != -1>>
	<br>''@@.pink;You're pregnant@@'' and going to have
		<<switch $PC.pregType>>
		<<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 $PC.reservedChildrenNursery > 0>>
		<<set _childrenReservedNursery = 1>>
		<<if $PC.pregType == 1>>
			Your child will be placed in $nurseryName.
		<<elseif $PC.reservedChildrenNursery < $PC.pregType>>
			$PC.reservedChildrenNursery of your children will be placed in $nurseryName.
		<<elseif $PC.pregType == 2>>
			Both of your children will be placed in $nurseryName.
		<<else>>
			All $PC.reservedChildrenNursery of your children will be placed in $nurseryName.
		<</if>>
		<<if ($PC.reservedChildrenNursery < $PC.pregType) && ($reservedChildrenNursery < $freeCribs) && ($PC.reservedChildrenNursery - $PC.reservedChildren > 0)>>
			<br>&nbsp;&nbsp;&nbsp;&nbsp;
			<<print "[[Keep another child|Nursery][$PC.reservedChildrenNursery += 1, $reservedChildrenNursery += 1]]">>
			<<if $PC.reservedChildrenNursery > 0>>
				| <<print "[[Keep one less child|Nursery][$PC.reservedChildrenNursery -= 1, $reservedChildrenNursery -= 1]]">>
			<</if>>
			<<if $PC.reservedChildrenNursery > 1>>
				| <<print "[[Keep none of your children|Nursery][$reservedChildrenNursery -= $PC.reservedChildrenNursery, $PC.reservedChildrenNursery = 0]]">>
			<</if>>
			<<if ($reservedChildrenNursery + $PC.pregType - $PC.reservedChildrenNursery) <= $freeCribs>>
				| <<print "[[Keep the rest of your children|Nursery][$reservedChildrenNursery += ($PC.pregType - $PC.reservedChildrenNursery), $PC.reservedChildrenNursery += ($PC.pregType - $PC.reservedChildrenNursery)]]">>
			<</if>>
		<<elseif ($PC.reservedChildrenNursery == $PC.pregType) || ($reservedChildrenNursery == $freeCribs) || ($PC.reservedChildrenNursery - $PC.reservedChildren >= 0)>>
			<br>&nbsp;&nbsp;&nbsp;&nbsp;
			<<print "[[Keep one less child|Nursery][$PC.reservedChildrenNursery -= 1, $reservedChildrenNursery -= 1]]">>
			<<if $PC.reservedChildrenNursery > 1>>
				| <<print "[[Keep none of your children|Nursery][$reservedChildrenNursery -= $PC.reservedChildrenNursery, $PC.reservedChildrenNursery = 0]]">>
			<</if>>
		<</if>>
	<<elseif $reservedChildrenNursery < $freeCribs>>
		<<if $PC.pregType - $PC.reservedChildren == 0>>
			//Your child<<if $PC.pregType > 0>>ren are<<else>>is<</if>> already reserved for $incubatorName//
			<<print "[[Keep your "+ (($PC.pregType > 1) ? "children" : "child") +" here instead|Nursery][$PC.reservedChildrenNursery += 1, $PC.reservedChildren = 0]]">>
		<<else>>
			You have <<if $freeCribs == 1>>an<</if>> @@.lime;available room<<if $freeCribs > 1>>s<</if>>.@@
			<br>&nbsp;&nbsp;&nbsp;&nbsp;
			<<print "[[Keep "+ (($PC.pregType > 1) ? "a" : "your") +" child|Nursery][$PC.reservedChildrenNursery += 1, $reservedChildrenNursery += 1]]">>
			<<if ($PC.pregType > 1) && ($reservedChildrenNursery + $PC.pregType - $PC.reservedChildrenNursery) <= $freeCribs>>
				| [[Keep all of your children|Nursery][$reservedChildrenNursery += $PC.pregType, $PC.reservedChildrenNursery += $PC.pregType]]
			<</if>>
		<</if>>
	<<elseif $reservedChildrenNursery == $freeCribs>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;
		You have @@.red;no room for your offspring.@@
	<</if>>
<</if>>
<<if $reservedChildrenNursery != 0 || _childrenReservedNursery == 1>> /* the oops I made it go negative somehow button */
	<br>
	 <<link "Clear all reserved children">>
		<<for _u = 0; _u < _SL; _u++>>
			<<if $slaves[_u].reservedChildrenNursery != 0>>
				<<set $slaves[_u].reservedChildrenNursery = 0>>
			<</if>>
		<</for>>
		<<set $PC.reservedChildrenNursery = 0>>
		<<set $reservedChildrenNursery = 0>>
		<<goto "Nursery">>
	 <</link>>
<</if>>
/* WILL NEED TO BE REWORKED
<br><br>
Target age for release: <<textbox "$targetAge" $targetAge "Nursery">> [[Minimum Legal Age|Nursery][$targetAge = $minimumSlaveAge]] | [[Average Age of Fertility|Nursery][$targetAge = $fertilityAge]] | [[Average Age of Potency|Nursery][$targetAge = $potencyAge]] | [[Legal Adulthood|Nursery][$targetAge = 18]]
//Setting will not be applied to rooms in use.//
*/
<br><br>Rename $nurseryName: <<textbox "$nurseryName" $nurseryName "Nursery">> //Use a noun or similar short phrase//
