code:
:: Customize Child [nobr]

<<set $nextButton = "Continue">>
<<set _oldName = $activeChild.slaveName, _oldSurname = $activeChild.slaveSurname>>

You may enter custom descriptors for the child's hair color, hair style, tattoos, or anything else here. After typing, press enter to commit your change. These custom descriptors will appear in descriptions of the child, but will have no gameplay effect. Changing them is free.

<<if $activeChild.devotion >= -50>>
	<<if $activeChild.custom.title != "">>
		You have instructed $him to always refer to you as $activeChild.custom.title, which, should $he lisp, comes out as $activeChild.custom.titleLisp.
	<<else>>
		You expect $him to refer to you as all your other slaves do.
	<</if>>

	<<if $activeChild.custom.title == "">>
		<<link "Set a custom title for $him to address you as">>
			<<replace "#result">>
				Custom title:
					<<textbox "$activeChild.custom.title" $activeChild.custom.title>>
				<<link "Apply">>
					<<replace "#result">>
						$He'll try $his best to call you $activeChild.custom.title.
						<<set $activeChild.custom.titleLisp = lispReplace($activeChild.custom.title)>>
					<</replace>>
				<</link>>
			<</replace>>
		<</link>>
	<<else>>
		$He's trying $his best to call you <<textbox "$activeChild.custom.title" $activeChild.custom.title>>

		<<link "Apply">>
			<<replace "#result">>
				$He'll try $his best to call you $activeChild.custom.title.
				<<set $activeChild.custom.titleLisp = lispReplace($activeChild.custom.title)>>
			<</replace>>
		<</link>> |
		<<link "Stop using a custom title">>
			<<replace "#result">>
				$He will no longer refer to you with a special title.
				<<set $activeChild.custom.title = "">>
				<<set $activeChild.custom.titleLisp = "">>
			<</replace>>
		<</link>>
	<</if>>

<<else>>
	//You must break $his will further before $he will refer to you by a new title.
	<<if SlaveStatsChecker.checkForLisp($activeChild)>>
		<<if (def $activeChild.custom.titleLisp) && ($activeChild.custom.titleLisp != "")>>
			For now, $he intends to keep calling you "<<print $activeChild.custom.titleLisp>>".
		<</if>>
	<<else>>
		<<if (def $activeChild.custom.title) && ($activeChild.custom.title != "")>>
			For now, $he intends to keep calling you "<<print $activeChild.custom.title>>".
		<</if>>
	<</if>>//
<</if>>

<<if ((($activeChild.devotion >= -50) || ($activeChild.trust < -20)) && ($activeChild.birthName != $activeChild.slaveName)) || (($activeChild.devotion > 20) || ($activeChild.trust < -20))>>
	Change $his given name<<if $activeChild.birthName != $activeChild.slaveName>> ($his birth name was $activeChild.birthName)<</if>>:
		<<includeDom App.UI.DOM.makeTextBox(
			$activeChild.slaveName,
			v => {
				$activeChild.slaveName = v;
				App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname});
			},
			false
		)>>
	<<link "Restore $his birth name">>
		<<set $activeChild.slaveName = $activeChild.birthName>>
		<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
	<</link>>
	<<if $arcologies[0].FSPastoralist != "unset">>
		<<if $activeChild.lactation > 0>>
			| <<link "Give $him a random cow given name">>
				<<set $activeChild.slaveName = setup.cowSlaveNames.random()>>
				<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
			<</link>>
		<</if>>
	<</if>>
	<<if child.race == "catgirl">>
		| <<link "Give $him a random cat given name">>
			<<set $activeChild.slaveName = setup.catSlaveNames.random()>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<</if>>
	<<if $arcologies[0].FSChattelReligionist != "unset">>
		| <<link "Give $him a random devotional given name">>
			<<set $activeChild.slaveName = setup.chattelReligionistSlaveNames.random()>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<</if>>

	Change $his surname<<if $activeChild.birthSurname != $activeChild.slaveSurname>> ($his birth surname was $activeChild.birthSurname)<</if>>:
	<<if $activeChild.slaveSurname>>
		<<includeDom App.UI.DOM.makeTextBox(
			$activeChild.slaveSurname,
			v => {
				$activeChild.slaveSurname = v;
				App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname});
			},
			false
		)>>
	<<else>>
		<<includeDom App.UI.DOM.makeTextBox(
			"",
			v => {
				$activeChild.slaveSurname = v;
				App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname});
			},
			false
		)>>
	<</if>>
	<<link "Restore $his birth surname">>
		<<set $activeChild.slaveSurname = $activeChild.birthSurname>>
		<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
	<</link>>
	<<if $activeChild.slaveSurname>>
		| <<link "Take $his surname away">>
			<<set $activeChild.slaveSurname = 0>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<</if>>
	<<if $activeChild.relationship >= 5>>
		<<for _i = 0; _i < $slaves.length; _i++>>
			<<if $activeChild.relationshipTarget == $slaves[_i].ID>>
				<<if $slaves[_i].slaveSurname>>
					<<if $activeChild.slaveSurname != $slaves[_i].slaveSurname>>
						| <<link "Give $him $his wife's surname">>
							<<set $activeChild.slaveSurname = $slaves[_i].slaveSurname>>
							<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
						<</link>>
						<<break>>
					<</if>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if $activeChild.relationship == -3>>
		<<if $PC.slaveSurname>>
			<<if $activeChild.slaveSurname != $PC.slaveSurname>>
				| <<link "Give $him your surname">>
					<<set $activeChild.slaveSurname = $PC.slaveSurname>>
					<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
				<</link>>
			<</if>>
		<</if>>
	<</if>>
	<<if $arcologies[0].FSRomanRevivalist != "unset">>
		| <<link "Give $him a random full Roman name">>
			<<set $activeChild.slaveName = setup.romanSlaveNames.random()>>
			<<set $activeChild.slaveSurname = setup.romanSlaveSurnames.random()>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<<elseif $arcologies[0].FSAztecRevivalist != "unset">>
		| <<link "Give $him a random full Aztec name">>
			<<set $activeChild.slaveName = setup.aztecSlaveNames.random()>>
			<<set $activeChild.slaveSurname = 0>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<<elseif $arcologies[0].FSEgyptianRevivalist != "unset">>
		| <<link "Give $him a random full ancient Egyptian name">>
			<<set $activeChild.slaveName = setup.ancientEgyptianSlaveNames.random()>>
			<<set $activeChild.slaveSurname = 0>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<<elseif $arcologies[0].FSEdoRevivalist != "unset">>
		| <<link "Give $him a random full feudal Japanese name">>
			<<set $activeChild.slaveName = setup.edoSlaveNames.random()>>
			<<set $activeChild.slaveSurname = setup.edoSlaveSurnames.random()>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<</if>>
	<<if $arcologies[0].FSDegradationist > -1>>
		| <<link "Give $him a degrading full name">>
			<<run DegradingName($activeChild)>>
			<<run App.UI.SlaveInteract.rename($activeChild, {oldName:_oldName, oldSurname:_oldSurname})>>
		<</link>>
	<</if>>
<<else>>
	//You must break $his will further before you can successfully force a new name on $him.//
<</if>>

<<switch $activeChild.hStyle>>
<<case "tails" "dreadlocks" "cornrows">>
	$His hair is in $activeChild.hStyle.
<<case "ponytail">>
	$His hair is in a $activeChild.hStyle.
<<default>>
	$His hair is $activeChild.hStyle.
<</switch>>
Custom hair description:
	<<textbox "$activeChild.hStyle" $activeChild.hStyle "Add custom descriptors">>

	//For best results, use a short, uncapitalized and unpunctuated description; for example: 'back in a ponytail'//

$His hair is $activeChild.hColor in color.
Custom hair color:
	<<textbox "$activeChild.hColor" $activeChild.hColor "Add custom descriptors">>

	//For best results, use a short, uncapitalized and unpunctuated description; for example: 'black with purple highlights'//

<<if $activeChild.eyeColor != $activeChild.origEye>>
	$He is wearing $activeChild.eyeColor lenses.
<<else>>
	$He has $activeChild.eyeColor eyes.
<</if>>
Custom eye color:
	<<textbox "$activeChild.eyeColor" $activeChild.eyeColor "Add custom descriptors">>

	//For best results, use a short, uncapitalized and unpunctuated description; for example: 'blue'//

Change $his custom tattoo:
	<<textbox "$activeChild.custom.tattoo" $activeChild.custom.tattoo "Add custom descriptors">>

	//For best results, use complete sentences; for example: '$He has blue stars tattooed along $his cheekbones.'//

Change $his origin story:
	<<textbox "$activeChild.origin" $activeChild.origin "Add custom descriptors">>

	//For best results, use complete, capitalized and punctuated sentences; for example: '$He followed you home from the pet store.'//

Change $his custom description:
	<<textbox "$activeChild.custom.desc" $activeChild.custom.desc "Add custom descriptors">>

	//For best results, use complete, capitalized and punctuated sentences; for example: '$He has a beauty mark above $his left nipple.'//

Change $his custom label:
	<<textbox "$activeChild.custom.label" $activeChild.custom.label "Add custom descriptors">>

	//For best results, use a short phrase; for example: 'Breeder.'//

Assign $him a custom image: <input id="customImageValue" type="text">
<<link "Reset" "Add custom descriptors">>
	<<set $activeChild.custom.image = null>>
<</link>>

    //File must be in// <tt><select id="customImageFormatSelector" style="border: none;"><option value="png">PNG</option><option value="jpg">JPG</option><option value="gif">GIF</option><option value="webm">WEBM</option></select></tt> //format. Place file in the \resources folder. Enter the filename without the extension. For example, for a file with the path// <tt>\bin\resources\headgirl.png</tt>, //enter //<tt>headgirl</tt>.
<>
<<if $seeImages == 1 && $imageChoice == 1>>

	<<if ndef $activeChild.custom.hairVector>>
		<<set $activeChild.custom.hairVector = 0>>
	<</if>>
	Assign $him a custom hair SVG image:
	<<if $activeChild.custom.hairVector != 0>>
		<<textbox "$activeChild.custom.hairVector" $activeChild.custom.hairVector "Add custom descriptors">>
	<<else>>
		<<textbox "$activeChild.custom.hairVector" "" "Add custom descriptors">>
	<</if>>
	<<link "Reset" "Add custom descriptors">>
		<<set $activeChild.custom.hairVector = 0>>
	<</link>>
<</if>>


code:
:: Export Child [nobr]

<<set $nextButton = "Continue", $nextLink = "Child Interact">>

//Copy the following block of code for importing//

<<if (ndef $activeChild.currentRules) || ($activeChild.currentRules.length < 1)>>
	<<set _currentRules = "[]">>
<<else>>
	<<set _currentRules = "$activeChild.currentRules">>
<</if>>

/*

 __Direct JSON export method__:

 */

	<<set _jsonText = toJson($activeChild)>>
	_jsonText

repo_name: Pecanus/fc

license: mit


code:
:: Import Child [nobr]

<<set $nextButton = "Continue", $nextLink = "Child Interact">>

//Paste the code into the text box and click Apply//

<<set $tempChild = "">>
<<textbox "$tempChild" $tempChild>>
<<link "Apply">>
	<<if (def $tempChild) && ($tempChild !== "")>>
		<<set $tempChild = eval('({' + $tempChild + '})')>>
		<<set $tempChild.ID = generateSlaveID()>>
		<<run newChild($tempChild)>>
		<<replace #import>>
			''Child imported successfully!''

		<</replace>>
		<<unset $tempChild>>
	<<else>>
		<<replace #import>>
			''Child not imported.''

		<</replace>>
	<</if>>
<</link>>

<<link "Continue">>
	<<goto "Child Interact">>
<</link>>