code:
:: Nursery [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Nursery", $showEncyclopedia = 1, $encyclopedia = "Nursery", $nurserySlaves = $NurseryiIDs.length>>
<<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, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>

$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 ripe young 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.
	<<set $nannyInfluence = 1>>
<<elseif $Matron != 0>>
	$Matron.slaveName is alone in $nurseryName, and has nothing to do but keep the place clean and look after the children.
	<<set $MatronInfluence = 1>>
<<elseif ($nurserySlaves <= 0) && ($nurseryBabies <= 0)>>
	$nurseryNameCaps is empty and quiet. <<link "Decommission the Nursery" "Main">><<set $nursery = 0, $nurseryNannies = 0, $nannyInfluence = 0, $nurseryDecoration = "standard", $cribs = [], $reservedChildrenNursery = 0>><<for _i = 0; _i < $slaves.length; _i++>><<run WombCleanGenericReserve($slaves[_i], "nursery", 9999)>><</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>>

/*TODO: add a malus for having children without nannies*/
<<set _Tmult0 = Math.trunc($nurseryNannies*1000*$upgradeMultiplierArcology)>>

It can support $nurseryNannies nann<<if $nurseryNannies != 1>>ies<<else>>y<</if>>. There <<if $nurserySlaves == 1>>is<<else>>are<</if>> $nurserySlaves nann<<if $nurserySlaves != 1>>ies<<else>>y<</if>> in $nurseryName.
<<if $nurseryBabies > 0 && ($nurserySlaves < 1 && $Matron < 1)>>
	//You must have at least one nanny or Matron to be able to influence the children's upbringing//

<</if>>
<<if $nurseryNannies < 5>>
	[[Expand the nursery|Nursery][cashX(forceNeg(_Tmult0), "capEx"), $nurseryNannies += 1, $PC.engineering += .1]] //Costs <<print cashFormat(_Tmult0)>> and will increase upkeep costs//
<<else>>
	//$nurseryNameCaps can support a maximum of 5 slaves//
<</if>>

<<if $Matron != 0>>
	<<setLocalPronouns $Matron>>

	<<if $MatronIgnoresFlaws != 1>>
		$Matron.slaveName will attempt to fix flaws in nannies serving under $him. [[Ignore flaws|Nursery][$MatronIgnoresFlaws = 1]]
	<<else>>
		$Matron.slaveName has been instructed to ignore flaws in the nannies serving under $him. [[Fix flaws|Nursery][$MatronIgnoresFlaws = 0]]
	<</if>>
<</if>>

<<print App.UI.SlaveList.stdFacilityPage(App.Entity.facilities.nursery)>>

It can support $nursery child<<if $nursery != 1>>ren<</if>>. There <<if $nurseryBabies == 1>>is<<else>>are<</if>> currently $nurseryBabies room<<if $nurseryBabies != 1>>s<</if>> in use in $nurseryName.
<<if $nursery < 50>>
	[[Add another room|Nursery][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "farmyard"), $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][cashX(forceNeg(Math.trunc(1000*$upgradeMultiplierArcology)), "farmyard"), $nursery -= 5]] //Costs <<print cashFormat(Math.trunc(1000*$upgradeMultiplierArcology))>> and will reduce upkeep costs//
<</if>>

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

//Sorting:// ''$sortNurseryList.''
		<<link "Sort by Name">>
				<<set $sortNurseryList = 'Name'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<>
		<</link>> |
		<<link "Sort by Reserved Nursery Spots">>
				<<set $sortNurseryList = 'Reserved Nursery Spots'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<>
		<</link>> |
		<<link "Sort by Pregnancy Week">>
				<<set $sortNurseryList = 'Pregnancy Week'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</replace>>
				<>
		<</link>> |
		<<link "Sort by Number of Children">>
				<<set $sortNurseryList = 'Number of Children'>>
				<<replace "#qlNurserySort">>$sortNurseryList<</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 _reservedNursery = WombReserveCount($slaves[_u], "nursery")>>
		<<set _reservedIncubator = WombReserveCount($slaves[_u], "incubator")>>
		<<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
		<<elseif $slaves[_u].pregSource == -3>>your Master's
		<<elseif $slaves[_u].pregSource == -7>>the lab's
		<<elseif $slaves[_u].pregSource == -9>>the Futanari Sisters'
		<<else>>
			<<set _t = $slaveIndices[$slaves[_u].pregSource]>>
			<<if def _t>>
				<<print $slaves[_t].slaveName>>'s
			<</if>>
		<</if>>
		<<if _WL > 1>>_WL babies<<else>>baby<</if>>.
		<<if _reservedNursery > 0>>
			<<set _childrenReservedNursery = 1>>
			<<if _WL == 1>>
				$His child will be placed in $nurseryName.
			<<elseif _reservedNursery < _WL>>
				_reservedNursery of $his children will be placed in $nurseryName.
			<<elseif _WL == 2>>
				Both of $his children will be placed in $nurseryName.
			<<else>>
				All _reservedNursery of $his children will be placed in $nurseryName.
			<</if>>
			<<if (_reservedIncubator + _reservedNursery < _WL) && ($reservedChildrenNursery < $freeCribs)>>

				<<print "[[Keep another child|Nursery][WombAddToGenericReserve($slaves[" + _u + "], 'nursery', 1)]]">>
				<<if _reservedNursery > 0>>
					| <<print "[[Keep one less child|Nursery][WombCleanGenericReserve($slaves[" + _u + "], 'nursery', 1)]]">>
				<</if>>
				<<if _reservedNursery > 1>>
					| <<print "[[Keep none of " + $his + " children|Nursery][WombCleanGenericReserve($slaves[" + _u + "], 'nursery', 9999)]]">>
				<</if>>
				<<if ($reservedChildrenNursery + _WL - _reservedNursery) <= $freeCribs>>
					| <<print "[[Keep the rest of " + $his + " children|Nursery][WombAddToGenericReserve($slaves[" + _u + "], 'nursery', 9999)]]">>
				<</if>>
			<<elseif (_reservedNursery == _WL) || ($reservedChildrenNursery == $freeCribs) || (_reservedIncubator + _reservedNursery == _WL)>>

				<<print "[[Keep one less child|Nursery][WombCleanGenericReserve($slaves[" + _u + "], 'nursery', 1)]]">>
				<<if _reservedNursery > 1>>
					| <<print "[[Keep none of " + $his + " children|Nursery][WombCleanGenericReserve($slaves[" + _u + "], 'nursery', 9999)]]">>
				<</if>>
			<</if>>
		<<elseif ($reservedChildrenNursery < $freeCribs) && ($freeCribs > _WL)>>
			<<if _WL - _reservedIncubator == 0>>
				//$His children are already reserved for $incubatorName//

				<<print "[[Keep " + $his + " " + ((_WL > 1) ? "children" : "child") + " here instead|Nursery][WombChangeReserveType($slaves[" + _u + "], 'incubator', 'nursery')]]">>
			<<else>>
				You have <<if $freeCribs == 1>>an<</if>> @@.lime;available room<<if $freeCribs > 1>>s<</if>>.@@

				<<print "[[Keep "+ ((_WL > 1) ? "a" : "the") +" child|Nursery][WombAddToGenericReserve($slaves[" + _u + "], 'nursery', 1)]]">>
				<<if (_WL > 1) && ($reservedChildrenNursery + _WL - _reservedNursery) <= $freeCribs>>
					| <<print "[[Keep all of " + $his + " children|Nursery][WombAddToGenericReserve($slaves[" + _u + "], 'nursery', 9999)]]">>
				<</if>>
			<</if>>
		<<elseif $reservedChildrenNursery == $freeCribs>>

			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 _reservedNursery > 0>>
		<<set _childrenReservedNursery = 1>>
		<<if _WL == 1>>
			Your child will be placed in $nurseryName.
		<<elseif _reservedNursery < _WL>>
			_reservedNursery of your children will be placed in $nurseryName.
		<<elseif _WL == 2>>
			Both of your children will be placed in $nurseryName.
		<<else>>
			All _reservedNursery of your children will be placed in $nurseryName.
		<</if>>
		<<if (_reservedNursery < _WL) && ($reservedChildrenNursery < $freeCribs) && (_reservedNursery - _reservedIncubator > 0)>>

			<<print "[[Keep another child|Nursery][_reservedNursery += 1, $reservedChildrenNursery += 1]]">>
			<<if _reservedNursery > 0>>
				| <<print "[[Keep one less child|Nursery][_reservedNursery -= 1, $reservedChildrenNursery -= 1]]">>
			<</if>>
			<<if _reservedNursery > 1>>
				| <<print "[[Keep none of your children|Nursery][$reservedChildrenNursery -= _reservedNursery, _reservedNursery = 0]]">>
			<</if>>
			<<if ($reservedChildrenNursery + _WL - _reservedNursery) <= $freeCribs>>
				| <<print "[[Keep the rest of your children|Nursery][$reservedChildrenNursery += (_WL - _reservedNursery), _reservedNursery += (_WL - _reservedNursery)]]">>
			<</if>>
		<<elseif (_reservedNursery == _WL) || ($reservedChildrenNursery == $freeCribs) || (_reservedNursery - _reservedIncubator >= 0)>>

			<<print "[[Keep one less child|Nursery][_reservedNursery -= 1, $reservedChildrenNursery -= 1]]">>
			<<if _reservedNursery > 1>>
				| <<print "[[Keep none of your children|Nursery][$reservedChildrenNursery -= _reservedNursery, _reservedNursery = 0]]">>
			<</if>>
		<</if>>
	<<elseif $reservedChildrenNursery < $freeCribs>>
		<<if _WL - _reservedIncubator == 0>>
			//Your child<<if _WL > 0>>ren are<<else>>is<</if>> already reserved for $incubatorName//
			<<print "[[Keep your "+ ((_WL > 1) ? "children" : "child") +" here instead|Nursery][_reservedNursery += 1, _reservedIncubator = 0]]">>
		<<else>>
			You have <<if $freeCribs == 1>>an<</if>> @@.lime;available room<<if $freeCribs > 1>>s<</if>>.@@

			<<print "[[Keep "+ ((_WL > 1) ? "a" : "your") +" child|Nursery][_reservedNursery += 1, $reservedChildrenNursery += 1]]">>
			<<if (_WL > 1) && ($reservedChildrenNursery + _WL - _reservedNursery) <= $freeCribs>>
				| [[Keep all of your children|Nursery][$reservedChildrenNursery += _WL, _reservedNursery += _WL]]
			<</if>>
		<</if>>
	<<elseif $reservedChildrenNursery == $freeCribs>>

		You have @@.red;no room for your offspring.@@
	<</if>>
<</if>>
<<if $reservedChildrenNursery != 0 || _childrenReservedNursery == 1>> /* the oops I made it go negative somehow button */

	<<link "Clear all reserved children">>
		<<for _u = 0; _u < _SL; _u++>>
			<<run WombCleanGenericReserve($slaves[_u], "nursery", 9999)>>
		<</for>>
		<<run WombCleanGenericReserve($PC, "nursery", 9999)>>
		<<goto "Nursery">>
	<</link>>
<</if>>

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

/*TODO: Rework these buttons to allow management that makes sense*/
/*TODO: Rewrite probably all of the descriptions - these are basically placeholders for now*/

<<if $nurseryWeight == 1>>
	<<if $nurseryWeightSetting == 1>>
		Weight is not being properly managed, saving costs but likely causing excessive weight gain.
		[[Monitor|Nursery][$nurseryWeightSetting = 2]] | [[Disable|Nursery][$nurseryWeightSetting = 0]]
	<<elseif $nurseryWeightSetting == 2>>
		Weight is being carefully managed; children will be raised at a healthy weight.
		[[Estimate only|Nursery][$nurseryWeightSetting = 1]] | [[Disable|Nursery][$nurseryWeightSetting = 0]]
	<<elseif $nurseryWeightSetting == 0>>
		Weight management systems are offline; children will likely be malnourished.
		[[Activate|Nursery][$nurseryWeightSetting = 2]]
	<</if>>
<<else>>
	The amount of food the children eat is not being monitored, meaning they may end up becoming malnourished.
	[[Carefully monitor the amount of food the children eat|Nursery][cashX(forceNeg(Math.trunc(1000*$upgradeMultiplierArcology)), "farmyard"), $nurseryWeight = 1]]
	//Costs <<print cashFormat(Math.trunc(1000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $nurseryMuscles == 1>>
	<<if $nurseryMusclesSetting == 2>>
		Children are purposefully getting more exercise than recommended; excessive muscle gain likely.
		[[Limit exercise|Nursery][$nurseryMusclesSetting = 1]] | [[Disable|Nursery][$nurseryMusclesSetting = 0]]
	<<elseif $nurseryMusclesSetting == 1>>
		Exercise is being carefully managed; children will be raised with average strength.
		[[More exercise|Nursery][$nurseryMusclesSetting = 2]] | [[Disable|Nursery][$nurseryMusclesSetting = 0]]
	<<elseif $nurseryMusclesSetting == 0>>
		Children are no getting any exercise; they will likely be extremely weak.
		[[Allow|Nursery][$nurseryMusclesSetting = 1]]
	<</if>>
<<else>>
	The children are not getting any exercise, meaning they will likely end up becoming weak and frail.
	[[Allow the children to remain active|Nursery][cashX(forceNeg(Math.trunc(1000*$upgradeMultiplierArcology)), "farmyard"), $nurseryMuscles = 1]] //Costs <<print cashFormat(Math.trunc(1000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

<<if $nurseryUpgradeHormones == 1>>
	<<if $nurseryHormonesSetting == 2>>
		Hormone levels are purposefully set higher than recommended; over-active reproductive systems likely.
		[[Limit|Nursery][$nurseryHormonesSetting = 1]] | [[Disable|Nursery][$nurseryHormonesSetting = 0]]
	<<elseif $nurseryHormonesSetting == 1>>
		Hormone levels are being carefully managed; children will be released with fully functional reproductive organs.
		[[Overload|Nursery][$nurseryHormonesSetting = 2]] | [[Disable|Nursery][$nurseryHormonesSetting = 0]]
	<<elseif $nurseryHormonesSetting == 0>>
		Hormones management systems are offline; children will undergo normal puberty.
		[[Activate|Nursery][$nurseryHormonesSetting = 1]]
	<</if>>
<<else>>
	The children are not being given growth hormones.
	[[Give the children growth hormones|Nursery][cashX(forceNeg(Math.trunc(1000*$upgradeMultiplierArcology)), "farmyard"), $nurseryUpgradeHormones = 1, $nurseryHormonesSetting = 0]]
	//Costs <<print cashFormat(Math.trunc(1000*$upgradeMultiplierArcology))>> and will increase upkeep costs//
<</if>>

	/* TODO: this may need a rewrite - I'm not much of a writer */
<<if $nurserySex == 1>>
	The staff are allowed to use the children sexually.
	[[Disallow the staff to use them|Nursery][$nurserySex = 0]]
<<else>>
	The staff are not allowed to use the children sexually.
	[[Allow the staff to use them|Nursery][$nurserySex = 1]]
<</if>>
/*

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

<<if $nurseryImprintSetting == "terror">>	/* TODO: this may (read: most likely will) need a rewrite */
	The children are being taught to be devoted but fearful of you. This is locked upon birth.
	[[Switch the system to focus on attachment|Nursery][$nurseryImprintSetting = "trust"]] //Only affects new infants//
<<else>>
	The children are being taught to be devoted and trusting of you. This is locked upon birth.
	[[Switch the system to focus on dependence|Nursery][$nurseryImprintSetting = "terror"]] //Only affects new infants//
<</if>>

<<if $nurseryBabies > 0>>

''Children in $nurseryName''

	/* FOR TESTING */
	<<for _c = 0; _c < $cribs.length; _c++>>
		<<link "$cribs[_c].slaveName" "Long Child Description">>
		<<include "Child Summary">>
		<</link>>

	<</for>>
<</if>>
/*
<<if $useSlaveSummaryTabs == 1>>
	<<set _j = "Back", _k = "AC Dump", _l = "Main">>

		<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'resting')">Resting</button>
		<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'all')" id="defaultButton">All</button>

			//<<OptionsSortAsAppearsOnMain>>//
			<<set $childAssignmentTab = "resting">>
			<<include "Child Summary">>

			//<<OptionsSortAsAppearsOnMain>>//
			<<set $childAssignmentTab = "all">>
			<<include "Child Summary">>

<<else>>  /*Display traditionally, without tabs*//*

//<<if $sortSlavesMain != 0>>

	Sort by:
	<<if $sortChildrenBy != "devotion">>[[Devotion|Main][$sortChildrenBy = "devotion"]]<<else>>Devotion<</if>> |
	<<if $sortChildrenBy != "name">>[[Name|Main][$sortChildrenBy = "name"]]<<else>>Name<</if>> |
	<<if $sortChildrenBy != "assignment">>[[Assignment|Main][$sortChildrenBy = "assignment"]]<<else>>Assignment<</if>> |
	<<if $sortChildrenBy != "seniority">>[[Seniority purchased|Main][$sortChildrenBy = "seniority"]]<<else>>Seniority<</if>> |
	<<if $sortChildrenBy != "actualAge">>[[Age|Main][$sortChildrenBy = "actualAge"]]<<else>>Age<</if>> |
	<<if $sortChildrenBy != "visualAge">>[[Apparent Age|Main][$sortChildrenBy = "visualAge"]]<<else>>Apparent Age<</if>> |
	<<if $sortChildrenBy != "physicalAge">>[[Bodily Age|Main][$sortChildrenBy = "physicalAge"]]<<else>>Bodily Age<</if>>

	Sort: <<if $sortSlavesOrder != "descending">>[[Descending|Main][$sortSlavesOrder = "descending"]]<<else>>Descending<</if>> |
	<<if $sortSlavesOrder != "ascending">>[[Ascending|Main][$sortSlavesOrder = "ascending"]]<<else>>Ascending<</if>>
<</if>>//

<<if $positionMainLinks >= 0>>
	<<MainLinks>>
<</if>>

/* TASK ARRAY *//*
<<set $jobTypes = [{title: "Rest", asgn: "rest"}, {title: "Classes", asgn: "take classes"}, {title: "Choose own", asgn: "choose her own job"}]>>

<<link Reset>><<resetAssignmentFilter>><<replace '#summarylist'>><<include "Child Summary">><</replace>><</link>>
Filter by assignment: |
<<for _i = 0; _i < $jobTypes.length; _i++>>
	<<set _title = $jobTypes[_i].title>>
	<<if $cribs.filter(function(x){return x.assignment == ($jobTypes[_i].asgn)}).length > 0>>
		<<print "
			<<link _title>>
				<<set $cribs.filter(function(x){return x.assignment == ($jobTypes[" + _i + "].asgn)}).map(function(y){y.assignmentVisible = 1})>>
				<<set $cribs.filter(function(x){return x.assignment != ($jobTypes[" + _i + "].asgn)}).map(function(y){y.assignmentVisible = 0})>>
				<<replace '#summarylist'>><<include 'Child Summary'>><</replace>>
			<</link>>
		">> |
	<</if>>
<</for>>

<<include "Child Summary">>

<<if $lineSeparations == 0>>
<<else>>
<</if>>

<<set _j = "Back", _k = "AC Dump", _l = "Main">>
<<for $i = 0; $i < _CL; $i++>>
<<if ($cribs[$i].assignment == "please you")>>
	<<setLocalPronouns $cribs[$i]>>

<<include "Toychest">> //In the coming week you plan to concentrate on
	<<if $cribs[$i].fuckdoll == 0>>
		<<if $cribs[$i].toyHole != "all her holes">>
			$his $cribs[$i].toyHole, but for now://

    [["Use "+$his+" mouth"|FLips][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]] | [["Play with "+$his+" tits|FBoobs][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
			<<if canDoVaginal($cribs[$i])>>
				| [["Fuck "+$him|FVagina][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<<if canDoAnal($cribs[$i])>>
					| [["Use "+$his+" holes"|FButt][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<</if>>
			<</if>>
			<<if canDoAnal($cribs[$i])>>
				| [["Fuck "+$his+" ass"|FAnus][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
			<</if>>
			<<if canDoVaginal($cribs[$i]) || canDoAnal($cribs[$i])>>
				<<if $cribs[$i].belly >= 300000>>
					| [["Fuck "+$him+" over "+$his+" belly"|FBellyFuck][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<</if>>
			<</if>>
			/*check*//*
			<<if canPenetrate($cribs[$i])>>
				| [["Ride "+$him|FDick][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j,$nextLink = _k,$returnTo = _l]]
			<</if>>
			| [["Abuse "+$him|FAbuse][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j,$nextLink = _k,$returnTo = _l]]
		<<else>>
			all of $his holes equally, but for now://

    [["Use "+$his+" mouth"|FLips][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]] | [["Play with "+$his+" tits"|FBoobs][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
			<<if canDoVaginal($cribs[$i])>>
				| [["Fuck "+$him|FVagina][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<<if canDoAnal($cribs[$i])>>
					| [["Use "+$his+" holes"|FButt][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<</if>>
			<</if>>
			<<if canDoAnal($cribs[$i])>>
				| [["Fuck "+$his+" ass"|FAnus][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
			<</if>>
			<<if canDoVaginal($cribs[$i]) || canDoAnal($cribs[$i])>>
				<<if $cribs[$i].belly >= 300000>>
					| [["Fuck "+$him+" over "+$his+" belly"|FBellyFuck][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
				<</if>>
			<</if>>
			/*check*//*
			<<if canPenetrate($cribs[$i])>>
				| [["Ride "+$him|FDick][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j,$nextLink = _k,$returnTo = _l]]
			<</if>>
			| [["Abuse "+$him|FAbuse][$activeSlave = $cribs["+$i+"], $childSex = 1, $nextButton = _j, $nextLink = _k, $returnTo = _l]]
		<</if>>
	<<else>>
		<<if $cribs[$i].toyHole != "all her holes">>
			$his $cribs[$i].toyHole.
		<<else>>
			all of $his holes.
		<</if>>
	<</if>>
<</if>>
<</for>>
<</if>>	/* closes $nurseryBabies check *//*

*/
/*
<<if $readySlaves == 1>>
	<<for $i = 0; $i < $nurseryBabies; $i++>>
		<<if $cribs[$i].growTime <= 0>>
			<<set $nurseryOldID = $cribs[$i].ID>>
			<<set $readySlave = $cribs.pluck([$i], [$i])>>
			<<break>>
		<</if>>
	<</for>>
	<<goto "Nursery Retrieval Workaround">>
<</if>>
*/

Rename $nurseryName: <<textbox "$nurseryName" $nurseryName "Nursery">> //Use a noun or similar short phrase//


code:
:: Nursery Discard Workaround [nobr]

$activeSlave.slaveName has been given away to another arcology to be raised, never to be seen again.

<<set $nurserySlaves-->>
<<set $returnTo = "Main">>

repo_name: AmbrosiaCheesecake/fc


code:
App.Data.Facilities.nursery = {
	baseName: "nursery",
	genericName: null,
	jobs: {
		nanny: {
			position: "nanny",
			assignment: "work as a nanny",
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "nanny",
	manager: {
		position: "matron",
		assignment: "be the Matron",
		careers: ["a babysitter", "a nanny", "a practitioner", "a wet nurse", "an au pair"],
		skill: "matron",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.NurseryNannyJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);

		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, 20, -21)) {
			r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
		}

		return r;
	}
};

App.Entity.facilities.nursery = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.nursery,
	{
		nanny: new App.Entity.Facilities.NurseryNannyJob()
	}
);


code:
:: Nursery Report [nobr]

/* TODO: This will most likely still need some rewriting */
<<SlaveIDSort $NurseryiIDs>>
<<set _NL = $NurseryiIDs.length, $nurserySlaves = _NL, _SL = $slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _trustBonus = 0>>

<<if $nurseryDecoration != "standard">>
	<<set _devBonus = 1>>
<<else>>
	<<set _devBonus = 0>>
<</if>>

<<if $Matron != 0>>
	<<set _FLs = $slaveIndices[$Matron.ID]>>

	<<if ($slaves[_FLs].health < 100)>>
		<<set $slaves[_FLs].health += 20>>
	<</if>>
	<<if ($slaves[_FLs].devotion <= 60)>>
		<<set $slaves[_FLs].devotion++>>
	<</if>>
	<<if $slaves[_FLs].trust < 60>>
		<<set $slaves[_FLs].trust++>>
	<</if>>
	<<if $slaves[_FLs].livingRules != "luxurious">>
		<<set $slaves[_FLs].livingRules = "luxurious">>
	<</if>>
	<<set _FLsFetish = 0>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "caring">>
			<<if fetishChangeChance($slaves[_FLs]) > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "caring">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	<<if ($Matron.fetish == "none") || ($Matron.fetish == "caring")>>
		<<set _devBonus++>>
	<</if>>
	<<set $slaves[_FLs].devotion += _devBonus, $Matron = $slaves[_FLs]>>
	    <<= SlaveFullName($Matron)>> is serving as the nursery matron.<<if $Matron.relationship == -3 && $Matron.devotion > 50>> $He tries $his best to be your perfect attentive, caring and loving wife.<</if>>
	<<if (_FLsFetish == 1)>>
		When $he is paid a visit by a slave with sexual issues to work out, $he provides $him with an understanding, willing, giving partner. $He finds real satisfaction in helping your slaves find sexual gratification, and @@.lightsalmon;becomes more caring.@@
	<<elseif (_FLsFetish == 2)>>
		Every new slave in the nursery is a new person $he gets to connect with and serve. Sexually. @@.lightsalmon;$He becomes more caring.@@
	<</if>>
	<<if setup.attendantCareers.includes($Matron.career)>>
		$He has experience with childcare from $his life before $he was a slave, making $him better at properly raising children, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<elseif $Matron.skill.matron >= $masteredXP>>
		$He has experience with childcare from working for you, making $him better at properly raising children, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<else>>
		<<set $slaves[_FLs].skill.matron += random(1,($Matron.intelligence+4)*2)>>
	<</if>>
	<<if ($Matron.fetish == "none")>>
		$Matron.slaveName respects the slaves working in the nursery, allowing them to care for the children more effectively.
		<<set _idleBonus++>>
		/* TODO: not sure what to write for this one
	<<elseif ($Matron.fetish == "dom")>>
		$Matron.slaveName enjoys being able to have control over the nannies.
		<<set _idleBonus++>>
		*/
	<<elseif ($Matron.fetishKnown == 1)>>
		$Matron.slaveName can't keep $his hands to $himself, preventing the slaves in the nursery from relaxing completely.
	<</if>>
	<<if ($Matron.visualAge > 35)>>
		$His apparent maturity encourages the slaves in the nursery to relax and pour out their troubles to $him.
		<<set _healthBonus++, _idleBonus++>>
	<</if>>
	<<if ($Matron.intelligence > 0)>>
		$He's so intelligent $he can suss out the cause of slaves' emotional issues and counsel them effectively.
		<<set _idleBonus++>>
	<</if>>
	<<if isFertile($Matron) || ($Matron.bellyPreg >= 1500) || ($Matron.counter.birthsTotal > 0) || ($Matron.bellyImplant >= 1500)>>
		$He has a natural mothering instinct and really makes $his guests feel at home.
		<<set _idleBonus++, _healthBonus++>>
	<</if>>
	<<if (_NL < $nursery)>>
		<<set _seed = random(1,10)+(($nursery-_NL)*(random(150,170)+(_idleBonus*10)))>>
		<<run cashX(_seed, "nursery", $Matron)>>

    Since $he doesn't have enough children to occupy all $him time, the nursery takes in citizens' children on a contract basis and $he cares for them too, earning @@.yellowgreen;<<print cashFormat(_seed)>>.@@
		<<if ($arcologies[0].FSRepopulationFocus > 0) && (_NL == 0)>>
			Society @@.green;loves@@ the way you are raising more children for $arcologies[0].name.
			<<= FSChange ("Repopulationist", 2)>>
		<</if>>
	<</if>>
	<<if (_NL > 0)>>

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

<<if (_NL > 0)>>
	    ''<<if (_NL > 1)>>There are _NL slaves<<else>>There is one slave<</if>> resting and recuperating in the nursery.''
	<<if ($arcologies[0].FSHedonisticDecadence > 0) && (_NL == 0)>>
		Society @@.green;approves@@ of your slaves being pampered this way, greatly advancing your laid back culture.
		<<= FutureSocieties.Change("Hedonistic", 1)>>
	<</if>>
<</if>>

<<if $Matron != 0>>
	<<set $i = _FLs>> /* apply following SA passages to facility leader */
	<<if $showEWD != 0>>

		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>

			<<SlaveArt $slaves[_FLs] 0 0>>

		<</if>>
		/* 000-250-006 */
		''__@@.pink;<<= SlaveFullName($slaves[$i])>>@@__'' is serving as the Matron in $nurseryName.

		<<= saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>

<<include "SA devotion">>
	<<else>>
		<<silently>>
		<<set _chosenClothes = saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
	<<set $Matron = $slaves[_FLs]>>
<</if>>

<<for _dI = 0; _dI < _NL; _dI++>>
	<<set $i = $slaveIndices[$NurseryiIDs[_dI]]>>
	<<set $slaves[$i].devotion += _devBonus, $slaves[$i].trust += _trustBonus, $slaves[$i].health += _healthBonus>>
	<<if ($slaves[$i].devotion < 60) && ($slaves[$i].trust < 60)>>
		<<set $slaves[$i].devotion++, $slaves[$i].trust++>>
	<<elseif ($slaves[$i].trust < 40)>>
		<<set $slaves[$i].trust += 10>>
	<<elseif ($slaves[$i].devotion < 40)>>
		<<set $slaves[$i].devotion += 10>>
	<</if>>
	<<if ($nurseryUpgrade == 1) && ($slaves[$i].health < 20)>>
		<<set $slaves[$i].health += 3>>
	<</if>>
	<<switch $nurseryDecoration>>
	<<case "Repopulationism">>	/* feel free to change this */
		<<set $slaves[$i].livingRules = "luxurious">>
	<<case "Degradationist">>
		<<set $slaves[$i].livingRules = "spare">>
	<<default>>
		<<set $slaves[$i].livingRules = "normal">>
	<</switch>>
	<<if $showEWD != 0>>

		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>

			<<SlaveArt $slaves[$i] 0 0>>

		<</if>>
		/* 000-250-006 */
		''__@@.pink;<<= SlaveFullName($slaves[$i])>>@@__''
		<<if $slaves[$i].choosesOwnAssignment == 2>>
			<<include "SA chooses own job">>
		<<else>>
			is working in $nurseryName.
		<</if>>

    $He <<= saRest($slaves[$i])>>

		<<= saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>

<<include "SA devotion">>
	<<else>>
		<<silently>>
		<<include "SA chooses own job">>
		<<run saChoosesOwnClothes($slaves[$i])>>
		<<run saRest($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
<</for>>
/*
<<if (_restedSlaves > 0)>>

	<<if (_restedSlaves == 1)>>
		One slave has rested until $he reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the nursery before the end of the week.
	<<else>>
		_restedSlaves slaves have rested until they reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the nursery before the end of the week.
	<</if>>
	<<if $nurseryDecoration != "standard">>

    $nurseryNameCaps's $nurseryDecoration atmosphere @@.hotpink;had an impact on <<if _restedSlaves == 1>>$him while $he was<<else>>them while they were<</if>>@@ working.
	<</if>>
<</if>>
*/
<<if _NL > 0 || $Matron != 0>>

<</if>>

<<include "Children Report">>


code:
:: Nursery Retrieval Workaround [nobr]

$readySlave.slaveName has been discharged from $nurseryName and is ready for inspection.

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


code:
:: Nursery Workaround [nobr]

<<if $cribs.length < $nursery>>
	<<run newChild($activeSlave)>>
	<<set $activeSlave.growTime = ($targetAgeNursery*52)>>
	/* for later
	TODO: is this going to be used?

	<<if $activeSlave.mother > 0>>
		<<set _tempMom = getSlave($activeSlave.mother)>>
	<</if>>
	<<if $activeSlave.father > 0>>
		<<set _tempDad = getSlave($activeSlave.father)>>
	<</if>>

Choose a name for $him. <<textbox "$activeSlave.slaveName" $activeSlave.slaveName>>
	<<link "Commit name.">>
		<<set $activeSlave.birthName = $activeSlave.slaveName>>
		<<replace "#naming">>
			You instruct $assistantName to register the new $girl as "<<print $activeSlave.slaveName>>" in the slave registry.
		<</replace>>
		<<replace "#newName">>
			''__@@.pink;$activeSlave.slaveName@@__''
		<</replace>>
	<</link>>

<<link "Have your PA assign $him a random name">>
		<<replace "#naming">>
			<<NewChildName $activeSlave>>
			$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
		<</replace>>
		<<replace "#newName">>
			''__@@.pink;$activeSlave.slaveName@@__''
		<</replace>>
	<</link>>
	<<if $arcologies[0].FSPastoralist != "unset">>
		<<if $activeSlave.lactation > 0>>

<<link "Have your PA assign $him a random cow name">>
				<<replace "#naming">>
					<<set $activeSlave.slaveName = setup.cowSlaveNames.random()>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<</if>>
	<</if>>
	<<if $arcologies[0].FSChattelReligionist != "unset">>

<<link "Have your PA assign $him a random devotional name">>
			<<replace "#naming">>
				<<set $activeSlave.slaveName = setup.chattelReligionistSlaveNames.random()>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<</if>>
	<<if $arcologies[0].FSRomanRevivalist != "unset">>

<<link "Have your PA assign $him a random Roman name">>
			<<replace "#naming">>
				<<set $activeSlave.slaveName = setup.romanSlaveNames.random()>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<<elseif $arcologies[0].FSAztecRevivalist != "unset">>

<<link "Have your PA assign $him a random Aztec name">>
			<<replace "#naming">>
				<<set $activeSlave.slaveName = setup.aztecSlaveNames.random()>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<<elseif $arcologies[0].FSEgyptianRevivalist != "unset">>

<<link "Have your PA assign $him a random ancient Egyptian name">>
			<<replace "#naming">>
				<<set $activeSlave.slaveName = setup.ancientEgyptianSlaveNames.random()>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<<elseif $arcologies[0].FSEdoRevivalist != "unset">>

<<link "Have your PA assign $him a random feudal Japanese name">>
			<<replace "#naming">>
				<<set $activeSlave.slaveName = setup.edoSlaveNames.random()>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<</if>>
	<<if $arcologies[0].FSDegradationist != "unset">>

<<link "Have your PA assign $him a degrading name">>
			<<replace "#naming">>
				<<run DegradingName($activeSlave)>>
				<<set $activeSlave.birthName = $activeSlave.slaveName>>
				$assistantName registers the new $girl as "<<print $activeSlave.slaveName>>" in your registry.
			<</replace>>
			<<replace "#newName">>
				''__@@.pink;$activeSlave.slaveName@@__''
			<</replace>>
		<</link>>
	<</if>>
	<<if $activeSlave.mother > 0>>
	<<setLocalPronouns _tempMom 2>>
		<<if _tempMom.ID == $Concubine.ID>>

<<link "Permit your Concubine to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempMom $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempMom.slaveName picks a name _he2 thinks you might find attractive; from now on _his2 daughter will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempMom.relationship == -3 && (_tempMom.devotion >= -20)>>

<<link "Permit your wife to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempMom $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempMom.slaveName picks a name suitable for your daughter; from now on _he2 will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempMom.ID == $Bodyguard.ID>>

<<link "Permit your bodyguard to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempMom $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempMom.slaveName decides on "<<print $activeSlave.slaveName>>" for _his2 daughter. _He2 hopes you'll find it fitting $his station.
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempMom.ID == $HeadGirl.ID>>

<<link "Permit your Head Girl to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempMom $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempMom.slaveName decides on "<<print $activeSlave.slaveName>>" for _his2 daughter, and hopes it will be a name your other slaves will learn to respect.
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempMom.devotion > 50 && _tempMom.trust > 50>>

<<link "Permit $his devoted mother to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempMom $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempMom.slaveName picks a name _he2 hopes you'll like; from now on _his2 daughter will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<</if>>
	<</if>>
	<<if $activeSlave.father > 0 && $activeSlave.father != $activeSlave.mother>>
		<<setLocalPronouns _tempDad 2>>
		<<if _tempDad.ID == $Concubine.ID>>

<<link "Permit your Concubine to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempDad $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempDad.slaveName picks a name _he2 thinks you might find attractive; from now on _his2 daughter will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempDad.relationship == -3 && (_tempDad.devotion >= -20)>>

<<link "Permit your wife to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempDad $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempDad.slaveName picks a name suitable for your daughter; from now on $he will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempDad.ID == $Bodyguard.ID>>

<<link "Permit your bodyguard to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempDad $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempDad.slaveName decides on "<<print $activeSlave.slaveName>>" for _his2 daughter. _He2 hopes you'll find it fitting $his station.
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempDad.ID == $HeadGirl.ID>>

<<link "Permit your Head Girl to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempDad $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempDad.slaveName decides on "<<print $activeSlave.slaveName>>" for _his2 daughter, and hopes it will be a name your other slaves will learn to respect.
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<<elseif _tempDad.devotion > 50 && _tempDad.trust > 50>>

<<link "Permit $his devoted father to name _his2 daughter">>
				<<replace "#naming">>
					<<ParentNames _tempDad $activeSlave>>
					<<set $activeSlave.birthName = $activeSlave.slaveName>>
					After some careful consideration, _tempDad.slaveName picks a name _he2 hopes you'll like; from now on _his2 daughter will be known as "<<print $activeSlave.slaveName>>".
				<</replace>>
				<<replace "#newName">>
					''__@@.pink;$activeSlave.slaveName@@__''
				<</replace>>
			<</link>>
		<</if>>
	<</if>>

	<<set $activeSlave.birthName = $activeSlave.slaveName>>

	*/
<</if>>


code:
:: Previous Child In Line

<<silently>>

<<set $i = $cribs.findIndex(function(s) { s.ID === $activeSlave.ID; })>>
<<set $cribs[$i] = $activeSlave>> /* save changes before switching */
<<if $i == 0>>
	<<set $activeSlave = $cribs[$cribs.length - 1]>>
<<else>>
	<<set $activeSlave = $cribs[$i-1]>>
<</if>>
<<goto "Child Interact">>

<</silently>>


code:
:: SA care for children [nobr]

//For effects on nannies/matron.//


code:
:: SA Nanny [nobr]

works as a nanny this week.

/* TODO: this needs to be written */


code:
App.Data.Facilities.penthouse = {
	baseName: "",
	genericName: "Penthouse",
	jobs: {
		rest: {
			position: "Rest",
			assignment: "rest",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		chooseOwn: {
			position: "Choose own",
			assignment: "choose her own job",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		fucktoy: {
			position: "Fucktoy",
			assignment: "please you",
			publicSexUse: false,
			fuckdollAccepted: true
		},
		classes: {
			position: "Classes",
			assignment: "take classes",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		houseServant: {
			position: "House Servant",
			assignment: "be a servant",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		whore: {
			position: "Whore",
			assignment: "whore",
			publicSexUse: true,
			fuckdollAccepted: false
		},
		publicServant: {
			position: "Public Servant",
			assignment: "serve the public",
			publicSexUse: true,
			fuckdollAccepted: false
		},
		subordinateSlave: {
			position: "Subordinate slave",
			assignment: "be a subordinate slave",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		cow: {
			position: "Milked",
			assignment: "get milked",
			publicSexUse: false,
			fuckdollAccepted: false
		},
		gloryhole: {
			position: "Gloryhole",
			assignment: "work a glory hole",
			publicSexUse: false,
			fuckdollAccepted: true
		},
		confinement: {
			position: "Confinement",
			assignment: "stay confined",
			publicSexUse: false,
			fuckdollAccepted: true
		}
	},
	defaultJob: "rest",
	manager: {
		position: "Recruiter",
		assignment: "recruit girls",
		careers: ["a club recruiter", "a college scout", "a con artist", "a cult leader", "a girl scout", "a hunter", "a lobbyist", "a military recruiter", "a missionary", "a political activist", "a princess", "a spy", "a talent scout", "retired"],
		skill: "recruiter",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};
App.Entity.Facilities.PenthouseJob = class extends App.Entity.Facilities.Job {
	/**
	 * @override
	 * @returns {number[]} */
	employeesIndices() {
		const employees = State.variables.JobIDArray[this.desc.assignment];
		if (!employees) { return []; }
		const si = State.variables.slaveIndices;
		return employees.map(id => si[id]);
	}

	/**
	 * @override
	 * @returns {App.Entity.SlaveState[]}
	 */
	employees() {
		const slaves = State.variables.slaves;
		return this.employeesIndices().map(idx => slaves[idx]);
	}
};

App.Entity.Facilities.PenthouseJobs = {
	Classes: class extends App.Entity.Facilities.PenthouseJob {
		canEmploy(slave) {
			let r = super.canEmploy(slave);
			if (slave.intelligenceImplant >= 15) {
				r.push(`${slave.slaveName} already has a basic education.`);
			}
			if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, -20, -51)) {
				r.push(`${slave.slaveName} is too resistant to learn.`);
			}

			if (slave.fetish === "mindbroken") {
				r.push(`${slave.slaveName}'s mind is fundamentally broken and can't learn.`);
			}
			return r;
		}
	},
	HouseServant: class extends App.Entity.Facilities.PenthouseJob {
		canEmploy(slave) {
			let r = super.canEmploy(slave);

			if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, -19, -51)) {
				r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
			}

			if (!canWalk(slave)) {
				r.push(`${slave.slaveName} can't walk and would be unable to properly clean.`);
			}
			if (!canSee(slave)) {
				r.push(`${slave.slaveName} is blind and would be unable to properly clean.`);
			}

			return r;
		}
	},

	SubordinateSlave: class extends App.Entity.Facilities.PenthouseJob {
		canEmploy(slave) {
			let r = super.canEmploy(slave);
			if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, -19, -51)) {
				r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
			}
			return r;
		}

		assignmentLink(i, passage, callback, linkText) {
			return super.assignmentLink(i, "Subordinate Targeting",
				(assignment) => {
					return `<<run App.Utils.setActiveSlaveByIndex(${i})>>` + (callback !== undefined ? callback(assignment) : '');
				}, linkText);
		}
	},
	Cow: class extends App.Entity.Facilities.PenthouseJob {
		canEmploy(slave) {
			let r = super.canEmploy(slave);

			if ((slave.lactation <= 0) && (slave.balls <= 0)) {
				r.push(`${slave.slaveName} is not lactating` + ((State.variables.seeDicks > 0) ? ' or producing semen.' : '.'));
			}
			return r;
		}
	},
};

App.Entity.Facilities.Penthouse = class extends App.Entity.Facilities.Facility {
	constructor() {
		super(App.Data.Facilities.penthouse, {
			classes: new App.Entity.Facilities.PenthouseJobs.Classes(),
			houseServant: new App.Entity.Facilities.PenthouseJobs.HouseServant(),
			subordinateSlave: new App.Entity.Facilities.PenthouseJobs.SubordinateSlave(),
			cow: new App.Entity.Facilities.PenthouseJobs.Cow(),
		});
	}

	/** Facility slave capacity
	* @returns {number} */
	get capacity() {
		return State.variables.dormitory;
	}

	/** Number of already hosted slaves
	 * @returns {number} */
	get hostedSlaves() {
		return State.variables.dormitoryPopulation;
	}

	/**
	 *
	 * @param {App.Entity.SlaveState} slave
	 * @returns {boolean}
	 */
	isHosted(slave) {
		return slave.assignmentVisible === 1;
	}

	/**
	 * all slaves that are at the penthouse
	 * @returns {App.Entity.SlaveState[]}
	 */
	employees() {
		return State.variables.slaves.filter( s => s.assignmentVisible === 1);
	}

	/**
	 * Indices in the slaves array for all slaves that are at the penthouse
	 * @returns {number[]}
	 */
	employeesIndices() {
		return State.variables.slaves.reduce(
			(acc, cur, idx) => { if (cur.assignmentVisible === 1) { acc.push(idx); } return acc; }, []);
	}

	_createJob() {
		return new App.Entity.Facilities.PenthouseJob();
	}
};

App.Entity.facilities.penthouse = new App.Entity.Facilities.Penthouse();


code:
App.Data.Facilities.pit = {
	baseName: "pit",
	genericName: null,
	jobs: {
		fighter: {
			position: "fighter",
			assignment: "",
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "fighter",
	manager: null
};

App.Entity.Facilities.PitFighterJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);
		if (slave.breedingMark === 1 && State.variables.propOutcome === 1) {
			r.push(`${slave.slaveName} may not participate in combat.`);
		}
		if (slave.indentureRestrictions > 1) {
			r.push(`${slave.slaveName}'s indenture forbids fighting.`);
		}
		if ((slave.indentureRestrictions > 0) && (this.facility.option("Lethal") === 1)) {
			r.push(`${slave.slaveName}'s indenture forbids lethal fights.`);
		}
		return r;
	}

	isEmployed(slave) {
		return State.variables.fighterIDs.includes(slave.ID);
	}

	employeesIndices() {
		const V = State.variables;
		const si = V.slaveIndices;
		return V.fighterIDs.map(id => si[id]);
	}
};

App.Entity.Facilities.Pit = class extends App.Entity.Facilities.SingleJobFacility {
	constructor() {
		super(App.Data.Facilities.pit,
			{
				fighter: new App.Entity.Facilities.PitFighterJob()
			});
	}

	get capacity() {
		return State.variables[this.desc.baseName] > 0 ? Number.MAX_VALUE : 0;
	}

	get hostedSlaves() {
		return State.variables.fighterIDs.length;
	}
};

App.Entity.facilities.pit = new App.Entity.Facilities.Pit();


code:
App.Data.Facilities.schoolroom = {
	baseName: "schoolroom",
	genericName: null,
	jobs: {
		student: {
			position: "",
			assignment: "learn in the schoolroom",
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "student",
	manager: {
		position: "schoolteacher",
		assignment: "be the Schoolteacher",
		careers: ["a child prodigy", "a coach", "a dean", "a historian", "a librarian", "a principal", "a private instructor", "a professor", "a scholar", "a scientist", "a teacher's pet", "a teacher", "a teaching assistant", "an archaeologist", "an astronaut", "an economist"],
		skill: "teacher",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: false,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.SchoolroomStudentJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);

		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, -20, -51)) {
			r.push(`${slave.slaveName} is too resistant to learn.`);
		}

		const maxSkill = 10 + this.facility.upgrade("Skills") * 20; // maximal skill value the school can teach
		if ((slave.intelligenceImplant >= 30) && (slave.voice === 0 || slave.accent + this.facility.upgrade("Language") <= 2) &&
			(slave.skill.oral > maxSkill) && (slave.skill.whoring > maxSkill) && (slave.skill.entertainment > maxSkill) &&
			(slave.skill.anal > maxSkill) && ((slave.vagina < 0) || (slave.skill.vaginal > maxSkill))) {
			r.push(`${slave.slaveName} has nothing left to learn.`);
		}

		if (slave.fetish === "mindbroken") {
			r.push(`${slave.slaveName}'s mind is fundamentally broken and can't learn`);
		}

		return r;
	}

	/** @private @override */
	get _employeeIDsVariableName() {
		return "SchlRiIDs";
	}
};

App.Entity.facilities.schoolroom = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.schoolroom,
	{
		student: new App.Entity.Facilities.SchoolroomStudentJob()
	}
);


code:
App.Data.Facilities.servantsQuarters = {
	baseName: "servantsQuarters",
	genericName: "Servants' Quarters",
	jobs: {
		servant: {
			position: "servant",
			assignment: "work as a servant",
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "servant",
	manager: {
		position: "stewardess",
		assignment: "be the Stewardess",
		careers: ["a barista", "a bartender", "a brewer", "a bureaucrat", "a caregiver", "a charity worker", "a club treasurer", "a concierge", "a critic", "a housekeeper", "a housesitter", "a lemonade stand operator", "a personal assistant", "a professional bartender", "a secretary", "a wedding planner", "an air hostess", "an architect", "an editor", "an estate agent", "an investor", "an office worker"],
		skill: "stewardess",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.ServantsQuartersServantJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);

		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, -20, -50, 20, -21)) {
			r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
		}
		if (!window.canWalk(slave)) {
			r.push(`${slave.slaveName} can't walk and would be unable to properly clean.`);
		}
		if (!canSee(slave)) {
			r.push(`${slave.slaveName} is blind and would be unable to properly clean.`);
		}
		return r;
	}

	/** @private @override */
	get _employeeIDsVariableName() {
		return "ServQiIDs";
	}
};

App.Entity.Facilities.ServantsQuartersStewardessJob = class extends App.Entity.Facilities.ManagingJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);
		if (slave.intelligence + slave.intelligenceImplant < -50) {
			r.push(`${slave.slaveName} is not intelligent enough.`);
		}
		return r;
	}
};

App.Entity.facilities.servantsQuarters = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.servantsQuarters,
	{
		servant: new App.Entity.Facilities.ServantsQuartersServantJob()
	},
	new App.Entity.Facilities.ServantsQuartersStewardessJob()
);


code:
App.Data.Facilities.spa = {
	baseName: "spa",
	genericName: null,
	jobs: {
		assignee: {
			position: "",
			assignment: "rest in the spa",
			publicSexUse: false,
			fuckdollAccepted: false,
		}
	},
	defaultJob: "assignee",
	manager: {
		position: "attendant",
		assignment: "be the Attendant",
		careers: ["a barber", "a cosmetologist", "a counselor", "a dispatch officer", "a fortune teller", "a groomer", "a latchkey kid", "a lifeguard", "a masseuse", "a mediator", "a personal trainer", "a police negotiator", "a psychologist", "a therapist", "a yoga instructor"],
		skill: "attendant",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldSee: false,
		shouldHear: true,
		shouldTalk: false,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.SpaAssigneeJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	canEmploy(slave) {
		let r = super.canEmploy(slave);

		if (((slave.devotion < -20 && slave.fetish !== "mindbroken") || (slave.health >= 20 && slave.trust > 60 && slave.devotion > 60 && slave.fetish !== "mindbroken" && slave.sexualFlaw === "none" && slave.behavioralFlaw === "none"))) {
			r.push(`${slave.slaveName} will not benefit from time at ${this.facility.name}.`);
		}

		return r;
	}
};

App.Entity.facilities.spa = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.spa,
	{
		assignee: new App.Entity.Facilities.SpaAssigneeJob()
	}
);


code:
:: Encyclopedia Widgets [nobr widget]

/* TODO: add entries for Nursery */

<<widget "encyclopediaEntryAttendingClasses">>
''Attending classes'' is an assignment which educates the slave, raising intelligence if possible. Being educated raises value and is useful for some jobs and leadership positions.
<</widget>>

<<widget "encyclopediaEntryConfinement">>
''Confinement'' is an assignment which accelerates breaking for disobedient slaves. If a slave isn't obedient enough to work and isn't
<<if passage() == "Encyclopedia">>
	[[unhealthy|Encyclopedia][$encyclopedia = "Health"]]
<<else>>
	[[unhealthy|Encyclopedia][$encyclopedia = "Health",$nextButton = "Back",$nextLink = "Main"]]
<</if>>
enough to need rest, this will make them useful sooner.
<</widget>>

<<widget "encyclopediaEntryFucktoy">>
''Fucktoy service'' is an assignment which keeps the slave close and under the player's eye. It's mostly just for fun, but fucktoys can improve reputation based on their beauty, and the player character's attention can be targeted to areas of the slave's body with possible fetish effects on happy slaves.
<</widget>>

<<widget "encyclopediaEntryGloryHole">>
''Occupying a glory hole'' is an assignment which makes money off of slaves regardless of their beauty, skills, or feelings; it's not fun or
<<if passage() == "Encyclopedia">>
	[[healthy|Encyclopedia][$encyclopedia = "Health"]],
<<else>>
	[[healthy|Encyclopedia][$encyclopedia = "Health",$nextButton = "Back",$nextLink = "Main"]],
<</if>>
but very powerful for extracting ¤ out of otherwise useless slaves.
<</widget>>

<<widget "encyclopediaEntryMilking">>
''Getting milked'' is an assignment which makes money from lactation based on a slave's breasts,
<<if passage() == "Encyclopedia">>
	[[health|Encyclopedia][$encyclopedia = "Health"]],
<<else>>
	[[health|Encyclopedia][$encyclopedia = "Health",$nextButton = "Back",$nextLink = "Main"]],
<</if>>
and hormonal status.<<if $seeDicks > 0>> Cows with balls will also give semen.<</if>> Creates profit quickly from slaves with big tits<<if $seeDicks > 0>> or balls<</if>>.
<</widget>>

<<widget "encyclopediaEntryFarming">>
''Farming'' is an assignment which produces
<<if passage() == "Encyclopedia">>
	[[food|Encyclopedia][$encyclopedia = "Food"]]
<<else>>
	[[food|Encyclopedia][$encyclopedia = "Food",$nextButton = "Back",$nextLink = "Main"]]
<</if>>
from your slaves' hard work<<if $seeBestiality == 1>> and allows you to breed slaves with animals<</if>>. Can also reduce arcology upkeep with upgrades in the
<<if passage() == "Encyclopedia">>
	[[Farmyard|Encyclopedia][$encyclopedia = "Farmyard"]].
<<else>>
	[[Farmyard|Encyclopedia][$encyclopedia = "Farmyard",$nextButton = "Back",$nextLink = "Main"]].
<</if>>
<</widget>>

<<widget "encyclopediaEntryPublicService">>
''Public Service'' is an assignment which increases reputation based on a slave's beauty, sexual appeal, and skills. Very similar to whoring, but for reputation rather than money.
<</widget>>

<<widget "encyclopediaEntryRest">>
''Rest'' is an assignment mostly used to improve
<<if passage() == "Encyclopedia">>
	[[health|Encyclopedia][$encyclopedia = "Health"]].
<<else>>
	[[health|Encyclopedia][$encyclopedia = "Health",$nextButton = "Back",$nextLink = "Main"]].
<</if>>
It can be useful to order slaves you wish to intensively modify to rest, since most modifications damage health. It will synergize with curative treatments, providing bonus healing when both are simultaneously applied.
<</widget>>

<<widget "encyclopediaEntrySexualServitude">>
''Sexual servitude'' is an assignment which pleases other slaves by forcing the slave to service them sexually. Useful for driving the targeted slave's
<<if passage() == "Encyclopedia">>
	[[devotion|Encyclopedia][$encyclopedia = "Devotion"]]
<<else>>
	[[devotion|Encyclopedia][$encyclopedia = "Devotion",$nextButton = "Back",$nextLink = "Main"]]
<</if>>
up quickly.
<</widget>>

<<widget "encyclopediaEntryServitude">>
''Servitude'' is an assignment which reduces your upkeep based on the slave's
<<if passage() == "Encyclopedia">>
	[[devotion|Encyclopedia][$encyclopedia = "Devotion"]].
<<else>>
	[[devotion|Encyclopedia][$encyclopedia = "Devotion",$nextButton = "Back",$nextLink = "Main"]].
<</if>>
Available at lower obedience than other jobs, is insensitive to the quality of a slave's body, and doesn't require skills; a good transitional assignment. Unusually, low sex drive is advantageous as a servant, since it reduces distraction. Lactating slaves are slightly better at this job, since they can contribute to their fellow slaves' nutrition.
<</widget>>

<<widget "encyclopediaEntryWhoring">>
''Whoring'' is an assignment which makes money based on a slave's beauty, sexual appeal, and skills. Good whores take a long time to train and beautify but become very profitable.
<</widget>>


code:
:: PassageDone

<<if window.savedColorMap>>
	<<addclass "body" "lightTheme">>
<</if>>


code:
/* Accordion 000-250-006 */

button.accordion {
	cursor: pointer;
	padding: 5px;
	width: 100%;
	margin-bottom: 10px;
	border-bottom: 3px double;
	border-right: 3px double;
	border-left: none;
	border-top: none;
	text-align: left;
	outline: none;
	transition: 0.2s;
	background-color: transparent;
}

button.accordion.active, button.accordion:hover {
	background-color: transparent;
}

button.accordion:before {
	content: '\002B';
	color: #777;
	font-weight: bold;
	float: left;
	margin-right: 5px;
}

.unStaffed {
	background-color: transparent;
	padding: .5em .2em;
	margin-bottom: 1em;
	border-bottom: thin inset grey;
}

.unStaffed:before {
	content: '\00D7';
	color: #777;
	font-weight: bold;
	color: red;
	float: left;
	margin-right: 5px;
}

.unStaffed:after {
	content: attr(data-after);
	float: right;
	margin-left: 2em;
	font-weight: strong;
	color: green;
}

button.accordion:after {
	content: attr(data-after);
	float: right;
	margin-left: 2em;
	font-weight: normal;
	color: green;
}

button.accordion.active:before {
	content: "\2212";
}

.accHidden {
	padding: 0 18px;
	margin-top: 5px;
	margin-bottom: 5px;
	max-height: 0;
	overflow: hidden;
}

div.accordion:before {
	content: '\002B';
	color: #777;
	font-weight: bold;
	float: left;
	margin-right: 5px;
}
div.accordion.active:before {
	content: "\2212";
}


code:
#graph .linage {
	fill: none;
	stroke: white;
}
#graph .marriage {
	fill: none;
	stroke: white;
}
#graph .node {
	background-color: lightblue;
	border-style: solid;
	border-width: 1px;
}
#graph .nodeText{
	font: 10px sans-serif;
	margin: 0;
	padding: 0;
	color: black;
}
#graph {
	font: 10px sans-serif;
	margin: -20px 0;
	padding: 0;
	color: black;
}

#graph div {
	border-style: solid;
	border-width: 1px;
}

#graph .XY {
	background-color: lightblue;
}

#graph div.XX {
	background-color: pink;
}

#graph div.unknown {
	background-color: gray;
}

#graph div.unknownXY {
	background-color: #808080;
}

#graph div.unknownXX {
	background-color: #808080;
}

#graph .you {
	background-color: red;
}

#graph .emphasis {
	font-style: italic;
	font-weight: bold;
	margin: 0;
	background: #ffffff88;
	border: 2px solid Gold;
	white-space: nowrap;
}

#editFamily {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

#editFamily #familyTable {
}


code:
body {
	overflow-x: hidden;
}

/* makes HR colorflip compatible */
hr {
	background:#ccc;
	border:0;
}

/* clears SugarCube's default transition */
.passage {
	transition: none;
	-webkit-transition: none;
}

.passage-in {
	opacity: 1 !important;
}

/* default is 54em */
#passages {
	max-width: 100%;
}

/* small trick to hide broken images */
img {
	text-indent: -10000px;
}

.imageColumn { /* TODO: this is mostly a copy of imageRef to get its flex features working properly. They can probably be removed from imageRef at some point */
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	align-items: flex-start;
	position: relative;
	float: right;
}

.imageRef {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	align-items: flex-start;
	position: relative;
	background-color: rgba(80, 80, 80, 0.5);
	margin: 2px;
}

.tinyImg {
	height: 120px;
	width: 120px;
	float: left;
}

.smlImg {
	height: 150px;
	width: 150px;
	float: left;
}

.smlImg > img, .smlImg > video {
	height: auto;
}

.medImg {
	height: 300px;
	width: 300px;
	float: right;
}

.medImg > img, .medImg > video {
	height: auto;
}

.lrgRender {
	height: 531px;
	width: 531px;
	margin-right: -50px;
	margin-left: -50px;
	float: right;
	z-index: -1;
}

.lrgVector {
	height: 600px;
	width: 600px;
	margin-right: -125px;
	margin-left: -125px;
	float: right;
	z-index: -1;
}

.lrgRender > div.mask {
	width: 150px;
	height: 100%;
	background: linear-gradient(90deg, rgba(17,17,17,1), rgba(17,17,17,0.8) 60%, rgba(17,17,17,0));
	z-index: 1;
	/*position: absolute;*/
}

.lrgRender > img, .lrgRender > video {
	margin-left: -150px;
	height: 531px;
	width: auto;
}

.lrgVector > div.mask {
	width: 150px;
	height: 100%;
	background: linear-gradient(90deg, rgba(17,17,17,1), rgba(17,17,17,0.8) 60%, rgba(17,17,17,0));
	z-index: 1;
}

.lrgVector > img, .lrgVector > video {
	margin-left: -150px;
	height: 600px;
	width: auto;
}

.lrgVector svg {
	width: 336px;
}

object {
	object-fit: scale-down;
	position: absolute;
	top: 0;
	left: 0;
}

img.paperdoll {
	position: absolute;
	top: 0;
	left: 0;
	margin-left: 0;
}

span.plusButton {
	display: inline-block;
	line-height: 25px;
	width: 20px;
	text-align: center;
	border: 1px solid rgba(0, 139, 0, 0.3);
	background: rgba(0, 139, 0, 0.2);
	margin: 2px 0;
}

span.minusButton {
	display: inline-block;
	line-height: 25px;
	width: 20px;
	text-align: center;
	border: 1px solid rgba(184, 0, 0, 0.3);
	background: rgba(184, 0, 0, 0.2);
	margin: 2px 0;
}

span.zeroButton {
	display: inline-block;
	line-height: 25px;
	width: 20px;
	text-align: center;
	border: 1px solid rgba(0, 0, 255, 0.3);
	background: rgba(0, 0, 255, 0.2);
	margin: 2px 0;
}

span.plusButton:hover { background: rgba(0, 139, 0, 0.4); }
span.minusButton:hover { background: rgba(184, 0, 0, 0.4); }
span.zeroButton:hover { background: rgba(0, 0, 255, 0.4); }

span.plusButton > a { display: block; }
span.minusButton > a { display: block; }
span.zeroButton > a { display: block; }

span.plusButton > a:hover { text-decoration: none; }
span.minusButton > a:hover { text-decoration: none; }
span.zeroButton > a:hover { text-decoration: none; }

/* Colors are made as css classes, to allow them to be changed for a light color scheme (for example). */
.link { color: #68D } /* link color */
.aquamarine { color: aquamarine }
.coral { color: coral }
.cyan { color: cyan }
.darkgoldenrod { color: darkgoldenrod }
.darkred { color: darkred }
.darkviolet { color: darkviolet }
.deeppink { color: deeppink }
.steelblue { color: steelblue }
.deepskyblue { color: deepskyblue }
.dodgerblue { color: dodgerblue }
.blue { color: blue }
.gold { color: gold }
.goldenrod { color: goldenrod }
.gray { color: gray }
.green { color: green }
.hotpink { color: hotpink }
.lawngreen { color: lawngreen }
.lightblue { color: lightblue }
.lightcoral { color: lightcoral }
.lightgreen { color: lightgreen }
.lightpink { color: lightpink }
.lightsalmon { color: lightsalmon }
.lime { color: lime }
.limegreen { color: limegreen }
.magenta { color: magenta }
.mediumaquamarine { color: mediumaquamarine }
.mediumorchid { color: mediumorchid }
.mediumseagreen { color: mediumseagreen }
.orange { color: orange }
.orangered { color: orangered }
.orchid { color: orchid }
.pink { color: pink }
.red { color: red }
.seagreen { color: seagreen }
.springgreen { color: springgreen }
.tan { color: tan }
.chocolate { color: chocolate }
.saddlebrown { color: saddlebrown }
.teal { color: teal }
.yellow { color: yellow }
.yellowgreen { color: yellowgreen }

.link a { color: #68D } /* link color */
.aquamarine a { color: aquamarine }
.coral a { color: coral }
.cyan a { color: cyan }
.darkgoldenrod a { color: darkgoldenrod }
.darkred a { color: darkred }
.darkviolet a { color: darkviolet }
.deeppink a { color: deeppink }
.steelblue a { color: steelblue }
.deepskyblue a { color: deepskyblue }
.dodgerblue a { color: dodgerblue }
.blue a { color: blue }
.gold a { color: gold }
.goldenrod a { color: goldenrod }
.gray a { color: gray }
.green a { color: green }
.hotpink a { color: hotpink }
.lawngreen a { color: lawngreen }
.lightblue a { color: lightblue }
.lightcoral a { color: lightcoral }
.lightgreen a { color: lightgreen }
.lightpink a { color: lightpink }
.lightsalmon a { color: lightsalmon }
.lime a { color: lime }
.limegreen a { color: limegreen }
.magenta a { color: magenta }
.mediumaquamarine a { color: mediumaquamarine }
.mediumorchid a { color: mediumorchid }
.mediumseagreen a { color: mediumseagreen }
.orange a { color: orange }
.orangered a { color: orangered }
.orchid a { color: orchid }
.pink a { color: pink }
.red a { color: red }
.seagreen a { color: seagreen }
.springgreen a { color: springgreen }
.tan a { color: tan }
.chocolate a { color: chocolate }
.saddlebrown a { color: saddlebrown }
.teal a { color: teal }
.yellow a { color: yellow }
.yellowgreen a { color: yellowgreen }

/*! <<checkvars>> macro for SugarCube 2.x */
#ui-dialog-body.checkvars{padding:1em}#ui-dialog-body.checkvars h1{font-size:1em;margin-top:0}#ui-dialog-body.checkvars table{border-collapse:collapse;border-spacing:0}#ui-dialog-body.checkvars thead tr{border-bottom:2px solid #444}#ui-dialog-body.checkvars tr:not(:first-child){border-top:1px solid #444}#ui-dialog-body.checkvars td,#ui-dialog-body.checkvars th{padding:.25em 1em}#ui-dialog-body.checkvars td:first-child,#ui-dialog-body.checkvars th:first-child{padding-left:.5em;border-right:1px solid #444}#ui-dialog-body.checkvars td:last-child,#ui-dialog-body.checkvars th:last-child{padding-right:.5em}#ui-dialog-body.checkvars th:first-child{text-align:center}#ui-dialog-body.checkvars td:first-child{font-weight:700;text-align:right}#ui-dialog-body.checkvars td{font-family:monospace,monospace;vertical-align:top;white-space:pre-wrap}#ui-dialog-body.checkvars .scroll-pad{margin:0;padding:0}

/*! <<bugreport>> macro for SugarCube 2.x */
#ui-dialog-body.bugreport #bugreport-info{margin-bottom:1em}#ui-dialog-body.bugreport #bugreport-data{display:block;overflow:auto;font-family:monospace,monospace;background-color:transparent;border:1px solid #444;margin:0;padding:6px;height:auto;min-height:200px;white-space:normal}#ui-dialog-body.bugreport .scroll-pad{margin:0;padding:0}

div.output{
width: 100%;
width: 100vw;
max-width: 100%;
word-break: break-all;
white-space: normal;
}
/* css rules for rules assistant */
.rajs-listitem {
	display: inline-block;
	color: #68D;
	margin-right: 1em;
}
.rajs-listitem:last-of-type { margin-right: 0; }
.rajs-listitem:hover {
	cursor: pointer;
	text-decoration: underline;
}
.rajs-list strong:first-of-type, .rajs-list input {
	margin-right: 2em;
}
.rajs-listitem input {
	margin: 0.25em;
}
.rajs-section h1 {
	border-bottom: 1px solid white;
	cursor: pointer;
}
.rajs-section h1:hover { text-decoration: underline; }

.scroll {
	overflow: auto;
}


code:
.optionMacro {
	margin-top: 8px;
	display: inline-block;
}

.optionDescription {
	display: inline-block;
	width: 500px;
	margin-right: 10px;
	line-height: 1.2;
	text-align: right;
}

@media only screen and (max-width: 1200px) {
	.optionDescription {
		display: block;
		width: unset;
		text-align: left;
	}

	.optionMacro {
		margin-top: 30px;
	}

}

.optionMacroOption {
	border: #555 solid 0.5px;
	border-top-width: 0;
	vertical-align: top;
	-moz-user-select: none;
	min-width: 79px; /* 80px - 1px for border */
	display: inline-block;
	text-align: center;
}

.optionComment {
	vertical-align: top;
	color: gray;
	padding-left: 10px;
}

/* But don't add the | after the last one */
.optionMacroOption:last-child {
	border-top-right-radius: 6px;
	border-bottom-right-radius: 6px;
	border-right-width: 0;
}

.optionMacroOption:first-child {
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
}

.optionMacroOption a {
	padding: 0 10px;
	box-sizing: border-box;
	width: 100%;
	display: block;
}

.optionMacroOption:hover {
	background: #2F2F2F;
}

body.lightTheme .optionMacroOption:hover {
	background: #DDDDDD;
}

body.lightTheme .optionMacroSelected {
	background: #DDDDDD;
}

.optionMacroSelected {
	background: #2F2F2F;
	padding: 0 10px;
	min-width: 80px;
	cursor: pointer;
	box-sizing: border-box;
}

.optionValue {
	display: inline-flex;
	flex-wrap: wrap;
}

.optionValue input {
	padding: 3px 3px 3px 10px;
	background: transparent;
	border: #555 solid 0.5px;
	border-top-width: 0;
	min-width: unset;
	width: 140px;
	height: 22px;
}

.optionMacroNumber input {
	width: 50px;
}

.optionValue input:last-child {
	border-top-right-radius: 6px;
	border-bottom-right-radius: 6px;
	border-right-width: 0;
}

.optionValue input:first-child {
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
}

.optionMacroSelected.optionMacroEnable {
	color: rgb(230,255,230);
	background-image: linear-gradient(rgba(0, 255,0, 0.12), transparent);
}

.optionMacroSelected.optionMacroDisable {
	color: rgb(255,240,240);
	background-image: linear-gradient(rgba(255, 100, 0, 0.2), transparent);
}


code:
.hidden
{
	display:none;
}

div.quicklist.devotion button.mindbroken
{
	background-color:red;
}
div.quicklist.devotion button.very-hateful
{
	background-color:darkviolet;
}
div.quicklist.devotion button.hateful
{
	background-color:darkviolet;
}
div.quicklist.devotion button.resistant
{
	background-color:mediumorchid;
}
div.quicklist.devotion button.ambivalent
{
	background-color: yellow;
	color: #444444;
}
div.quicklist.devotion button.accepting
{
	background-color: hotpink;
}
div.quicklist.devotion button.devoted
{
	background-color: deeppink;
}
div.quicklist.devotion button.worshipful
{
	background-color: magenta;
}
div.quicklist.trust button.mindbroken
{
	background-color:red;
}
div.quicklist.trust button.extremely-terrified
{
	background-color: darkgoldenrod;
}
div.quicklist.trust button.terrified
{
	background-color: goldenrod;
}
div.quicklist.trust button.frightened
{
	background-color: gold;
	color: coral;
}
div.quicklist.trust button.fearful
{
	background-color: yellow;
	color: green;
}
div.quicklist.trust button.hate-careful
{
	background-color: orange;
}
div.quicklist.trust button.careful
{
	background-color: mediumaquamarine;
	color: forestgreen;
}
div.quicklist.trust button.bold
{
	background-color: orangered;
}
div.quicklist.trust button.trusting
{
	background-color: mediumseagreen;
}
div.quicklist.trust button.defiant
{
	background-color: darkred;
}
div.quicklist.trust button.profoundly-trusting
{
	background-color: seagreen;
}
div.quicklist
{
	table-layout: fixed;
	text-align: center;
	border-collapse: separate;
	border-spacing: 2px;
	border-style: hidden;
	empty-cells: hide;
	width: 70%;
}
div.quicklist button
{
	margin-top: 15px;
	margin-right: 20px;
	white-space: nowrap;
}


code:
/* Stylesheet for WardrobeUse.tw */

#passage-wardrobe-use .optionMacro {
	display: inline;
}

#passage-wardrobe-use .optionDescription {
	width: unset;
	text-align: left;
}

#passage-wardrobe-use .optionValue {
	display: flex;
}

#passage-wardrobe-use .optionMacroOption {
	flex-grow: 1;
}

/* Last line shouldn't grow */
#passage-wardrobe-use .optionValue::after {
	flex-grow: 1000000000;
	content: '';
}


code:
:: Alpha disclaimer

<<set $ui = "start">>\
//version $ver mod version $pmodVer build $releaseID//
@@.green;//Mod: expanded age ranges and other tweaks 2016-08-30//@@ @@.darkred;+SV@@
@@.green;//Mod: extra preg content and other crap//@@

''This is an alpha.'' That means the game is missing content, is full of bugs, is imbalanced, and is generally in an incomplete state. The game will keep a start of turn autosave. If you encounter a bug, we strongly recommend you reload your start of turn autosave immediately. Please submit your feedback and bug reports at https://gitgud.io/pregmodfan/fc-pregmod/issues. Consider attaching a save file and screenshot of the problem.  This Pregmod is a modification of the original <i>Free Cities</i> created by FCdev, which can be seen at https://freecitiesblog.blogspot.com/.

An in-game encyclopedia is available from the sidebar (or [[here|Encyclopedia][$nextButton = "Back", $nextLink = passage()]] if you'd prefer to have a look before starting), with answers to most basic gameplay questions.

__Important note for new players, and a reminder for FC veterans:__ when the player is offered a set of choices, the ''Continue'' button at the top of the left sidebar will almost always remain available. Using this to decline all the options presented is //not cheating.// If it's available, it's supposed to be available. It represents the player character politely bowing out of the situation.

If you enjoy FC and feel like using your real-life ¤ to express gratitude, you can do so at https://www.patreon.com/freecitiesdev?ty=h. It's a tip jar, not support for more content. I'm doing this for fun; let's keep it that way.

''Saves from versions prior to 0.6 are not compatible.''

@@.yellow;This is a text-based game that includes descriptions of sexual activity, graphic violence, drug use, and other subjects not suitable for persons under the age of 18. This is a work of fiction; any resemblance to actual persons, places, or events is unintended.@@

[[I am 18 or more years of age, I understand, and I wish to continue|Economy Intro]]


code:
:: SVG filters

<html>
<svg class="defs-only" style="width: 0; height: 0; position: absolute;">
	<filter id="skin-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.15 0 0 0 0 0 0.1 0 0 0 0 0 0.05 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-bronzed" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0.1 0 0 0 0.6 0 0 0 0 0 0.3 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dark" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0 "/>
	</filter>
	<filter id="skin-ebony" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.1 0 0 0 0 0 0.05 0 0 0 0 0 0.05 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-extremely-pale" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.05 0 0 0 0 0 1.05 0 0 0 0 0 1.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-fair" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.8 0 0 0.2 0 0 0.8 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="skin-light" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0.5 0 0.5 0 0 0.5 0 0 0.5 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="skin-light-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.7 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-olive" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0 0 0.8 0 0 0 0 0 0.6 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-pale" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.6 0 0 0.4 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-tanned" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.65 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-white" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dyed-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.25 0 0 0.2 0 0 0 0 0.3 0 0 0 1 0 "/>
	</filter>
	<filter id="skin-dyed-green" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0.2 0.65 0.15 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dyed-blue" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.3 0 0 0 0 0 0.5 0 0 0 0.4 0.2 0.25 0 0.1 0 0 0 1 0"/>
	</filter>

	<filter id="hair-ashen" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.1 0 0.7 0 0 0.1 0 0 0.7 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-auburn" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.2 0 0 0 0 0 0.15 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-blazing-red" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="0.10" />
			<feFuncG type="gamma" exponent="3.00" />
			<feFuncB type="gamma" exponent="7.50" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.4 0 0 0 0 0 1.3 0 0 0 0 0 0.7 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-blue" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.3 0 0 0 0 0 0.5 0 0 0 0.4 0.2 0.25 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-bright-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.2 0 0.4 0 0 0 0 0 0.1 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-brunette" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-burgundy" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.45 0 0 0 0.25 0 0.2 0 0 0.1 0 0 0.3 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="hair-chestnut" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0.2 0 0.7 0 0 0 0 0 0.1 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-chocolate-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-copper" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 -0.2 0 0.8 0 0 -0.2 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.1 0 0 0 0 0 0.9 0 0 0 0 0 0.4 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0 0 0.35 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.2 0 0.15 0 0 0.1 0 0 0 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-deep-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 -0.3 0 0.3 0 0 -0.1 0 0 0 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dirty-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.3 0 0.7 0 0 0.3 0 0 0.2 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="hair-fair-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.5 0 0.8 0 0 0.4 0 0 0.6 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="hair-ginger" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.2 0 0 0 0.1 0 0.9 0 0 0 0 0 0.1 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-golden" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.7 0 0 0 -0.1 0 1.5 0 0 -0.1 0 0 0.1 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-golden-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.8 0 0 0 -0.3 0 1.6 0 0 -0.4 0 0 0.3 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-green" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0.2 0.65 0.15 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-gray" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-grey" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-hazel" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.5 0 0 0.2 0 0 0.15 0 0.15 0 0 0 1 0"/>
	</filter>
	<filter id="hair-light-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.7 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-light-purple" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.4 0 0.1 0 0 0.2 0 0 0.7 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-neon-blue" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="3.75" />
			<feFuncG type="gamma" exponent="0.75" />
			<feFuncB type="gamma" exponent="0.25" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-neon-green" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="3.00" />
			<feFuncG type="gamma" exponent="0.25" />
			<feFuncB type="gamma" exponent="0.98" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-neon-pink" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="0.10" />
			<feFuncG type="gamma" exponent="1.00" />
			<feFuncB type="gamma" exponent="0.50" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-olive" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0 0.6 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-onyx-black" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="5.50" />
			<feFuncG type="gamma" exponent="6.00" />
			<feFuncB type="gamma" exponent="7.00" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-pale-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.45 0 0 0 0.7 0 0.4 0 0 0.7 0 0 0.6 0 0.4 0 0 0 1 0"/>
	</filter>
	<filter id="hair-peachy" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.45 0 0 0 0 0 1.4 -0.1 0 -0.1 0 0 0.85 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-pink" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 0 0 1.5 -0.2 0 -0.2 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-platinum-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.6 0 0 0.4 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-purple" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0 0 0.2 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-raven-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.2 0 0 0 0 0 0.2 0 0 0 0 0 0.3 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.25 0 0 0.2 0 0 0 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-red-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.25 0 0.8 0 0 0.1 0 0 0.35 0 0.15 0 0 0 1 0"/>
	</filter>
	<filter id="hair-silver" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.3 0 0.8 0 0 0.3 0 0 0.8 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-strawberry-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.2 0 0 0 0.2 0 1.2 0 0 0 0 0 0.7 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-violet" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="2 -1 0 0 0 0 2 -1 0 0 -1 0 2 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-white" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.5 0 0.6 0 0 0.5 0 0 0.6 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="hair-white-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.5 0 0.7 0 0 0.5 0 0 0.5 0 0.4 0 0 0 1 0"/>
	</filter>
</svg>
</html>