:: StoryCaption [nobr]

<<set _Pass = passage()>>

<<if $ui != "start">><p><<userButton>></p><</if>>

<<if $ui != "start">>
	<<if $cheatMode || $debugMode>>
		<div>_Pass</div>
		<<if _Pass == "JS Random Event">>
			<div><<= $event.eventName>></div>
		<</if>>
	<</if>>
	<div>
		<span id="week">''Week $week''</span>
		<<if $week > 52>> (<<= years($week)>>) <</if>>
	</div>
	<div> Week of <<= asDateString($week)>> </div>
	<<if _Pass == "Main" && $cheatMode && $cheatModeM>>
		<<set _TWeek = $week>>
		<<textbox "$week" $week>>
		<<link "Apply">>
			<<set $week = Math.trunc(Number($week) || _TWeek)>>
			<<if $week < 1>><<set $week = 1>><</if>>
			<<replace "#week">>''Week $week''<</replace>>
		<</link>>
	<</if>>
	<div>
 <<if $weatherToday.severity == 1>>
		<i>@@.cyan; $weatherToday.name@@</i>
 <<elseif $weatherToday.severity == 2>>
		<i>@@.yellow; $weatherToday.name@@</i>
 <<elseif $weatherToday.severity == 3>>
		<i>@@.orange; $weatherToday.name@@</i>
 <<else>>
		<i>@@.red; $weatherToday.name@@</i>
 <</if>>
	</div>

	<<if $sideBarOptions.Cash > 0>>
		<<set $cash = Math.trunc($cash)>>
		<<if $cash > 0>>
			@@.yellowgreen;Cash@@ | @@.yellowgreen;<<= cashFormat($cash)>>@@
		<<else>>
			__@@.red;Cash@@__ | @@.red;<<= cashFormat($cash)>>@@
		<</if>>

		<<if _Pass == "Main">> <div>
			<<set _TCash2 = ($cash-$cashLastWeek)>>
			<<if _TCash2 > 0>> (@@.green;<<= cashFormat(_TCash2)>>@@
			<<else>> (@@.red;<<= cashFormat(_TCash2)>>@@
			<</if>>
			since last week)
			<<if $cheatMode && $cheatModeM>>
				<<set _TCash1 = $cash>>
				<<textbox "$cash" $cash>>
				<<link "Apply">>
					<<set $cash = Math.trunc(Number($cash) || _TCash1), $cheater = 1>>
				<</link>>
			<</if>>
		</div> <</if>>
	<</if>>

	<<if $foodMarket > 0>> <br>
		<<set $food = Math.trunc($food)>>
		<<set $foodConsumption = Math.trunc(($lowerClass*$foodRate.lower) + ($middleClass*$foodRate.middle) + ($upperClass*$foodRate.upper) + ($topClass*$foodRate.top))>>
		<<if $food > $foodConsumption>> /* if there is enough food for the next week */
			@@.chocolate;Food@@
		<<else>>
			@@.red;Food@@
		<</if>>
		<<if $food < 0>> <<set $food = 0>> <</if>>
		| @@.chocolate;<<= massFormat($food)>>@@

		<<if _Pass == "Main">> <br>
			<<set _TFood2 = ($food-$foodLastWeek)>>
			<<if _TFood2 < 0>> (@@.red;<<= massFormat(_TFood2)>>@@
			<<else>> (@@.chocolate;+<<= massFormat(_TFood2)>>@@
			<</if>>
			since last week)
			<<if $cheatMode && $cheatModeM>>
				<<set _TFood1 = $food>>
				<<textbox "$food" $food>>
				<<link "Apply">>
					<<if $food < 0>>
						<<set $food = 0>>
					<<else>>
						<<set $food = Math.trunc(Number($food) || _TFood1), $cheater = 1>>
					<</if>>
				<</link>>
			<</if>>
		<</if>>
	<</if>>

	<<if $sideBarOptions.Upkeep > 0>>
		<div>
			<<if _Pass == "Main">> [[Upkeep|Costs Budget]] |
			<<else>> Upkeep |
			<</if>>
			@@.red;<<= cashFormat($costs)>>@@
		</div>
	<</if>>

	<<if $sideBarOptions.SexSlaveCount > 0>>
		<div>@@.pink;Total Sex Slaves@@ | <<= $slaves.length>></div>
	<</if>>
	<<if $sideBarOptions.roomPop > 0>>
		<div>@@.pink;Penthouse Beds@@ | <<if $dormitoryPopulation+$roomsPopulation > ($dormitory+$rooms)>>@@.red;<<= $dormitoryPopulation+$roomsPopulation>>@@<<else>><<= $dormitoryPopulation+$roomsPopulation>><</if>>/<<= ($dormitory+$rooms)>></div>
		<div>@@.pink;Dormitory Beds@@ | <<if $dormitoryPopulation > $dormitory>>@@.red;<<= $dormitoryPopulation>>@@<<else>><<= $dormitoryPopulation>><</if>>/<<= $dormitory>></div>
		<div>@@.pink;Luxury Rooms@@ | <<if $roomsPopulation > $rooms>>@@.red;<<= $roomsPopulation>>@@<<else>><<= $roomsPopulation>><</if>>/<<= $rooms>></div>
	<</if>>

	<<if _Pass != "Manage Penthouse">>
		<<if $sideBarOptions.GSP > 0 && _Pass != "Neighbor Interact">>
			<div>
			@@.yellowgreen;GSP@@ |
			<<= num(Math.trunc(0.1*$arcologies[0].prosperity))>><<if $showNumbers == 2 || ($showNumbers == 1 && Math.trunc(0.1*$arcologies[0].prosperity) > $showNumbersMax)>>m<<else>> million<</if>>
			<<= ownershipReport({sidebar: true})>>
			</div>
		<</if>>

		<<if $sideBarOptions.Rep > 0>>
			<div>
			<<if _Pass == "Main">> [[Rep|Rep Budget]] |
			<<else>> @@.green;Rep@@ |
			<</if>>
			<<if $rep > 19000>>
				@@color:rgb(0,145,0);worshipped@@
			<<elseif $rep > 18000>>
				@@color:rgb(0,150,0);great@@
			<<elseif $rep > 17000>>
				@@color:rgb(0,155,0);exalted@@
			<<elseif $rep > 16000>>
				@@color:rgb(0,160,0);illustrious@@
			<<elseif $rep > 15000>>
				@@color:rgb(0,165,0);prestigious@@
			<<elseif $rep > 14000>>
				@@color:rgb(0,170,0);renowned@@
			<<elseif $rep > 13000>>
				@@color:rgb(0,175,0);famed@@
			<<elseif $rep > 12000>>
				@@color:rgb(0,180,0);celebrated@@
			<<elseif $rep > 11000>>
				@@color:rgb(0,185,0);honored@@
			<<elseif $rep > 10000>>
				@@color:rgb(0,190,0);acclaimed@@
			<<elseif $rep > 9000>>
				@@color:rgb(0,195,0);eminent@@
			<<elseif $rep > 8250>>
				@@color:rgb(0,200,0);prominent@@
			<<elseif $rep > 7500>>
				@@color:rgb(0,205,0);distinguished@@
			<<elseif $rep > 6750>>
				@@color:rgb(0,210,0);admired@@
			<<elseif $rep > 6000>>
				@@color:rgb(0,215,0);esteemed@@
			<<elseif $rep > 5250>>
				@@color:rgb(0,220,0);respected@@
			<<elseif $rep > 4500>>
				@@color:rgb(0,225,0);known@@
			<<elseif $rep > 3750>>
				@@color:rgb(0,230,0);recognized@@
			<<elseif $rep > 3000>>
				@@color:rgb(0,235,0);rumored@@
			<<elseif $rep > 2250>>
				@@color:rgb(0,240,0);envied@@
			<<elseif $rep > 1500>>
				@@color:rgb(0,245,0);resented@@
			<<elseif $rep > 750>>
				@@color:rgb(0,250,0);disliked@@
			<<else>>
				@@color:rgb(0,255,0);unknown@@
			<</if>>
			(<<= num($rep)>>)
			<<if _Pass == "Main" && $cheatMode && $cheatModeM>>
				<<set _TRep = $rep>>
				<<textbox "$rep" $rep>>
				<<link "Apply">>
					<<set $rep = Math.clamp(Math.trunc(Number($rep) || _TRep), 0, 20000), $cheater = 1>>
				<</link>>
			<</if>>
			</div>
		<</if>>

		<<if $secExpEnabled > 0 && ($sideBarOptions.Authority + $sideBarOptions.Security + $sideBarOptions.Crime > 0)>>
			<<if $sideBarOptions.Authority > 0>>
				<div>
				@@.darkviolet;Auth@@ |
				<<set $SecExp.core.authority = Math.clamp(Math.trunc($SecExp.core.authority), 0, 20000)>>
				<<if $SecExp.core.authority > 19500>>
					@@color:rgb(148, 0, 211);divine will@@
				<<elseif $SecExp.core.authority > 19000>>
					@@color:rgb(148, 0, 211);sovereign@@
				<<elseif $SecExp.core.authority > 18000>>
					@@color:rgb(148, 0, 211);monarch@@
				<<elseif $SecExp.core.authority > 17000>>
					@@color:rgb(148, 0, 211);tyrant@@
				<<elseif $SecExp.core.authority > 15000>>
					@@color:rgb(148, 0, 211);dictator@@
				<<elseif $SecExp.core.authority > 14000>>
					@@color:rgb(148, 0, 211);prince@@
				<<elseif $SecExp.core.authority > 13000>>
					@@color:rgb(183, 0, 211);master@@
				<<elseif $SecExp.core.authority > 12000>>
					@@color:rgb(183, 0, 211);leader@@
				<<elseif $SecExp.core.authority > 11000>>
					@@color:rgb(183, 0, 211);director@@
				<<elseif $SecExp.core.authority > 10000>>
					@@color:rgb(183, 0, 211);overseer@@
				<<elseif $SecExp.core.authority > 9000>>
					@@color:rgb(183, 0, 211);chief@@
				<<elseif $SecExp.core.authority > 8000>>
					@@color:rgb(183, 0, 211);manager@@
				<<elseif $SecExp.core.authority > 7000>>
					@@color:rgb(211,0,204);principal@@
				<<elseif $SecExp.core.authority > 6000>>
					@@color:rgb(211,0,204);auxiliary@@
				<<elseif $SecExp.core.authority > 5000>>
					@@color:rgb(211,0,204);subordinate@@
				<<elseif $SecExp.core.authority > 4000>>
					@@color:rgb(211,0,204);follower@@
				<<elseif $SecExp.core.authority > 3000>>
					@@color:rgb(211,0,204);powerless@@
				<<elseif $SecExp.core.authority > 2000>>
					@@color:rgb(211,0,204);toothless@@
				<<elseif $SecExp.core.authority > 1000>>
					@@color:rgb(211,0,204);mostly harmless@@
				<<else>>
					@@color:rgb(211,0,204);harmless@@
				<</if>>
				(<<= num($SecExp.core.authority)>>)
				<<if _Pass == "Main" && $cheatMode && $cheatModeM>>
					<<set _TAuth = $SecExp.core.authority>>
					<<textbox "$SecExp.core.authority" $SecExp.core.authority>>
					<<link "Apply">>
						<<set $SecExp.core.authority = Math.clamp(Math.trunc(Number($SecExp.core.authority) || _TAuth), 0, 20000), $cheater = 1>>
					<</link>>
				<</if>>
				</div>
			<</if>>

			<<if $sideBarOptions.Security > 0>>
				<div>
				@@.deepskyblue;Security@@ | @@.deepskyblue;<<= Math.trunc($SecExp.security.cap)>>%@@
				<<if _Pass == "Main" && $cheatMode && $cheatModeM>>
					<<set _TSec = $SecExp.security.cap>>
					<<textbox "$SecExp.security.cap" $SecExp.security.cap>>
					<<link "Apply">>
						<<set $SecExp.security.cap = Math.clamp(Math.trunc(Number($SecExp.security.cap) || _TSec), 0, 100), $cheater = 1>>
					<</link>>
				<</if>>
				</div>
			<</if>>

			<<if $sideBarOptions.Crime > 0>>
				<div>
				@@.orangered;Crime@@ | @@.orangered;<<= Math.trunc($SecExp.core.crimeLow)>>%@@
				<<if _Pass == "Main" && $cheatMode && $cheatModeM>>
					<<set _TCrime = $SecExp.core.crimeLow>>
					<<textbox "$SecExp.core.crimeLow" $SecExp.core.crimeLow>>
					<<link "Apply">>
						<<set $SecExp.core.crimeLow = Math.clamp(Math.trunc(Number($SecExp.core.crimeLow) || _TCrime), 0, 100), $cheater = 1>>
					<</link>>
				<</if>>
				</div>
			<</if>>

		<</if>> /* Closes secExp check and associated sideBarOptions options */
	<</if>> /* Closes Pass != "Manage Penthouse""*/

	<p>
		<<includeDOM App.UI.quickMenu()>>
	</p>

	<<if $nextButton != "Continue" && $nextButton != " ">>
		<<if _Pass == "Rules Assistant">>
			<p>[[Rules Assistant Summary]]</p>
		<</if>> /* Closes Pass state check */

		<<if $debugMode > 0>>
			<p>
				Debugging Tools
				<div><<link "Display Variables">><<checkvars>><</link>></div>
				<div>
					<<link "Display Changed Variables">>
						<<set Config.history.maxStates = 2>> /* makes sure we store the current state so we can return to it */
						<<goto "Variable Difference">>
					<</link>>
				</div>
				<div><<link "Bug Report">><<bugreport>><</link>></div>
				<<if $debugModeCustomFunction > 0>>
					<div>
						<<textarea "_customEvalCode" "">>
						<<link "Run Custom Function">>
							<<if _customEvalCode>>
								<<if _customEvalCode.charAt(0) != "(" || $nextLink == ")">> /* second condition is only there for sanityCheck */
									<<set _customEvalCode = "(" + _customEvalCode + ")">>
								<</if>>
								<<if typeof eval(_customEvalCode) === "function">>
									<<run (eval(_customEvalCode))()>>
								<</if>>
							<</if>>
							<<goto _Pass>>
						<</link>>
					</div>
				<</if>>
				<div><<link "Dump Game State">><<run App.Debug.dumpGameState()>><</link>></div>
			</p>
		<</if>>
	<</if>> /* Closes nextButton != "Continue" && nextButton != " " */
<<elseif _Pass == "Starting Girls">>
	<<set _slaveCost = startingSlaveCost($activeSlave)>>
	<p>
		<<if _slaveCost > $cash>>
			@@.red;This slave will cost ''<<print cashFormat(_slaveCost)>>.''<br>
			You only have: <<print cashFormat($cash)>>@@
		<<else>>
			This slave will cost @@.yellowgreen;''<<print cashFormat(_slaveCost)>>.''@@<br>
			You have <<print cashFormat($cash)>>.
		<</if>>
	</p>
<</if>>

<p>
	//''FCE'':// <<= App.Encyclopedia.Dialog.linkSC($encyclopedia, $encyclopedia)>>
</p>

src/gui/storyCaption.tw