code:
:: Dairy Report [nobr]

<<set _MMWorkout = 0>>

<<SlaveSort $DairyiIDs>>
<<set _DL = $DairyiIDs.length, $dairySlaves = _DL, _SL = $slaves.length, $bioreactorPerfectedID = 0, $legendaryBallsID = 0, $legendaryCowID = 0, $milkmaidDevotionBonus = 1, $milkmaidHealthBonus = 0, $milkmaidTrustBonus = 1, $milkmaidDevotionThreshold = 45, $milkmaidTrustThreshold = 35, _anusesStretched = 0, _birthers = 0, _births = 0, _cumWeek = 0, _femCumWeek = 0, _FLsFetish = 0, _milkWeek = 0, _balltacular = 0, _boobtacular = 0, _careerForgotten = 0, _chemMinor = 0, _chemSevere = 0, _desterilized = 0, _hatefilled = 0, _horrified = 0, $intelligenceLost = 0, _mindbroken = 0, _profits = 0, _skillsLost = 0, _stupidified = 0, _vaginasStretched = 0>>

<<set $facility = $facility || {}, $facility.dairy = initFacilityStatistics($facility.dairy)>>

<<if ($Milkmaid != 0)>>
	<<set _FLs = $slaves.findIndex(function(s) { return s.ID == $Milkmaid.ID; })>>

	<<if $slaves[_FLs].health < 90>>
		<<set $slaves[_FLs].curatives = 2>>
	<<else>>
		<<set $slaves[_FLs].curatives = 0>>
	<</if>>
	<<if ($slaves[_FLs].diet != "healthy")>>
		<<set ($slaves[_FLs].diet = "healthy")>>
	<</if>>
	<<if $slaves[_FLs].devotion <= 60>>
		<<set $slaves[_FLs].devotion += 5>>
	<</if>>
	<<if $slaves[_FLs].trust < 60>>
		<<set $slaves[_FLs].trust += 5>>
	<</if>>
	<<if ($slaves[_FLs].oralSkill > 0)>>
		<<set $milkmaidDevotionBonus += Math.trunc($slaves[_FLs].oralSkill/30)>>
	<</if>>
	<<if ($slaves[_FLs].health >= 80)>>
		<<set $milkmaidHealthBonus++>>
	<</if>>
	<<if $slaves[_FLs].livingRules != "luxurious">>
		<<set $slaves[_FLs].livingRules = "luxurious">>
	<</if>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "boobs">>
			<<fetishChangeChance $slaves[_FLs]>>
			<<if $fetishChangeChance > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "boobs">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	<<run getSlaveStatisticData($Milkmaid, $facility.dairy)>>
	<<set $Milkmaid = $slaves[_FLs], $i = _FLs>>
	    <<SlaveFullName $Milkmaid>> is serving as your Milkmaid.
	<<if $Milkmaid.relationship == -3 && $Milkmaid.devotion > 50>>
		<<set $milkmaidDevotionBonus += 2, $milkmaidTrustBonus += 2>>
		She tries her best to be your perfect farmwife.
	<</if>>
	<<if (_DL > 0) && ($milkmaidImpregnates == 1) && (canPenetrate($Milkmaid)) && $Milkmaid.pubertyXY == 1>>
		<<set _milkmaidImpregnated = 0>>
		<<for _dI = 0; _dI < _DL; _dI++>>
			<<set $i = $slaveIndices[$DairyiIDs[_dI]]>>
			<<if (canImpreg($slaves[$i], $Milkmaid))>>
				<<set $slaves[$i].preg = 1, $slaves[$i].pregSource = $Milkmaid.ID, $slaves[$i].pregKnown = 1, $slaves[$i].pregWeek = 1, _milkmaidImpregnated++, $slaves[$i].vaginalCount += 10, $vaginalTotal += 10>>
				<<set $slaves[$i].pregType = setPregType($slaves[$i])>>
				<<set WombImpregnate($slaves[$i], $slaves[$i].pregType, $Milkmaid.ID, 1)>>
			<</if>>
		<</for>>
		<<if _milkmaidImpregnated > 0>>
			It's her responsibility to keep her charges pregnant, and she constantly
			<<if _milkmaidImpregnated == 1>>
				breeds the one fertile cow.
			<<else>>
				fills the _milkmaidImpregnated cows' cunts with her cum.
			<</if>>
			<<if $Milkmaid.career == "a breeding bull">>
				She was conditioned to fill empty wombs, so she takes a @@.hotpink;deep pleasure@@ in her job.
				<<set $slaves[_FLs].devotion++>>
			<</if>>
			<<set _Tmult = (_milkmaidImpregnated * 10), $slaves[_FLs].penetrativeCount += _Tmult, $Milkmaid.penetrativeCount += _Tmult, $penetrativeTotal += _Tmult>>
			<<set $slaves[_FLs].need = 0>>
		<</if>>
	<</if>>
	<<if (_FLsFetish == 1)>>
		In her line of work, she touches more breasts than even you do. She lives in an atmosphere of quivering, heaving, milky breastflesh; of girls who shudder and moan when she touches their creamy nipples. She has @@.lightcoral;become more of a breast girl.@@
	<<elseif (_FLsFetish == 2)>>
		It's a hard life, pulling teats and washing cows, but it does @@.lightsalmon;make her more of a breast fetishist.@@
	<</if>>
	<<if ($Milkmaid.muscles > 30)>>
		<<set $milkmaidHealthBonus++>>
		Her muscles help her handle the fattest or most reluctant cow.
	<</if>>
	<<if $dairyRestraintsSetting != 2>> /* how much effort the MM must take to force a slave into a stall */
		<<for _dI = 0; _dI < _DL; _dI++>>
			<<set $i =  $slaveIndices[$DairyiIDs[_dI]]>>
			<<if $slaves[$i].devotion < 20>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].trust < 20>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].muscles >= 30>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].weight >= 70>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].weight >= 160>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].boobs >= 20000>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].balls >= 30>>
				<<set _MMWorkout++>>
			<</if>>
			<<if $slaves[$i].belly >= 5000>>
				<<set _MMWorkout++>>
			<</if>>
			<<if !canWalk($slaves[$i])>> /* big bonus if they can't move themselves and are fat as cows */
				<<if $slaves[$i].weight >= 70>>
					<<set _MMWorkout += 2>>
				<</if>>
				<<if $slaves[$i].weight >= 160>>
					<<set _MMWorkout += 2>>
				<</if>>
				<<if $slaves[$i].boobs >= 20000>>
					<<set _MMWorkout += 2>>
				<</if>>
				<<if $slaves[$i].balls >= 30>>
					<<set _MMWorkout += 2>>
				<</if>>
				<<if $slaves[$i].belly >= 5000>>
					<<set _MMWorkout += 2>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if (_MMWorkout > random(1,30)) && $Milkmaid.muscles < 60>>
		Constantly having to wrestle unruly or aiding heavy cows into their stalls forces her to @@.lime;build muscle.@@
		<<set $slaves[_FLs].muscles++>>
	<</if>>
	<<if ($Milkmaid.oralSkill > 30)>>
		Her skilled tongue helps her keep her girls happy.
	<</if>>
	<<if ($Milkmaid.oralSkill < 90)>>
		<<set $skillIncrease = 3>>
		<<OralSkillIncrease $slaves[_FLs]>>
	<</if>>
	<<if ($Milkmaid.sexualQuirk == "caring")>>
		<<set $milkmaidTrustBonus++>>
		She's very caring, and does her best to get the cows to trust her.
	<</if>>
	<<if ($Milkmaid.behavioralQuirk == "funny")>>
		<<set $milkmaidTrustBonus++>>
		She's funny, and does her best to get the cows to trust her by keeping them laughing.
	<</if>>
	<<if setup.milkmaidCareers.includes($Milkmaid.career)>>
		<<set $milkmaidHealthBonus++>>
		She has career experience dealing with milk animals.
	<<elseif $Milkmaid.skillMM >= $masteredXP>>
		<<set $milkmaidHealthBonus++>>
		She has experience dealing with milk animals from working for you.
	<<else>>
		<<set $slaves[_FLs].skillMM += random(1,($Milkmaid.intelligence+4)*2)>>
	<</if>>
	<<if ($dairyStimulatorsSetting < 2) && ($Milkmaid.dick > 4) && (canPenetrate($Milkmaid))>>
		<<for _dI = 0; _dI < _DL; _dI++>>
			<<set $i = $slaveIndices[$DairyiIDs[_dI]]>>
			<<if ($slaves[$i].balls > 0)>>
				She uses her turgid cock to give prostate stimulation to slaves that need help ejaculating.
				<<set $slaves[_FLs].need -= 50>>
				<<break>>
			<</if>>
		<</for>>
	<</if>>
	<<set $milkmaidDevotionThreshold += (5*$milkmaidDevotionBonus), $milkmaidTrustThreshold += (5*$milkmaidTrustBonus)>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$DairyiIDs[_dI]]>>
		<<if $Milkmaid.rivalryTarget == $slaves[$i].ID>>
			She either neglects or harasses her <<if $Milkmaid.rivalry == 1>>growing rival<<elseif $Milkmaid.rivalry == 2>>rival<<elseif $Milkmaid.rivalry == 3>>bitter rival<</if>>, $slaves[$i].slaveName, making sure she is unhappy and uncomfortable.
			<<set $slaves[$i].devotion -= 3, $slaves[$i].trust -= 3>>
			<<if random(1,100) > 65>>
				<<set $Milkmaid.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>>
			<</if>>
		<<elseif $Milkmaid.relationshipTarget == $slaves[$i].ID>>
			She dotes over her <<if $Milkmaid.relationship == 1>>friend<<elseif $Milkmaid.relationship == 2>>best friend<<elseif $Milkmaid.relationship == 3>>friend with benefits<<elseif $Milkmaid.relationship == 4>>lover<<elseif $Milkmaid.relationship == 5>>slave wife<</if>>, $slaves[$i].slaveName, making sure she is happy and comfortable.
			<<set $slaves[$i].devotion++, $slaves[$i].trust++>>
		<<elseif $familyTesting == 1 && totalRelatives($slaves[$i]) > 0>>
			<<if $slaves[$i].mother == $Milkmaid.ID || $slaves[$i].father == $Milkmaid.ID>>
				She pays special attention to her daughter, $slaves[$i].slaveName, making sure she is well kept and happy.
				<<set $slaves[$i].trust++>>
			<<elseif $slaves[$i].ID == $Milkmaid.mother>>
				She pays special attention to her mother, $slaves[$i].slaveName, making sure she is well kept and happy.
				<<set $slaves[$i].trust++>>
			<<elseif $slaves[$i].ID == $Milkmaid.father>>
				She pays special attention to her father, $slaves[$i].slaveName, making sure she is well kept and happy.
				<<set $slaves[$i].trust++>>
			<<else>>
				<<switch areSisters($slaves[$i], $Milkmaid)>>
				<<case 1>>
					She pays special attention to her twin sister, $slaves[$i].slaveName, making sure she is well kept and happy.
					<<set $slaves[$i].trust++>>
				<<case 2>>
					She pays special attention to her sister, $slaves[$i].slaveName, making sure she is well kept and happy.
					<<set $slaves[$i].trust++>>
				<<case 3>>
					She pays special attention to her half-sister, $slaves[$i].slaveName, making sure she is well kept and happy.
					<<set $slaves[$i].trust++>>
				<</switch>>
			<</if>>
		<<elseif $Milkmaid.relationTarget == $slaves[$i].ID && $familyTesting == 0>>
			She pays special attention to her $slaves[$i].relation, $slaves[$i].slaveName, making sure she is well kept and happy.
			<<set $slaves[$i].trust++>>
		<</if>>
		<<if $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a dairy cow.">>
			<<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>
				She spends extra time with $slaves[$i].slaveName, the well-known cow. She is fascinated by $slaves[$i].slaveName's massive $slaves[$i].boobs cc breasts and spends extra time massaging and kneading them to maximize production.
				<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
			<<else>>
				She is disappointed that the well-known cow $slaves[$i].slaveName<<if ($slaves[$i].lactation == 0)>> isn't producing milk anymore. <<else>>'s breasts have shrunken considerably from their heyday.<</if>>
			<</if>>
		<</if>>
		<<if $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a cockmilker.">>
			<<if (($slaves[$i].balls > 6) && ($slaves[$i].dick != 0)) || (($slaves[$i].balls > 4) && ($slaves[$i].dick != 0) && ($slaves[$i].prostate > 1))>>
				She spends extra time with $slaves[$i].slaveName, the massive ejaculating cow.  She can't help but massage the cow's dick and testes to stimulate them further and coax more from them.
				<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
			<<else>>
				She is disappointed that the (formerly) massive ejaculating cow $slaves[$i].slaveName<<if $slaves[$i].balls == 0 || $slaves[$i].dick == 0>> is incapable of giving cum. <<elseif $slaves[$i].prostate < 2>> no longer possesses a hyperactive prostate. <<else>>'s balls are considerably smaller than at their heyday.<</if>>
			<</if>>
		<</if>>
		<<if $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a breeder." && $slaves[$i].bellyPreg >= 1500>>
			She spends extra time with $slaves[$i].slaveName, the well-known breeder. $Milkmaid.slaveName is fascinated by her growing pregnancy and popular womb. She makes sure her belly and it's occupants are nice and comfortable.
			<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
		<</if>>
	<</for>>
<</if>>

<<set _Tadd = ($bioreactorsXY + $bioreactorsXX + $bioreactorsHerm + $bioreactorsBarren)>>
<<if (_DL + _Tadd > 0)>>
	<<if ($Milkmaid != 0)>>

<</if>>
	    <<if (_DL != 1)>>''There are _DL cows in $dairyName.''<<else>>''There is one cow in $dairyName.''<</if>>
	<<if ($dairyRestraintsSetting > 1)>>
		The facility functions as an industrial slave products factory.
	<</if>>
	<<if (_Tadd > 0)>>
		_Tadd milking machines have permanent biological components, making a total of <<print _Tadd + _DL>> milk-producing bodies.
	<</if>>
<</if>>

<<if ($Milkmaid != 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[_FLs]>>@@__'' is serving as your Milkmaid.

		<<include "SA chooses own clothes">>
		<<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 clothes">>
		<<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 $Milkmaid = $slaves[_FLs]>>
<</if>>

<<set _oldCash = $cash>>
<<for _dI = 0; _dI < _DL; _dI++>>
	<<set $i = $slaveIndices[$DairyiIDs[_dI]]>>
	/* Special attention section */
	<<if ($legendaryCowID == 0) && ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>>
		<<set $legendaryCowID = $slaves[$i].ID>>
	<</if>>
	<<if ($legendaryBallsID == 0) && ($slaves[$i].dick != 0) && ($slaves[$i].balls > 5 || ($slaves[$i].balls > 4 && $slaves[$i].prostate > 1)) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>>
		<<set $legendaryBallsID = $slaves[$i].ID>>
	<</if>>

	/* Perform facility based rule changes */
	<<if ($dairySlimMaintain == 0)>>
		<<if $dairyWeightSetting == 0>>
			<<if $slaves[$i].weight <= 30>>
				<<set $slaves[$i].diet = "fattening">>
			<<else>>
				<<set $slaves[$i].diet = "healthy">>
			<</if>>
		<<elseif $dairyWeightSetting == 1>>
			<<if $slaves[$i].weight <= 95>>
				<<set $slaves[$i].diet = "fattening">>
			<<else>>
				<<set $slaves[$i].diet = "healthy">>
			<</if>>
		<<elseif $dairyWeightSetting == 2>>
			<<if $slaves[$i].weight <= 130>>
				<<set $slaves[$i].diet = "fattening">>
			<<else>>
				<<set $slaves[$i].diet = "healthy">>
			<</if>>
		<<elseif $dairyWeightSetting == 3>>
			<<if $slaves[$i].weight <= 160>>
				<<set $slaves[$i].diet = "fattening">>
			<<else>>
				<<set $slaves[$i].diet = "healthy">>
			<</if>>
		<<elseif $dairyWeightSetting == 4>>
			<<if $slaves[$i].weight <= 200>>
				<<set $slaves[$i].diet = "fattening">>
			<<else>>
				<<set $slaves[$i].diet = "healthy">>
			<</if>>
		<<elseif $dairyRestraintsSetting > 1>>
			<<set $slaves[$i].diet = "healthy">>
		<</if>>
	<<elseif $slaves[$i].weight > 10>>
		<<set $slaves[$i].diet = "restricted">>
	<<elseif ($slaves[$i].diet == "fattening") || $slaves[$i].diet == "healthy" || ($dairyRestraintsSetting > 1)>>
		<<set $slaves[$i].diet = "healthy">>
	<</if>>
	<<if $dairyRestraintsSetting > 1>>
		<<set $slaves[$i].collar = "none", $slaves[$i].choosesOwnClothes = 0, $slaves[$i].clothes = "no clothing", $slaves[$i].buttplug = "none", $slaves[$i].vaginalAccessory = "none", $slaves[$i].dickAccessory = "none">>
	<</if>>
	<<switch $dairyDecoration>>
	<<case "Roman Revivalist" "Aztec Revivalist" "Chinese Revivalist" "Chattel Religionist" "Edo Revivalist" "Arabian Revivalist" "Egyptian Revivalist" "Supremacist" "Subjugationist" "Degradationist">>
		<<set $slaves[$i].livingRules = "spare">>
	<<default>>
		<<set $slaves[$i].livingRules = "normal">>
	<</switch>>
	<<if $dairyPregSetting > 0>>
		<<set $reservedChildren -= $slaves[$i].reservedChildren>>
		<<set $slaves[$i].reservedChildren = 0>>
	<</if>>

	/* General End of Week effects */
	<<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 serving as a cow in $dairyName.
		<</if>>

    She <<include "SA get milked">>

		<<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">>
		<<include "SA get milked">>
		<<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 _milkWeek += $milk, _cumWeek += $cum>>

	/* Facility Specific End of Week effects */
	<<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust > -20)>>
		<<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>>
	<</if>>
	<<if ($slaves[$i].health < -80)>>
		<<set $slaves[$i].health += 20>>
	<<elseif ($slaves[$i].health < -40)>>
		<<set $slaves[$i].health += 10>>
	<<elseif ($slaves[$i].health < 0)>>
		<<set $slaves[$i].health += 7>>
	<<elseif ($slaves[$i].health < 90)>>
		<<set $slaves[$i].health += 3>>
	<</if>>
	<<if ($slaves[$i].inflation > 0)>>
		<<set $slaves[$i].inflation = 0, $slaves[$i].inflationType = "none", $slaves[$i].inflationMethod = 0, $slaves[$i].milkSource = 0>>
		<<SetBellySize $slaves[$i]>>
	<</if>>
	<<if ($slaves[$i].lactation > 0) && (($dairySlimMaintain == 0) || ($slaves[$i].boobs > 700))>>
		<<if ($slaves[$i].boobs < 2000)>>
			<<set $slaves[$i].boobs += 100>>
		<<elseif ($slaves[$i].boobs < 5000)>>
			<<set $slaves[$i].boobs += 50>>
		<<elseif ($slaves[$i].boobs < 10000)>>
			<<set $slaves[$i].boobs += 25>>
		<</if>>
	<</if>>
	<<if $slaves[$i].prostate == 1>>
		<<set $slaves[$i].prostate = 2, $slaves[$i].health -= 10, $cash -= $surgeryCost>>
	<</if>>
	<<if $slaves[$i].vasectomy == 1>>
		<<set $slaves[$i].vasectomy = 0, $slaves[$i].health -= 10, $cash -= $surgeryCost>>
	<</if>>
	<<if ($dairySlimMaintain == 0)>>
		<<if ($slaves[$i].lactation < 2) && ($slaves[$i].boobs > 300 || $slaves[$i].dick == 0 || $slaves[$i].lactation == 1 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2>>
			<<set $slaves[$i].lactation = 2, $slaves[$i].health -= 10, $cash -= $surgeryCost>>
		<</if>>
	<</if>>
	<<if ($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0)>>
		<<if ($dairySlimMaintain == 0)>>
			<<if ($slaves[$i].balls == 0)>>
				<<set $slaves[$i].hormones = 2>>
			<</if>>
		<<elseif $slaves[$i].diet == "fattening">>
			<<set $slaves[$i].weight += 2>>
		<</if>>
		<<if ($slaves[$i].health < 75)>>
			<<set $slaves[$i].health += 25>>
		<<else>>
			<<if ($dairySlimMaintain == 0) && $slaves[$i].lactation > 0>>
				<<if $dairyFeedersSetting > 1 && $dairyStimulatorsSetting > 0>>
					<<if $slaves[$i].boobs < 50000>>
						<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
							<<if ($slaves[$i].boobs < 2000)>>
								<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<elseif ($slaves[$i].boobs < 5000)>>
								<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<else>>
								<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<</if>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
						<</if>>
						<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
							<<set _boobtacular++>>
						<</if>>
						<<set $slaves[$i].boobs += _growth>>
					<<else>>
						<<set $slaves[$i].boobs = 50000>>
					<</if>>
				<<elseif $dairyFeedersSetting > 0 && $dairyStimulatorsSetting > 0>>
					<<if $slaves[$i].boobs < 25000>>
						<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
							<<if ($slaves[$i].boobs < 2000)>>
								<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<elseif ($slaves[$i].boobs < 5000)>>
								<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<else>>
								<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<</if>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
						<</if>>
						<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
							<<set _boobtacular++>>
						<</if>>
						<<set $slaves[$i].boobs += _growth>>
					<</if>>
				<<elseif $dairyFeedersSetting > 1>>
					<<if $slaves[$i].boobs < 10000>>
						<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
							<<if ($slaves[$i].boobs < 2000)>>
								<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<elseif ($slaves[$i].boobs < 5000)>>
								<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<else>>
								<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<</if>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
						<</if>>
						<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
							<<set _boobtacular++>>
						<</if>>
						<<set $slaves[$i].boobs += _growth>>
					<</if>>
				<<else>>
					<<if $slaves[$i].boobs < 5000>>
						<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
							<<if ($slaves[$i].boobs < 2000)>>
								<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<elseif ($slaves[$i].boobs < 5000)>>
								<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<<else>>
								<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
							<</if>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
						<</if>>
						<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
							<<set _boobtacular++>>
						<</if>>
						<<set $slaves[$i].boobs += _growth>>
					<</if>>
				<</if>>
			<</if>>
			<<if ($slaves[$i].balls > 0)>>
				<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
					<<if ($slaves[$i].balls < 125)>>
						<<set $slaves[$i].balls++>>
					<</if>>
					<<if ($slaves[$i].balls == 125)>>
						<<set _balltacular++>>
					<</if>>
				<<elseif ($slaves[$i].balls < 10)>>
					<<if (random(1,100) > (40+(10*$slaves[$i].balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>>
						<<set $slaves[$i].balls++>>
					<</if>>
					<<if ($slaves[$i].balls == 10)>>
						<<set _balltacular++>>
					<</if>>
				<</if>>
				<<if $slaves[$i].dick > 0>>
					<<if $slaves[$i].dick < 10>>
						<<if (random(1,100) > (40+(10*$slaves[$i].dick)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>>
							<<set $slaves[$i].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<</if>>
		<</if>>
	<</if>> /* closes ($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0) */
	<<if ($dairyStimulatorsUpgrade == 1) && $dairyStimulatorsSetting > 0>>
		<<if ($dairyStimulatorsSetting > 1) && ($slaves[$i].anus < 4)>>
			<<set $slaves[$i].anus++>>
			<<if ($slaves[$i].anus == 4)>>
				<<set _anusesStretched++>>
			<</if>>
		<<elseif ($slaves[$i].anus < 3)>>
			<<set $slaves[$i].anus++>>
		<</if>>
		<<if ($slaves[$i].health < 60)>>
			<<set $slaves[$i].health += 20>>
		<<elseif $dairySlimMaintain == 0 && $slaves[$i].lactation > 0>>
			<<if $dairyFeedersSetting > 1>>
				<<if $slaves[$i].boobs < 50000>>
					<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
						<<if ($slaves[$i].boobs < 2000)>>
							<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<elseif ($slaves[$i].boobs < 5000)>>
							<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<</if>>
					<<else>>
						<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
					<</if>>
					<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
						<<set _boobtacular++>>
					<</if>>
					<<set $slaves[$i].boobs += _growth>>
				<<else>>
					<<set $slaves[$i].boobs = 50000>>
				<</if>>
			<<elseif $dairyFeedersSetting > 0>>
				<<if $slaves[$i].boobs < 25000>>
					<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
						<<if ($slaves[$i].boobs < 2000)>>
							<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<elseif ($slaves[$i].boobs < 5000)>>
							<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<</if>>
					<<else>>
						<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
					<</if>>
					<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
						<<set _boobtacular++>>
					<</if>>
					<<set $slaves[$i].boobs += _growth>>
				<</if>>
			<<else>>
				<<if $slaves[$i].boobs < 10000>>
					<<if $arcologies[0].FSAssetExpansionistResearch == 1>>
						<<if ($slaves[$i].boobs < 2000)>>
							<<set _growth  = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<elseif ($slaves[$i].boobs < 5000)>>
							<<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<<else>>
							<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>>
						<</if>>
					<<else>>
						<<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>>
					<</if>>
					<<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>>
						<<set _boobtacular++>>
					<</if>>
					<<set $slaves[$i].boobs += _growth>>
				<</if>>
			<</if>>
		<</if>>
		<<if $slaves[$i].balls > 0>>
			<<set _cumWeek = _cumWeek*1.2>>
		<</if>>
	<</if>>
	<<if ($dairyRestraintsSetting > 1)>>
		<<if $slaves[$i].lactation > 0>>
			<<set $slaves[$i].lactationAdaptation += 1>>
		<</if>>
		<<if ($slaves[$i].muscles > -100)>>
			<<set $slaves[$i].muscles-->>
		<</if>>
		<<if ($slaves[$i].fetish == "mindbroken")>>
			<<if ($slaves[$i].boobs > 48000) && (($slaves[$i].balls >= 10) || ($slaves[$i].balls == 0))>>
				<<set $bioreactorPerfectedID = $slaves[$i].ID>>
			<</if>>
		<<else>>
			<<if ($slaves[$i].sexualFlaw != "self hating")>>
			<<if ($slaves[$i].sexualFlaw != "cum addict") || ($dairyFeedersSetting == 0)>>
			<<if ($slaves[$i].sexualFlaw != "anal addict") || ($dairyStimulatorsSetting == 0)>>
			<<if ($slaves[$i].sexualFlaw != "breeder") || ($slaves[$i].preg < 0) || ($dairyPregSetting == 0)>>
				<<if $dairyStimulatorsSetting > 1>>
					<<if ($slaves[$i].sexualFlaw != "hates anal") && ($slaves[$i].sexualQuirk != "painal queen")>>
						<<set $slaves[$i].sexualFlaw = "hates anal">>
					<</if>>
				<</if>>
				<<if $dairyPregSetting > 1>>
					<<if ($slaves[$i].sexualFlaw != "hates penetration") && ($slaves[$i].sexualQuirk != "strugglefuck queen")>>
						<<set $slaves[$i].sexualFlaw = "hates penetration">>
					<</if>>
				<</if>>
				<<if $dairyFeedersSetting > 1>>
					<<if ($slaves[$i].sexualFlaw != "hates oral") && ($slaves[$i].sexualQuirk != "gagfuck queen")>>
						<<set $slaves[$i].sexualFlaw = "hates oral">>
					<</if>>
				<</if>>
			<</if>>
			<</if>>
			<</if>>
			<</if>>
		<</if>>
		<<if $slaves[$i].chem > 250>>
			<<set _chemSevere++>>
		<<elseif $slaves[$i].chem > 100>>
			<<set _chemMinor++>>
		<</if>>
	<</if>>
	<<if ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 5>>
		<<if $slaves[$i].devotion <= 95 && $slaves[$i].sexualFlaw != "self hating">>
			<<if ($slaves[$i].sexualFlaw != "breeder") || ($slaves[$i].preg < 0)>>
				<<if ($slaves[$i].devotion > -75)>>
					<<set $slaves[$i].devotion -= 10>>
					<<if ($slaves[$i].devotion < -65)>>
						<<set _hatefilled++>>
					<</if>>
				<<elseif ($slaves[$i].trust > -75)>>
					<<set $slaves[$i].trust -= 10>>
					<<if ($slaves[$i].trust < -65)>>
						<<set _horrified++>>
					<</if>>
				<<elseif ($slaves[$i].vaginalSkill > 0)>>
					<<set $slaves[$i].vaginalSkill -= 10, _skillsLost++>>
				<<elseif ($slaves[$i].oralSkill > 0)>>
					<<set $slaves[$i].oralSkill -= 10, _skillsLost++>>
				<<elseif ($slaves[$i].analSkill > 0)>>
					<<set $slaves[$i].analSkill -= 10, _skillsLost++>>
				<<elseif ($slaves[$i].career != "a bioreactor")>>
					<<set $slaves[$i].career = "a bioreactor", _careerForgotten++>>
				<<elseif ($slaves[$i].intelligence > -1)>>
					<<set $slaves[$i].intelligence--, _intelligenceLost++>>
				<<elseif ($slaves[$i].devotion >= -20)>>
					<<set $slaves[$i].devotion -= 10>>
				<<elseif ($slaves[$i].trust > -20)>>
					<<set $slaves[$i].trust -= 10>>
				<<elseif ($slaves[$i].whoreSkill > 0)>>
					<<set $slaves[$i].whoreSkill -= 10, _skillsLost++>>
				<<elseif ($slaves[$i].entertainSkill > 0)>>
					<<set $slaves[$i].entertainSkill -= 10, _skillsLost++>>
				<<elseif ($slaves[$i].intelligence > -2)>>
					<<set $slaves[$i].intelligence--, _stupidified++>>
				<<elseif ($slaves[$i].fetish != "mindbroken")>>
					<<set $slaves[$i].fetish = "mindbroken", _mindbroken++>>
				<</if>>
			<</if>>
		<</if>>
		<<if (($slaves[$i].milk > 1000) && ($slaves[$i].boobs > 12000) || ($slaves[$i].cum > 1000) && ($slaves[$i].balls >= 10)) && ($slaves[$i].career != "a bioreactor")>>
			<<set $slaves[$i].career = "a bioreactor", _careerForgotten++>>
		<</if>>
		<<if ($arcologies[0].FSBodyPuristLaw == 0) && ($healthyDrugsUpgrade == 0)>>
			<<set $slaves[$i].chem += 5>>
		<<else>>
			<<set $slaves[$i].chem += 2>>
		<</if>>
	<<elseif ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 3>>
		<<if ($slaves[$i].devotion < 75)>>
			<<if ($slaves[$i].devotion > -75)>>
				<<set $slaves[$i].devotion -= 5>>
				<<if ($slaves[$i].devotion < -70)>>
					<<set _hatefilled++>>
				<</if>>
			<<elseif ($slaves[$i].trust > -75)>>
				<<set $slaves[$i].trust -= 5>>
				<<if ($slaves[$i].trust < -70)>>
					<<set _horrified++>>
				<</if>>
			<<elseif ($slaves[$i].vaginalSkill >= 20)>>
				<<set $slaves[$i].vaginalSkill -= 10, _skillsLost++>>
			<<elseif ($slaves[$i].oralSkill >= 20)>>
				<<set $slaves[$i].oralSkill -= 10, _skillsLost++>>
			<<elseif ($slaves[$i].analSkill >= 20)>>
				<<set $slaves[$i].analSkill -= 10, _skillsLost++>>
			<<elseif ($slaves[$i].career != "a bioreactor")>>
				<<set $slaves[$i].career = "a bioreactor", _careerForgotten++>>
			<<elseif ($slaves[$i].intelligence > -1)>>
				<<set $slaves[$i].intelligence--, $intelligenceLost++>>
			<<elseif ($slaves[$i].devotion >= -20)>>
				<<set $slaves[$i].devotion -= 8>>
			<<elseif ($slaves[$i].trust > -20)>>
				<<set $slaves[$i].trust -= 8>>
			<<elseif ($slaves[$i].whoreSkill >= 20)>>
				<<set $slaves[$i].whoreSkill -= 10, _skillsLost++>>
			<<elseif ($slaves[$i].entertainSkill >= 20)>>
				<<set $slaves[$i].entertainSkill -= 10, _skillsLost++>>
			<<elseif ($slaves[$i].intelligence > -2)>>
				<<set $slaves[$i].intelligence--, _stupidified++>>
			<<elseif ($slaves[$i].fetish != "mindbroken")>>
				<<set $slaves[$i].fetish = "mindbroken", _mindbroken++>>
			<</if>>
		<<elseif (($slaves[$i].milk > 1000) && ($slaves[$i].boobs > 12000) || ($slaves[$i].cum > 1000) && ($slaves[$i].balls >= 10)) && ($slaves[$i].career != "a bioreactor")>>
			<<set $slaves[$i].career = "a bioreactor", _careerForgotten++>>
		<</if>>
		<<if ($arcologies[0].FSBodyPuristLaw == 0) && ($healthyDrugsUpgrade == 0)>>
			<<set $slaves[$i].chem += 2>>
		<<else>>
			<<set $slaves[$i].chem++>>
		<</if>>
	<</if>> /* closes ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 5 */
	<<if ($dairyPregUpgrade == 1) && ($dairyPregSetting > 0)>>
		<<if ($slaves[$i].ovaries == 1) && ($slaves[$i].vagina > -1)>>
			<<set _femCumWeek += Math.trunc((70-$slaves[$i].physicalAge)/(30-($slaves[$i].vaginaLube*10)))>>
			<<if ($slaves[$i].preg == -2)>>
				<<set $slaves[$i].preg = 0, _desterilized++>>
			<</if>>
			<<if isFertile($slaves[$i])>>
				<<if $slaves[$i].eggType == "human">>
					<<set $slaves[$i].preg = 1, $slaves[$i].pregWeek = 1, $slaves[$i].pregKnown = 1>>
					<<if ($dairyPregSetting > 2)>>
						<<set $slaves[$i].pregType = random(10,29)>>
					<<elseif ($dairyPregSetting > 1)>>
						<<set $slaves[$i].pregType = random(3,6)>>
					<<else>>
						<<set $slaves[$i].pregType = either(1, 1, 1, 1, 2, 2, 2, 3, 3, 4)>>
					<</if>>
					<<set $slaves[$i].pregSource = -2>>
					<<set WombImpregnate($slaves[$i], $slaves[$i].pregType, -2, 1)>>
				<</if>> /*closes eggType */
				<<if ($slaves[$i].vagina == 0)>>
					<<set $slaves[$i].vagina++>>
				<</if>>
			<<elseif ($slaves[$i].pregKnown == 1)>>
				<<if ($dairyPregSetting > 2)>>
					<<set $cash += 100>>
				<<elseif ($dairyPregSetting > 1)>>
					<<set $cash += 50>>
				<<else>>
					<<set $cash += 25>>
				<</if>>
				<<if ($dairyPregSetting > 1) && ($slaves[$i].vagina < 4)>>
					<<set $slaves[$i].vagina++>>
					<<if ($slaves[$i].vagina == 4)>>
						<<set _vaginasStretched++>>
					<</if>>
				<<elseif ($slaves[$i].vagina < 3)>>
					<<set $slaves[$i].vagina++>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</for>>

<<if $inflatedSlavesMilk > 0>>
	<<set _milkWeek -= ((8*$inflatedSlavesMilk*10)+8)>>
<</if>>
<<if $inflatedSlavesCum > 0>>
	<<set _cumWeek -= ((80*$inflatedSlavesCum*10)+80)>>
	<<if _cumWeek < 0>>
		<<set _cumWeek = 0>>
	<</if>>
<</if>>

<<if (_Tadd > 0)>>
	<<set _tempCash = $cash>>
	<<set _seed = (100*$bioreactorsXY) + (100*$bioreactorsHerm), _cumWeek += _seed>>
	<<if ($arcologies[0].FSPastoralistLaw == 1)>>
		<<set $cash += _seed*random(40,50)>>
	<<elseif ($arcologies[0].FSPastoralist != "unset")>>
		<<set $cash += _seed*(random(25,35)+Math.trunc($arcologies[0].FSPastoralist/10))>>
	<<else>>
		<<set $cash += _seed*random(25,35)>>
	<</if>>
	<<set _seed = (2*$bioreactorsXX) + (2*$bioreactorsHerm), _femCumWeek += _seed>>
	<<if ($arcologies[0].FSPastoralistLaw == 1)>>
		<<set $cash += _seed*random(40,50)>>
	<<elseif ($arcologies[0].FSPastoralist != "unset")>>
		<<set $cash += _seed*(random(25,35)+Math.trunc($arcologies[0].FSPastoralist/10))>>
	<<else>>
		<<set $cash += _seed*random(25,35)>>
	<</if>>
	<<set _seed = (800*$bioreactorsXX) + (700*$bioreactorsBarren) + (600*$bioreactorsXY) + (600*$bioreactorsHerm), _milkWeek += _seed>>
	<<if ($arcologies[0].FSPastoralistLaw == 1)>>
		<<set $cash += _seed*(13+Math.trunc($arcologies[0].FSPastoralist/30))>>
	<<elseif ($arcologies[0].FSPastoralist != "unset")>>
		<<set $cash += _seed*(8+Math.trunc($arcologies[0].FSPastoralist/30))>>
	<<else>>
		<<set $cash += _seed*9>>
	<</if>>

_Tadd permanently converted biological "machine<<if _Tadd > 1>>s<</if>>" produce<<if _Tadd == 1>>s<</if>> @@.yellowgreen;<<print cashFormat($cash-_tempCash)>>@@ income.
<</if>>

<<if $inflatedSlavesMilk > 0>>
	<<set $cash -= Math.trunc(((600*($inflatedSlavesMilk)+8)+random(50,200)))>>
<</if>>
<<if $inflatedSlavesCum > 0>>
	<<set $cash -= Math.trunc(((300*($inflatedSlavesCum+8))+random(25,100)))>>
<</if>>

<<set _profits = $cash-_oldCash>>

<<if _chemSevere > 1>>
	_chemSevere cows' productivity is being reduced by the long term effects of industrial use.
<<elseif _chemSevere > 0>>
	One cow's productivity is being reduced by the long term effects of industrial use.
<</if>>
<<if _chemMinor > 1>>
	_chemMinor cows have been drugged and used long enough that they require increased curative doses, slightly reducing their output.
<<elseif _chemMinor > 0>>
	One cow has been drugged and used long enough that she requires increased curative doses, slightly reducing her output.
<</if>>
<<if _desterilized > 1>>
	_desterilized cows had minor health issues preventing their fertile womb from conceiving; the issues have been resolved and they have been impregnated.
<<elseif _chemMinor > 0>>
	One cow had minor health issues preventing her fertile womb from conceiving; they have been resolved and she has been impregnated.
<</if>>
<<if _hatefilled > 1>>
	_hatefilled cows stopped struggling so much when fucked by the machines; it seems they have sunk into a fugue.
<<elseif _hatefilled > 0>>
	One cow stopped struggling so much when fucked by the machines; it seems she has sunk into a fugue.
<</if>>
<<if _horrified > 1>>
	_horrified cows' emotional activity dropped significantly; this indicates acceptance that they are not likely to leave $dairyName, ever again.
<<elseif _horrified > 0>>
	One cow's emotional activity dropped significantly; this indicates acceptance that she is not likely to leave $dairyName, ever again.
<</if>>
<<if _skillsLost > 1>>
	_skillsLost cows forgot skills due to their inability to focus on anything but machine rape.
<<elseif _skillsLost > 0>>
	One cow forgot skills due to her inability to focus on anything but machine rape.
<</if>>
<<if _careerForgotten > 1>>
	_careerForgotten cows forgot the details of their past professional lives; all they can remember now is this.
<<elseif _careerForgotten > 0>>
	One cow forgot the details of her past professional life; all she can remember now is this.
<</if>>
<<if _vaginasStretched > 1>>
	_vaginasStretched cows' vaginas were broken in for machine use, and are unlikely to be any use for anything other than receiving cum and medication, and giving birth.
<<elseif _vaginasStretched > 0>>
	One cow's vagina was broken in for machine use, and is unlikely to be any use for anything other than receiving cum and medication, and giving birth.
<</if>>
<<if _anusesStretched > 1>>
	_anusesStretched cows' anuses were loosened by machine sodomy, and are now permanently gaped.
<<elseif _anusesStretched > 0>>
	One cow's anus was loosened by machine sodomy, and is now permanently gaped.
<</if>>
<<if $intelligenceLost > 1>>
	$intelligenceLost cows suffered some loss of intelligence due to accumulated mental stress from life attached to a milking machine.
<<elseif $intelligenceLost > 0>>
	One cow  suffered some loss of intelligence due to accumulated mental stress from life attached to a milking machine.
<</if>>
<<if _stupidified > 1>>
	_stupidified cows were so mentally dulled by use as biological factories that they were reduced to a very low level of intelligence.
<<elseif _stupidified > 0>>
	One cow was so mentally dulled by use as biological factories that she was reduced to a very low level of intelligence.
<</if>>
<<if _mindbroken > 1>>
	_mindbroken cows finally lost higher mental function, and are now nothing more than industrial equipment made of meat.
<<elseif _mindbroken > 0>>
	One cow finally lost higher mental function, and is now nothing more than industrial equipment made of meat.
<</if>>
<<if _boobtacular > 1>>
	_boobtacular cows grew past 30 kilograms of breasts, a remarkable advance in capacity.
<<elseif _boobtacular > 0>>
	One cow grew past 30 kilograms of breasts, a remarkable advance in capacity.
<</if>>
<<if _balltacular > 1>>
	_balltacular cows' testicles reached the largest size drug treatments can produce; the machines will now focus on buttfucking them with extra force.
<<elseif _balltacular > 0>>
	One cow's testicles reached the largest size drug treatments can produce; the machines will now focus on buttfucking her with extra force.
<</if>>

<<if ($dairyPregUpgrade == 1)>>
<<if ($dairyPregSetting >= 2)>>
	Fertile cows make you a significant profit through contract pregnancies.
<<elseif ($dairyPregSetting == 1)>>
	Fertile cows make you a small profit through contract pregnancies.
<</if>>
<</if>>
<<set _cumWeek = Math.trunc(_cumWeek/10)>>
<<set $cumPipeline = _cumWeek, $milkPipeline = _milkWeek>>
<<if $inflatedSlavesMilk > 0>>
	<<set _outputMilk = ((8*$inflatedSlavesMilk*10)+8)>>
<<else>>
	<<set _outputMilk = 0>>
<</if>>
<<if $inflatedSlavesCum > 0>>
	<<set _outputCum = (((80*$inflatedSlavesCum*10)+80)/10)>>
<<else>>
	<<set _outputCum = 0>>
<</if>>
$dairyNameCaps produced <<print _milkWeek+_outputMilk>> liters of milk<<if _cumWeek > 0>> and <<print _cumWeek+_outputCum>> liters of cum<</if>> this week.
<<if $inflatedSlavesMilk > 0>>
	_outputMilk liters of milk were pumped into your penthouse for filling slaves this week.
<</if>>
<<if $inflatedSlavesCum > 0>>
	<<if $inflatedSlavesMilk > 0>>and <</if>>_outputCum liters of cum were pumped into your penthouse<<if $inflatedSlavesMilk > 0>> as well<<else>> this week<</if>>.
<</if>>
<<if _femCumWeek > 0>>
	The machines also managed to reclaim _femCumWeek liters of salable vaginal secretions.
<</if>>
<<if _births > 1>>
	Additionally, _birthers cows gave birth<<if _births > _birthers>> to a total of _births calves<</if>> this week.
<<elseif _births > 0>>
	Additionally, one cow gave birth<<if _births > _birthers>> to a total of _births calves<</if>> this week.
<</if>>

<<if $arcologies[0].FSRestart != "unset">>
<<if $dairyPregSetting > 0>>
	The Societal Elite know what you are doing with your cows. @@.red;They do not approve@@.
	<<set $failedElite += 5>>
<</if>>
<<if _milkmaidImpregnates == 1>>
	The Societal Elite know you've ordered $Milkmaid.slaveName to impregnate your cows. @@.red;They are not amused by your disinterest in eugenics@@.
	<<set $failedElite += 10>>
<</if>>
<</if>>

<>
<<if (_profits > 0)>>
These sale of these products makes a profit of @@.yellowgreen;<<print cashFormat(_profits)>>@@.
<<elseif (_profits < 0)>>
Due to one-off costs of hormonal implants to encourage fluid production, your dairy made a loss of @@.red;<<print cashFormat(_profits)>>@@.
<</if>>

<<if ($arcologies[0].FSPastoralistLaw == 1)>>
	Slave products have completely replaced traditional dairy, making the facility extremely lucrative.
<</if>>

<<if ($dairySlimMaintainUpgrade == 1 && $dairySlimMaintain == 1)>>

	<<if $arcologies[0].FSSlimnessEnthusiast > 80>>
		Because of your arcology's great enthusiasm for small breasted slaves, the dairy's milking systems have been carefully overhauled and optimized for maximum milk extraction from slaves with smaller endowments--providing a significant boost to their otherwise modest output. This also prevents unfashionable breast expansion of already slim slaves through the milking process.
	<<elseif $arcologies[0].FSSlimnessEnthusiast > 20>>
		In keeping with your arcology's ideals, $dairyName has been modified to handle slim slaves with minimal impact to their body shapes. This limits potential profitability, but prevents unfashionable breast expansion of already slim slaves through the milking process.
	<<else>>
		Due to your arcology's lack of enthusiasm for small breasted slaves the dairy has discontinued using milking techniques that prevent breast growth through the milking process.
		<<set $dairySlimMaintain = 0, $dairySlimMaintainUpgrade = 0>>
	<</if>>
<</if>>

<<if ($createBioreactors == 1) && ($bioreactorPerfectedID != 0)>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$DairyiIDs[_dI]]>>
		<<if ($slaves[$i].ID == $bioreactorPerfectedID)>>

    <<SlaveFullName $slaves[$i]>>'s breasts<<if $slaves[$i].balls > 0>>, balls<</if>><<if $slaves[$i].ovaries == 1>>, belly<</if>>, body, and mind have been completely adapted to synthesize useful products. She has been reclassified as part of the machine she's now permanently attached to. This combination is projected to produce approximately
			<<if $slaves[$i].balls > 0>><<print 1000*Math.trunc((3*52*(45-$slaves[$i].physicalAge))/1000)>> liters of cum,<</if>>
			<<if $slaves[$i].ovaries == 1>><<print 100*Math.trunc((52*(45-$slaves[$i].physicalAge))/100)>> liters of vaginal secretions, <<if $dairyPregSetting == 3>><<print 13*(45-$slaves[$i].physicalAge)>><<else>><<print 5*(45-$slaves[$i].physicalAge)>><</if>> slaves,<</if>>
			and <<print 1000*Math.trunc((300*52*(45-$slaves[$i].physicalAge))/1000)>> liters of milk over a <<print 45-$slaves[$i].physicalAge>> year period before its biological components must be replaced.
			<<if ($slaves[$i].ovaries == 1)>>
				<<if ($slaves[$i].balls == 0)>>
					<<set $bioreactorsXX++>>
				<<else>>
					<<set $bioreactorsHerm++>>
				<</if>>
			<<else>>
				<<if ($slaves[$i].balls == 0)>>
					<<set $bioreactorsBarren++>>
				<<else>>
					<<set $bioreactorsXY++>>
				<</if>>
			<</if>>
			<<set $activeSlave = $slaves[$i]>>
			<<include "Remove activeSlave">>
			<<break>>
		<</if>>
	<</for>>
<</if>>

<<if $dairyDecoration != "standard">>
	$dairyNameCaps's @@.green;$dairyDecoration style is well known.@@
<</if>>

<<if _DL > 0>>

	<<DairyStatistics 0>>
	<<timed 50ms>>
		<<replace #dairystats>>
			<<DairyStatistics 1>>
		<</replace>>
	<</timed>>
<</if>>
<<if (_DL + _Tadd) > 0 || $Milkmaid != 0>>

<</if>>


code:
:: Description Options [nobr]

<<set $nextButton = "Back", $nextLink = "Options">>

//These options will affect both the long form description of each slave and the miniscenes available from the main menu.//

<<if $showSexualHistory == 1>>
	Sexual histories are @@.green;SHOWN.@@ //[[Hide|Description Options][$showSexualHistory = 0]]//
<<else>>
	Sexual histories are @@.red;HIDDEN.@@ //[[Show|Description Options][$showSexualHistory = 1]]//
<</if>>

<<if $showBodyMods == 1>>
	Cosmetic body mods are @@.green;SHOWN.@@ //[[Hide|Description Options][$showBodyMods = 0]]//
<<else>>
	Cosmetic body mods are @@.red;HIDDEN.@@ //[[Show|Description Options][$showBodyMods = 1]]//
<</if>>

<<if $showImplantEffects == 1>>
	The effects of implants are @@.green;SHOWN.@@ //[[Hide|Description Options][$showImplantEffects = 0]]//
<<else>>
	The effects of implants are @@.red;HIDDEN.@@ //[[Show|Description Options][$showImplantEffects = 1]]//
<</if>>

<<if $showClothing == 1>>
	Clothing is mostly @@.green;SHOWN.@@ //[[Hide|Description Options][$showClothing = 0]]//
<<else>>
	Clothing is mostly @@.red;HIDDEN.@@ //[[Show|Description Options][$showClothing = 1]]//
<</if>>

Detailed slave age information is
<<if $showAgeDetail == 1>>
	@@.green;SHOWN.@@ //[[Hide|Description Options][$showAgeDetail = 0]]//
<<else>>
	@@.red;HIDDEN.@@ //[[Show|Description Options][$showAgeDetail = 1]]//
<</if>>

Approximate height is
<<if $showHeightCMs == 1>>
	@@.green;SHOWN.@@ //[[Hide|Description Options][$showHeightCMs = 0]]//
<<else>>
	@@.red;HIDDEN.@@ //[[Show|Description Options][$showHeightCMs = 1]]//
<</if>>

Volume, in CCs, of breasts is
<<if $showBoobCCs == 1>>
	@@.green;SHOWN.@@ //[[Hide|Description Options][$showBoobCCs = 0]]//
<<else>>
	@@.red;HIDDEN.@@ //[[Show|Description Options][$showBoobCCs = 1]]//
<</if>>

<<if $seeDicks != 0>>

Approximate sizes of dicks and balls are
<<if $showDickCMs == 1>>
	@@.green;SHOWN.@@ //[[Hide|Description Options][$showDickCMs = 0]]//
<<else>>
	@@.red;HIDDEN.@@ //[[Show|Description Options][$showDickCMs = 1]]//
<</if>>
<</if>>

Attractiveness and Sexual scores are
<<if $showScores == 1>>
	@@.green;SHOWN.@@ //[[Hide|Description Options][$showScores = 0]]//
<<else>>
	@@.red;HIDDEN.@@ //[[Show|Description Options][$showScores = 1]]//
<</if>>

license: mit


code:
:: Discard Confirm

This will permanently remove $activeSlave.slaveName from the game, and you will not receive any money for her. This is primarily intended as a way to rid yourself of bugged slaves. Are you certain?

[[Discard her|Slave Sold]]

[[Cancel|Slave Interact]]


code:
:: Dispensary [nobr]

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

The Dispensary

<<if $dispensaryUpgrade == 0>>
	//The pharmaceutical fabricator is running smoothly. It can cheaply replicate complex medications, and has already cut the cost of drugs for your slaves by a fourth. It can easily produce advanced drugs should you obtain the data necessary to create them.//

<<else>>
	//The pharmaceutical fabricator is running smoothly. It can cheaply and quickly replicate complex medications, and has already cut the cost of drugs for your slaves in half. It can easily produce advanced drugs should you obtain the data necessary to create them.//

<</if>>

<<if ($dispensaryUpgrade == 0)>>
	<<if ($rep > 5000)>>
		[[Upgrade the pharmaceutical fabricator|Dispensary][$cash -= Math.trunc(30000*$upgradeMultiplierArcology), $dispensaryUpgrade = 1, $drugsCost = (($drugsCost*2)/3)]]
		//Costs <<print cashFormat(Math.trunc(30000*$upgradeMultiplierArcology))>>//

    //Will improve production efficiency further decreasing costs.//

	<<else>>
		//You lack the reputation to obtain cutting-edge pharmaceutical fabricator upgrades//

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

The Organ Farm

<<if ($organFarmUpgrade < 3) && ($rep <= 10000*_PCSkillCheck)>>
	//You lack the reputation to access experimental organ farm parts//

<<elseif $dispensaryUpgrade == 0 && $organFarmUpgrade == 2>>
	//The fabricator must upgraded before it can be fitted with perfected organ farm parts//

<<elseif $organs.length > 0>>
	//The organ farm can not be upgraded while it is use//

<<elseif ($organFarmUpgrade == 2) && ($rep > 10000*_PCSkillCheck)>>
	[[Upgrade to the organ farm to the cutting edge model|Dispensary][$cash -= 150000*_PCSkillCheck, $organFarmUpgrade = 3]]
	//Costs <<print cashFormat(150000*_PCSkillCheck)>>//

    //Will allow the organ farm to rapidly grow organs without risk to the implantee's health.//

<<elseif ($organFarmUpgrade == 1) && ($rep > 10000*_PCSkillCheck)>>
	[[Upgrade the organ farm with an experimental growth accelerator|Dispensary][$cash -= 50000*_PCSkillCheck, $organFarmUpgrade = 2]]
	//Costs <<print cashFormat(50000*_PCSkillCheck)>>//

    //Will allow the organ farm to quickly grow organs. Implanted organs may cause health issues.//

<<elseif ($organFarmUpgrade == 0) && ($rep > 10000*_PCSkillCheck)>>
	[[Upgrade the fabricator with an experimental organ farm|Dispensary][$cash -= 50000*_PCSkillCheck, $organFarmUpgrade = 1]]
	//Costs <<print cashFormat(50000*_PCSkillCheck)>>//

    //Will allow the fabrication of tailored organs using the autosurgery.//

<</if>>
<<if $organFarmUpgrade > 2>>
	The fabricator is capable of rapidly growing organs.

<<elseif $organFarmUpgrade > 1>>
	The fabricator is capable of quickly growing organs, though not without side effects.

<<elseif ($organFarmUpgrade > 0)>>
	The fabricator is capable of growing organs.

<</if>>
<<if $organs.length > 0>>
It is currently working on the following organs:
	<<for $i = 0; $i < $organs.length; $i++>>
		<<for $j = 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID == $organs[$i].ID>>

				$slaves[$j].slaveName's $organs[$i].type,
				<<if $organFarmUpgrade == 1>>
					<<print $organs[$i].weeksToCompletion>>
				<<elseif $organFarmUpgrade == 2>>
					<<print Math.ceil($organs[$i].weeksToCompletion/2)>>
				<<elseif $organFarmUpgrade == 3>>
					<<print Math.ceil($organs[$i].weeksToCompletion/4)>>
				<</if>> weeks from completion.
				<<break>>
			<</if>>
		<</for>>
	<</for>>

<</if>>
<<if $incubatorSlaves > 0>>
	<<for $x = 0; $x < $incubatorOrgans.length; $x++>>
		<<for _w = 0; _w < $incubatorSlaves; _w++>>
			<<if $tanks[_w].ID == $incubatorOrgans[$x].ID>>

				$tanks[_w].slaveName's $incubatorOrgans[$x].type,
				<<if $incubatorOrgans[$x].weeksToCompletion <= 0>>
					ready to be implanted as soon as she exits the incubator.
				<<else>>
					<<if $organFarmUpgrade == 1>>
						<<print $incubatorOrgans[$x].weeksToCompletion>>
					<<elseif $organFarmUpgrade == 2>>
						<<print Math.ceil($incubatorOrgans[$x].weeksToCompletion/2)>>
					<<elseif $organFarmUpgrade == 3>>
						<<print Math.ceil($incubatorOrgans[$x].weeksToCompletion/4)>>
					<</if>> weeks from completion.
				<</if>>
				<<break>>
			<</if>>
		<</for>>
	<</for>>

<</if>>
<<if $completedOrgans.length > 0>>

	Currently the following organs are completed and ready for implantation:
	<<for $i = 0; $i < $completedOrgans.length; $i++>>
		<<for $j = 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID == $completedOrgans[$i].ID>>

$slaves[$j].slaveName's $completedOrgans[$i].type.
				<<break>>
			<</if>>
		<</for>>
	<</for>>

<</if>>

<<if $organFarmUpgrade > 0>>
	<<if ($youngerOvaries != 1) && ($rep <= 10000*_PCSkillCheck)>>
		//You lack the reputation to access designs for cloning fertile ovaries for menopausal slaves.//

	<<elseif ($youngerOvaries != 1) && ($rep > 10000*_PCSkillCheck)>>
		[[Purchase designs for cloning fertile ovaries for menopausal slaves|Dispensary][$cash -= 30000*_PCSkillCheck, $youngerOvaries = 1]]
		//Costs <<print cashFormat(30000*_PCSkillCheck)>>//

    //Will allow the growth of younger, fertile ovaries for menopausal slaves. Restored fertility will only last for a couple years at most.//

	<<elseif ($youngerOvaries > 0)>>
		The fabricator is capable of growing fertile ovaries for postmenopausal slaves.

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

Hormones Upgrades

The fabricator is producing
<<if $injectionUpgrade == 0>>
	standard growth hormones.
	<<if $rep > 6000>>
		[[Purchase data on prototype growth hormone tests|Dispensary][$cash -= 25000*_PCSkillCheck, $injectionUpgrade = 1]]
		//Costs <<print cashFormat(25000*_PCSkillCheck)>>//

    //Should improve the reliability of growth injections of all kinds.//

	<<else>>
		//You lack the reputation to obtain prototype medicines//

	<</if>>
<<elseif $injectionUpgrade == 1>>
	prototype growth hormones.
	<<if $rep > 10000>>
		[[Upgrade the fabricator to customize each slave's growth hormones|Dispensary][$cash -= 50000*_PCSkillCheck, $injectionUpgrade = 2]]
		//Costs <<print cashFormat(50000*_PCSkillCheck)>>//

    //Should improve the reliability of growth injections of all kinds.//
	<<else>>
		//You lack the reputation to obtain prototype fabricator upgrades//
	<</if>>
<<elseif $injectionUpgrade == 2>>
	prototype growth hormones.
	<<if $rep > 14000>>
		[[Upgrade the fabricator with prototype biomechanical microfactories|Dispensary][$cash -= 100000*_PCSkillCheck, $injectionUpgrade = 3]]
		//Costs <<print cashFormat(100000*_PCSkillCheck)>>//

    //Should improve the reliability of growth injections of all kinds.//

	<<else>>
		//You lack the reputation to obtain prototype biomechanical microfactories//

	<</if>>
<<else>>
	the world's most effective growth hormones.

<</if>>

The fabricator is producing
<<if $hormoneUpgradeMood == 0>>
	standardized hormone replacement therapies.
	<<if $rep > 2000>>
		[[Upgrade for individualized therapy|Dispensary][$cash -= 10000*_PCSkillCheck, $hormoneUpgradeMood = 1]]
		//Costs <<print cashFormat(10000*_PCSkillCheck)>>//

    //Should eliminate the occasional moodiness and sexual disinterest caused by generalized therapy.//

	<<else>>
		//You lack the reputation to obtain advanced drug manufacturing components//

	<</if>>
<<else>>
	individualized hormone replacement therapies.

<</if>>

The hormone replacement therapies
<<if $hormoneUpgradePower == 0>>
	are traditional: they're formulated to mimic natural hormones.
	<<if $rep > 4000>>
		[[Purchase data on advanced HRT|Dispensary][$cash -= 25000*_PCSkillCheck, $hormoneUpgradePower = 1]]
		//Costs <<print cashFormat(25000*_PCSkillCheck)>>//

    //Should increase the power of hormone therapies.//

	<<else>>
		//You lack the reputation to obtain prototype medicines//

	<</if>>
<<else>>
	are advanced: they're formulated to improve on natural hormones.

<</if>>

The hormone replacement therapies
<<if $hormoneUpgradeShrinkage == 0>>
	are broad-spectrum.
	<<if $rep > 4000>>
		[[Purchase data on targeted HRT|Dispensary][$cash -= 25000*_PCSkillCheck, $hormoneUpgradeShrinkage = 1]]
		//Costs <<print cashFormat(25000*_PCSkillCheck)>>//

    //Should reduce atrophy of organs corresponding to original sex.//

	<<else>>
		//You lack the reputation to obtain prototype medicines//

	<</if>>
<<else>>
	are targeted, reducing atrophy of organs corresponding to original sex.

<</if>>

<<if $precociousPuberty == 1>>
	<<if ($pubertyHormones == 0) && ($rep <= 4500*_PCSkillCheck)>>
		//You lack the reputation to fund forced puberty drugs//

	<<elseif ($pubertyHormones == 0) && ($rep > 4500*_PCSkillCheck)>>
		[[Fund research into powerful hormonal injections to jumpstart puberty|Dispensary][$cash -= 30000*$upgradeMultiplierMedicine, $pubertyHormones = 1]]
		//Costs <<print cashFormat(30000*$upgradeMultiplierMedicine)>>//

    //Will allow the production of powerful hormonal drugs designed to force a slave through puberty without regard for side effects. //

	<<elseif ($pubertyHormones == 1)>>
		The fabricator is producing extra strong hormonal drugs designed to force a slave through puberty.

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

Dietary Upgrades

<<if $feeder == 1>>
	<<if ($dietXXY == 0) && ($rep <= 3500*_PCSkillCheck)>>
		//You lack the reputation to fund research into hermaphrodite hormones//

	<<elseif ($dietXXY == 0) && ($rep > 3500*_PCSkillCheck)>>
		[[Fund research into developing hermaphrodite hormone therapies|Dispensary][$cash -= 10000*$upgradeMultiplierMedicine, $dietXXY = 1]]
		//Costs <<print cashFormat(10000*$upgradeMultiplierMedicine)>>//

    //Will allow for specially balanced meals to be served in the cafeteria designed to promote both halves of a herm's sexuality. //

	<<elseif ($dietXXY == 1)>>
		The fabricator is producing meals to be served in the cafeteria designed to promote both halves of a herm's sexuality.

	<</if>>
<<else>>
	The feeders are incapable of modifying slave diets well enough to adjust hormones for hermaphrodite meals.

<</if>>

<<if $cumProDiet == 0>>
	[[Purchase recipes to encourage cum production|Dispensary][$cash -= 5000*_PCSkillCheck, $cumProDiet = 1]]
	//Costs <<print cashFormat(5000*_PCSkillCheck)>>//

    //Will allow for specially designed meals to be served in the cafeteria to promote cum production.//

<<elseif $cumProDiet == 1>>
	The fabricator is producing meals to be served in the cafeteria designed to promote cum production.

<</if>>

<<if $dietCleanse == 0>>
	[[Purchase cleansing recipes to lessen genome damage|Dispensary][$cash -= 10000*_PCSkillCheck, $dietCleanse = 1]]
	//Costs <<print cashFormat(10000*_PCSkillCheck)>>//

    //Will allow for specially designed meals to be served in the cafeteria to counteract excessive drug use.//

<<elseif $dietCleanse == 1>>
	The fabricator is producing meals to be served in the cafeteria designed to counteract excessive drug use and good health. They smell awful and taste worse than they look, but they're healthy.

<</if>>

Pharmacological Upgrades

<<if ($curativeUpgrade == 0) && ($rep > 6000*_PCSkillCheck)>>
	[[Purchase data on advanced curatives|Dispensary][$cash -= 25000*_PCSkillCheck, $curativeUpgrade = 1]]
	//Costs <<print cashFormat(25000*_PCSkillCheck)>>//

    //Should improve the effectiveness of curative treatment.//

<<elseif ($curativeUpgrade == 1)>>
	The fabricator is producing highly effective curative cocktails.

<</if>>

<<if ($growthStim == 0) && ($rep > 6000*_PCSkillCheck)>>
	[[Purchase data on growth stimulants|Dispensary][$cash -= 20000*_PCSkillCheck, $growthStim = 1]]
	//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Will allow the manufacturing of drugs to encourage growth in slave height.//

<<elseif ($growthStim == 1)>>
	The fabricator is able to produce growth stimulants.

<</if>>

<<if ($aphrodisiacUpgradeRefine == 0) && ($rep > 6000*_PCSkillCheck)>>
	[[Purchase data on refined aphrodisiacs|Dispensary][$cash -= 20000*_PCSkillCheck, $aphrodisiacUpgradeRefine = 1]]
	//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Will prevent most physical side effects of aphrodisiacs. Once the formulas are changed they can not be changed back.//

<<elseif ($aphrodisiacUpgradeRefine == 1)>>
	The fabricator is producing refined aphrodisiacs with limited hormonal effects.

<</if>>

<<if ($aphrodisiacUpgrade == 0) && ($rep > 6000*_PCSkillCheck)>>
	[[Purchase data on aphrodisiac withdrawal treatment|Dispensary][$cash -= 10000*_PCSkillCheck, $aphrodisiacUpgrade = 1]]
	//Costs <<print cashFormat(10000*_PCSkillCheck)>>//

    //Should prevent most negative effects of withdrawal.//

<<elseif ($aphrodisiacUpgrade == 1)>>
	The fabricator is producing a substitute that will protect slaves from aphrodisiac withdrawal.

<</if>>

<<if ($healthyDrugsUpgrade == 0)>>
	<<if (($organFarmUpgrade >= 1) && ($injectionUpgrade != 0) && ($curativeUpgrade == 1) && ($aphrodisiacUpgrade == 1))>>
		<<if ($rep >= 15000*_PCSkillCheck)>>
			[[Fund research into drug formulations without negative physical side effects|Dispensary][$cash -= 500000*$upgradeMultiplierMedicine,$healthyDrugsUpgrade = 1]]
			//Costs <<print cashFormat(500000*$upgradeMultiplierMedicine)>>//

    //Will prevent the negative side effects of excessive drug usage on your slaves.//

		<<else>>
			// You lack the reputation to access the technology necessary to develop advanced drug formulations. //

		<</if>>
	<<else>>
		// You must purchase all other upgrades before developing advanced drug formulations. //

	<</if>>
<<else>>
	The fabricator has been upgraded to optimize the structures of your other drugs, eliminating their negative side effects.

<</if>>
/* Code [draft] contributed by Anon1888 */

<<if ($arcologies[0].FSBodyPuristLaw == 1)>>
	//The pharmaceutical fabricator is working with your body purist arcology to reduce long term drug side effects.//

<</if>>

<<if $seePreg != 0>>

Fertility Focused Pharmacology

<<if $seeHyperPreg == 1>>
	<<if $superFertilityDrugs == 1 && ($rep > 10000*_PCSkillCheck) && $pregSpeedControl != 1>>
		[[Fund research pregnancy speed control methods|Dispensary][$cash -= 200000*$upgradeMultiplierMedicine, $pregSpeedControl = 1, $clinicSpeedGestation = 0]]
		//Costs <<print cashFormat(200000*$upgradeMultiplierMedicine)>>//

    // Fund underground research labs to develop methods for controlling pregnancy progress. //

	<<elseif ($rep <= 10000*_PCSkillCheck) && $pregSpeedControl != 1>>
		//You lack the reputation required to contact underground research labs to develop methods for controlling pregnancy progress.//

	<<elseif ($pregSpeedControl == 1)>>
		The fabricator is producing extremely complex gestation control agents. They can be used to control gestation speed, and even suppress labor for some time. //

	<</if>>
<<elseif $birthsTotal > 10>>
	<<if ($rep > 10000*_PCSkillCheck) && $pregSpeedControl != 1>>
		[[Fund research pregnancy speed control methods|Dispensary][$cash -= 200000*$upgradeMultiplierMedicine, $pregSpeedControl = 1, $clinicSpeedGestation = 0]]
		//Costs <<print cashFormat(200000*$upgradeMultiplierMedicine)>>//

    // Fund underground research labs to develop methods for controlling pregnancy progress. //

	<<elseif ($rep <= 10000*_PCSkillCheck) && $pregSpeedControl != 1>>
		//You lack the reputation required to contact underground research labs to develop methods for controlling pregnancy progress.//

	<<elseif ($pregSpeedControl == 1)>>
		The fabricator is producing extremely complex gestation control agents. They can be used to control gestation speed, and even suppress labor for some time. //

	<</if>>
<<else>>
	//You lack the experience required to contact underground research labs to develop methods for controlling pregnancy progress.//

<</if>>

<<if ($superFertilityDrugs == 0) && ($rep > 2500*_PCSkillCheck) && $seeHyperPreg == 1>>
	[[Purchase data on powerful fertility drugs|Dispensary][$cash -= 20000*_PCSkillCheck, $superFertilityDrugs = 1]]
	//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Should improve the likelihood of conception and multiples. //

<<elseif ($superFertilityDrugs == 1)>>
	The fabricator is producing highly effective fertility agents. There is a warning present involving overdosing and instances of ten or more children.

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

Implant Production

<<if ($ImplantProductionUpgrade == 0) && ($rep <= 2000*_PCSkillCheck)>>
	//You lack the reputation to access experimental implant manufacturer parts//

<</if>>

<<if ($ImplantProductionUpgrade == 0) && ($rep > 2000*_PCSkillCheck)>>
    [[Upgrade the fabricator with an experimental implant manufacturer|Dispensary][$cash -= 20000*_PCSkillCheck, $ImplantProductionUpgrade = 1]]
	//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Will allow the fabrication of special implants using the autosurgery.//

<<elseif ($ImplantProductionUpgrade > 0)>>
	The fabricator is capable of crafting special implants.

<</if>>

<<if $ImplantProductionUpgrade == 1 && $seeHyperPreg == 1 && $seeExtreme == 1 && $seePreg != 0>>
	<<if ($permaPregImplant == 0) and ($rep <= 4000*_PCSkillCheck)>>
		//You lack the reputation to access experimental pregnancy generator schematics//

	<</if>>
	<<if ($permaPregImplant == 0) && ($rep > 4000*_PCSkillCheck)>>
		[[Purchase schematics for an experimental implantable pregnancy generator|Dispensary][$cash -= 30000*_PCSkillCheck, $permaPregImplant = 1]]
		//Costs <<print cashFormat(30000*_PCSkillCheck)>>//

    //Will allow the fabrication of implants that force perpetual pregnancy.//

	<<elseif ($permaPregImplant > 0)>>
		The fabricator is capable of crafting pregnancy generators.

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

<<if $ImplantProductionUpgrade == 1>>
	<<if ($bellyImplants == 0) && ($rep <= 2000*_PCSkillCheck)>>
		//You lack the reputation to access experimental fillable abdominal implants//

	<</if>>

	<<if ($bellyImplants == 0) && ($rep > 2000*_PCSkillCheck)>>
		[[Purchase schematics for fillable abdominal implants|Dispensary][$cash -= 20000*_PCSkillCheck, $bellyImplants = 1]]
		//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Will allow the fabrication of fillable abdominal implants using the autosurgery.//

	<<elseif ($bellyImplants > 0)>>
		The fabricator is capable of crafting fillable abdominal implants.

	<</if>>

	<<if ($bellyImplants == 1) && ($cervixImplants != 1) && ($rep <= 6000*_PCSkillCheck)>> /* show only after belly implants already researched */
		//You lack the reputation to access experimental cervix filter micropumps schematics for abdominal implants//

	<</if>>

	<<if ($bellyImplants == 1) && ($cervixImplants != 1) && ($rep >6000*_PCSkillCheck)>> /* nanotech like technology much more impressive and costly than simple implant */
		[[Purchase schematics for cervix filter micropumps|Dispensary][$cash -= 70000*_PCSkillCheck, $cervixImplants = 1]]
		//Costs <<print cashFormat(70000*_PCSkillCheck)>>//

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

	<<elseif ($cervixImplants > 0)>>
		The fabricator is capable of crafting cervix filter micropumps for fillable abdominal implants.

	<</if>>

	<<if ($prostateImplants != 1) && ($rep <= 3000*_PCSkillCheck)>>
		//You lack the reputation to access plans for prostate implants//

	<</if>>
	<<if ($prostateImplants != 1) && ($rep > 3000*_PCSkillCheck)>>
		[[Purchase plans for ejaculation enhancing prostate implants|Dispensary][$cash -= 30000*_PCSkillCheck, $prostateImplants = 1]]
		//Costs <<print cashFormat(30000*_PCSkillCheck)>>//

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

	<<elseif ($prostateImplants > 0)>>
		The fabricator is capable of producing ejaculation enhancing prostate implants.

	<</if>>

	<<if ($meshImplants != 1) && ($rep <= 10000*_PCSkillCheck)>>
		//You lack the reputation to access plans for supportive breast implants//

	<</if>>
	<<if ($meshImplants != 1) && ($rep > 10000*_PCSkillCheck)>>
		[[Purchase plans for supportive mesh breast implants|Dispensary][$cash -= 40000*_PCSkillCheck, $meshImplants = 1]]
		//Costs <<print cashFormat(40000*_PCSkillCheck)>>//

    //Will allow the fabrication of organic and supportive mesh breast implants.//

	<<elseif ($meshImplants > 0)>>
		The fabricator is capable of producing supportive mesh breast implants.

	<</if>>

<</if>>

Future Societies Research

<<if $seePreg != 0>>
<<if $arcologies[0].FSGenderRadicalistDecoration == 100 && $organFarmUpgrade > 0>>
	<<if ($arcologies[0].FSGenderRadicalistResearch == 0)>>
		<<if ($rep >= 10000*_PCSkillCheck)>>
			[[Fund research into developing male pregnancy methods|Dispensary][$cash -= 50000*$upgradeMultiplierMedicine,$arcologies[0].FSGenderRadicalistResearch = 1]] //Costs <<print cashFormat(50000*$upgradeMultiplierMedicine)>>. Will allow cloning and production of anal uteri and ovaries.//

		<<else>>
			// You lack the reputation to access the research necessary to develop anal uteri and ovaries. //

		<</if>>
	<<else>>
		The organ farm has been upgraded with schematics for modified uteri and ovaries.

	<</if>>
<<elseif $arcologies[0].FSGenderRadicalistResearch == 1>>
	The organ farm has been upgraded with schematics for modified uteri and ovaries.

<<else>>
	// Gender Radicalist focused research unavailable. //

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

<<if ($ImplantProductionUpgrade == 1) and ($arcologies[0].FSTransformationFetishistDecoration >= 100)>>
	<<if ($arcologies[0].FSTransformationFetishistResearch == 0) and ($rep <= 5000*_PCSkillCheck)>>
		//You lack the reputation to access experimental gigantic implants and elasticizing filler.//

	<<elseif ($arcologies[0].FSTransformationFetishistResearch == 0)>>
		[[Purchase data on gigantic implants and elasticizing filler|Dispensary][$cash -= 20000*_PCSkillCheck, $arcologies[0].FSTransformationFetishistResearch = 1]]
		//Costs <<print cashFormat(20000*_PCSkillCheck)>>//

    //Will allow the fabrication of gigantic implants using the autosurgery and filler capable of overfilling existing fillable implants.//

	<<elseif ($arcologies[0].FSTransformationFetishistResearch > 0)>>
		The fabricator is capable of crafting gigantic implants and elasticizing filler designed to overfill existing implants.

	<</if>>
<<elseif $arcologies[0].FSTransformationFetishistResearch == 1>>
	The fabricator is capable of crafting gigantic implants and elasticizing filler designed to overfill existing implants.

<<else>>
	// Transformation Fetishist focused research unavailable. //

<</if>>

<<if $arcologies[0].FSAssetExpansionistDecoration == 100>>
	<<if ($arcologies[0].FSAssetExpansionistResearch == 0)>>
		<<if ($rep >= 5000*_PCSkillCheck)>>
			[[Fund research into drug formulations for growth without limit|Dispensary][$cash -= 30000*$upgradeMultiplierMedicine,$arcologies[0].FSAssetExpansionistResearch = 1]] //Costs <<print cashFormat(30000*$upgradeMultiplierMedicine)>>. Will allow creation of drugs to push assets to unthinkable sizes.//

		<<else>>
			// You lack the reputation to access the research necessary to develop advanced growth drug formulations. //

		<</if>>
	<<else>>
		The fabricator has been upgraded to manufacture extremely powerful growth drugs.

	<</if>>
<<elseif $arcologies[0].FSAssetExpansionistResearch == 1>>
	The fabricator has been upgraded to manufacture extremely powerful growth drugs.

<<else>>
	// Asset Expansionist focused research unavailable. //

<</if>>

<<if $arcologies[0].FSSlimnessEnthusiastDecoration == 100>>
	<<if ($arcologies[0].FSSlimnessEnthusiastResearch == 0)>>
		<<if ($rep >= 5000*_PCSkillCheck)>>
			[[Fund research into drug formulations for slimming slaves|Dispensary][$cash -= 30000*$upgradeMultiplierMedicine,$arcologies[0].FSSlimnessEnthusiastResearch = 1]] //Costs <<print cashFormat(30000*$upgradeMultiplierMedicine)>>. Will allow creation of drugs to shrink assets.//

		<<else>>
			// You lack the reputation to access the research necessary to develop asset reducing drug formulations. //

		<</if>>
	<<else>>
		The fabricator has been upgraded to manufacture growth reversing drugs.

	<</if>>
<<elseif $arcologies[0].FSSlimnessEnthusiastResearch == 1>>
	The fabricator has been upgraded to manufacture growth reversing drugs.

<<else>>
	// Slimness Enthusiast focused research unavailable. //

<</if>>

<<if $arcologies[0].FSYouthPreferentialistDecoration == 100>>
	<<if ($arcologies[0].FSYouthPreferentialistResearch == 0)>>
		<<if ($rep >= 5000*_PCSkillCheck)>>
			[[Fund research into skin care designed to reverse the effects of aging|Dispensary][$cash -= 30000*$upgradeMultiplierMedicine,$arcologies[0].FSYouthPreferentialistResearch = 1]] //Costs <<print cashFormat(30000*$upgradeMultiplierMedicine)>>. Will allow creation of beauty creams designed to make slaves look young again.//

		<<else>>
			// You lack the reputation to access the research necessary to develop beauty creams designed to make slaves look young again. //

		<</if>>
	<<else>>
		The fabricator has been upgraded to manufacture extremely effective beauty creams designed to combat aging.

	<</if>>
<<elseif $arcologies[0].FSYouthPreferentialistResearch == 1>>
	The fabricator has been upgraded to manufacture extremely effective beauty creams designed to combat aging.

<<else>>
	// Youth Preferentialist focused research unavailable. //

<</if>>

<<if $arcologies[0].FSHedonisticDecadenceDecoration == 100>>
	<<if ($arcologies[0].FSHedonisticDecadenceResearch == 0)>>
		<<if ($rep >= 5000*_PCSkillCheck)>>
			[[Purchase recipes for concentrated, shaped slave food|Dispensary][$cash -= 50000*_PCSkillCheck,$arcologies[0].FSHedonisticDecadenceResearch = 1]] //Costs <<print cashFormat(50000*_PCSkillCheck)>>. Will allow production of solid slave food in various familiar shapes and flavors. Addictive and a little fatty.<<if $arcologies[0].FSDegradationist != "unset">> Since your slaves don't deserve luxuries, a modified recipe formulated to cause severe stomach cramps minutes after ingestion will be developed.<</if>> //

		<<else>>
			// You lack the reputation to access the research necessary to purchase concentrated, shaped slave food recipes. //

		<</if>>
	<<else>>
		The fabricator has been upgraded to manufacture tasty, extremely addictive, solid slave food in various familiar shapes and flavors. While they look and taste like real food, their consistency is all wrong. Slaves gorging on them are likely to experience steady weight gain.<<if $arcologies[0].FSDegradationist != "unset">> Since your slaves don't deserve luxuries, all food crafted will cause severe stomach cramps minutes after ingestion. Coupled with their addictive nature, it ought to be quite torturous.<</if>>
		<<if $arcologies[0].FSSlimnessEnthusiast > 50 && $arcologies[0].FSHedonisticDecadenceDietResearch == 0>>
			[[Purchase diet recipes|Dispensary][$cash -= 10000*_PCSkillCheck,$arcologies[0].FSHedonisticDecadenceDietResearch = 1]]
			//Costs <<print cashFormat(10000*_PCSkillCheck)>>//

    Will prevent rampant weight gain from ruining your slim slaves.

		<<elseif $arcologies[0].FSHedonisticDecadenceDietResearch == 1>>
			A diet recipe is being utilized to prevent unwanted weight gain.

		<</if>>
	<</if>>
<<elseif $arcologies[0].FSHedonisticDecadenceResearch == 1>>
	The fabricator has been upgraded to manufacture tasty, extremely addictive, solid slave food in various familiar shapes and flavors. While they look and taste like real food, their consistency is all wrong. Slaves gorging on them are likely to experience steady weight gain.<<if $arcologies[0].FSDegradationist != "unset">> Since your slaves don't deserve luxuries, all food crafted will cause severe stomach cramps minutes after ingestion. Coupled with their addictive nature, it ought to be quite torturous.<</if>>
	<<if $arcologies[0].FSSlimnessEnthusiast > 50 && $arcologies[0].FSHedonisticDecadenceDietResearch == 0>>
		[[Purchase diet recipes|Dispensary][$cash -= 10000*_PCSkillCheck,$arcologies[0].FSHedonisticDecadenceDietResearch = 1]]
		//Costs <<print cashFormat(10000*_PCSkillCheck)>>//

    Will prevent rampant weight gain from ruining your slim slaves.

	<<elseif $arcologies[0].FSHedonisticDecadenceDietResearch == 1>>
		A diet recipe is being utilized to prevent unwanted weight gain.

	<</if>>
<<else>>
	// Hedonistic Decadence focused research unavailable. //

<</if>>


code:
:: DJ Select [nobr]

<<set $nextButton = "Back", $nextLink = "Club", $showEncyclopedia = 1>><<set $encyclopedia = "DJ">>
<<showallAssignmentFilter>>
<<if ($DJ != 0)>>
	''__@@.pink;<<SlaveFullName $DJ>>@@__'' is serving as your DJ.

She will headline entertainment in $clubName.
<<else>>
	You have not selected a DJ.
<</if>>

''Appoint a DJ from your devoted slaves:''

[[None|DJ Workaround][$i = -1]]

<<assignmentFilter>>

	<<showallAssignmentFilter>>
	<<include "Slave Summary">>
	<<resetAssignmentFilter>>


code:
:: DJ Workaround [silently]

<<if $DJ != 0>>
	<<removeJob $DJ "be the DJ">>
<</if>>
<<if $i > -1>>
	<<assignJob $slaves[$i] "be the DJ">>
	<<set $slaves[$i].livingRules = "luxurious">>
	<<set $DJ = $slaves[$i]>>
<</if>>

<<goto "Club">>


code:
:: Economics [nobr]

 <<print $arcologies[0].name + " Weekly Financial Report - Week " + $week>>

<<set $nextButton = "Continue", $nextLink = "Scheduled Event">>

<<if $cash > -10000>>
	<<set $debtWarned = 0>>
<</if>>

<<SectorCounts>>
<<UpdateOwnership>>

<<include "Markets Report">>

<<if $useTabs == 0>>
<<include "Neighbors Development">>

<<include "Personal Business">>

<<if $corpAnnounced == 1>>

	<<if $corpIncorporated == 0>>

	You have not yet committed funds to create a publicly traded slave trading corporation. <<link "Lay the groundwork for incorporation">><<set $corpIncorporated = 1>><<set $sharePrice = 20>><<set $oldSharePrice = $sharePrice>><<set $personalShares = 2000>><<set $cash -= 30000>><<set $publicShares = 1000>><<set $corpCash = 20000>><<set $generalAssets = 500>><<set $slaveAssets = 1000>><<set $entrapmentAssets = 500>><<set $captureAssets = 500>><<set $trainingAssets = 500>><<set $surgicalAssets = 500>><<set $drugAssets = 500>><<replace "#incorporate">><<print "The groundwork has been laid for the incorporation of a publicly traded slave trading corporation. The IPO will involve 1000 shares at <<print cashFormat(20)>>/share.">><</replace>><</link>> //Costs <<print cashFormat(30000)>>//

	<<else>>
	<<include "Corporation Developments">>
	<</if>>

<</if>>
<<include "Reputation">>

<<if $secExp == 1>>

<<include "authorityReport">>
<</if>>

<<include "Arcology Management">>

<<if ($PC.boobs == 1 && $PC.boobsBonus > 0) || $PC.pregKnown == 1 || $playerAging != 0>>

<<include "Personal Notes">>
<</if>>

<<if $FSAnnounced > 0>>

	<<include "FS Developments">>
<</if>>

<<if $secExp == 1>>
<<include "securityReport">>
<</if>>

<<else>>
<<CreateSimpleTabs>>

  <button class="tablinks" onclick="opentab(event, 'Arcologies')" id="defaultOpen">Arcologies</button>
  <button class="tablinks" onclick="opentab(event, 'Business')">Personal Business</button>
	<<if $corpAnnounced == 1>>
	<button class="tablinks" onclick="opentab(event, 'Corporation')">Corporation</button>
	<</if>>
	<button class="tablinks" onclick="opentab(event, 'Reputation')">Reputation</button>
	<<if $secExp == 1>>
	<button class="tablinks" onclick="opentab(event, 'Authority')">Authority</button>
	<</if>>
	<button class="tablinks" onclick="opentab(event, 'Management')">Arcology Management</button>
	<<if ($PC.boobs == 1 && $PC.boobsBonus > 0) || $PC.pregKnown == 1 || $playerAging != 0>>
	<button class="tablinks" onclick="opentab(event, 'Personal')">Personal Notes</button>
	<</if>>
	<<if $FSAnnounced > 0>>
	<button class="tablinks" onclick="opentab(event, 'Societies')">Society Development</button>
	<</if>>
	<<if $secExp == 1>>
	<button class="tablinks" onclick="opentab(event, 'securityReport')">Security</button>
	<</if>>

  <<include "Neighbors Development">>

<<include "Personal Business">>

<<if $corpAnnounced == 1>>

<<if $corpIncorporated == 0>>

You have not yet committed funds to create a publicly traded slave trading corporation. <<link "Lay the groundwork for incorporation">><<set $corpIncorporated = 1>><<set $sharePrice = 20>><<set $oldSharePrice = $sharePrice>><<set $personalShares = 2000>><<set $cash -= 30000>><<set $publicShares = 1000>><<set $corpCash = 20000>><<set $generalAssets = 500>><<set $slaveAssets = 1000>><<set $entrapmentAssets = 500>><<set $captureAssets = 500>><<set $trainingAssets = 500>><<set $surgicalAssets = 500>><<set $drugAssets = 500>><<replace "#incorporate">><<print "The groundwork has been laid for the incorporation of a publicly traded slave trading corporation. The IPO will involve 1000 shares at <<print cashFormat(20)>>/share.">><</replace>><</link>> //Costs <<print cashFormat(30000)>>//

<<else>>
<<include "Corporation Developments">>
<</if>>

<</if>>

<<include "Reputation">>

<<include "authorityReport">>

<<include "Arcology Management">>

<<if ($PC.boobs == 1 && $PC.boobsBonus > 0) || $PC.pregKnown == 1 || $playerAging != 0>>

<<include "Personal Notes">>

<</if>>

<<if $FSAnnounced > 0>>

<<include "FS Developments">>

<</if>>

<<include "securityReport">>

<</if>>


code:
:: End Week [nobr]

<<set $gingering = 0, $oralUseWeight = 5, $vaginalUseWeight = 5, $analUseWeight = 5, $mammaryUseWeight = 1, $penetrativeUseWeight = 1, $inflatedSlavesMilk = 0, $inflatedSlavesCum = 0, $subSlaves = 0>>

<<if $OralEncouragement == 1>>
	<<set $oralUseWeight += 2, $vaginalUseWeight -= 1, $analUseWeight -= 1>>
<<elseif $VaginalEncouragement == 1>>
	<<set $oralUseWeight -= 1, $vaginalUseWeight += 2, $analUseWeight -= 1>>
<<elseif $AnalEncouragement == 1>>
	<<set $oralUseWeight -= 1, $vaginalUseWeight -= 1, $analUseWeight += 2>>
<</if>>
<<if $OralDiscouragement == 1>>
	<<set $oralUseWeight -= 2, $vaginalUseWeight += 1 , $analUseWeight += 1>>
<</if>>
<<if $VaginalDiscouragement == 1>>
	<<set $oralUseWeight += 1, $vaginalUseWeight -= 2, $analUseWeight += 1>>
<</if>>
<<if $AnalDiscouragement == 1>>
	<<set $oralUseWeight += 1, $vaginalUseWeight += 1, $analUseWeight -= 2>>
<</if>>
<<if $sexualOpeness == 1>>
	<<set $penetrativeUseWeight++>>
<</if>>
<<HSM>>

<<for _i = 0; _i < $slaves.length; _i++>>
	<<if $slaves[_i].inflationMethod == 1 || $slaves[_i].inflationMethod == 2>>
		<<if $slaves[_i].inflationType == "milk">>
			<<set $inflatedSlavesMilk++>>
		<<elseif $slaves[_i].inflationType == "cum">>
			<<set $inflatedSlavesCum++>>
		<</if>>
	<</if>>
	<<if $slaves[_i].assignment == "be a subordinate slave" && $slaves[_i].subTarget == 0>>
		<<set $subSlaves++>>
	<</if>>
<</for>>

<<if $organs.length > 0>>
<<for _i = 0; _i < $organs.length; _i++>>
	<<if $organs[_i].weeksToCompletion > 0>>
		<<if $organFarmUpgrade == 3>>
			<<set $organs[_i].weeksToCompletion -= 4>>
		<<elseif $organFarmUpgrade == 2>>
			<<set $organs[_i].weeksToCompletion -= 2>>
		<<else>>
			<<set $organs[_i].weeksToCompletion-->>
		<</if>>
	<</if>>
	<<if $organs[_i].weeksToCompletion <= 0>>
		<<set $completedOrgans.push($organs[_i])>>
		<<set $organs.deleteAt(_i)>>
	<</if>>
<</for>>
<</if>>
<<if $incubatorOrgans.length > 0>>
<<for _i = 0; _i < $incubatorOrgans.length; _i++>>
	<<if $incubatorOrgans[_i].weeksToCompletion > 0>>
		<<if $organFarmUpgrade == 3>>
			<<set $incubatorOrgans[_i].weeksToCompletion -= 4>>
		<<elseif $organFarmUpgrade == 2>>
			<<set $incubatorOrgans[_i].weeksToCompletion -= 2>>
		<<else>>
			<<set $incubatorOrgans[_i].weeksToCompletion-->>
		<</if>>
	<</if>>
<</for>>
<</if>>

<<if $limbs.length > 0>>
<<for _i = 0; _i < $limbs.length; _i++>>
	<<if $limbs[_i].weeksToCompletion > 0>>
		<<set $limbs[_i].weeksToCompletion-->>
	<</if>>
	<<if $limbs[_i].weeksToCompletion == 0>>
		<<set $limbsCompleted++>>
	<</if>>
<</for>>
<</if>>

/% Begin section: ensure minimum age is set (game may have been loaded from a non-modded version). %/
<<if $minimumSlaveAge <= 18 && $minimumSlaveAge > 0>>
<<else>>
  <<set $minimumSlaveAge = 18>>
  <<set $pedo_mode = 0>>
  <<if $fertilityAge <= 18 && $fertilityAge > 0>>
  <<else>>
	<<set $fertilityAge = 13>>
  <</if>>
  <<if $potencyAge <= 18 && $potencyAge > 0>>
  <<else>>
	<<set $potencyAge = 13>>
  <</if>>
<</if>>
/% End section: ensure minimum age is set. %/

<<set $TSS.schoolSale = 0, $GRI.schoolSale = 0, $SCP.schoolSale = 0, $LDE.schoolSale = 0, $TGA.schoolSale = 0, $HA.schoolSale = 0, $TFS.schoolSale = 0, $TCR.schoolSale = 0, $independenceDay = 0, $showEncyclopedia = 0, $racialVarieties = [], $shelterGirlsIDs = [], $oldWeek = $week, $cashLastWeek = $cash>>

<<if $manuallyRetired == 0>><<set $retiree = 0>><</if>>
<<set $expiree = 0>>

<<set $PC.sexualEnergy = 4>>
<<if $personalAttention == "sex">>
	<<set $PC.sexualEnergy += 2>>
<</if>>
<<if $PC.physicalAge >= 65>>
	<<set $PC.sexualEnergy -= 4>>
<<elseif $PC.physicalAge >= 50>>
	<<set $PC.sexualEnergy -= 2>>
<<elseif $PC.physicalAge < 21>>
	<<set $PC.sexualEnergy += 4>>
<<elseif $PC.physicalAge < 35>>
	<<set $PC.sexualEnergy += 2>>
<</if>>
<<if $PC.balls > 2>>
	<<set $PC.sexualEnergy += 2>>
<<elseif $PC.balls > 1>>
	<<set $PC.sexualEnergy++>>
<</if>>
<<if $PC.preg > 20>>
	<<if $PC.pregMood == 2>>
		<<set $PC.sexualEnergy += 4>>
	<<else>>
		<<set $PC.sexualEnergy -= 3>>
	<</if>>
<<elseif $PC.preg > 0>>
	<<set $PC.sexualEnergy -= 1>>
<<else>>
	<<if $PC.fertDrugs == 1>>
		<<set $PC.sexualEnergy++>>
	<</if>>
	<<if $PC.forcedFertDrugs > 0>>
		<<set $PC.sexualEnergy += 2>>
	<</if>>
<</if>>
<<if $PC.staminaPills > 0>>
	<<set $PC.sexualEnergy += 2>>
<</if>>
<<if $PC.preg > 0>>
	<<set WombProgress($PC, 1)>>
	<<set WombNormalizePreg($PC), $PC.pregWeek = $PC.preg>>
	<<set _newBelly = WombGetVolume($PC)>>
	<<if _newBelly >= $PC.belly>>
		<<set $PC.belly = _newBelly>>
	<<elseif $PC.belly > 500>>
		<<set $PC.belly *= .75>>
	<</if>>
	<<if $PC.fertDrugs != 0>>
		<<set $PC.fertDrugs = 0>>
	<</if>>
<<elseif $PC.belly > 0>>
	<<if $PC.belly < 100>>
		<<set $PC.belly = 0>>
	<<else>>
		<<set $PC.belly *= .75>>
	<</if>>
<</if>>
<<if $PC.pregWeek < 0>>
	<<set $PC.pregWeek++>>
<</if>>

<<set $HGEnergy = 0, $HGCum = 0, $HGSlaveSuccess = 0, $HeadGirl = 0, $Recruiter = 0, $Madam = 0, $madamCashBonus = 0, $DJ = 0, $DJRepBonus = 0, $Milkmaid = 0, $Collectrix = 0, $Stewardess = 0, $Schoolteacher = 0, $Wardeness = 0, $Concubine = 0, $Attendant = 0, $Nurse = 0, $Bodyguard = 0, $fuckSlaves = 0, $freeSexualEnergy = 0, $publicServants = 0, $cumSlaves = 0, $averageDick = 0, $slavesWithWorkingDicks = 0>>

/* GAMEOVERS */
<<if $slaves.length < 1>>
	<<set $gameover = "no slaves">><<goto "Gameover">>
<<elseif $arcologies[0].ownership < $arcologies[0].minority>>
	<<set $gameover = "ownership">><<goto "Gameover">>
<<else>>
	<<goto "Slave Assignments Report">>
<</if>>


code:
:: Export All Rules [nobr]

<<set $nextButton = "Continue", $nextLink = "Rules Assistant">>

//Copy one of following blocks for importing later. RA rules become too complex, only new (direct JSON) method guarantee proper result, but may not work in some browsers.//

 __Direct JSON export method__:

<<set _length = $defaultRules.length>>
<<for _r = _length - 1; _r >= 0; _r-->>
<<if $defaultRules[_r] == null>>
	<<continue>>
<</if>>
<<set _currentRule = $defaultRules[_r]>>

<<set _jsonText = toJson(_currentRule)>>
_jsonText

<</for>>


code:
:: Export Rule [nobr]

<<set $nextButton = "Continue", $nextLink = "Rules Assistant">>

//RA rules become too complex, only new (direct JSON) method guarantee proper result, but may not work in some browsers. (Mostly old ones.)//

 __Direct JSON export method__:

<<set _jsonText = toJson($currentRule)>>
_jsonText