code:
#!/bin/bash
if [ ! -d ".git" ]; then
	#not running in git repo, so can't use git commands :-)
	echo "No .git repo found - skipping sanity checks"
	exit 0
fi

WARNING='\033[93m'
WARNING='\033[93m'
ENDC='\033[0m'

myprint() {
	while read data; do
		echo -n -e "[$1]$WARNING"
		echo "$data"
	done
}

GREP="git grep -n --color"
# Check for missing right angle bracket: <</if>
$GREP "<</[^>]*>[^>]" -- 'game/*'  | myprint "MissingClosingAngleBracket"
$GREP "<<[^>()]*>[^()<>"$'\r]*\r'"\?$" -- 'game/*' | myprint "MissingClosingAngleBracket"
# Check for missing left angle bracket: </if>>
$GREP "\([^<]\|^\)</\?\(if\|else\|case\|set\|print\|elseif\)" -- 'game/*' | myprint "MissingOpeningAngleBracket2"
# Check for accidental assignment.  e.g.:   <<if $foo = "hello">>
$GREP "<<[ ]*if[^>=]*[^><\!=]=[^=][^>]*>>" -- 'game/*' | myprint "AccidentalAssignmentInIf"
# Check for accidental assignment.  e.g.:   <<elseif $foo = "hello">>
$GREP "<<[ ]*elseif[^>=]*[^><\!=]=[^=][^>]*>>" -- 'game/*' | myprint "AccidentalAssignmentInElseIf"
# Check for missing ".  e.g.:   <<if $foo == "hello>>
# $GREP -e "<<[^\"<>]*\"[^\"<>]*>>" -- 'game/*' | myprint "MissingSpeechMark"
# Check for missing ".  e.g.:   <<if $foo = "hello)
# $GREP -e "<<[^\"<>]*\([^\"<>]*\"[^><\"]*\"\| [<>] \)*\"\([^\"<>]*\"[^><\"]*\"\| [<>] \)*\([^\"<>]\| [<>] \)*>>" --and --not -e "*[^']*" -- 'game/*' | myprint "MissingSpeechMark2"
# Check for colours like: @@color:red   - should be @@.red
$GREP -e "@@color:" --and --not -e  "@@color:rgb([0-9 ]\+,[0-9 ]\+,[0-9 ]\+)" -- "game/*" | myprint "UseCssColors"
# Check for missing $ in activeSlave or PC
$GREP "<<[ ]*[^\$><_\[]*\(activeSlave\|PC\)[.]"  -- "game/*" | myprint "MissingDollar"
# Check for closing bracket without opening bracket.  e.g.:  <<if foo)>>	  (but  <<case "foo")>>   is valid, so ignore those
$GREP -e "<<[ a-zA-Z]\+\([^()<>]\|[^()<>][<>][^()<>]\)*)" --and --not -e "<< *case"  -- "game/*" | myprint "MissingOpeningBracket"
# Check for opening bracket without closing bracket.  e.g.:  <<if (foo>>
$GREP -e "<<[ a-zA-Z]\([^<>]\|[^<>][<>][^<>]\)\+(\([^()<>]\|[^<>()][<>][^<>()]\|([^<>()]*])\)*>>" -- "game/*" | myprint "MissingClosingBracket"
# Check for two closing brackets but one opening bracket.  e.g.:  <<if (foo))>>
$GREP -e "<<[ a-zA-Z]\+[^()<>]*([^()]*)[^()]*)[^()<>]*>>"  -- "game/*" | myprint "MissingOpeningBracket2"
# Check for one closing bracket but two opening brackets.  e.g.:  <<if ((foo)>>
$GREP -e "<<[ a-zA-Z]\+[^()<>]*([^()]*([^()]*)[^()<>]*>>"  -- "game/*" | myprint "MissingClosingBracket2"
$GREP -e "<<.*[(][^<>)]*[(][^<>)]*)\?[^<>)]*>>" -- "game/*" | myprint "MissingClosingBracket3"
# Check for missing >>.  e.g.:   <<if $foo
$GREP "<<[^<>]*[^,\"\[{"$'\r]\r'"\?$" -- 'game/*' | myprint "MissingClosingAngleBrackets"
# Check for too many >>>.  e.g.: <</if>>>
$GREP "<<[^<>\"]*[<>]\?[^<>\"]*>>>" -- "game/*" | myprint "TooManyAngleBrackets"
# Check for too many <<<.  e.g.: <<</if>>
$GREP "<<<[^<>\"]*[<>]\?[^<>\"]*>>" -- "game/*" | myprint "TooManyAngleBrackets2"
# Check for wrong capitalisation on 'activeslave' and other common typos
$GREP  "\(csae\|[a-z] She \|attepmts\|youreslf\|advnaces\|canAcheive\|setBellySize\|SetbellySize\|setbellySize\|bellypreg\|pregBelly\|bellyimplant\|bellyfluid\|pronounCaps\|carress\)" -- 'game/*' | myprint "SpellCheck"
$GREP  "\(recieve\|recieves\)" -- 'game/*' | myprint "PregmodderCannotSpellReceive"
$GREP "\$slave\[" -- 'game/*' | myprint "ShouldBeSlaves"
# Check for strange spaces e.g.  $slaves[$i]. lips
$GREP "\$slaves\[\$i\]\. " -- 'game/*' | myprint "MissingPropertyAfterSlaves"
# Check, e.g., <<//if>>
$GREP "<</[a-zA-Z]*[^a-zA-Z<>]\+[a-zA-Z]*>>" -- 'game/*' | myprint "DoubleSlash"
# Check, e.g.  <<else $foo==4
$GREP "<<else >\?[^>]" -- 'game/*' | myprint "ShouldBeElseIf"
# Check, e.g., =to
$GREP "=to" -- 'game/*' | myprint "EqualAndTo"
# Check, e.g.  <<set foo == 4>>
$GREP "<<set[^{>=]*==" -- 'game/*' | myprint "DoubleEqualsInSet"
# Check for, e.g   <<if slaves[foo]>>
$GREP "<<\([^>]\|[^>]>[^>]\)*[^$]slaves\[" -- 'game/*' | myprint "MissingDollar"
# Check for missing $ or _ in variable name:
$GREP -e "<<[a-zA-Z]\([^>\"]\|[^>]>[^>]\|\"[^\"]*\"\)* [a-zA-Z]\+ * =" -- game/* | myprint "MissingDollar2"
# Check for missing command, e.g.  <<foo =
$GREP -e "<<[a-zA-Z]* = *" -- game/* | myprint "BadCommand"
# Check for duplicate words, e.g. with with
$GREP -e  " \(\b[a-zA-Z][a-zA-Z]\+\) \1\b " --and --not -e " her her " --and --not -e " you you " --and --not -e " New New " --and --not -e "Slave Slave " --and --not -e " that that " --and --not -e " in in " --and --not -e " is is " -- 'game/*' | myprint "Duplicate words"
# Check for obsolete SugarCube macros
$GREP -E "<<display |<<click|<<.*\.contains" -- game/* | myprint "ObsoleteMacro"
# Check for double articles
$GREP -E "\Wa an\W" -- game/* | myprint "DoubleArticle"
# Check for incorrect articles
$GREP -i -E "\Wa (a|e|i|o|u)." -- game/* | grep -a -i -vE "\Wa (un|eu|us|ut|on|ur|in)." | grep -a -i -vE "(&|<<s>>|UM)." | myprint "IncorrectArticle"
$GREP -i -E "\Wan (b|c|d|f|g|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)\w." -- game/* | grep -a -i -vE "[A-Z]{3}" | myprint "IncorrectArticle"
# Check for $ sign mid-word
$GREP -i "\w$\w" -- game/* | myprint "VarSignMidWord"
# check for $ sign at beginning of macro
$GREP '<<\s*\$' -- 'game/*'  | myprint "VarSignAtMacroStart"
# check for missing ; before statement
$GREP 'if $ ' -- 'game/*'  | myprint "missing ; before statement"
$GREP 'elseif $ ' -- 'game/*'  | myprint "missing ; before statement"
# Check that we do not have any variables that we use only once.   e.g.	 $onlyUsedOnce
# Ignore  *Nationalities
(
cd game/
find . -name "*.twee" -exec cat '{}' ';' | tr -c '$a-zA-Z' '\n'  | sed -n '/^[$]/p' | sort | uniq -u | sed 's/^[$]/-e[$]/' | sed 's/$/\\\\W/' | xargs -r  git grep -n --color | myprint "OnlyUsedOnce"
find . -name "*.twee" -exec cat '{}' ';' | tr -c '.$a-zA-Z[]_' '\n' | sed 's/SugarCube\.State\.variables\./$/g' | sed -n -e 's/^[$]\(PC\|activeSlave\|\(slaves\|tanks\)\[[^]]*\]*\)[.]\([a-zA-Z]\+\).*$/[.]\3/p' | sort | uniq -u |sed 's/^\(.*\)$/-e\1\\\\\b/'  | xargs -r git grep -n --color | myprint "SlaveAttributeUsedOnce"
$GREP "\$\(PC\|activeSlave\|slaves\|tanks\)[.][^a-zA-Z]" | myprint "UnexpectedCharAfterDot"

#Find all the variables listed in init.twee
VARIABLELIST=$(cat base-system/init.twee | tr -c '$a-zA-Z' '\n'  | sed -n '/^[$]/p' | sort | uniq)
# Find all variables anywhere.  Commented out because the output is too noisy currently
#VARIABLELIST=$(find . -name "*.twee" -exec cat '{}' ';' | tr -c '$a-zA-Z' '\n'  | sed -n '/^[$]/p' | sort | uniq)
MISSINGFROMVERSIONUPDATE=$(for variable in $VARIABLELIST; do grep -q "$variable" base-system/version-update.twee || echo "$variable"; done)
echo -e "base-system/version-update.twee$ENDC: $(echo $MISSINGFROMVERSIONUPDATE)" | myprint "MissingFromVersionUpdate"
)

git ls-files "game/*.twee" | xargs -d '\n'  ./devTools/check.py

path: sanityCheck


code:
/*CSS override*/
/*Remove comments to apply*/
/*#stats {
	top: 256px;
}

body.has-images #story-caption {
	margin-top: calc(278px - 2.5em);
}*/

license: mit


code:
*.exe
*.pl
videocleaner.pl method instructions.txt
*.log
*.7z

repo_name: CrapBag/videocleaneradvanceddnd

path: .gitignore

license: wtfpl


code:
@echo off
@setlocal enableextensions enabledelayedexpansion
REM Advanced Drag'N'Drop for videocleaner
REM by CrapBag
REM Todo:
REM None

set BATDIR=%~dp0

call :INI "%BATDIR%\config.ini" General bDebug _debug
call :VarToBoolean _debug
call :INI "%BATDIR%\config.ini" General sVideocleaner _cleaner
call :INI "%BATDIR%\config.ini" Logging bLogging _logging
call :VarToBoolean _logging
call :INI "%BATDIR%\config.ini" Logging bUseMD5 _usemd5
call :VarToBoolean _usemd5
call :INI "%BATDIR%\config.ini" Tags bMoveTags _movetags
call :VarToBoolean _movetags
call :INI "%BATDIR%\config.ini" Tags sMoveTagsPath _movetagspath
call :INI "%BATDIR%\config.ini" Tags bKeepTags _keeptags
call :VarToBoolean _keeptags

if NOT exist "%_cleaner%" (
	echo Executable not found^^!
	echo.
	echo Please confirm the the videocleaner
	echo path in config.ini and try again.
	echo.
	echo Press any key to close...
	if %_debug%==1 (
		echo _cleaner=%_cleaner%
		echo _movetags=%_movetags%
		echo _movetagspath=%_movetagspath%
		echo _tagdest=%_tagdest%
		echo _usemd5=%_usemd5%
		echo _keeptags=%_keeptags%
		echo.
	)
	pause>nul
	goto :EOF
)

if %_usemd5%==1 call :TestHashTools
rem echo _hasfciv=%_hasfciv%

if %_movetagspath%==custom (
	call :INI "%BATDIR%\config.ini" Tags sMoveTagsCustom _tagdest
	if NOT defined _tagdest (
		echo Error: MoveTagsPath=custom but MoveTagsCustom is not defined^^!
		echo Defaulting to 'file'.
		set _tagdest=%cd%\tags
	) else (
		if NOT exist !_tagdest!\nul (
			echo Error: MoveTagsCustom path invalid or doesn't exist^^!
			echo Defaulting to 'file'.
			set _tagdest=%cd%\tags
		)
	)
) else (
	if %_movetagspath%==file (
		set _tagdest=%cd%\tags
	) else (
		if %_movetagspath%==script (
			set _tagdest=%BATDIR%\tags
			if NOT exist !_tagdest!\nul (
				md !_tagdest!
			)
		) else (
			echo Error: MoveTagsPath not recognized^^!
			echo Defaulting to 'file'.
			set _tagdest=%cd%\tags
		)
	)
)

if "%~1"=="" (
	goto NoFiles
)

for %%H in (%*) do (
	if %_debug%==1 echo Begin checking parameters.
	REM echo %%H
	REM echo "%%~xH"
	if [%%~xH]==[] (
		if %_debug%==1 echo Extension blank^^!
		if exist %%H\nul (
			if %_debug%==1 echo Folder exists
			call :ProcessFolder %%H
		) else (
			if %_debug%==1 echo Folder is nope
			call :ProcessFiles %%H
			echo.
		)
	) else (
		if %_debug%==1 echo Has extension, process file
		call :ProcessFiles %%H
		echo.
	)
)
goto EndOfFile

:VarToBoolean
set variable=%~1
REM echo V2B:%variable%=!%variable%!
if !%variable%!==0 (
	exit /B
)
if !%variable%!==1 (
	exit /B
)
if /I !%variable%!==False (
	set !variable!=0
	exit /B
)
if /I !%variable%!==True (
	set !variable!=1
	exit /B
)
REM echo V2B: Set fails to False
set !variable!=0
exit /B

REM USE: call :INI inifile iniarea inikey variable
:INI
rem INI Parsing script by paxdiablo
rem https://stackoverflow.com/a/2866328
set file=%~1
set area=[%~2]
set key=%~3
set variable=%~4
set currarea=
for /f "usebackq delims=" %%A in ("!file!") do (
    set ln=%%A
    if "x!ln:~0,1!"=="x[" (
        set currarea=!ln!
    ) else (
        for /f "tokens=1,2 delims==" %%B in ("!ln!") do (
            set currkey=%%B
            set currval=%%C
            if "x!area!"=="x!currarea!" if "x!key!"=="x!currkey!" (
                set !variable!=!currval!
            )
        )
    )
)
exit /B

:TestHashTools
set _hascertutil=0
set _hasfciv=0
if %_debug%==1 echo Begin test CertUtil.
for /f %%E in ('CertUtil') do (
	if %%E==CertUtil: set _hascertutil=1
)
if %_hascertutil%==1 exit /B
if %_debug%==1 echo Begin test fciv.
for /f "eol=/ tokens=2" %%E in ('fciv') do (
	if %%E==fciv.exe set _hasfciv=1
)
if %_hasfciv%==1 exit /B
echo CertUtil or fciv not found^^!
echo.
echo Please ensure one of these is
echo installed and is on your PATH, or
echo disable bUseMD5 and try again.
echo.
echo Press and key to close...
pause>nul
goto :EOF

:NoFiles
echo To use this script, drag any number
echo of videos or folders of videos onto the script.
echo Each one will be cleaned in turn,
echo after which the script will pause
echo to allow you to read the results
echo.
if %_debug%==1 (
	echo _cleaner=%_cleaner%
	echo _movetags=%_movetags%
	echo _movetagspath=%_movetagspath%
	echo _tagdest=%_tagdest%
	echo _usemd5=%_usemd5%
	echo.
)
echo Press any key to close...
pause>nul
goto :EOF

:ProcessFolder
for %%I in (%1\*) do (
	REM echo %%I
	if [%%~xI]==[] (
		REM echo Extension blank!
		if exist %%I\nul (
			REM echo Folder exists
			call :ProcessFolder "%%I"
		) else (
			REM echo Folder is nope
		call :ProcessFiles "%%I"
			echo.
		)
	) else (
		call :ProcessFiles "%%I"
		echo.
	)
)
exit /B

:ProcessFiles
echo %~nx1
REM echo %BATDIR%cleanedfiles.log
if %_logging%==1 (
	if %_debug%==1 echo _usemd5=%_usemd5%
	if %_usemd5%==1 (
		echo Calculating MD5...
		if %_hascertutil%==1 (
			for /F "skip=1" %%J in ('certutil -hashfile %1 MD5') DO if NOT %%J==CertUtil: set _initialMD5=%%J
			for /F %%K in (%BATDIR%cleanedMD5s.log) DO (
				if /I %%K==!_initialMD5! (
					echo File "%~nx1" previously cleaned.
					exit /B
				)
			)
		) else (
			for /F "eol=/" %%J in ('fciv %1') DO set _initialMD5=%%J
			for /F %%K in (%BATDIR%cleanedMD5s.log) DO (
				if /I %%K==!_initialMD5! (
					echo File "%~nx1" previously cleaned.
					exit /B
				)
			)
		)
	) else (
		if %_debug%==1 echo Begin test file path.
		for /F "delims=" %%G in (%BATDIR%cleanedfiles.log) DO (
			REM echo "%1"
			REM echo vs
			REM echo "%%G"
			if /I %%G==%1 (
				echo File "%~nx1" previously cleaned.
				exit /B
			) else (
				REM echo No match.
			)
			REM echo.
		)
	)
)
"%_cleaner%" -f %1
set _hastag==0
if EXIST "%~dpnx1.tag" (
	if %_debug%==1 echo Tag found
	set _hastag==1
	if %_keeptags%==0 (
		if %_debug%==1 echo Deleting tag...
		del /Q "%~dpnx1.tag"
	) else (
		if %_movetags%==1 (
			if %_movetagspath%==file (
				if NOT exist !_tagdest!\nul (
					REM echo FOLDER NO BE
					md !_tagdest!
				)
			)
			move "%~dpnx1.tag" "!_tagdest!\%~nx1.tag"
		)
	)
)
if %_logging%==1 (
	if %_usemd5%==1 (
		if %_hastag%==1 (
			echo Calculating new MD5...
			if %_hascertutil%==1 (
				for /F "skip=1" %%L in ('certutil -hashfile %1 MD5') DO if NOT %%L==CertUtil: set _finalMD5=%%L
			) else (
				for /F "eol=/" %%L in ('fciv %1') do set _finalMD5=%%L
			)
			echo !_finalMD5!>>%BATDIR%\cleanedMD5s.log
		) else (
			if %_debug%==1 echo No tag found, using initial MD5
			echo !_initialMD5!>>%BATDIR%\cleanedMD5s.log
		)
	) else (
		echo %1>>%BATDIR%\cleanedfiles.log
	)
)
exit /B

:EndOfFile
echo Press any key to close...
pause>nul
goto :EOF


code:
## About

This script simplifies scrubbing trailing data from video files using videocleaner.exe by proving a simple method for processing large numbers of files and preventing accidental reprocessing of files.

## Installation

Place *Drag'N'Drop.cmd* and *config.ini* in the same folder as videocleaner.exe.

Modify *config.ini* as you like.

## Usage

Drag any number of video files or folders containing videos onto *Drag'N'Drop.cmd*.

## Help, I don't have videocleaner.exe!

Ask your friendly neighborhood thread for help.


code:
[General]
# Provide some extra information
bDebug=0
# Absolute path to your videocleaner.exe
# !BATDIR! points to the location of this script
sVideocleaner=!BATDIR!\videocleaner.exe
[Logging]
# Toggles logging and skipping. Without this, dragging folders
# full of previously scanned files will take a while.
bLogging=true
# This option eliminates accidental rescanning when files are moved,
# but requires CertUtil or FCIV be installed.
# CertUtil should be included with modern versions of Windows, and
# more info on FCIV can be found here:
# https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/fciv-availability-and-description
bUseMD5=true
[Tags]
# If false, delete tags
bKeepTags=true
# If true, move tags
bMoveTags=true
#########################################################################
# Options: 'file' 'script' 'custom'                                     #
#########################################################################
# file: Tag is placed in 'tags' subfolder relative to file input.       #
# script: Tag is placed in 'tags' subfolder relative to videocleaner.   #
# custom: Tag is placed in folder defined in 'MoveTagsCustom' variable. #
#########################################################################
sMoveTagsPath=file
# Absolute path to location tags should be moved to.
# Requires MoveTagsPath=custom, and folder must exist before running.
# Variables need to be put in ! rather than %, like !BATDIR! above.
sMoveTagsCustom=


code:
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Start.tw
src/config/start.tw

repo_name: brankirk/fc


code:
# Ignore everything in this directory
*
# Except this file
!.gitignore


code:
#!/bin/bash

# Will add all *.tw files to StoryIncludes.
rm src/config/start.tw
cp src/config/start.tw.proto start.tw.tmp
find src -name '*.tw' -print >>start.tw.tmp
mv start.tw.tmp src/config/start.tw

HASH=`git log -n1 |grep commit | sed 's/commit //'`

./devTools/tweeGo/tweego -o bin/FC_pregmod.html src/config/start.tw

rm src/config/start.tw

path: compile


code:
#!/bin/bash

# Will add all *.tw files to StoryIncludes.
rm src/config/start.tw
cp src/config/start.tw.proto start.tw.tmp
find src -name '*.tw' -print >>start.tw.tmp
mv start.tw.tmp src/config/start.tw

HASH=`git log -n1 |grep -m1 commit | sed 's/commit //'`

./devTools/tweeGo/tweego -o bin/FC_pregmod_$HASH.html src/config/start.tw

rm src/config/start.tw

echo "FC_pregmod_$HASH.html" compilation finished.

path: compile-git


code:
@echo off
:: Free Cities Basic Compiler - Windows x86_64

:: Will add all *.tw files to StoryIncludes.
del src\config\start.tw
copy src\config\start.tw.proto start.tw.tmp >nul
>>start.tw.tmp (for /r "src" %%F in (*.tw) do echo %%F)
move start.tw.tmp src\config\start.tw >nul

CALL "%~dp0devTools\tweeGo\tweego.exe" -o "%~dp0bin/FC_pregmod.html" "%~dp0src\config\start.tw"

del src\config\start.tw
ECHO Done


code:
@echo off
:: Free Cities Basic Compiler - Windows x86_64
:: Will wait for keypress before terminating.

:: Will add all *.tw files to StoryIncludes.
del src\config\start.tw
copy src\config\start.tw.proto start.tw.tmp >nul
>>start.tw.tmp (for /r "src" %%F in (*.tw) do echo %%F)
move start.tw.tmp src\config\start.tw >nul

CALL "%~dp0devTools\tweeGo\tweego.exe" -o "%~dp0bin/FC_pregmod.html" "%~dp0src\config\start.tw"

del src\config\start.tw

ECHO Done
PAUSE


code:
:: slave generation widgets [nobr]

<<widget "NationalityToRace">>

<<if $fixedRace == 0>>

<<if ($activeSlave.nationality is "American")>>
	<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "latina", "latina", "asian", "amerindian", "mixed race")>>
<<elseif ($activeSlave.nationality is "Canadian")>>
	<<set $activeSlave.race to either("white", "white", "white", "white", "amerindian")>>
<<elseif ($activeSlave.nationality is "Puerto Rican")>>
	<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Cuban")>>
	<<set $activeSlave.race to either("latina", "black")>>
<<elseif ($activeSlave.nationality is "Haitian")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Jamaican")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Mexican")>>
	<<set $activeSlave.race to either("latina", "latina", "latina", "latina", "latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Dominican")>>
	<<set $activeSlave.race to either("mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "white", "white", "black")>>
<<elseif ($activeSlave.nationality is "Peruvian")>>
	<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Venezuelan")>>
	<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Bolivian")>>
	<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Guatemalan")>>
	<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Brazilian")>>
	<<set $activeSlave.race to either("black", "latina", "mixed race", "mixed race", "amerindian", "white")>>
<<elseif ($activeSlave.nationality is "Argentinian")>>
	<<set $activeSlave.race to either("white", "latina", "latina")>>
<<elseif ($activeSlave.nationality is "Chilean")>>
	<<set $activeSlave.race to either("white", "latina", "latina", "latina")>>
<<elseif ($activeSlave.nationality is "Colombian")>>
	<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Egyptian")>>
	<<set $activeSlave.race to either("black", "middle eastern", "middle eastern", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Turkish")>>
	<<set $activeSlave.race to either("middle eastern", "middle eastern", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Iranian")>>
	<<set $activeSlave.race to either("indo-aryan", "indo-aryan", "indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Armenian")>>
	<<set $activeSlave.race to either("indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Israeli")>>
	<<set $activeSlave.race to either("white", "middle eastern", "semitic", "semitic")>>
<<elseif ($activeSlave.nationality is "Saudi")>>
	<<set $activeSlave.race to either("black", "asian", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Moroccan")>>
	<<set $activeSlave.race to either("middle eastern", "middle eastern", "black")>>
<<elseif ($activeSlave.nationality is "Nigerian")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Kenyan")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Zimbabwean")>>
	<<set $activeSlave.race to either("black", "black", "black", "black", "white")>>
<<elseif ($activeSlave.nationality is "Ugandan")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Tanzanian")>>
	<<set $activeSlave.race to either("black", "black", "black", "semitic")>>
<<elseif ($activeSlave.nationality is "Ghanan")>>
	<<set $activeSlave.race to either("black", "black", "black", "semitic")>>
<<elseif ($activeSlave.nationality is "Congolese")>>
	<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Ethiopian")>>
	<<set $activeSlave.race to either("black", "black", "black", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "South African")>>
	<<set $activeSlave.race to either("black", "black", "black", "white")>>
<<elseif ($activeSlave.nationality is "Chinese")>>
	<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Korean")>>
	<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Japanese")>>
	<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Thai")>>
	<<set $activeSlave.race to either("asian", "asian", "malay")>>
<<elseif ($activeSlave.nationality is "Vietnamese")>>
	<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Indonesian")>>
	<<set $activeSlave.race to either("asian", "malay", "malay", "pacific islander")>>
<<elseif ($activeSlave.nationality is "Filipina")>>
	<<set $activeSlave.race to either("asian", "malay", "malay", "pacific islander")>>
<<elseif ($activeSlave.nationality is "Burmese")>>
	<<set $activeSlave.race to either("asian", "asian", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Nepalese")>>
	<<set $activeSlave.race to either("asian", "asian", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Uzbek")>>
	<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Afghan")>>
	<<set $activeSlave.race to either("indo-aryan", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Algerian")>>
	<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Libyan")>>
	<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Tunisian")>>
	<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Lebanese")>>
	<<set $activeSlave.race to either("middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Jordanian")>>
	<<set $activeSlave.race to either("middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Emirati")>>
	<<set $activeSlave.race to either("middle eastern", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Omani")>>
	<<set $activeSlave.race to either("middle eastern", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Malian")>>
	<<set $activeSlave.race to either("black", "black", "black", "black", "black", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Sudanese")>>
	<<set $activeSlave.race to either("black", "black", "black", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Yemeni")>>
	<<set $activeSlave.race to either("black", "semitic", "middle eastern", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Iraqi")>>
	<<set $activeSlave.race to either("semitic", "middle eastern", "middle eastern", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Indian")>>
	<<set $activeSlave.race to either("indo-aryan")>>
<<elseif ($activeSlave.nationality is "Malaysian")>>
	<<set $activeSlave.race to either("asian", "malay", "malay", "malay")>>
<<elseif ($activeSlave.nationality is "Kazakh")>>
	<<set $activeSlave.race to either("asian", "asian", "asian", "semitic", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Pakistani")>>
	<<set $activeSlave.race to either("indo-aryan", "indo-aryan", "indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Bangladeshi")>>
	<<set $activeSlave.race to either("indo-aryan")>>
<<elseif ($activeSlave.nationality is "Belarusian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Russian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Ukrainian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Irish")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Icelandic")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Finnish")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Swiss")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Danish")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Norwegian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Austrian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Slovak")>>
	<<set $activeSlave.race to either("white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Dutch")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Belgian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Czech")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Serbian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Portuguese")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Hungarian")>>
	<<set $activeSlave.race to either("white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Estonian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Polish")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
	<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Romanian")>>
	<<set $activeSlave.race to either("semitic", "white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "German")>>
	<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Swedish")>>
	<<set $activeSlave.race to either("middle eastern", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "French")>>
	<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "white", "white", "southern European")>>
<<elseif ($activeSlave.nationality is "Italian")>>
	<<set $activeSlave.race to either("middle eastern", "southern European", "southern European", "white", "white")>>
<<elseif ($activeSlave.nationality is "Greek")>>
	<<set $activeSlave.race to either("southern European")>>
<<elseif ($activeSlave.nationality is "Spanish")>>
	<<set $activeSlave.race to either("semitic", "southern European", "southern European")>>
<<elseif ($activeSlave.nationality is "British")>>
	<<set $activeSlave.race to either("indo-aryan", "white", "white", "white", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Scottish")>>
	<<set $activeSlave.race to either("middle eastern", "indo-aryan", "white", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Australian")>>
	<<set $activeSlave.race to either("white", "white", "black", "asian")>>
<<elseif ($activeSlave.nationality is "a New Zealander")>>
	<<set $activeSlave.race to either("white", "white", "white", "white", "pacific islander")>>
<</if>>

/% Begin mixed race rate adjustment. %/
/% Some countries are extremely ethnically homogeneous and unlikely to change soon. %/
<<if ($activeSlave.nationality is "Japanese")>>
	<<if random(1,100) > 98>>
		<<set $activeSlave.race to "mixed race">>
	<</if>>
<<elseif ($activeSlave.nationality is "Korean")>>
	<<if random(1,100) > 95>>
		<<set $activeSlave.race to "mixed race">>
	<</if>>
<<elseif ($activeSlave.nationality is "Polish") or ($activeSlave.nationality is "Romanian") or ($activeSlave.nationality is "Bulgarian") or ($activeSlave.nationality is "Lithuanian") or ($activeSlave.nationality is "Croatian")>>
	/% Croatia isn't an origin currently but the game might add it in the future. %/
	<<if random(1,100) > 98>>
		<<set $activeSlave.race to "mixed race">>
	<</if>>
<<elseif random(1,100) > 90>>
	/% Default rate. %/
	<<set $activeSlave.race to "mixed race">>
<</if>>
/% End mixed race rate adjustment. %/

<<else>>

<<switch $fixedRace>>
<<case "white">>
	<<set $activeSlave.nationality to $whiteNationalities.random()>>
<<case "asian">>
	<<set $activeSlave.nationality to $asianNationalities.random()>>
<<case "latina">>
	<<set $activeSlave.nationality to $latinaNationalities.random()>>
<<case "middle eastern">>
	<<set $activeSlave.nationality to $middleEasternNationalities.random()>>
<<case "black">>
	<<set $activeSlave.nationality to $blackNationalities.random()>>
<<case "indo-aryan">>
	<<set $activeSlave.nationality to $indoAryan"Nationalities.random()>>
<<case "pacific islander">>
	<<set $activeSlave.nationality to $pacificIslanderNationalities.random()>>
<<case "malay">>
	<<set $activeSlave.nationality to $malayNationalities.random()>>
<<case "amerindian">>
	<<set $activeSlave.nationality to $amerindianNationalities.random()>>
<<case "southern european">>
	<<set $activeSlave.nationality to $southernEuropean"Nationalities.random()>>
<<case "semitic">>
	<<set $activeSlave.nationality to $semiticNationalities.random()>>
<</switch>>
<<set $activeSlave.race = $fixedRace>>

<</if>>

<<if $arcologies[0].FSSupremacistLawME != 0>>
<<if $activeSlave.race == $arcologies[0].FSSupremacistRace>>
	<<set $activeSlave.race to "mixed race">>
<</if>>
<</if>>

<</widget>>

<<widget "NationalityToName">>

<<if ($activeSlave.nationality is "American")>>
	<<if $activeSlave.race is "black">>
		<<set $activeSlave.birthName to $africanAmericanSlaveNames.random()>>
	<<elseif $activeSlave.race is "latina">>
		<<set $activeSlave.birthName to $latinaSlaveNames.random()>>
	<<elseif $activeSlave.race is "asian">>
		<<set $activeSlave.birthName to $asianAmericanSlaveNames.random()>>
	<<elseif $activeSlave.race is "middle eastern">>
		<<set $activeSlave.birthName to $egyptianSlaveNames.random()>>
	<<else>>
		<<set $activeSlave.birthName to $whiteAmericanSlaveNames.random()>>
	<</if>>
<<case "Canadian">>
	<<set $activeSlave.birthName to $canadianSlaveNames.random()>>
<<case "Mexican">>
	<<set $activeSlave.birthName to $mexicanSlaveNames.random()>>
<<case "Dominican">>
	<<set $activeSlave.birthName to $dominicanSlaveNames.random()>>
<<case "Puerto Rican">>
	<<set $activeSlave.birthName to $puertoRicanSlaveNames.random()>>
<<case "Haitian">>
	<<set $activeSlave.birthName to $haitianSlaveNames.random()>>
<<case "Jamaican">>
	<<set $activeSlave.birthName to $jamaicanSlaveNames.random()>>
<<case "Cuban">>
	<<set $activeSlave.birthName to $cubanSlaveNames.random()>>
<<case "Guatemalan">>
	<<set $activeSlave.birthName to $guatemalanSlaveNames.random()>>
<<case "Chilean">>
	<<set $activeSlave.birthName to $chileanSlaveNames.random()>>
<<case "Peruvian">>
	<<set $activeSlave.birthName to $peruvianSlaveNames.random()>>
<<case "Bolivian">>
	<<set $activeSlave.birthName to $bolivianSlaveNames.random()>>
<<case "Venezuelan">>
	<<set $activeSlave.birthName to $venezuelanSlaveNames.random()>>
<<case "Belarusian">>
	<<set $activeSlave.birthName to $belarusianSlaveNames.random()>>
<<case "Russian">>
	<<set $activeSlave.birthName to $russianSlaveNames.random()>>
<<case "Ukrainian">>
	<<set $activeSlave.birthName to $ukrainianSlaveNames.random()>>
<<case "Italian">>
	<<set $activeSlave.birthName to $italianSlaveNames.random()>>
<<case "Spanish">>
	<<set $activeSlave.birthName to $spanishSlaveNames.random()>>
<<case "British">>
	<<set $activeSlave.birthName to $britishSlaveNames.random()>>
<<case "Scottish">>
	<<set $activeSlave.birthName to $scottishSlaveNames.random()>>
<<case "French">>
	<<set $activeSlave.birthName to $frenchSlaveNames.random()>>
<<case "German">>
	<<set $activeSlave.birthName to $germanSlaveNames.random()>>
<<case "Lithuanian">>
	<<set $activeSlave.birthName to $lithuanianSlaveNames.random()>>
<<case "Norwegian">>
	<<set $activeSlave.birthName to $norwegianSlaveNames.random()>>
<<case "Slovak">>
	<<set $activeSlave.birthName to $slovakSlaveNames.random()>>
<<case "Danish">>
	<<set $activeSlave.birthName to $danishSlaveNames.random()>>
<<case "Dutch">>
	<<set $activeSlave.birthName to $dutchSlaveNames.random()>>
<<case "Austrian">>
	<<set $activeSlave.birthName to $austrianSlaveNames.random()>>
<<case "Swiss">>
	<<set $activeSlave.birthName to $swissSlaveNames.random()>>
<<case "Serbian">>
	<<set $activeSlave.birthName to $serbianSlaveNames.random()>>
<<case "Belgian">>
	<<set $activeSlave.birthName to $belgianSlaveNames.random()>>
<<case "Czech">>
	<<set $activeSlave.birthName to $czechSlaveNames.random()>>
<<case "Portuguese">>
	<<set $activeSlave.birthName to $portugueseSlaveNames.random()>>
<<case "Swedish">>
	<<set $activeSlave.birthName to $swedishSlaveNames.random()>>
<<case "Romanian">>
	<<set $activeSlave.birthName to $romanianSlaveNames.random()>>
<<case "Hungarian">>
	<<set $activeSlave.birthName to $hungarianSlaveNames.random()>>
<<case "Estonian">>
	<<set $activeSlave.birthName to $estonianSlaveNames.random()>>
<<case "Irish">>
	<<set $activeSlave.birthName to $irishSlaveNames.random()>>
<<case "Icelandic">>
	<<set $activeSlave.birthName to $icelandicSlaveNames.random()>>
<<case "Finnish">>
	<<set $activeSlave.birthName to $finnishSlaveNames.random()>>
<<case "Greek">>
	<<set $activeSlave.birthName to $greekSlaveNames.random()>>
<<case "Polish">>
	<<set $activeSlave.birthName to $polishSlaveNames.random()>>
<<case "Brazilian">>
	<<set $activeSlave.birthName to $brazilianSlaveNames.random()>>
<<case "Egyptian">>
	<<set $activeSlave.birthName to $egyptianSlaveNames.random()>>
<<case "Colombian">>
	<<set $activeSlave.birthName to $colombianSlaveNames.random()>>
<<case "Argentinian">>
	<<set $activeSlave.birthName to $argentinianSlaveNames.random()>>
<<case "Turkish">>
	<<set $activeSlave.birthName to $turkishSlaveNames.random()>>
<<case "Iranian">>
	<<set $activeSlave.birthName to $iranianSlaveNames.random()>>
<<case "Armenian">>
	<<set $activeSlave.birthName to $armenianSlaveNames.random()>>
<<case "Israeli">>
	<<set $activeSlave.birthName to $israeliSlaveNames.random()>>
<<case "Saudi">>
	<<set $activeSlave.birthName to $saudiSlaveNames.random()>>
<<case "South African">>
	<<if $activeSlave.race is "black">>
		<<set $activeSlave.birthName to $blackSouthAfricanSlaveNames.random()>>
	<<else>>
		<<set $activeSlave.birthName to $whiteSouthAfricanSlaveNames.random()>>
	<</if>>
<<case "Nigerian">>
	<<set $activeSlave.birthName to $nigerianSlaveNames.random()>>
<<case "Congolese">>
	<<set $activeSlave.birthName to $congoleseSlaveNames.random()>>
<<case "Kenyan">>
	<<set $activeSlave.birthName to $kenyanSlaveNames.random()>>
<<case "Tanzanian">>
	<<set $activeSlave.birthName to $tanzanianSlaveNames.random()>>
<<case "Zimbabwean">>
	<<if $activeSlave.race == "white">>
		<<set $activeSlave.birthName to $britishSlaveNames.random()>>
	<<else>>
		<<set $activeSlave.birthName to $zimbabweanSlaveNames.random()>>
	<</if>>
<<case "Ghanan">>
	<<set $activeSlave.birthName to $ghananSlaveNames.random()>>
<<case "Ugandan">>
	<<set $activeSlave.birthName to $ugandanSlaveNames.random()>>
<<case "Ethiopian">>
	<<set $activeSlave.birthName to $ethiopianSlaveNames.random()>>
<<case "Moroccan">>
	<<set $activeSlave.birthName to $moroccanSlaveNames.random()>>
<<case "Chinese">>
	<<set $activeSlave.birthName to $chineseSlaveNames.random()>>
<<case "Korean">>
	<<set $activeSlave.birthName to $koreanSlaveNames.random()>>
<<case "Thai">>
	<<set $activeSlave.birthName to $thaiSlaveNames.random()>>
<<case "Vietnamese">>
	<<set $activeSlave.birthName to $vietnameseSlaveNames.random()>>
<<case "Japanese">>
	<<set $activeSlave.birthName to $japaneseSlaveNames.random()>>
<<case "Indonesian">>
	<<set $activeSlave.birthName to $indonesianSlaveNames.random()>>
<<case "Filipina">>
	<<set $activeSlave.birthName to $filipinaSlaveNames.random()>>
<<case "Bangladeshi">>
	<<set $activeSlave.birthName to $bangladeshiSlaveNames.random()>>
<<case "Malaysian">>
	<<set $activeSlave.birthName to $malaysianSlaveNames.random()>>
<<case "Uzbek">>
	<<set $activeSlave.birthName to $uzbekSlaveNames.random()>>
<<case "Afghan">>
	<<set $activeSlave.birthName to $afghanSlaveNames.random()>>
<<case "Nepalese">>
	<<set $activeSlave.birthName to $nepaleseSlaveNames.random()>>
<<case "Burmese">>
	<<set $activeSlave.birthName to $burmeseSlaveNames.random()>>
<<case "Iraqi">>
	<<set $activeSlave.birthName to $iraqiSlaveNames.random()>>
<<case "Yemeni">>
	<<set $activeSlave.birthName to $yemeniSlaveNames.random()>>
<<case "Sudanese">>
	<<set $activeSlave.birthName to $sudaneseSlaveNames.random()>>
<<case "Algerian">>
	<<set $activeSlave.birthName to $algerianSlaveNames.random()>>
<<case "Tunisian">>
	<<set $activeSlave.birthName to $tunisianSlaveNames.random()>>
<<case "Libyan">>
	<<set $activeSlave.birthName to $libyanSlaveNames.random()>>
<<case "Omani">>
	<<set $activeSlave.birthName to $omaniSlaveNames.random()>>
<<case "Malian">>
	<<set $activeSlave.birthName to $malianSlaveNames.random()>>
<<case "Jordanian">>
	<<set $activeSlave.birthName to $jordanianSlaveNames.random()>>
<<case "Lebanese">>
	<<set $activeSlave.birthName to $lebaneseSlaveNames.random()>>
<<case "Emirati">>
	<<set $activeSlave.birthName to $emiratiSlaveNames.random()>>
<<case "Kazakh">>
	<<set $activeSlave.birthName to $kazakhSlaveNames.random()>>
<<case "Pakistani">>
	<<set $activeSlave.birthName to $pakistaniSlaveNames.random()>>
<<case "Indian">>
	<<set $activeSlave.birthName to $indianSlaveNames.random()>>
<<case "Australian">>
	<<set $activeSlave.birthName to $australianSlaveNames.random()>>
<<case "a New Zealander">>
	<<set $activeSlave.birthName to $newZealanderSlaveNames.random()>>
<<default>>
	<<set $activeSlave.birthName to $whiteAmericanSlaveNames.random()>>
<</switch>>

<</widget>>

<<widget "NationalityToAccent">>

<<set $seed to either(0,1,1,2,2,2,3,3,3,3)>>

<<if ($activeSlave.nationality is "American")>>
	<<if $activeSlave.race is "black">>
	<<if $language is "English">>
		<<set $activeSlave.accent to 0>>
	<<else>>
		<<set $activeSlave.accent to either(0,1,1,2,2,2,3,3,3,3)>>
	<</if>>
	<<elseif $activeSlave.race is "latina">>
	<<if $language is "English">>
		<<set $activeSlave.accent to 0>>
	<<elseif $language is "Spanish">>
		<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
		<<set $activeSlave.accent to $seed>>
	<</if>>
	<<elseif $activeSlave.race is "asian">>
	<<if $language is "English">>
		<<set $activeSlave.accent to 0>>
	<<elseif $language is "Chinese">>
		<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
		<<set $activeSlave.accent to $seed>>
	<</if>>
	<<elseif $activeSlave.race is "middle eastern">>
	<<if $language is "English">>
		<<set $activeSlave.accent to 0>>
	<<elseif $language is "Arabic">>
		<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
		<<set $activeSlave.accent to $seed>>
	<</if>>
	<<else>>
	<<if $language is "English">>
		<<set $activeSlave.accent to 0>>
	<<else>>
		<<set $activeSlave.accent to $seed>>
	<</if>>
	<</if>>
<<elseif ($activeSlave.nationality is "Canadian")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Mexican")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Dominican")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Puerto Rican")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Haitian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Jamaican")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Cuban")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Guatemalan")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Chilean")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Peruvian")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Bolivian")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Venezuelan")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Russian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Ukrainian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Italian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Spanish")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "British")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Scottish")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 2>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "French")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "German")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Belarusian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "French")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "German")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Norwegian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Slovak")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Danish")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Dutch")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Austrian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Swiss")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Serbian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Belgian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Czech")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Portuguese")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Swedish")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Romanian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Hungarian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Estonian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Irish")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Icelandic")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Finnish")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Greek")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Polish")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Brazilian")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Egyptian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Colombian")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Argentinian")>>
	<<if $language is "Spanish">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Turkish")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Iranian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Armenian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Israeli")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Saudi")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "South African")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Nigerian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Congolese")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Kenyan")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Tanzanian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Zimbabwean")>>
	<<if $language is "English" && $activeSlave.race == "white">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Ghanan")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Ugandan")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Ethiopian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Moroccan")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Chinese")>>
	<<if $language is "Chinese">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Korean")>>
	<<if $language is "Chinese">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Thai")>>
	<<if $language is "Chinese">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Vietnamese")>>
	<<if $language is "Chinese">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Japanese")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Indonesian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Filipina")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Bangladeshi")>>
	<<if $language is "Indian">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Malaysian")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Uzbek")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Afghan")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Nepalese")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Burmese")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Iraqi")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Yemeni")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Sudanese")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Algerian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Tunisian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Libyan")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Omani")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Malian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Jordanian")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Lebanese")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Emirati")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Kazakh")>>
	<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Pakistani")>>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to either(0,1,2,3)>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Indian")>>
	<<if $language is "Indian">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "Australian")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif ($activeSlave.nationality is "a New Zealander")>>
	<<if $language is "English">>
	<<set $activeSlave.accent to 1>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif $activeSlave.nationality is "Roman Revivalist">>
	<<if $language is "Latin">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif $activeSlave.nationality is "Ancient Egyptian Revivalist">>
	<<if $language is "Ancient Egyptian">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif $activeSlave.nationality is "Edo Revivalist">>
	<<if $language is "Japanese">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif $activeSlave.nationality is "Arabian Revivalist">>
	<<if $language is "Arabic">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<elseif $activeSlave.nationality is "Ancient Chinese Revivalist">>
	<<if $language is "Chinese">>
	<<set $activeSlave.accent to 0>>
	<<else>>
	<<set $activeSlave.accent to $seed>>
	<</if>>
<<else>>
	<<set $activeSlave.accent to $seed>>
<</if>>

<<if $activeSlave.nationality is $language>>
	<<set $activeSlave.accent to 0>>
<</if>>

<</widget>>

path: devNotes/Slave Generation Widgets.txt


code:
########################################################################################################################
#
# sugarcube-2.py
#
# Copyright (c) 2013-2017 Thomas Michael Edwards <tmedwards@motoslave.net>. All rights reserved.
# Use of this source code is governed by a Simplified BSD License which can be found in the LICENSE file.
#
########################################################################################################################

import os, os.path, header
from collections import OrderedDict

class Header (header.Header):

	def filesToEmbed(self):
		userLibPath = self.path + os.sep + 'userlib.js'
		if os.path.isfile(userLibPath):
			return OrderedDict([
				('"USER_LIB"', userLibPath)
			])
		else:
			return OrderedDict()

	def storySettings(self):
		return "SugarCube 2.x does not support the StorySettings special passage.\n\nInstead, you should use its configuration object, config.\n    See: http://www.motoslave.net/sugarcube/2/docs/config-object.html"

	def isEndTag(self, name, tag):
		return (name == ('/' + tag) or name == ('end' + tag))

	def nestedMacros(self):
		return [
				# standard macros
				'append',
				'button',
				'capture',
				'createplaylist',
				'for',
				'if',
				'link',
				'linkappend',
				'linkprepend',
				'linkreplace',
				'nobr',
				'prepend',
				'repeat',
				'replace',
				'script',
				'switch',
				'silently',
				'timed',
				'widget',
				# deprecated macros
				'click'
			]

	def passageTitleColor(self, passage):
		additionalSpecialPassages = [
				'PassageDone',
				'PassageFooter',
				'PassageHeader',
				'PassageReady',
				'StoryBanner',
				'StoryCaption',
				'StoryShare'
			]
		if passage.isStylesheet():
			return ((111, 49, 83), (234, 123, 184))
		elif passage.isScript():
			return ((89, 66, 28), (226, 170, 80))
		elif ('widget' in passage.tags):
			return ((80, 106, 26), (134, 178, 44))
		elif passage.isInfoPassage() or (passage.title in additionalSpecialPassages):
			return ((28, 89, 74), (41, 214, 113))
		elif passage.title == 'Start':
			return ('#4ca333', '#4bdb24')

	def passageChecks(self):
		return super(Header, self).passageChecks()


code:
How to mod (basic doc):

1. All sources now in the src subdir, in separate files. 1 passage = 1 file.

2. Special files and dir's:
    - src/config 		- configuration of the story is here.
    - src/config/start.tw 	- contains list of .tw passage files, regenerated automatic, by building scripts. Do not change by hands. (origial passage Start from pregmod renamed and moved to src/events/intro/introSummary.tw)
    - src/js/storyJS.tw		- special passage with [script] tag - contain all native JavaScript from pregmod.
    - devTools/tweeGo/targets/sugarcube-2/userlib.js - on original FC JS moved here (I deleted it after moving JS to storyJS.tw). Compare to storyJS.tw but do not copy file here. May conflict with src/js/storyJS.tw if copied.
    - src/pregmod 		- I put all pregmod-only passages here.
    - .gitignore 		- special file for git - to ignore some files. For example - compilation results.

3. Compilation:

    Windows:
    Run compile.bat - result will be file bin/FC_pregmod.html
    Second run of compile.but will overwrite bin/FC_pregmod.html without prompt.

    Linux:
    Ensure executable permission on file "devTools/tweeGo/tweego" (not tweego.exe!)
    Ensure executable permission on file "compile"
    In the root dir of sources (where you see src, devTools, bin...) run command "./compile" from console
    compile-git will produce the same result file but with current commit hash in filename.

    Mac:
    Don't supported directly (I don't have access to Mac for testing).
    But potentially can be used linux compilation script if you download tweego for mac from here: https://bitbucket.org/tmedwards/tweego/downloads/ and replace linux executable with mac executable in ./devTools/tweeGo/ folder. This is not tested though.

4. Simple comparing and merging with original FC:

    Use meld tool. Place folder FreeCities (original FC sources tree) near FreeCitiesPregmod (this sources tree) and use command:
    meld FreeCities FreeCitiesPregmod
    or just select these folders in meld's GUI.

5. All modders will be wery grateful if any, who make some changes to game, with .html file also post his/her resulting src folder tree.

6. For contributors to pregmod: if you don't use git, then you need to post yours version of src folder tree, not just produced FC_pregmod.html file!!! This html file can't be reverted to proper sources, and useless as contribution!

7. Git workflow:
    - Master branch is pregmod-master. Only Pregmodder can add something to it directly. Always contain his last public changes.
    - pregmod-dev - branch with experimental code mainly by pregmodfan.
    - Any contributions will be placed in separate branches like pregmod-mod-<something> (if it's ready to merge with master complete feature/mod) or pregmod-contrib-<something> if it's partial work until contributions is reviewed.

    Typical cycle with git:
	1. Make account on gitgud if you don't have usable one.
	2. Fork main repository through gitgud interface. (Or pull changes from main repo if you already have fork.)
	3. Clone your fork to local machine witn git client  (Or pull changes if already cloned.)
	4. Make you changes as you like, commit, and push result into your forked repository (with git client).
	5. Make merge request through gitgud interface.


code:
:: MOD_Edit Arcology Cheat [nobr]

	<<set $nextButton to "Continue">>
	<<set $nextLink to "MOD_Edit Arcology Cheat Datatype Cleanup">>
	<<set $PC.actualAge to Math.clamp($PC.actualAge, 18, 80)>>

''Cheating Edit Arcology''

<<if ($economy != 1) || ($seeDicks != 25) || ($continent != "North America") || ($internationalTrade != 1) || ($internationalVariety != 1) || ($seeRace != 1) || ($seeNationality != 1) || ($seeExtreme != 0) || ($plot != 1)>>
	//[[restore defaults|MOD_Edit Arcology Cheat][$seeDicks to 25,$economy to 1,$continent to "North America",$internationalTrade to 1,$internationalVariety to 1,$seeRace to 1,$seeNationality to 1,$seeExtreme to 0,$plot to 1]]//
<</if>>

<<if $economy == 1>>
	The world economy is in ''doubtful'' shape.
	[[Easier|MOD_Edit Arcology Cheat][$economy to 0.5]] | [[Harder|MOD_Edit Arcology Cheat][$economy to 1.5]]
<<elseif $economy < 1>>
	The world economy is still in ''good'' shape.
	[[Harder|MOD_Edit Arcology Cheat][$economy to 1]]
<<else>>
	The world economy is in ''terrible'' shape.
	[[Easier|MOD_Edit Arcology Cheat][$economy to 1]]
<</if>>

<<set $drugsCost = Math.trunc(100*$economy)>>
<<set $rulesCost = Math.trunc(100*$economy)>>
<<set $modCost = Math.trunc(50*$economy)>>
<<set $surgeryCost = Math.trunc(300*$economy)>>

The arcology is located in ''$continent''.

[[North America|MOD_Edit Arcology Cheat][$continent to "North America", $language to "English"]] | [[South America|MOD_Edit Arcology Cheat][$continent to "South America", $language to "Spanish"]] | [[Europe|MOD_Edit Arcology Cheat][$continent to "Europe", $language to "English"]] | [[the Middle East|MOD_Edit Arcology Cheat][$continent to "the Middle East", $language to "Arabic"]] | [[Africa|MOD_Edit Arcology Cheat][$continent to "Africa", $language to "Arabic"]] | [[Asia|MOD_Edit Arcology Cheat][$continent to "Asia", $language to "Chinese"]] | [[Australia|MOD_Edit Arcology Cheat][$continent to "Australia", $language to "English"]] | [[Japan|MOD_Edit Arcology Cheat][$continent to "Japan", $language to "Japanese"]]

The lingua franca of the arcology is ''$language''.

<<if $language != "English">>
	[[English|MOD_Edit Arcology Cheat][$language to "English"]] |
<<else>>
	English |
<</if>>
<<if $language != "Spanish">>
	[[Spanish|MOD_Edit Arcology Cheat][$language to "Spanish"]] |
<<else>>
	Spanish |
<</if>>
<<if $language != "Arabic">>
	[[Arabic|MOD_Edit Arcology Cheat][$language to "Arabic"]] |
<<else>>
	Arabic |
<</if>>
<<if $language != "Chinese">>
	[[Chinese|MOD_Edit Arcology Cheat][$language to "Chinese"]] |
<<else>>
	Chinese |
<</if>>
Custom: <<textbox "$language" $language "MOD_Edit Arcology Cheat">>

<<if $internationalTrade == 0>>
	The slave trade is ''continental,'' so a narrower variety of slaves will be available.
	[[Allow intercontinental trade|MOD_Edit Arcology Cheat][$internationalTrade to 1]]
<<else>>
	The slave trade is ''international,'' so a wider variety of slaves will be available.
	[[Restrict the trade to continental|MOD_Edit Arcology Cheat][$internationalTrade to 0]]
<</if>>

<<if $internationalTrade == 1>>
<<if $internationalVariety == 0>>
	International slave variety is ''semi-realistic,'' so more populous nations will be more common.
	[[Normalized national variety|MOD_Edit Arcology Cheat][$internationalVariety to 1]]
<<else>>
	International slave variety is ''normalized,'' so small nations will appear nearly as much as large ones.
	[[Semi-realistic national variety|MOD_Edit Arcology Cheat][$internationalVariety to 0]]
<</if>>
<</if>>

<<if $seeRace == 1>>
	Ethnicity will ''occasionally'' be mentioned.
	[[Disable most mentions of race|MOD_Edit Arcology Cheat][$seeRace to 0]]
<<else>>
	Ethnicity will ''almost never'' be mentioned.
	[[Enable mentions of race|MOD_Edit Arcology Cheat][$seeRace to 1]]
<</if>>

<<if $seeNationality == 1>>
	Nationality will ''occasionally'' be mentioned.
	[[Disable most mentions of nationality|MOD_Edit Arcology Cheat][$seeNationality to 0]]
<<else>>
	Nationality will ''almost never'' be mentioned.
	[[Enable mentions of nationality|MOD_Edit Arcology Cheat][$seeNationality to 1]]
<</if>>

<<if $seeExtreme == 1>>
	Extreme content like amputation is ''enabled''.
	[[Disable|MOD_Edit Arcology Cheat][$seeExtreme to 0]]
<<else>>
	Extreme content like amputation is ''disabled''.
	[[Enable|MOD_Edit Arcology Cheat][$seeExtreme to 1]]
<</if>>

<<if ($weightAffectsAssets != 0)>>
Slave assets affected by weight is ''enabled''. [[Disable|MOD_Edit Arcology Cheat][$weightAffectsAssets to 0]]
<<else>>
Slave assets affected by weight is ''disabled''. [[Enable|MOD_Edit Arcology Cheat][$weightAffectsAssets to 1]]
<</if>> //If enabled, thin slaves will have large assets drop in size and vice versa at week end. (Diet still affects asset sizes).//

<<if ($curativeSideEffects != 0)>>
Curative side effects are ''enabled''. [[Disable|MOD_Edit Arcology Cheat][$curativeSideEffects to 0]]
<<else>>
Curative side effects are ''disabled''. [[Enable|MOD_Edit Arcology Cheat][$curativeSideEffects to 1]]
<</if>> //If enabled, curatives have a chance to give slaves harmful side effects.//

Slave girls will
<<if $seeDicks >= 90>>
	''almost always'' have dicks.
	[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
	 | [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
	 | [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
	 | [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
<<elseif $seeDicks > 50>>
	''more likely than not'' have dicks.
	[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
	 | [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
	 | [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
	 | [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<elseif $seeDicks > 25>>
	''occasionally'' have dicks.
	[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
	 | [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
	 | [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
	 | [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<elseif $seeDicks > 0>>
	''rarely'' have dicks.
	[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
	 | [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
	 | [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
	 | [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<else>>
	''almost never'' have dicks.
	 [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
	 | [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
	 | [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
	 | [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<</if>>
<<link "Go your own dick way">>
	<<textbox "$seeDicks" $seeDicks>>
	[[Apply|MOD_Edit Arcology Cheat][$seeDicks to Number($seeDicks)]]
<</link>>

<<if $plot == 1>>
	Game mode: ''two-handed''. Includes non-erotic events concerning the changing world.
	[[Disable non-erotic events|MOD_Edit Arcology Cheat][$plot to 0]]
<<else>>
	Game mode: ''one-handed''. No non-erotic events concerning the changing world.
	[[Enable non-erotic events|MOD_Edit Arcology Cheat][$plot to 1]]
<</if>>

/*<<nobr>>
<<if $normalizedEvents == 1>>
	Random events distribution: ''normalized''. Random events will happen with equal frequency.
	[[Realistic|MOD_Edit Arcology Cheat][$normalizedEvents to 0]]
<<else>>
	Random events distribution: ''realistic''. Events will happen more frequently if more slaves qualify for them.
	[[Normalize|MOD_Edit Arcology Cheat][$normalizedEvents to 1]]
<</if>>
<</nobr>>*/

__Player Character__

<<if $PC.title gt 0>>
	Conversational title: ''Master''.
	[[Switch to Mistress|MOD_Edit Arcology Cheat][$PC.title to 0]]
<<else>>
	Conversational title: ''Mistress''.
	[[Switch to Master|MOD_Edit Arcology Cheat][$PC.title to 1]]
<</if>>

	Career: ''$PC.career''.
	[[Wealth|MOD_Edit Arcology Cheat][$PC.career to "wealth"]] |
	[[Business|MOD_Edit Arcology Cheat][$PC.career to "capitalist"]] |
	[[PMC work|MOD_Edit Arcology Cheat][$PC.career to "mercenary"]] |
	[[Slaving|MOD_Edit Arcology Cheat][$PC.career to "slaver"]] |
	[[Engineering|MOD_Edit Arcology Cheat][$PC.career to "engineer"]] |
	[[Medicine|MOD_Edit Arcology Cheat][$PC.career to "medicine"]] |
	[[Celebrity|MOD_Edit Arcology Cheat][$PC.career to "celebrity"]]

	Method of acquiring the arcology: ''$PC.rumor''.
	[[Wealth|MOD_Edit Arcology Cheat][$PC.rumor to "wealth"]] |
	[[Hard work|MOD_Edit Arcology Cheat][$PC.rumor to "diligence"]] |
	[[Force|MOD_Edit Arcology Cheat][$PC.rumor to "force"]] |
	[[Social engineering|MOD_Edit Arcology Cheat][$PC.rumor to "social engineering"]] |
	[[Luck|MOD_Edit Arcology Cheat][$PC.rumor to "luck"]]

<<if $PC.dick gt 0>>
	Genitalia: ''penis''. Standard sex scenes; easier reputation maintenance.
	[[Switch to vagina|MOD_Edit Arcology Cheat][$PC.dick to 0]]
<<else>>
	Genitalia: ''vagina''. Sex scene variations; more difficult reputation maintenance.
	[[Switch to penis|MOD_Edit Arcology Cheat][$PC.dick to 1]]
<</if>>

<<if $PC.boobs gt 0>>
	Chest: ''breasts''. Sex scene variations; more difficult reputation maintenance.
	[[Remove breasts|MOD_Edit Arcology Cheat][$PC.boobs to 0]]
<<else>>
	Chest: ''masculine''. Standard sex scenes; easier reputation maintenance.
	[[Add breasts|MOD_Edit Arcology Cheat][$PC.boobs to 1]]
<</if>>

Age:
<<if $PC.actualAge >= 65>>
	''old''.
<<elseif $PC.actualAge >= 50>>
	''well into middle age''.
<<elseif $PC.actualAge >= 35>>
	''entering middle age''.
<<else>>
	''surprisingly young''.
<</if>>
<<textbox "$PC.actualAge" $PC.actualAge "MOD_Edit Arcology Cheat">>
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>

<<if $playerAging == 2>>
	You will ''age naturally.''
	[[Disable aging|MOD_Edit Arcology Cheat][$playerAging to 0]] |
	[[Semi aging|MOD_Edit Arcology Cheat][$playerAging to 1]]
<<elseif $playerAging == 1>>
	You ''will'' celebrate birthdays, but ''not age.''
	[[Enable aging fully|MOD_Edit Arcology Cheat][$playerAging to 2]] |
	[[Disable aging|MOD_Edit Arcology Cheat][$playerAging to 0]]
<<else>>
	You will ''not age,'' and not experience birthdays.
	[[Enable aging|MOD_Edit Arcology Cheat][$playerAging to 2]] |
	[[Semi aging|MOD_Edit Arcology Cheat][$playerAging to 1]]
<</if>>
//This option cannot be changed during the game//

Rename your character: <<textbox "$PCName" $PCName "MOD_Edit Arcology Cheat">>

Nationality: ''$PC.nationality''.<<textbox "$PC.nationality" $PC.nationality "MOD_Edit Arcology Cheat">>

Race: ''$PC.race''.
	[[White|MOD_Edit Arcology Cheat][$PC.race to "white"]] |
	[[Asian|MOD_Edit Arcology Cheat][$PC.race to "asian"]] |
	[[Latina|MOD_Edit Arcology Cheat][$PC.race to "latina"]] |
	[[Middle Eastern|MOD_Edit Arcology Cheat][$PC.race to "middle eastern"]] |
	[[Black|MOD_Edit Arcology Cheat][$PC.race to "black"]] |
	[[Semitic|MOD_Edit Arcology Cheat][$PC.race to "semitic"]] |
	[[Southern European|MOD_Edit Arcology Cheat][$PC.race to "southern european"]] |
	[[Indo-aryan|MOD_Edit Arcology Cheat][$PC.race to "indo-aryan"]] |
	[[Amerindian|MOD_Edit Arcology Cheat][$PC.race to "amerindien"]] |
	[[Pacific Islander|MOD_Edit Arcology Cheat][$PC.race to "pacific islander"]] |
	[[Malay|MOD_Edit Arcology Cheat][$PC.race to "malay"]] |
	[[Mixed Race|MOD_Edit Arcology Cheat][$PC.race to "mixed race"]]

Skin: ''$PC.skin''.
	[[White|MOD_Edit Arcology Cheat][$PC.skin to "white"]] |
	[[Fair|MOD_Edit Arcology Cheat][$PC.skin to "fair"]] |
	[[Light|MOD_Edit Arcology Cheat][$PC.skin to "light"]] |
	[[Dark|MOD_Edit Arcology Cheat][$PC.skin to "dark"]] |
	[[Olive|MOD_Edit Arcology Cheat][$PC.skin to "olive"]] |
	[[Black|MOD_Edit Arcology Cheat][$PC.skin to "black"]] |
	[[Light Brown|MOD_Edit Arcology Cheat][$PC.skin to "light brown"]] |
	[[Brown|MOD_Edit Arcology Cheat][$PC.skin to "brown"]] |
	[[Pale|MOD_Edit Arcology Cheat][$PC.skin to "pale"]] |
	[[Extremely Pale|MOD_Edit Arcology Cheat][$PC.skin to "extremely pale"]]

Eye color: ''$PC.eyeColor''.
<<textbox "$PC.eyeColor" $PC.eyeColor "MOD_Edit Arcology Cheat">>

Hair color: ''$PC.hColor''.
<<textbox "$PC.hColor" $PC.hColor "MOD_Edit Arcology Cheat">>

Preferred refreshment: <<textbox "$PC.refreshment" $PC.refreshment "MOD_Edit Arcology Cheat">> [[Cigars|MOD_Edit Arcology Cheat][$PC.refreshment to "cigar",$PC.refreshmentType = 0]] | [[Whiskey|MOD_Edit Arcology Cheat][$PC.refreshment to "whiskey",$PC.refreshmentType = 1]]

Preferred method of consumption: <<if $PC.refreshmentType == 0>>Smoked<<elseif $PC.refreshmentType == 1>>Drank<<elseif $PC.refreshmentType == 2>>Eaten<<elseif $PC.refreshmentType == 3>>Snorted<<else>>Injected<</if>>

[[Smoked|MOD_Edit Arcology Cheat][$PC.refreshmentType = 0]] | [[Drank|MOD_Edit Arcology Cheat][$PC.refreshmentType = 1]] | [[Eaten|MOD_Edit Arcology Cheat][$PC.refreshmentType = 2]] | [[Snorted|MOD_Edit Arcology Cheat][$PC.refreshmentType = 3]] | [[Injected|MOD_Edit Arcology Cheat][$PC.refreshmentType = 4]]

Arcology citizens: $ACitizens
<<textbox "$ACitizens" $ACitizens>>

Arcology sex slaves: $ASlaves
<<textbox "$ASlaves" $ASlaves>>

Arcology menial slaves:  $AHelots
<<textbox "$AHelots" $AHelots>>

Arcology prosperity cap: $AProsperityCap
<<textbox "$AProsperityCap" $AProsperityCap>>

Shelter Abuse Counter: $shelterAbuse
<<textbox "$shelterAbuse" $shelterAbuse>>

''The Slavegirl School:''

TSS Students Bought: <<textbox "$TSS.studentsBought" $TSS.studentsBought>>

TSS Upgrades: ''$TSS.schoolUpgrade'' |
<<radiobutton "$TSS.schoolUpgrade" 0>> 0
| <<radiobutton "$TSS.schoolUpgrade" 1>> 1
| <<radiobutton "$TSS.schoolUpgrade" 2>> 2

TSS Moved to Arcology: ''$TSS.schoolPresent'' |
<<radiobutton "$TSS.schoolPresent" 0>> 0
| <<radiobutton "$TSS.schoolPresent" 1>> 1 (Moved)

TSS Prosperity: <<textbox "$TSS.schoolProsperity" $TSS.schoolProsperity>>

TSS Failed: ''$TSS.schoolAnnexed'' |
<<radiobutton "$TSS.schoolAnnexed" 0>> 0
| <<radiobutton "$TSS.schoolAnnexed" 1>> 1 (Failed)

''The Growth Research Institute:''

GRI Students Bought: <<textbox "$GRI.studentsBought" $GRI.studentsBought>>

GRI Upgrades: ''$GRI.schoolUpgrade'' |
<<radiobutton "$GRI.schoolUpgrade" 0>> 0
| <<radiobutton "$GRI.schoolUpgrade" 1>> 1
| <<radiobutton "$GRI.schoolUpgrade" 2>> 2

GRI Moved to Arcology: ''$GRI.schoolPresent'' |
<<radiobutton "$GRI.schoolPresent" 0>> 0
| <<radiobutton "$GRI.schoolPresent" 1>> 1 (Moved)

GRI Prosperity: <<textbox "$GRI.schoolProsperity" $GRI.schoolProsperity>>

GRI Failed: ''$GRI.schoolAnnexed'' |
<<radiobutton "$GRI.schoolAnnexed" 0>> 0
| <<radiobutton "$GRI.schoolAnnexed" 1>> 1 (Failed)

''St. Claver Preparatory:''

SCP Students Bought: <<textbox "$SCP.studentsBought" $SCP.studentsBought>>

SCP Upgrades: ''$SCP.schoolUpgrade'' |
<<radiobutton "$SCP.schoolUpgrade" 0>> 0
| <<radiobutton "$SCP.schoolUpgrade" 1>> 1
| <<radiobutton "$SCP.schoolUpgrade" 2>> 2

SCP Moved to Arcology: ''$SCP.schoolPresent'' |
<<radiobutton "$SCP.schoolPresent" 0>> 0
| <<radiobutton "$SCP.schoolPresent" 1>> 1 (Moved)

SCP Prosperity: <<textbox "$SCP.schoolProsperity" $SCP.schoolProsperity>>

SCP Failed: ''$SCP.schoolAnnexed'' |
<<radiobutton "$SCP.schoolAnnexed" 0>> 0
| <<radiobutton "$SCP.schoolAnnexed" 1>> 1 (Failed)

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

''L'Ecole des Enculees:''

LDE Students Bought: <<textbox "$LDE.studentsBought" $LDE.studentsBought>>

LDE Upgrades: ''$LDE.schoolUpgrade'' |
<<radiobutton "$LDE.schoolUpgrade" 0>> 0
| <<radiobutton "$LDE.schoolUpgrade" 1>> 1
| <<radiobutton "$LDE.schoolUpgrade" 2>> 2

LDE Moved to Arcology: ''$LDE.schoolPresent'' |
<<radiobutton "$LDE.schoolPresent" 0>> 0
| <<radiobutton "$LDE.schoolPresent" 1>> 1 (Moved)

LDE Prosperity: <<textbox "$LDE.schoolProsperity" $LDE.schoolProsperity>>

LDE Failed: ''$LDE.schoolAnnexed'' |
<<radiobutton "$LDE.schoolAnnexed" 0>> 0
| <<radiobutton "$LDE.schoolAnnexed" 1>> 1 (Failed)

	''The Gymnasium-Academy:''

TGA Students Bought: <<textbox "$TGA.studentsBought" $TGA.studentsBought>>

TGA Upgrades: ''$TGA.schoolUpgrade''
<<radiobutton "$TGA.schoolUpgrade" 0>> 0
| <<radiobutton "$TGA.schoolUpgrade" 1>> 1
| <<radiobutton "$TGA.schoolUpgrade" 2>> 2

TGA Moved to Arcology: ''$TGA.schoolPresent'' |
<<radiobutton "$TGA.schoolPresent" 0>> 0
| <<radiobutton "$TGA.schoolPresent" 1>> 1 (Moved)

TGA Prosperity: <<textbox "$TGA.schoolProsperity" $TGA.schoolProsperity>>

TGA Failed: ''$TGA.schoolAnnexed'' |
<<radiobutton "$TGA.schoolAnnexed" 0>> 0
| <<radiobutton "$TGA.schoolAnnexed" 1>> 1 (Failed)

	''The Futanari Sisters:''

TFS Students Bought: <<textbox "$TFS.studentsBought" $TFS.studentsBought>>

TFS Upgrades: ''$TFS.schoolUpgrade'' |
<<radiobutton "$TFS.schoolUpgrade" 0>> 0
| <<radiobutton "$TFS.schoolUpgrade" 1>> 1
| <<radiobutton "$TFS.schoolUpgrade" 2>> 2

TFS Moved to Arcology: ''$TFS.schoolPresent'' |
<<radiobutton "$TFS.schoolPresent" 0>> 0
| <<radiobutton "$TFS.schoolPresent" 1>> 1 (Moved)

TFS Prosperity:<<textbox "$TFS.schoolProsperity" $TFS.schoolProsperity>>

TFS Failed: ''$TFS.schoolAnnexed'' |
<<radiobutton "$TFS.schoolAnnexed" 0>> 0
| <<radiobutton "$TFS.schoolAnnexed" 1>> 1 (Failed)
<</if>>

__Arcologies:__

    __''$arcologies[0].name''__ is your arcology.

You own: ''$arcologies[0].ownership%'' of the arcology <<textbox "$arcologies[0].ownership" $arcologies[0].ownership>>

Other minority ownership: ''$arcologies[0].minority%'' <<textbox "$arcologies[0].minority" $arcologies[0].minority>>

$arcologies[0].name's GSP is
@@color:yellowgreen;¤<<print Math.trunc(0.1*$arcologies[0].prosperity)>>m@@.

<<if $arcologies.length > 1>>
<<set _neighbors to Number($arcologies.length-1)>>

Your arcology has <<print Number($arcologies.length-1)>>
<<if _neighbors == 1>> neighbor<<else>> neighbors<</if>>.
<<else>>
Your arcology has no neighbors.
<</if>>

<<if $arcologies.length < 8>>
<<link "Add neighbor">>
	<<set $seed to ["north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"]>>

	<<set $activeArcology to {name: "Arcology X-", direction: "north", government: "an individual", honeymoon: 0, prosperity: 50, ownership: 50, minority: 20, PCminority: 0, demandFactor:0, FSSupremacist: "unset", FSSupremacistRace: 0, FSSubjugationist: "unset", FSSubjugationistRace: 0, FSGenderRadicalist: "unset", FSGenderFundamentalist: "unset", FSPaternalist: "unset", FSDegradationist: "unset", FSBodyPurist: "unset", FSTransformationFetishist: "unset", FSYouthPreferentialist: "unset", FSMaturityPreferentialist: "unset", FSSlimnessEnthusiast: "unset", FSAssetExpansionist: "unset", FSPastoralist: "unset", FSPhysicalIdealist: "unset", FSChattelReligionist: "unset", FSRomanRevivalist: "unset", FSEgyptianRevivalist: "unset", FSEdoRevivalist: "unset", FSArabianRevivalist: "unset", FSChineseRevivalist: "unset", FSNull: "unset", embargo: 1, embargoTarget: -1, influenceTarget: -1, influenceBonus: 0, rival: 0}>>

	<<if $arcologies.length < 4>>
		<<set $activeArcology.name to $activeArcology.name+$arcologies.length>>
	<<else>>
		<<set $activeArcology.name to $activeArcology.name+($arcologies.length+1)>>
	<</if>>

	<<set $activeArcology.direction to $seed.pluck()>>
	<<set $activeArcology.government to random(0,5)>>
	<<set $activeArcology.prosperity += random(-20,20)>>
	<<set $activeArcology.ownership += random(-10,0)>>
	<<set $activeArcology.minority += random(-5,5)>>
	<<set $arcologies.push($activeArcology)>>

	<<goto "MOD_Edit Arcology Cheat">>
<</link>>
<</if>>

<<set $averageProsperity to 0>>
<<set $seed to 0>>
<<for $i to 0; $i lt $arcologies.length; $i++>>
	<<set $averageProsperity += $arcologies[$i].prosperity>>
	<<set $seed += 1>>
<</for>>
<<set $averageProsperity to $averageProsperity/$seed>>

<<for $i to 0; $i < $arcologies.length; $i++>>
	<<if $arcologies[$i].direction != 0>>
	<<display "Neighbor Description">>
	<</if>>

	<<if $i != 0>>
	<<print "[[Remove neighbor|MOD_Edit Arcology Cheat][$arcologies.pluck( [" + $i + "], [" + $i + "] )]]">>
	<</if>>
<</for>>


code:
:: MOD_Edit Arcology Cheat Datatype Cleanup

<<nobr>>
	<<set $nextButton to "Continue">>
	<<set $nextLink to "Manage Arcology">>

	<<set $ACitizens to Number($ACitizens)>>
	<<set $ASlaves to Number($ASlaves)>>
	<<set $AHelots to Number($AHelots)>>
	<<set $shelterAbuse to Number($shelterAbuse)>>

	<<set $TSS.studentsBought to Number($TSS.studentsBought)>>
	<<set $TSS.schoolProsperity to Number($TSS.schoolProsperity)>>

	<<set $GRI.studentsBought to Number($GRI.studentsBought)>>
	<<set $GRI.schoolProsperity to Number($GRI.schoolProsperity)>>

	<<set $SCP.studentsBought to Number($SCP.studentsBought)>>
	<<set $SCP.schoolProsperity to Number($SCP.schoolProsperity)>>

	<<set $LDE.studentsBought to Number($LDE.studentsBought)>>
	<<set $LDE.schoolProsperity to Number($LDE.schoolProsperity)>>

	<<set $TGA.studentsBought to Number($TGA.studentsBought)>>
	<<set $TGA.schoolProsperity to Number($TGA.schoolProsperity)>>

	<<set $TFS.studentsBought to Number($TFS.studentsBought)>>
	<<set $TFS.schoolProsperity to Number($TFS.schoolProsperity)>>

	<<set $arcologies[0].ownership to Number($arcologies[0].ownership)>>
	<<set $arcologies[0].minority to Number($arcologies[0].minority)>>

	<<set $PC.actualAge to Number($PC.actualAge)>>
	<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>

	The chanting grows louder and louder, CHEAT! CHEAT! CHEAT!

	The Arcology morphs and changes shape, CHEAT! CHEAT! CHEAT!

	The Arcology has been changed forever and you forfeit your CHEATING CHEATY SOUL!
<</nobr>>\