code:
:: Alpha disclaimer

<<set $ui = "start">>\
//version $ver build $releaseID//
@@.green;//Mod: expanded age ranges and other tweaks 2016-08-30//@@ @@.darkred;+SV@@
@@.green;//Mod: extra preg content and other crap//@@

''This is an alpha.'' That means the game is missing content, is full of bugs, is imbalanced, and is generally in an incomplete state. The game will keep a start of turn autosave. If you encounter a bug, I strongly recommend you reload your start of turn autosave immediately. Bugs will occasionally cause a bugged slave named $activeSlave.slaveName (or similar) to appear. If this happens, use the "Discard her" option on the slave menu to get rid of her. Then, please report the circumstances (especially what random event you just saw) to the dev. Please submit your feedback and bug reports at https://www.reddit.com/r/freecitiesgame/ or at https://freecitiesblog.blogspot.com/.

An in-game encyclopedia is available from the sidebar (or [[here|Encyclopedia][$nextButton = "Back", $nextLink = passage()]] if you'd prefer to have a look before starting), with answers to most basic gameplay questions.

__Important note for new players, and a reminder for FC veterans:__ when the player is offered a set of choices, the ''Continue'' button at the top of the left sidebar will almost always remain available. Using this to decline all the options presented is //not cheating.// If it's available, it's supposed to be available. It represents the player character politely bowing out of the situation.

If you enjoy FC and feel like using your real-life ¤ to express gratitude, you can do so at https://www.patreon.com/freecitiesdev?ty=h. It's a tip jar, not support for more content. I'm doing this for fun; let's keep it that way.

''Saves from versions prior to 0.6 are not compatible.''

@@.yellow;This is a text-based game that includes descriptions of sexual activity, graphic violence, drug use, and other subjects not suitable for persons under the age of 18. This is a work of fiction; any resemblance to actual persons, places, or events is unintended.@@

[[I am 18 or more years of age, I understand, and I wish to continue|Economy Intro]]


code:
:: SVG filters [widget]
<<widget "SVGFilters">>
<html>
<svg class="defs-only" style="width: 0; height: 0; position: absolute;">
	<filter id="skin-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.15 0 0 0 0 0 0.1 0 0 0 0 0 0.05 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-bronzed" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0.1 0 0 0 0.6 0 0 0 0 0 0.3 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dark" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0 "/>
	</filter>
	<filter id="skin-ebony" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.1 0 0 0 0 0 0.05 0 0 0 0 0 0.05 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-extremely-pale" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.05 0 0 0 0 0 1.05 0 0 0 0 0 1.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-fair" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.8 0 0 0.2 0 0 0.8 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="skin-light" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0.5 0 0.5 0 0 0.5 0 0 0.5 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="skin-light-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.7 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-olive" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0 0 0.8 0 0 0 0 0 0.6 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-pale" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.6 0 0 0.4 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-tanned" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.65 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-white" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dyed-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.25 0 0 0.2 0 0 0 0 0.3 0 0 0 1 0 "/>
	</filter>
	<filter id="skin-dyed-green" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0.2 0.65 0.15 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="skin-dyed-blue" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.3 0 0 0 0 0 0.5 0 0 0 0.4 0.2 0.25 0 0.1 0 0 0 1 0"/>
	</filter>

	<filter id="hair-ashen" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.1 0 0.7 0 0 0.1 0 0 0.7 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-auburn" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.2 0 0 0 0 0 0.15 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-blazing-red" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="0.10" />
			<feFuncG type="gamma" exponent="3.00" />
			<feFuncB type="gamma" exponent="7.50" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.4 0 0 0 0 0 1.3 0 0 0 0 0 0.7 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-blue" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.3 0 0 0 0 0 0.5 0 0 0 0.4 0.2 0.25 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-bright-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.2 0 0.4 0 0 0 0 0 0.1 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-brunette" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.5 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-burgundy" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.45 0 0 0 0.25 0 0.2 0 0 0.1 0 0 0.3 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="hair-chestnut" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0.2 0 0.7 0 0 0 0 0 0.1 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-chocolate-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-copper" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 -0.2 0 0.8 0 0 -0.2 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.5 0 0 0 0 0 0.2 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.1 0 0 0 0 0 0.9 0 0 0 0 0 0.4 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0 0 0.35 0 0 0 0 0 0.1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dark-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.2 0 0.15 0 0 0.1 0 0 0 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-deep-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 -0.3 0 0.3 0 0 -0.1 0 0 0 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-dirty-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.3 0 0.7 0 0 0.3 0 0 0.2 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="hair-fair-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.5 0 0.8 0 0 0.4 0 0 0.6 0 0.2 0 0 0 1 0"/>
	</filter>
	<filter id="hair-ginger" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.2 0 0 0 0.1 0 0.9 0 0 0 0 0 0.1 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-golden" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.7 0 0 0 -0.1 0 1.5 0 0 -0.1 0 0 0.1 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-golden-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.8 0 0 0 -0.3 0 1.6 0 0 -0.4 0 0 0.3 0 0.1 0 0 0 1 0"/>
	</filter>
	<filter id="hair-green" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0.2 0.65 0.15 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-gray" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-grey" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-hazel" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.2 0 0.5 0 0 0.2 0 0 0.15 0 0.15 0 0 0 1 0"/>
	</filter>
	<filter id="hair-light-brown" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0 0 0.7 0 0 0 0 0 0.5 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-light-purple" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.4 0 0.1 0 0 0.2 0 0 0.7 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-neon-blue" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="3.75" />
			<feFuncG type="gamma" exponent="0.75" />
			<feFuncB type="gamma" exponent="0.25" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-neon-green" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="3.00" />
			<feFuncG type="gamma" exponent="0.25" />
			<feFuncB type="gamma" exponent="0.98" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-neon-pink" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="0.10" />
			<feFuncG type="gamma" exponent="1.00" />
			<feFuncB type="gamma" exponent="0.50" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-olive" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0 0 0.6 0 0 0 0 0 0.15 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-onyx-black" color-interpolation-filters="sRGB">
		<feComponentTransfer>
			<feFuncR type="gamma" exponent="5.50" />
			<feFuncG type="gamma" exponent="6.00" />
			<feFuncB type="gamma" exponent="7.00" />
		</feComponentTransfer>
	</filter>
	<filter id="hair-pale-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.45 0 0 0 0.7 0 0.4 0 0 0.7 0 0 0.6 0 0.4 0 0 0 1 0"/>
	</filter>
	<filter id="hair-peachy" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.45 0 0 0 0 0 1.4 -0.1 0 -0.1 0 0 0.85 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-pink" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.5 0 0 0 0 0 1.5 -0.2 0 -0.2 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-platinum-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.6 0 0 0.4 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-purple" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.9 0 0 0 0 0 0.2 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-raven-black" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.2 0 0 0 0 0 0.2 0 0 0 0 0 0.3 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-red" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.4 0 0.25 0 0 0.2 0 0 0 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-red-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1 0 0 0 0.25 0 0.8 0 0 0.1 0 0 0.35 0 0.15 0 0 0 1 0"/>
	</filter>
	<filter id="hair-silver" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.8 0 0 0 0.3 0 0.8 0 0 0.3 0 0 0.8 0 0.3 0 0 0 1 0"/>
	</filter>
	<filter id="hair-strawberry-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="1.2 0 0 0 0.2 0 1.2 0 0 0 0 0 0.7 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-violet" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="2 -1 0 0 0 0 2 -1 0 0 -1 0 2 0 0 0 0 0 1 0"/>
	</filter>
	<filter id="hair-white" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.6 0 0 0 0.5 0 0.6 0 0 0.5 0 0 0.6 0 0.5 0 0 0 1 0"/>
	</filter>
	<filter id="hair-white-blonde" color-interpolation-filters="sRGB">
		<feColorMatrix type="matrix" values="0.7 0 0 0 0.5 0 0.7 0 0 0.5 0 0 0.5 0 0.4 0 0 0 1 0"/>
	</filter>
</svg>
</html>
<</widget>>

repo_name: Anony/fc


code:
:: init [nobr]

/*
FREE CITIES
a text-based slave management game
Copyright (C) 2017 freecitiesdev

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

<<set $returnTo = "init", $nextButton = "Continue", $nextLink = "Alpha disclaimer">>

<<unset $releaseID>>
<<set $ver = "0.10.7", $releaseID = 1024>>
<<if ndef $releaseID>><<set $releaseID = 1024>><</if>>

/* This needs to be broken down into individual files that can be added to StoryInit instead. */

<<if def $slaves>>
	<<set _SL = $slaves.length>>
	<<for _i = 0; _i < _SL; _i++>>
	<<if $slaves[_i].assignment == "be imported">>
		<<set $slaves[_i].ID += 1200000>>
		<<set $slaves[_i].assignment = "rest">>
		<<set $slaves[_i].assignmentVisible = 1>>
		<<set $slaves[_i].weekAcquired = 0>>
		<<set $slaves[_i].newGamePlus = 1>>
		<<PMODinit $slaves[_i]>>
		<<if $slaves[_i].mother > 0>>
			<<set $slaves[_i].mother += 1200000>>
		<<elseif $freshPC == 1 && $slaves[_i].mother == -1>>
			<<set $slaves[_i].mother = -12000000>>
		<<elseif $slaves[_i].mother < -1>>
			<<set $slaves[_i].mother -= 1200000>>
		<</if>>
		<<if $slaves[_i].father > 0>>
			<<set $slaves[_i].father += 1200000>>
		<<elseif $freshPC == 1 && $slaves[_i].father == -1>>
			<<set $slaves[_i].father = -12000000>>
		<<elseif $slaves[_i].father < -1>>
			<<set $slaves[_i].father -= 1200000>>
		<</if>>
		<<set $slaves[_i].daughters = 0>>
		<<set $slaves[_i].sisters = 0>>
		<<set $slaves[_i].canRecruit = 0>>
		<<set $slaves[_i].breedingMark = 0>>
		<<if $arcologies[0].FSRomanRevivalist > 90>>
			<<set $slaves[_i].nationality = "Roman Revivalist">>
		<<elseif $arcologies[0].FSAztecRevivalist > 90>>
			<<set $slaves[_i].nationality = "Aztec Revivalist">>
		<<elseif $arcologies[0].FSEgyptianRevivalist > 90>>
			<<set $slaves[_i].nationality = "Ancient Egyptian Revivalist">>
		<<elseif $arcologies[0].FSEdoRevivalist > 90>>
			<<set $slaves[_i].nationality = "Edo Revivalist">>
		<<elseif $arcologies[0].FSArabianRevivalist > 90>>
			<<set $slaves[_i].nationality = "Arabian Revivalist">>
		<<elseif $arcologies[0].FSChineseRevivalist > 90>>
			<<set $slaves[_i].nationality = "Ancient Chinese Revivalist">>
		<</if>>
		<<if $slaves[_i].relationTarget != 0>>
		<<set $slaves[_i].relationTarget += 1200000>>
		<</if>>
		<<if $slaves[_i].relationshipTarget != 0>>
		<<set $slaves[_i].relationshipTarget += 1200000>>
		<</if>>
		<<set $slaves[_i].rivalry = 0, $slaves[_i].rivalryTarget = 0, $slaves[_i].subTarget = 0>>
	<<else>>
		<<set _dump = removeSlave(_i), _i--, _SL-->>
	<</if>>
	<</for>>
	<<for _k = 0; _k < _SL; _k++>>
		<<for _i = 0; _i < _SL; _i++>>
			<<if $slaves[_k].mother == $slaves[_i].ID || $slaves[_k].father == $slaves[_i].ID>>
				<<set $slaves[_i].daughters += 1>>
			<</if>>
			<<if areSisters($slaves[_k], $slaves[_i]) > 0>>
				<<set $slaves[_i].sisters += 1>>
			<</if>>
		<</for>>
		<<if $slaves[_k].pregSource > 0>>
			<<set $slaves[_k].pregSource += 1200000>>
			<<set _getFather = $slaveIndices[$slaves[_k].pregSource]>>
			<<if ndef _getFather>>
				<<set $slaves[_k].pregSource = 0>>
			<</if>>
		<</if>>
	<</for>>
	<<set $genePool = ngUpdateGenePool($genePool)>>
	/*
	<<for $i = 0; $i < $genePool.length; $i++>>
		<<for $k = 0; $k < $slaves.length; $k++>>
			<<if $genePool[$i].ID+1200000 == $slaves[$k].ID>>
				<<set $genePool[$i].ID += 1200000>>
				<<break>>
			<</if>>
		<</for>>
		<<if $k == $slaves.length>>
			<<set $dump = $genePool.pluck([$i], [$i])>><<set $i-->>
		<</if>>
	<</for>>
	*/
	<<for _i = 0; _i < _SL; _i++>>
	<<if $slaves[_i].relation != 0>>
		<<set _seed = 0, _rt = $slaves[_i].relationTarget, _ID = $slaves[_i].ID>>
		<<set _j = $slaveIndices[_rt]>>
		<<if def _j && $slaves[_j].relationTarget == _ID>>
			<<set _seed = 1>>
		<</if>>
		<<if _seed == 0>>
		<<set $slaves[_i].relation = 0, $slaves[_i].relationTarget = 0>>
		<</if>>
	<</if>>
	<<if $slaves[_i].relationship > 0>>
		<<set _seed = 0, _rt = $slaves[_i].relationshipTarget, _ID = $slaves[_i].ID>>
		<<set _j = $slaveIndices[_rt]>>
		<<if def _j && $slaves[_j].relationshipTarget == _ID>>
			<<set _seed = 1>>
		<</if>>
		<<if _seed == 0>>
		<<set $slaves[_i].relationship = 0, $slaves[_i].relationshipTarget = 0>>
		<</if>>
	<</if>>
	<</for>>
	<<for _i = 0; _i < _SL; _i++>>
	<<if $familyTesting == 1>>
		<<if $slaves[_i].canRecruit == 1>>
			/*<<set $recruiters.push($slaves[_i])>>*/
		<</if>>
	<<else>>
	<<if $slaves[_i].relation == 0>>
		<<if random(1,100) <= 5>>
		<<set $slaves[_i].recruiter = "twin">>
		<<elseif ($slaves[_i].actualAge > 32) && (random(1,100) <= 41)>>
		<<set $slaves[_i].recruiter = "mother">>
		<<elseif ($slaves[_i].actualAge < 24) && (random(1,100) <= 40)>>
		<<set $slaves[_i].recruiter = "daughter">>
		<<elseif ($slaves[_i].actualAge < 43) && (random(1,100) <= 20)>>
		<<set $slaves[_i].recruiter = "older sister">>
		<<elseif ($slaves[_i].actualAge < 25) && ($slaves[_i].actualAge > 18) && (random(1,100) <= 20)>>
		<<set $slaves[_i].recruiter = "young sister">>
		<</if>>
	<<else>>
		<<set $slaves[_i].recruiter = 0>>
	<</if>>
	<</if>> /*closes family mode */
	<<set $slaves[_i].milk = 0>>
	<<set $slaves[_i].cum = 0>>
	<<set $slaves[_i].births = 0>>
	<<set $slaves[_i].mammaryCount = 0>>
	<<set $slaves[_i].penetrativeCount = 0>>
	<<set $slaves[_i].oralCount = 0>>
	<<set $slaves[_i].analCount = 0>>
	<<set $slaves[_i].vaginalCount = 0>>
	<</for>>
	<<set $slavesOriginal = []>> /* not used by pregmod */
	<<if ndef $PC.intelligence>>
		<<set $PC.intelligence = 3>>
	<</if>>
	<<if ndef $PC.face>>
		<<set $PC.face = 100>>
	<</if>>
	<<if ndef $PC.actualAge>>
		<<if $PC.age == 1>>
			<<set $PC.actualAge = 20>>
		<<elseif $PC.age == 2>>
			<<set $PC.actualAge = 35>>
		<<elseif $PC.age == 3>>
			<<set $PC.actualAge = 50>>
		<</if>>
	<</if>>
	<<if ndef $PC.visualAge>>
		<<set $PC.visualAge = $PC.actualAge>>
	<</if>>
	<<if ndef $PC.physicalAge>>
		<<set $PC.physicalAge = $PC.actualAge>>
	<</if>>
	<<if ndef $PC.birthWeek>>
		<<set $PC.birthWeek = 0>>
	<</if>>
	<<if ndef $PC.markings>>
		<<set $PC.markings = "none">>
	<</if>>
	<<if ndef $PC.mpreg>> /* for <<KnockMeUp $PC>> */
		<<set $PC.mpreg = 0>>
	<</if>>
	<<if ndef $PC.slavesKnockedUp>>
		<<set $PC.slavesKnockedUp = 0>>
	<</if>>
	<<if ndef $PC.slavesFathered>>
		<<set $PC.slavesFathered = 0>>
	<</if>>
	<<if ndef $PC.pronoun>>
		<<if $PC.title == 1>>
			<<set $PC.pronoun = "he", $PC.possessive = "his", $PC.object = "him">>
		<<else>>
			<<set $PC.pronoun = "she", $PC.possessive = "her", $PC.object = "her">>
		<</if>>
	<</if>>
	<<if ndef $PC.pregKnown>>
		<<if $PC.preg > 0>>
			<<set $PC.pregKnown = 1>>
		<<else>>
			<<set $PC.pregKnown = 0>>
		<</if>>
	<</if>>
	<<if ndef $PC.pregType>>
		<<if $PC.preg > 0>>
			<<set $PC.pregType = 1>>
		<<else>>
			<<set $PC.pregType = 0>>
		<</if>>
	<</if>>
	<<if ndef $PC.belly>>
		<<if $PC.preg > 0>>
			<<set $PC.belly = getPregBellySize($PC)>>
		<<else>>
			<<set $PC.belly = 0>>
		<</if>>
	<</if>>
	<<if ndef $PC.degeneracy>>
		<<set $PC.degeneracy = 0>>
	<</if>>
	<<if ndef $PC.pregWeek>>
		<<if $PC.preg > 0>>
			<<set $PC.pregWeek = $PC.preg>>
		<<else>>
			<<set $PC.pregWeek = 0>>
		<</if>>
	<</if>>
	<<set $PC.reservedChildren = 0>>
<<else>>
	<<set $slaves = []>>
	<<set $slavesOriginal = []>> /* not used by pregmod */
	<<set $genePool = []>>
<</if>>

<<set $slaveIndices = slaves2indices()>>
<<set $organs = []>>
<<set $ArcadeiIDs = [], $BrothiIDs = [], $CellBiIDs = [], $CliniciIDs = [], $ClubiIDs = [], $DairyiIDs = [], $HGSuiteiIDs = [], $MastSiIDs = [], $SchlRiIDs = [], $ServQiIDs = [], $SpaiIDs = []>>

<<if ndef $saveImported>>
	<<set $saveImported = 0>>
<</if>>

<<if $saveImported == 0>> /* new game (not NG+) */

	<<initPC>>
	<<set $freshPC = 0>>
	<<set $cheater = 0>>
	<<set $cash = 10000>>
	<<set $normalizedEvents = 0>>
	<<set $autosave = 1>>
	<<set $useFSNames = 1>>
	<<set $seeDetails = 1>>
	<<set $seeDesk = 1>>
	<<set $newModelUI = 1>>
	<<set $seeArcology = 1>>
	<<set $seeFCNN = 1>>
	<<set $useSummaryCache = true>>
	<<set $seeExtreme = 0>>
	<<set $seeHyperPreg = 0>>
	<<set $seePreg = 1>>
	<<set $seeCircumcision = 1>>
	<<set $seeAge = 1>>
	<<set $seeDicks = 25>>
	<<set $seeRace = 1>>
	<<set $seeNationality = 1>>
	<<set $seeImages = 0>>
	<<set $imageChoice = 0>>
	<<set $seeVectorArtHighlights = 1>>
	<<set $seeMainFetishes = 0>>
	<<set $seeSummaryImages = 1>>
	<<set $seeReportImages = 1>>
	<<set $lineSeparations = 1>>
	<<set $showSexualHistory = 1>>
	<<set $showBodyMods = 0>>
	<<set $showImplantEffects = 1>>
	<<set $showClothing = 1>>
	<<set $showAgeDetail = 1>>
	<<set $showBoobCCs = 1>>
	<<set $showHeightCMs = 1>>
	<<set $showDickCMs = 1>>
	<<set $showScores = 1>>
	<<set $showAssignToScenes = 1>>
	<<set $showEWD = 1>>
	<<set $showEWM = 1>>
	<<set $showVignettes = 1>>
	<<set $showAppraisal = 1>>
	<<set $positionMainLinks = -1>>
	<<set $showTipsFromEncy = 1>>
	<<set $displayAssignments = 1>>
	<<set $sortSlavesBy = "devotion">>
	<<set $sortSlavesOrder = "descending">>
	<<set $sortSlavesMain = 1>>
	<<set $HGSeverity = 0>>
	<<set $HGFormality = 1>>
	<<set $universalRulesConsent = 0>>
	<<set $universalRulesRest = 0>>
	<<set $universalRulesFacilityWork = 1>>
	<<set $universalRulesImpregnation = "none">>
	<<set $universalRulesBirthing = 0>>
	<<set $universalRulesCSec = 0>>
	<<set $universalRulesNewSlavesRA = 1>>
	<<set $universalRulesAssignsSelfFacility = 0>>
	<<set $universalRulesImmobileSlavesMaintainMuscles = 0>>
	<<set $slaveDead = 0>>
	<<set $rulesAssistantMain = 1>>
	<<set $rulesAssistantAuto = 0>>
	<<set $abbreviateDevotion = 2>>
	<<set $abbreviateRules = 2>>
	<<set $abbreviateClothes = 2>>
	<<set $abbreviateOrigins = 2>>
	<<set $abbreviateRulesets = 2>>
	<<set $abbreviateNationality = 2>>
	<<set $abbreviateHealth = 2>>
	<<set $abbreviateDiet = 2>>
	<<set $abbreviateDrugs = 2>>
	<<set $abbreviateRace = 2>>
	<<set $abbreviateGenitalia = 2>>
	<<set $abbreviatePhysicals = 2>>
	<<set $abbreviateSkills = 2>>
	<<set $abbreviateMental = 2>>
	<<set $abbreviateSidebar = 2>>
	<<set $summaryStats = 1>>
	<<set $nicknamesAllowed = 1>>
	<<set $modRequestsAllowed = 1>>
	<<set $expansionRequestsAllowed = 1>>
	<<set $plot = 1>>
	<<set $continent = "North America">>
	<<set $terrain = "rural">>
	<<set $language = "English">>
	<<set $headGirlTrainsSkills = 1>>
	<<set $headGirlTrainsHealth = 1>>
	<<set $headGirlTrainsObedience = 1>>
	<<set $headGirlTrainsFlaws = 1>>
	<<set $headGirlSoftensFlaws = 1>>
	<<set $headGirlTrainsParaphilias = 1>>
	<<set $retainCareer = 1>>
	<<set $useSlaveSummaryTabs = 0>>
	<<set $useSlaveSummaryOverviewTab = 0>>
	<<set $useSlaveListInPageJSNavigation = 0>>

	/* master suite reporting and alternate descriptions */
	<<set $verboseDescriptions = 0>>
	/* Accordion 000-250-006 */
	<<set $useAccordion = 0>>

	<<set $useTabs = 0>>

	/*onlyintendeddickgirls variables */
	<<set $makeDicks = 0>>

	/* economy reports variables */
	<<set $showEconomicDetails = 0>>

	/* Pregmod specific */
	<<set $economy = 1>>
	<<set $neighboringArcologies = 3>>
	<<set $newDescriptions = 0>>
	<<set $familyTesting = 0>>
	<<set $inbreeding = 1>>
	<<set $allowFamilyTitles = 0>>

	/% Begin mod section: toggle whether slaves lisp. %/
	<<set $disableLisping = 0>>
	/% End mod section: toggle whether slaves lisp. %/

	<<set $weightAffectsAssets = 1>>
	<<set $curativeSideEffects = 1>>

	/*non-vanilla shit*/
	<<set $pedo_mode = 0>>
	<<set $minimumSlaveAge = 18>>
	<<set $fertilityAge = 13>>
	<<silently>>
	FertilityAge($fertilityAge)
	<</silently>>
	<<set $potencyAge = 13>>
	<<set $AgePenalty = 1>>
	<<set $precociousPuberty = 0>>
	<<set $loliGrow = 1>>

	<<set $retirementAge = 45>
	<<set $customRetirementAge = 45>>
	<<set $FSCreditCount = 5>>
	<<set $FSCreditCountString = "five">>

	<<include "Init Rules">>

<<else>> /* imported save (NG+) */

	<<if $freshPC == 0>>
		<<if def $arcologies[0].prosperity>>
			<<set $cash += 250*$arcologies[0].prosperity*$arcologies[0].ownership>>
		<</if>>
		<<set $cash = Math.clamp(1000*Math.trunc($cash/100000), 5000, 1000000)>>
		<<if $retainCareer == 0>>
			<<set $PC.career = "arcology owner", $PC.trading = 100, $PC.warfare = 100, $PC.hacking = 100, $PC.slaving = 100, $PC.engineering = 100, $PC.medicine = 100>>
		<</if>>
		<<if $PC.mother > 0>>
			<<set $PC.mother += 1200000>>
		<<elseif $PC.mother < 0>>
			<<set $PC.mother -= 1200000>>
		<</if>>
		<<if $PC.father > 0>>
			<<set $PC.father += 1200000>>
		<<elseif $PC.father < 0>>
			<<set $PC.father -= 1200000>>
		<</if>>
	<<else>>
		<<initPC>>
		<<set $cheater = 0>>
		<<set $cash = 10000>>
	<</if>>

<</if>>

<<set $targetArcology = {type: "New"}>>

<<set $REFeminizationCheckinIDs = []>>
<<set $REMILFCheckinIDs = []>>
<<set $REOrientationCheckinIDs = []>>
<<set $REUglyCheckinIDs = []>>
<<set $REButtholeCheckinIDs = []>>
<<set $REFutaSisterCheckinIDs = []>>
<<set $REReductionCheckinIDs = []>>
<<set $activeSlave = 0>>

<<set $boomerangSlave = 0, $boomerangWeeks = 0, $boomerangBuyer = 0>>

<<set $bioreactorPerfectedID = 0>>

<<set $independenceDay = 0>>
<<set $invasionVictory = 0>>
<<set $daughtersVictory = 0>>
<<set $startingGirlCopied = 0, $startingGirlRelation = 0>>
<<set $archetyped = 0>>

<<set $slavesVisible = 0>>
<<set $dormitory = 20>>
<<set $dormitoryPopulation = 0>>
<<set $rooms = 5>>
<<set $roomsPopulation = 0>>

<<set $brothelSlaves = 0>>
<<set $brothelDecoration = "standard">>
<<set $brothelUpgradeDrugs = 0>>
<<set $brothelAdsSpending = 0>>
<<set $brothelAdsOld = 0>>
<<set $brothelAdsModded = 0>>
<<set $brothelAdsImplanted = 0>>
<<set $brothelAdsStacked = 0>>
<<set $brothelAdsPreg = 0>>
<<set $brothelAdsXX = 0>>
<<set $brothelName = "the Brothel">>
<<set $brothelNameCaps = "The Brothel">>
<<set $brothel = 0>>
<<set $dairySlaves = 0>>
<<set $dairyDecoration = "standard">>
<<set $dairyPrepUpgrade = 0>>
<<set $dairyStimulatorsUpgrade = 0>>
<<set $dairyStimulatorsSetting = 0>>
<<set $dairyStimulatorsSettingChanged = 0>>
<<set $dairyFeedersUpgrade = 0>>
<<set $dairyFeedersSetting = 0>>
<<set $dairyFeedersSettingChanged = 0>>
<<set $dairyPregUpgrade = 0>>
<<set $dairyPregSetting = 0>>
<<set $dairyPregSettingChanged = 0>>
<<set $dairyRestraintsUpgrade = 0>>
<<set $dairyRestraintsSetting = 0>>
<<silently>>
DairyRestraintsSetting($dairyRestraintsSetting)
<</silently>>
<<set $dairySlimMaintainUpgrade = 0>>
<<set $dairySlimMaintain = 0>>
<<set $dairyHyperPregRemodel = 0>>
<<set $dairyWeightSetting = 0>>
<<set $dairyImplantsSetting = 1>>
<<set $dairyUpgradeMenials = 0>>
<<set $createBioreactors = 0>>
<<set $bioreactorsAnnounced = 0>>
<<set $bioreactorsHerm = 0>>
<<set $bioreactorsXX = 0>>
<<set $bioreactorsXY = 0>>
<<set $bioreactorsBarren = 0>>
<<set $dairyName = "the Dairy">>
<<set $dairyNameCaps = "The Dairy">>
<<set $dairy = 0>>
<<set $cumSlaves = 0>>
<<set $clubSlaves = 0>>
<<set $clubDecoration = "standard">>
<<set $clubUpgradePDAs = 0>>
<<set $clubAdsSpending = 0>>
<<set $clubAdsOld = 0>>
<<set $clubAdsModded = 0>>
<<set $clubAdsImplanted = 0>>
<<set $clubAdsStacked = 0>>
<<set $clubAdsPreg = 0>>
<<set $clubAdsXX = 0>>
<<set $clubName = "the Club">>
<<set $clubNameCaps = "The Club">>
<<set $club = 0>>
<<set $servantsQuartersSlaves = 0>>
<<set $servantsQuartersDecoration = "standard">>
<<set $servantsQuartersUpgradeMonitoring = 0>>
<<set $servantsQuarters = 0>>
<<set $servantsQuartersName = "the Servants' Quarters">>
<<set $servantsQuartersNameCaps = "The Servants' Quarters">>
<<set $schoolroomSlaves = 0>>
<<set $schoolroomDecoration = "standard">>
<<set $schoolroomUpgradeSkills = 0>>
<<set $schoolroomUpgradeLanguage = 0>>
<<set $schoolroomUpgradeRemedial = 0>>
<<set $schoolroom = 0>>
<<set $schoolroomName = "the Schoolroom">>
<<set $schoolroomNameCaps = "The Schoolroom">>
<<set $spaSlaves = 0>>
<<set $spaDecoration = "standard">>
<<set $spa = 0>>
<<set $spaUpgrade = 0>>
<<set $spaFix = 0>>
<<set $spaName = "the Spa">>
<<set $spaNameCaps = "The Spa">>
<<set $incubator = 0>>
<<set $incubatorSlaves = 0>>
<<set $incubatorOrgans = []>>
<<set $incubatorOldID = 0>>
<<set $incubatorUpgradeSpeed = 5>>
<<set $incubatorUpgradeWeight = 0>>
<<set $incubatorUpgradeMuscles = 0>>
<<set $incubatorUpgradeGrowthStims = 0>>
<<set $incubatorUpgradeReproduction = 0>>
<<set $incubatorUpgradeOrgans = 0>>
<<set $incubatorImprintSetting = 0>>
<<set $incubatorWeightSetting = 0>>
<<set $incubatorMusclesSetting = 0>>
<<set $incubatorGrowthStimsSetting = 0>>
<<set $incubatorReproductionSetting = 0>>
<<set $incubatorName = "the Incubator">>
<<set $incubatorNameCaps = "The Incubator">>
<<set $reservedChildren = 0>>
<<set $tanks = []>>
<<set $clinicSlaves = 0>>
<<set $clinicDecoration = "standard">>
<<set $clinic = 0>>
<<set $clinicUpgradeFilters = 0>>
<<set $clinicUpgradeScanner = 0>>
<<set $clinicUpgradePurge = 0>>
<<set $clinicName = "the Clinic">>
<<set $clinicNameCaps = "The Clinic">>
<<set $arcadeSlaves = 0>>
<<set $arcadeDecoration = "standard">>
<<set $arcadeUpgradeInjectors = 0>>
<<set $arcadeUpgradeFuckdolls = 0>>
<<set $arcadeUpgradeCollectors = 0>>
<<set $arcadeUpgradeMenials = 0>>
<<set $arcadeName = "the Arcade">>
<<set $arcadeNameCaps = "The Arcade">>
<<set $arcade = 0>>
<<set $fuckdollsSold = 0>>
<<set $cellblockSlaves = 0>>
<<set $cellblockDecoration = "standard">>
<<set $cellblockUpgrade = 0>>
<<set $cellblock = 0>>
<<set $cellblockName = "the Cellblock">>
<<set $cellblockNameCaps = "The Cellblock">>
<<set $cellblockWardenCumsInside = 1>>
<<set $masterSuiteSlaves = 0>>
<<set $masterSuiteDecoration = "standard">>
<<set $masterSuiteUpgradeLuxury = 0>>
<<set $masterSuiteUpgradePregnancy = 0>>				/* Is the upgrade active? */
<<set $masterSuitePregnancyFertilityDrugs = 0>>		/* Are slaves being put on fertility drugs? */
<<set $masterSuitePregnancyFertilitySupplements = 0>>	/* Are those drugs being supplemented (health benefits and (even) more multiple pregnancies) */
<<set $masterSuitePregnancySlaveLuxuries = 0>>			/* Are the slaves being given some nicer things to reduce stress during preg? (health/devotion/trust benefits) */
<<set $universalHGImpregnateMasterSuiteToggle = 0>>	/* Will the HG impregnate fertile slaves in the MS? */
<<set $masterSuiteHyperPregnancy = 0>>
<<set $masterSuite = 0>>
<<set $masterSuiteName = "the Master Suite">>
<<set $masterSuiteNameCaps = "The Master Suite">>
<<set $HGSuite = 0>>
<<set $HGSuiteSlaves = 0>>
<<set $HGSuiteSurgery = 1>>
<<set $HGSuiteDrugs = 1>>
<<set $HGSuiteHormones = 1>>
<<set $HGSuiteEquality = 0>>
<<set $HGSuiteName = "the Head Girl Suite">>
<<set $HGSuiteNameCaps = "The Head Girl Suite">>
<<set $fighterIDs = []>>
<<set $pitBG = 0>>
<<set $pitAudience = "none">>
<<set $pitLethal = 0>>
<<set $pitVirginities = 0>>
<<set $pitFought = 0>>
<<set $pit = 0>>
<<set $pitName = "the Pit">>
<<set $pitNameCaps = "The Pit">>
<<set $dojo = 0>>
<<set $feeder = 0>>
<<set $cockFeeder = 0>>
<<set $suppository = 0>>
<<set $studio = 0>>
<<set $weatherCladding = 0>>
<<set $weatherAwareness = 0>>
<<set $boobAccessibility = 0>>
<<set $servantMilkers = 0>>
<<set $servantMilkersMultiplier = 1>>
<<set $foodCost = 25>>
<<set $revealFoodEffects = 0>>

<<set $legendaryWhoreID = 0>>
<<set $legendaryEntertainerID = 0>>
<<set $legendaryCowID = 0>>
<<set $legendaryBallsID = 0>>
<<set $legendaryWombID = 0>>
<<set $legendaryAbolitionistID = 0>>

<<set $FSAnnounced = 0>>
<<set $FSCredits = 0>>
<<set $FSGotRepCredits = 0>>
<<set $FSSingleSlaveRep = 10>>
<<set $FSSpending = 0>>
<<set $FSLockinLevel = 100>>
<<set $applyLaw = 0>>
<<set $FSPromenade = {Subjugationist: 0, Supremacist: 0, GenderRadicalist: 0, GenderFundamentalist: 0, Paternalist: 0, Degradationist: 0, BodyPurist: 0, TransformationFetishist: 0, YouthPreferentialist: 0, MaturityPreferentialist: 0, SlimnessEnthusiast: 0, AssetExpansionist: 0, Pastoralist: 0, PhysicalIdealist: 0, ChattelReligionist: 0, AztecRevivalist: 0, RomanRevivalist: 0, EgyptianRevivalist: 0, EdoRevivalist: 0, ArabianRevivalist: 0, ChineseRevivalist: 0, Repopulationist: 0, Eugenics: 0, Hedonism: 0}>>

<<set $corpAnnounced = 0>>
<<set $corpIncorporated = 0>>
<<set $corpMarket = 0>>
<<set $corpPeopleEnslaved = 0>>
<<set $sharePrice = 0>>
<<set $personalShares = 0>>
<<set $publicShares = 0>>
<<set $corpCash = 0>>
<<set $corpProfit = 0>>
<<set $generalAssets = 0>>
<<set $slaveAssets = 0>>
<<set $entrapmentAssets = 0>>
<<set $captureAssets = 0>>
<<set $trainingAssets = 0>>
<<set $surgicalAssets = 0>>
<<set $drugAssets = 0>>
<<set $generalAssetPrice = 10>>
<<set $slaveAssetPrice = 10>>
<<set $entrapmentAssetPrice = 10>>
<<set $captureAssetPrice = 10>>
<<set $trainingAssetPrice = 10>>
<<set $surgicalAssetPrice = 10>>
<<set $drugAssetPrice = 10>>
<<set $generalUpgradeBreaking = "unselected">>
<<set $generalUpgradeWeight = "unselected">>
<<set $generalUpgradeMuscle = "unselected">>
<<set $entrapmentUpgradeDevotionOne = "unselected">>
<<set $entrapmentUpgradeDevotionTwo = "unselected">>
<<set $entrapmentUpgradeIntelligence = "unselected">>
<<set $captureUpgradeGender = "unselected">>
<<set $captureUpgradeAge = "unselected">>
<<set $captureUpgradeRace = "unselected">>
<<set $trainingUpgradeAccent = "unselected">>
<<set $trainingUpgradeEducation = "unselected">>
<<set $trainingUpgradeSexEd = "unselected">>
<<set $surgicalUpgradeCosmetics = "unselected">>
<<set $surgicalUpgradeImplants = "unselected">>
<<set $surgicalUpgradeGenitalia = "unselected">>
<<set $drugUpgradeHormones = "unselected">>
<<set $drugUpgradeInjectionOne = "unselected">>
<<set $drugUpgradeInjectionTwo = "unselected">>
<<set $corpValue = 0>>

<<set $shelterSlave = 0>>
<<set $shelterSlaveBought = 0>>
<<set $shelterAbuse = 0>>
<<set $shelterSlaveGeneratedWeek = 0>>

/* alternate clothing access variables */
<<set $clothesBoughtBunny = 0>>
<<set $clothesBoughtConservative = 0>>
<<set $clothesBoughtChains = 0>>
<<set $clothesBoughtWestern = 0>>
<<set $clothesBoughtOil = 0>>
<<set $clothesBoughtHabit = 0>>
<<set $clothesBoughtToga = 0>>
<<set $clothesBoughtHuipil = 0>>
<<set $clothesBoughtKimono = 0>>
<<set $clothesBoughtHarem = 0>>
<<set $clothesBoughtQipao = 0>>
<<set $clothesBoughtEgypt = 0>>
<<set $clothesBoughtBelly = 0>>
<<set $clothesBoughtMaternityDress = 0>>
<<set $clothesBoughtMaternityLingerie = 0>>
<<set $clothesBoughtLazyClothes = 0>>
<<set $toysBoughtDildos = 0>>
<<set $toysBoughtGags = 0>>
<<set $toysBoughtButtPlugs = 0>>
<<set $toysBoughtButtPlugTails = 0>>
<<set $buckets = 0>>
/* assistant FS appearance variable */
<<set $assistantFSAppearance = "default">>

<<set $assistantPronouns = {pronoun: "she", possessivePronoun: "hers", possessive: "her", object: "her", objectReflexive: "herself", noun: "girl"}>>

/*pregmod variables */
<<set $specialSlavesPriceOverride = 0>>
<<set $pregAccessibility = 0>>
<<set $dickAccessibility = 0>>
<<set $ballsAccessibility = 0>>
<<set $buttAccessibility = 0>>
<<set $ageMode = 0>>
<<set $enema = 0>>
<<set $medicalEnema = 0>>
<<set $dairyPiping = 0>>
<<set $inflatedSlavesMilk = 0>>
<<set $inflatedSlavesCum = 0>>
<<set $milkPipeline = 0>>
<<set $cumPipeline = 0>>
<<set $burstee = 0>>
<<set $slaveDeath = 0>>
<<set $clinicInflateBelly = 0>>
<<set $playerBred = 0>>
<<set $propOutcome = 0>>
<<set $EliteSires = ["moves", "quick", "crazy", "virgin", "futa", "preggo"]>>
<<set $startingPoint = -1>>
<<set $PhysicalRetirementAgePolicy = 0>>
<<set $raped = -1>>
<<set $children = []>>
<<set $missingParentID = -10000>>
<<set $startingSlaveRelative = 0>>
<<set $mom = 0>>
<<set $animalParts = 0>>
<<set $showBestiality = 0>>
<<set $originOveride = 0>>
<<set $playerAging = 2>>
<<set $pregSpeedControl = 0>>
<<set $clinicSpeedGestation = 0>>
<<set $playerSurgery = 0>>
<<set $bodyswapAnnounced = 0>>
<<set $surnamesForbidden = 0>>
<<set $menstruation = 0>>
<<set $FCTVcount = 0>>
<<set $FCTVrate = 4>>
<<set $FCTVreceiver = 0>>
<<set $receiverAvailable = 0>>
<<set $FCTVshow = 0>>
<<set $lastShow = 0>>
<<set $randShow = 0>>
<<set $MercenariesMessageSent = 0>>
<<set $SpecialForcesMessageSent = 0>>
<<set $BodyguardHasSucessfullyRecivedSignal = 0>>
<<set $finalChoice = "none">>
<<set $eliteTotal = 12>>
<<set $eliteDead = 0>>
<<set $eliteVegetable = 0>>
<<set $eliteFate = 0>>
<<set $swanSong = 0>>
<<set $failedElite = 0>>
<<set $eugenicsFullControl = 0>>
<<set $badC = 0, $badB = 0>>

<<set $schoolSuggestion = 0>>
<<set $TSS = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $GRI = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $SCP = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $LDE = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $TGA = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $TCR = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $TFS = {farmUpgrade: 0, schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>
<<set $futaAddiction = 0>>
<<set $HA = {schoolUpgrade: 0, schoolPresent: 0, schoolProsperity: 0, subsidize: 0, schoolAnnexed: 0, studentsBought: 0, schoolSale: 0}>>

<<set $IDNumber = 1>>

<<set $week = 1>>
<<set $month = "January">>
<<set $day = 19>>
<<set $year = 2037>>

<<set $weddingPlanned = 0>>
<<set $weddingSlaveID = 0>>
<<set $personalAttention = "sex">>
<<set $HeadGirl = 0>>
<<set $HGTimeInGrade = 0>>
<<set $HGEnergy = 0>>
<<set $HGCum = 0>>
<<set $Recruiter = 0>>
<<set $recruiterTarget = "desperate whores">>
<<set $recruiterProgress = 0>>
<<set $recruiterIdleRule = "number">>
<<set $recruiterIdleNumber = 20>>
<<set $bodyguardTrains = 1>>
<<set $Bodyguard = 0>>
<<set $Madam = 0>>
<<set $DJ = 0>>
<<set $Milkmaid = 0>>
<<set $milkmaidImpregnates = 0>>
<<set $Collectrix = 0>>
<<set $Stewardess = 0>>
<<set $stewardessImpregnates = 0>>
<<set $Schoolteacher = 0>>
<<set $Attendant = 0>>
<<set $Nurse = 0>>
<<set $Wardeness = 0>>
<<set $Concubine = 0>>
<<set $assistant = 0>>
<<set $assistantPower = 0>>
<<set $economicUncertainty = 10>>
<<set $assistantAppearance = "normal">>
<<set $assistantExtra1 = 0>>
<<set $assistantExtra2 = 0>>
<<set $assistantOptions = 0>>
<<set $assistantFSOptions = 0>>
<<set $assistantName = "your personal assistant">>
<<set $assistantNameAnnounced = 0>>
<<set $assistantBodyDesire = 0>>
<<set $marketAssistantAnnounced = 0>>
<<set $marketAssistantRelationship = "cute">>
<<set $marketAssistantLimit = 0>>
<<set $marketAssistantAggressiveness = 0>>

<<set $justiceEvents = ["slave deal", "slave training", "majority deal", "indenture deal", "virginity deal"]>> /* not in setupVars because we remove events from this array as they occur */

<<set $fixedNationality = 0>>
<<set $fixedRace = 0>>
<<set $ui = "start">>

<<set $brandTarget = "buttocks">>
<<set $brandDesign = "your initials">>

<<set $oralTotal = 0>>
<<set $vaginalTotal = 0>>
<<set $analTotal = 0>>
<<set $mammaryTotal = 0>>
<<set $penetrativeTotal = 0>>
<<set $milkTotal = 0>>
<<set $cumTotal = 0>>
<<set $birthsTotal = 0>>
<<set $pitKillsTotal = 0>>

<<set $collaboration = 0>>
<<set $traitor = 0>>
<<set $hackerSupport = 0>>
<<set $hostage = 0>>
<<set $hostageAnnounced = 0>>
<<set $hostageCost = 0>>
<<set $hostageRescued = 0>>
<<set $hostageGiveIn = 0>>
<<set $rivalSet = 0>>
<<set $rivalryFS = 0>>
<<set $rivalryFSAdopted = 0>>
<<set $rivalryFSRace = 0>>
<<set $rivalOwner = 0>>
<<set $rivalOwnerEnslaved = 0>>
<<set $rivalryPower = 0>>
<<set $rivalryDuration = 0>>
<<set $nationHate = 0>>
<<set $slaveMedic = 0>>
<<set $PShoot = 0>>
<<set $PSnatch = 0>>
<<set $PRaid = 0>>
<<set $PAid = 0>>
<<set $PPit = 0>>

<<set $dispensary = 0>>
<<set $dispensaryUpgrade = 0>>
<<set $organFarmUpgrade = 0>>
<<set $completedOrgans = []>>
<<set $limbsCompleted = 0>>
<<set $limbs = []>>
<<set $ImplantProductionUpgrade = 0>>
<<set $permaPregImplant = 0>>
<<set $injectionUpgrade = 0>>
<<set $hormoneUpgradeMood = 0>>
<<set $hormoneUpgradeShrinkage = 0>>
<<set $hormoneUpgradePower = 0>>
<<set $pubertyHormones = 0>>
<<set $dietXXY = 0>>
<<set $dietCleanse = 0>>
<<set $cumProDiet = 0>>
<<set $dietFertility = 0>>
<<set $curativeUpgrade = 0>>
<<set $growthStim = 0>>
<<set $reproductionFormula = 0>>
<<set $aphrodisiacUpgrade = 0>>
<<set $aphrodisiacUpgradeRefine = 0>>
<<set $healthyDrugsUpgrade = 0>>
<<set $superFertilityDrugs = 0>>
<<set $bellyImplants = 0>>
<<set $cervixImplants = 0>>
<<set $meshImplants = 0>>
<<set $prostateImplants = 0>>
<<set $youngerOvaries = 0>>
<<set $prostheticsUpgrade = 0>>

<<set $surgeryUpgrade = 0>>

<<set $barracks = 0>>
<<set $mercenaries = 0>>
<<set $mercenariesHelpCorp = 0>>
<<set $personalArms = 0>>

<<set $saleDescription = 0>>
<<set $gingering = 0>>
<<set $beforeGingering = 0>>
<<set $gingeringDetected = 0>>
<<set $gingeringDetection = 0>>
<<set $surgeryDescription = 0>>
<<set $encyclopedia = "How to Play">>
<<set $showEncyclopedia = 1>>

<<set $trinkets = []>>
<<set $SPcost = 1000>>
<<set $preOwnedViewed = 0>>
<<set $debtWarned = 0>>
<<set $internationalTrade = 1>>
<<set $internationalVariety = 0>>
<<set $slaveCostFactor = 0.95>>
<<set $menialDemandFactor = 0>>
<<set $minimumSlaveCost = 2500>>
<<set $facilityCost = 100>>
<<set $enduringRep = 1000>>
<<set $rep = 1000>>
<<set $repGain = 0>>
<<set $repLoss = 0>>
<<set $cashLastWeek = 0>>

<<set $arcologyUpgrade = {drones: 0, hydro: 0, apron: 0, grid: 0, spire: 0}>>

<<set $AGrowth = 2>>
<<set $ACitizens = 4000>>
<<set $ASlaves = 1000>>

<<set $sectors = [
	{type: "Penthouse", ownership: 1},
	{type: "Empty", ownership: 0},
	{type: "Empty", ownership: 0},
	{type: "Empty", ownership: 0},
	{type: "Empty", ownership: 0},
	{type: "Shops", ownership: 1},
	{type: "Shops", ownership: 1},
	{type: "Shops", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Apartments", ownership: 1},
	{type: "Markets", ownership: 1},
	{type: "Markets", ownership: 1},
	{type: "Markets", ownership: 1},
	{type: "Markets", ownership: 1},
	{type: "Markets", ownership: 1},
	{type: "Manufacturing", ownership: 1},
	{type: "Manufacturing", ownership: 1},
	{type: "Manufacturing", ownership: 1},
	{type: "Manufacturing", ownership: 1},
	{type: "Manufacturing", ownership: 1}
]>>

<<for _i = 0; _i < 12; _i++>>
	<<set _j = random(5,28)>>
	<<if $sectors[_j].ownership == 1>>
		<<set $sectors[_j].ownership = 0>>
	<<else>>
		<<set _i-->>
	<</if>>
<</for>>

<<set $helots = 0>>
<<set $fuckdolls = 0>>
<<set $menialBioreactors = 0>>
<<set $prestigeAuctioned = 0>>
<<set $slaveMarketLimit = 20>>
<<set $slavesSeen = 0>>

<<set $slaveOrphanageTotal = 0>>
<<set $citizenOrphanageTotal = 0>>
<<set $privateOrphanageTotal = 0>>
<<set $breederOrphanageTotal = 0>>

<<set $alwaysSubsidizeRep = 0>>
<<set $alwaysSubsidizeGrowth = 0>>
<<set $ProImmigrationCash = 0>>
<<set $ProImmigrationRep = 0>>
<<set $AntiImmigrationCash = 0>>
<<set $AntiImmigrationRep = 0>>
<<set $ProEnslavementCash = 0>>
<<set $ProEnslavementRep = 0>>
<<set $AntiEnslavementCash = 0>>
<<set $AntiEnslavementRep = 0>>
<<set $BasicSMR = 1>>
<<set $HealthInspectionSMR = 0>>
<<set $EducationSMR = 0>>
<<set $FrigiditySMR = 0>>
<<set $BasicBeautySMR = 0>>
<<set $QualityBeautySMR = 0>>
<<set $BasicWeightSMR = 0>>
<<set $BasicIntelligenceSMR = 0>>
<<set $QualityIntelligenceSMR = 0>>
<<set $BasicHeightSMR = 0>>
<<set $AdvancedHeightSMR = 0>>
<<set $IntelligenceEugenicsSMR = 0>>
<<set $HeightEugenicsSMR = 0>>
<<set $FaceEugenicsSMR = 0>>
<<set $HonestySMR = 0>>
<<set $ProRefugees = 0>>
<<set $ProRecruitment = 0>>
<<set $OralEncouragement = 0>>
<<set $VaginalEncouragement = 0>>
<<set $AnalEncouragement = 0>>
<<set $OralDiscouragement = 0>>
<<set $VaginalDiscouragement = 0>>
<<set $AnalDiscouragement = 0>>
<<set $CashForRep = 0>>
<<set $RepForCash = 0>>
<<set $Cash4Babies = 0>>
<<set $RegularParties = 0>>
<<set $PAPublic = 0>>
<<set $CoursingAssociation = 0>>
	<<set $Lurcher = 0>>
	<<set $coursed = 0>>
<<set $RaidingMercenaries = 0>>
	<<set $raided = 0>>
<<set $MixedMarriage = 0>>
<<set $CulturalOpenness = 0>>
<<set $goodImageCampaign = 0>>
<<set $sexualOpeness = 0>>

<<set $policyCost = 5000>>
<<set $expiree = 0>>
<<set $retiree = 0>>
<<set $birthee = 0>>
<<set $CustomRetirementAgePolicy = 0>>
<<set $BioreactorRetirement = 0>>
<<set $ArcadeRetirement = 0>>
<<set $CitizenRetirement = 0>>
<<set $SexMilestoneRetirement = 0>>
<<set $MilkMilestoneRetirement = 0>>
<<set $BirthsMilestoneRetirement = 0>>
<<set $KillsMilestoneRetirement = 0>>
<<set $retirementSex = 10000>>
<<set $retirementMilk = 50000>>
<<set $retirementBirths = 5>>
<<set $retirementKills = 3>>
<<set $nicaea = 0>>
<<set $nicaeaAnnounceable = 0>>
<<set $nicaeaAnnounced = 0>>
<<set $nicaeaPreparation = 0>>
<<set $nicaeaInvolvement = -2>>
<<set $nicaeaPower = 0>>
<<set $nicaeaHeld = 0>>
<<set $peacekeepers = 0>>
<<set $peacekeepersFate = 0>>
<<set $mercRomeo = 0>>

<<set $oralUseWeight = 5>>
<<set $vaginalUseWeight = 5>>
<<set $analUseWeight = 5>>

<<set $niceWeather = [
	{name: "Sunny", severity: 1},
	{name: "Cloudy", severity: 1},
	{name: "Partly Cloudy", severity: 1},
	{name: "Overcast", severity: 1},
	{name: "Light Wind", severity: 1},
	{name: "Clear and Calm", severity: 1},
	{name: "Light Rain", severity: 1},
	{name: "Heavy Rain", severity: 1},
	{name: "Smoke warning", severity: 1},
]>>

<<set $lightWeather = [
	{name: "High Winds", severity: 2},
	{name: "Acid Rain", severity: 2},
	{name: "T-Storm Warning", severity: 2},
	{name: "Flood Warning", severity: 2},
	{name: "Tornado Warning", severity: 2},
	{name: "Light Sandstorm", severity: 2},
	{name: "High Heat", severity: 2},
	{name: "Smoky", severity: 2},
]>>

<<set $heavyWeather = [
	{name: "Extreme Winds", severity: 3},
	{name: "Heavy Acid Rain", severity: 3},
	{name: "Extreme T-storm", severity: 3},
	{name: "Flooding", severity: 3},
	{name: "Tornadoes", severity: 3},
	{name: "Sandstorm", severity: 3},
	{name: "Extreme Heat", severity: 3},
	{name: "Dense Smoke", severity: 3},
]>>

<<set $extremeWeather = [
	{name: "Solar Flare", severity: 4},
	{name: "Ion Storm", severity: 4},
	{name: "Cataclysmic Rains", severity: 4},
	{name: "Cat 6 Hurricane", severity: 4},
	{name: "Abrasive Sandstorm", severity: 4},
	{name: "Radiological Warning", severity: 4},
]>>

<<set $weatherToday = $niceWeather.random()>>

<<set $customSlaveOrdered = 0>>
<<set $customSlave = {age: 19, health: 0, muscles: 0, lips: 15, voice: -1, heightMod: "normal", weight: 0, face: 0, race: "white", skin: 0, boobs: 500, butt: 3, sex: 1, virgin: 0, dick: 2, balls: 2, clit: 0, labia: 0, vaginaLube: 1, analVirgin: 0, skills: 15, whoreSkills: 15, combatSkills: 0, intelligence: 0, intelligenceImplant: 1, nationality: "Stateless", amp: 0, eyes: 1}>>

<<set $huskSlaveOrdered = 0>>
<<set $huskSlave = {age: 18, nationality: "Stateless", race: "white", sex: 1, virgin: 0}>>

/*non-vanilla shit*/

<<set $one_time_age_overrides_pedo_mode = 0>>
<<set $activeSlaveOneTimeMinAge = 0>>
<<set $activeSlaveOneTimeMaxAge = 999>>
<<set $targetAge = $minimumSlaveAge>>
<<set $pubertyLength = 5>>
<<set $maxGrowthAge = 24>>

/* Job Fulfillment Center */
<<set $JFCOrder = 0, $Role = "">>

<<set $cheatMode = 0>>
<<set $cheatModeM = 1>>

<<set $fcnn = []>>
<<set $fcnn.push("...coming up at the top of the hour: Catgirl slaves, science fact or science fiction...")>>
<<set $fcnn.push("...coming up at the top of the hour: Malnockestivi Smith, Free Cities' first MtFtMtFtH transgendered person...")>>
<<set $fcnn.push("...new arcology construction up 23% worldwide this year, according to...")>>
<<set $fcnn.push("...United States Congress spends 1,264th consecutive day gridlocked over post office...")>>
<<set $fcnn.push("...coming up at the top of the hour: Arcology owners: oversexed oligarchs or attractive, oversexed oligarchs?...")>>
<<set $fcnn.push("...coming up at the top of the hour: Anal sex: not just for sex any more...")>>
<<set $fcnn.push("...coming up at the top of the hour: Oral sex: the new hello...")>>
<<set $fcnn.push("...new book by prominent feminist suggests that women should not be used as sexual appliances...")>>
<<set $fcnn.push("...just ahead, interview with Desha Moore, prominent advocate for compulsory female enslavement...")>>
<<set $fcnn.push("...just ahead, Slave Market Trends: will the pierced anus be in again this year...")>>
<<set $fcnn.push("...just ahead, Slave Market Trends: upstart slave trainers avoid implants...")>>
<<set $fcnn.push("...implant technology firm BusTech notches successful initial public offering...")>>
<<set $fcnn.push("...the upcoming shortage of authentic leather and what it means for the whip industry...")>>
<<set $fcnn.push("...dairy conglomerate Creem Inc. denies allegations of adulterating breast milk with...")>>
<<set $fcnn.push("...two-time award-winning actress Linda Loveless debuted new implants on the red carpet this...")>>
<<set $fcnn.push("...dick size: are your slaves lying to you when they tell you you're too big...")>>
<<set $fcnn.push("...just ahead, slave expert's opinion on best shemale slaves to use for double penetration...")>>
<<set $fcnn.push("...Free Cities social conservatives criticize marriage, say your slaves should be enough...")>>
<<set $fcnn.push("...councilman Taggart suggested in a public address that involuntary enslavement...")>>
<<set $fcnn.push("...councilman Taggart denies allegations that he has remained faithful to his wife...")>>
<<set $fcnn.push("...councilman Taggart presented evidence that regulation of the sex slave market would...")>>
<<set $fcnn.push("...after a word from our sponsors. Creem Inc.: for all your dairy needs...")>>
<<set $fcnn.push("...after a word from our sponsors. Horstmann Ltd, Free Cities' finest whipmakers...")>>
<<set $fcnn.push("...after a word from our sponsors. Coming soon to theaters, Quintuple, the musical...")>>
<<set $fcnn.push("...critical of low-end slave training corporation Wallerson & Sons for practices that they say...")>>
<<set $fcnn.push("...training corporation Wallerson & Sons called a study on slave illness rates 'ludicrous,' but...")>>
<<set $fcnn.push("...our tech correspondent: the possibilities of virally-administered gene therapy...")>>
<<set $fcnn.push("...our tech correspondent: breakthrough in in-vitro drug treatments that promise to...")>>
<<set $fcnn.push("...our tech correspondent: next year to see release of two competing aphrodisiacs...")>>
<<set $fcnn.push("...our tech correspondent: the coming permanent aphrodisiac implants, and what they mean...")>>
<<set $fcnn.push("...Sex Slaves in Space: what it takes to keep a mining crew happy for an 18-month contract...")>>
<<set $fcnn.push("...the implant-drug balance: how much tissue growth is necessary to support larger...")>>
<<set $fcnn.push("...the actress stated that the cut to full nudity in the script violated contractual...")>>
<<set $fcnn.push("...doping scandal as Slave Games watchdog alleges champion used internal reservoir of lube...")>>
<<set $fcnn.push("...next on Extreme Surgery: the mouthpussy experimenters and what they...")>>
<<set $fcnn.push("...'A hole's a hole,' said CEO of upstart budget glory hole franchise...")>>
<<set $fcnn.push("...underground slave pit fights step into the light this evening as...")>>
<<set $fcnn.push("...underground slave pit fight champion, freed yesterday, sells herself back into...")>>
<<set $fcnn.push("...with the lead designer of the MP17, the new machine pistol marketed specifically for bodyguards...")>>
<<set $fcnn.push("...the new Aegis drone series: because your arcology's security is your most important possession...")>>
<<set $fcnn.push("...the BAe Goshawk: because you deserve to travel at twice the speed of sound in the finest style...")>>
<<set $fcnn.push("...this year's Goat.cx award for outstanding orifice innovation goes to...")>>
<<set $fcnn.push("...public controversy over cannibalism. Decadence taken too far or an acceptable next step...")>>
<<set $fcnn.push("...sixth day of street cleaners' strike. Spokesman for the strikers: 'It's getting too nasty...")>>

/* HACKY EVENT WORKAROUNDS */
<<set $eventID = -1>>

/* INCORPORATED MODS */

/* Special Force Variables [SFVAR] */

/* Extra content enabling */
<<set $SFMODToggle = 0>>						/* Does the player want to see the SF module at all? */

/* Initial events and presentation logic */
<<set $securityForceCreate = 0>> 					/* Has the player chosen to create the SF? Used for initial events */
<<set $securityForceEventSeen = 0>>					/* Has the player seen the SF event? Used to avoid re-event */
<<set $securityForceName = "Special Force">>		/* What is the SF called? */
<<set $securityForceActive = 0>>					/* SF is active - activates end of turn screen logic */

/* SF control panel and logic */
<<set $securityForceSubsidyActive = 0>>				/* Is the player having to subsidize the SF? */
<<set $securityForceRecruit = 0>>					/* How many recruits has the SF attracted this week? Used in recruitment calcs */
<<set $securityForceTrade = 0>>						/* How much trade has the SF encouraged this week? Used for rep calcs */
<<set $securityForceBooty = 0>>						/* How much money has the SF made this week? Used in money calcs */
<<set $securityForceIncome = 0>>					/* What was the final, adjusted take for the SF this week? Used for EOW text */
<<set $securityForceProfitable = 0>>				/* Is the SF profitable? Used for EOW text */
<<set $securityForceFocus = "recruit">>				/* What is the SF's assigned job? */
<<set $securityForceRulesOfEngagement = "hold">>	/* What are the SF's ROE outside the arcology? */
<<set $securityForceAccountability = "strict">>		/* Is the SF being held accountable for its actions outside the arcology? */
<<set $securityForceDepravity = 0>>					/* How depraved has the SF become? Used for flavor text injections. */
<<set $securityForceUpgradeToken = 0>>				/* Flag to keep track of single upgrade/week. */
<<set $securityForceGiftToken = 0>>					/* Flag to keep track of single gift/week. */

/* Personnel/Gear */
<<set $securityForceArcologyUpgrades = 0>>			/* How many militarized arcology upgrades has the player bought? */
<<set $securityForcePersonnel = 40>> 				/* How big is the SF? Maxes out at battalion/regimental (~1500) strength */
<<set $securityForceInfantryPower = 0>>				/* How many infantry upgrades has the player bought? */
<<set $securityForceStimulantPower = 0>>			/* How many stimulant upgrades has the player bought? */
<<set $securityForceVehiclePower = 0>>				/* How many vehicle upgrades has the player bought? */
<<set $securityForceHeavyBattleTank = 0>>			/* Has the SF found a busted down heavy battle tank begging for work? */
<<set $securityForceAircraftPower = 0>>				/* How many aircraft upgrades has the player bought? */
<<set $securityForceSpacePlanePower = 0>>			/* Has the SF found a busted down spaceplane begging for work? */
<<set $securityForceFortressZeppelin = 0>>			/* Has the SF found a busted down fortress zeppelin begging for work? */
<<set $securityForceAC130 = 0>>						/* Has the SF found a busted down AC-130 begging for work? */
<<set $securityForceHeavyTransport = 0>>			/* Has the SF found a busted down heavy yransport begging for work? */
<<set $securityForceDronePower = 0>>				/* How many drone upgrades has the player bought? */
<<set $securityForceSatellitePower = 0>>			/* Has the SF commendeered a Satellite relay? */
<<set $securityForceGiantRobot = 0>>				/* Has the player assembled a makeshift giant robot */
<<set $securityForceMissileSilo = 0>>				/* Has the SF found a disused missile silo in need of reassignement?*/
<<set $securityForceAircraftCarrier = 0>> 			/* Has the SF found a busted down aircraft carrier begging for work? */
<<set $securityForceSubmarine = 0>>					/* Has the SF found a busted down submarine begging for work? */
<<set $securityForceHeavyAmphibiousTransport = 0>>	/* Has the SF found a busted down heavy amphibious transport begging for work? */
<<set $securityForceMissionEfficiency = 1>>			/* How efficient is the SF at completing its assigned task? (Upgrades*Drug Multiplier) */

/* SupportFacility */
<<set $SupportFacility = 0>>						/* Is the support facility built ? */

/* Colonel */
<<set $securityForceSexedColonelToken = 0>>			/* Has the player sexed The Colonel this week? */
<<set $ColonelCore = "">>							/* What is the core of The Colonel? */
<<set $securityForceColonelToken = 0>>				/* Flag to keep track of talking to The Colonel. */
<<set $securityForceColonelSexed = 0>>				/* Has the player sexed The Colonel this week? */

/* TradeShow */
<<set $TradeShowAttendanceGranted = 0>>				/* Has The Colonel been allowed to go the TradeShow? */
<<set $OverallTradeShowAttendance = 0>>				/* how many times has The Colonel gone to the TradeShow */
<<set $CurrentTradeShowAttendance = 0>>				/* Has The Colonel attended the current TradeShow? */
<<set $TradeShowIncome = 0>>						/* How much was The Colonel able to make at the TradeShow selling generic scematics? */
<<set $TotalTradeShowIncome = 0>>					/* Total TradeShowIncome */
<<set $TradeShowHelots = 0>>						/* How many menail slaves were sent as a bonus from generic scematic sales during the current TradeShow?
<<set $TotalTradeShowHelots = 0>>					/* Total number of menail slaves acquired via the Trade Show */

/* Misc mod variables */
<<set $recruiterEugenics = 0>>
<<set $cyberMod = 0>>
<<set $stockpile = {
basicPLimbInterface: 0,
advPLimbInterface: 0,
basicPLimb: 0,
advSexPLimb: 0,
advGracePLimb: 0,
advCombatPLimb: 0,
cyberneticPLimb: 0,
ocularImplant: 0,
erectileImplant: 0
} >>

<<if ndef $AgeEffectOnTrainerPricingPC>>
	<<set $AgeEffectOnTrainerPricingPC = 1>>
<</if>>
<<if ndef $AgeEffectOnTrainerEffectivenessPC>>
	<<set $AgeEffectOnTrainerEffectivenessPC = 1>>
<</if>>
<<if ndef $AgeTrainingUpperBoundPC>>
	<<set $AgeTrainingUpperBoundPC = 14>>
<</if>>
<<if ndef $AgeTrainingLowerBoundPC>>
	<<set $AgeTrainingLowerBoundPC = 12>>
<</if>>
<<if ndef $IsInPrimePC>>
	<<set $IsInPrimePC = 3>>
<</if>>
<<if ndef $IsPastPrimePC>>
	<<set $IsPastPrimePC = 5000>>
<</if>>

<<set $researchLab = {
built: "false",
aiModule: 1,
productionTime: 0,
research: "none",
manufacture: "none",
maxSpace: 0,
hired: 0,
menials: 0,
basicPLimbInterface: 0,
advPLimbInterface: 0,
basicPLimb: 0,
advSexPLimb: 0,
advGracePLimb: 0,
advCombatPLimb: 0,
cyberneticPLimb: 0,
ocularImplant: 0,
erectileImplant: 0
} >>

<<set $merchantFSWares = ["GenderRadicalistResearch", "TransformationFetishistResearch", "AssetExpansionistResearch", "SlimnessEnthusiastResearch", "YouthPreferentialistResearch", "HedonisticDecadenceResearch"]>>
<<set $merchantIllegalWares = ["childhoodFertilityInducedNCS"]>>

<<if ndef $PC.hacking>>
	<<set $PC.hacking = 0>>
<</if>>

/* Security Expansion */
<<set $secExp = 0>>
<<set $showSecExp = 0>>
<<set $wasToggledBefore = 0>>

/* Career-skill gain */
<<set $masteredXP = 200>>

<<include "secInit">>

<<goto "Alpha disclaimer">>


code:
:: cyberConfig [nobr]

<<switch $temp>>

<<case 0>>
	This room is lined with shelves and cabinets, it could be easily mistaken for a storage room if it were not for examination table in its center.

	<<set $nextButton = "Back", $nextLink = "Slave Interact">>
		<<if $activeSlave.amp != 1>>
			Your slave $activeSlave.slaveName is obediently waiting for your instructions.
		<<else>>
			Your slave $activeSlave.slaveName is lying on the table, waiting for your instructions.
		<</if>>

	<<if $activeSlave.origEye == "implant">>

		$pronounCap has an ocular implant installed.
		<<if $activeSlave.eyes == 1>>
			They are operating normally.
		<<elseif $activeSlave.eyes == -1>>
			They are set to blur her vision.
		<<else>>
			They are turned off.
		<</if>>

		<<if $activeSlave.eyes != 1>>[[Restore vision|cyberConfig][$activeSlave.eyes = 1,$temp = 3]] | <</if>>
		<<if $activeSlave.eyes != -1>>[[Blur|cyberConfig][$activeSlave.eyes = -1,$temp = 3]] | <</if>>
		<<if $activeSlave.eyes != -2>>[[Disable|cyberConfig][$activeSlave.eyes = -2,$temp = 3]]<</if>>

		$pronounCap currently has $activeSlave.eyeColor lenses equipped.

		Swap out $possessive lenses:
		[[Blue|cyberConfig][$activeSlave.eyeColor = "blue",$temp = 2,$cash -= $modCost]]
		| [[Black|cyberConfig][$activeSlave.eyeColor = "black",$temp = 2,$cash -= $modCost]]
		| [[Brown|cyberConfig][$activeSlave.eyeColor = "brown",$temp = 2,$cash -= $modCost]]
		| [[Green|cyberConfig][$activeSlave.eyeColor = "green",$temp = 2,$cash -= $modCost]]
		| [[Turquoise|cyberConfig][$activeSlave.eyeColor = "turquoise",$temp = 2,$cash -= $modCost]]
		| [[Sky-blue|cyberConfig][$activeSlave.eyeColor = "sky-blue",$temp = 2,$cash -= $modCost]]
		| [[Hazel|cyberConfig][$activeSlave.eyeColor = "hazel",$temp = 2,$cash -= $modCost]]
		| [[Pale-grey|cyberConfig][$activeSlave.eyeColor = "pale-grey",$temp = 2,$cash -= $modCost]]
		| [[White|cyberConfig][$activeSlave.eyeColor = "white",$temp = 2,$cash -= $modCost]]
		| [[Pink|cyberConfig][$activeSlave.eyeColor = "pink",$temp = 2,$cash -= $modCost]]
		| [[Amber|cyberConfig][$activeSlave.eyeColor = "amber",$temp = 2,$cash -= $modCost]]
		| [[Red|cyberConfig][$activeSlave.eyeColor = "red",$temp = 2,$cash -= $modCost]]
		| [[Catlike|cyberConfig][$activeSlave.eyeColor = "catlike",$temp = 2,$cash -= $modCost]]
		| [[Serpent-like|cyberConfig][$activeSlave.eyeColor = "serpent-like",$temp = 2,$cash -= $modCost]]
		| [[Devilish|cyberConfig][$activeSlave.eyeColor = "devilish",$temp = 2,$cash -= $modCost]]
		| [[Demonic|cyberConfig][$activeSlave.eyeColor = "demonic",$temp = 2,$cash -= $modCost]]
		| [[Hypnotic|cyberConfig][$activeSlave.eyeColor = "hypnotic",$temp = 2,$cash -= $modCost]]
		| [[Heart-shaped|cyberConfig][$activeSlave.eyeColor = "heart-shaped",$temp = 2,$cash -= $modCost]]
	<</if>>

	<<if $activeSlave.PLimb > 0>>

		$pronounCap has PLimb interface installed. You can assign and adjust $possessive prosthetics here.
		<<if $activeSlave.amp <= -1>>

			$possessiveCap prosthetics are currently attached, if you wish to change them you will first need to detach them.

			[[Detach|cyberConfig][$temp = 1,$nextButton = "Continue", $nextLink = "cyberConfig"]]
		<<else>>

			<<if $stockpile.basicPLimb > 0>>[[Attach basic limbs|cyberConfig][$temp = 4, $activeSlave.amp = -1, $stockpile.basicPLimb -= 1]]<</if>>
			<<if $stockpile.advSexPLimb > 0>>[[Attach sex limbs|cyberConfig][$temp = 4, $activeSlave.amp = -2, $stockpile.advSexPLimb -= 1]]<</if>>
			<<if $stockpile.advGracePLimb > 0>>[[Attach beauty limbs|cyberConfig][$temp = 4, $activeSlave.amp = -3, $stockpile.advGracePLimb -= 1]]<</if>>
			<<if $stockpile.advCombatPLimb > 0>>[[Attach combat limbs|cyberConfig][$temp = 4, $activeSlave.amp = -4, $stockpile.advCombatPLimb -= 1]]<</if>>
			<<if $activeSlave.PLimb == 2>>
				<<if $stockpile.cyberneticPLimb > 0>>[[Attach cybernetic limbs|cyberConfig][$temp = 4, $activeSlave.amp = -5, $stockpile.cyberneticPLimb -= 1]]<</if>>
			<<else>>
				 //To equip more advanced prosthetics you will need to upgrade your slaves' PLimb interface.//
			<</if>>
		<</if>>

	<<else>>
		<<if $activeSlave.amp == 0>>

			$pronounCap has healthy limbs so there is no need for prosthetics.
		<<else>>

			$pronounCap does not have a PLimb interface installed so you can't give $possessive any prosthetics.
		<</if>>
	<</if>>

<<case 1>>
	<<set $temp = 0, $nextButton = "Continue", $nextLink = "cyberConfig">>
	<<if $activeSlave.amp == -1>><<set $stockpile.basicPLimb += 1>>
	<<elseif $activeSlave.amp == -2>><<set $stockpile.advSexPLimb += 1>>
	<<elseif $activeSlave.amp == -3>><<set $stockpile.advGracePLimb += 1>>
	<<elseif $activeSlave.amp == -4>><<set $stockpile.advCombatPLimb += 1>>
	<<elseif $activeSlave.amp == -5>><<set $stockpile.cyberneticPLimb += 1>>
	<</if>>
	<<set $activeSlave.amp = 1>>
	Due to built-in safeties it is necessary to remove each limb separately, first releasing the lock and then waiting for automated seal release.

	<<if ($activeSlave.devotion > 20)>>
		You instruct $possessive to lie down on the table and proceed to remove $possessive limbs. $pronounCap <<if canSee($activeSlave)>>watches<<else>>listens<</if>> with interest as you work.<<if ($activeSlave.devotion > 50)>> As you remove the last limb $pronoun playfully wiggles $possessive stumps at you.<</if>>
	<<else>>
		You order $possessive to lie down on the table and proceed to remove $possessive limbs. $pronounCap <<if canSee($activeSlave)>>watches<<else>>listens<</if>> with a bitter expression as you work.
	<</if>>

<<case 2>>
	<<set $temp = 0, $nextButton = "Continue", $nextLink = "cyberConfig">>
	<<if $activeSlave.amp != 1>>You have $possessive lie down and<<else>>You<</if>> use a speculum to keep $possessive eyes open while you disengage $possessive lenses remotely and swap them out with $possessive new $activeSlave.eyeColor lenses.
<<case 3>>
	<<set $temp = 0, $nextButton = "Continue", $nextLink = "cyberConfig">>
	<<if $activeSlave.eyes == 1>>
		$pronounCap blinks as $possessive vision returns.
	<<elseif $activeSlave.eyes == -1>>
		$pronounCap squints at you as $possessive vision becomes a blur.
	<<else>>
		$pronounCap has a panicked expression when $possessive vision suddenly goes out.
	<</if>>
<<case 4>>
	<<set $temp = 0, $nextButton = "Continue", $nextLink = "cyberConfig">>
	Attaching $possessive limbs is a simple procedure, you simply push a connector on each limb into the socket in $possessive implants until the lock engages.<<if $activeSlave.PLimb == 2>> $pronounCap jumps a bit as limbs connect to $possessive nerves.<</if>> When you are done, $pronoun sits up and
	<<if $activeSlave.amp == -2>>experimentally engages the vibe function in $possessive fingers.
	<<elseif $activeSlave.amp == -3>>runs a hand over the smooth skin of $possessive new legs.
	<<elseif $activeSlave.amp == -4>>engages and disengages the blade in $possessive forearm.
	<<elseif $activeSlave.amp == -5>>experimentally flexes the muscles in $possessive artificial arm.
	<<else>>catches $possessive balance.
	<</if>>
<</switch>>


code:
:: Research Lab [nobr]

<<switch $temp>>

<<case 0>>

	<<set $nextButton = "Back", $nextLink = "Manage Arcology">>

	//You switch one of the screens in your office to the feed from research facility.//

[[Decommission facility|Manage Arcology][$researchLab.built = "false",$researchLab.hired = 0,$helots += $researchLab.menials,$researchLab.menials = 0,$researchLab.research = "none",$researchLab.manufacture = "none",$researchLab.productionTime = 0]] //Warning! This will cancel all projects, remove all staff and shut down this facility.//

[[Purchase cybernetics|Research Lab][$temp = 1]]

	__Personnel__

	<<if $researchLab.aiModule == 1>>
		[[Buy and install research module|Research Lab][$cash -= 35000, $researchLab.aiModule = 2]] //This module enables your assistant to assist staff and direct menials assigned to your research facility, increasing efficiency. It costs <<print cashFormat(35000)>>//

	<</if>>
	<<if ($researchLab.hired + $researchLab.menials) == 0>>
		//Facility is currently unstaffed.//
	<<else>>
		//You have
		<<if $researchLab.hired == 1>>
			one scientist
		<<elseif $researchLab.hired > 1>>
			$researchLab.hired scientists
		<</if>>
		<<if $researchLab.menials != 0>> and<</if>>
		<<if $researchLab.menials == 0>>
		<<elseif $researchLab.menials == 1>>
			one menial slave
		<<elseif $researchLab.menials > 1>>
			$researchLab.menials menials
		<</if>>
		working in your lab.
			<<if $researchLab.aiModule != 0>>Occasionally you hear voice of your assistant as it helps direct and organize work.<</if>>//
	<</if>>

	 Currently, this facility can employ $researchLab.maxSpace people.
	<<if $researchLab.maxSpace == 5>>
		[[Expand facility|Research Lab][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $researchLab.maxSpace = 10]]
		//Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 10>>
		[[Expand facility|Research Lab][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $researchLab.maxSpace = 20]]
		//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 20>>
		[[Expand facility|Research Lab][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $researchLab.maxSpace = 30]]
		//Costs <<print cashFormat(Math.trunc(15000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 30>>
		[[Expand facility|Research Lab][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $researchLab.maxSpace = 40]]
		//Costs <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 40>>
		[[Expand facility|Research Lab][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $researchLab.maxSpace = 50]]
		//Costs <<print cashFormat(Math.trunc(25000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 50>>
		//Facility is fully expanded.//
	<</if>>

	<<if ($researchLab.hired + $researchLab.menials) < $researchLab.maxSpace>>
		Hire [[x1|Research Lab][$researchLab.hired += 1,$cash -= 5000]]
		<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 5>>
			| [[x5|Research Lab][$researchLab.hired += 5,$cash -= 25000]]
		<</if>>
		<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 10>>
			| [[x10|Research Lab][$researchLab.hired += 10,$cash -= 50000]]
		<</if>>
		scientists.

		    //Each scientist will require an initial fee of <<print cashFormat(5000)>> and incur <<print cashFormat(300)>> weekly.//

		 <<if $helots > 0>>
			Assign [[x1|Research Lab][$researchLab.menials += 1,$helots -= 1]]
			<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 5 && $helots >= 5>>
				| [[x5|Research Lab][$researchLab.menials += 5,$helots -= 5]]
			<</if>>
			<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 10 && $helots >= 10>>
				| [[x10|Research Lab][$researchLab.menials += 10,$helots -= 10]]
			<</if>>
			  menial slaves to lab.

		<<else>>You do not own any <<if $researchLab.menials != 0>>unassigned <</if>>menial slaves.

		<</if>>
		   //Using menial slaves is much cheaper than hiring scientists, but they are less effective. <<print cashFormat(100)>> per slave each week.//

	<<else>>
		   //Facility is fully staffed.//
	<</if>>

	<<if $researchLab.hired > 0>>
		Fire [[x1|Research Lab][$researchLab.hired -= 1]]
		<<if $researchLab.hired >= 5>>
			| [[x5|Research Lab][$researchLab.hired -= 5]]
		<</if>>
		<<if $researchLab.hired >= 10>>
			| [[x10|Research Lab][$researchLab.hired -= 10]]
		<</if>>
		| [[All|Research Lab][$researchLab.hired = 0]]
		scientists.
	<</if>>
	<<if $researchLab.menials > 0>>

		Dismiss [[x1|Research Lab][$researchLab.menials -= 1,$helots += 1]]
		<<if $researchLab.menials >= 5>>
			| [[x5|Research Lab][$researchLab.menials -= 5,$helots += 5]]
		<</if>>
		<<if $researchLab.menials >= 10>>
			| [[x10|Research Lab][$researchLab.menials -= 10,$helots += 10]]
		<</if>>
		| [[All|Research Lab][$helots += $researchLab.menials,$researchLab.menials = 0]]
		menial slaves.
	<</if>>

	__Research__

	<<if $researchLab.research != "none">>
		//Your lab staff is currently researching @@.yellow;$researchLab.research@@.//

		[[Cancel Research|Research Lab][$researchLab.productionTime = 0,$researchLab.research = "none"]]
	<<elseif $researchLab.manufacture != "none">>
		//Your lab staff is currently busy with other projects.//
	<<else>>
		//No research active.//

		<<if $researchLab.basicPLimbInterface == 0 && $stockpile.basicPLimbInterface > 0>>

			[[Reverse engineer basic prosthetics interface|Research Lab][$researchLab.productionTime = 80,$researchLab.research = "Basic prosthetics interface"]]
		<</if>>
		<<if $researchLab.basicPLimbInterface != 0 && $researchLab.advPLimbInterface == 0 && $stockpile.advPLimbInterface > 0>>

			[[Reverse engineer advanced prosthetics interface|Research Lab][$researchLab.productionTime = 120,$researchLab.research = "Advanced prosthetics interface"]]
		<</if>>
		<<if $researchLab.basicPLimb == 0 && $stockpile.basicPLimb > 0>>

			[[Reverse engineer basic prosthetic limbs|Research Lab][$researchLab.productionTime = 80,$researchLab.research = "Basic prosthetic limbs"]]
		<</if>>
		<<if $researchLab.advSexPLimb == 0 && $stockpile.advSexPLimb > 0>>

			[[Reverse engineer advanced sex limbs|Research Lab][$stockpile.advSexPLimb -= 1,$researchLab.productionTime = 100,$researchLab.research = "Advanced sex limbs"]]
		<</if>>
		<<if $researchLab.advGracePLimb == 0 && $stockpile.advGracePLimb > 0>>

			[[Reverse engineer advanced beauty limbs|Research Lab][$stockpile.advGracePLimb -= 1,$researchLab.productionTime = 100,$researchLab.research = "Advanced beauty limbs"]]
		<</if>>
		<<if $researchLab.advCombatPLimb == 0 && $stockpile.advCombatPLimb > 0>>

			[[Reverse engineer advanced combat limbs|Research Lab][$stockpile.advCombatPLimb -= 1,$researchLab.productionTime = 100,$researchLab.research = "Advanced combat limbs"]]
		<</if>>
		<<if $researchLab.cyberneticPLimb == 0 && $researchLab.advPLimbInterface == 1 && ($researchLab.advSexPLimb + $researchLab.advGracePLimb + $researchLab.advCombatPLimb) >= 1>>

			[[Develop cybernetic limbs|Research Lab][$researchLab.productionTime = 300,$researchLab.research = "Cybernetic limbs"]]
		<</if>>
		<<if $researchLab.ocularImplant == 0 && $stockpile.ocularImplant > 0>>

			[[Reverse engineer ocular implants|Research Lab][$stockpile.ocularImplant -= 1,$researchLab.productionTime = 100,$researchLab.research = "Ocular implants"]]
		<</if>>
		<<if $researchLab.erectileImplant == 0 && $stockpile.erectileImplant > 0>>

			[[Reverse engineer erectile implant|Research Lab][$stockpile.erectileImplant -= 1,$researchLab.productionTime = 100,$researchLab.research = "Erectile implant"]]
		<</if>>
	<</if>>

	__Manufacture__

	<<if $researchLab.research != "none">>
		//Your lab staff is currently busy with research.//
	<<elseif $researchLab.manufacture != "none">>
		//Your lab staff is currently building @@.yellow;$researchLab.manufacture@@.//
		[[Cancel Project|Research Lab][$researchLab.productionTime = 0,$researchLab.manufacture = "none"]]
	<<else>>
		//No projects currently active.//

		<<if $researchLab.basicPLimbInterface == 1>>

			[[Build basic prosthetics interface|Research Lab][$researchLab.productionTime = 50,$researchLab.manufacture = "Basic prosthetics interface"]] // Currently have: $stockpile.basicPLimbInterface//
		<</if>>
		<<if $researchLab.advPLimbInterface == 1>>

			[[Build advanced prosthetics interface|Research Lab][$researchLab.productionTime = 80,$researchLab.manufacture = "Advanced prosthetics interface"]] // Currently have: $stockpile.advPLimbInterface//
		<</if>>
		<<if $researchLab.basicPLimb == 1>>

			[[Build basic prosthetic limbs|Research Lab][$researchLab.productionTime = 20,$researchLab.manufacture = "Basic prosthetic limbs"]] // Currently have: $stockpile.basicPLimb//
		<</if>>
		<<if $researchLab.advSexPLimb == 1>>

			[[Build advanced sex limbs|Research Lab][$researchLab.productionTime = 100,$researchLab.manufacture = "Advanced sex limbs"]] // Currently have: $stockpile.advSexPLimb//
		<</if>>
		<<if $researchLab.advGracePLimb == 1>>

			[[Build advanced beauty limbs|Research Lab][$researchLab.productionTime = 100,$researchLab.manufacture = "Advanced beauty limbs"]] // Currently have: $stockpile.advGracePLimb//
		<</if>>
		<<if $researchLab.advCombatPLimb == 1>>

			[[Build advanced combat limbs|Research Lab][$researchLab.productionTime = 100,$researchLab.manufacture = "Advanced combat limbs"]] // Currently have: $stockpile.advCombatPLimb//
		<</if>>
		<<if $researchLab.cyberneticPLimb == 1>>

			[[Build cybernetic limbs|Research Lab][$researchLab.productionTime = 150,$researchLab.manufacture = "Cybernetic limbs"]] // Currently have: $stockpile.cyberneticPLimb//
		<</if>>
		<<if $researchLab.ocularImplant == 1>>

			[[Build ocular implants|Research Lab][$researchLab.productionTime = 80,$researchLab.manufacture = "Ocular implants"]] // Currently have: $stockpile.ocularImplant//
		<</if>>
		<<if $researchLab.erectileImplant == 1>>

			[[Build Erectile implant|Research Lab][$researchLab.productionTime = 50,$researchLab.manufacture = "Erectile implant"]] // Costs <<print cashFormat(25000)>>. Currently have: $stockpile.erectileImplant//
		<</if>>
	<</if>>

<<case 1>>
	<<set $temp = 0>>
	<<set $nextLink = "Research Lab">>
	//You contact a representative of one of the larger cybernetics companies and inquire about their products.
 This is what they have to offer://

	__Hardware__

	[[Basic prosthetics interface|Research Lab][$temp = 1, $cash -= 25000, $stockpile.basicPLimbInterface += 1]] //Costs <<print cashFormat(25000)>>. Currently have: $stockpile.basicPLimbInterface//

	[[Advanced prosthetics interface|Research Lab][$temp = 1, $cash -= 60000, $stockpile.advPLimbInterface += 1]] //Costs <<print cashFormat(60000)>>. Currently have: $stockpile.advPLimbInterface//

	[[Basic prosthetic limbs|Research Lab][$temp = 1, $cash -= 15000, $stockpile.basicPLimb += 1]] //Costs <<print cashFormat(15000)>>. Currently have: $stockpile.basicPLimb//

	[[Advanced sex limbs|Research Lab][$temp = 1, $cash -= 30000, $stockpile.advSexPLimb += 1]] //Costs <<print cashFormat(30000)>>. Currently have: $stockpile.advSexPLimb//

	[[Advanced beauty limbs|Research Lab][$temp = 1, $cash -= 30000, $stockpile.advGracePLimb += 1]] //Costs <<print cashFormat(30000)>>. Currently have: $stockpile.advGracePLimb//

	[[Advanced combat limbs|Research Lab][$temp = 1, $cash -= 30000, $stockpile.advCombatPLimb += 1]] //Costs <<print cashFormat(30000)>>. Currently have: $stockpile.advCombatPLimb//

	[[Ocular implants|Research Lab][$temp = 1, $cash -= 35000, $stockpile.ocularImplant += 1]] //Costs <<print cashFormat(35000)>>. Currently have: $stockpile.ocularImplant//

	/*[[Erectile implant|Research Lab][$temp = 1, $cash -= 25000, $stockpile.erectileImplant += 1]] //Costs <<print cashFormat(25000)>>. Currently have: $stockpile.erectileImplant//*/

__Schematics__

	<<if $researchLab.basicPLimbInterface != 1 && $researchLab.research != "Basic prosthetics interface">>
		[[Basic prosthetics interface|Research Lab][$temp = 1, $cash -= 85000, $researchLab.basicPLimbInterface = 1]] //Costs <<print cashFormat(85000)>>.//

	<</if>>
	<<if $researchLab.advPLimbInterface != 1 && $researchLab.research != "Advanced prosthetics interface">>
	[[Advanced prosthetics interface|Research Lab][$temp = 1, $cash -= 260000, $researchLab.advPLimbInterface = 1]] //Costs <<print cashFormat(260000)>>.//

	<</if>>
	<<if $researchLab.basicPLimb != 1 && $researchLab.research != "Basic prosthetic limbs">>
	[[Basic prosthetic limbs|Research Lab][$temp = 1, $cash -= 60000, $researchLab.basicPLimb = 1]] //Costs <<print cashFormat(60000)>>.//

	<</if>>
	<<if $researchLab.advSexPLimb != 1 && $researchLab.research != "Advanced sex limbs">>
	[[Advanced sex limbs|Research Lab][$temp = 1, $cash -= 120000, $researchLab.advSexPLimb = 1]] //Costs <<print cashFormat(120000)>>.//

	<</if>>
	<<if $researchLab.advGracePLimb != 1 && $researchLab.research != "Advanced beauty limbs">>
	[[Advanced beauty limbs|Research Lab][$temp = 1, $cash -= 120000, $researchLab.advGracePLimb = 1]] //Costs <<print cashFormat(120000)>>.//

	<</if>>
	<<if $researchLab.advCombatPLimb != 1 && $researchLab.research != "Advanced combat limbs">>
	[[Advanced combat limbs|Research Lab][$temp = 1, $cash -= 120000, $researchLab.advCombatPLimb = 1]] //Costs <<print cashFormat(120000)>>.//

	<</if>>
	<<if $researchLab.ocularImplant != 1 && $researchLab.research != "Ocular implants">>
	[[Ocular implants|Research Lab][$temp = 1, $cash -= 160000, $researchLab.ocularImplant = 1]] //Costs <<print cashFormat(160000)>>.//

	<</if>>
	/*<<if $researchLab.erectileImplant != 1 && $researchLab.research != "Erectile implant">>
	[[Erectile implant|Research Lab][$temp = 1, $cash -= 95000, $researchLab.erectileImplant = 1]] //Costs <<print cashFormat(95000)>>.//
	<</if>>*/

<</switch>>


code:
:: SFJS [script]

window.simpleWorldEconomyCheck = function() {
	var n1 = 4;
	var n2 = 3;
	var n3 = 2;
	if(State.variables.economy === .5) {
		return n1;
	} else if(State.variables.economy === 1.5) {
		return n3;
	} else {
		return n2;
	}
}

window.HSM = function() {
	if (State.variables.PC.hacking <= -100)
		return 1.5;
	else if (State.variables.PC.hacking <= -75)
		return 1.35;
	else if (State.variables.PC.hacking <= -50)
		return 1.25;
	else if (State.variables.PC.hacking <= -25)
		return 1.15;
	else if (State.variables.PC.hacking < 0)
		return 1.10;
	else if (State.variables.PC.hacking === 0)
		return 1;
	else if (State.variables.PC.hacking <= 10)
		return .97;
	else if (State.variables.PC.hacking <= 25)
		return .95;
	else if (State.variables.PC.hacking <= 50)
		return .90;
	else if (State.variables.PC.hacking <= 75)
		return .85;
	else if (State.variables.PC.hacking < 100)
		return .80;
	else if (State.variables.PC.hacking >= 100)
		return .75;
	}


code:
:: accordionJS.tw [script]
/* Accordion 000-250-006 */

/*
 * We're making changes to the DOM, so we need to make them *after* everything has been generated
 * Sticking this all in postdisplay calls reduces the chance of there being a timing conflict
 *   with other scripts, since anything poking the DOM here will be done last
 *
 * Dev Note: The accordion mod should be able to turn *anything* into an accordion. This iteration
 *   is configured tightly for the end of week report runs, but it shouldn't be that hard to adapt for
 *   other uses, like character bios. For now, I'll see what other extra-long passages of cosmetic text
 *   might benefit.
 *
 * 000-250-006 03092017
*/

postdisplay["doAccordionSet"] = function (content) {
    if (variables().useAccordion == 1) {
        Array.prototype.slice.call(document.querySelectorAll('.macro-include'))
        .forEach(function(element) {
            element.classList.add('accHidden');
        });
    }
}

postdisplay["doAccordion"] = function (content) {
    var acc = document.getElementsByClassName("accordion");
    var i;

    for (i = 0; i < acc.length; i += 1) {
        acc[i].onclick = function () {
            this.classList.toggle("active");
            var panel = this.nextElementSibling;
            if (panel.style.maxHeight) {
                panel.style.maxHeight = null;
            } else {
                panel.style.maxHeight = 2*panel.scrollHeight + "px";
            }
        };
    }
};


code:
:: AssayJS [script]

window.isSlim = function(slave) {
	var slim = false;
	var ArcologyZero = State.variables.arcologies[0];

	if ((slave.boobs < 500) && (slave.butt < 3)) {
		if ((slave.muscles <= 30) && (ArcologyZero.FSPhysicalIdealist == "unset") && (slave.weight <= 10) && (ArcologyZero.FSHedonisticDecadence == "unset")) {
			slim = true;
		} else if (ArcologyZero.FSPhysicalIdealist != "unset") {
			if ((ArcologyZero.FSPhysicalIdealistStrongFat == 1) && (slave.weight <= 30)) {
				slim = true;
			}
		} else if ((ArcologyZero.FSHedonisticDecadence != "unset") && (slave.weight <= 30)) {
			if (ArcologyZero.FSHedonisticDecadenceStrongFat == 1) {
				slim = true;
			} else if (slave.muscles <= 30) {
				slim = true;
			}
		}
	}

	return slim;
}

window.isStacked = function(slave) {
	return (slave.butt > 4) && (slave.boobs > 800);
}

window.isModded = function(slave) {
	var tatScore = TatScore(slave);
	var piercingScore = PiercingScore(slave);
	var modScore = piercingScore+tatScore;

	return ((modScore > 15) || (piercingScore > 8) && (tatScore > 5));
}

window.isUnmodded = function(slave) {
	var tatScore = TatScore(slave);
	var piercingScore = PiercingScore(slave);

	return !isModded(slave) && (slave.corsetPiercing == 0) && (piercingScore < 3) && (tatScore < 2);
}

window.isXY = function(slave) {
	return (slave.dick > 0);
}

window.isYoung = function(slave) {
	return (slave.visualAge < 30);
}

window.isPreg = function(slave) {
	return ((slave.bellyPreg >= 5000) || (slave.bellyImplant >= 5000));
}

window.isNotPreg = function(slave) {
	return !isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory);
}

window.isPure = function(slave) {
	return ((slave.boobsImplant == 0) && (slave.buttImplant == 0) && (slave.waist >= -95) && (slave.lipsImplant == 0) && (slave.faceImplant < 30) && (slave.bellyImplant == -1) && (Math.abs(slave.shouldersImplant) < 2) && (Math.abs(slave.hipsImplant) < 2));
}

window.PiercingScore = function(slave) {
	var piercingScore = 0;

	if (slave.earPiercing > 0) {
		piercingScore += slave.earPiercing*0.75-0.5;
	}
	if (slave.nosePiercing > 0) {
		piercingScore += slave.nosePiercing*0.75-0.5;
	}
	if (slave.eyebrowPiercing > 0) {
		piercingScore += slave.eyebrowPiercing*0.75-0.5;
	}
	if (slave.navelPiercing > 0) {
		piercingScore += slave.navelPiercing*0.75-0.5;
	}
	if (slave.corsetPiercing > 0) {
		piercingScore += slave.corsetPiercing*0.75+0.5;
	}
	if (slave.nipplesPiercing > 0) {
		piercingScore += slave.nipplesPiercing*0.75-0.25;
	}
	if (slave.areolaePiercing > 0) {
		piercingScore += slave.areolaePiercing*0.75+0.5;
	}
	if (slave.lipsPiercing > 0) {
		piercingScore += slave.lipsPiercing*0.75-0.25;
	}
	if (slave.tonguePiercing > 0 ) {
		piercingScore += slave.tonguePiercing*0.75-0.25;
	}
	if (slave.clitPiercing == 3) {
		piercingScore += 1.25; /* smart piercing */
	} else if (slave.clitPiercing > 0) {
		piercingScore += slave.clitPiercing*0.75-0.25;
	}
	if (slave.vaginaPiercing > 0) {
		piercingScore += slave.vaginaPiercing*0.75-0.25;
	}
	if (slave.dickPiercing > 0) {
		piercingScore += slave.dickPiercing*0.75-0.25;
	}
	if (slave.anusPiercing > 0) {
		piercingScore += slave.anusPiercing*0.75-0.25;
	}
	return piercingScore;
}

window.TatScore = function(slave) {
	var tatScore = 0;

	if (slave.boobsTat != 0) {
		tatScore += 1.25;
	}
	if (slave.buttTat != 0) {
		tatScore += 1.25;
	}
	if (slave.lipsTat != 0) {
		tatScore += 1.25;
	}
	if (slave.shouldersTat != 0) {
		tatScore += 1;
	}
	if (slave.backTat != 0) {
		tatScore += 1.25;
	}
	if (slave.armsTat != 0) {
		tatScore += 1;
	}
	if (slave.legsTat != 0) {
		tatScore += 1;
	}
	if (slave.stampTat != 0) {
		tatScore += 1;
	}
	if (slave.vaginaTat != 0) {
		tatScore += 1;
	}
	if (slave.dickTat != 0) {
		tatScore += 1;
	}
	if (slave.bellyTat != 0) {
		if (((slave.preg > 30) && (slave.pregType >= 20)) || (slave.belly >= 300000)) {
			tatScore += 0.75;
		} else if (((slave.preg > 20) && (slave.pregType >= 20)) || ((slave.preg > 30) && (slave.pregType >= 10)) || (slave.belly >= 150000)) {
			tatScore += 1;
		} else if ((slave.belly >= 10000) || (slave.bellyImplant >= 8000)) {
			tatScore += 1;
		} else if (((slave.preg >= 10) && (slave.pregType >= 20)) || ((slave.preg > 10) && (slave.pregType >= 10)) || (slave.belly >= 5000)) {
			tatScore += 0.5;
		} else if (slave.belly >= 1500) {
			tatScore += 0.25;
		} else {
			tatScore += 0.1;
		}
	}
	if (slave.anusTat == "bleached") {
		tatScore += 0.5;
	} else if (slave.anusTat != 0) {
		tatScore += 1.25;
	}

	return tatScore;
}

window.slimPass = function(slave) {
	var slimPass = 0;
	var ArcologyZero = State.variables.arcologies[0];

	if (ArcologyZero.FSSlimnessEnthusiastLaw == 1) {
		if ((slave.boobs < 300) && (slave.butt <= 1) && (slave.waist <= 10)) {
			State.variables.slimPass = 1;
			if ((ArcologyZero.FSPhysicalIdealist == "unset") && (ArcologyZero.FSHedonisticDecadenceStrongFat == 0) && (slave.muscles > 30)) { /*muscle check*/
				slimPass = 0;
			}
			if (State.variables.slimPass == 1) {
				if ((ArcologyZero.FSHedonisticDecadence != "unset") || (ArcologyZero.FSPhysicalIdealistStrongFat == 1)) { /*weight check*/
					if (slave.weight > 30) {
						slimPass = 0;
					}
				} else if (slave.weight > 10) {
					slimPass = 0;
				}
			}
		}
	}

	return slimPass;
}

window.sameAssignmentP = function sameAssignmentP(A, B) {
	return A.assignment === B.assignment
}

window.haveRelationP = function haveRelationP(slave, target) {
	return slave.relationTarget === target.ID
}

window.haveRelationshipP = function haveRelationshipP(slave, target) {
	return slave.relationshipTarget === target.ID
}

window.isRivalP = function isRivalP(slave, target) {
	return slave.rivalryTarget === target.ID
}

window.supremeRaceP = function supremeRaceP(slave) {
	return State.variables.arcologies[0].FSSupremacistRace === slave.race
}

window.inferiorRaceP = function inferiorRaceP(slave) {
	return State.variables.arcologies[0].FSSubjugationistRace === slave.race
}

window.addSlave = function addSlave(slave) {
	State.variables.slaves.push(slave);
	State.variables.slaveIndices[slave.ID] = State.variables.slaves.length - 1;
};

window.removeSlave = function removeSlave(index) {
	const ret = State.variables.slaves.deleteAt(index);
	State.variables.slaveIndices = slaves2indices();
	return ret;
};

window.slaves2indices = function slaves2indices() {
	const obj = {};
	State.variables.slaves.forEach((slave, i) => obj[slave.ID] = i);
	return obj;
};

window.getSlave = function getSlave(ID) {
	const index = State.variables.slaveIndices[ID];
	if (index === undefined) return undefined;
	else return State.variables.slaves[index];
};

window.getPronouns = function getPronouns(slave) {
	return {pronoun: slave.pronoun, possessivePronoun: slave.possessivePronoun, possessive: slave.possessive, object: slave.object, objectReflexive: slave.objectReflexive, noun: slave.noun}
};