code:
:: Club Report [nobr]

<<SlaveIDSort $ClubiIDs>>
<<set _DL = $ClubiIDs.length, _SL = $slaves.length, $clubBonuses = 0, $legendaryEntertainerID = 0, _FLsFetish = 0>>
<<set $legendaryWombID = 0>>
<<set _minBonus = 50, _maxBonus = 150>>

<<set $facility = $facility || {}, $facility.club = initFacilityStatistics($facility.club)>>
<<set _adMgr = new App.Ads.AdManager("club")>>

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

	<<if ($slaves[_FLs].health.condition < -80)>>
		<<run improveCondition($slaves[_FLs], 20)>>
	<<elseif $slaves[_FLs].health.condition < -40>>
		<<run improveCondition($slaves[_FLs], 15)>>
	<<elseif $slaves[_FLs].health.condition < 0>>
		<<run improveCondition($slaves[_FLs], 10)>>
	<<elseif $slaves[_FLs].health.condition < 90>>
		<<run improveCondition($slaves[_FLs], 7)>>
	<</if>>
	<<if $slaves[_FLs].devotion <= 60>>
		<<set $slaves[_FLs].devotion += 5>>
	<</if>>
	<<if $slaves[_FLs].trust < 60>>
		<<set $slaves[_FLs].trust += 3>>
	<</if>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "humiliation">>
			<<if fetishChangeChance($slaves[_FLs]) > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "humiliation">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	<<if $slaves[_FLs].rules.living != "luxurious">>
		<<set $slaves[_FLs].rules.living = "luxurious">>
	<</if>>
	/% Make sure we have registered living expenses as for any other slave %/
	<<run getSlaveStatisticData($DJ, $facility.club)>>
	<<set $DJ = $slaves[_FLs]>>
	<<setLocalPronouns $DJ>>
	    <<= SlaveFullName($DJ)>> is performing as the DJ.
	<<if $DJ.relationship == -3 && $DJ.devotion > 50>>
		$He tries $his best to be your energetic, cheerful $wife.
	<</if>>
	<<if (_FLsFetish == 1)>>
		$He's expected to be the innovative, beautiful DJ spinning beats one minute, and come out of $his booth to grind on the floor the next; $he enjoys the interplay, and finds greater @@.lightcoral;pleasure in exhibitionism.@@
	<<elseif (_FLsFetish == 2)>>
		Every day $he gets to enjoy hundreds of stares on $his skin, and @@.lightsalmon;becomes more of an exhibitionist.@@
	<</if>>
	<<if getBestVision($DJ) === 0>>
		$His lack of eyesight doesn't slow $him down; rather, it strengthens $his other senses. $His tracks have a distinct sound, since $he experiences noise as $his sight.
	<</if>>
	<<if ($DJ.skill.entertainment <= 10)>>
		Though $DJ.slaveName does $his best to lead on the club, with $his lack of skill $he can do little.
	<<elseif ($DJ.skill.entertainment <= 30)>>
		$DJ.slaveName's basic skills marginally @@.green;improve@@ the atmosphere in $clubName.
	<<elseif ($DJ.skill.entertainment <= 60)>>
		$DJ.slaveName's skills @@.green;improve@@ the atmosphere in $clubName.
	<<elseif ($DJ.skill.entertainment < 100)>>
		$DJ.slaveName's skills greatly @@.green;improve@@ the atmosphere in $clubName.
	<<elseif ($DJ.skill.entertainment >= 100)>>
		$DJ.slaveName's mastery immensely @@.green;improves@@ the atmosphere in $clubName.
	<</if>>
	<<if ($DJ.muscles > 5) && ($DJ.muscles <= 95)>>
		$His toned body helps $him lead $his fellow club sluts by letting $him dance all night.
	<</if>>
	<<if ($DJ.intelligence+$DJ.intelligenceImplant > 15)>>
		$He's smart enough to make an actual contribution to the music, greatly enhancing the entire experience.
	<</if>>
	<<if ($DJ.face > 95)>>
		$His great beauty is a further draw, even when $he's in $his DJ booth, but especially when $he comes out to dance.
	<</if>>
	<<if setup.DJCareers.includes($DJ.career)>>
		$He has musical experience from $his life before $he was a slave, a grounding that gives $his tracks actual depth.
	<<elseif $DJ.skill.DJ >= $masteredXP>>
		$He has musical experience from working for you, giving $his tracks actual depth.
	<<else>>
		<<set $slaves[_FLs].skill.DJ += random(1,Math.ceil(($DJ.intelligence+$DJ.intelligenceImplant)/15) + 8)>>
	<</if>>
	<<if (_DL + $clubSlavesGettingHelp < 10)>>
		<<set $i = _FLs>> /* apply following SA passages to facility leader */
		<<if ($legendaryEntertainerID == 0) && ($slaves[_FLs].prestige == 0) && ($slaves[_FLs].skill.entertainment >= 100) && ($slaves[_FLs].devotion > 50)>>
			<<set $legendaryEntertainerID = $slaves[_FLs].ID>>
		<</if>>

    Since $he doesn't have enough sluts in $clubName to make it worthwhile for $him to be on stage 24/7, $he spends $his extra time slutting it up $himself. $He has sex with $slaves[$i].sexAmount citizens, @@.green;pleasing them immensely,@@ since it's more appealing to fuck the DJ than some club slut.
		<<if $showEWD != 0>>

    $He <<= saServeThePublic($slaves[$i])>>
		<<else>>
			<<run saServeThePublic($slaves[$i])>>
		<</if>>
	<</if>>
	<<if (_DL > 0)>>

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

<<if (_DL > 0)>>
	<<set _possibleBonuses = 0>>
	    <<if (_DL != 1)>>''The _DL slaves pleasing citizens in $clubName''<<else>>''The one slave pleasing citizens in $clubName''<</if>> worked hard to @@.green;increase your reputation@@ this week.
<</if>>

<<if ($DJ != 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 performing as the DJ in $clubName.

		<<= 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>>
		<<run 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 $DJ = $slaves[_FLs]>>
	<<run _adMgr.tallySlave($DJ)>>
<</if>>

<<if (_DL > 0)>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$ClubiIDs[_dI]]>>
		<<setLocalPronouns $slaves[$i]>>
		<<if ($legendaryEntertainerID == 0) && ($slaves[$i].prestige == 0) && ($slaves[$i].skill.entertainment >= 100) && ($slaves[$i].devotion > 50)>>
			<<set $legendaryEntertainerID = $slaves[$i].ID>>
		<</if>>
		<<if ($legendaryWombID == 0) && (!isAmputee($slaves[$i])) && ($slaves[$i].preg > $slaves[$i].pregData.normalBirth/1.33) && ($slaves[$i].broodmother == 0) && ($slaves[$i].eggType == "human") && ($slaves[$i].counter.births > 10) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>>
			<<set $legendaryWombID = $slaves[$i].ID>>
		<</if>>
		<<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>>
			<<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>>
		<<elseif ($slaves[$i].devotion < 45)>>
			<<set $slaves[$i].devotion += 4>>
		<<elseif ($slaves[$i].devotion > 50)>>
			<<set $slaves[$i].devotion -= 4>>
		<</if>>

		<<if ($slaves[$i].trust < 30)>>
			<<set $slaves[$i].trust += 5>>
		<</if>>

		<<if ($slaves[$i].health.condition < -80)>>
			<<run improveCondition($slaves[$i], 20)>>
		<<elseif ($slaves[$i].health.condition < -40)>>
			<<run improveCondition($slaves[$i], 15)>>
		<<elseif ($slaves[$i].health.condition < 0)>>
			<<run improveCondition($slaves[$i], 10)>>
		<<elseif ($slaves[$i].health.condition < 90)>>
			<<run improveCondition($slaves[$i], 7)>>
		<</if>>

		<<if $slaves[$i].rules.living != "normal">>
			<<set $slaves[$i].rules.living = "normal">>
		<</if>>

		<<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 in $clubName.
			<</if>>

    $He <<= saServeThePublic($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 saServeThePublic($slaves[$i])>>
			<<run 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>>
		<<run _adMgr.tallySlave($slaves[$i])>>
	<</for>>

	<<if $clubAdsSpending != 0>>
		An ad campaign is getting citizens into the club every night, and sluts that match it gratify patrons.
	<</if>>
	<<set _adcats = App.Ads.Categories>> /* for brevity */

	<<if $clubAdsSpending != 0>>
		<<if $clubAdsStacked == 1>>
			Its advertisements feature stacked girls.
			<<set _ads = 1>>
		<<elseif $clubAdsStacked == -1>>
			Its advertisements feature slim girls.
			<<set _ads = -1>>
		<<else>>
			Its advertisements feature a variety of girls, some that are slim and some others that are stacked.
			<<set _ads = 0>>
		<</if>>
	<</if>>
	<<set _pref = _adcats.assetSize.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetSize)>>
	<<if _pref === 1>>
		Most customers prefer stacked girls.
	<<elseif _pref === -1>>
		Most customers prefer slim girls.
	<<else>>
		<<set _variety = _adMgr.varietyBonus(_adcats.assetSize)>>
		<<set _possibleBonuses += Math.abs(_variety)>>
		<<if _variety === 1>>
			<<set $clubBonuses++>>
			<<run repX(_DL*random(5,10), "club")>>
			There is a @@.green;wide@@ variety of slim and stacked slaves working the club.
		<</if>>
		Most customers don't have preferences for either slim or stacked slaves.
	<</if>>
	<<if _girls === -1>>
		Most of the slaves in the club are slim.
	<<elseif _girls === 1>>
		Most of the slaves in the club are stacked.
	<<else>>
		The slaves in the club vary in slimness.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($clubAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
			<<run cashX(_adsIncome, "clubAds")>>
			Its advertising for <<if _ads == 1>>stacked <<elseif _ads == -1>>slim <</if>>girls matched most customers' preferences and the girls in the club matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising for <<if _ads == 1>>stacked <<elseif _ads == -1>>slim <</if>>girls matched most customers preferences, but the girls in the club did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>stacked <<elseif _girls == -1>>slim <</if>>girls in the club did not match its advertisements, but since the girls in the club matched most customers preferences for <<if _pref == 1>>stacked <<elseif _pref == -1>>slim <</if>>girls, your reputation was not affected.
		<<elseif (_girls != _pref)>>
			Some customers were put off since the <<if _girls == 1>>stacked <<elseif _girls == -1>>slim <</if>>girls there did not match their preferences for <<if _pref == 1>>stacked <<elseif _pref == -1>>slim <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>stacked <<elseif _girls == -1>>slim <</if>>girls in the club match most customers' preferences for <<if _pref == 1>>stacked <<elseif _pref == -1>>slim <</if>>girls. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>stacked <<elseif _girls == -1>>slim <</if>>girls there did not match their preferences for <<if _pref == 1>>stacked <<elseif _pref == -1>>slim <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<</if>>

	<<if ($clubAdsSpending > 0)>>
		<<if $clubAdsModded == 1>>
			Its advertisements feature girls that are heavily pierced and tattooed.
			<<set _ads = 1>>
		<<elseif $clubAdsModded == -1>>
			Its advertisements feature girls that free from piercings and tattoos.
			<<set _ads = -1>>
		<<else>>
			Its advertisements feature some girls that are tattooed and pierced, and some that aren't.
			<<set _ads = 0>>
		<</if>>
	<</if>>
	<<set _pref = _adcats.mods.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.mods)>>
	<<if _pref === 1>>
		Most customers prefer heavily pierced and tattooed girls.
	<<elseif _pref === -1>>
		Most customers prefer natural girls.
	<<else>>
		<<set _variety = _adMgr.varietyBonus(_adcats.mods)>>
		<<set _possibleBonuses += Math.abs(_variety)>>
		<<if _variety === 1>>
			<<set $clubBonuses++>>
			<<run repX(_DL*random(5,10), "club")>>
			There are @@.green;both@@ heavily pierced and tattooed slaves and slaves with more natural bodies filling the club.
		<</if>>
		Most customers don't have preferences for either natural or heavily body modded girls.
	<</if>>
	<<if _girls === 1>>
		Most of the slaves in the club are heavily pierced and tattooed.
	<<elseif _girls === -1>>
		Most of the slaves in the club have natural unmodded bodies.
	<<else>>
		Some girls in the club have piercings or tattoos, some do not and others have both.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($clubAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
			<<run cashX(_adsIncome, "clubAds")>>
			Its advertising for <<if _ads == 1>>heavily modded <<elseif _ads == -1>>natural bodied <</if>>girls matched most customers' preferences and the girls in the club matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising for <<if _ads == 1>>heavily modded <<elseif _ads == -1>>natural bodied <</if>>girls matched most customers preferences, but the girls in the club did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>heavily modded <<elseif _girls == -1>>natural bodied <</if>>girls in the club did not match its advertisements, but since the girls in the club matched most customers preferences for <<if _pref == 1>>heavily modded <<elseif _pref == -1>>natural bodied <</if>>girls, your reputation was not affected.
		<<elseif (_girls != _pref)>>
			Some customers were put off since the <<if _girls == 1>>heavily modded <<elseif _girls == -1>>natural bodied <</if>>girls there did not match most customers preferences for <<if _pref == 1>>heavily modded <<elseif _pref == -1>>natural bodied <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>heavily modded <<elseif _girls == -1>>natural bodied <</if>>girls in the club match most customers' preferences for <<if _pref == 1>>heavily modded <<elseif _pref == -1>>natural unmodded <</if>>girls. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>heavily modded <<elseif _girls == -1>>natural bodied <</if>>girls there did not match most customers preferences for <<if _pref == 1>>heavily modded <<elseif _pref == -1>>natural bodied <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<</if>>

	<<if ($clubAdsSpending > 0)>>
		<<if $clubAdsImplanted == 1>>
			Its advertisements feature girls that are augmented by implants or improved surgically.
			<<set _ads = 1>>
		<<elseif $clubAdsImplanted == -1>>
			Its advertisements feature girls that have all natural bodies.
			<<set _ads = -1>>
		<<else>>
			Its advertisements feature some girls that are surgically improved and implanted and some that are all-natural.
			<<set _ads = 0>>
		<</if>>
	<</if>>
	<<set _pref = _adcats.assetOrigin.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetOrigin)>>
	<<if _pref === 1>>
		Most customers prefer heavily implanted and surgically enhanced girls.
	<<elseif _pref === -1>>
		Most customers prefer all-natural girls.
	<<else>>
		<<set _variety = _adMgr.varietyBonus(_adcats.assetOrigin)>>
		<<set _possibleBonuses += Math.abs(_variety)>>
		<<if _variety === 1>>
			<<set $clubBonuses++>>
			<<run repX(_DL*random(5,10), "club")>>
			Citizens in $clubName can easily find @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means.
		<</if>>
		Most customers don't have preferences for either all-natural or surgically enhanced and implanted girls.
	<</if>>
	<<if _girls === 1>>
		Most of the slaves in the club are heavily implanted or surgically enhanced.
	<<elseif _girls === -1>>
		Most of the slaves in the club have naturally pure bodies.
	<<else>>
		The slaves in the club vary in body modification.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($clubAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
			<<run cashX(_adsIncome, "clubAds")>>
			Its advertising for <<if _ads == 1>>implanted or surgically improved <<elseif _ads == -1>>naturally pure <</if>>girls matched most customers' preferences and the girls in the club matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising for <<if _ads == 1>>implanted or surgically improved <<elseif _ads == -1>>naturally pure <</if>>girls matched most customers preferences, but the girls in the club did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>implanted or surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls in the club did not match its advertisements, but since the girls in the club matched most customers preferences for <<if _pref == 1>>implanted or surgically improved <<elseif _pref == -1>>naturally pure <</if>>girls, your reputation was not affected.
		<<elseif (_girls != _pref)>>
			Some customers were put off since the <<if _girls == 1>>implanted and surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls there did not match their preferences for <<if _pref == 1>>implanted or surgically improved <<elseif _pref == -1>>naturally pure <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>implanted or surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls in the club match most customers' preferences for <<if _pref == 1>>implanted or surgically improved <<elseif _pref == -1>>natural unmodded <</if>>girls. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>implanted and surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls there did not match their preferences for <<if _pref == 1>>implanted or surgically improved <<elseif _pref == -1>>naturally pure <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<</if>>

	<<if ($seeDicks != 0)>>

		<<if ($clubAdsSpending > 0)>>
			<<if ($clubAdsXX == 1)>>
				Its advertisements feature girls with female genitalia.
				<<set _ads = 1>>
			<<elseif ($clubAdsXX == -1)>>
				Its advertisements feature girls with male genitalia.
				<<set _ads = -1>>
			<<else>>
				Its advertisements feature a variety of girls with both male and female genitalia.
				<<set _ads = 0>>
			<</if>>
		<</if>>
		<<set _pref = _adcats.genitalia.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.genitalia)>>
		<<if _pref === 1>>
			Most customers prefer girls with pussies.
		<<elseif _pref === -1>>
			Most customers prefer girls with dicks.
		<<else>>
			<<set _variety = _adMgr.varietyBonus(_adcats.genitalia)>>
			<<set _possibleBonuses += Math.abs(_variety)>>
			<<if _variety === 1>>
				<<set $clubBonuses++>>
				<<run repX(_DL*random(5,10), "club")>>
				The club offers a @@.green;mix@@ of sluts that can appeal to varied tastes in genitalia.
			<</if>>
			Most customers don't have preferences for either girls with dicks or girls with pussies.
		<</if>>
		<<if _girls === 1>>
			Most of the slaves in the club have female genitalia.
		<<elseif _girls === -1>>
			Most of the slaves in the club have male genitalia.
		<<else>>
			The slaves in the club vary in genitalia.
		<</if>>
		<<if _pref == 0>> /*customers don't care*/
		<<elseif ($clubAdsSpending > 0) >>
			<<if (_ads == _pref) && (_girls == _ads)>>
				<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
				<<run cashX(_adsIncome, "clubAds")>>
				Its advertising for girls <<if _ads == 1>>with pussies <<elseif _ads == -1>>with dicks <</if>> matches most customers' preferences as advertised. Your @@.green;reputation@@ increased slightly as a result.
				<<run repX(random(_minBonus,_maxBonus), "club")>>
			<<elseif (_ads == _pref) && (_girls != _ads)>>
				Its advertising for girls <<if _ads == 1>>with pussies <<elseif _ads == -1>>with dicks <</if>> matched most customers preferences, but the girls in the club are not as advertised. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<<elseif (_girls == _pref) && (_girls != _ads)>>
				The girls <<if _girls == 1>> with pussies<<elseif _girls == -1>> with dicks<</if>>in the club did not match the advertisements, but since the girls in the club matched most customers preferences for girls<<if _pref == 1>> with pussies<<elseif _pref == -1>> with dicks<</if>>, your reputation was not affected.
			<<elseif (_girls != _pref)>>
				Some customers were put off since the girls <<if _girls == 1>>with female genitalia <<elseif _girls == -1>>with male genitalia <</if>> did not match their preferences for girls<<if _pref == 1>> with pussies<<elseif _pref == -1>> with dicks<</if>>. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<</if>>
		<<else>>
			<<if (_girls == _pref)>>
				The girls in the club match most customers preferences for girls <<if _girls == 1>>with female genitalia <<elseif _girls == -1>>with male genitalia <</if>>. Your @@.green;reputation@@ increased slightly as a result.
				<<run repX(random(_minBonus,_maxBonus), "club")>>
			<<else>>
				Some customers were put off since the girls <<if _girls == 1>>with female genitalia <<elseif _girls == -1>>with male genitalia <</if>> did not match their preferences for girls<<if _pref == 1>> with pussies<<elseif _pref == -1>> with dicks<</if>>. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<</if>>
		<</if>>
	<</if>>

	<<if ($clubAdsSpending > 0)>>
		<<switch ($clubAdsOld)>>
			<<case 1>>
				Its advertisements feature mature slaves.
				<<set _ads = 1>>
			<<case -1>>
				Its advertisements feature young slaves.
				<<set _ads = -1>>
			<<case -2>>
				Its advertisements feature teenagers.
				<<set _ads = -1>>
			<<case -3>>
				Its advertisements feature lolis.
				<<set _ads = -1>>
			<<default>>
				Its advertisements feature slaves of a variety of ages.
				<<set _ads = 0>>
		<</switch>>
	<</if>>
	<<set _pref = _adcats.age.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.age)>>
	<<if _pref === 1>>
		Most customers prefer mature girls.
	<<elseif _pref === -1>>
		Most customers prefer young girls.
	<<else>>
		<<set _variety = _adMgr.varietyBonus(_adcats.age)>>
		<<set _possibleBonuses += Math.abs(_variety)>>
		<<if _variety === 1>>
			<<set $clubBonuses++>>
			<<run repX(_DL*random(5,10), "club")>>
			There are girls @@.green;both@@ young and mature in $clubName.
		<</if>>
		Most customers don't have preferences for either mature or young girls.
	<</if>>
	<<if _girls === 1>>
		Most of the slaves in the club are mature.
	<<elseif _girls === -1>>
		Most of the slaves in the club are young.
	<<else>>
		The slaves in the club vary in age.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($clubAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
			<<run cashX(_adsIncome, "clubAds")>>
			Its advertising matches most customers' age preferences and the girls in the club match the ages as advertised. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising matched most customers age preferences, but the girls in the club do not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The ages of girls in the club did not match the ages as advertised, but since the girls in the club matched most customers age preferences, your reputation was not affected.
		<<elseif (_girls != _pref) && (_girls == _ads)>>
			Some customers were put off since the ages of girls there did not match their preferences. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The girls in the club match most customers' age preferences. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "club")>>
		<<else>>
			Some customers were put off since the ages of girls there did not match their preferences. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
		<</if>>
	<</if>>

	<<if $seePreg == 1>>

		<<if ($clubAdsSpending > 0)>>
			<<if $clubAdsPreg == 1>>
				Its advertisements feature girls that are clearly pregnant.
				<<set _ads = 1>>
			<<elseif $clubAdsPreg == -1>>
				Its advertisements feature girls that have flat, usually firm, bellies.
				<<set _ads = -1>>
			<<else>>
				Its advertisements feature some girls that are pregnant.
				<<set _ads = 0>>
			<</if>>
		<</if>>
		<<set _pref = _adcats.preg.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.preg)>>
		<<if _pref === 1>>
			Most customers prefer their girls rounded with child.
		<<elseif _pref === -1>>
			Most customers prefer girls that aren't gravid.
		<<else>>
			<<set _variety = _adMgr.varietyBonus(_adcats.assetSize)>>
			<<set _possibleBonuses += Math.abs(_variety)>>
			<<if _variety === 1>>
				<<set $clubBonuses++>>
				<<run repX(_DL*random(5,10), "club")>>
				There is a @@.green;wide@@ selection of slaves with a variety of middles working the club.
			<</if>>
			Most customers don't have preferences for either big-bellied or flat-bellied girls.
		<</if>>
		<<if _girls === -1>>
			Most of the slaves in the club sport flat bellies.
		<<elseif _girls === 1>>
			Most of the slaves in the club sport gravid middles.
		<<else>>
			The slaves in the club vary in belly type.
		<</if>>
		<<if (_pref == 0)>> /*customers don't care*/
		<<elseif ($clubAdsSpending > 0)>>
			<<if (_ads == _pref) && (_girls == _ads)>>
				<<set _adsIncome = _DL*random(20,30), $facility.club.adsIncome += _adsIncome, _clubBonuses++>>
				<<run cashX(_adsIncome, "clubAds")>>
				Its advertising for <<if _ads == 1>>pregnant <<elseif _ads == -1>>flat-bellied <</if>>girls matched most customers' preferences and the girls in the club matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
				<<run repX(random(_minBonus,_maxBonus), "club")>>
			<<elseif (_ads == _pref) && (_girls != _ads)>>
				Its advertising for <<if _ads == 1>>pregnant <<elseif _ads == -1>>flat-bellied <</if>>girls matched most customers preferences, but the girls in the club did not. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<<elseif (_girls == _pref) && (_girls != _ads)>>
				The <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the club did not match its advertisements, but since the girls in the club matched most customers preferences for <<if _pref == 1>>fecund <<elseif _pref == -1>>flat-bellied <</if>>girls, your reputation was not affected.
			<<elseif (_girls != _pref)>>
				Some customers were put off since the <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the club did not match their preferences for <<if _pref == 1>>fecund <<elseif _pref == -1>>flat-bellied <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<</if>>
		<<else>>
			<<if (_girls == _pref)>>
				The <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the club match most customers' preferences for <<if _pref == 1>>fecund <<elseif _pref == -1>>flat-bellied <</if>>girls. Your @@.green;reputation@@ increased slightly as a result.
				<<run repX(random(_minBonus,_maxBonus), "club")>>
			<<else>>
				Some customers were put off since the <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the club did not match their preferences for <<if _pref == 1>>fecund <<elseif _pref == -1>>flat-bellied <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "club")>>
			<</if>>
		<</if>>
	<</if>>

	<<if (_possibleBonuses > 0) && ($clubBonuses >= _possibleBonuses)>>
		<<run repX(_DL*random(10,15), "club")>>

		There is a ''@@.green;perfect variety@@'' of slaves serving the public from $clubName.
	<<else>>

		$clubNameCaps does not offer enough variety to satisfy all visitors.
	<</if>>

	<>
	<<if $clubDecoration != "standard">>

    $clubNameCaps's customers enjoy @@.green;having sex in $clubDecoration surroundings.@@
	<</if>>

	<<ClubStatistics 0>>
	<<timed 50ms>>
		<<replace #clubstats>>
			<<ClubStatistics 1>>
		<</replace>>
	<</timed>>
<</if>>

<<if _DL > 0 || $DJ != 0>>

<</if>>


code:
:: Complete Catalog [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Main">>

//This is the complete catalog of slaves that you can acquire from other slaveowners. Most of these slaves are not for sale, so persuading their owners to part with them will be extremely expensive.//

<<for $i = 0; $i < $heroSlaves.length; $i++>>
	<<if $i > 0>> | <</if>>
	<<if $heroSlaves[$i].ID == $activeSlave.ID>>
		//$heroSlaves[$i].slaveName//
	<<else>>
		<<print "[[$heroSlaves[$i].slaveName|Complete Catalog][$activeSlave = App.Utils.getHeroSlave($heroSlaves[" + $i + "], $baseHeroSlave)]]">>
	<</if>>
<</for>>

<<if ndef $activeSlave.pubicHColor>>
	<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
<</if>>
<<if ndef $activeSlave.underArmHColor>>
	<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
<</if>>
<<if $activeSlave.override_Race != 1>>
	<<set $activeSlave.origRace = $activeSlave.race>>
<</if>>
<<if $activeSlave.override_Eye_Color != 1>>
	<<run resetEyeColor($activeSlave, "both")>>
<</if>>
<<if $activeSlave.override_H_Color != 1>>
	<<set $activeSlave.hColor = getGeneticHairColor($activeSlave)>>
<</if>>
<<if $activeSlave.override_Arm_H_Color != 1>>
	<<set $activeSlave.underArmHColor = getGeneticHairColor($activeSlave)>>
<</if>>
<<if $activeSlave.override_Pubic_H_Color != 1>>
	<<set $activeSlave.pubicHColor = getGeneticHairColor($activeSlave)>>
<</if>>
<<if $activeSlave.override_Brow_H_Color != 1>>
	<<set $activeSlave.eyebrowHColor = getGeneticHairColor($activeSlave)>>
<</if>>
<<if $activeSlave.override_Skin != 1>>
	<<set $activeSlave.skin = getGeneticSkinColor($activeSlave)>>
<</if>>
<<run SetBellySize($activeSlave)>>
<<set $specialSlavesPriceOverride = 1>>
<<run nationalityToAccent($activeSlave)>>
<<if $familyTesting == 1>>
	/* special slaves exceptions to keep siblings sensible */
	<<if $activeSlave.mother == -9999 && $activeSlave.father == -9998>> /* The twins — Camille & Kennerly */
		<<for _k = 0; _k < $slaves.length; _k++>>
			<<if areSisters($slaves[_k], $activeSlave) > 0>>
				<<set $activeSlave.actualAge = $slaves[_k].actualAge, $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge, $activeSlave.birthWeek = $slaves[_k].birthWeek>>
			<</if>>
		<</for>>
	<</if>>
	<<if $activeSlave.mother == -9997 && $activeSlave.father == -9996>> /* The siblings — Elisa & Martin */
		<<for _k = 0; _k < $slaves.length; _k++>>
			<<if areSisters($slaves[_k], $activeSlave) > 0>>
				<<if $activeSlave.birthName == "Elisa">>
					<<set $activeSlave.actualAge = $slaves[_k].actualAge-1, $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<<elseif $activeSlave.birthName == "Martin">>
					<<set $activeSlave.actualAge = $slaves[_k].actualAge+1, $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if $activeSlave.mother == -9995 && $activeSlave.father == -9994>> /* The fruit siblings — Green & Purple Grape */
		<<for _k = 0; _k < $slaves.length; _k++>>
			<<if areSisters($slaves[_k], $activeSlave) > 0>>
				<<if $activeSlave.birthName == "Green Grape">>
					<<set $activeSlave.actualAge = $slaves[_k].actualAge-5, $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<<elseif $activeSlave.birthName == "Purple Grape">>
					<<set $activeSlave.actualAge = $slaves[_k].actualAge+5, $activeSlave.physicalAge = $activeSlave.actualAge, $activeSlave.visualAge = $activeSlave.actualAge, $activeSlave.ovaryAge = $activeSlave.actualAge>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>

<<set $saleDescription = 1>>
<<include "Long Slave Description">>
<<set _slaveCost = slaveCost($activeSlave)>>
<<set _slaveCost = (10*Math.trunc((_slaveCost/10)*2))>>
<<if _slaveCost < 40000>>
	<<set _slaveCost += random(20000,60000)>>
<</if>>
<<set $specialSlavesPriceOverride = 0>>

The offered price is <<print cashFormat(_slaveCost)>>.

<<link "Buy $his slave contract" "New Slave Intro">>
	<<set $activeSlave.weekAcquired = $week, $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Main", $specialSlave = 1>>
	<<run cashX(forceNeg(_slaveCost), "slaveTransfer", $activeSlave)>>
<</link>>

license: mit


code:
:: Concubine Select [nobr]

<<set $nextButton = "Back", $nextLink = "Master Suite", $showEncyclopedia = 1, $encyclopedia = "Concubine">>
<<if ($Concubine != 0)>>
	<<set $Concubine = getSlave($Concubine.ID)>>
	<<setLocalPronouns $Concubine>>
	''__@@.pink;<<= SlaveFullName($Concubine)>>@@__'' is serving as your Concubine.

$He will take the lead in seeing to your pleasure.
<<else>>
	You have not selected a Concubine.
<</if>>

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

[[None|Master Suite][removeJob($Concubine, "be your Concubine")]]

<<print App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.masterSuite, "Master Suite")>>


code:
:: Costs Budget [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", _arcologyCosts = 0>>

<<if def $lastWeeksCashIncome>>
	<<set $lastWeeksCashIncome.Total = 0>>
	<<set $lastWeeksCashExpenses.Total = 0>>
	<<set $lastWeeksCashProfits.Total = 0>>
<</if>>

<<if ndef $showAllEntries>>
	<<set $showAllEntries = {costsBudget: 0, repBudget: 0}>>
<</if>>

	Here you can view many of the financial details of your arcology, <<= properTitle()>>. The detailed list of slaves and their costs (food, hormones) that you may remember can now be found in the "Slave maintenance" link. Other links will allow you to directly control areas of your arcology to adjust spending to suit your tastes.

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

<<if $difficultySwitch == 1>>

		The Local Economy score effects some prices in your ecology. The lower the score, the higher the prices. The base score is ''100''.

			Global Economy

	| <<print $economy>>

	<<if ($cheatMode) && ($cheatModeM)>>
		<<set _Teconomy = $economy>>
		<<textbox "_Teconomy" _Teconomy>>
		<<link "Apply">>
		<<set $economy = Math.trunc(Number(_Teconomy)) || $economy, $cheater = 1>>
		<<replace "#economy">>

			Global Economy

		| <<print $economy>>
		<</replace>>
		<</link>>
	<</if>>

			Local Economy

	| <<print $localEcon>>

	<<if ($cheatMode) && ($cheatModeM)>>
		<<set _TlocalEcon = $localEcon>>
		<<textbox "_TlocalEcon" _TlocalEcon>>
		<<link "Apply">>
		<<set $localEcon = Math.trunc(Number(_TlocalEcon)) || $localEcon, $cheater = 1>>
		<<replace "#localEcon">>

			Local Economy

		| <<print $localEcon>>
		<</replace>>
		<</link>>
	<</if>>

 The current score is
	<<if $localEcon > 100>>
		<<set _econPercent = Math.trunc(1000-100000/$localEcon)/10>>
		reducing prices by ''<<print _econPercent>>%.''
	<<elseif $localEcon == 100>>
		equal to the base score. There are no price modifications.
	<<else>>
		<<set _econPercent = Math.trunc(100000/$localEcon-1000)/10>>
		increasing prices by ''<<print _econPercent>>%.''
	<</if>>

<<if $lineSeparations == 0>>

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

Your weekly costs are as follows:
<<options $showAllEntries.costsBudget>>
	<<option 0 "Normal">>
	<<option 1 "Show Empty Entries">>
<</options>>

/* Table of Totals */
<<if ndef $lastWeeksCashIncome>>
	Financial data currently unavailable.
<<else>>

<>

Penthouse

		Income
		Expense
		Totals

	<<print budgetLine("whore", "Whores")>>

	<<print budgetLine("rest", "Resting")>>

	<<print budgetLine("houseServant", "House servants")>>

	<<print budgetLine("confined", "Confined")>>

	<<print budgetLine("publicServant", "Public servants")>>

	<<print budgetLine("classes", "Classes")>>

	<<print budgetLine("milked", "Milked")>>

	<<print budgetLine("gloryhole", "Gloryhole")>>

Structures

	<<print budgetLine("brothel", "<<if $brothel>>[[$brothelNameCaps|Brothel][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$brothelNameCaps<</if>> ($BrothiIDs.length slaves)")>>

	<<print budgetLine("whoreBrothel", "Brothel whores")>>

	<<print budgetLine("brothelAds", "<<if $brothel>>[[Brothel ads|Brothel Advertisement][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Brothel ads<</if>> also increase the income of whoring slaves in \"jobs.\"")>>

	<<if $brothel > 0>>

	<</if>>

	<<print budgetLine("club", "<<if $club>>[[$clubNameCaps|Club][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$clubNameCaps<</if>> ($ClubiIDs.length slaves)")>>

	<<print budgetLine("clubAds", "<<if $club>>[[Club ads|Club Advertisement][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Club ads<</if>>")>>

	<<if $club > 0>>

	<</if>>

	<<print budgetLine("arcade", "<<if $arcade>>[[$arcadeNameCaps|Arcade][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$arcadeNameCaps<</if>> ($ArcadeiIDs.length slaves)")>>

	<<print budgetLine("gloryholeArcade", "Arcade slaves")>>

	<<if $arcade > 0>>

	<</if>>

	<<print budgetLine("dairy", "<<if $dairy>>[[$dairyNameCaps|Dairy][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$dairyNameCaps<</if>> ($DairyiIDs.length slaves)")>>

	<<print budgetLine("milkedDairy", "Dairy cows")>>

	<<if $dairy > 0>>

	<</if>>

	<<print budgetLine("servantsQuarters", "<<if $servantsQuarters>>[[Servants' Quarters][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Servants' Quarters<</if>> ($ServQiIDs.length slaves)")>>

	<<print budgetLine("masterSuite", "<<if $masterSuite>>[[Master Suite][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Master Suite<</if>> ($MastSiIDs.length slaves)")>>

	<<print budgetLine("school", "<<if $schoolroom>>[[$schoolroomNameCaps|Schoolroom][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$schoolroomNameCaps<</if>> ($SchlRiIDs.length slaves)")>>

	<<print budgetLine("spa", "<<if $spa>>[[$spaNameCaps|Spa][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$spaNameCaps<</if>> ($SpaiIDs.length slaves)")>>

	<<print budgetLine("clinic", "<<if $clinic>>[[$clinicNameCaps|Clinic][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$clinicNameCaps<</if>> ($CliniciIDs.length slaves)")>>

	<<print budgetLine("cellblock", "<<if $cellblock>>[[$cellblockNameCaps|Cellblock][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$cellblockNameCaps<</if>> ($CellBiIDs.length slaves)")>>

	<<print budgetLine("lab", "<<if $researchLab.level > 0>>[[Prosthetic Lab][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>Prosthetic Lab<</if>> maintenance")>>

	<<print budgetLine("incubator", "<<if $incubator>>[[$incubatorNameCaps|Incubator][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$incubatorNameCaps<</if>> ($incubatorSlaves slaves)")>>

	<<print budgetLine("nursery", "<<if $nursery>>[[$nurseryNameCaps|Nursery][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$nurseryNameCaps<</if>> ($NurseryiIDs.length slaves)")>>

	<<print budgetLine("farmyard", "<<if $farmyard>>[[$farmyardNameCaps|Farmyard][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$farmyardNameCaps<</if>> ($FarmyardiIDs.length slaves)")>>

	<<print budgetLine("pit", "<<if $pit>>[[$pitNameCaps|Pit][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]<<else>>$pitNameCaps<</if>> ($fighterIDs.length slaves)")>>

	<<print budgetLine("environment", "Environment")>>

	<<print budgetLine("weather",
				"<<if $lastWeeksCashExpenses.weather < 0 && $weatherCladding == 0>>
					Weather is causing expensive damage. Consider a protective [[upgrade|Manage Arcology][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]].
				<<else>>
					Weather
				<</if>>")>>

Slaves

	<<print budgetLine("slaveUpkeep", "[[Slave maintenance|Costs Report Slaves][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($slaves.length slaves)")>>

	<<print budgetLine("extraMilk", "Extra milk")>>

	<<print budgetLine("slaveTransfer", "Selling/buying major slaves")>>

	<<print budgetLine("menialTransfer", "Menials: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>

	<<print budgetLine("fuckdollsTransfer", "Fuckdolls: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>

	<<print budgetLine("menialBioreactorsTransfer", "Bioreactors: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>

	<<print budgetLine("babyTransfer", "Selling/buying babies")>>

	<<print budgetLine("menialTrades", "[[Menials|Buy Slaves]]: labor")>>

	<<print budgetLine("fuckdolls", "Fuckdolls")>>

	<<print budgetLine("menialBioreactors", "Menials: bioreactors")>>

	<<print budgetLine("porn", "Porn")>>

	<<print budgetLine("recruiter", "[[Recruiter|Recruiter Select]]")>>

	<<print budgetLine("menialRetirement", "Menials retiring")>>

	<<print budgetLine("slaveMod", "Slave modification")>>

	<<print budgetLine("slaveSurgery", "Slave surgery")>>

	<<print budgetLine("birth", "Slave surgery")>>

Finance

	<<print budgetLine("personalBusiness", "Personal business")>>

	<<print budgetLine("personalLivingExpenses",
		"<<if $PC.rules.living == \"luxurious\">>
			Since you are accustomed to luxury, your personal living expenses are:
		<<elseif $PC.rules.living == \"normal\">>
			Since you are used to living well, your personal living expenses are:
		<<else>>
			Since you are used to a fairly normal life, your personal living expenses are:
		<</if>>
		")>>

	<<print budgetLine("PCtraining", "
				Your training expenses
				<<if ($personalAttention == \"trading\")>>
					[[Trading trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<<elseif ($personalAttention == \"warfare\")>>
					[[Warfare trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<<elseif ($personalAttention == \"slaving\")>>
					[[Slaving trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<<elseif ($personalAttention == \"engineering\")>>
					[[Engineering trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<<elseif ($personalAttention == \"medicine\")>>
					[[Medicine trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<<elseif ($personalAttention == \"hacking\")>>
					[[Hacking trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
				<</if>>
			")>>

	<<print budgetLine("PCmedical", "Your medical expenses")>>

	<<print budgetLine("PCskills", "Your skills")>>

	<<print budgetLine("rents",
			"Your [[rents|Manage Arcology]]
			<<if $lastWeeksCashExpenses.rents < 0>>
				and bribes
			<</if>>
		")>>

	<<print budgetLine("stocks", "Stock dividends on ($personalShares/<<print ($publicShares + $personalShares)>> shares).")>>

	<<print budgetLine("stocksTraded", "Stock trading")>>

	<<print budgetLine("fines", "Fines")>>

	<<print budgetLine("event", "Events")>>

	<<print budgetLine("war", "Arcology conflict")>>

	<<print budgetLine("capEx", "Capital expenses")>>

	<<print budgetLine("cheating", "CHEATING")>>

Policies

	<<print budgetLine("policies", "[[Policies]]")>>
	<<print budgetLine("edicts", "<<if $secExpEnabled>>[[Edicts|edicts]]<<else>>Edicts<</if>>")>>

	<<print budgetLine("futureSocieties", "[[Society shaping|Future Society][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]")>>

	<<print budgetLine("schoolBacking",
				"<<if $TSS.subsidize != 0>>[[The Slavegirl School|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $GRI.subsidize != 0>>[[Growth Research Institute|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] subsidiary lab influence
				<<elseif $SCP.subsidize != 0>>[[St. Claver Preparatory|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $LDE.subsidize != 0>>[[L'Encole des Enculees|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $TGA.subsidize != 0>>[[The Gymnasium-Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $TCR.subsidize != 0>>[[The Cattle Ranch|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $HA.subsidize != 0>>[[Hippolyta Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $NUL.subsidize != 0>>[[Nueva Universidad de Libertad|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
				<<elseif $TFS.subsidize != 0>>[[The Futanari Sisters|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] community influence
				<<elseif $TSS.schoolPresent == 1>>[[The Slavegirl School|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $GRI.schoolPresent == 1>>[[Growth Research Institute|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] subsidiary lab upkeep
				<<elseif $SCP.schoolPresent == 1>>[[St. Claver Preparatory|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $LDE.schoolPresent == 1>>[[L'Encole des Enculees|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $TGA.schoolPresent == 1>>[[The Gymnasium-Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $TCR.schoolPresent == 1>>[[The Cattle Ranch|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $HA.schoolPresent == 1>>[[Hippolyta Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<elseif $NUL.schoolPresent == 1>>[[Nueva Universidad de Libertad|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
				<<else>> Unknown school expense
				<</if>>
			")>>

	<<print budgetLine("citizenOrphanage", "Education of $citizenOrphanageTotal of your slaves\' children in citizen schools")>>

	<<print budgetLine("privateOrphanage", "Private tutelage of $privateOrphanageTotal of your slaves\' children")>>

	<<print budgetLine("mercenaries",
			"Security:
			<<if $barracks>>
				[[$mercenariesTitle|Barracks][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]
			<<else>>
				Mercenaries

					Cost increased by the lack of an armory to house them.

			<</if>>
			<<if ($PC.skill.warfare >= 100) || ($PC.career == \"arcology owner\")>>

					Cost reduced by your mercenary contacts.

			<</if>>
		")>>

	<<print budgetLine("securityExpansion", "Security expansion")>>

	<<print budgetLine("specialForces", "Special forces")>>

	<<print budgetLine("peacekeepers", "Peacekeepers<<if State.variables.peacekeepers.undermining !== 0>>, including undermining<</if>>")>>

Budget Report

		Tracked totals

			<<set $lastWeeksCashIncome.Total = hashSum($lastWeeksCashIncome)>>
			<<print cashFormatColor(Math.trunc($lastWeeksCashIncome.Total))>>

			<<set $lastWeeksCashExpenses.Total = hashSum($lastWeeksCashExpenses)>>
			<<print cashFormatColor(Math.trunc($lastWeeksCashExpenses.Total))>>

			<<set $lastWeeksCashProfits.Total = ($lastWeeksCashIncome.Total + $lastWeeksCashExpenses.Total)>>
			/* each "profit" item is calculated on this sheet, and there's two ways to generate a profit total: the difference of the income and expense totals, and adding all the profit items. If they aren't the same, I probably forgot to properly add an item's profit calculation to this sheet.*/
			<<if $lastWeeksCashProfits.Total != hashSum($lastWeeksCashProfits) - $lastWeeksCashProfits.Total>>/* Profits includes the total number of profits, so we have to subtract it back out */
				<<print (cashFormat(Math.trunc(hashSum($lastWeeksCashProfits)-$lastWeeksCashProfits.Total)))>>

Fix profit calc

			<</if>>

				<<print cashFormatColor(Math.trunc($lastWeeksCashProfits.Total))>>

		Expenses budget for week <<print ($week+1)>>

			<<print cashFormatColor($costs)>>

		Last week actuals

			<<print cashFormatColor($cash-$cashLastWeek)>>

	<<if ($cash-$cashLastWeek) == $lastWeeksCashProfits.Total>>

			The books are balanced, <<= properTitle()>>!

	<<else>>

			Transaction tracking off by:

			/*<<print ($lastWeeksCashExpenses.Total + $costs)>>*/

				<<print cashFormatColor(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)>>

	<</if>>

<</if>>

<<if ndef $lastWeeksCashErrors>>
	<<set $lastWeeksCashErrors = "Errors: ">>
<</if>>

<<if $lastWeeksCashErrors !== "Errors: ">>
	<<link "Reset">>
		<<set $lastWeeksCashErrors = "Errors: ">>
	<</link>>
	<<print cashFormatColor($lastWeeksCashErrors)>>
<</if>>


code:
:: Costs Report [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main",_arcologyCosts = 0>>
<<set _arcologyCosts = 0>>
<<if $PCSlutContacts == 0>><<set $PCSlutContacts = 1>><</if>>
/*
//Your weekly costs are as follows.//

Since you are
<<if $PC.rules.living == "luxurious">>
	accustomed to luxury,
	<<set _ownerExpense = 3>>
<<elseif $PC.rules.living == "normal">>
	used to living well,
	<<set _ownerExpense = 2>>
<<else>>
	used to a fairly normal life,
	<<set _ownerExpense = 1>>
<</if>>
your personal living expenses are @@.yellowgreen;<<print cashFormat(Math.trunc(_ownerExpense*(250+(50000/$localEcon))))>>.@@
<<set _arcologyCosts += Math.trunc(_ownerExpense*(250+(50000/$localEcon)))>>

<<if $arcologies[0].FSRepopulationFocusLaw == 1 && $PC.pregKnown == 1>>

Rent promotion for being a pregnant citizen under ''Universal Pregnancy Subsidy:'' @@.yellowgreen;<<print cashFormat(500)>>@@
	<<set _arcologyCosts += 500>>
<</if>>

<<if $PC.preg == -1>>

Your contraceptives expenses: @@.yellowgreen;<<print cashFormat(25)>>@@
	<<set _arcologyCosts += 25>>
<<elseif $PC.fertDrugs == 1>>

Your fertility regimen: @@.yellowgreen;<<print cashFormat(50)>>@@
	<<set _arcologyCosts += 50>>
<<elseif $PC.preg >= 16>>

Increased living expenses due to being pregnant: @@.yellowgreen;<<print cashFormat(100)>>@@
	<<set _arcologyCosts += 100>>
<</if>>
<<if $PC.staminaPills == 1>>

Your stamina pills: @@.yellowgreen;<<print cashFormat(50)>>@@
	<<set _arcologyCosts += 50>>
<</if>>

<<if $PC.actualAge >= $IsInPrimePC && $PC.actualAge < $IsPastPrimePC>>
	<<if ($personalAttention == "trading") || ($personalAttention == "warfare") || ($personalAttention == "slaving") || ($personalAttention == "engineering") || ($personalAttention == "medicine") || ($personalAttention == "hacking")>>

		<<set _cost = 10000*$AgeEffectOnTrainerPricingPC,_arcologyCosts += _cost>>
		<<switch $personalAttention>>
			<<case trading>>
				__Trading__
			<<case warfare>>
				__Warfare__
			<<case slaving>>
				__Slaving__
			<<case engineering>>
				__Engineering__
			<<case medicine>>
				__Medicine__
			<<case hacking>>
				__Hacking__
		<</switch>>
		Trainer Fees: @@.yellowgreen;<<print cashFormat(_cost)>>@@
	<</if>>
<</if>>

<<if $breederOrphanageTotal > 0>><<set _breederTuition = 50>><<else>><<set _breederTuition = 0>><</if>>
<<if $citizenOrphanageTotal+$privateOrphanageTotal+$breederOrphanageTotal > 0>>

 __Orphanage__ fee: @@.yellowgreen;<<print cashFormat($citizenOrphanageTotal*100+$privateOrphanageTotal*500+_breederTuition)>>@@
	<<set _arcologyCosts += $citizenOrphanageTotal*100+$privateOrphanageTotal*500+_breederTuition>>
	<<if $citizenOrphanageTotal > 0>>

    Citizen: @@.yellowgreen;<<print cashFormat(100)>>@@ per child. Currently <<print num($citizenOrphanageTotal)>> are being taught, bringing the total to @@.yellowgreen;<<print cashFormat($citizenOrphanageTotal*100)>>.@@
	<</if>>
	<<if $privateOrphanageTotal > 0>>

    Private: @@.yellowgreen;<<print cashFormat(500)>>@@ per child. Currently <<print num($privateOrphanageTotal)>> are being taught, bringing the total to @@.yellowgreen;<<print cashFormat($privateOrphanageTotal*500)>>.@@
	<</if>>
	<<if $breederOrphanageTotal > 0>>

    Since <<print num($breederOrphanageTotal)>> of your slaves' children are being raised into productive members of society in a society funded school, you pay a flat @@.yellowgreen;<<print cashFormat(50)>>@@ usage fee.
	<</if>>
<</if>>

<<if $peacekeepers != 0 && $peacekeepers.undermining != 0>>

 <<print cashFormat($peacekeepers.undermining)>> to undermine political support for the nearby old world peacekeeping mission.
	<<set _arcologyCosts += $peacekeepers.undermining>>
<</if>>

<<if $SF.Toggle && $SF.Active >= 1 && $SF.Subsidy > 0>> <<= App.SF.Count()>>

__Financially supporting $SF.Lower until self sufficiency:__ <<print cashFormat(Math.ceil(_SFSubsidy))>>
	<<set _arcologyCosts += Math.ceil(_SFSubsidy)>>
<</if>>
<<if $mercenaries > 0>>
	<<set _mercCosts = $mercenaries*2000>>
	<<if $barracks>><<set _mercCosts *= 0.5>><</if>>
	<<if ($PC.skill.warfare >= 100) || ($PC.career == "arcology owner")>><<set _mercCosts *= 0.5>><</if>>

__Mercenary Expenses__: @@.yellowgreen;<<print cashFormat(_mercCosts)>>@@
	<<if $barracks>><<else>>//@@.red;Increased by the lack of a barracks.@@//<</if>>
	<<if ($PC.skill.warfare >= 100) || ($PC.career == "arcology owner")>>//Reduced by your @@.springgreen;mercenary contacts.@@//<</if>>
	<<set _arcologyCosts += _mercCosts>>
<</if>>

<<if $citizenRetirementMenials == 1>>

__Menial Slave Retirement Premiums__:
	<<if $CitizenRetirement == 1>>
		<<set _citizenRetirementMenialsCost = $menials * 2>>
	<<else>>
		<<set _citizenRetirementMenialsCost = ($menials + $slaves.length) * 2>>
	<</if>>
	<<set _arcologyCosts += _citizenRetirementMenialsCost>>
	@@.yellowgreen;<<print cashFormat(_citizenRetirementMenialsCost)>>@@
<</if>>

<<if $rations > 0>>
	<<set _rationsPrice = ($rations*1000)>> /* this number may need tweaking *//*

__Rations__:
	@@.yellowgreen;<<print cashFormat(_rationsPrice)>>@@
<</if>>

<<if $brothel > 0 || $club > 0 || $arcade > 0 || $dairy > 0 || $farmyard > 0>>

__Arcology Building Maintenance__:
	<<if $brothel > 0>>
	<<set _advertising = 0>>
	<<if $brothel > 0>>
		<<set _advertising = $brothelAdsSpending>>
	<</if>>

	Brothel: @@.yellowgreen;<<print cashFormat(($brothel*$facilityCost)+(0.1*$brothelUpgradeDrugs*$brothel*$facilityCost)+_advertising)>>@@
	<<set _arcologyCosts += ($brothel*$facilityCost)+(0.1*$brothelUpgradeDrugs*$brothel*$facilityCost)+_advertising>>
<</if>>
	<<if $club > 0>>
		<<set _advertising= 0>>
		<<if $club > 0>>
			<<set _advertising = $clubAdsSpending>>
			<<set _arcologyCosts += $clubAdsSpending>>
		<</if>>

		Club: @@.yellowgreen;<<print cashFormat(($club*$facilityCost)+(0.2*$clubUpgradePDAs*$club*$facilityCost)+_advertising)>>@@
		<<set _arcologyCosts += ($club*$facilityCost)+(0.2*$clubUpgradePDAs*$club*$facilityCost)+_advertising>>
	<</if>>
	<<if $arcade > 0>>

		Arcade: @@.yellowgreen;<<print cashFormat((0.5*$arcade*$facilityCost)+(0.2*$arcadeUpgradeInjectors*$arcade*$facilityCost)+(0.2*$arcadeUpgradeCollectors*$arcade*$facilityCost))>>@@
		<<set _arcologyCosts += (0.5*$arcade*$facilityCost)+(0.2*$arcadeUpgradeInjectors*$arcade*$facilityCost)+(0.2*$arcadeUpgradeCollectors*$arcade*$facilityCost)>>
	<</if>>
	<<if $dairy > 0>>

		Dairy: @@.yellowgreen;<<print cashFormat(($dairy*$facilityCost)+(0.2*$dairyFeedersUpgrade*$dairy*$facilityCost)+(0.1*$dairyPregUpgrade*$dairy*$facilityCost))>>@@
		<<set _arcologyCosts += ($dairy*$facilityCost)+(0.2*$dairyFeedersUpgrade*$dairy*$facilityCost)+(0.1*$dairyPregUpgrade*$dairy*$facilityCost)>>
		<<if $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren > 0>>

			Additional maintenance for milking machines upgraded with biological components: @@.yellowgreen;<<print cashFormat(($bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren)*100)>>@@
			<<set _arcologyCosts += ($bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren)*100>>
		<</if>>
	<</if>>
	<<if $farmyard > 0>> /*TODO: this will also need to be expanded */
		/*

		Farmyard: @@.yellowgreen;<<print cashFormat($farmyard*$facilityCost)>>@@
		<<set _arcologyCosts += $farmyard*$facilityCost>>
	<</if>>
<</if>>

<<if ($servantsQuarters > 0 && $servantsQuartersUpgradeMonitoring > 0) ||
$nursery > 0 || $masterSuiteUpgradePregnancy > 0 || $incubator > 0 ||
$researchLab.level > 0>>

__Penthouse Facility Maintenance__:
	<<if ($servantsQuarters > 0) && ($servantsQuartersUpgradeMonitoring > 0)>>

		Servants' Quarters: @@.yellowgreen;<<print cashFormat((0.2*$servantsQuartersUpgradeMonitoring*$servantsQuarters*$facilityCost))>>@@
		<<set _arcologyCosts += 0.2*$servantsQuartersUpgradeMonitoring*$servantsQuarters*$facilityCost>>
	<</if>>
	<<if $nursery > 0>> /*TODO: this will definitely need to be expanded to take into account the number of children and other factors */
		/*

		Nursery: @@.yellowgreen;<<print cashFormat($nursery*$facilityCost)>>@@
		<<set _arcologyCosts += $nursery*$facilityCost>>
	<</if>>
	<<if ($masterSuiteUpgradePregnancy > 0)>>

		Master Suite: @@.yellowgreen;<<print cashFormat(((500*$masterSuiteUpgradePregnancy) + (1000*$masterSuitePregnancyFertilitySupplements)))>>@@
		<<set _arcologyCosts += ((500*$masterSuiteUpgradePregnancy) + (1000*$masterSuitePregnancyFertilitySupplements))>>
	<</if>>
	<<if $incubator > 0>>

		Incubation Facility: @@.yellowgreen;<<print cashFormat((10*$incubator*$facilityCost)+(0.2*$incubatorUpgradeWeight*$incubator*$facilityCost)+(0.2*$incubatorUpgradeMuscles*$incubator*$facilityCost)+(0.2*$incubatorUpgradeReproduction*$incubator*$facilityCost)+(0.2*$incubatorUpgradeGrowthStims*$incubator*$facilityCost)+(0.5*$incubatorUpgradeSpeed*$incubator*$facilityCost))>>@@
		<<set _arcologyCosts += (10*$incubator*$facilityCost)+(0.2*$incubatorUpgradeWeight*$incubator*$facilityCost)+(0.2*$incubatorUpgradeMuscles*$incubator*$facilityCost)+(0.2*$incubatorUpgradeReproduction*$incubator*$facilityCost)+(0.2*$incubatorUpgradeGrowthStims*$incubator*$facilityCost)+(0.5*$incubatorUpgradeSpeed*$incubator*$facilityCost)>>
		<<if $incubatorWeightSetting+$incubatorMusclesSetting+$incubatorReproductionSetting > 0>>

    Additional monitoring and maintenance costs for growing children: @@.yellowgreen;<<print cashFormat((($incubatorWeightSetting+$incubatorMusclesSetting+$incubatorReproductionSetting+$incubatorGrowthStimsSetting)*500))>>@@
			<<set _arcologyCosts += (($incubatorWeightSetting+$incubatorMusclesSetting+$incubatorReproductionSetting+$incubatorGrowthStimsSetting)*500)>>
		<</if>>
	<</if>>
	<<if $researchLab.level > 0>>

		Prosthetic Lab: @@.yellowgreen;<<print cashFormat((100*$researchLab.maxSpace))>>@@
		<<set _arcologyCosts += 100*$researchLab.maxSpace>>
		<<if $researchLab.hired != 0>>
    Scientists: @@.yellowgreen;<<print cashFormat((300*$researchLab.hired))>>@@
		<<set _arcologyCosts += 300*$researchLab.hired>> <</if>>
		<<if $researchLab.menials != 0>>
>    Menial Slaves: @@.yellowgreen;<<print cashFormat((100*$researchLab.menials))>>@@
		<<set _arcologyCosts += 100*$researchLab.menials>> <</if>>
	<</if>>
<</if>>

/* security expansion */
/*<<if $secExp > 0>>

	<<if $edictsUpkeep + $SFSupportUpkeep > 0>>
		__Edicts Upkeep__: @@.yellowgreen;<<print cashFormat($edictsUpkeep + $SFSupportUpkeep)>>@@
		<<set _arcologyCosts += ($edictsUpkeep + $SFSupportUpkeep)>>
	<</if>>
	<<if $propHub != 0 || $secHQ != 0 || $secBarracks != 0 || $riotCenter != 0>>

__Security Apparatus Maintenance Costs__:
		<<if $propHub != 0>>

			Propaganda Hub: @@.yellowgreen;<<print cashFormat($propHubUpkeep)>>@@
			<<set _arcologyCosts += $propHubUpkeep>>
		<</if>>
		<<if $secHQ != 0>>

			Security Headquarters: @@.yellowgreen;<<print cashFormat(($secHQUpkeep)+(20*$secMenials))>>@@
			<<set _arcologyCosts += ($secHQUpkeep)+(20*$secMenials)>>
		<</if>>
		<<if $secBarracks != 0>>

			Barracks: @@.yellowgreen;<<print cashFormat($secBarracksUpkeep)>>@@
			<<set _arcologyCosts += $secBarracksUpkeep>>
		<</if>>
		<<if $riotCenter != 0>>

			Riot Control Center: @@.yellowgreen;<<print cashFormat($riotUpkeep)>>@@
			<<set _arcologyCosts += $riotUpkeep>>
		<</if>>
	<</if>>

	<<if $soldierWages == 0>>
		<<set _soldierMod = 1>>
	<<elseif $soldierWages == 1>>
		<<set _soldierMod = 1.5>>
	<<else>>
		<<set _soldierMod = 2>>
	<</if>>
	<<set _milTotal = 0, _slaveTotal = 0, _mercTotal = 0, _numItems = 0>>
	<<if $militiaUnits.length > 0>>

__Militia Platoons Upkeep__:
		<<for _i = 0; _i < $militiaUnits.length; _i++>>

			 <<print ordinalSuffix($militiaUnits.length-[_i])>>: @@.yellowgreen;<<print cashFormat($militiaUnits[_i].troops*$soldierUpkeep * _soldierMod)>>@@
			<<set _milTotal += $militiaUnits[_i].troops*$soldierUpkeep * _soldierMod>>
			<<set _numItems += 1>>
		<</for>>

    ''Total: @@.yellowgreen;<<print cashFormat(_milTotal)>>@@''
	<</if>>
	<<if $slaveUnits.length > 0>>

__Slave Platoons Upkeep__:
		<<for _i = 0; _i < $slaveUnits.length; _i++>>

			 <<print ordinalSuffix($slaveUnits.length-[_i])>>: @@.yellowgreen;<<print cashFormat($slaveUnits[_i].troops*$soldierUpkeep * 0.5 * _soldierMod)>>@@
			<<set _slaveTotal += $slaveUnits[_i].troops*$soldierUpkeep * 0.5 * _soldierMod>>
		<</for>>

    ''Total: @@.yellowgreen;<<print cashFormat(_slaveTotal)>>@@''
	<</if>>
	<<if $mercUnits.length > 0>>

__Mercenary Platoons Upkeep__:
		<<for _i = 0; _i < $mercUnits.length; _i++>>

			 <<print ordinalSuffix($mercUnits.length-[_i])>>: @@.yellowgreen;<<print cashFormat($mercUnits[_i].troops*$soldierUpkeep * 1.5 * _soldierMod)>>@@
			<<set _mercTotal += $mercUnits[_i].troops*$soldierUpkeep * 1.5 * _soldierMod>>
		<</for>>

    ''Total: @@.yellowgreen;<<print cashFormat(_mercTotal)>>@@''
		<<if (_milTotal+_slaveTotal+_mercTotal) > 0>>

__Total Defense Force Upkeep__: @@.yellowgreen;<<print cashFormat(_milTotal+_slaveTotal+_mercTotal)>>@@
			<<set _arcologyCosts += (_milTotal+_slaveTotal+_mercTotal)>>
		<</if>>
	<</if>>
<</if>>

<<if $econWeatherDamage && $disasterResponse > 0>>
	<<set _DRUUpkeep = Math.trunc($disasterResponse * 200000 / $localEcon)>>

__Disaster Response Unit Expenses__: @@.yellowgreen;<<print cashFormat(_DRUUpkeep)>>@@
	<<set _arcologyCosts += _DRUUpkeep>>
<</if>>
<<if $antiWeatherFreeze > 0>>
	<<set _AWFUpkeep = Math.trunc($antiWeatherFreeze * 200000 / $localEcon)>>

__Passenger Upgrades Expenses__: @@.yellowgreen;<<print cashFormat(_AWFUpkeep)>>@@
	<<set _arcologyCosts += _AWFUpkeep>>
<</if>>
<<if $FSSpending != 0>>

__Society Shaping Expenses__: @@.yellowgreen;<<print cashFormat($FSSpending)>>@@
	<<set _arcologyCosts += $FSSpending>>
<</if>>
<<if $Recruiter != 0>>

__Recruiting Expenses__: @@.yellowgreen;<<print cashFormat(250)>>@@
	<<set _arcologyCosts += 250>>
<</if>>

<<set _schoolPresent = 0, _schoolSubsidy = 0>>
<<if ($TSS.schoolPresent > 0)>>
	<<set _school = "The Slavegirl School">>
	<<set _schoolPresent = 1>>
	<<if $TSS.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($GRI.schoolPresent > 0)>>
	<<set _school = "Growth Research Institute">>
	<<set _schoolPresent = 1>>
	<<if $GRI.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($SCP.schoolPresent > 0)>>
	<<set _school = "St. Claver Preparatory">>
	<<set _schoolPresent = 1>>
	<<if $SCP.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($LDE.schoolPresent > 0)>>
	<<set _school = "L'École des Enculées">>
	<<set _schoolPresent = 1>>
	<<if $LDE.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($TGA.schoolPresent > 0)>>
	<<set _school = "The Gymnasium-Academy">>
	<<set _schoolPresent = 1>>
	<<if $TGA.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($HA.schoolPresent > 0)>>
	<<set _school = "The Hippolyta Academy">>
	<<set _schoolPresent = 1>>
	<<if $HA.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($TCR.schoolPresent > 0)>>
	<<set _school = "The Cattle Ranch">>
	<<set _schoolPresent = 1>>
	<<if $TCR.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($TFS.schoolPresent > 0)>>
	<<set _school = "The Futanari Sisters">>
	<<set _schoolPresent = 1>>
	<<if $TFS.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>
<<if ($NUL.schoolPresent > 0)>>
	<<set _school = "Nueva Universidad de Libertad">>
	<<set _schoolPresent = 1>>
	<<if $NUL.subsidize != 0>>
		<<set _schoolSubsidy = 1>>
	<</if>>
<</if>>

<<if _schoolPresent > 0>>
	<<if _school == "Growth Research Institute">>

		__<<print _school>> Subsidiary Lab Upkeep__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<<set _arcologyCosts += 1000>>
		<<if _schoolSubsidy > 0>>

			__<<print _school>> Subsidiary Lab Influence__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<</if>>
	<<elseif _school == "The Cattle Ranch">>

		__<<print _school>> Local Pasture Upkeep__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<<set _arcologyCosts += 1000>>
		<<if _schoolSubsidy > 0>>

			__<<print _school>> Local Pasture Influence__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<</if>>
	<<elseif _school == "The Futanari Sisters">>

		__<<print _school>> Community Upkeep__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<<set _arcologyCosts += 1000>>
		<<if _schoolSubsidy > 0>>

			__<<print _school>> Community Influence__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<</if>>
	<<else>>

		__<<print _school>> Branch Campus Upkeep__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<<set _arcologyCosts += 1000>>
		<<if _schoolSubsidy > 0>>

			__<<print _school>> Branch Campus Influence__: @@.yellowgreen;<<print cashFormat(1000)>>@@
		<</if>>
	<</if>>
<</if>>

<<if $alwaysSubsidizeGrowth > 0 || $alwaysSubsidizeRep > 0 || $RegularParties > 0>>

__Weekly Costs__:
	<<if $alwaysSubsidizeGrowth > 0>>

    Arcology Growth Subsidy: @@.yellowgreen;<<print cashFormat($policyCost)>>@@
		<<set _arcologyCosts += $policyCost>>
	<</if>>
	<<if $alwaysSubsidizeRep > 0>>

    Self-promotion Budget: @@.yellowgreen;<<print cashFormat($policyCost)>>@@
		<<set _arcologyCosts += $policyCost>>
	<</if>>
	<<if $RegularParties > 0>>

    Social Gatherings: @@.yellowgreen;<<print cashFormat($policyCost)>>@@
		<<set _arcologyCosts += $policyCost>>
	<</if>>
<</if>>

<<if $ProImmigrationCash == 1>>

    Pro-immigration Promotion Budget: @@.yellowgreen;<<print cashFormat($policyCost)>>@@
	<<set _arcologyCosts += $policyCost>>
<</if>>
<<if $AntiEnslavementCash == 1>>

    Anti-enslavement Charity Budget: @@.yellowgreen;<<print cashFormat($policyCost)>>@@
	<<set _arcologyCosts += $policyCost>>
<</if>>

<<if $CoursingAssociation == 1>>

    Coursing Association Membership: @@.yellowgreen;<<print cashFormat(1000)>>@@
	<<set _arcologyCosts += 1000>>
<</if>>

''Overall Arcology Costs:'' @@.yellowgreen;<<print cashFormat(_arcologyCosts)>>@@

<<set _total = 0>> <<set _SL = $slaves.length>>
<<for $i = 0; $i < _SL; $i++>>
	<<set _individualCosts = 0>>
	''$slaves[$i].slaveName'':
	<<switch $slaves[$i].assignment>>
		<<case "be confined in the arcade">>
			<<set _livingExpense = ($rulesCost*.75)>>
		<<case "work in the dairy">>
			<<if $dairyRestraintsSetting >= 2>>
				<<set _livingExpense = ($rulesCost*.75)>>
			<<elseif $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.5)>>
			<<elseif $dairyDecoration == "Degradationist">>
				<<set _livingExpense = ($rulesCost*.9)>>
			<<else>>
				<<set _livingExpense = $rulesCost>>
			<</if>>
		<<case "work as a farmhand">>
			<<if $slaves[$i].rules.living == "luxurious">>
				<<set _livingExpense = ($rulesCost)>>
			<<elseif $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*2)>>
			<<else>>
				<<set _livingExpense = ($rulesCost*.9)>>
			<</if>>
		<<case "work in the brothel">>
			<<if $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.5)>>
			<<else>>
				<<set _livingExpense = $rulesCost>>
			<</if>>
		<<case "serve in the club" "learn in the schoolroom">>
			<<set _livingExpense = ($rulesCost*1.5)>>
		<<case "get treatment in the clinic">>
			<<if $slaves[$i].rules.living == "luxurious">>
				<<set _livingExpense = ($rulesCost*2)>>
			<<elseif $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.5)>>
			<<else>>
				<<set _livingExpense = $rulesCost>>
			<</if>>
		<<case "rest in the spa" "work as a nanny">>
			<<if $slaves[$i].rules.living == "luxurious">>
				<<set _livingExpense = ($rulesCost*1.75)>>
			<<elseif $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.5)>>
			<<else>>
				<<set _livingExpense = $rulesCost>>
			<</if>>
		<<case "be a servant">>
			<<if $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.5)>>
			<<else>>
				<<if $servantsQuartersDecoration == "Degradationist">>
					<<set _livingExpense = ($rulesCost*.9)>>
				<<else>>
					<<set _livingExpense = $rulesCost>>
				<</if>>
			<</if>>
		<<case "be confined in the cellblock">>
			<<if $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*1.25)>>
			<<else>>
				<<set _livingExpense = ($rulesCost*.9)>>
			<</if>>
		<<case "be the Madam" "be the DJ" "be the Nurse" "be the Wardeness" "be the Attendant" "be the Matron" "be the Schoolteacher" "be the Stewardess" "be the Milkmaid" "be the Farmer">>
			<<set _livingExpense = ($rulesCost*2)>>
		<<default>>
			<<if $slaves[$i].rules.living == "luxurious">>
				<<if $slaves[$i].relationship >= 4>>
					<<set _livingExpense = ($rulesCost*3)>>
				<<else>>
					<<set _livingExpense = ($rulesCost*4)>>
				<</if>>
			<<elseif $slaves[$i].rules.living == "normal">>
				<<set _livingExpense = ($rulesCost*2)>>
			<<else>>
				<<set _livingExpense = $rulesCost>>
			<</if>>
	<</switch>>

    Living expenses: @@.yellowgreen;<<print cashFormat(_livingExpense)>>@@
	<<set _individualCosts += _livingExpense>>

    Basic slave food cost: @@.yellowgreen;<<print cashFormat($foodCost*4)>>@@
	<<set _individualCosts += $foodCost*4>>
	<<switch $slaves[$i].diet>>
		<<case "fattening" "muscle building">>

    Heavy diet: @@.yellowgreen;<<print cashFormat($foodCost)>>@@
			<<set _individualCosts += $foodCost>>
		<<case "restricted" "slimming">>

    Light diet: //reduced by// @@.yellowgreen;<<print cashFormat($foodCost)>>@@
			<<set _individualCosts -= $foodCost>>
	<</switch>>
	<<if $slaves[$i].weight > 130 || $slaves[$i].weight > 50 || $slaves[$i].weight < -50>>

    Caloric adjustment for
		<<if $slaves[$i].weight > 130>>
			heavy weight: @@.yellowgreen;<<print cashFormat($foodCost*2)>>@@
			<<set _individualCosts += $foodCost*2>>
		<<elseif $slaves[$i].weight > 50>>
			high weight: @@.yellowgreen;<<print cashFormat($foodCost)>>@@
			<<set _individualCosts += $foodCost>>
		<<elseif $slaves[$i].weight < -50>>
			light weight: //reduced by// @@.yellowgreen;<<print cashFormat($foodCost)>>@@
			<<set _individualCosts -= $foodCost>>
		<</if>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.fertility == 2 && $slaves[$i].geneticQuirks.hyperFertility == 2 && $slaves[$i].preg == 0 && ($slaves[$i].ovaries == 1 || $slaves[$i].mpreg == 1))>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to genetic hyper-fertility: @@.yellowgreen;<<print cashFormat($foodCost/2)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/2)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/2>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.macromastia == 2)>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to macromastia: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/5>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.gigantomastia == 2)>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to gigantomastia: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/5>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.rearLipedema == 2)>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to lipedema: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/5>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.mGain == 2 && $slaves[$i].geneticQuirks.mLoss != 2)>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to myotonic hypertrophy: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/5>>
	<</if>>
	<<if ($slaves[$i].geneticQuirks.wGain == 2 && $slaves[$i].geneticQuirks.wLoss != 2)>>

		<<if $geneticMappingUpgrade >= 1>>
			Additional dietary supplements due to hyperleptinemia: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<<else>>
			Adjustment for unusual deitary deficiencies: @@.yellowgreen;<<print cashFormat($foodCost/5)>>@@
		<</if>>
		<<set _individualCosts += $foodCost/5>>
	<</if>>
	<<if $slaves[$i].drugs == "appetite suppressors">>

    Food saved via suppressed appetite: //reduced by// @@.yellowgreen;<<print cashFormat($foodCost)>>@@
		<<set _individualCosts -= $foodCost>>
	<</if>>
	<<if $slaves[$i].lactation > 0>>

    Food to support
		<<if $slaves[$i].lactation > 1>>heavy<<else>>natural<</if>> lactation from
		<<if Math.trunc($slaves[$i].boobs/10000) > 2>>absurd udders<<elseif Math.trunc($slaves[$i].boobs/10000) > 1>>enormous boobs<<else>>reasonable breasts<</if>>:
		@@.yellowgreen;<<print cashFormat($foodCost*$slaves[$i].lactation*(1+Math.trunc($slaves[$i].boobs/10000)))>>@@
		<<set _individualCosts += $foodCost*$slaves[$i].lactation*(1+Math.trunc($slaves[$i].boobs/10000))>>
	<</if>>
	<<if $slaves[$i].preg > $slaves[$i].pregData.normalBirth/8>>
		<<if $slaves[$i].assignment == "work in the dairy" && $dairyFeedersSetting > 0>>

    Extra feeding costs to support pregnancy are covered by dairy feeders.
		<<elseif ($slaves[$i].assignment == "serve in the master suite" || $slaves[$i].assignment == "be your concubine") && $masterSuiteUpgradePregnancy == 1>>

    Extra feeding costs to support pregnancy are covered by $masterSuiteName luxuries.
		<<else>>
			<<set _pAccMult = 1>>

    Extra feeding to support <<if $slaves[$i].pregControl == "speed up">>accelerated <<set _pAccMult = 3>><</if>>pregnancy:
			@@.yellowgreen;<<print cashFormat($foodCost*$slaves[$i].pregType*_pAccMult)>>@@
			<<set _individualCosts += $foodCost*$slaves[$i].pregType*_pAccMult>>
			<<if $slaves[$i].pregType >= 10>>

    Specialized food blend to support multiples:
				@@.yellowgreen;<<print cashFormat($foodCost*$slaves[$i].pregType*2*_pAccMult)>>@@
				<<set _individualCosts += $foodCost*$slaves[$i].pregType*_pAccMult>>
			<<elseif $slaves[$i].pregType >= 30>>

    Concentrated, quick to digest food blend to support extreme multiples: @@.yellowgreen;<<print cashFormat($foodCost*$slaves[$i].pregType*_pAccMult)>>@@
				<<set _individualCosts += $foodCost*2*$slaves[$i].pregType*_pAccMult>>
			<<elseif $slaves[$i].pregType >= 50>>

    Specialized dietary adjustments and concentrated, quick to digest food required to support absurd multiples: <<print cashFormat($foodCost*$slaves[$i].pregType*3*_pAccMult)>>
				<<set _individualCosts += $foodCost*$slaves[$i].pregType*3*_pAccMult>>
			<<elseif $slaves[$i].pregType >= 100>>

    Specialized dietary requirements and feeding methods to support absurd multiples:
				@@.yellowgreen;<<print cashFormat($foodCost*$slaves[$i].pregType*5*_pAccMult)>>@@
				<<set _individualCosts += $foodCost*$slaves[$i].pregType*5*_pAccMult>>
			<</if>>
		<</if>>
	<</if>>
	<<switch $slaves[$i].diet>>
		<<case "XX" "XY">>

    Hormone enriched diet:
			@@.yellowgreen;<<print cashFormat(25)>>@@
			<<set _individualCosts += 25>>
		<<case "XXY">>

    Specialized hermaphrodite diet:
			@@.yellowgreen;<<print cashFormat(75)>>@@
			<<set _individualCosts += 75>>
		<<case "cleansing">>

    Chemical cleansing diet:
			@@.yellowgreen;<<print cashFormat(50)>>@@
			<<set _individualCosts += 50>>
		<<case "fertility">>

    Specialized fertility diet:
			@@.yellowgreen;<<print cashFormat(25)>>@@
			<<set _individualCosts += 50>>
	<</switch>>
	<<if $boobAccessibility != 1>>
		<<if ($slaves[$i].boobs > 20000)>>
			<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to inconveniently huge boobs:
				@@.yellowgreen;<<print cashFormat(50)>>@@
				<<set _individualCosts += 50>>
			<</if>>
		<</if>>
	<</if>>
	<<if $pregAccessibility != 1>>
		<<if ($slaves[$i].belly >= 60000)>>
			<<if ($slaves[$i].assignment != "labor in the production line") && ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to an inconveniently huge belly:
				@@.yellowgreen;<<print cashFormat(100)>>@@
				<<set _individualCosts += 100>>
			<</if>>
		<</if>>
	<</if>>
	<<if $dickAccessibility != 1>>
		<<if ($slaves[$i].dick > 45)>>
			<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to an inconveniently huge penis:
				@@.yellowgreen;<<print cashFormat(50)>>@@
				<<set _individualCosts += 50>>
			<</if>>
		<</if>>
	<</if>>
	<<if $ballsAccessibility != 1>>
		<<if ($slaves[$i].balls > 90)>>
			<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to inconveniently huge balls:
				@@.yellowgreen;<<print cashFormat(50)>>@@
				<<set _individualCosts += 50>>
			<</if>>
		<</if>>
	<</if>>
	<<if $buttAccessibility != 1>>
		<<if ($slaves[$i].butt > 15)>>
			<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to an inconveniently huge butt:
				@@.yellowgreen;<<print cashFormat(50)>>@@
				<<set _individualCosts += 50>>
			<</if>>
		<</if>>
	<</if>>
	<<if !canSee($slaves[$i]) && ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to lack of sight:
		@@.yellowgreen;<<print cashFormat(50)>>@@
		<<set _individualCosts += 50>>
	<<elseif $slaves[$i].eyes <= -1 && $slaves[$i].eyewear != "corrective glasses" && $slaves[$i].eyewear != "corrective contacts">>

    Increased living expenses due to poor vision:
		@@.yellowgreen;<<print cashFormat(25)>>@@
		<<set _individualCosts += 25>>
	<<elseif ($slaves[$i].eyewear == "blurring glasses") || ($slaves[$i].eyewear == "blurring contacts")>>

    Increased living expenses due to blurred vision:
		@@.yellowgreen;<<print cashFormat(25)>>@@
		<<set _individualCosts += 25>>
	<</if>>
	<<if !canHear($slaves[$i]) && ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>

    Increased living expenses due to lack of hearing:
		@@.yellowgreen;<<print cashFormat(20)>>@@
		<<set _individualCosts += 20>>
	<<elseif $slaves[$i].hears <= -1 && $slaves[$i].earwear != "hearing aids">>

    Increased living expenses due to poor hearing:
		@@.yellowgreen;<<print cashFormat(5)>>@@
		<<set _individualCosts += 5>>
	<<elseif ($slaves[$i].earwear == "muffling ear plugs")>>

    Increased living expenses due to muffled hearing:
		@@.yellowgreen;<<print cashFormat(5)>>@@
		<<set _individualCosts += 5>>
	<</if>>
	<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2) && ($slaves[$i].assignment != "be confined in the arcade")>>
		<<if (!hasAllNaturalLimbs($slaves[$i]))>>
			<<if (isAmputee($slaves[$i]))>>

    Increased living expenses due to limblessness:
				@@.yellowgreen;<<print cashFormat($rulesCost)>>@@
				<<set _individualCosts += $rulesCost>>
			<<else>>

    Increased living expenses due to prosthetics:
				@@.yellowgreen;<<print cashFormat($rulesCost/2)>>@@
				<<set _individualCosts += $rulesCost/2>>
			<</if>>
		<<elseif !canWalk($slaves[$i])>>

    Increased living expenses due to immobility:
			@@.yellowgreen;<<print cashFormat($rulesCost)>>@@
			<<set _individualCosts += $rulesCost>>
		<</if>>
	<</if>>
	<<if $slaves[$i].boobs > 10000>>
		<<if $slaves[$i].boobsImplantType == 1>>

    Maintenance cost for oversized string implants:
			@@.yellowgreen;<<print cashFormat(50)>>@@
			<<set _individualCosts += 50>>
		<</if>>
	<</if>>
	<<if $slaves[$i].butt > 10>>
		<<if $slaves[$i].buttImplantType == 1>>

    Maintenance cost for oversized string implants:
			@@.yellowgreen;<<print cashFormat(50)>>@@
			<<set _individualCosts += 50>>
		<</if>>
	<</if>>
	<<if $slaves[$i].preg > $slaves[$i].pregData.minLiveBirth>>
		<<if $universalRulesBirthing == 1>>
			<<if ($slaves[$i].assignment != "work in the dairy" || $dairyRestraintsSetting < 2)>>

    Coverage cost for daily pregnancy scanning:
				@@.yellowgreen;<<print cashFormat(50)>>@@
				<<set _individualCosts += 50>>
			<</if>>
		<</if>>
	<</if>>
	<<if $CitizenRetirement == 1>>

    Retirement account payments:
		@@.yellowgreen;<<print cashFormat(250)>>@@
		<<set _individualCosts += 250>>
	<</if>>
	<<if ($slaves[$i].inflation == 3)>>
		<<switch $slaves[$i].inflationType>>
		<<case "water">>

    Costs of specially formulated water for enemas; 2 gallons:
			@@.yellowgreen;<<print cashFormat(100)>>@@
			<<set _individualCosts += 100>>
		<<case "food">>

    Costs of filler food for slave stuffing; 2 gallons:
			@@.yellowgreen;<<print cashFormat(($foodCost*4))>>@@
			<<set _individualCosts += ($foodCost*4)>>
		<<case "curative" "aphrodisiac" "tightener">>

    Costs of specially formulated drug mixtures for enemas; 2 gallons:
			@@.yellowgreen;<<print cashFormat((100+($drugsCost*2)))>>@@
			<<set _individualCosts += (100+($drugsCost*2))>>
		<</switch>>
	<<elseif ($slaves[$i].inflation == 2)>>
		<<switch $slaves[$i].inflationType>>
		<<case "water">>

    Costs of specially formulated water for enemas; 1 gallon:
			@@.yellowgreen;<<print cashFormat(50)>>@@
			<<set _individualCosts += 50>>
		<<case "food">>

    Costs of filler food for slave stuffing; 1 gallon:
			@@.yellowgreen;<<print cashFormat(($foodCost*2))>>@@
			<<set _individualCosts += ($foodCost*4)>>
		<<case "curative" "aphrodisiac" "tightener">>

    Costs of specially formulated drug mixtures for enemas; 1 gallon:
			@@.yellowgreen;<<print cashFormat((50+($drugsCost*2)))>>@@
			<<set _individualCosts += (50+($drugsCost*2))>>
		<</switch>>
	<<elseif ($slaves[$i].inflation == 1)>>
		<<switch $slaves[$i].inflationType>>
		<<case "water">>

    Costs of specially formulated water for enemas; 2 liters:
			@@.yellowgreen;<<print cashFormat(25)>>@@
			<<set _individualCosts += 25>>
		<<case "food">>

    Costs of filler food for slave stuffing; 2 liters:
			<<print cashFormat(($foodCost))>>
			<<set _individualCosts += ($foodCost)>>
		<<case "curative" "aphrodisiac" "tightener">>

    Costs of specially formulated drug mixtures for enemas; 2 liters:
			@@.yellowgreen;<<print cashFormat((25+($drugsCost*2)))>>@@
			<<set _individualCosts += (25+($drugsCost*2))>>
		<</switch>>
	<</if>>
	<<switch $slaves[$i].drugs>>
	<<case "anti-aging cream">>

    Anti-aging creams:
		<<print cashFormat(($drugsCost*10))>>
		<<set _individualCosts += ($drugsCost*10)>>
	<<case "female hormone injections" "male hormone injections">>

    Hormonal injections:
		@@.yellowgreen;<<print cashFormat(($drugsCost*5))>>@@
		<<set _individualCosts += ($drugsCost*5)>>
	<<case "growth stimulants">>

    Growth stimulants:
		@@.yellowgreen;<<print cashFormat(($drugsCost*5))>>@@
		<<set _individualCosts += ($drugsCost*5)>>
	<<case "psychostimulants">>

    Mental stimulants:
		@@.yellowgreen;<<print cashFormat(($drugsCost*5))>>@@
		<<set _individualCosts += ($drugsCost*5)>>
	<<case "intensive breast injections" "intensive butt injections" "intensive penis enhancement" "intensive testicle enhancement" "intensive lip injections" "hyper breast injections" "hyper butt injections" "hyper penis enhancement" "hyper testicle enhancement" "hyper lip injections">>

    Intensive drugs:
		@@.yellowgreen;<<print cashFormat($drugsCost*5)>>@@
		<<set _individualCosts += $drugsCost*5>>
	<<case "sag-B-gone">>

    Questionable infomercial creams:
		@@.yellowgreen;<<print cashFormat(Math.trunc($drugsCost/10))>>@@
		<<set _individualCosts += ($drugsCost/10)>>
	<<case "no drugs" "none">>
	<<default>>

    Standard drugs:
		@@.yellowgreen;<<print cashFormat(($drugsCost*2))>>@@
		<<set _individualCosts += ($drugsCost*2)>>
	<</switch>>
	<<if $slaves[$i].curatives == 1 && !assignmentVisible($slaves[$i])>>
	<<elseif $slaves[$i].curatives > 0>>

    Health drugs:
		@@.yellowgreen;<<print cashFormat($drugsCost+($slaves[$i].curatives*$drugsCost))>>@@
		<<set _individualCosts += $drugsCost+($slaves[$i].curatives*$drugsCost)>>
	<</if>>
	<<if ($slaves[$i].aphrodisiacs !== 0)>>

    Aphrodisiacs/Anaphrodisiacs:
		@@.yellowgreen;<<print cashFormat(Math.trunc($drugsCost*Math.abs($slaves[$i].aphrodisiacs)))>>@@
		<<set _individualCosts += $drugsCost*Math.abs($slaves[$i].aphrodisiacs)>>
	<</if>>
	<<if ($slaves[$i].hormones != 0)>>

    Hormones:
		@@.yellowgreen;<<print cashFormat((Math.trunc($drugsCost*Math.abs($slaves[$i].hormones)*0.5)))>>@@
		<<set _individualCosts += Math.trunc($drugsCost*Math.abs($slaves[$i].hormones)*0.5)>>
	<</if>>
	<<if ($slaves[$i].bodySwap > 0)>>

    JS-Suppressants:
		@@.yellowgreen;<<print cashFormat(($drugsCost*10*$slaves[$i].bodySwap))>>@@
		<<set _individualCosts += Math.trunc($drugsCost*10*$slaves[$i].bodySwap)>>
	<</if>>
	<<if ($slaves[$i].preg == -1) && isFertile($slaves[$i])>>

    Contraceptives:
		@@.yellowgreen;<<print cashFormat((Math.trunc($drugsCost*0.5)))>>@@
		<<set _individualCosts += Math.trunc($drugsCost*0.5)>>
	<</if>>
	<<if ($studio == 1)>>
		<<if ($slaves[$i].porn.spending > 0)>>

    Publicity:
			@@.yellowgreen;<<print cashFormat($slaves[$i].porn.spending/$PCSlutContacts)>>@@
			<<set _individualCosts += ($slaves[$i].porn.spending/$PCSlutContacts)>>
		<</if>>
	<</if>>
	<<if (($slaves[$i].assignment == "be your Concubine" ||$slaves[$i].relationship == -3) && $arcologies[0].FSPetiteAdmirationLaw == 1)>>

    Big & Small Subsidy:
		@@.yellowgreen;<<print cashFormat(-200)>>@@
		<<set _individualCosts -= 200>>
	<</if>>
	<<set _total += Math.trunc(_individualCosts)>>

        __Total__:
	@@.yellowgreen;<<print cashFormat(Math.trunc(_individualCosts))>>@@

<</for>>
*/
<<set _total = 0>> <<set _SL = $slaves.length>>
<<for $i = 0; $i < _SL; $i++>>
	<<capture $i>>

<<if $lineSeparations == 0>>
<<else>>
<</if>>
	[[$slaves[$i].slaveName|Slave Interact][$activeSlave = $slaves[$i]]] will $slaves[$i].assignment.
	<<SlaveExpenses $slaves[$i]>>
	<</capture>>
<</for>>
/*

Overall slave costs: @@.yellowgreen;<<print cashFormat(_total)>>@@

This brings the overall total to ''@@.yellowgreen;<<print cashFormat(_arcologyCosts+_total)>>@@'' before reductions.

<<if $PC.career == "servant">>

Using your prior experience, you managed to lower your home's upkeep by @@.green;<<if $personalAttention == "upkeep">><<if $PC.belly >= 5000>>20%<<else>>25%<</if>><<else>>10%<</if>>.@@
<</if>>

<<if $secExp == 1>>

	<<if $terrain == "oceanic" || $terrain == "marine">>
		<<if $docks > 0>>

The infrastructure you've built eases the transportation and safe handling of the supplies required by the arcology. @@.green;Upkeep is lowered by <<print $docks * 5>>%.@@
		<</if>>
	<<else>>
		<<if $railway > 0>>

The infrastructure you've built eases the transportation and safe handling of the supplies required by the arcology. @@.green;Upkeep is lowered by <<print $railway * 5>>%.@@
		<</if>>
	<</if>>
<</if>>
*/


code:
:: Costs Report Slaves [nobr]

<<set _arcologyCosts = 0>>
<<if $PCSlutContacts == 0>><<set $PCSlutContacts = 1>><</if>>

<<set _total = 0>> <<set _SL = $slaves.length>>
<<for $i = 0; $i < _SL; $i++>>
	<<capture $i>>

<<if $lineSeparations == 0>>
<<else>>
<</if>>
	[[$slaves[$i].slaveName|Slave Interact][$activeSlave = $slaves[$i]]] will $slaves[$i].assignment.
	<<SlaveExpenses $slaves[$i]>>
	<</capture>>
<</for>>


code:
:: Cost widgets [nobr widget]

<<widget "SlaveExpenses">>
	<<set _individualCosts = 0>>
	<<setLocalPronouns $args[0]>>

	/* Generate the lines of the report */
	<<for _line range getSlaveCostArray($args[0])>>

			<<= _line.text>>: <<=cashFormatColor(_line.value)>>

	<</for>>

	/* Total expenses */
	<<set _individualCosts = Math.trunc(getSlaveCost($args[0]))>>

		__Predicted expense__: @@.red;<<print cashFormat(Math.trunc(_individualCosts))>>@@

	/* Income from last week vs expense gives net, assistant gated */
	<<if $assistantPower > 0>>
		<<if $args[0].lastWeeksCashIncome > 0>>

				Income: <<print cashFormatColor($args[0].lastWeeksCashIncome)>>

			<<set _total = (Math.trunc($args[0].lastWeeksCashIncome - _individualCosts))>>

				__Total__: <<print cashFormatColor(Math.trunc(_total))>>

		<</if>>
	<</if>>
	<<SlaveExpensesExtra $args[0]>>
<</widget>>

<<widget "SlaveExpensesExtra">>
	<<setLocalPronouns $args[0]>>
	/* Background and original cost */
	<<if $args[0].origin != 0>>

			$args[0].origin

	<</if>>

		<<if $args[0].slaveCost < 0>>
			You bought $him for: @@.red;<<print cashFormat($args[0].slaveCost)>>.@@
			<<set _Cost = $args[0].slaveCost>>
		<<elseif $args[0].slaveCost == 0>>
			You spent nothing to acquire $him.
			<<set _Cost = $args[0].slaveCost>>
		<<else>>
			You have no record of how much <<if $args[0].origin != 0>>this<<else>>$he originally<</if>> cost.
			<<set _Cost = 0>>
		<</if>>

	/* Lifetime totals, assistant gated */
	<<if $assistantPower > 0>>
		<<set _weeksOwned = $week - $args[0].weekAcquired>>
		/* Lifetime expense */

			<<if $args[0].lifetimeCashExpenses < 0>>
				In $his <<if _weeksOwned > 0>>_weeksOwned <<if _weeksOwned == 1>>week<<else>>weeks<</if>><<else>>time<</if>> with you, $he has cost @@.red;<<print cashFormat($args[0].lifetimeCashExpenses)>>.@@
				<<set _Expense = $args[0].lifetimeCashExpenses>>
			<<else>>
				You have no record of $him costing you any ¤.
				<<set _Expense = 0>>
			<</if>>

		/* Lifetime income */

			<<if $args[0].lifetimeCashIncome > 0>>
				In $his <<if _weeksOwned > 0>>_weeksOwned <<if _weeksOwned == 1>>week<<else>>weeks<</if>><<else>>time<</if>> with you, $he has earned @@.yellowgreen;<<print cashFormat($args[0].lifetimeCashIncome)>>.@@
				<<set _Income = $args[0].lifetimeCashIncome>>
			<<else>>
				You have no record of $him making you any ¤.
				<<set _Income = 0>>
			<</if>>

		/* Lifetime total */

			Overall,
			<<if (_Income + _Cost + _Expense) > 0>>
				you have made @@.yellowgreen;<<print cashFormat(_Income + _Cost + _Expense)>>@@ net from $his labors.
			<<elseif (_Income + _Cost + _Expense) == 0>>
				$he is even in cost and income.
			<<else>>
				$he has cost you @@.red;<<print cashFormat(_Income + _Cost + _Expense)>>.@@
			<</if>>

		/* Reputation: */

			<<if ($args[0].lifetimeRepIncome != 0 || $args[0].lifetimeRepExpenses != 0)>>
				<<set _repTotal = ($args[0].lifetimeRepIncome + $args[0].lifetimeRepExpenses)>>
				<<if ($cheatMode == 1 || $debugMode == 1)>>
					<<if $args[0].lifetimeRepIncome != 0>>

							This week $he has
							<<if $args[0].lastWeeksRepIncome == 0>>
								had no positive effect on your reputation, but
							<<else>>
								improved your reputation by @@.green;<<print num($args[0].lastWeeksRepIncome)>>@@ and
							<</if>>
							over $his entire time with you, $he gained @@.green;<<print num($args[0].lifetimeRepIncome)>>.@@

					<</if>>
					<<if $args[0].lifetimeRepExpenses != 0>>

							This week $he has
							<<if $args[0].lastWeeksRepExpenses == 0>>
								had no negative effect on your reputation, but
							<<else>>
								lowered your reputation by @@.red;<<print num($args[0].lastWeeksRepExpenses)>>@@ and
							<</if>>
							over $his entire time with you, $he cost @@.red;<<print num($args[0].lifetimeRepExpenses)>>.@@

					<</if>>

						Overall then, $he has changed your reputation by
						<<if _repTotal > 0>>
							@@.green;<<print num(_repTotal)>>@@
						<<elseif _repTotal < 0>>
							@@.red;<<print num(_repTotal)>>@@
						<<else>>
							<<print num(_repTotal)>>
						<</if>>

				<<else>> /* lowercasedonkey: TODO: I don't like how vague my placeholder is. Probably need to set up some kind of sliding scale to describe how much rep (roughly) she has made or lost. Need to get a sense of common ranges. */

						Overall, $he has
						<<if _repTotal == 0>>
							had no impact on your reputation.
						<<elseif _repTotal > 0>>
							@@.green;increased@@ your reputation.
						<<elseif _repTotal < 0>>
							@@.red;decreased@@ your reputation.
						<</if>>

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

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

<<widget "setupLastWeeksCash">>
/* Feel free to add categories. Just make sure to display them in costsBudget.tw as well! */
<<set $lastWeeksCashIncome = {
/* Slave Jobs */
whore: 0,
whoreBrothel: 0,
rest: 0,
houseServant: 0,
confined: 0,
publicServant: 0,
classes: 0,
milked: 0,
milkedDairy: 0,
extraMilk: 0, /*milk from slaves doing other things*/
gloryhole: 0,
gloryholeArcade: 0,
porn: 0,

recruiter: 0,

/* Slaves in general */
fuckdolls: 0,
menialTrades: 0,
menialBioreactors: 0,

slaveTransfer: 0,
fuckdollsTransfer: 0,
menialTransfer: 0,
menialBioreactorsTransfer: 0,
babyTransfer: 0,
menialRetirement: 0,

slaveMod: 0,
slaveSurgery: 0,
slaveUpkeep: 0,
birth: 0,

/*Buildings*/
lab: 0,
brothel: 0,
brothelAds: 0,
club: 0,
clubAds: 0,
arcade: 0,
dairy: 0,
servantsQuarters: 0,
masterSuite: 0,
school: 0,
spa: 0,
clinic: 0,
cellblock: 0,
incubator: 0,
nursery: 0,
farmyard: 0,
pit: 0,

environment: 0,
weather: 0,

mercenaries: 0,
peacekeepers: 0,
specialForces: 0,
securityExpansion: 0,

citizenOrphanage: 0,
privateOrphanage: 0,

capEx: 0,
futureSocieties: 0,
schoolBacking: 0,
policies: 0,
edicts: 0,

/*Personal Finance*/
personalBusiness: 0,
personalLivingExpenses: 0,
PCtraining: 0,
PCmedical: 0,
PCskills: 0,
stocksTraded: 0, /*trading*/
stocks: 0, /*share growth*/
fines: 0,
event: 0, /* poker night etc. Try to file things elsewhere if you can. */
war: 0,

rents: 0,

cheating: 0,
total: 0

}>>

<<set $lastWeeksCashExpenses = clone($lastWeeksCashIncome)>>
<<set $lastWeeksCashProfits = clone($lastWeeksCashIncome)>>

<</widget>>

<<widget "setupLastWeeksRep">>
/* Feel free to add categories. Just make sure to display them in costsBudget.tw as well! */
<<set $lastWeeksRepIncome = {
/*Slave Jobs*/
fucktoy: 0,
publicServant: 0,
gloryholeArcade: 0,
gloryhole: 0,

concubine: 0,
headGirl: 0,
bodyguard: 0,
recruiter: 0,

/*Slaves in general*/
fuckdolls: 0,
slaveTransfer: 0,
babyTransfer: 0,
birth: 0,
retirement: 0,
slavesViewOfPC: 0,
prestigiousSlave: 0,
vignette: 0,
porn: 0,

/*Buildings*/
arcade: 0,
brothel: 0,
club: 0,
publicServantClub: 0,
clubAds: 0,
pit: 0,
servantsQuarters: 0,
spa: 0,

architecture: 0,

/*Policies*/
capEx: 0,
futureSocieties: 0,
policies: 0,
edicts: 0,
war: 0,
food: 0,

/*Forces */
peacekeepers: 0,
specialForces: 0,

/*Personal Finance*/
personalBusiness: 0,
PCappearance: 0,
PCactions: 0, /* actions involving your body: becoming pregnant, etc. */
PCRelationships: 0,
SlaveRelationships: 0,
event: 0, /*poker night etc. Try to file things elsewhere if you can.*/

/*special*/
multiplier: 0,
overflow: 0,
cheating: 0,

total: 0

}>>

<<set $lastWeeksRepExpenses = clone($lastWeeksRepIncome)>>
<<set $lastWeeksRepProfits = clone($lastWeeksRepIncome)>>

<</widget>>