code:
:: Brothel [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Brothel", $showEncyclopedia = 1, $encyclopedia = "Brothel", $brothelSlaves = $BrothiIDs.length, $Flag = 0>>

<<if $brothelName != "the Brothel">>
	<<set $brothelNameCaps = $brothelName.replace("the ", "The ")>>
<</if>>
<<brothelAssignmentFilter>>
$brothelNameCaps
<<switch $brothelDecoration>>
<<case "Roman Revivalist">>
	is decorated as a Roman whorehouse. Refreshments are served at a bar, and someone is playing pipes in the back.
<<case "Aztec Revivalist">>
	is decorated as an Aztec ode to fertility and nature. Clients may sacrifice a bit of blood to honor the goddess of Filth or to partake in a fertility ritual before joining the girl of their choosing.
<<case "Egyptian Revivalist">>
	is decorated as an ancient Egyptian fertility temple. Customers are bade relax on couches next to running water so that slaves may dance to entice them.
<<case "Edo Revivalist">>
	is furnished as an Edo period pleasure house, seedy by the standards of the time. Still, girls usually keep their clothes on until they lead patrons back behind the sliding paper screens, though this does not stop silhouettes of the activities within from being visible on them.
<<case "Arabian Revivalist">>
	is furnished as an Arabian fleshmarket, with the merchandise standing on little platforms, prices visible. Customers are permitted to fondle before making a decision and dragging a girl back behind a curtain.
<<case "Chinese Revivalist">>
	is furnished as an old Chinese pleasure house, with each girl set up in her own low room. They stand outside the doors, luring customers back one by one.
<<case "Chattel Religionist">>
	is decorated as a place of carnal worship. The air is scented by censers, and the slaves here maintain an air of holiness even when being sodomized in public.
<<case "Degradationist">>
	is decorated to look like a dungeon. The décor involves a lot of black leather and burnished steel, and the slaves on offer are mostly chained to beds and walls.
<<case "Repopulation Focus">>
	is clean and full of soft couches and chairs for its' pregnant whores to lounge upon while showing off their assets. Several of the rooms are prepped to allow a whore to give birth in front of an audience. A supply of freshly squeezed breast milk is available on tap.
<<case "Eugenics">>
	is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping and pole dancing on a stage. Safe sex is greatly encouraged. The real action happens in several reserved rooms dedicated to society's best, since the loud music drowns out private conversations.
<<case "Asset Expansionist">>
	is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping and pole dancing on a stage.
<<case "Transformation Fetishist">>
	is sterile and clean. Interactive screens on the walls list the whores and their modifications in clinical detail.
<<case "Gender Radicalist">>
	is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting every possible combination of human sexual congress.
<<case "Gender Fundamentalist">>
	is decorated to look like an old world whorehouse. Screens on the walls are showing pornography starring the whores, with prices flashing after each sex act.
<<case "Physical Idealist">>
	is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping on a stage. There is a distinct smell of sweat, and there is as much emphasis on the strippers' muscles as their breasts.
<<case "Supremacist">>
	is decorated like an old world gentleman's club. The pictures on the wall depict degradation of every race on earth, except $arcologies[0].FSSupremacistRace people.
<<case "Subjugationist">>
	is decorated to celebrate the degradation of $arcologies[0].FSSubjugationistRace whores. The whores greet customers in stereotypical $arcologies[0].FSSubjugationistRace accents.
<<case "Paternalist">>
	is decorated to look like a trendy bar. Whores are encouraged to meet customers for a drink and get to know them a little before heading back into a private room.
<<case "Pastoralist">>
	is decorated to look like a dairy. Though it isn't one, there is an intense sexual focus on boobs and lactation, and all the whores have their sizes and productivity proudly posted.
<<case "Maturity Preferentialist">>
	is decorated to look like a refined bar. It has a row of sturdy backless barstools, perfect for a delectable selection of succulent MILFs to perch on.
<<case "Youth Preferentialist">>
	is decorated to look like the sort of bar old world students visit on spring break. Vapid music is playing, and when whores aren't with customers, they dance and make out with each other to attract some.
<<case "Body Purist">>
	is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting idealized human forms in the act of love.
<<case "Slimness Enthusiast">>
	is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting slim, girlish figures playing, dancing, and loving.
<<case "Hedonistic">>
	is comfortable and full of soft couches and chairs for its' overweight whores to lounge upon between clients <<if $arcologies[0].FSHedonisticDecadenceResearch == 1>>and enjoy a plate of snacks<<else>>and enjoy a big cup of slave food<</if>>. The smells of fresh baked goods are pumped into the facility to mask the smell of sweat. It's not unusual for a client to fuck a whore right on her chosen couch, since the effort of moving is often too much.
<<default>>
	is utilitarian. There's a businesslike foyer with an area for the merchandise to stand. Customers make their selection (or selections) and then lead the whores back into little rooms.
<</switch>>

<<if $brothelAdsSpending > 0>>
	Screens outside the entrance are showing porn to advertise $brothelNameCaps.
	<<if $brothelAdsOld == 1>>
		The featured slave actresses are all MILFs.
	<<elseif $brothelAdsOld == -1>>
		The featured slave actresses are all nice and young.
	<<elseif $brothelAdsOld == -2>>
		The featured slave actresses are all teenagers.
	<<elseif $brothelAdsOld == -3>>
		The featured slave actresses are all lolis.
	<<else>>
		The featured slave actresses vary in age.
	<</if>>
	<<if $brothelAdsStacked == 1>>
		Lots of bouncing breasts and butts
	<<elseif $brothelAdsStacked == -1>>
		Lots of trim breasts and shapely butts
	<<else>>
		A variety of breast and butt sizes and shapes
	<</if>>
	are on display, and
	<<if $brothelAdsImplanted == 1>>
		most of these are augmented by implants.
	<<elseif $brothelAdsImplanted == -1>>
		they're all natural.
	<<else>>
		some are augmented by implants.
	<</if>>
	<<if $seePreg == 1>>
		<<if $brothelAdsPreg == 1>>
			Most of slaves have firm, rounded bellies.
		<<elseif $brothelAdsPreg == -1>>
			Most of the slaves have firm, flat bellies.
		<<else>>
			Some of the slaves are pregnant.
		<</if>>
	<</if>>
	<<if $brothelAdsModded == 1>>
		Everything is heavily pierced and tattooed.
	<<elseif $brothelAdsModded == -1>>
		Everything is free of tattoos and piercings.
	<<else>>
		Some of these assets are tattooed and pierced, and some aren't.
	<</if>>
	The slaves in the ads are
	<<if $brothelAdsXX == 1>>
		sucking dick and taking cock in their pussies and asses.
	<<elseif $brothelAdsXX == -1>>
		sucking cock and being assfucked while their dicks flop around.
	<<else>>
		sucking dick and taking anal, and the ones that have pussies are being fucked there, too.
	<</if>>
	The ads are shown on media across $arcologies[0].name.
	<<if ($brothelAdsXX == 1) && ($brothelAdsImplanted == 1) && ($brothelAdsStacked == 1)>>
		As a result, $brothelName is known as the place to go if you want to rent a<<if ($brothelAdsPreg == 1)>>pregnant<</if>> bimbo's pussy.
	<<elseif ($brothelAdsXX == 1) && ($brothelAdsOld == 1)>>
		As a result, $brothelName is known as the place to go if you want to rent a<<if ($brothelAdsPreg == 1)>>pregnant<</if>> MILF's tits.
	<<elseif ($brothelAdsXX == 1) && ($brothelAdsOld == -3)>>
		As a result, $brothelName is known as the place to go if you want to rent<<if $brothelAdsPreg == 1>> a pregnant<</if>><<if $brothelAdsStacked == 1>><<if $brothelAdsPreg != 1>> an<</if>> oppai<</if>> loli.
	<<elseif ($brothelAdsXX == 1) && ($brothelAdsPreg == 1)>>
		As a result, $brothelName is known as the place to go if you want to pound some pregnant pussy.
	<<elseif ($brothelAdsXX == -1) && ($brothelAdsStacked == 1)>>
		As a result, $brothelName is known as the place to go if you want to rent a shemale's asspussy.
	<<elseif ($brothelAdsXX == -1) && ($brothelAdsStacked == -1)>>
		As a result, $brothelName is known as the place to go if you want to rent a trap's tight ass.
	<</if>>
<</if>>

<<if $brothelSlaves > 2>>
	$brothelNameCaps is bustling with activity. Customers are coming and going and slave girls are displaying themselves. When a slave catches a customer's eye, he leads her back into a little cubicle.
<<elseif $brothelSlaves > 0>>
	$brothelNameCaps is working steadily. Customers are present and slave girls are on offer. When a slave catches a customer's eye, he leads her back into a little cubicle.
<<elseif $Madam != 0>>
	$Madam.slaveName is alone in $brothelName, and has nothing to do but keep the place clean and plan future sales efforts.
<<else>>
	$brothelNameCaps is empty and desolate.
	<<link "Decommission the brothel" "Main">>
		<<set $brothel = 0, $brothelUpgradeDrugs = 0, $brothelDecoration = "standard", $brothelAdsSpending = 0>>
		<<set _broth = $sectors.findIndex(function(s) { return s.type == "Brothel"; })>>
		<<if _broth != -1>>
			<<set $sectors[_broth].type = "Shops">>
		<</if>>
	<</link>>
<</if>>

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

<<set _Tmult0 = Math.trunc($brothel*1000*$upgradeMultiplierArcology)>>

It can support $brothel whores. Currently there <<if $brothelSlaves == 1>>is<<else>>are<</if>> $brothelSlaves whore<<if $brothelSlaves != 1>>s<</if>> at $brothelNameCaps.
[[Expand the brothel|Brothel][cashX(forceNeg(_Tmult0), "capEx"), $brothel += 5, $PC.engineering += .1]] //Costs <<print cashFormat(_Tmult0)>> and will increase upkeep costs//

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

	<<if $MadamIgnoresFlaws != 1>>
		$Madam.slaveName will attempt to fix flaws in whores serving under $him. [[Ignore flaws|Brothel][$MadamIgnoresFlaws = 1]]
	<<else>>
		$Madam.slaveName has been instructed to ignore flaws in the whores serving under $him. [[Fix flaws|Brothel][$MadamIgnoresFlaws = 0]]
	<</if>>
<</if>>

<<if $brothelUpgradeDrugs == 1>>
	It has been upgraded with aphrodisiac injection systems that monitor the whores and adjust dosage to keep them healthy but desperately horny and hopelessly addicted. The systems are currently applying a moderate dosage of aphrodisiac. [[Increase the aphrodisiac dosage|Brothel][$brothelUpgradeDrugs = 2]] | [[Disable the aphrodisiac injection systems|Brothel][$brothelUpgradeDrugs = 0.1]] //Will reduce upkeep costs if disabled, and raise them if increased//
<<elseif $brothelUpgradeDrugs == 2>>
	It has been upgraded with aphrodisiac injection systems that monitor the whores and adjust dosage to keep them healthy but desperately horny and hopelessly addicted. The systems are currently applying an extreme dosage of aphrodisiac. [[Decrease the aphrodisiac dosage|Brothel][$brothelUpgradeDrugs = 1]] | [[Disable the aphrodisiac injection systems|Brothel][$brothelUpgradeDrugs = 0.1]] //Will reduce upkeep costs//
<<elseif $brothelUpgradeDrugs == 0.1>>
	It has been upgraded with aphrodisiac injection systems that monitor the whores and adjust dosage to keep them healthy but desperately horny and hopelessly addicted. The systems are currently disabled. [[Enable them|Brothel][$brothelUpgradeDrugs = 1]] //Will increase upkeep costs//
<<else>>
	<<set _Tmult1 = Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier)>>
	It is a standard brothel. [[Upgrade the brothel with aphrodisiac injection systems|Brothel][cashX(forceNeg(_Tmult1), "capEx"), $brothelUpgradeDrugs = 0.1, $PC.hacking += 0.1]] //Costs <<print cashFormat(_Tmult1)>> and will increase upkeep costs//
<</if>>

$brothelNameCaps
<<if $brothelAdsSpending > 0>>
	is the subject of an active ad campaign.
<<else>>
	advertises by word of mouth.
<</if>>
Last week this
<<set $lastWeeksCashProfits.brothelAds = $lastWeeksCashIncome.brothelAds + $lastWeeksCashExpenses.brothelAds>>
<<if $lastWeeksCashProfits.brothelAds > 0>>
	made you an extra @@.green;<<print cashFormat($lastWeeksCashProfits.brothelAds)>>,@@<<if $brothelSlaves > 1>> as well as increasing business for your whores.<</if>>
<<elseif $lastWeeksCashProfits.brothelAds < 0>>
	cost you @@.red;<<print cashFormat($lastWeeksCashProfits.brothelAds)>>,@@<<if $brothelSlaves > 1>> but still increased business for your whores.<</if>>
<</if>>
<<link "Manage brothel advertisements" "Brothel Advertisement">><<set $nextLink = passage(), $nextButton = "Back">><</link>>

<<BrothelStatistics 1>>

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

	<button class="tablinks" onclick="opentab(event, 'assign')" id="tab assign">Assign a slave</button>
	<button class="tablinks" onclick="opentab(event, 'remove')" id="tab remove">Remove a slave</button>

		<<if $brothelSlaves > 0>>
			<<brothelAssignmentFilter>>
			<<set $Flag = 1>>
			<<include "Slave Summary">>
			<<resetAssignmentFilter>>
		<<else>>

//$brothelNameCaps is empty for the moment.
//
		<</if>>

		<<if ($brothel <= $brothelSlaves)>>
			''$brothelNameCaps is full and cannot hold any more slaves''
		<<elseif ($slaves.length > $brothelSlaves)>>
			<<resetAssignmentFilter>>
			<<set $Flag = 0>>
			<<include "Slave Summary">>
		<</if>>

<<if ($tabChoice.Brothel == "assign")>>

<<else>>

<</if>>

Rename $brothelName: <<textbox "$brothelName" $brothelName "Brothel">> //Use a noun or similar short phrase//


code:
:: Brothel Advertisement [nobr]

<<switch $brothelDecoration>>
<<case "Roman Revivalist">>
	$brothelNameCaps is decorated as a Roman whorehouse. Refreshments are served at a bar, and someone is playing pipes in the back.
<<case "Aztec Revivalist">>
	$brothelNameCaps is decorated as an Aztec ode to fertility and nature. Clients may sacrifice a bit of blood to honor the goddess of Filth or to partake in a fertility ritual before joining the girl of their choosing.
<<case "Egyptian Revivalist">>
	$brothelNameCaps is decorated as an ancient Egyptian fertility temple. Customers are bade relax on couches next to running water so that slaves may dance to entice them.
<<case "Edo Revivalist">>
	$brothelNameCaps is furnished as an Edo period pleasure house, seedy by the standards of the time. Still, girls usually keep their clothes on until they lead patrons back behind the sliding paper screens, though this does not stop silhouettes of the activities within from being visible on them.
<<case "Arabian Revivalist">>
	$brothelNameCaps is furnished as an Arabian slave market, with the merchandise standing on little platforms, prices visible. Customers are permitted to fondle before making a decision and dragging a girl back behind a curtain.
<<case "Chinese Revivalist">>
	$brothelNameCaps is furnished as an old Chinese pleasure house, with each girl set up in her own low room. They stand outside the doors, luring customers back one by one.
<<case "Chattel Religionist">>
	$brothelNameCaps is decorated as a place of worship. The air is scented by censers, and the slaves here maintain an air of holiness even when being sodomized in public.
<<case "Degradationist">>
	$brothelNameCaps is decorated to look like a dungeon. The décor involves a lot of black leather and burnished steel, and the slaves on offer are mostly chained to beds and walls.
<<case "Repopulation Focus">>
	$brothelNameCaps is clean and full of soft couches and chairs for its' pregnant whores to lounge upon while showing off their assets. Several of the rooms are prepped to allow a whore to give birth in front of an audience. A supply of freshly squeezed breast milk is available on tap.
<<case "Eugenics">>
	$brothelNameCaps is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping and pole dancing on a stage. Safe sex is greatly encouraged. The real action happens in several reserved rooms dedicated to society's best, since the loud music drowns out private conversations.
<<case "Asset Expansionist">>
	$brothelNameCaps is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping and pole dancing on a stage.
<<case "Transformation Fetishist">>
	$brothelNameCaps is sterile and clean. Interactive screens on the walls list the whores and their modifications in clinical detail.
<<case "Gender Radicalist">>
	$brothelNameCaps is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting every possible combination of human sexual congress.
<<case "Gender Fundamentalist">>
	$brothelNameCaps is decorated to look like an old world whorehouse. Screens on the walls are showing pornography starring the whores, with prices flashing after each sex act.
<<case "Physical Idealist">>
	$brothelNameCaps is decorated to look like a club. Loud music is playing, and the whores that aren't with customers are stripping on a stage. There is a distinct smell of sweat, and there is as much emphasis on the strippers' muscles as their breasts.
<<case "Subjugationist">>
	$brothelNameCaps is decorated to celebrate the degradation of $arcologies[0].FSSubjugationistRace whores. The whores greet customers in stereotypical $arcologies[0].FSSubjugationistRace accents.
<<case "Supremacist">>
	$brothelNameCaps is decorated like an old world gentleman's club. The pictures on the wall depict degradation of every race on earth, except $arcologies[0].FSSupremacistRace people.
<<case "Paternalist">>
	$brothelNameCaps is decorated to look like a normal bar. Whores are encouraged to meet customers for a drink and get to know them a little before heading back into a private room.
<<case "Maturity Preferentialist">>
	$brothelNameCaps is decorated to look like a refined bar. It has a row of sturdy backless barstools, perfect for a delectable selection of succulent MILFs to perch on.
<<case "Youth Preferentialist">>
	$brothelNameCaps is decorated to look like a the sort of bar old world students visit on spring break. Vapid music is playing, and when whores aren't with customers, they dance and make out with each other to attract some.
<<case "Body Purist">>
	$brothelNameCaps is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting idealized human forms in the act of love.
<<case "Slimness Enthusiast">>
	$brothelNameCaps is decorated to look like an old world bordello. The rich décor includes erotic photography and pornographic statuary, depicting slim, girlish figures playing, dancing, and loving.
<<case "Pastoralist">>
	$brothelNameCaps is decorated to look like a dairy. Though it isn't one, there is an intense sexual focus on boobs and lactation, and all the whores have their sizes proudly posted.
<<case "Hedonistic">>
	$brothelNameCaps is comfortable and full of soft couches and chairs for its' overweight whores to lounge upon between clients <<if $arcologies[0].FSHedonisticDecadenceResearch == 1>>and enjoy a plate of snacks<<else>>and enjoy a big cup of slave food<</if>>. The smells of fresh baked goods are pumped into the facility to mask the smell of sweat. It's not unusual for a client to fuck a whore right on her chosen couch, since the effort of moving is often too much.
<</switch>>

<<if $brothelAdsSpending > 0>>
	Screens outside the entrance are showing porn to advertise the brothel.
	<<if $brothelAdsOld == 1>>
	The featured slave actresses are all MILFs.
	<<elseif $brothelAdsOld == -1>>
	The featured slave actresses are all nice and young.
	<<elseif $brothelAdsOld == -2>>
	The featured slave actresses are all teenagers.
	<<elseif $brothelAdsOld == -3>>
	The featured slave actresses are all lolis.
	<<else>>
	The featured slave actresses vary in age.
	<</if>>
	<<if $brothelAdsStacked == 1>>
	Lots of bouncing breasts and butts
	<<elseif $brothelAdsStacked == -1>>
	Lots of trim breasts and shapely butts
	<<else>>
	A variety of breast and butt sizes and shapes
	<</if>>
	are on display, and
	<<if $brothelAdsImplanted == 1>>
	most of these are augmented by implants.
	<<elseif $brothelAdsImplanted == -1>>
	they're all natural.
	<<else>>
	some are augmented by implants.
	<</if>>
	<<if $seePreg == 1>>
		<<if $brothelAdsPreg == 1>>
			Most of slaves have firm, rounded bellies.
		<<elseif $brothelAdsPreg == -1>>
			Most of the slaves have firm, flat bellies.
		<<else>>
			Some of the slaves are pregnant.
		<</if>>
	<</if>>
	<<if $brothelAdsModded == 1>>
	Everything is heavily pierced and tattooed.
	<<elseif $brothelAdsModded == -1>>
	Everything is free of tattoos and piercings.
	<<else>>
	Some of these assets are tattooed and pierced, and some aren't.
	<</if>>
	The slaves in the ads are
	<<if $brothelAdsXX == 1>>
	sucking dick and taking cock in their pussies and asses.
	<<elseif $brothelAdsXX == -1>>
	sucking cock and being assfucked while their dicks flop around.
	<<else>>
	sucking dick and taking anal, and the ones that have pussies are being fucked there, too.
	<</if>>
<</if>>

<<if $brothelAdsSpending >= 5000>>
	Advertisements based on these scenes run constantly in media across the arcology, and there's an active merchandising campaign underway to promote your whores.
<<elseif $brothelAdsSpending >= 4000>>
	Advertisements based on these scenes run constantly in media across the arcology.
<<elseif $brothelAdsSpending >= 3000>>
	Advertisements based on these scenes are run in media across the arcology.
<<elseif $brothelAdsSpending >= 2000>>
	Advertisements based on these scenes run regularly in arcology media.
<<elseif $brothelAdsSpending >= 1000>>
	Advertisements based on these scenes run occasionally in arcology media.
<<else>>
	$arcologies[0].name has a robust internal media that could be used to bring customers into the brothel.
<</if>>

You are spending @@.red;<<print cashFormat($brothelAdsSpending)>>@@ each week to advertise the brothel.
<<if $lastWeeksCashIncome.brothelAds > 0>>
	Last week's ads increased profits by @@.green;<<print cashFormat($lastWeeksCashIncome.brothelAds)>>@@<<if $brothelSlaves > 1>> and also increased business for your whores<</if>>, and cost @@.red;<<print cashFormat($lastWeeksCashExpenses.brothelAds)>>.@@
<</if>>

<<if $brothelAdsSpending > 900>>
	<<link "Decrease">><<set $brothelAdsSpending -= 1000>><<goto "Brothel Advertisement">><</link>> |
<<else>>
	Decrease |
<</if>>
<<if $brothelAdsSpending < 5000>>
	<<link "Increase">><<set $brothelAdsSpending += 1000>><<goto "Brothel Advertisement">><</link>>
<<else>>
	Increase
<</if>>

__Design Brothel Ad Campaign__ //Will replace relevant variety bonuses//

Asset size:
<<if $brothelAdsStacked != 1>><<link "Stacked">><<set $brothelAdsStacked = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>Stacked | <</if>>
<<if $brothelAdsStacked != -1>><<link "Slim">><<set $brothelAdsStacked = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>Slim | <</if>>
<<if $brothelAdsStacked != 0>><<link "Variety">><<set $brothelAdsStacked = 0>><<goto "Brothel Advertisement">><</link>><<else>>Variety<</if>>

Asset origin:
<<if $brothelAdsImplanted != 1>><<link "Implants">><<set $brothelAdsImplanted = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>Implants | <</if>>
<<if $brothelAdsImplanted != -1>><<link "All natural">><<set $brothelAdsImplanted = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>All natural | <</if>>
<<if $brothelAdsImplanted != 0>><<link "Variety">><<set $brothelAdsImplanted = 0>><<goto "Brothel Advertisement">><</link>><<else>>Variety<</if>>

Body mods:
<<if $brothelAdsModded != 1>><<link "Modded">><<set $brothelAdsModded = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>Modded | <</if>>
<<if $brothelAdsModded != -1>><<link "Unmodded">><<set $brothelAdsModded = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>Unmodded | <</if>>
<<if $brothelAdsModded != 0>><<link "Variety">><<set $brothelAdsModded = 0>><<goto "Brothel Advertisement">><</link>><<else>>Variety<</if>>

<<if $seePreg != 0>>
Pregnancy:
<<if $brothelAdsPreg != 1>><<link "Gravid">><<set $brothelAdsPreg = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>Gravid | <</if>>
<<if $brothelAdsPreg != -1>><<link "None">><<set $brothelAdsPreg = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>None | <</if>>
<<if $brothelAdsPreg != 0>><<link "Variety">><<set $brothelAdsPreg = 0>><<goto "Brothel Advertisement">><</link>><<else>>Variety<</if>>

<</if>>

Age:
<<if $brothelAdsOld != 1>><<link "MILF">><<set $brothelAdsOld = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>MILF | <</if>>
<<if $brothelAdsOld != -1>><<link "Young">><<set $brothelAdsOld = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>Young | <</if>>
<<if $minimumSlaveAge < 18>>
<<if $brothelAdsOld != -2>><<link "Teen">><<set $brothelAdsOld = -2>><<goto "Brothel Advertisement">><</link>> | <<else>>Teen | <</if>>
<</if>>
<<if $minimumSlaveAge < 13>>
<<if $brothelAdsOld != -3>><<link "Loli">><<set $brothelAdsOld = -3>><<goto "Brothel Advertisement">><</link>> | <<else>>Loli | <</if>>
<</if>>
<<if $brothelAdsOld != 0>><<link "Variety">><<set $brothelAdsOld = 0>><<goto "Brothel Advertisement">><</link>> <<else>>Variety<</if>>

<<if $seeDicks != 0>>
	Genitalia:
	<<if $brothelAdsXX != 1>><<link "Pussies">><<set $brothelAdsXX = 1>><<goto "Brothel Advertisement">><</link>> | <<else>>Pussies | <</if>>
	<<if $brothelAdsXX != -1>><<link "Dicks">><<set $brothelAdsXX = -1>><<goto "Brothel Advertisement">><</link>> | <<else>>Dicks | <</if>>
	<<if $brothelAdsXX != 0>><<link "Variety">><<set $brothelAdsXX = 0>><<goto "Brothel Advertisement">><</link>> <<else>>Variety<</if>>

<</if>>

repo_name: Littlefootlittleguy/fc


code:
:: Brothel Report [nobr]

<<SlaveSort $BrothiIDs>>
<<set _DL = $BrothiIDs.length, $brothelSlaves = _DL, _SL = $slaves.length, $legendaryWhoreID = 0, $madamCashBonus = 0, _FLsFetish = 0, _profits = 0>>
<<set $legendaryWombID = 0>>
<<set _modded = 0, _old = 0, _pure = 0, _slim = 0, _implanted = 0, _stacked = 0, _unmodded = 0, _XX = 0, _XY = 0, _young = 0, _pregYes = 0, _pregNo = 0, _minBonus = 50, _maxBonus = 150>>

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

<<if ($Madam != 0)>>
	<<set _FLs = $slaveIndices[$Madam.ID]>>

	<<if ($slaves[_FLs].health < -80)>>
		<<set $slaves[_FLs].health += 20>>
	<<elseif $slaves[_FLs].health < -40>>
		<<set $slaves[_FLs].health += 15>>
	<<elseif $slaves[_FLs].health < 0>>
		<<set $slaves[_FLs].health += 10>>
	<<elseif $slaves[_FLs].health < 90>>
		<<set $slaves[_FLs].health += 7>>
	<</if>>
	<<if $slaves[_FLs].devotion <= 45>>
		<<set $slaves[_FLs].devotion += 5>>
	<</if>>
	<<if $slaves[_FLs].trust < 45>>
		<<set $slaves[_FLs].trust += 5>>
	<</if>>
	<<if $slaves[_FLs].livingRules != "luxurious">>
		<<set $slaves[_FLs].livingRules = "luxurious">>
	<</if>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "dom">>
			<<if fetishChangeChance($slaves[_FLs]) > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "dom">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	/% Make sure we have registered living expenses as for any other slave %/
	<<run getSlaveStatisticData($Madam, $facility.brothel)>>
	<<set $Madam = $slaves[_FLs]>>
	<<setLocalPronouns $Madam>>
	    <<= SlaveFullName($Madam)>> is serving as the Madam.
	<<if $Madam.relationship == -3 && $Madam.devotion > 50>>
		As your loving wife, $he does $his best to attract attention to your brothel.
		<<set $madamCashBonus += 0.25>>
	<</if>>
	<<if (_FLsFetish == 1)>>
		$He isn't above sampling the merchandise $himself; before long it's obvious to $his girls that $he @@.lightcoral;really likes fucking them.@@
	<<elseif (_FLsFetish == 2)>>
		$He's careful that all of the whores under $his supervision are all warmed up and ready to get fucked every morning, and $he @@.lightsalmon;becomes more dominant.@@
	<</if>>
	<<if ($Madam.skill.whoring <= 10)>>
		Though $Madam.slaveName does $his best to manage the brothel, with $his lack of skill $he can do little.
	<<elseif ($Madam.skill.whoring <= 30)>>
		$Madam.slaveName's basic skills marginally @@.yellowgreen;improve@@ business at $brothelName.
		<<set $madamCashBonus += 0.05>>
	<<elseif ($Madam.skill.whoring <= 60)>>
		$Madam.slaveName's skills @@.yellowgreen;improve@@ business at $brothelName.
		<<set $madamCashBonus += 0.1>>
	<<elseif ($Madam.skill.whoring < 100)>>
		$Madam.slaveName's skills greatly @@.yellowgreen;improve@@ business at $brothelName.
		<<set $madamCashBonus += 0.15>>
	<<else>>
		$Madam.slaveName's mastery immensely @@.yellowgreen;improves@@ business at $brothelName.
		<<set $madamCashBonus += 0.20>>
	<</if>>
	<<if ($Madam.actualAge > 35)>>
		$His age and experience also contribute.
		<<set $madamCashBonus += 0.05>>
	<<elseif $AgePenalty == 0>>
		<<set $madamCashBonus += 0.05>>
	<</if>>
	<<if setup.madamCareers.includes($Madam.career)>>
		$He has experience from $his life before $he was a slave that helps $him in the seedy business of selling other people's bodies for sex.
		<<set $madamCashBonus += 0.05>>
	<<elseif $Madam.skill.madam >= $masteredXP>>
		$He has experience from working for you that helps $him in the seedy business of selling other people's bodies for sex.
		<<set $madamCashBonus += 0.05>>
	<<else>>
		<<set $slaves[_FLs].skill.madam += random(1,Math.ceil(($Madam.intelligence+$Madam.intelligenceImplant)/15) + 8)>>
	<</if>>
	<<if ($Madam.intelligence+$Madam.intelligenceImplant > 15)>>
		$He is a clever manager.
		<<set $madamCashBonus += 0.05*Math.floor(($Madam.intelligence+$Madam.intelligenceImplant)/32)>>
	<</if>>
	<<if ($Madam.dick > 2) && (canPenetrate($Madam))>>
		$His turgid dick helps $him manage the bitches.
		<<set $madamCashBonus += 0.05>>
	<</if>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$BrothiIDs[_dI]]>>
		<<if $Madam.rivalryTarget == $slaves[$i].ID>>
			$He forces $his <<print rivalryTerm($Madam)>>, to service all the men in the brothel.
			<<set $slaves[$i].devotion -= 2, $slaves[$i].trust -= 2>>
			<<if canDoVaginal($slaves[$i])>>
				<<set $slaves[$i].counter.vaginal += 10, $vaginalTotal += 10>>
				<<if $slaves[$i].counter.publicUse>><<set $slaves[$i].counter.publicUse += 10>><<else>><<set $slaves[$i].counter.publicUse = 10>><</if>>
			<</if>>
			<<if canDoAnal($slaves[$i])>>
				<<set $slaves[$i].counter.anal += 10, $analTotal += 10>>
				<<if $slaves[$i].counter.publicUse>><<set $slaves[$i].counter.publicUse += 10>><<else>><<set $slaves[$i].counter.publicUse = 10>><</if>>
			<</if>>
			<<set $slaves[$i].counter.oral += 10, $oralTotal += 10>>
			<<if $slaves[$i].counter.publicUse>><<set $slaves[$i].counter.publicUse += 10>><<else>><<set $slaves[$i].counter.publicUse = 10>><</if>>
			<<if random(1,100) > 65>>
				<<set $slaves[_FLs].rivalry++, $Madam.rivalry++, $slaves[$i].rivalry++>>
			<</if>>
		<<elseif $Madam.relationshipTarget == $slaves[$i].ID>>
			<<setLocalPronouns $slaves[$i] 2>>
			$He dotes over $his <<print relationshipTerm($Madam)>>, $slaves[$i].slaveName, making sure _he2 is safe, but unfortunately driving potential customers away from _him2.
			<<set $slaves[$i].devotion++, $madamCashBonus -= 0.05>>
		<<elseif $familyTesting == 1 && areRelated($Madam, $slaves[$i]) > 0>>
			<<setLocalPronouns $slaves[$i] 2>>
			$He pays special attention to $his <<print relativeTerm($Madam.ID,$slaves[$i].ID)>>, $slaves[$i].slaveName, making sure _he2 is treated well and showing off _his2 skills.
			<<set $slaves[$i].trust++, $madamCashBonus += 0.05>>
		<<elseif $Madam.relationTarget == $slaves[$i].ID && $familyTesting == 0>>
			<<setLocalPronouns $slaves[$i] 2>>
			$He pays special attention to $his $slaves[$i].relation, $slaves[$i].slaveName, making sure _he2 is treated well and showing off _his2 skills.
			<<set $slaves[$i].trust++, $madamCashBonus += 0.05>>
		<</if>>
		<<if $slaves[$i].prestigeDesc == "She is a famed Free Cities whore, and commands top prices.">>
			<<setLocalPronouns $slaves[$i] 2>>
			$He makes sure to promote $slaves[$i].slaveName, the famed whore, in order to capitalize on _his2 popularity.
			<<set $madamCashBonus += 0.15>>
		<<elseif $slaves[$i].prestigeDesc == "She is a famed Free Cities slut, and can please anyone.">>
			<<setLocalPronouns $slaves[$i] 2>>
			$He makes sure to promote $slaves[$i].slaveName, the famed entertainer, in order to capitalize on _his2 popularity.
			<<set $madamCashBonus += 0.15>>
		<<elseif $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a dairy cow.">>
			<<setLocalPronouns $slaves[$i] 2>>
			<<if ($arcologies[0].FSPhysicalIdealist != "unset")>>
				<<if ($slaves[$i].muscles > 60) && ($slaves[$i].weight < 30) && ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>
					$He shows off how even a cow like $slaves[$i].slaveName can achieve physical perfection.
					<<set $madamCashBonus += 0.15>>
				<<else>>
					A<<if ($slaves[$i].muscles < 30)>>n unmuscled,<</if>><<if ($slaves[$i].weight > 30)>> fat,<</if>> 'prestigious' <<if ($slaves[$i].lactation > 0)>>cow<<elseif (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>mass of titflesh<<else>>slave<</if>> like $slaves[$i].slaveName is woefully out of fashion, so $Milkmaid.slaveName tries to draw attention away from _him2.
				<</if>>
			<<else>>
				<<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>
					$He makes sure to massage $slaves[$i].slaveName's huge breasts to get the milk flowing before enticing clients to suckle and play with _him2.
					<<set $madamCashBonus += 0.10>>
				<<else>>
					$He would like to show off $slaves[$i].slaveName's huge udders, but $slaves[$i].slaveName <<if ($slaves[$i].lactation == 0)>> isn't producing milk anymore. <<else>> doesn't exactly have huge udders anymore. <</if>>
				<</if>>
			<</if>>
		<<elseif $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a cockmilker.">>
			<<setLocalPronouns $slaves[$i] 2>>
			<<if $arcologies[0].FSGenderFundamentalist != "unset">> /* this needs review - doesn't fit right. An XY slave would be expected to be masculine. */
				<<if ($slaves[$i].balls == 0) && ($slaves[$i].dick == 0) && ($slaves[$i].vagina > -1)>>
					$He uses $slaves[$i].slaveName as an example of how even a huge-balled freak like _him2 can be restored to proper femininity.
					<<set $madamCashBonus += 0.20>>
				<<else>>
					$He tries to hide $slaves[$i].slaveName, 'her' body being notorious for defiance of conventional femininity.
				<</if>>
			<<else>>
				<<if (($slaves[$i].balls > 5) && ($slaves[$i].dick != 0)) || (($slaves[$i].balls > 4) && ($slaves[$i].dick != 0) && ($slaves[$i].prostate > 1))>>
					$He shows off $slaves[$i].slaveName's copious loads by putting a condom over _his2 dick and teasing _him2 till _he2 bursts it. The show draws multiple clients that want to play with _his2 oversized junk and messy orgasms.
					<<set $madamCashBonus += 0.15>>
				<<else>>
					$He would love to show off $slaves[$i].slaveName's copious loads, but $slaves[$i].slaveName<<if $slaves[$i].dick == 0>> doesn't have a dick.<<elseif $slaves[$i].balls == 0>>'s not producing cum. <<else>>'s orgasms just aren't messy enough. <</if>>
				<</if>>
			<</if>>
		<<elseif $slaves[$i].prestigeDesc == "She is remembered for winning best in show as a breeder.">>
			<<setLocalPronouns $slaves[$i] 2>>
			<<if $slaves[$i].bellyPreg >= 5000>>
				$He makes sure $slaves[$i].slaveName's growing pregnancy is well taken care of, even if it means driving away potential customers away when the mother-to-be needs a rest.
				<<set $madamCashBonus -= 0.05>>
			<<elseif canGetPregnant($slaves[$i])>>
				$He makes sure to play off $slaves[$i].slaveName's fame and fertility by enticing potential customers to be the one to claim _his2 womb by filling it with their child.
				<<set $madamCashBonus += 0.15>>
			<<else>>
				$He would love to play off of $slaves[$i].slaveName's fame and fertility, but unfortunately _he2 <<if $slaves[$i].pregKnown == 1 && $slaves[$i].bellyPreg < 1500>>is already pregnant and not far enough along to show it<<elseif $slaves[$i].pregKnown == 1 && $slaves[$i].bellyPreg < 5000>>already pregnant, but not enough to be exciting<<else>>is unable to get knocked up<</if>>.
			<</if>>
		<</if>>
	<</for>>

	<<set _oldCash = $cash>>
	<<if (_DL < 5)>>
		<<set $slavesGettingHelp = 0>>
		<<if $universalRulesFacilityWork == 1>>
			<<for $i = 0; $i < _SL; $i++>>
				<<if ($slaves[$i].assignment == "whore")>>
					<<set $slavesGettingHelp++>>
				<</if>>
			<</for>>
		<</if>>
		<<if (_DL+$slavesGettingHelp < 5)>>
			<<set $i = _FLs>> /* apply following SA passages to facility leader */
			<<if $showEWD != 0>>

    $He <<= saWhore($slaves[$i])>>
			<<else>>
				<<set _dump = saWhore($slaves[$i])>>
			<</if>>
			<<set _seed = $cash-_oldCash, _cashX += Math.trunc(0.5*_seed), _seed = Math.trunc(1.5*_seed), _profits += _seed>>
			<<run cashX(_cashX, "whore", $Madam)>>

    Since $he doesn't have enough whores to manage to keep $him busy, $he sees $beauty customers $himself (<<print Math.trunc($beauty/7)>> a day), earning you @@.yellowgreen;<<print cashFormat(_seed)>>.@@ $He can charge more for $his time, since many citizens find it erotic to fuck the Madam.
		<</if>>
	<</if>>
	<<if (_DL > 0)>>

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

<<if (_DL > 0)>>
	    <<if _DL != 1>>''There are _DL slave whores working out of $brothelName.''<<else>>''There is one slave whore working out of $brothelName.''<</if>>
<</if>>

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

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

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

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

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

<<include "SA devotion">>
	<<else>>
		<<silently>>
		<<set _chosenClothes = saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
	<<set $Madam = $slaves[_FLs]>>
	<<if isSlim($slaves[_FLs])>>
		<<set _slim += 1>>
	<</if>>
	<<if isStacked($slaves[_FLs])>>
		<<set _stacked += 1>>
	<</if>>
	<<if isYoung($slaves[_FLs])>>
		<<set _young += 1>>
	<<else>>
		<<set _old += 1>>
	<</if>>
	<<if SlaveStatsChecker.isModded($slaves[_FLs])>>
		<<set _modded += 1>>
	<<elseif SlaveStatsChecker.isUnmodded($slaves[_FLs])>>
		<<set _unmodded += 1>>
	<</if>>
	<<if isXY($slaves[_FLs])>>
		<<set _XY += 1>>
	<<else>>
		<<set _XX += 1>>
	<</if>>
	<<if isPure($slaves[_FLs])>>
		<<set _pure += 1>>
	<<else>>
		<<set _implanted += 1>>
	<</if>>
	<<if isPreg($slaves[_FLs])>>
		<<set _pregYes += 1>>
	<<elseif isNotPreg($slaves[_FLs])>>
		<<set _pregNo += 1>>
	<</if>>
<</if>>

<<if (_DL > 0)>>
	<<set _healthBonus = 0, _aphrod = 0>>
	<<if ($brothelUpgradeDrugs == 1)>>
		<<set _healthBonus += 1, _aphrod = 1>>
	<<elseif ($brothelUpgradeDrugs == 2)>>
		<<set _healthBonus += 3, _aphrod = 2>>
	<</if>>
	<<set _oldCash = $cash>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$BrothiIDs[_dI]]>>
		<<setLocalPronouns $slaves[$i]>>
		<<if ($legendaryWombID == 0) && ($slaves[$i].amp != 1) && ($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 ($legendaryWhoreID == 0) && ($slaves[$i].skill.whoring >= 100) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>>
			<<set $legendaryWhoreID = $slaves[$i].ID>>
		<</if>>

		/* Perform facility based rule changes */
		<<set $slaves[$i].health += _healthBonus, $slaves[$i].aphrodisiacs = _aphrod>>
		<<switch $brothelDecoration>>
		<<case "Degradationist" "standard">>
			<<set $slaves[$i].livingRules = "spare">>
		<<default>>
			<<set $slaves[$i].livingRules = "normal">>
		<</switch>>
		<<if ($slaves[$i].health < -80)>>
			<<set $slaves[$i].health += 20>>
		<<elseif $slaves[$i].health < -40>>
			<<set $slaves[$i].health += 15>>
		<<elseif $slaves[$i].health < 0>>
			<<set $slaves[$i].health += 10>>
		<<elseif $slaves[$i].health < 90>>
			<<set $slaves[$i].health += 7>>
		<</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].energy > 40 && $slaves[$i].energy < 95>>
			<<set $slaves[$i].energy++>>
		<</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 working out of $brothelName.
			<</if>>

    $He <<= saWhore($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">>
			<<set _dump = saWhore($slaves[$i])>>
			<<set _chosenClothes = saChoosesOwnClothes($slaves[$i])>>
			<<include "SA rules">>
			<<include "SA diet">>
			<<include "SA long term effects">>
			<<include "SA drugs">>
			<<include "SA relationships">>
			<<include "SA rivalries">>
			<<include "SA devotion">>
			<</silently>>
		<</if>>
		<<if isSlim($slaves[$i])>>
			<<set _slim += 1>>
		<</if>>
		<<if isStacked($slaves[$i])>>
			<<set _stacked += 1>>
		<</if>>
		<<if isYoung($slaves[$i])>>
			<<set _young += 1>>
		<<else>>
			<<set _old += 1>>
		<</if>>
		<<if SlaveStatsChecker.isModded($slaves[$i])>>
			<<set _modded += 1>>
		<<elseif SlaveStatsChecker.isUnmodded($slaves[$i])>>
			<<set _unmodded += 1>>
		<</if>>
		<<if isXY($slaves[$i])>>
			<<set _XY += 1>>
		<<else>>
			<<set _XX += 1>>
		<</if>>
		<<if isPure($slaves[$i])>>
			<<set _pure += 1>>
		<<else>>
			<<set _implanted += 1>>
		<</if>>
		<<if isPreg($slaves[$i])>>
			<<set _pregYes += 1>>
		<<elseif isNotPreg($slaves[$i])>>
			<<set _pregNo += 1>>
		<</if>>
		<<if $brothelAdsSpending != 0>>
			<<set _seed = 0>>
			<<if $brothelAdsStacked == 1>>
				<<if ($slaves[$i].butt > 4) && ($slaves[$i].boobs > 800)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsStacked == -1>>
				<<if ($slaves[$i].boobs < 500) && ($slaves[$i].butt < 3) && ($slaves[$i].weight <= 10) && ($slaves[$i].muscles <= 95)>>
					<<set _seed++>>
				<</if>>
			<</if>>
			<<set _PierceC = ($slaves[$i].lipsPiercing + $slaves[$i].nipplesPiercing + $slaves[$i].vaginaPiercing + $slaves[$i].clitPiercing + $slaves[$i].anusPiercing + $slaves[$i].earPiercing + $slaves[$i].eyebrowPiercing + $slaves[$i].nosePiercing + $slaves[$i].navelPiercing)>>
			<<if $brothelAdsModded == 1>>
				<<if (_PierceC > 8)>>
					<<if ($slaves[$i].lipsTat != 0) && ($slaves[$i].buttTat != 0) && ($slaves[$i].anusTat != 0) && ($slaves[$i].vaginaTat != 0) && ($slaves[$i].boobsTat != 0)>>
						<<set _seed++>>
					<</if>>
				<</if>>
			<<elseif $brothelAdsModded == -1>>
				<<if (_PierceC < 3)>>
					<<if ($slaves[$i].lipsTat == 0) && ($slaves[$i].buttTat == 0) && ($slaves[$i].vaginaTat == 0) && ($slaves[$i].boobsTat == 0)>>
						<<set _seed++>>
					<</if>>
				<</if>>
			<</if>>
			<<if $brothelAdsPreg == 1>>
				<<if ($slaves[$i].bellyPreg >= 5000) || ($slaves[$i].bellyImplant >= 5000)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsPreg == -1>>
				<<if ($slaves[$i].belly < 100) && ($slaves[$i].weight < 30) && (!setup.fakeBellies.includes($bellyAccessory)) && ($slaves[$i].bellyImplant <= 0)>>
					<<set _seed++>>
				<</if>>
			<</if>>
			<<if $brothelAdsImplanted == 1>>
				<<if ($slaves[$i].boobsImplant > 0) && ($slaves[$i].buttImplant > 0) && ($slaves[$i].waist < -95) && ($slaves[$i].lipsImplant > 0) && ($slaves[$i].bellyImplant >= 1500)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsImplanted == -1>>
				<<if $slaves[$i].boobsImplant == 0 && $slaves[$i].buttImplant == 0 && $slaves[$i].waist >= -95 && $slaves[$i].lipsImplant == 0 && $slaves[$i].faceImplant < 30 && $slaves[$i].bellyImplant <= 0>>
					<<set _seed++>>
				<</if>>
			<</if>>
			<<if $brothelAdsOld == 1>>
				<<if ($slaves[$i].physicalAge >= 30)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsOld == -1>>
				<<if ($slaves[$i].physicalAge < 30) && ($slaves[$i].physicalAge >= 18)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsOld == -2>>
				<<if ($slaves[$i].physicalAge <= 18) && ($slaves[$i].physicalAge >= 13)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsOld == -3>>
				<<if ($slaves[$i].physicalAge < 13)>>
					<<set _seed++>>
				<</if>>
			<</if>>
			<<if $brothelAdsXX == 1>>
				<<if ($slaves[$i].dick == 0)>>
					<<set _seed++>>
				<</if>>
			<<elseif $brothelAdsXX == -1>>
				<<if ($slaves[$i].dick > 0)>>
					<<set _seed++>>
				<</if>>
			<</if>>
			<<if _seed > 0>>
				<<set _adsIncome = _seed * random(50,60) * Math.trunc($brothelAdsSpending/1000)>>
				<<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>>
				<<run cashX(_cashX, "brothelAds")>>
			<<else>>
				<<set _adsIncome = random(50,60) * Math.trunc($brothelAdsSpending/1000)>>
				<<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>>
				<<run cashX(_cashX, "brothelAds")>>
			<</if>>
		<</if>>
	<</for>>
	<<set _profits += $cash-_oldCash, _oldCash = $cash, _possibleBonuses = 0, _brothelBonuses = 0>>

	/* adblock */

	<<if $brothelAdsSpending != 0>>
		An ad campaign is supporting business there, and whores that match it make more ¤.
	<</if>>

	<<if $brothelAdsSpending != 0>>
		<<if $brothelAdsStacked == 1>>
			Its advertisements feature girls with plenty up top and rears to match.
			<<set _ads = 1>>
		<<elseif $brothelAdsStacked == -1>>
			Its advertisements feature trim girls with little in the way of T&A.
			<<set _ads = -1>>
		<<else>>
			Its advertisements feature a variety of girls, some that are trim and others that are curvaceous.
			<<set _ads = 0>>
		<</if>>
	<</if>>
	<<if ($arcologies[0].FSAssetExpansionist != "unset") && ($arcologies[0].FSAssetExpansionist >= 80)>>
		Most customers prefer their girls well endowed.
		<<set _pref = 1>>
	<<elseif ($arcologies[0].FSSlimnessEnthusiast != "unset") && ($arcologies[0].FSSlimnessEnthusiast >= 80) >>
		Most customers prefer their girls light.
		<<set _pref = -1>>
	<<else>>
		<<if ($arcologies[0].FSAssetExpansionist == "unset") && ($arcologies[0].FSSlimnessEnthusiast == "unset")>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsStacked == 0)>>
				<<set _possibleBonuses++>>
				<<if (_slim > 0) && (_stacked > 0) && (Math.abs(_slim-_stacked) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30),$facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers a @@.yellowgreen;wide@@ variety of slim and stacked slaves.
				<</if>>
			<</if>>
		<</if>>
		Most customers don't mind the selection of assets.
		<<set _pref = 0>>
	<</if>>
	<<if (_slim > (_DL/2))>>
		<<set _girls = -1>>
		Most of the slaves in the brothel have small tits and asses.
	<<elseif (_stacked > (_DL/2))>>
		<<set _girls = 1>>
		Most of the slaves in the brothel have large tits and asses.
	<<else>>
		<<set _girls = 0>>
		The slaves in the brothel vary in asset size.
	<</if>>
	<<if (_pref == 0)>> /*customers don't care*/
	<<elseif ($brothelAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
			<<run cashX(_adsIncome, "brothelAds")>>
			Its advertising for <<if _ads == 1>>stacked <<elseif _ads == -1>>trim <</if>>girls matched most customers' preferences and the girls in the brothel matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising for <<if _ads == 1>>stacked <<elseif _ads == -1>>trim <</if>>girls matched most customers preferences, but most of the girls in the brothel were not as advertised. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>stacked <<elseif _girls == -1>>trim <</if>>girls in the brothel did not match its advertisements, but since the girls in the brothel 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>>trim <</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)), "brothel")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>stacked <<elseif _girls == -1>>trim <</if>>girls in the brothel 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), "brothel")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>stacked <<elseif _girls == -1>>trim <</if>>girls there did not match their preferences for <<if _pref == 1>>large <<elseif _pref == -1>>slim <</if>>girls. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<</if>>
	<</if>>

	<<if $seePreg == 1>>

	<<if ($brothelAdsSpending > 0)>>
		<<if $brothelAdsPreg == 1>>
			Its advertisements feature girls that are clearly pregnant.
			<<set _ads = 1>>
		<<elseif $brothelAdsPreg == -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>>
	<<if ($arcologies[0].FSRepopulationFocus != "unset") && ($arcologies[0].FSRepopulationFocus >= 80)>>
		Most customers prefer their girls rounded with child.
		<<set _pref = 1>>
	<<elseif ($arcologies[0].FSRestart != "unset") && ($arcologies[0].FSRestart >= 80)>>
		Most customers prefer girls that aren't gravid.
		<<set _pref = -1>>
	<<else>>
		<<if ($arcologies[0].FSRepopulationFocus == "unset") && ($arcologies[0].FSRestart == "unset")>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsPreg == 0)>>
				<<set _possibleBonuses++>>
				<<if (_pregYes > 0) && (_pregNo > 0) && (Math.abs(_pregYes-_pregNo) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers a @@.yellowgreen;wide@@ selection of slaves with a variety of middles.
				<</if>>
			<</if>>
		<</if>>
		Most customers don't have preferences for either big-bellied or flat-bellied girls.
		<<set _pref = 0>>
	<</if>>
	<<if (_pregNo > (_DL/2))>>
		<<set _girls = -1>>
		Most of the slaves in the brothel sport flat bellies.
	<<elseif (_pregYes > (_DL/2))>>
		<<set _girls = 1>>
		Most of the slaves in the brothel sport gravid middles.
	<<else>>
		<<set _girls = 0>>
		The slaves in the brothel vary in belly type.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($brothelAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
			<<run cashX(_adsIncome, "brothelAds")>>
			Its advertising for <<if _ads == 1>>pregnant <<elseif _ads == -1>>flat-bellied <</if>>girls matched most customers' preferences and the girls in the brothel matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<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 brothel did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the brothel did not match its advertisements, but since the girls in the brothel 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 there 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)), "brothel")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls in the brothel 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), "brothel")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>pregnant <<elseif _girls == -1>>flat-bellied <</if>>girls there 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)), "brothel")>>
		<</if>>
	<</if>>
	<</if>>

	<<if ($brothelAdsSpending > 0)>>
		<<if $brothelAdsModded == 1>>
			Its advertisements feature girls that are heavily pierced and tattooed.
			<<set _ads = 1>>
		<<elseif $brothelAdsModded == -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>>
	<<if ($arcologies[0].FSDegradationist != "unset") && ($arcologies[0].FSDegradationist >= 80)>>
		Most customers prefer heavily modified girls.
		<<set _pref = 1>>
	<<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80) >>
		Most customers prefer natural girls.
		<<set _pref = -1>>
	<<else>>
		<<if ($arcologies[0].FSDegradationist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsModded == 0)>>
				<<set _possibleBonuses++>>
				<<if (_modded > 0) && (_unmodded > 0) && (Math.abs(_modded-_unmodded) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers a @@.yellowgreen;both@@ a selection of heavily altered slaves and those with more natural bodies.
				<</if>>
			<</if>>
		<</if>>
		Most customers don't have preferences for either modded or natural slaves.
		<<set _pref = 0>>
	<</if>>
	<<if (_modded > (_DL/2))>>
		<<set _girls = 1>>
		Most of the slaves in the brothel are heavily pierced and tattooed.
	<<elseif (_unmodded > (_DL/2))>>
		<<set _girls = -1>>
		Most of the slaves in the brothel have natural, unmodded bodies.
	<<else>>
		<<set _girls = 0>>
		Some girls in the brothel have piercings or tattoos, some have none and others have both.
	<</if>>
	<<if (_pref == 0)>> /*customers don't care*/
	<<elseif ($brothelAdsSpending > 0) && (_pref != 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
			<<run cashX(_adsIncome, "brothelAds")>>
			Its advertising for <<if _ads == 1>>heavily modified <<elseif _ads == -1>>natural bodied <</if>>girls matched most customers' preferences and the girls in the brothel matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising for <<if _ads == 1>>heavily modified <<elseif _ads == -1>>natural bodied <</if>>girls matched most customers preferences, but the girls in the brothel did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>heavily modified <<elseif _girls == -1>>natural bodied <</if>>girls in the brothel did not match its advertisements, but since the girls in the brothel 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 modified <<elseif _girls == -1>>natural bodied <</if>>girls there did not match their 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)), "brothel")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>heavily modified <<elseif _girls == -1>>natural bodied <</if>>girls in the brothel 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), "brothel")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>heavily modified <<elseif _girls == -1>>natural bodied <</if>>girls there did not match their 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)), "brothel")>>
		<</if>>
	<</if>>

	<<if ($brothelAdsSpending > 0)>>
		<<if ($brothelAdsImplanted == 1)>>
			Its advertisements feature girls that are augmented by implants or improved surgically.
			<<set _ads = 1>>
		<<elseif ($brothelAdsImplanted == -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>>
	<<if ($arcologies[0].FSTransformationFetishist != "unset") && ($arcologies[0].FSTransformationFetishist >= 80)>>
		Most customers prefer their girls fake.
		<<set _pref = 1>>
	<<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80)>>
		Most customers prefer all-natural girls.
		<<set _pref = -1>>
	<<else>>
		<<if ($arcologies[0].FSTransformationFetishist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsImplanted == 0)>>
				<<set _possibleBonuses++>>
				<<if (_implanted > 0) && (_pure > 0) && (Math.abs(_implanted-_pure) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means.
				<</if>>
			<</if>>
		<</if>>
		Most customers don't have preferences for either all-natural or surgically enhanced and implanted girls.
		<<set _pref = 0>>
	<</if>>
	<<if (_implanted > (_DL/2))>>
		<<set _girls = 1>>
		Most of the slaves in the brothel are heavily implanted or surgically enhanced.
	<<elseif (_pure > (_DL/2))>>
		<<set _girls = -1>>
		Most of the slaves in the brothel have naturally pure bodies.
	<<else>>
		<<set _girls = 0>>
		The slaves in the brothel vary in body modification.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($brothelAdsSpending > 0)>>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
			<<run cashX(_adsIncome, "brothelAds")>>
			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 brothel matched its advertisements. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<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 brothel did not. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The <<if _girls == 1>>implanted or surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls in the brothel did not match its advertisements, but since the girls in the brothel 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 or 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)), "brothel")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The <<if _girls == 1>>implanted or surgically improved <<elseif _girls == -1>>naturally pure <</if>>girls in the brothel 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), "brothel")>>
		<<else>>
			Some customers were put off since the <<if _girls == 1>>implanted or 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)), "brothel")>>
		<</if>>
	<</if>>

	<<if $seeDicks != 0>>

		<<if ($brothelAdsSpending > 0)>>
			<<if ($brothelAdsXX == 1)>>
				Its advertisements feature girls with female genitalia.
				<<set _ads = 1>>
			<<elseif ($brothelAdsXX == -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>>
		<<if ($arcologies[0].FSGenderFundamentalist != "unset") && ($arcologies[0].FSGenderFundamentalist >= 80)>>
			Most customers prefer girls with pussies.
			<<set _pref = 1>>
		<<elseif ($arcologies[0].FSGenderRadicalist != "unset") && ($arcologies[0].FSGenderRadicalist >= 80)>>
			Most customers prefer girls with dicks.
			<<set _pref = -1>>
		<<else>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsXX == 0)>>
				<<set _possibleBonuses++>>
				<<if (_XX > 0) && (_XY > 0) && (Math.abs(_XX-_XY) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers a @@.yellowgreen;mix@@ of whores that can appeal to varied tastes in genitalia.
				<</if>>
			<</if>>
			Most customers don't have preferences for either girls with dicks or girls with pussies.
			<<set _pref = 0>>
		<</if>>
		<<if (_XX > (_DL/2))>>
			<<set _girls = 1>>
			Most of the slaves in the brothel have female genitalia.
		<<elseif (_XY > (_DL/2))>>
			Most of the slaves in the brothel have male genitalia.
			<<set _girls = -1>>
		<<else>>
			<<set _girls = 0>>
			The slaves in the brothel vary in genitalia.
		<</if>>
		<<if _pref == 0>> /*customers don't care*/
		<<elseif ($brothelAdsSpending > 0) >>
			<<if (_ads == _pref) && (_girls == _ads)>>
				<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
				<<run cashX(_adsIncome, "brothelAds")>>
				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), "brothel")>>
			<<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 brothel are not as advertised. Your @@.red;reputation@@ dropped slightly as a result.
				<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
			<<elseif (_girls == _pref) && (_girls != _ads)>>
				The girls <<if _girls == 1>> with pussies<<elseif _girls == -1>> with dicks<</if>> in the brothel did not match the advertisements, but since the girls in the brothel 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)), "brothel")>>
			<</if>>
		<<else>>
			<<if (_girls == _pref)>>
				The girls in the brothel 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), "brothel")>>
			<<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)), "brothel")>>
			<</if>>
		<</if>>
	<</if>>

	<<if ($brothelAdsSpending > 0)>>
		<<switch ($brothelAdsOld)>>
			<<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>>
	<<if ($arcologies[0].FSMaturityPreferentialist != "unset") && ($arcologies[0].FSMaturityPreferentialist >= 80)>>
		Most customers prefer mature girls.
		<<set _pref = 1>>
	<<elseif ($arcologies[0].FSYouthPreferentialist != "unset") && ($arcologies[0].FSYouthPreferentialist >= 80)>>
		Most customers prefer young girls.
		<<set _pref = -1>>
	<<else>>
		<<if ($arcologies[0].FSMaturityPreferentialist == "unset") && ($arcologies[0].FSYouthPreferentialist == "unset")>>
			<<if ($brothelAdsSpending == 0) || ($brothelAdsOld == 0)>>
				<<set _possibleBonuses++>>
				<<if (_young > 0) && (_old > 0) && (Math.abs(_young-_old) <= (_DL/3))>>
					<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
					<<run cashX(_adsIncome, "brothelAds")>>
					The brothel offers girls @@.yellowgreen;both@@ young and mature.
				<</if>>
			<</if>>
		<</if>>
		Most customers don't have preferences for either mature or young girls.
		<<set _pref = 0>>
	<</if>>
	<<if (_young > (_DL/2))>>
		<<set _girls = -1>>
		Most of the slaves in the brothel are young.
	<<elseif (_old > (_DL/2))>>
		<<set _girls = 1>>
		Most of the slaves in the brothel are mature.
	<<else>>
		<<set _girls = 0>>
		The slaves in the brothel vary in age.
	<</if>>
	<<if _pref == 0>> /*customers don't care*/
	<<elseif ($brothelAdsSpending > 0) >>
		<<if (_ads == _pref) && (_girls == _ads)>>
			<<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>>
			<<run cashX(_adsIncome, "brothelAds")>>
			Its advertising matches most customers' age preferences and the girls in the brothel match the ages as advertised. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<elseif (_ads == _pref) && (_girls != _ads)>>
			Its advertising matched most customers age preferences, but the girls in the brothel are not as advertised. Your @@.red;reputation@@ dropped slightly as a result.
			<<run repX(forceNeg(random(_minBonus,_maxBonus)), "brothel")>>
		<<elseif (_girls == _pref) && (_girls != _ads)>>
			The ages of girls in the brothel did not match the ages as advertised, but since the girls in the brothel matched most customers age preferences, your reputation was not affected.
		<<elseif (_girls != _pref)>>
			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)), "brothel")>>
		<</if>>
	<<else>>
		<<if (_girls == _pref)>>
			The girls in the brothel match most customers' age preferences. Your @@.green;reputation@@ increased slightly as a result.
			<<run repX(random(_minBonus,_maxBonus), "brothel")>>
		<<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)), "brothel")>>
		<</if>>
	<</if>>

	<<if (_possibleBonuses > 0) && (_brothelBonuses >= _possibleBonuses)>>

		<<set _adsIncome = _DL*random(40,60), $facility.brothel.adsIncome += _adsIncome>>
		<<run cashX(_adsIncome, "brothelAds")>>
		There is a ''@@.yellowgreen;perfect variety@@'' of slave whores working in the brothel.
	<</if>>

	<<set _profits += $cash-_oldCash>>

	<>

	$brothelNameCaps makes you @@.yellowgreen;<<print cashFormat(_profits)>>@@ this week.

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

$brothelNameCaps's customers enjoyed @@.green;fucking whores in $brothelDecoration surroundings.@@
	<</if>>

	<<BrothelStatistics 0>>
	<<timed 50ms>>
		<<replace #brothelstats>>
			<<BrothelStatistics 1>>
		<</replace>>
	<</timed>>
<</if>>

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

<</if>>


code:
:: building widgets [nobr widget]

/%
Call as <<DisplayBuilding>>
Displays the arcology as a table.
Yes, I am aware this is horrible. If anyone can figure out how to get widgets to play nice with tables, or otherwise unfuck this, tell me and I'll implement it.
%/
<<widget "DisplayBuilding">>

<<set _Pass = passage()>>

<>

 /* Level 9, penthouse, sector 0 */

			<<link "Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>> @@.cyan;[P]@@
			<<if $masterSuite||$HGSuite||$dojo||$servantsQuarters||$spa||$nursery||$clinic||$schoolroom||$cellblock||$incubator||$researchLab.built=="true">>

				<<if $masterSuite>> <<print MasterSuiteUIName()>> ($masterSuiteSlaves/$masterSuite<<if $Concubine>>, C<</if>>)<</if>>
				<<if $HGSuite>> <<print HeadGirlSuiteUIName()>> <<if $HeadGirl != 0>>(HG<<if $HGSuiteSlaves > 0>>, 1)<<else>>)<</if>><</if>><</if>>
				<<if $dojo > 1>>[[Armory|BG Select]] <<if $Bodyguard != 0>>(BG)<</if>> <</if>>
				<<if $servantsQuarters>> <<print ServantQuartersUIName()>> ($servantsQuartersSlaves/$servantsQuarters<<if $Stewardess>>, L<</if>>)<</if>>
				<<if $spa>> <<print SpaUIName()>> ($spaSlaves/$spa<<if $Attendant>>, L<</if>>)<</if>>
				<<if $nursery>> <<print NurseryUIName()>> (<<if $nursery-$nurseryBabies == 0>>No empty rooms<<elseif $nursery-$nurseryBabies == 1>>1 empty room<<else>><<print $nursery-$nurseryBabies>> empty rooms<</if>>, $nurserySlaves/$nurseryNannies<<if $Matron>>, L<</if>>)<</if>>
				<<if $clinic>> <<print ClinicUIName()>> ($clinicSlaves/$clinic<<if $Nurse>>, L<</if>>)<</if>>
				<<if $schoolroom>> <<print SchoolRoomUIName()>> ($schoolroomSlaves/$schoolroom<<if $Schoolteacher>>, L<</if>>)<</if>>
				<<if $cellblock>> <<print CellblockUIName()>> ($cellblockSlaves/$cellblock<<if $Wardeness>>, L<</if>>)<</if>>
				<<if $incubator>> <<print IncubatorUIName()>> (<<if $incubator-$incubatorSlaves == 0>>No empty tanks<<elseif $incubator-$incubatorSlaves == 1>>1 empty tank<<else>><<print $incubator-$incubatorSlaves>> empty tanks<</if>>)<</if>>
				<<if $researchLab.built == "true">>[[Research Lab][$temp = 0]]<</if>>
			<</if>>

	<<if $arcologyUpgrade.spire == 1>>

 /* Level 8, spire, sectors 1-2 */

			<<for _i = 1; _i <= 2; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 7, spire, sectors 3-4 */

			<<for _i = 3; _i <= 4; _i++>><<sectorblock $sectors[_i] _i>><</for>>

	<</if>>

 /* Level 6, promenade, sectors 5-7 */

		<<for _i = 5; _i <= 7; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 5, apartments, sectors 8-11 */

		<<for _i = 8; _i <= 11; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 4, apartments, sectors 12-15 */

		<<for _i = 12; _i <= 15; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 3, apartments, sectors 16-19 */

		<<for _i = 16; _i <= 19; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 2, concourse, sectors 20-24 */
		<<for _i = 20; _i <= 24; _i++>><<sectorblock $sectors[_i] _i>><</for>>

 /* Level 1, service area, sectors 25-29 */
		<<for _i = 25; _i <= 29; _i++>><<sectorblock $sectors[_i] _i>><</for>>

<</widget>>

<<widget "SectorSell">>

<<set $price = 1000*Math.trunc($arcologies[0].prosperity*(1+($arcologies[0].demandFactor/100)))>>
Selling this sector would relinquish a 4% interest in $arcologies[0].name. Such an interest is worth <<print cashFormat($price)>>.
<<if $arcologies[0].ownership >= 4>>
	[[Sell|Main][cashX($price, "capEx"), $arcologies[0].ownership -= 4, $arcologies[0].demandFactor += 40, $sectors[$AS].ownership = 0]]
<</if>>

<</widget>>

/%
 Call as <<SectorCounts>>
 Updates $AProsperityCap, $Sweatshops.
%/
<<widget "SectorCounts">>

<<if $arcologyUpgrade.drones != 1>>
	<<set $AProsperityCap = 0>>
<<elseif $arcologyUpgrade.hydro != 1>>
	<<set $AProsperityCap = 10>>
<<elseif $arcologyUpgrade.apron != 1>>
	<<set $AProsperityCap = 30>>
<<elseif $arcologyUpgrade.grid != 1>>
	<<set $AProsperityCap = 60>>
<<elseif $arcologyUpgrade.spire != 1>>
	<<set $AProsperityCap = 100>>
<<else>>
	<<set $AProsperityCap = 150>>
<</if>>
<<set $Sweatshops = 0>>
<<if $arcologyUpgrade.spire == 1>>
	<<for _i = 1; _i <= 4; _i++>>
		<<if $sectors[_i].type == "DenseApartments">>
			<<set $AProsperityCap += 10>>
		<<elseif $sectors[_i].type == "LuxuryApartments">>
			<<set $AProsperityCap += 15>>
		<<else>>
			<<set $AProsperityCap += 10>>
		<</if>>
	<</for>>
<</if>>
<<for _i = 8; _i <= 19; _i++>>
	<<if $sectors[_i].type == "DenseApartments">>
		<<set $AProsperityCap += 10>>
	<<elseif $sectors[_i].type == "LuxuryApartments">>
		<<set $AProsperityCap += 15>>
	<<else>>
		<<set $AProsperityCap += 10>>
	<</if>>
<</for>>
<<for _i = 25; _i <= 29; _i++>>
	<<if $sectors[_i].type == "Sweatshops">>
		<<set $Sweatshops++>>
	<</if>>
<</for>>

<</widget>>

/%
 Call as <<UpdateOwnership>>
 Updates $arcologies[0].ownership.
%/
<<widget "UpdateOwnership">>

<<set $arcologies[0].ownership = 0>>
<<if $arcologyUpgrade.spire == 1>>
	<<for _i = 1; _i <= 29; _i++>>
		<<if $sectors[_i].ownership == 1>><<set $arcologies[0].ownership += 3.45>><</if>>
	<</for>>
	<<set $arcologies[0].ownership = Math.trunc($arcologies[0].ownership)>>
<<else>>
	<<for _i = 5; _i <= 29; _i++>>
		<<if $sectors[_i].ownership == 1>><<set $arcologies[0].ownership += 4>><</if>>
	<</for>>
<</if>>

<</widget>>


code:
:: Bulk Slave Generate [nobr]

<<set $newSlaves = [], $returnTo = "Main", $newSlavesDone = 0, $spent = 0, $newSlaveIndex = 0>>

<<if ndef $numSlaves>>
	<<set $numSlaves = 5>>
<</if>>
<<if ndef $numArcology>>
	<<set $numArcology = 1>>
<</if>>

/* Discount calculation. Gives 5% on top of slave school discount */
<<set $discount = 475>>
<<switch $slaveMarket>>
<<case "TSS">>
	<<if $TSS.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "GRI">>
	<<if $GRI.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "SCP">>
	<<if $SCP.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "LDE">>
	<<if $LDE.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "TGA">>
	<<if $TGA.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "HA">>
	<<if $HA.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "TCR">>
	<<if $TCR.schoolUpgrade != 0>>
		<<set $discount = 375>>
	<</if>>

<<case "TFS">>
	<<if $TFS.schoolUpgrade != 0>>
		<<set $discount = 300>>
	<<else>>
		<<set $discount = 380>>
	<</if>>

<<case "corporate">>
	<<if $corpMarket == 1>>
		<<set $discount = 350>>
	<</if>>

<<case "neighbor">>
	<<set $activeArcology = $arcologies[0]>>
	<<if $numArcology >= $arcologies.length>>
		<<set $numArcology = 1>>
	<</if>>
	<<set $targetArcology = $arcologies[$numArcology]>>
	<<include "Arcology Opinion">>
	<<set $opinion = Math.trunc($opinion/20)>>
	<<set $opinion = Math.clamp($opinion, -10, 10)>>
	<<set $discount -= ($opinion * 25)>>

<</switch>>

/* Determine if Law Compliance effects must be applied to this transaction */
<<switch $slaveMarket>>
<<case "indentures" "neighbor" "heap" "TSS" "GRI" "SCP" "LDE" "TGA" "HA" "TCR" "TFS" "wetware" "low tier criminals" "gangs and smugglers" "white collar" "military prison">> /* these markets are exempt from law compliance */
	<<set $applyLaw = 0>>
<<default>> /* all other markets are not exempt: corporate, hunters, kidnappers, raiders, trainers */
	<<set $applyLaw = 1>>
<</switch>>

<<for _i = 0; _i < $numSlaves; _i++>>
	<<silently>>
		<<GenerateMarketSlave $slaveMarket $numArcology>>
	<</silently>>
	<<set $slavesSeen += 1>>
	<<if $applyLaw == 0>>
		<<slaveCost $activeSlave>>
	<<else>>
		<<set _backup = $activeSlave>> /* backup newly generated slave */
		<<silently>>
			<<include "Law Compliance">> /* includes CheckForGingering - slave stats may change, affecting price */
		<</silently>>
		<<slaveCost $activeSlave>>
		<<run removeGingering()>> /* remove gingered state, if applied, so we can apply it again later */
		<<set $activeSlave = _backup>> /* restore backup so we can apply Law Compliance again later */
	<</if>>

	/* Adjust $slaveCost according to $slavesSeen */
	<<if $slavesSeen > $slaveMarketLimit>>
		<<set $slaveCost += $slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1)>>
		<<if $introType == "inStock">>
			<<break>>
		<</if>>
	<</if>>

	/* Apply discount modifier */
	<<set $slaveCost = $discount*Math.trunc($slaveCost/500)>>

	/* Charge the Player for the slave, or break out if cannot afford */
	<<if $cash < $slaveCost>>
		<<set _i = $numSlaves>>
		<<break>>
	<<else>>
		<<run cashX(forceNeg($slaveCost), "slaveTransfer", $activeSlave)>>
		<<set $newSlaves.push($activeSlave)>>
		<<set $spent += $slaveCost>>
	<</if>>
<</for>>

/* Max Buy clean-up */
<<if $numSlaves == 9999>>
	<<set $numSlaves = $newSlaves.length>>
<</if>>

/* increment Slave school purchase counts if needed */
<<switch $slaveMarket>>
<<case "TSS">>
	<<set $TSS.studentsBought += $newSlaves.length>>
<<case "GRI">>
	<<set $GRI.studentsBought += $newSlaves.length>>
<<case "SCP">>
	<<set $SCP.studentsBought += $newSlaves.length>>
<<case "LDE">>
	<<set $LDE.studentsBought += $newSlaves.length>>
<<case "TGA">>
	<<set $TGA.studentsBought += $newSlaves.length>>
<<case "HA">>
	<<set $HA.studentsBought += $newSlaves.length>>
<<case "TCR">>
	<<set $TCR.studentsBought += $newSlaves.length>>
<<case "TFS">>
	<<set $TFS.studentsBought += $newSlaves.length>>
<</switch>>

<<goto "Bulk Slave Intro">>


code:
:: Bulk Slave Intro [nobr]

<<if ndef $introType>>
	<<set $introType = "">>
<</if>>
<<if $newSlaves.length == 0>>
	<<set $introType = "">>
<</if>>

<<switch $introType>>
<<case "">>
	/* No message to give */
<<case "multi">>
	<<if $newSlaves.length > 1>>
		Your selection of $newSlaves.length slaves arrives from <<MarketNamePeriod $slaveMarket $numArcology>>
	<<else>>
		Your new slave from <<MarketName $slaveMarket $numArcology>> has arrived.
	<</if>>

<<case "bulk">>
	Your delivery of $newSlaves.length slaves arrives from <<MarketNamePeriod $slaveMarket $numArcology>>
	<<if $newSlaves.length != $numSlaves>>
		You were going to order $numSlaves, but $assistantName lowered it on financial grounds.
	<</if>>
	<<set _seed = Math.ceil($slavesSeen - $slaveMarketLimit)>>
	<<if _seed > $newSlaves.length>>
		You have cast such a wide net for slaves this week that all are more expensive than normal.
	<<elseif _seed > 0>>
		You have cast such a wide net for slaves this week that some (_seed) are more expensive than normal.
	<</if>>
	<<if $slaveMarket == "TFS">>
		/* Put line about The Futanari Sisters discount & pricing */
	<<elseif $discount == 475>>
		Your bulk delivery came with a @@.yellowgreen;5%@@ discount.
	<<else>>
		With all your discounts factored in you got a @@.yellowgreen;<<print (500-$discount)/5>>%@@ discount;
	<</if>>
	You spent @@.yellowgreen;<<print cashFormat($spent)>>@@ on your new slaves.

<<case "inStock">>
	You clear out <<MarketName $slaveMarket $numArcology>> of its stock of $newSlaves.length slaves.
	<<if $slaveMarket == "TFS">>
		/* Put line about The Futanari Sisters discount & pricing */
	<<elseif $discount == 475>>
		Your bulk delivery came with a @@.yellowgreen;5%@@ discount.
	<<else>>
		With all your discounts factored in you got a @@.yellowgreen;<<print (500-$discount)/5>>%@@ discount;
	<</if>>
	You spent @@.yellowgreen;<<print cashFormat($spent)>>@@ on your new slaves.

<<case "event">>
	This is placeholder event info.

<</switch>>
/* remove the below line to make the intro blurb show up for every slave, not just the first */
<<set $introType = "">>

<<if ($newSlaveIndex >= $newSlaves.length) || ($newSlavesDone == 1)>>
	<<if $newSlaves.length > 0>>
		/* Push the induction changes for the final slave to the newSlave array */
		<<run newSlave($activeSlave)>>

		/* Variable Clean-up */
		<<set $newSlaves = []>>
		<<set $newSlavesDone = 0>>
		<<set $introType = "">>
	<</if>>
	<<goto $returnTo>>
<<else>>
	/* If looking at 2nd slave, push the induction changes for the prior slave to the newSlave array */
	<<if $newSlaveIndex > 0>>
		<<run newSlave($activeSlave)>>
	<</if>>
	<<if $newSlaves.length > 1>>
		Showing new slave <<print $newSlaveIndex+1>> of <<print $newSlaves.length>>:
	<</if>>

	/* Set activeSlave to the desired newSlave so that existing code can be used */
	<<set $activeSlave = $newSlaves[$newSlaveIndex]>>

	/* Due to possible gingering, the Long Slave Description must be displayed before the New Slave Intro */
	<<set $saleDescription = 1>> /* policies were applied earlier, if needed */
	<<include "Long Slave Description">>

	/* Use existing New Slave Intro */
	<<include "New Slave Intro">> /* calls removeGingering() if needed */

	/* Override nextButton setting from New Slave Intro */
	<<set $nextButton = "Continue">>
	<<set $nextLink = "Bulk Slave Intro">>

	/* Add an option = goto the next slave below the New Slave Intro section */

	<<if $newSlaveIndex < ($newSlaves.length - 1)>>
		[[Next Slave|Bulk Slave Intro]]
	<<else>>
		[[Finish introducing slaves|Bulk Slave Intro][$newSlavesDone = 1]]
	<</if>>

<</if>> /* Closes no new Slaves check */

<<set $newSlaveIndex++>>