code:
:: Madam Select [nobr]

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

$He will manage the brothel.
<<else>>
	You have not selected a Madam.
<</if>>

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

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

<<assignmentFilter>>

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

repo_name: Mizako/fc


code:
:: Madam Workaround [silently]

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

<<goto "Brothel">>


code:
:: Main [nobr]

<<unset $Flag>>
<<resetAssignmentFilter>>
<<if $releaseID >= 1000 || $ver.includes("0.9") || $ver.includes("0.8") || $ver.includes("0.7") || $ver.includes("0.6")>>
	<<if $releaseID >= 1031>>
	<<elseif $releaseID < 1031>>
		''@@.red;INCOMPATIBILITY WARNING:@@'' your saved game was created using version $ver build $releaseID. Due to a major overhaul to intelligence and education, it is advisable to run backwards compatibility.
	<<elseif $releaseID >= 1022 && ndef $SF>>
		''@@.red;INCOMPATIBILITY WARNING:@@'' your saved game was created using version $ver build $releaseID. Due to a major changes to the Security Force Mod, you must run backwards compatibility.
	<<elseif $releaseID >= 1022>>
	<<elseif $releaseID >= 1019>>
		''@@.red;INCOMPATIBILITY WARNING:@@'' your saved game was created using version $ver build $releaseID. Due to a major change to nationality weighting, you must run backwards compatibility.
	<<else>>
		''@@.red;INCOMPATIBLE SAVE WARNING:@@'' your saved game was created using version $ver build $releaseID. Please select New Game Plus from the Options menu or start a new game.

	<</if>>
<<else>>
	''@@.red;INCOMPATIBLE SAVE WARNING:@@'' your saved game was created using version $ver and you are using later version which New Game Plus cannot reconcile. Please start a new game.

<</if>>
<<if $defaultRules.length > 0 && ($defaultRules[0].condition == undefined || $defaultRules[0].set == undefined)>>
	''@@.red;INCOMPATIBILITY WARNING:@@'' the rules assistant format has changed. In the Options Menu, please ''Reset RA Rules''
<</if>>

<<if def $organsCompleted>>
	<<unset $organsCompleted>>
<</if>>

<<set $currentRule = $defaultRules[0]>>

<<SlaveSort $slaves>>

<<set _SL = $slaves.length>>

/* extra sanity checks and repair */
<<if $slaves.includes(null)>>

@@.red;ERROR: Main slaves array contains a null entry! Please report this.@@ <<link "Repair">><<set $slaves.delete(null)>><</link>><<goto "Main">>

<</if>>

<<if $NaNArray.length > 0>>

@@.red; ERROR: The following variables are NaN! Please report this.@@

	<<for _main = 0; _main < $NaNArray.length; _main++>>
		$NaNArray[_main]

	<</for>>
	<<link "Hide NaN variables until next week">><<replace #NaNArray>><<set $NaNArray = []>><</replace>><</link>>

<</if>>

/* end extra sanity checks and repair */

<<set _duplicateSlaves = _($slaves).countBy(s => s.ID).pickBy(v => v > 1).keys().map(v => Number(v)).value()>>
<<foreach _i of _duplicateSlaves>>

@@.red;Duplicate slave ID _i at indices
	<<= _($slaves).map((s, idx) => ({ID: s.ID, idx: idx, name: s.slaveName, assignment: s.assignment})).filter(s => s.ID === _i).map(s => s.idx + ' - ' + s.name + ' (' + s.assignment + ')').join(', ')>>@@
<</foreach>>
<<set _visibleSlaves = $slaves.filter(s => s.assignmentVisible == 1 && (s.assignment != "be your Head Girl" || $HGSuite != 1) && (s.assignment != "guard you" || $dojo <= 1)),
	$slavesVisible = _visibleSlaves.length,
	$dormitoryPopulation = _visibleSlaves.filter(s => s.livingRules != "luxurious").length,
	$roomsPopulation = $slavesVisible - $dormitoryPopulation - _visibleSlaves.filter(s => s.livingRules == "luxurious" && s.relationship >= 4).length * 0.5,
	_PA = (Array.isArray($personalAttention) ? $personalAttention.map(function(x) { return getSlave(x.ID); }) : []),
	_HG = $slaveIndices[$HeadGirl.ID],
	_RC = $slaveIndices[$Recruiter.ID],
	_BG = $slaveIndices[$Bodyguard.ID]>>

<<if (def _HG && $HGSuite > 0)>><<set $slavesVisible++>><</if>>
<<if ($HGSuiteSlaves > 0)>><<set $slavesVisible++>><</if>>
<<if (def _BG && $dojo > 1)>><<set $slavesVisible++>><</if>>

<<set $nextButton = "END WEEK", $nextLink = "End Week", $showEncyclopedia = 1, $encyclopedia = "How to Play">>
<<set $costs = Math.trunc(predictCost($slaves))>>

<<if ($PC.customTitle == "")>>
	<<set $PC.customTitle = undefined, $PC.customTitleLisp = undefined>>
<</if>>

/* Saves use the first eight printed words to make the "file name", the below line cheats and makes saves here nicer named. */
@@font-size: 0; $arcologies[0].name, Week $week, $slaves.length Slaves, <<print cashFormat($cash)>> … … … @@

<<if $newModelUI == 1>><<DisplayBuilding>><</if>>
<<if $seeArcology == 1>>    <<include "Arcology Description">> | [[Hide|Main][$seeArcology = 0]]
<</if>>

<<if $seeDesk == 1>>
<<include "Office Description">>
[[Hide|Main][$seeDesk = 0]]
<</if>>
<<if $seeFCNN == 1>>FCNN: <<print $fcnn.random()>> [[Hide|Main][$seeFCNN = 0]]<</if>>
<<if ($seeDesk == 1) && ($seeFCNN == 0)>>
<</if>>

/* Check if custom rules have an assignation operator */
<<set _RL = $defaultRules.length>>
<<set _regex = /[^!=<>]=[^=<>]/gi>>
<<set $rulesError = false>>
<<for _itr = 0; _itr < _RL; _itr++>>
	<<if $defaultRules[_itr].condition.function == "custom" && $defaultRules[_itr].condition.data.match(_regex)>>
		<<set $rulesError = true>>
		<<break>>
	<</if>>
<</for>>

__''MAIN MENU''__    //[[Summary Options]]//
<<if $rulesAssistantMain != 0>>
	| //<<link "Rules Assistant Options" "Rules Assistant">><</link>>// @@.cyan;[R]@@
	<<if $rulesAssistantAuto != 1>>
		| //<<link "Apply Rules Assistant at week end" "Main">><<set $rulesAssistantAuto = 1>><</link>>//
	<<else>>
		| //<<link "Stop applying Rules Assistant at week end" "Main">><<set $rulesAssistantAuto = 0>><</link>>//
	<</if>>
	| //<<if $rulesError>>@@.yellow; WARNING: some custom rules will change slave variables @@<</if>><<link "Re-apply Rules Assistant now (this will only check slaves in the Penthouse)" "Main">><<for _i = 0;_i < _SL;_i++>><<if $slaves[_i].assignmentVisible == 1 && $slaves[_i].useRulesAssistant == 1>><<= DefaultRules($slaves[_i])>><</if>><</for>><</link>>//
<</if>>

<<if $useSlaveSummaryTabs == 1>>
	<<if $positionMainLinks >= 0>>

		<<= App.UI.View.MainLinks()>>

	<</if>>
	<<set _j = "Back", _k = "AS Dump", _l = "Main">>

		<<set _penthouseSlaves = 0>>
		<<run Object.keys($JobIDArray).forEach((job) => _penthouseSlaves += $JobIDArray[job].length)>>
		<<if $useSlaveSummaryOverviewTab == 1>>
		<button class="tablinks" onclick="opentab(event, 'overview')" id="tab overview">Overview</button>
		<</if>>
		<button class="tablinks" onclick="opentab(event, 'resting')" id="tab resting"> /*leaving resting always on as it changes a lot from week to week. */
			Resting
			<<if $JobIDArray['rest'].length > 0>>
				($JobIDArray['rest'].length)
			<</if>>
		</button>
		<<if $JobIDArray['stay confined'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'stay confined')" id="tab stay confined">
				Confined
				($JobIDArray['stay confined'].length)
			</button>
		<</if>>
		<<if $JobIDArray['take classes'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'take classes')" id="tab take classes">
				Students
				($JobIDArray['take classes'].length)
			</button>
		<</if>>
		<<if $JobIDArray['please you'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'please you')" id="tab please you">
				Fucktoys
				($JobIDArray['please you'].length)
			</button>
		<</if>>
		<<if $JobIDArray['whore'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'whore')" id="tab whore">
				Whores
				($JobIDArray['whore'].length)
			</button>
		<</if>>
		<<if $JobIDArray['serve the public'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'serve the public')" id="tab serve the public">
				Public Servants
				($JobIDArray['serve the public'].length)
			</button>
		<</if>>
		<<if $JobIDArray['be a servant'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'be a servant')" id="tab be a servant">
				Servants
				($JobIDArray['be a servant'].length)
			</button>
		<</if>>
		<<if $JobIDArray['get milked'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'get milked')" id="tab milked">
				Cows
				($JobIDArray['get milked'].length)
			</button>
		<</if>>
		<<if $JobIDArray['work a glory hole'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'work a glory hole')" id="tab work a glory hole">
				Gloryhole
				($JobIDArray['work a glory hole'].length)
			</button>
		<</if>>
		<<if $JobIDArray['be a subordinate slave'].length > 0>>
			<button class="tablinks" onclick="opentab(event, 'be a subordinate slave')" id="tab be a subordinate slave">
				Subordinate slaves
				($JobIDArray['be a subordinate slave'].length)
			</button>
		<</if>>

		<button class="tablinks" onclick="opentab(event, 'all')" id="tab all">
			All
			<<if _penthouseSlaves > 0>>
				<<if $HeadGirl != 0>>
					<<set _penthouseSlaves++>>
				<</if>>
				<<if $Recruiter != 0>>
					<<set _penthouseSlaves++>>
				<</if>>
				<<if $Bodyguard != 0>>
					<<set _penthouseSlaves++>>
				<</if>>
				(_penthouseSlaves)
			<</if>>
		</button>

			<<set $slaveAssignmentTab = "overview">>
			<<if def _HG>>
				''__@@.pink;<<= SlaveFullName($HeadGirl)>>@@__'' is serving as your Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>.
				<<link "Manage Head Girl" "HG Select">><</link>> @@.cyan;[H]@@
				<<set $showOneSlave = "Head Girl">>
				<<include "Slave Summary">>
			<<elseif (ndef _HG) && ($slaves.length > 1)>>
				You have @@.red;not@@ selected a Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>. <<link "Select one" "HG Select">><</link>> @@.cyan;[H]@@
			<<elseif (ndef _HG)>>
				//You do not have enough slaves to keep a Head Girl//
			<</if>>

			<<if def _RC>>
				<<setLocalPronouns $slaves[_RC]>>
				''__@@.pink;<<= SlaveFullName($Recruiter)>>@@__'' is working
				<<if $recruiterTarget != "other arcologies">>
					to recruit girls.
				<<else>>
					as a Sexual
					<<if $arcologies[0].influenceTarget == -1>>
						Ambassador, but @@.red;$he has no target to influence.@@
					<<else>>
						Ambassador to <<for $i = 0; $i < $arcologies.length; $i++>><<if $arcologies[$i].direction == $arcologies[0].influenceTarget>>$arcologies[$i].name<<break>><</if>><</for>>.
					<</if>>
				<</if>>
				<<link "Manage Recruiter" "Recruiter Select">><</link>> @@.cyan;[U]@@
				<<set $showOneSlave = "recruit girls">>
				<<include "Slave Summary">>
			<<else>>
				You have @@.red;not@@ selected a Recruiter.
				<<link "Select one" "Recruiter Select">><</link>> @@.cyan;[U]@@
			<</if>>
			<<if ($dojo != 0)>>

				<<if def _BG>>
					''__@@.pink;<<= SlaveFullName($Bodyguard)>>@@__'' is serving as your bodyguard. <<link "Manage Bodyguard" "BG Select">><</link>> @@.cyan;[B]@@
					<<set $showOneSlave = "guard you">>
					<<include "Slave Summary">>
				<<else>>
					You have @@.red;not@@ selected a Bodyguard. <<link "Select one" "BG Select">><</link>> @@.cyan;[B]@@
				<</if>>

				/* Start Italic event text */
				<<if (def _BG) && ($slaves[_BG].assignment == "guard you")>>
					<<setLocalPronouns $slaves[_BG]>>
					<<set $i = _BG>>
					<<set _GO = "idiot ball">>

					//<<= App.Interact.UseGuard($slaves[$i])>>//

    [["Use "+$his+" mouth"|FLips][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
					| [["Play with "+$his+" tits"|FBoobs][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
					<<if canDoVaginal($slaves[_BG])>>
						| [["Fuck "+$him|FVagina][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
						<<if canDoAnal($slaves[_BG])>>
							| [["Use "+$his+" holes"|FButt][$activeSlave = $slaves[_BG],$nextButton = _j, $nextLink = _k, $returnTo = _l]]
						<</if>>
						<<if $slaves[_BG].belly >= 300000>>
							| [["Fuck "+$him+" over "+$his+" belly"|FBellyFuck][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
						<</if>>
					<</if>>
					/*check*/
					<<if canPenetrate($slaves[_BG])>>
						| [["Ride "+$him|FDick][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
					<</if>>
					<<if canDoAnal($slaves[_BG])>>
						| [["Fuck "+$his+" ass"|FAnus][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
					<</if>>
					| [["Abuse "+$him|Gameover][$gameover = _GO]]
				<</if>>
				/* End Italic event text */

			<</if>>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryRest>>
				Associated facilities:
				<<if $spa>>[[Spa]],<<else>>Spa,<</if>>
				<<if $clinic>>[[Clinic]]<<else>>Clinic<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "resting">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryConfinement>>
				Associated facility: <<if $cellblock>>[[Cellblock]]<<else>>Cellblock<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "stay confined">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryAttendingClasses>>
				Associated facility: <<if $schoolroom>>[[Schoolroom]]<<else>>Schoolroom<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "take classes">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryFucktoy>>
				Associated facility: <<if $masterSuite>>[[Master Suite]]<<else>>Master Suite<</if>> //
			<</if>>

			/* Start Italic event text */
			<<for $i = 0; $i < _SL; $i++>>
				<<capture $i>>
				<<setLocalPronouns $slaves[$i]>>
				<<if ($slaves[$i].assignment == "please you")>>

					//<<= App.Interact.ToyChest($slaves[$i])>>//
					//In the coming week you plan to concentrate on
					<<if $slaves[$i].fuckdoll == 0>>
						<<if $slaves[$i].toyHole != "all her holes">>
							$his $slaves[$i].toyHole, but for now://
						<<else>>
							all of $his holes equally, but for now://
						<</if>>

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

			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "please you">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryWhoring>>
				Associated facility: <<if $brothel>>[[Brothel]]<<else>>Brothel<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "whore">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryPublicService>>
				Associated facility: <<if $club>>[[Club]]<<else>>Club<</if>> //
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "serve the public">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryServitude>>
				Associated facility: <<if $servantsQuarters>>[[Servants' Quarters]]<<else>>Servant's Quarters<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "be a servant">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryMilking>>
				Associated facility: <<if $dairy>>[[Dairy]]<<else>>Dairy<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "get milked">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryFarming>>
				Associated facility: <<if $farmyard>>[[Farmyard]]<<else>>Farmyard<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "work as a farmhand">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntryGloryHole>>
				Associated facility: <<if $arcade>>[[Arcade]]<<else>>Arcade<</if>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "work a glory hole">>
			<<include "Slave Summary">>

			<<if $showTipsFromEncy != 0>>
				//<<encyclopediaEntrySexualServitude>>//
			<</if>>
			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "be a subordinate slave">>
			<<include "Slave Summary">>

			//<<OptionsSortAsAppearsOnMain>>//
			<<set $slaveAssignmentTab = "all">>
			<<include "Slave Summary">>

			<<if (ndef _HG) && ($slaves.length > 1)>>
				You have @@.red;not@@ selected a Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>. <<link "Select one" "HG Select">><</link>> @@.cyan;[H]@@
			<<elseif (ndef _HG)>>
				//You do not have enough slaves to keep a Head Girl//
			<</if>>

			<<if ndef _RC>>
				You have @@.red;not@@ selected a Recruiter.
				<<link "Select one" "Recruiter Select">><</link>> @@.cyan;[U]@@
			<</if>>
			<<if ($dojo != 0)>>

				<<if ndef _BG>>
					You have @@.red;not@@ selected a Bodyguard. <<link "Select one" "BG Select">><</link>> @@.cyan;[B]@@
				<</if>>
			<</if>>

	<<if ($tabChoice.Main == "overview")>>

	<<elseif ($tabChoice.Main == "resting")>>

	<<elseif ($tabChoice.Main == "stay confined" && $JobIDArray['stay confined'].length)>>

	<<elseif ($tabChoice.Main == "take classes") && $JobIDArray['take classes'].length>>

	<<elseif ($tabChoice.Main == "please you") && $JobIDArray['please you'].length>>

	<<elseif ($tabChoice.Main == "whore" && $JobIDArray['whore'].length)>>

	<<elseif ($tabChoice.Main == "serve the public") && $JobIDArray['serve the public'].length>>

	<<elseif ($tabChoice.Main == "be a servant") && $JobIDArray['be a servant'].length>>

	<<elseif ($tabChoice.Main == "get milked") && $JobIDArray['get milked'].length>>

	<<elseif ($tabChoice.Main == "work a glory hole") && $JobIDArray['work a glory hole'].length>>

	<<elseif ($tabChoice.Main == "be a subordinate slave") && $JobIDArray['be a subordinate slave'].length>>

	<<elseif ($tabChoice.Main == "all")>>

	<<else>>

	<</if>>

	<<if $positionMainLinks <= 0>>

		<<= App.UI.View.MainLinks()>>

	<</if>>

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

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

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

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

<<if $positionMainLinks >= 0>>

	<<= App.UI.View.MainLinks()>>

<</if>>

/* TASK ARRAY */
<<set $jobTypes = [{title: "Rest", asgn: "rest"}, {title: "Subordinate", asgn: "be a subordinate slave"}, {title: "Whore", asgn: "whore"}, {title: "Public Servant", asgn: "serve the public"}, {title: "Hole", asgn: "work a glory hole"}, {title: "Milking", asgn: "get milked"}, {title: "House Servant", asgn: "be a servant"}, {title: "Fucktoy", asgn: "please you"}, {title: "Confinement", asgn: "stay confined"}, {title: "Classes", asgn: "take classes"}, {title: "Choose own", asgn: "choose her own job"}]>>

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

<<include "Slave Summary">>

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

	<<= App.UI.View.MainLinks()>>

<</if>>

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

	//<<= App.Interact.ToyChest($slaves[$i])>>//
	//In the coming week you plan to concentrate on
	<<if $slaves[$i].fuckdoll == 0>>
		<<if $slaves[$i].toyHole != "all her holes">>
			$his $slaves[$i].toyHole, but for now://
		<<else>>
			all of $his holes equally, but for now://
		<</if>>

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

<<if (def _BG) && ($slaves[_BG].assignment == "guard you") && ($useSlaveSummaryOverviewTab != 1)>>
	<<set $i = _BG>>
	<<setLocalPronouns $slaves[$i]>>
	<<set _GO = "idiot ball">>

	//<<= App.Interact.UseGuard($slaves[$i])>>//

    [["Use "+$his+" mouth"|FLips][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
	| [["Play with "+$his+" tits"|FBoobs][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
	<<if canDoVaginal($slaves[_BG])>>
		| [["Fuck "+$him|FVagina][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
		<<if canDoAnal($slaves[_BG])>>
			| [["Use "+$his+" holes"|FButt][$activeSlave = $slaves[_BG],$nextButton = _j, $nextLink = _k, $returnTo = _l]]
		<</if>>
		<<if $slaves[_BG].belly >= 300000>>
			| [["Fuck "+$him+" over "+$his+" belly"|FBellyFuck][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
		<</if>>
	<</if>>
	/*check*/
	<<if canPenetrate($slaves[_BG])>>
		| [["Ride "+$him|FDick][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
	<</if>>
	<<if canDoAnal($slaves[_BG])>>
		| [["Fuck "+$his+" ass"|FAnus][$activeSlave = $slaves[_BG], $nextButton = _j, $nextLink = _k, $returnTo = _l]]
	<</if>>
	| [["Abuse "+$him|Gameover][$gameover = _GO]]
<</if>>

<<set $activeSlave = $slaves.random()>>
<<if $activeSlave && ($activeSlave.assignment != "please you") && ($activeSlave.assignment != "guard you")>>

//<<include "Walk Past">>//
<</if>>


code:
:: Manage Arcology [nobr]

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

<<if $cheatMode == 1>>

//[[Cheat Edit Arcology|MOD_Edit Arcology Cheat][$cheater = 1]]//

<</if>>
<<set $showEncyclopedia = 0>>

<<DisplayBuilding>>
<<include "Arcology Description">>

__Arcology Ownership__

<<UpdateOwnership>>
You own ''$arcologies[0].ownership%'' of $arcologies[0].name, <<if $arcologies[0].minority > 0>>against ''$arcologies[0].minority%'' owned by the second most significant holder<<else>>and there are no other significant holders<</if>>.
<<if $arcologies[0].minority > $arcologies[0].ownership-10>>
	@@.red;This is a dangerously narrow margin of control.@@
<</if>>

<<if $FSAnnounced > 0>>
	<<if $FSCredits > 0>>

		@@.yellow;$arcologies[0].name's society is ready to begin accepting a new societal direction.@@
	<</if>>
<</if>>

__Construction__

<<if $arcologyUpgrade.drones != 1>>
	//The first major upgrade needed is the installation of a drone security system so higher-class citizens will feel safe and protected should they choose to immigrate. This upgrade will cost <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>.// [[Install drone security system|Manage Arcology][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $arcologyUpgrade.drones = 1, $secBots.active = 1, $secBots.troops = 30, $secBots.maxTroops = 30, $PC.engineering += 1]]
<<elseif $arcologyUpgrade.hydro != 1>>
	//The next major upgrade needed is the installation of a better water reclamation system so your residents will have access to cheaper water and hydroponically grown food. This upgrade will cost <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>.// [[Upgrade water reclamation system|Manage Arcology][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $arcologyUpgrade.hydro = 1, $PC.engineering += 1]]
<<elseif $arcologyUpgrade.apron != 1>>
	//The next major upgrade needed is the installation of a broader apron at the bottom of the arcology to increase its surface area and gather more solar energy. Right now, tenants that use a lot of power have to import it from outside. This upgrade will cost <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>.// [[Install solar apron|Manage Arcology][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $arcologyUpgrade.apron = 1, $PC.engineering += 1]]
<<elseif $arcologyUpgrade.grid != 1>>
	//The next major upgrade needed is an improvement of the arcology's electrical transmission lines to make efficient use of the additional power from the solar apron. This upgrade will cost <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>.// [[Upgrade transmission lines|Manage Arcology][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $arcologyUpgrade.grid = 1, $PC.engineering += 1]]
<<elseif $arcologyUpgrade.spire != 1>>
	//The next major upgrade needed is the addition of a spire at the top of the arcology to increase the space available for the wealthiest citizens to own whole floors. This huge project will cost <<print cashFormat(Math.trunc(250000*$upgradeMultiplierArcology))>>.// [[Add spire|Manage Arcology][cashX(forceNeg(Math.trunc(250000*$upgradeMultiplierArcology)), "capEx"), $arcologyUpgrade.spire = 1, $sectors[1].type = "Apartments", $sectors[2].type = "Apartments", $sectors[3].type = "Apartments", $sectors[4].type = "Apartments", $sectors[1].ownership = 1, $sectors[2].ownership = 1, $sectors[3].ownership = 1, $sectors[4].ownership = 1, $PC.engineering += 1]]
<<else>>
	//The arcology's public areas are fully upgraded.//
<</if>>

<<if $weatherCladding == 0>>
	//Extreme weather is becoming common worldwide. The arcology's exterior can be hardened to reduce damage in case of heavy weather, but this will reduce its beauty somewhat and will cost <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>. Your citizens are <<if $weatherAwareness == 0>>likely to disapprove of this measure as alarmism.<<else>>@@.yellow;concerned that this measure has not been taken already.@@<</if>> // [[Apply weather cladding|Manage Arcology][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $weatherCladding = 1, $PC.engineering += 1]]
<<elseif $weatherCladding == 1 && $arcologyUpgrade.spire == 1>>
	The arcology's exterior is jacketed with unsightly but sturdy weather cladding. Your arcology is so prosperous that remodeling the cladding into something beautiful is within the realm of possibility. This massive project will cost <<print cashFormat(Math.trunc(3500000*$upgradeMultiplierArcology))>> and without a doubt render your arcology one of the wonders of the world.
	[[Remodel weather cladding|Manage Arcology][cashX(forceNeg(Math.trunc(3500000*$upgradeMultiplierArcology)), "capEx"), $weatherCladding = 2, $PC.engineering += 1]]
<<elseif $weatherCladding == 1>>
	//The arcology's exterior is jacketed with unsightly but sturdy weather cladding.//
<<elseif $weatherCladding == 2>>
	//The arcology's exterior is jacketed with gorgeously sculpted and fully functional weather cladding.//
<</if>>

<<if ($receiverAvailable == 1) && ($FCTVenable != 0) && ($FCTVreceiver == 0)>>
	You have not installed an FCTV receiver.
	Installing this receiver yourself will cost <<print cashFormat(Math.trunc(25000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>.
	You can have your citizens pay for the fiberoptic upgrades, reducing the cost to <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>.
	You can also have them heavily subsidize installation, they will be upset about it, but it will only cost <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>.

	[[No subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(25000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTVreceiver = 1, $receiverAvailable = $week, repX(500, "capEx"), $PC.hacking += 1]] | [[Light subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTVreceiver = 1, $receiverAvailable = $week, $PC.hacking += 1]] | [[Heavy subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTVreceiver = 1, $receiverAvailable = $week, repX(-1500, "capEx"), $PC.hacking += 1]]
<<elseif ($FCTVreceiver == 3)>>
	You have installed the FCTV receiver and have access to the full range of FCTV's programs. High viewership rates amongst your citizens makes it easier to pursue your societal goals.
<<elseif ($FCTVreceiver == 2)>>
	You have installed the FCTV receiver and have access to the full range of FCTV's programs. Decent viewership rates amongst your citizens makes it somewhat easier to pursue your societal goals.
<<elseif ($FCTVreceiver == 1)>>
	You have installed the FCTV receiver and have access to the full range of FCTV's programs. Low viewership rates amongst your citizens limits the impact of FCTV on your societal goals.
<</if>>

<<if $secExp == 0>>
	<<if $weatherAwareness > 0>>
		<<if $antiWeatherFreeze == 0>>

The extreme weather hurts your arcology's ability to function. Reinforcing your passenger terminals increase the weather range at which they can operate.

			Reinforcing passenger terminals costs <<print cashFormat(50000)>> and increase upkeep. [[Reinforce|Manage Arcology][$antiWeatherFreeze = 1, cashX(-50000, "capEx")]]
		<<elseif $antiWeatherFreeze == 1>>

You have reinforced your passenger terminals to function even during bad weather. You can invest into all-weather transportation to remain functional no matter what.

			Investing in all-weather transportation costs <<print cashFormat(100000)>> and increase upkeep. [[Invest|Manage Arcology][$antiWeatherFreeze = 2, cashX(-100000, "capEx")]]
		<<elseif $antiWeatherFreeze == 2>>

Your arcology's passenger terminals remain fully operational even during the most extreme weather.
		<</if>>
	<</if>>
<</if>>

<<if $secExp == 1>>

	__Security__
	<<if $propHub == 0>>

		[[Set up the propaganda Hub|Manage Arcology][cashX(forceNeg(Math.trunc((5000*$upgradeMultiplierArcology*$HackingSkillMultiplier))), "capEx"), $propHub = 1, $PC.engineering += 1, $PC.hacking += 1,$RecuriterOffice = 0]]
		//Costs <<print cashFormat(Math.trunc((5000*$upgradeMultiplierArcology*$HackingSkillMultiplier)))>>.//

//Building specialized in the management of authority.//
	<<else>>

		The [[Propaganda Hub|propagandaHub]] is ready to manipulate reality on your command.
	<</if>>
	<<if $secHQ == 0>>

		[[Set up the security headquarters|Manage Arcology][cashX(forceNeg(Math.trunc((5000*$upgradeMultiplierArcology*$HackingSkillMultiplier))), "capEx"), $secHQ = 1, $PC.engineering += 1, $PC.hacking += 1]]
		//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>.//

//Building specialized in the management of security and crime.//
	<<else>>

		The [[security HQ|securityHQ]] is constantly working to protect your arcology.
	<</if>>

	<<if $secBarracks == 0>>

		[[Set up the barracks|Manage Arcology][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $secBarracks = 1, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//

//Building specialized in the management of armed forces.//
	<<else>>

		The [[barracks|secBarracks]] patiently await your orders.
	<</if>>

	<<if $riotCenter == 0 && $rebellionsEnabled == 1>>

		[[Set up the riot control center|Manage Arcology][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $riotCenter = 1, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
		<<if $PC.engineering < 100>>  <<= IncreasePCSkills('engineering', 0.1)>> <</if>>

//Building specialized in the management and suppression of rebellions.//
	<<elseif $rebellionsEnabled == 1>>

		The [[Riot Control Center|riotControlCenter]] stands ready for action.
	<</if>>
<</if>>

<<if ($PC.engineering >= 100) || ($PC.career == "arcology owner")>>

//Arcology upgrades are less expensive due to your @@.springgreen;<<if $PC.career == "arcology owner">>experience in the Free Cities<<else>>arcology engineering training<</if>>.@@//
<</if>>

<<if $difficultySwitch == 1>>

	__Disaster Repsonse__

	<<if $econWeatherDamage > 0>>
		The recent terrible weather has damaged the local infrastructure. It is @@.red;reducing the local economy score by <<print $econWeatherDamage>>.@@
		<<if $disasterResponse == 0>>

Locals will do their best to repair the damage on their own, but setting up a disaster response unit
will improve the recovery of infrastructure critical for keeping goods, people and information flowing smoothly in and out of your arcology.

Creating the unit will cost <<print cashFormat(50000)>> and incur upkeep. [[Create Disaster Response Unit|Manage Arcology][cashX(-50000, "capEx"), $disasterResponse = 1]]
		<<elseif $disasterResponse == 1>>

You are sending your disaster response unit to repair critical infrastructure. They are doing what they can.

The unit can be made more effective with an additional investment of <<print cashFormat(100000)>>. This will also increase upkeep. [[Improve Disaster Response Unit|Manage Arcology][cashX(-100000, "capEx"), $disasterResponse = 2]]
		<<else>>

Your highly capable disaster response unit is rapidly repairing the weather damage.
		<</if>>
	<<elseif $disasterResponse > 0>>
		Your disaster response unit is idle. It will not cost you any upkeep this week.
	<</if>>
<</if>>

<<if $foodMarket > 0>>

<<include "Food Market">>
<</if>>

__Sexual Service Policies__

If so desired, your assistant can help you manipulate the business environment within your arcology.

Currently outside parties are providing <<print $NPCMarketShareLC/10>>% of the sexual services.

<<if $NPCSexSubsidiesLC == 0>>
	You can provide a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 1]]

<<elseif $NPCSexSubsidiesLC == 1>>
	You are providing a minor subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Cancel Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 0]] | [[Moderate Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 2]]

<<elseif $NPCSexSubsidiesLC == 2>>
	You are providing a moderate subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Minor Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 1]] | [[Substantial Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 3]]

<<elseif $NPCSexSubsidiesLC == 3>>
	You are providing a substantial subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Moderate Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 2]] | [[Gratuitous Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 4]]

<<else>>
	You are providing a gratuitous subsidy for those selling sexual services to the lower class. //Upkeep is relative to the amount of sex provided by other parties// [[Substantial Subsidy|Manage Arcology][$NPCSexSubsidiesLC = 3]]

<</if>>
<<if $sexSupplyBarriersLC == 0>>
	You can make things more difficult for those supplying sexual services in the lower class segment if you are willing to spend 1000 reputation and pay a flat upkeep of @@.yellowgreen;<<print cashFormat(1000)>>.@@ <<if $rep > 1000>>[[Create Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 1, repX(-1000, "policies")]] <<else>>//You are not reputable enough//<</if>>
<<elseif $sexSupplyBarriersLC == 1>>
	You have forced some unneeded beauraucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the beauraucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(5000)>>.@@ <<if $rep > 1000>>[[Abolish Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 0, repX(-1000, "policies")]] | [[Increase Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 2, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
<<elseif $sexSupplyBarriersLC == 2>>
	You have forced considerable beauraucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the beauraucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(20000)>>.@@ <<if $rep > 1000>>[[Reduce Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 1, repX(-1000, "policies")]] | [[Increase Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
<<elseif $sexSupplyBarriersLC == 3>>
	You have forced stiffling beauraucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. Increasing the beauraucracy further will cost a flat upkeep of @@.yellowgreen;<<print cashFormat(60000)>>.@@ <<if $rep > 1000>>[[Reduce Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 2, repX(-1000, "policies")]] | [[Increase Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 4, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
<<else>>
	You have forced suffocating beauraucracy on those selling sexual services to the lower class making things a little more difficult. If you are willing to spend 1000 reputation you can change this policy. <<if $rep > 1000>>[[Reduce Beauraucracy|Manage Arcology][$sexSupplyBarriersLC = 3, repX(-1000, "policies")]]<<else>>//You are not reputable enough//<</if>>
<</if>>

__Population and Rent__

<<print $arcologies[0].name>> is home to the following;
<<set _percACitizens = Math.trunc(($ACitizens / ($ACitizens + $ASlaves)) * 1000) / 10,
_percASlaves = Math.trunc(($ASlaves / ($ACitizens + $ASlaves)) * 1000) / 10,
_percLowerClass = Math.trunc(($lowerClass / ($ACitizens + $ASlaves)) * 1000) / 10,
_percMiddleClass = Math.trunc(($middleClass / ($ACitizens + $ASlaves)) * 1000) / 10,
_percUpperClass = Math.trunc(($upperClass / ($ACitizens + $ASlaves)) * 1000) / 10,
_percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>

Lower Class Citizens  | $lowerClass | <<print _percLowerClass>>% | Rent @@.yellowgreen;<<print cashFormat($LCRent / 25)>>@@
<<if $LCRent > 30>>
	//Very High// | [[Decrease|Manage Arcology][$LCRent = 30, $rentEffectL = 0.94]]
<<elseif $LCRent > 20>>
	//High// | [[Increase|Manage Arcology][$LCRent = 40, $rentEffectL = 0.85]] | [[Decrease|Manage Arcology][$LCRent = 20, $rentEffectL = 1]]
<<elseif $LCRent > 10>>
	//Average// | [[Increase|Manage Arcology][$LCRent = 30, $rentEffectL = 0.94]] | [[Decrease|Manage Arcology][$LCRent = 10, $rentEffectL = 1.04]]
<<elseif $LCRent > 0>>
	//Low// | [[Increase|Manage Arcology][$LCRent = 20, $rentEffectL = 1]] | [[Free Rent|Manage Arcology][$LCRent = 0, $rentEffectL = 1.1]]
<<else>>
	//Free// | [[Increase|Manage Arcology][$LCRent = 10, $rentEffectL = 1.04]]
<</if>>

Middle Class Citizens | $middleClass | <<print _percMiddleClass>>% | Rent @@.yellowgreen;<<print cashFormat($MCRent / 25)>>@@
<<if $MCRent > 75>>
	//Very High// | [[Decrease|Manage Arcology][$MCRent = 75, $rentEffectM = 0.94]]
<<elseif $MCRent > 50>>
	//High// | [[Increase|Manage Arcology][$MCRent = 100, $rentEffectM = 0.85]] | [[Decrease|Manage Arcology][$MCRent = 50, $rentEffectM = 1]]
<<elseif $MCRent > 25>>
	//Average// | [[Increase|Manage Arcology][$MCRent = 75, $rentEffectM = 0.94]] | [[Decrease|Manage Arcology][$MCRent = 25, $rentEffectM = 1.04]]
<<elseif $MCRent > 0>>
	//Low// | [[Increase|Manage Arcology][$MCRent = 50, $rentEffectM = 1]] | [[Free Rent|Manage Arcology][$MCRent = 0, $rentEffectM = 1.1]]
<<else>>
	//Free// | [[Increase|Manage Arcology][$MCRent = 25, $rentEffectM = 1.04]]
<</if>>

Upper Class Citizens  | $upperClass | <<print _percUpperClass>>% | Rent @@.yellowgreen;<<print cashFormat($UCRent / 25)>>@@
<<if $UCRent > 270>>
	//Very High// | [[Decrease|Manage Arcology][$UCRent = 270, $rentEffectU = 0.94]]
<<elseif $UCRent > 180>>
	//High// | [[Increase|Manage Arcology][$UCRent = 360, $rentEffectU = 0.85]] | [[Decrease|Manage Arcology][$UCRent = 180, $rentEffectU = 1]]
<<elseif $UCRent > 90>>
	//Average// | [[Increase|Manage Arcology][$UCRent = 270, $rentEffectU = 0.94]] | [[Decrease|Manage Arcology][$UCRent = 90, $rentEffectU = 1.04]]
<<elseif $UCRent > 0>>
	//Low// | [[Increase|Manage Arcology][$UCRent = 180, $rentEffectU = 1]] | [[Free Rent|Manage Arcology][$UCRent = 0, $rentEffectU = 1.1]]
<<else>>
	//Free// | [[Increase|Manage Arcology][$UCRent = 90, $rentEffectU = 1.04]]
<</if>>

Millionaires		  | $topClass | <<print _percTopClass>>% | Rent @@.yellowgreen;<<print cashFormat($TCRent / 25)>>@@
<<if $TCRent > 975>>
	//Very High// | [[Decrease|Manage Arcology][$TCRent = 975, $rentEffectT = 0.94]]
<<elseif $TCRent > 650>>
	//High// | [[Increase|Manage Arcology][$TCRent = 1300, $rentEffectT = 0.85]] | [[Decrease|Manage Arcology][$TCRent = 650, $rentEffectT = 1]]
<<elseif $TCRent > 325>>
	//Average// | [[Increase|Manage Arcology][$TCRent = 975, $rentEffectT = 0.94]] | [[Decrease|Manage Arcology][$TCRent = 325, $rentEffectT = 1.04]]
<<elseif $TCRent > 0>>
	//Low// | [[Increase|Manage Arcology][$TCRent = 650, $rentEffectT = 1]] | [[Free Rent|Manage Arcology][$TCRent = 0, $rentEffectT = 1.1]]
<<else>>
	//Free// | [[Increase|Manage Arcology][$TCRent = 325, $rentEffectT = 1.04]]
<</if>>

Slaves				| $ASlaves | <<print _percASlaves>>%

__Language__

The lingua franca of the arcology is ''$language''.
<<link "Language options">><<set $seed = $language>><<goto "Change Language">><</link>>

__Special Arcology Upgrades__

<<if ($personalArms == 0) && ($mercenaries == 0) && ($assistant == 0)>>
//$arcologies[0].name has no special upgrades//
<</if>>

<<if ($personalArms == 1)>>
	You own a prototype powered exoskeleton that mounts armor and a smart mortar system, and has rifles mounted into its forearms.
<<elseif ($personalArms > 1)>>
	You own a prototype powered exoskeleton that mounts armor and a smart mortar system, and has rifles mounted into its forearms. Furthermore, your security drones can rearm with small-caliber guns if necessary.
<</if>>

<<if ($mercenaries > 0)>>
	<<if ($mercenaries == 1)>>
		A squad of mercenaries is permanently quartered in $arcologies[0].name. They are grim men and women, heavily armed and armored.
	<<elseif ($mercenaries < 5)>>
		A full platoon of mercenaries is permanently quartered in $arcologies[0].name. They are grim men and women, heavily armed and armored.
	<<elseif ($mercenaries >= 5)>>
		You have permanently settled a full company of mercenaries in $arcologies[0].name as your $mercenariesTitle. They are grim men and women who appreciate their luxurious life here and train hard to keep their skills with their prototype armor sharp.
	<</if>>
<</if>>

<<if ($assistant > 0)>>
	<<setAssistantPronouns>>
	<<if $assistantName == "your personal assistant">>Your personal assistant<<else>>$assistantName<</if>> is using an alternative personality setting, speaking in a sultry, sexual voice, and talking as though the penthouse's sex toys are _hisA body.
	<<if ($assistant > 1)>>
		_HeA also has charge of all smart piercings in the arcology, and is using _hisA adaptations to sexual duties to improve their effectiveness.
	<</if>>
<</if>>

Your slaves have participated in approximately <<print num($oralTotal+$vaginalTotal+$analTotal)>> sexual encounters: <<print num($oralTotal)>> primarily oral, <<print num($vaginalTotal)>> vanilla, <<print num($mammaryTotal)>> mammary, <<print num($analTotal)>> anal, and <<print num($penetrativeTotal)>> with the slave penetrating another. They have produced about <<print num($milkTotal)>> liters of marketable milk, <<if $seeDicks != 0>>about <<print num($cumTotal)>> deciliters of marketable cum, <</if>>and have given birth <<print num($birthsTotal)>> times.

<<if $pitKillsTotal > 0>>$pitKillsTotal slaves have died in your fighting pit.<</if>>
<<if $fuckdollsSold > 0>>$fuckdollsSold mindbroken arcade slaves have been converted into Fuckdolls and sold.<</if>>

<<if $secExp == 1 && $battlesEnabled == 1>>

<<if $SF.Toggle === 0||$SF.Active === 0>>
	Your army counts <<print num($militiaEmployedManpower + $slavesEmployedManpower + $mercEmployedManpower)>> total soldiers.
<<elseif $SF.Toggle && $SF.Active >= 1>>
	Your army counts <<print num($militiaEmployedManpower + $slavesEmployedManpower + $mercEmployedManpower + $SF.Squad.Troops)>> total soldiers of which <<print num($SF.Squad.Troops)>> under the special force command and the rest under your direct control.
<</if>>
<<if $hasFoughtOnce == 1>>
	Your troops were involved in <<print num($battlesCount)>> battles of which <<print num($majorBattlesCount)>> were major engagements. You won
	<<if $battlesCount == $PCvictories>>
		all of them.
	<<elseif $battlesCount == $PClosses>>
		none of them.
	<<else>>
		<<print num($PCvictories)>> of them, while the enemy managed to gain the upper hand in the other <<print num($PClosses)>>.
	<</if>>
<</if>>

<<if $rebellionsCount >= 1>>
	Your arcology was involved in <<print num($rebellionsCount)>> rebellions. You won <<print num($PCrebWon)>> of them, while the rebels defeated your forces in <<print num($PCrebLoss)>>.
<</if>>

During all battles you lost a total of <<print num($militiaTotalCasualties + $slavesTotalCasualties + $mercTotalCasualties)>> men, while scoring a total of <<print num($totalKills)>> kills.
<</if>>

Your arcology is named <<textbox "$arcologies[0].name" $arcologies[0].name "Manage Arcology">>

<<if $cheatMode == 1 && $seeExtreme == 1>>

[[Host Dinner Party|Dinner Party Preparations]]
<</if>>


code:
:: Manage Penthouse [nobr]

<<set $nextButton = "Back", $nextLink = "Main", $showEncyclopedia = 1, $encyclopedia = "What the Upgrades Do">>

<<if $cheatMode == 1>>

//[[Cheat Edit Arcology|MOD_Edit Arcology Cheat][$cheater = 1]]//

<</if>>

<<include "Office Description">>
<<if $PC.career == "mercenary">>
	You look back at the rifle. It could never hold a zero, and would fail to feed if it wasn't given just the right amount of lubricant. But sometimes, you'd give anything for one more mission with that shitty old rifle.
<</if>>

<<if $SF.Toggle && $SF.Active >= 1>>
	<<link "Take your express elevator down to $SF.Lower""Firebase">> <</link>>

<<elseif $SF.BadOutcome === "lockdown">>
	The thick wall of rubble in front of the entrance to $SF.Lower's firebase would make the trip worthless.
<</if>>

__Penthouse Capacity__

The main penthouse dormitory, which houses slaves who aren't living in a facility and aren't granted a luxurious standard of living, has a capacity of ''$dormitory'' slaves.
[[Expand the dormitory|Manage Penthouse][cashX(forceNeg(Math.trunc($dormitory*1000*$upgradeMultiplierArcology)), "capEx"), $dormitory += 10, $PC.engineering += .1]]
//Costs <<print cashFormat(Math.trunc($dormitory*1000*$upgradeMultiplierArcology))>>//

//Exceeding this limit is bad for slaves' health, devotion and trust//

The penthouse also features little individual rooms, which house slaves who do enjoy a luxurious standard of living. They have a capacity of ''$rooms'' slaves.
[[Expand the rooms|Manage Penthouse][cashX(forceNeg(Math.trunc($rooms*1000*$upgradeMultiplierArcology)), "capEx"), $rooms += 5, $PC.engineering += .1]]
//Costs <<print cashFormat(Math.trunc($rooms*1000*$upgradeMultiplierArcology))>>//

//The number of rooms determines the number of slaves that can be granted luxury//

__Penthouse Facilities__

<<if $masterSuite == 0>>
	[[Improve your master bedroom to house a harem of personal toys|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $masterSuite = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse is capped by a master suite with room for an entire harem of personal toys.
<</if>>

<<if $servantsQuarters == 0>>
	[[Build a dormitory to house large numbers of house servants|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $servantsQuarters = 5, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse includes a dormitory to house large numbers of house servants.
<</if>>

<<if $schoolroom == 0>>
	[[Build a schoolroom where slaves can be educated|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $schoolroom = 5, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse includes a schoolroom where slaves can be educated.
<</if>>

<<if $spa == 0>>
	[[Install open baths to provide relaxation space for resting slaves|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $spa = 5, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The penthouse includes a fully appointed spa where slaves can rest and recuperate.
<</if>>

<<if $cheatMode == 1>>
<<if $familyTesting == 1 && $seePreg != 0>>

<<if $nursery == 0>>
	[[Build a nursery to raise children from birth|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $nursery = 5, $nurseryNannies = 1, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
		The penthouse has a nursery built where infants can be brought up.
<</if>>
<</if>>
<</if>>

<<if $clinic == 0>>
	[[Expand the surgical recovery area to accommodate patients and a nurse|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $clinic = 5, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The surgical recovery area has been expanded to take in more unhealthy slaves and be staffed by a nurse.
<</if>>

<<if $cellblock == 0>>
	[[Construct cells to properly confine disobedient slaves|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $cellblock = 5, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The lower level of the penthouse includes a hallway of cells to confine slaves in.
<</if>>

<<if $familyTesting == 1 && $seePreg != 0>>
<<if $arcologyUpgrade.grid == 1>>
<<if $incubator == 0>>
	[[Install an incubation chamber to rapidly age children|Manage Penthouse][cashX(forceNeg(Math.trunc(100000*$upgradeMultiplierArcology)), "capEx"), $incubator = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(100000*$upgradeMultiplierArcology))>>//
<<else>>
	The penthouse has a specialized facility dedicated to rapidly aging children.
<</if>>
<<elseif $arcologyUpgrade.hydro == 1 || $arcologyUpgrade.apron == 1>>
	//Installation of a child aging facility will require the arcology's electrical infrastructure to be overhauled.//
<</if>>

<</if>>

<<if $HGSuite != 1>>
	[[Build a small suite for a Head Girl to live in|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $HGSuite = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	There is a small but handsome suite next to yours reserved for the Head Girl.
<</if>>

<<if $cyberMod == 1>>

	<<if $researchLab.built == "true">>
		Your penthouse is now equipped with a research lab.
	<<else>>
		[[Clear out one of the floors and install research equipment|Manage Penthouse][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology)), "capEx"), $researchLab.built = "true", $researchLab.maxSpace = 5, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology))>>//
	<</if>>
<</if>>

__Penthouse Upgrades__

<<if $servantMilkers != 1>>
	Your penthouse is equipped with basic milkers for lactating slaves. [[Install more and tie them into the liquid systems|Manage Penthouse][cashX(forceNeg(Math.trunc(25000*$upgradeMultiplierArcology)), "capEx"), $servantMilkers = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(25000*$upgradeMultiplierArcology))>>//
<<else>>
	Every room in the penthouse is equipped with milkers tied into the liquid systems, letting slaves with full udders drain them anywhere.
<</if>>

<<if $boobAccessibility != 1>>
<<if $pregAccessibility == 1 || $ballsAccessibility || $buttAccessibility>>
	Your penthouse has already been widened for overly wide slaves but there are no special accommodations for slaves with enormous breasts. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $boobAccessibility = 1, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse has no special accessibility provisions for slaves with enormous breasts. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $boobAccessibility = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>//
<</if>>
<<else>>
	The entire penthouse has been remodeled to make life with enormous breasts easier. The doorways have been widened, and tables, sinks and other items now have two levels: one at shoulder height for slaves to use, and another at waist height for them to rest their tits on while they do.
<</if>>

<<if $seeHyperPreg == 1>>

	<<if $pregAccessibility != 1>>
		<<if $boobAccessibility == 1 || $ballsAccessibility || $buttAccessibility>>
			Your penthouse has already been widened to make life for overly wide slaves easier but there are no special accommodations for slaves with enormous pregnancies. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $pregAccessibility = 1, $PC.engineering += .5]]
			//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
		<<else>>
			Your penthouse has no special accessibility provisions for slaves with enormous pregnancies. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $pregAccessibility = 1, $PC.engineering += 1]]
			//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>//
		<</if>>
	<<else>>
		The entire penthouse has been remodeled to make life with enormous pregnancies easier. The doorways have been widened, and tables, sinks and other items are now designed to work around a massively distended belly.
	<</if>>
<</if>>

<<if $arcologies[0].FSAssetExpansionistResearch == 1>>

<<if $dickAccessibility != 1>>
	Your penthouse has no special accessibility provisions for slaves with enormous dicks. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $dickAccessibility = 1, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	The entire penthouse has been remodeled to make life with enormous dicks easier. Carts, slings and harnesses are available to keep things from dragging and there is now plenty of room for huge genitals to occupy when a slave must use appliances, tables and seats.
<</if>>

<<if $ballsAccessibility != 1>>
<<if $boobAccessibility == 1 || $buttAccessibility || $pregAccessibility>>
	Your penthouse has already been widened to make life for overly wide slaves easier but there are no special accommodations for slaves with enormous testicles. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $ballsAccessibility = 1, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse has no special accessibility provisions for slaves with enormous testicles. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $ballsAccessibility = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>//
<</if>>
<<else>>
	The entire penthouse has been remodeled to make life with enormous testicles easier. The doorways have been widened, tables, sinks and other items are now designed to fit over giant balls, drains have been widened to allow excessive cum to flow easier, and seats have been specially altered to allow plenty of ball room for seated slaves.
<</if>>

<<if $buttAccessibility != 1>>
<<if $boobAccessibility == 1 || $dickAccessibility || $ballsAccessibility>>
	Your penthouse has already been widened to make life for overly wide slaves easier but there are no special accommodations for slaves with gigantic posteriors. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $buttAccessibility = 1, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	Your penthouse has no special accessibility provisions for slaves with enormous posteriors. [[Remodel for accessibility|Manage Penthouse][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $buttAccessibility = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>//
<</if>>
<<else>>
	The entire penthouse has been remodeled to make life with enormous rears easier. The doorways have been widened, and anything that can be sat on is now extra, extra wide and reinforced to allow even the heaviest, biggest asses to comfortably rest upon it.
<</if>>

<<if $boobAccessibility > 0 || $pregAccessibility > 0 || $dickAccessibility > 0 || $ballsAccessibility > 0 || $buttAccessibility > 0>>
<<set _removeCost = Math.trunc(((5000*($boobAccessibility+$pregAccessibility+$dickAccessibility+$ballsAccessibility+$buttAccessibility)))*$upgradeMultiplierArcology)>>

//[[Remove the accessibility renovations|Manage Penthouse][cashX(forceNeg(_removeCost), "capEx"), $boobAccessibility = 0, $pregAccessibility = 0, $dickAccessibility = 0, $ballsAccessibility = 0, $buttAccessibility = 0]] Will cost <<print cashFormat(_removeCost)>>//
<</if>>

<</if>>

<<if $feeder == 0>>
	[[Upgrade the kitchen's nutritional sensing systems|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $feeder = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The kitchen mounts sensors to refine diets in real time.
<</if>>

<<if $cockFeeder == 0>>
	[[Enhance the feeding system with faux phalli|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $cockFeeder = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The kitchen dispenses food from phalli slaves must suck off in order to eat. //[[Remove them|Manage Penthouse][$cockFeeder = 0]]//
<</if>>

<<if $suppository == 0>>
	[[Replace the drug dispensers with reciprocating dildo suppositories|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $suppository = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	The kitchen applies drugs that can be absorbed rectally by assfucking slaves with dildos that cum the pharmaceuticals. //[[Remove them|Manage Penthouse][$suppository = 0]]//
<</if>>

<<if $dairy != 0>>
<<if $dairyPiping == 0>>
	[[Install pipes connecting the Dairy to the rest of your penthouse for use in enema play|Manage Penthouse][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology)), "capEx"), $dairyPiping = 1, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology))>>//
<<else>>
	Various taps around the penthouse supply product from $dairyName for use in enema play and force-feeding.
<</if>>
<<elseif $dairyPiping == 1>>
	Various taps around the penthouse supply product from $dairyName for use in enema play and force-feeding. With no dairy to draw from, they are currently unused.
<</if>>

<<if $studio == 0>>
	[[Install a media hub to convert slave video feeds into pornography|Manage Penthouse][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $studio = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
<<else>>
	The arcology's video systems are connected to a media hub that can convert slave video feeds into pornography.
	<<if $studioFeed == 0>>
		[[Upgrade the media hub to allow better control of pornographic content|Manage Penthouse][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology)), "capEx"), $studioFeed = 1]]
		//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology))>>//
	<<else>>
		It has been upgraded to allow superior control of a slave's pornographic content.
	<</if>>
<</if>>

<<if $dojo == 0>>
	[[Set up a personal armory to support a bodyguard|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $dojo = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<elseif $dojo == 1>>
	There is a small armory next to your office that can support a bodyguard. [[Upgrade the armory with a private room for the bodyguard|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $dojo = 2, $PC.engineering += .5]]
	//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
<<else>>
	There is a small armory next to your office that can support a bodyguard, with a little room for her to rest in when off duty.
<</if>>

<<if $dispensary == 0>>
<<if $rep > 2000>>
	[[Install a pharmaceutical fabricator|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $dispensary = 1, $drugsCost = $drugsCost*.75, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	//You lack the reputation to obtain cutting-edge pharmaceutical technology//
<</if>>
<<else>>
	There is a [[pharmaceutical fabricator|Dispensary]] attached to the surgery.
<</if>>

<<if $ImplantProductionUpgrade == 0>>
<<if $rep > 2000>>
	[[Install an implant manufactory|Manage Penthouse][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $ImplantProductionUpgrade = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
<<else>>
	//You lack the reputation to obtain cutting-edge implant fabrication technology//
<</if>>
<<else>>
	There is a [[implant manufactory|Implant Manufactory]] attached to the surgery.
<</if>>

<<if $organFarmUpgrade == 0>>
<<if $rep > 10000>>
	[[Install an experimental organ farm|Manage Penthouse][cashX(forceNeg(Math.trunc(70000*$upgradeMultiplierArcology)), "capEx"), $organFarmUpgrade = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(Math.trunc(70000*$upgradeMultiplierArcology))>>//
<<else>>
	//You lack the reputation to obtain an experimental organ fabricator//
<</if>>
<<else>>
	There is an [[organ farm|Organ Farm]] attached to the surgery.
<</if>>

<<if $geneticMappingUpgrade == 0>>
<<if $rep > 14000>>
	[[Install a genetic sequencer|Manage Penthouse][cashX(-120000, "capEx"), $geneticMappingUpgrade = 1, $PC.engineering += .1]]
	//Costs <<print cashFormat(120000)>>//
<<else>>
	//You lack the reputation to purchase a cutting-edge genetic sequencer//
<</if>>
<<else>>
	There is a [[genetic sequencer|Gene Lab]] attached to the surgery.
<</if>>

<<if $cyberMod == 0>>
	<<switch $prostheticsUpgrade>>
	<<case 1>>
	There is a facility to construct mechanical prosthetic limbs for amputated slaves.
	<<if ($rep > 12000)>>
		[[Research advanced prototype prosthetics|Manage Penthouse][cashX(forceNeg(Math.trunc(100000*$upgradeMultiplierArcology)), "capEx"), $prostheticsUpgrade = 2]]
		//Costs <<print cashFormat(Math.trunc(100000*$upgradeMultiplierArcology))>>//
	<<else>>
		//You lack the reputation to research and produce prototype prosthetics.//
	<</if>>
	<<case 2>>
	There is a prosthetics facility upgraded to use advanced materials and designs.
	<<if ($rep > 16000)>>
		[[Research high-tech cybernetic limbs|Manage Penthouse][cashX(forceNeg(Math.trunc(100000*$upgradeMultiplierArcology)), "capEx"), $prostheticsUpgrade = 3]]
		//Costs <<print cashFormat(Math.trunc(100000*$upgradeMultiplierArcology))>>//
	<<else>>
		//You lack the reputation to research and produce prototype cybernetic limbs.//
	<</if>>
	<<case 3>>
	There is a high-tech facility to build prosthetics and state-of-the-art cybernetic replacement limbs.
	<<default>>
	<<if ($rep > 8000)>>
		[[Construct a mechanical prosthetics facility|Manage Penthouse][cashX(forceNeg(Math.trunc(100000*$upgradeMultiplierArcology)), "capEx"), $prostheticsUpgrade = 1, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(100000*$upgradeMultiplierArcology))>>//
	<<else>>
		//You lack the reputation to construct a prosthetics facility.//
	<</if>>
	<</switch>>
<</if>>

<<if $surgeryUpgrade == 0>>
<<if $rep > 10000>>
	[[Upgrade the remote surgery|Manage Penthouse][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "capEx"), $surgeryUpgrade = 1, $PC.engineering += 1]]
	//Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>>//
<<else>>
	//You lack the reputation to secure rare surgery upgrades//
<</if>>
<<else>>
	Your remote surgery has been heavily upgraded and customized.
<</if>>

<<if $seePreg == 1>>

	<<if $pregnancyMonitoringUpgrade == 0>>
	<<if $rep > 10000>>
		[[Upgrade the pregnancy monitoring systems|Manage Penthouse][cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "capEx"), $pregnancyMonitoringUpgrade = 1, $PC.engineering += 1]]
		//Costs <<print cashFormat(Math.trunc(30000*$upgradeMultiplierArcology))>>//
	<<else>>
		//You lack the reputation to purchase improved pregnancy monitoring systems//
	<</if>>
	<<else>>
		Your pregnancy monitoring systems have been heavily upgraded.
	<</if>>
<</if>>


code:
:: Manufacturing [nobr]

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

This is a space in the arcology's service areas,
<<switch $sectors[$AS].type>>
<<case "Manufacturing">>
	rented to a variety of tenants for manufacturing purposes. You control this part of the arcology and all these producers pay you rent.
<<case "Sweatshops">>
	designed for labor intensive manufacturing by menial slaves.
<<default>>ERROR: bad sector type
<</switch>>
<<if $sectors[$AS].type == "Manufacturing">><<SectorSell>><</if>>

<<if $sectors[$AS].type == "Sweatshops">>
	<<if $menials > 0>>

		You own <<print num($menials)>> menial slaves. All your sweatshops together can use only <<print $Sweatshops*500>>,
		<<if $menials > $Sweatshops*500>>
			the remainder is assigned to various odd jobs in the arcology.
		<<elseif $menials == $Sweatshops*500>>
			and your menials are fully staffing them.
		<<else>>
			leaving space for <<print $Sweatshops*500-$menials>> more.
		<</if>>
	<</if>>
<</if>>

<<if $dairy == 0>>

	[[Construct a dairy to milk slaves on an industrial scale|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $dairy = 5, $sectors[$AS].type = "Dairy"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> and will incur upkeep costs//
<</if>>

<<if $cheatMode == 1>>
	<<if $farmyard == 0>>

		[[Construct a farming facility to grow food for your arcology and house animals|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $farmyard = 5, $sectors[$AS].type = "Farmyard"]]
		//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> and will incur upkeep costs// @@.red;Alpha Content!@@
	<</if>>
<</if>>

<<if $mercenaries>>
	<<if $barracks != 1>>

		[[Build an armory to properly house your mercenaries|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $barracks = 1, $sectors[$AS].type = "Barracks"]]
		//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> but will reduce mercenary upkeep//
	<</if>>
<</if>>

<<if $secExp == 1>>
	<<if $weapManu != 1>>

		[[Convert this sector to weapons manufacturing|Main][cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "capEx"), $weapManu = 1, $sectors[$AS].type = "weapManu"]]
		//Costs <<print cashFormat(Math.trunc(30000*$upgradeMultiplierArcology))>> but will provide a weekly income and will unlock upgrades for our troops//
	<</if>>
<</if>>

[[Convert to pens to increase the number of menial slaves you can house|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $sectors[$AS].type = "Pens"]]
//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//

<<if $sectors[$AS].type != "Sweatshops">>

	[[Convert these facilities to use the labor of menial slaves|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $sectors[$AS].type = "Sweatshops"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
<</if>>

<<if $sectors[$AS].type != "Manufacturing">>

	[[Return this sector to standard manufacturing|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $sectors[$AS].type = "Manufacturing"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
<</if>>


code:
:: Markets [nobr]

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

This is an area of the concourse occupied by large stores and markets, many of which sell slaves. You control this part of the arcology and all these merchants pay you rent.
<<SectorSell>>

<<if $arcade == 0>>

	[[Construct a sex arcade to present slaves' holes for public use|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $arcade = 10, $sectors[$AS].type = "Arcade"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> and will incur upkeep costs//
<</if>>

<<if $pit == 0>>

	[[Build a pit to host proper slave fights|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $pit = 1, $sectors[$AS].type = "Pit"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
<</if>>

<<if $secExp == 1 && $transportHub == 0>>

	[[Centralize and modernize the transport hub|Main][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $transportHub = 1, $sectors[$AS].type = "transportHub", $docks = 1, $railway = 1, $airport = 1]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
<</if>>

<<if $corpMarket == 0 && $corpIncorporated == 1>>

	[[Create a flagship slave market for your corporation here|Main][$corpCash -= Math.trunc(10000*$upgradeMultiplierArcology), $corpMarket = 1, $sectors[$AS].type = "CorporateMarket"]]
	//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>> of the corporation's money//
<</if>>


code:
:: Markets Report [nobr]

//FC Markets Report://

<<set _assetAffected = either("capture", "drugs", "entrapment", "general", "slaves", "surgical", "training")>>
<<set _assetDirection = either("down", "up")>>

<<if _assetAffected == "general">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...rising energy costs drove @@.yellowgreen;rising prices@@ of several market baskets...
	<<else>>
		...conflict-driven increases in transportation costs increase @@.yellowgreen;price indices@@...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...increasing Free Cities slave labor effects @@.gold;general prices@@...
	<<else>>
		...Antarctic oil shale pushing down energy prices, driving down major @@.gold;price indices@@...
	<</if>>
	<</if>>
<<elseif _assetAffected == "slaves">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...heavy demand for fashionable varieties drove @@.yellowgreen;rising slave prices@@ last...
	<<else>>
		...study suggested the sexual revolution would continue to drive up @@.yellowgreen;slave prices@@...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...increased supply due to bush wars drove down @@.gold;slave prices@@...
	<<else>>
		...@@.gold;slave prices@@ continue to fall due to major improvements in training...
	<</if>>
	<</if>>
<<elseif _assetAffected == "entrapment">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...prospect of deregulation drove a @@.yellowgreen;scramble@@ for means of enslavement...
	<<else>>
		...law would legalize enslavement, driving @@.yellowgreen;high prices@@ for associated...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...reactionism produced lower demand and @@.gold;lower prices@@ for legal enslavement...
	<<else>>
		...report on low success rates @@.gold;drove down@@ value of legal enslavement methods...
	<</if>>
	<</if>>
<<elseif _assetAffected == "capture">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...declaration of war @@.yellowgreen;pushed up@@ average mercenary wage...
	<<else>>
		...advancing technology to blame for @@.yellowgreen;rising costs@@ of assets for wet work...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...rumored peace treaty @@.gold;pushed down@@ mercenary contract clearing rate...
	<<else>>
		...demobilization of the cash-strapped army expected to produce mercenary @@.gold;glut@@...
	<</if>>
	<</if>>
<<elseif _assetAffected == "training">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...rising demand in turn @@.yellowgreen;pushing up@@ prices for most means of slave training...
	<<else>>
		...public demand for ever-better slave training inevitably @@.yellowgreen;increase@@ training costs...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...competition from low-cost slave breaking firms @@.gold;reducing@@ asking price for...
	<<else>>
		...increased automation of slave training @@.gold;negatively impacting@@ training contracts...
	<</if>>
	<</if>>
<<elseif _assetAffected == "surgical">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...fashionable extravagant implant procedures @@.yellowgreen;driving prices@@ of remote surgical...
	<<else>>
		...near-universal breast implants producing corresponding @@.yellowgreen;price inflation@@ of surgery...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...vastly reduced overhead with remote surgery @@.gold;hitting prices@@ of surgery hard...
	<<else>>
		...oversupply after major manufacturers converted lines to @@.gold;low-cost@@ implant production...
	<</if>>
	<</if>>
<<elseif _assetAffected == "drugs">>
	<<if _assetDirection == "up">>
	<<if random(1,100) > 50>>
		...intense demand for curatives in conflict zones @@.yellowgreen;increasing prices@@...
	<<else>>
		...setbacks in growth hormone human testing expected to @@.yellowgreen;increase prices@@ of traditional formula...
	<</if>>
	<<else>>
	<<if random(1,100) > 50>>
		...new formula @@.gold;cut costs@@ of common curatives by an unprecedented...
	<<else>>
		...glut caused by big pharma reorienting towards @@.gold;cheap,@@ mass-produced aphros...
	<</if>>
	<</if>>
<</if>>