code:
:: slave creation widgets [widget nobr]

/%
 Call as <<StartingGirlsWorkaround>>
%/
<<widget "StartingGirlsWorkaround">>
	<<display "Generate New Slave">>
	<<set $startingGirlCopied to 0>>
	<<set $activeSlave.health = 0>>
	<<set $activeSlave.devotion = 0>>
	<<set $activeSlave.trust = 0>>
	<<set $activeSlave.sexualQuirk to "none">>
	<<set $activeSlave.behavioralQuirk to "none">>
	<<set $activeSlave.fetishKnown to 1>>
	<<if $activeSlave.vagina < 0>>
	<<set $activeSlave.ovaries = 0>>
	<<elseif $activeSlave.vagina < 1>>
	<<set $activeSlave.vaginalSkill = 0>>
	<</if>>
	<<if $activeSlave.anus < 1>>
	<<set $activeSlave.analSkill = 0>>
	<</if>>

	<<set $activeSlave.actualAge to Number($activeSlave.actualAge)>>
	<<set $activeSlave.devotion = Number($activeSlave.devotion)>>
	<<set $activeSlave.trust = Number($activeSlave.trust)>>
	<<if $activeSlave.indenture >= 0>>
		<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208)>>
	<</if>>
	<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274)>>
	<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs, 0, 10000)>>
	<<set $activeSlave.boobs = Number($activeSlave.boobs)>>
	<<set $activeSlave.boobs = Math.trunc($activeSlave.boobs/50)*50>>
<</widget>>

/%
 Call as <<StartingGirlsRefresh>>
%/
<<widget "StartingGirlsRefresh">>

	<<replace "#devotion">>
		@@color:yellow;Ambivalent.@@
	<</replace>>

	<<replace "#trust">>
		@@color:yellow;Fearful.@@
	<</replace>>

	<<replace "#legal">>
		Slave.
	<</replace>>

	<<replace "#voice">>
		<<if $activeSlave.voice == 0>>Mute.
		<<elseif $activeSlave.voice == 1>>Deep.
		<<elseif $activeSlave.voice is 2>>Normal.
		<<elseif $activeSlave.voice is 3>>High.
		<</if>>
	<</replace>>

	<<replace "#language">>
		<<if $activeSlave.accent == 0>>Unaccented.
		<<elseif $activeSlave.accent == 1>>Pretty $activeSlave.nationality accent.
		<<elseif $activeSlave.accent is 2>>Thick $activeSlave.nationality accent.
		<<else>>Not fluent.
		<</if>>
	<</replace>>

	<<replace "#age">>
		<<textbox "$activeSlave.actualAge" $activeSlave.actualAge "Starting Girls">>
	<</replace>>

	<<replace "#health">>
		@@color:yellow;Healthy.@@
	<</replace>>

	<<replace "#muscles">>
		Normal.
	<</replace>>

	<<replace "#waist">>
		Normal.
	<</replace>>

	<<if $seeExtreme == 1>>
		<<replace "#amp">>
			<<if $activeSlave.amp == 1>>Amputee.
			<<else>>Normal.
			<</if>>
		<</replace>>
	<</if>>

	<<replace "#height">>
		<<if $activeSlave.height < 150>>Petite.
		<<elseif $activeSlave.height < 160>>Short.
		<<elseif $activeSlave.height < 170>>Average.
		<<elseif $activeSlave.height < 185>>Tall.
		<<else>>Very tall.
		<</if>>
		<<textbox "$activeSlave.height" $activeSlave.height "Starting Girls">> cm
	<</replace>>

	<<replace "#weight">>
		<<if $activeSlave.weight < -95>>@@color:red;Emaciated.@@
		<<elseif $activeSlave.weight < -30>>@@color:red;Skinny.@@
		<<elseif $activeSlave.weight < -10>>Thin.
		<<elseif $activeSlave.weight <= 10>>Average.
		<<elseif $activeSlave.weight <= 30>>Plush.
		<<elseif $activeSlave.weight <= 95>>@@color:red;Chubby.@@
		<<else>>@@color:red;Fat.@@
		<</if>>
	<</replace>>

	<<if $seeRace == 1>>
		<<replace "#ethnicity">>
		<<textbox "$activeSlave.race" $activeSlave.race "Starting Girls">>
		<</replace>>
	<</if>>

	<<replace "#skin">>
		<<textbox "$activeSlave.skin" $activeSlave.skin "Starting Girls">>
	<</replace>>

	<<replace "#faceShape">>
		$activeSlave.faceShape
	<</replace>>

	<<replace "#face">>
		<<if $activeSlave.face < -2>>Very ugly.
		<<elseif $activeSlave.face is -2>>Ugly.
		<<elseif $activeSlave.face is -1>>Unattractive.
		<<elseif $activeSlave.face == 0>>Average.
		<<elseif $activeSlave.face == 1>>Attractive.
		<<elseif $activeSlave.face is 2>>Beautiful.
		<<else>>Very beautiful.
		<</if>>
	<</replace>>

	<<replace "#lips">>
		<<if $activeSlave.lips <= 10>>Thin.
		<<elseif $activeSlave.lips <= 20>>Normal.
		<<elseif $activeSlave.lips <= 40>>Plush.
		<<elseif $activeSlave.lips <= 70>>Big.
		<<elseif $activeSlave.lips <= 95>>Huge.
		<<else>>Facepussy.
		<</if>>
	<</replace>>

	<<replace "#teeth">>
		<<if $activeSlave.teeth is "crooked">>Crooked.
		<<elseif $activeSlave.teeth is "straightening braces">>Braces.
		<<else>>Straight.
		<</if>>
	<</replace>>

	<<replace "#vision">>
		<<if $seeExtreme == 1>>
			<<if $activeSlave.eyes is -2>>Blind.
			<<elseif $activeSlave.eyes is -1>>Nearsighted.
			<<else>>Normal.
			<</if>>
		<<else>>
			<<if $activeSlave.eyes is -1>>Nearsighted.
			<<else>>Normal.
			<</if>>
		<</if>>
	<</replace>>

	<<replace "#boobs">>
		<<if $activeSlave.boobs <= 200>>Flat.
		<<elseif $activeSlave.boobs <= 500>>Healthy.
		<<elseif $activeSlave.boobs <= 800>>Large.
		<<elseif $activeSlave.boobs <= 1200>>Very Large.
		<<elseif $activeSlave.boobs <= 2000>>Huge.
		<<elseif $activeSlave.boobs <= 4000>>Massive.
		<<elseif $activeSlave.boobs <= 6000>>Monstrous.
		<<else>>Science experiment.
		<</if>>
		<<textbox "$activeSlave.boobs" $activeSlave.boobs "Starting Girls">> CCs
	<</replace>>

	<<replace "#lactation">>
		<<if $activeSlave.lactation == 2>>Artificial.
		<<elseif $activeSlave.lactation == 1>>Natural.
		<<else>>None.
		<</if>>
	<</replace>>

	<<replace "#nipples">>
		$activeSlave.nipples
	<</replace>>

	<<replace "#areolae">>
		<<if $activeSlave.areolae == 1>>
		Large.
		<<elseif $activeSlave.areolae == 2>>
			Wide.
		<<elseif $activeSlave.areolae == 3>>
			Huge.
		<<else>>
			Normal.
		<</if>>
	<</replace>>

	<<replace "#shoulders">>
		<<if $activeSlave.shoulders < -1>>Very narrow.
		<<elseif $activeSlave.shoulders < 0>>Narrow.
		<<elseif $activeSlave.shoulders > 1>>Very broad.
		<<elseif $activeSlave.shoulders > 0>>Broad.
		<<else>>Feminine.
		<</if>>
	<</replace>>

	<<replace "#hips">>
		<<if $activeSlave.hips < -1>>Very narrow.
		<<elseif $activeSlave.hips < 0>>Narrow.
		<<elseif $activeSlave.hips > 1>>Very broad.
		<<elseif $activeSlave.hips > 0>>Broad.
		<<else>>Normal.
		<</if>>
	<</replace>>

	<<replace "#butt">>
		<<if $activeSlave.butt == 0>>Flat.
		<<elseif $activeSlave.butt < 2>>Small.
		<<elseif $activeSlave.butt < 3>>Plump.
		<<elseif $activeSlave.butt < 4>>Big.
		<<elseif $activeSlave.butt < 5>>Huge.
		<<elseif $activeSlave.butt < 6>>Enormous.
		<<elseif $activeSlave.butt < 7>>Gigantic.
		<<else>>Massive.
		<</if>>
	<</replace>>

	<<replace "#anus">>
		<<if $activeSlave.anus == 0>>@@color:lime;Virgin.@@
		<<elseif $activeSlave.anus == 1>>Normal.
		<<elseif $activeSlave.anus is 2>>Veteran.
		<<else>>Gaping.
		<</if>>
	<</replace>>

	<<replace "#vagina">>
		<<if $activeSlave.vagina is -1>>//No vagina.//
		<<elseif $activeSlave.vagina == 0>>@@color:lime;Virgin.@@
		<<elseif $activeSlave.vagina == 1>>Normal.
		<<elseif $activeSlave.vagina is 2>>Veteran.
		<<else>>Gaping.
		<</if>>
	<</replace>>

	<<replace "#vaginablock">>
		<<if $activeSlave.vagina > -1>>

		''Clit:''

			<<if $activeSlave.clit == 0>>Normal.
			<<elseif $activeSlave.clit == 1>>Large.
			<<else>>Huge.
			<</if>>

		<<click "Normal">>
			<<set $activeSlave.clit to 0>>
			<<replace #clit>>
				Normal.
			<</replace>>
		<</click>>
		|
		<<click "Large">>
			<<set $activeSlave.clit to 1>>
			<<replace #clit>>
				Large.
			<</replace>>
		<</click>>
		|
		<<click "Huge">>
			<<set $activeSlave.clit to 2>>
			<<replace #clit>>
				Huge.
			<</replace>>
		<</click>>
		<</if>>

		''Labia:''

			<<if $activeSlave.labia is 2>>Huge.
			<<elseif $activeSlave.labia == 1>>Large.
			<<else>>Normal.
			<</if>>

		<<click "Normal">>
			<<set $activeSlave.labia to 0>>
			<<replace #labia>>
				Normal.
			<</replace>>
		<</click>>
		|
		<<click "Large">>
			<<set $activeSlave.labia to 1>>
			<<replace #labia>>
				Large.
			<</replace>>
		<</click>>
		|
		<<click "Huge">>
			<<set $activeSlave.labia to 2>>
			<<replace #labia>>
				Huge.
			<</replace>>
		<</click>>

		''Vaginal wetness:''

		<<if $activeSlave.vaginaLube == 0>>Dry.
		<<elseif $activeSlave.vaginaLube == 1>>Normal.
		<<else>>Excessive.
		<</if>>

		<<click "Dry">><<set $activeSlave.vaginaLube = 0>><<replace "#wetness">>Dry.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Normal">><<set $activeSlave.vaginaLube = 1>><<replace "#wetness">>Normal.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Excessive">><<set $activeSlave.vaginaLube = 2>><<replace "#wetness">>Excessive.<</replace>><<StartingGirlsCost>><</click>>

		''Pregnancy:''

		<<if $activeSlave.preg > 20>>Ready to drop.
		<<elseif $activeSlave.preg > 20>>Advanced.
		<<elseif $activeSlave.preg > 5>>Early.
		<<elseif $activeSlave.preg > -2>>None.
		<<else>>Barren.
		<</if>>

		<<click "Ready to Drop">><<set $activeSlave.preg = 35,$activeSlave.pregType = 1,$activeSlave.pubertyXX = 1>><<replace "#preg">>Ready to drop.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Advanced">><<set $activeSlave.preg = 25,$activeSlave.pregType = 1,$activeSlave.pubertyXX = 1>><<replace "#preg">>Advanced.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Early">><<set $activeSlave.preg = 10,$activeSlave.pregType = 1,$activeSlave.pubertyXX = 1>><<replace "#preg">>Early.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "None">><<set $activeSlave.preg = 0,$activeSlave.pregType = 0,$activeSlave.pregSource = 0>><<replace "#preg">>None.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Barren">><<set $activeSlave.preg = -2,$activeSlave.pregType = 0,$activeSlave.pregSource = 0>><<replace "#preg">>Barren.<</replace>><<StartingGirlsCost>><</click>>

''Puberty:''

		<<if $activeSlave.pubertyXX == 1>>Postpubescent.
		<<else>>Prepubescent.
		<</if>>

		<<textbox "$activeSlave.pubertyAgeXX" $activeSlave.pubertyAgeXX "Starting Girls">>
		<<click "Postpubescent">><<set $activeSlave.pubertyXX = 1>><<replace "#pub">>Postpubescent.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Prepubescent">><<set $activeSlave.pubertyXX = 0,$activeSlave.pubertyAgeXX = $fertilityAge,$activeSlave.preg = 0,$activeSlave.pregType = 0,$activeSlave.pregSource = 0>><<replace "#pub">>Prepubescent.<</replace>><<StartingGirlsCost>><</click>>
		<<if $PC.dick == 1>>

 ''Father:''

		<<if $activeSlave.pregSource == -1>>My child.
		<<else>>
		<</if>>

		<<click "My child">><<set $activeSlave.pregSource = -1>><<replace "#father">>My child.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Clear">><<set $activeSlave.pregSource = 0>><<replace "#father">><</replace>><<StartingGirlsCost>><</click>>
		<</if>>
	<</replace>>

	<<replace "#dickblock">>
		<<if $seeDicks != 0>>

		''Penis:''

		<<if $activeSlave.dick == 0>>None.
		<<elseif $activeSlave.dick == 1>>Tiny.
		<<elseif $activeSlave.dick is 2>>Small.
		<<elseif $activeSlave.dick is 3>>Normal.
		<<elseif $activeSlave.dick is 4>>Large.
		<<else>>Massive.
		<</if>>

		<<click "No penis">><<set $activeSlave.dick = 0,$activeSlave.balls = 0,$activeSlave.clit = 0,$activeSlave.pubertyXY = 0,$activeSlave.pubertyAgeXY = $potencyAge>><<replace "#dick">>None.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Tiny">><<set $activeSlave.dick = 1,$activeSlave.clit = 0>><<replace "#dick">>Tiny.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Small">><<set $activeSlave.dick = 2,$activeSlave.clit = 0>><<replace "#dick">>Small.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Normal">><<set $activeSlave.dick = 3,$activeSlave.clit = 0>><<replace "#dick">>Normal.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Large">><<set $activeSlave.dick = 4,$activeSlave.clit = 0>><<replace "#dick">>Large.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Massive">><<set $activeSlave.dick = 5,$activeSlave.clit = 0>><<replace "#dick">>Massive.<</replace>><<StartingGirlsCost>><</click>>
		<<if $activeSlave.dick > 0>>

		''Foreskin:''

		<<if $activeSlave.foreskin == 0>>None.
		<<elseif $activeSlave.foreskin == 1>>Tiny.
		<<elseif $activeSlave.foreskin is 2>>Small.
		<<elseif $activeSlave.foreskin is 3>>Normal.
		<<elseif $activeSlave.foreskin is 4>>Large.
		<<else>>Massive.<</if>>

		<<if $seeCircumcision == 1>><<click "Circumcised">><<set $activeSlave.foreskin = 0>><<replace "#foreskin">>None.<</replace>><<StartingGirlsCost>><</click>> |<</if>>
		<<click "Tiny">><<set $activeSlave.foreskin = 1>><<replace "#foreskin">>Tiny.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Small">><<set $activeSlave.foreskin = 2>><<replace "#foreskin">>Small.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Normal">><<set $activeSlave.foreskin = 3>><<replace "#foreskin">>Normal.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Large">><<set $activeSlave.foreskin = 4>><<replace "#foreskin">>Large.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Massive">><<set $activeSlave.foreskin = 5>><<replace "#foreskin">>Massive.<</replace>><<StartingGirlsCost>><</click>>

		''Testicles:''

		<<if $activeSlave.balls == 0>>None.
		<<elseif $activeSlave.balls == 1>>Vestigial.
		<<elseif $activeSlave.balls is 2>>Small.
		<<elseif $activeSlave.balls is 3>>Normal.
		<<elseif $activeSlave.balls is 4>>Large.
		<<else>>Massive.<</if>>

		<<click "No testicles">><<set $activeSlave.balls = 0,$activeSlave.pubertyXY = 0,$activeSlave.pubertyAgeXY = $potencyAge>><<replace "#balls">>None.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Vestigial">><<set $activeSlave.balls = 1>><<replace "#balls">>Vestigial.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Small">><<set $activeSlave.balls = 2>><<replace "#balls">>Small.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Normal">><<set $activeSlave.balls = 3>><<replace "#balls">>Normal.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Large">><<set $activeSlave.balls = 4>><<replace "#balls">>Large.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Massive">><<set $activeSlave.balls = 5>><<replace "#balls">>Massive.<</replace>><<StartingGirlsCost>><</click>>

		''Puberty:''<<textbox "$activeSlave.pubertyAgeXY" $activeSlave.pubertyAgeXY "Starting Girls">>
		<<if $activeSlave.balls > 0>>

		''Ballsack:''

		<<if $activeSlave.scrotum == 0>>None.
		<<elseif $activeSlave.scrotum == 1>>Tiny.
		<<elseif $activeSlave.scrotum is 2>>Small.
		<<elseif $activeSlave.scrotum is 3>>Normal.
		<<elseif $activeSlave.scrotum is 4>>Large.
		<<else>>Massive.<</if>>

		<<click "None">><<set $activeSlave.scrotum = 0>><<replace "#scrotum">>None.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Tiny">><<set $activeSlave.scrotum = 1>><<replace "#scrotum">>Tiny.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Small">><<set $activeSlave.scrotum = 2>><<replace "#scrotum">>Small.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Normal">><<set $activeSlave.scrotum = 3>><<replace "#scrotum">>Normal.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Large">><<set $activeSlave.scrotum = 4>><<replace "#scrotum">>Large.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Massive">><<set $activeSlave.scrotum = 5>><<replace "#scrotum">>Massive.<</replace>><<StartingGirlsCost>><</click>>

''Puberty:''

		<<if $activeSlave.pubertyXY == 1>>Postpubescent.
		<<else>>Prepubescent.
		<</if>>

		<<click "Postpubescent">><<set $activeSlave.pubertyXY = 1>><<replace "#Mpub">>Postpubescent.<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Prepubescent">><<set $activeSlave.pubertyXY = 0,$activeSlave.pubertyAgeXY = $potencyAge>><<replace "#Mpub">>Prepubescent.<</replace>><<StartingGirlsCost>><</click>>
		<</if>>
		<</if>>
		<</if>>
	<</replace>>

	<<replace "#analSkillsBlock">>
		<<if $activeSlave.anus == 0>>
			//Anal virgins cannot be given anal skills//
		<<else>>
			''Anal sex:''

			<<if $activeSlave.analSkill <= 10>>Unskilled.
			<<elseif $activeSlave.analSkill <= 30>>@@color:cyan;Basic.@@
			<<elseif $activeSlave.analSkill <= 60>>@@color:cyan;Skilled.@@
			<<else>>@@color:cyan;Expert.@@
			<</if>>

			<<if $activeSlave.anus < 3>><<click "Unskilled">><<set $activeSlave.analSkill = 0>><<replace "#analSkill">>Unskilled.<</replace>><<StartingGirlsCost>><</click>> |<</if>>
			<<click "Basic">><<set $activeSlave.analSkill = 15>><<replace "#analSkill">>@@color:cyan;Basic.@@<</replace>><<StartingGirlsCost>><</click>> |
			<<click "Skilled">><<set $activeSlave.analSkill = 35>><<replace "#analSkill">>@@color:cyan;Skilled.@@<</replace>><<StartingGirlsCost>><</click>> |
			<<click "Expert">><<set $activeSlave.analSkill = 65>><<replace "#analSkill">>@@color:cyan;Expert.@@<</replace>><<StartingGirlsCost>><</click>>
		<</if>>
	<</replace>>

	<<replace "#oralSkill">>
		<<if $activeSlave.oralSkill <= 10>>Unskilled.
		<<elseif $activeSlave.oralSkill <= 30>>@@color:cyan;Basic.@@
		<<elseif $activeSlave.oralSkill <= 60>>@@color:cyan;Skilled.@@
		<<else>>@@color:cyan;Expert.@@
		<</if>>
	<</replace>>

	<<replace "#vaginalSkillsBlock">>
		<<if $activeSlave.vagina == 0>>
			//Virgins cannot be given vaginal skills//
		<<elseif $activeSlave.vagina is -1>>
			//Must have a vagina to have vaginal skills//
		<<else>>
			''Vaginal sex:''

			<<if $activeSlave.vaginalSkill <= 10>>Unskilled.
			<<elseif $activeSlave.vaginalSkill <= 30>>@@color:cyan;Basic.@@
			<<elseif $activeSlave.vaginalSkill <= 60>>@@color:cyan;Skilled.@@
			<<else>>@@color:cyan;Expert.@@
			<</if>>

			<<if $activeSlave.vagina < 3>><<click "Unskilled">><<set $activeSlave.vaginalSkill = 0>><<replace "#vaginalSkill">>Unskilled.<</replace>><<StartingGirlsCost>><</click>> |<</if>>
			<<click "Basic">><<set $activeSlave.vaginalSkill = 15>><<replace "#vaginalSkill">>@@color:cyan;Basic.@@<</replace>><<StartingGirlsCost>><</click>> |
			<<click "Skilled">><<set $activeSlave.vaginalSkill = 35>><<replace "#vaginalSkill">>@@color:cyan;Skilled.@@<</replace>><<StartingGirlsCost>><</click>> |
			<<click "Expert">><<set $activeSlave.vaginalSkill = 65>><<replace "#vaginalSkill">>@@color:cyan;Expert.@@<</replace>><<StartingGirlsCost>><</click>>
		<</if>>
	<</replace>>

	<<replace "#whoreSkill">>
		<<if $activeSlave.whoreSkill <= 10>>Unskilled.
		<<elseif $activeSlave.whoreSkill <= 30>>@@color:cyan;Basic.@@
		<<elseif $activeSlave.whoreSkill <= 60>>@@color:cyan;Skilled.@@
		<<else>>@@color:cyan;Expert.@@
		<</if>>
	<</replace>>

	<<replace "#entertainSkill">>
		<<if $activeSlave.entertainSkill <= 10>>Unskilled.
		<<elseif $activeSlave.entertainSkill <= 30>>@@color:cyan;Basic.@@
		<<elseif $activeSlave.entertainSkill <= 60>>@@color:cyan;Skilled.@@
		<<else>>@@color:cyan;Expert.@@
		<</if>>
	<</replace>>

	<<replace "#combatSkill">>
		<<if $activeSlave.combatSkill == 0>>Unskilled.
		<<else>>@@color:cyan;Skilled.@@
		<</if>>
	<</replace>>

	<<replace "#intelligence">>
		<<if $activeSlave.intelligence is 3>>@@color:deepskyblue;Brilliant.@@
		<<elseif $activeSlave.intelligence is 2>>@@color:deepskyblue;Very smart.@@
		<<elseif $activeSlave.intelligence == 1>>@@color:deepskyblue;Smart.@@
		<<elseif $activeSlave.intelligence == 0>>Average.
		<<elseif $activeSlave.intelligence is -1>>@@color:orangered;Stupid.@@
		<<elseif $activeSlave.intelligence is -2>>@@color:orangered;Very stupid.@@
		<<else>>@@color:orangered;Moronic.@@
		<</if>>
	<</replace>>

	<<replace "#intelligenceImplant">>
		<<if $activeSlave.intelligenceImplant == 1>>@@color:deepskyblue;Educated.@@
		<<else>>Uneducated.
		<</if>>
	<</replace>>

	<<if $activeSlave.fetishKnown == 1>>
		<<ToggleFetish 1>>
	<<else>>
		<<ToggleFetish 0>>
	<</if>>

	<<if $activeSlave.attrKnown == 1>>
		<<ToggleSexuality 1>>
	<<else>>
		<<ToggleSexuality 0>>
	<</if>>

	<<replace "#behavioralFlaw">>
		<<if $activeSlave.behavioralFlaw is "none">>
		//$activeSlave.behavioralFlaw.//
		<<else>>
			@@color:red;$activeSlave.behavioralFlaw.@@
		<</if>>
	<</replace>>

	<<replace "#sexualFlaw">>
		<<if $activeSlave.sexualFlaw is "none">>
			//$activeSlave.sexualFlaw.//
		<<else>>
			@@color:red;$activeSlave.sexualFlaw.@@
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<StartingGirlsAnalSkill>>
%/
<<widget "StartingGirlsAnalSkill">>
	<<replace "#analSkillsBlock">>
		<<if $activeSlave.anus == 0>>
		//Anal virgins cannot be given anal skills//
		<<else>>
		''Anal sex:''

		<<if $activeSlave.analSkill <= 10>>Unskilled.
		<<elseif $activeSlave.analSkill <= 30>>@@color:cyan;Basic.@@
		<<elseif $activeSlave.analSkill <= 60>>@@color:cyan;Skilled.@@
		<<else>>@@color:cyan;Expert.@@
		<</if>>

		<<if $activeSlave.anus < 3>><<click "Unskilled">><<set $activeSlave.analSkill = 0>><<replace "#analSkill">>Unskilled.<</replace>><<StartingGirlsCost>><</click>> |<</if>>
		<<click "Basic">><<set $activeSlave.analSkill = 15>><<replace "#analSkill">>@@color:cyan;Basic.@@<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Skilled">><<set $activeSlave.analSkill = 35>><<replace "#analSkill">>@@color:cyan;Skilled.@@<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Expert">><<set $activeSlave.analSkill = 65>><<replace "#analSkill">>@@color:cyan;Expert.@@<</replace>><<StartingGirlsCost>><</click>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<StartingGirlsVaginalSkill>>
%/
<<widget "StartingGirlsVaginalSkill">>
	<<replace "#vaginalSkillsBlock">>
		<<if $activeSlave.vagina == 0>>
		//Virgins cannot be given vaginal skills//
		<<elseif $activeSlave.vagina is -1>>
		//Must have a vagina to have vaginal skills//
		<<else>>
		''Vaginal sex:''

		<<if $activeSlave.vaginalSkill <= 10>>Unskilled.
		<<elseif $activeSlave.vaginalSkill <= 30>>@@color:cyan;Basic.@@
		<<elseif $activeSlave.vaginalSkill <= 60>>@@color:cyan;Skilled.@@
		<<else>>@@color:cyan;Expert.@@
		<</if>>

		<<if $activeSlave.anus < 3>><<click "Unskilled">><<set $activeSlave.vaginalSkill = 0>><<replace "#vaginalSkill">>Unskilled.<</replace>><<StartingGirlsCost>><</click>> |<</if>>
		<<click "Basic">><<set $activeSlave.vaginalSkill = 15>><<replace "#vaginalSkill">>@@color:cyan;Basic.@@<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Skilled">><<set $activeSlave.vaginalSkill = 35>><<replace "#vaginalSkill">>@@color:cyan;Skilled.@@<</replace>><<StartingGirlsCost>><</click>> |
		<<click "Expert">><<set $activeSlave.vaginalSkill = 65>><<replace "#vaginalSkill">>@@color:cyan;Expert.@@<</replace>><<StartingGirlsCost>><</click>>
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<SaleDescription>>
%/
<<widget "SaleDescription">>
	<<replace #slaveinfo>>
		<<set $saleDescription = 1>>
		<<display "Long Slave Description">>
		<<set $saleDescription = 0>>
	<</replace>>
<</widget>>

/%
 Call as <<StartingGirlsCost>>
%/
<<widget "StartingGirlsCost">>

<<replace "#cost">>
	<<slaveCost $activeSlave>>
	¤<<print $slaveCost>>.
<</replace>>
<<replace "#finalize">>
<<if $cash >= $slaveCost>>
	<<if $PC.career != "engineer">>

		<<click "Add this slave">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 1, $careerBonusApplied = 0>>
			<<set $activeSlave.actualAge to Number($activeSlave.actualAge)>>
			<<set $activeSlave.devotion = Number($activeSlave.devotion)>>
			<<set $activeSlave.trust = Number($activeSlave.trust)>>
			<<if $activeSlave.indenture >= 0>>
				<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208)>>
			<</if>>
			<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274)>>
			<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs, 0, 10000)>>
			<<set $activeSlave.boobs = Number($activeSlave.boobs)>>
			<<set $activeSlave.boobs = Math.trunc($activeSlave.boobs/50)*50>>
			<<set $slaveWithoutBonuses = $activeSlave>>
			<<goto "RG AS Dump">>
		<</click>>
		//This will apply your @@color:springgreen;career bonus@@ to her:
		<<if $PC.career is "capitalist">>
			one free level of @@color:cyan;prostitution skill.@@
		<<elseif $PC.career is "mercenary">>
			@@color:mediumaquamarine;+2 trust.@@
		<<elseif $PC.career is "slaver">>
			@@color:hotpink;+2 devotion.@@
		<<elseif $PC.career is "medicine">>
			free @@color:lime;basic implants.@@
		<<elseif $PC.career is "celebrity">>
			one free level of @@color:cyan;entertainment skill.@@
		<<elseif $PC.career is "gang">>
			@@color:green;+5 health@@ and a free level of @@color:cyan;combat skill@@
		<<elseif $PC.career is "escort">>
			two free levels of @@color:cyan;sex skills@@, one free level of @@color:cyan;prostitution skill@@, and one free level of @@color:cyan;entertainment skill.@@
		<<elseif $PC.career is "servant">>
			@@color:mediumaquamarine;+1 trust@@ and @@color:hotpink;+1 devotion.@@
		<<else>>
			two free levels of @@color:cyan;sex skills.@@
		<</if>>//

		<<click "Add slave without career bonus">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 0, $careerBonusApplied = 0>>
			<<set $activeSlave.actualAge to Number($activeSlave.actualAge)>>
			<<set $activeSlave.devotion = Number($activeSlave.devotion)>>
			<<set $activeSlave.trust = Number($activeSlave.trust)>>
			<<if $activeSlave.indenture >= 0>>
				<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208)>>
			<</if>>
			<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274)>>
			<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs, 0, 10000)>>
			<<set $activeSlave.boobs = Number($activeSlave.boobs)>>
			<<set $activeSlave.boobs = Math.trunc($activeSlave.boobs/50)*50>>
			<<set $slaveWithoutBonuses = $activeSlave>>
			<<goto "RG AS Dump">>
		<</click>>
	<<else>>

		<<click "Add slave">>
			<<set $returnTo = "Commit Starting Girl", $createRelatedSlave = 0, $applyCareerBonus = 0, $careerBonusApplied = 0>>
			<<set $activeSlave.actualAge to Number($activeSlave.actualAge)>>
			<<set $activeSlave.devotion = Number($activeSlave.devotion)>>
			<<set $activeSlave.trust = Number($activeSlave.trust)>>
			<<if $activeSlave.indenture >= 0>>
				<<set $activeSlave.indenture = Math.clamp($activeSlave.indenture, 26, 208)>>
			<</if>>
			<<set $activeSlave.height = Math.clamp($activeSlave.height, 85, 274)>>
			<<set $activeSlave.boobs = Math.clamp($activeSlave.boobs, 0, 10000)>>
			<<set $activeSlave.boobs = Number($activeSlave.boobs)>>
			<<set $activeSlave.boobs = Math.trunc($activeSlave.boobs/50)*50>>
			<<set $slaveWithoutBonuses = $activeSlave>>
			<<goto "RG AS Dump">>
		<</click>>

	<</if>>
<<else>>
	//You lack the necessary funds to add this slave.//
<</if>>

    [[Discard this slave and continue to the arcology|Acquisition]]
<</replace>>
<</widget>>

/%
 Call as <<ToggleFetish 1>>
 $arg[0] is whether unknown or known.
%/
<<widget "ToggleFetish">>

<<if ($args[0] == 0)>>
	<<set $activeSlave.fetish = either("none", "none", "none", "none", "none", "none", "none", "none", "none", "none", "submissive", "cumslut", "humiliation", "buttslut", "boobs", "pregnancy", "dom", "sadist", "masochist"), $activeSlave.fetishKnown = 0>>
	<<replace "#fetishblock">>
		//Not known.//
		<<click "Known">>
			<<ToggleFetish 1>>
		<</click>>
	<</replace>>
<<else>>
	<<set $activeSlave.fetishKnown = 1>>
		<<replace "#fetishblock">>

		<<if $activeSlave.fetishKnown == 1>>
			<<if $activeSlave.fetish is "none">>
				@@color:pink;$activeSlave.fetish.@@
			<<else>>
				@@color:lightcoral;$activeSlave.fetish.@@
			<</if>>
		<<else>>
			//Not known.//
			<<click "Known">>
				<<ToggleFetish 1>>
			<</click>>
		<</if>>

		<<if $activeSlave.fetishKnown == 1>>
			<<click "Unknown">>
				<<ToggleFetish 0>>
			<<StartingGirlsCost>>
		<</click>> |
		<<click "None">>
			<<set $activeSlave.fetish = "none", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Sub">>
			<<set $activeSlave.fetish = "submissive", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Dom">>
			<<set $activeSlave.fetish = "dom", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Cumslut">>
			<<set $activeSlave.fetish = "cumslut", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Humiliation">>
			<<set $activeSlave.fetish = "humiliation", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Buttslut">>
			<<set $activeSlave.fetish = "buttslut", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Breasts">>
			<<set $activeSlave.fetish = "boobs", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Pregnancy">>
			<<set $activeSlave.fetish = "pregnancy", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Sadism">>
			<<set $activeSlave.fetish = "sadist", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>> |
		<<click "Masochism">>
			<<set $activeSlave.fetish = "masochist", $activeSlave.fetishKnown = 1>>
			<<ToggleFetish 1>>
		<</click>>

		<<if $activeSlave.fetish != "none">>

			''Fetish strength:''
			<<if $activeSlave.fetishStrength > 95>>
				@@color:lightcoral;High.@@
			<<elseif $activeSlave.fetishStrength <= 60>>
				@@color:pink;Low.@@
			<<else>>
				@@color:hotpink;Normal.@@
			<</if>>
			<<if $activeSlave.fetishStrength > 60>>
				<<click "Decrease">>
					<<ChangeFetishStrength 0>>
				<</click>>
			<</if>>
			<<if ($activeSlave.fetishStrength > 60)>>|<</if>>
			<<if $activeSlave.fetishStrength <= 95>>
				<<click "Increase">>
					<<ChangeFetishStrength 1>>
				<</click>>
			<</if>>

	<</if>>

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

<</widget>>

/%
 Call as <<ChangeFetishStrength 1>>
 $arg[0] is whether increase or decreas
%/
<<widget "ChangeFetishStrength">>

<<if ($args[0] == 0)>>
	<<set $activeSlave.fetishStrength -= 5, $activeSlave.fetishKnown = 1>>
	<<replace "#fetishStrength">>
		''Fetish strength:''
		<<if $activeSlave.fetishStrength > 95>>
			@@color:lightcoral;High.@@
		<<elseif $activeSlave.fetishStrength <= 60>>
			@@color:pink;Low.@@
		<<else>>
			@@color:hotpink;Normal.@@
		<</if>>

		<<if $activeSlave.fetishStrength > 60>>
			<<click "Decrease">>
				<<ChangeFetishStrength 0>>
			<</click>>
		<</if>>
		<<if ($activeSlave.fetishStrength > 60)>>|<</if>>
		<<if $activeSlave.fetishStrength <= 95>>
			<<click "Increase">>
				<<ChangeFetishStrength 1>>
			<</click>>
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>

<<else>>
	<<set $activeSlave.fetishStrength += 5, $activeSlave.fetishKnown = 1>>
	<<replace "#fetishStrength">>
		''Fetish strength:''
		<<if $activeSlave.fetishStrength > 95>>
			@@color:lightcoral;High.@@
		<<elseif $activeSlave.fetishStrength <= 60>>
			@@color:pink;Low.@@
		<<else>>
			@@color:hotpink;Normal.@@
		<</if>>

		<<if $activeSlave.fetishStrength > 60>>
			<<click "Decrease">>
				<<ChangeFetishStrength 0>>
			<</click>>
		<</if>>
		<<if ($activeSlave.fetishStrength > 60)>>|<</if>>
		<<if $activeSlave.fetishStrength <= 95>>
			<<click "Increase">>
				<<ChangeFetishStrength 1>>
			<</click>>
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>

<</if>>

<</widget>>

/%
 Call as <<ToggleSexuality 1>>
 $arg[0] is whether unknown or known.
%/
<<widget "ToggleSexuality">>

<<if ($args[0] == 0)>>

	<<set $activeSlave.attrXX = random(0,100), $activeSlave.attrXY = random(0,100), $activeSlave.energy = random(1,90), $activeSlave.attrKnown = 0>>
	<<StartingGirlsCost>>
	<<replace "#sexuality">>
		//Not known.//

	<<click "Known">>
		<<ToggleSexuality 1>>
	<</click>>
	<</replace>>
<<else>>
	<<set $activeSlave.attrKnown = 1>>
	<<replace "#sexuality">>

	<<if $activeSlave.attrKnown == 1>>
		<<if $activeSlave.attrXY <= 5>>
			@@color:red;Disgusted by men,@@
		<<elseif $activeSlave.attrXY <= 15>>
			@@color:red;Turned off by men,@@
		<<elseif $activeSlave.attrXY <= 35>>
			@@color:red;Not attracted to men,@@
		<<elseif $activeSlave.attrXY <= 65>>
			Indifferent to men,
		<<elseif $activeSlave.attrXY <= 85>>
			@@color:green;Attracted to men,@@
		<<elseif $activeSlave.attrXY <= 95>>
			@@color:green;Aroused by men,@@
		<<else>>
			@@color:green;Passionate about men,@@
		<</if>>
	<<else>>
		//Not known.//
	<</if>>

	<<if $activeSlave.attrKnown == 1>>
		<<if $activeSlave.attrXX <= 5>>
			@@color:red;disgusted by women.@@
		<<elseif $activeSlave.attrXX <= 15>>
			@@color:red;turned off by women.@@
		<<elseif $activeSlave.attrXX <= 35>>
			@@color:red;not attracted to women.@@
		<<elseif $activeSlave.attrXX <= 65>>
			indifferent to women.
		<<elseif $activeSlave.attrXX <= 85>>
			@@color:green;attracted to women.@@
		<<elseif $activeSlave.attrXX <= 95>>
			@@color:green;aroused by women.@@
		<<else>>
			@@color:green;passionate about women.@@
		<</if>>
	<</if>>

	<<if $activeSlave.attrKnown == 1>>
	<<click "Unknown">>
		<<ToggleSexuality 0>>
	<</click>>

	XY attraction:

		<<click "Decrease">>
		<<ChangeAttr 1 0>>
		<</click>>

	|
		<<click "Increase">>
		<<ChangeAttr 1 1>>
		<</click>>

	XX attraction:

		<<click "Decrease">>
		<<ChangeAttr 0 0>>
		<</click>>

	|
		<<click "Increase">>
		<<ChangeAttr 0 1>>
		<</click>>

	''Sex drive:''

		<<if $activeSlave.energy == 100>>@@color:green;Nympho!@@
		<<elseif $activeSlave.energy > 80>>@@color:green;Sex addict.@@
		<<elseif $activeSlave.energy > 60>>@@color:green;Powerful.@@
		<<elseif $activeSlave.energy > 40>>@@color:yellow;Average.@@
		<<elseif $activeSlave.energy > 20>>@@color:red;Poor.@@
		<<else>>@@color:red;Frigid.@@<</if>>

	<<click "Nympho">>
		<<set $activeSlave.energy = 100, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:green;Nympho!@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	| <<click "Sex addict">>
		<<set $activeSlave.energy = 85, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:green;Sex addict.@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	| <<click "Powerful">>
		<<set $activeSlave.energy = 65, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:green;Powerful.@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	| <<click "Average">>
		<<set $activeSlave.energy = 45, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:yellow;Average.@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	| <<click "Poor">>
		<<set $activeSlave.energy = 25, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:red;Poor.@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	| <<click "Frigid">>
		<<set $activeSlave.energy = 5, $activeSlave.attrKnown = 1>>
		<<replace "#energy">>
			@@color:red;Frigid.@@
		<</replace>>
		<<StartingGirlsCost>>
	<</click>>
	<<else>>
		<<click "Known">>
			<<ToggleSexuality 1>>
		</click>>
	<</if>>
	<</replace>>
	<<StartingGirlsCost>>
<</if>>
<</widget>>

/%
 Call as <<ChangeAttr 1 1>>
 $arg[0] is whether XX or XY.
 $arg[1] is whether increase or decrease.
%/
<<widget "ChangeAttr">>

<<if ($args[0] == 0) && ($args[1] == 0)>>
	<<if $activeSlave.attrXX-10 >= 0>>
		<<set $activeSlave.attrXX -= 10>>
	<<else>>
		<<set $activeSlave.attrXX = 0>>
	<</if>>
	<<set $activeSlave.attrXX == Math.clamp($activeSlave.attrXX, 0, 100)>>
	<<set $activeSlave.attrKnown = 1>>
	<<replace "#attrXX">>
		<<if $activeSlave.attrXX <= 5>>
			@@color:red;disgusted by women.@@
		<<elseif $activeSlave.attrXX <= 15>>
			@@color:red;turned off by women.@@
		<<elseif $activeSlave.attrXX <= 35>>
			@@color:red;not attracted to women.@@
		<<elseif $activeSlave.attrXX <= 65>>
			indifferent to women.
		<<elseif $activeSlave.attrXX <= 85>>
			@@color:green;attracted to women.@@
		<<elseif $activeSlave.attrXX <= 95>>
			@@color:green;aroused by women.@@
		<<else>>
			@@color:green;passionate about women.@@
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>
	<<if $activeSlave.attrXX == 100>>
		<<replace "#increaseXX">>
		<</replace>>
		<<replace "#decreaseXX">>
			<<click "Decrease">>
			<<ChangeAttr 0 0>>
			<</click>>
		<</replace>>
	<<elseif $activeSlave.attrXX == 0>>
		<<replace "#decreaseXX">>

		<</replace>>
		<<replace "#increaseXX">>
			<<click "Increase">>
			<<ChangeAttr 0 1>>
			<</click>>
		<</replace>>
	<<else>>
		<<replace "#decreaseXX">>
			<<click "Decrease">>
			<<ChangeAttr 0 0>>
			<</click>>
		<</replace>>
		<<replace "#increaseXX">>
		|
			<<click "Increase">>
			<<ChangeAttr 0 1>>
			<</click>>
		<</replace>>
	<</if>>
<<elseif ($args[0] == 0) && ($args[1] == 1)>>
	<<if $activeSlave.attrXX+10 <= 100>>
		<<set $activeSlave.attrXX += 10>>
	<<else>>
		<<set $activeSlave.attrXX = 100>>
	<</if>>
	<<set $activeSlave.attrXX == Math.clamp(0, 100)>>
	<<set $activeSlave.attrKnown = 1>>
	<<replace "#attrXX">>
		<<if $activeSlave.attrXX <= 5>>
			@@color:red;disgusted by women.@@
		<<elseif $activeSlave.attrXX <= 15>>
			@@color:red;turned off by women.@@
		<<elseif $activeSlave.attrXX <= 35>>
			@@color:red;not attracted to women.@@
		<<elseif $activeSlave.attrXX <= 65>>
			indifferent to women.
		<<elseif $activeSlave.attrXX <= 85>>
			@@color:green;attracted to women.@@
		<<elseif $activeSlave.attrXX <= 95>>
			@@color:green;aroused by women.@@
		<<else>>
			@@color:green;passionate about women.@@
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>
<<if $activeSlave.attrXX == 100>>
	<<replace "#increaseXX">>
	<</replace>>
	<<replace "#decreaseXX">>
		<<click "Decrease">>
		<<ChangeAttr 0 0>>
		<</click>>
	<</replace>>
<<elseif $activeSlave.attrXX == 0>>
	<<replace "#decreaseXX">>

	<</replace>>
	<<replace "#increaseXX">>
		<<click "Increase">>
		<<ChangeAttr 0 1>>
		<</click>>
	<</replace>>
<<else>>
	<<replace "#decreaseXX">>
		<<click "Decrease">>
		<<ChangeAttr 0 0>>
		<</click>>
	<</replace>>
	<<replace "#increaseXX">>
	|
		<<click "Increase">>
		<<ChangeAttr 0 1>>
		<</click>>
	<</replace>>
<</if>>
<<elseif ($args[0] == 1) && ($args[1] == 0)>>
	<<if $activeSlave.attrXY-10 >= 0>>
		<<set $activeSlave.attrXY -= 10>>
	<<else>>
		<<set $activeSlave.attrXY = 0>>
	<</if>>

	<<set $activeSlave.attrXY == Math.clamp(0, 100)>>
	<<set $activeSlave.attrKnown = 1>>
	<<replace "#attrXY">>
		<<if $activeSlave.attrXY <= 5>>
			@@color:red;Disgusted by men,@@
		<<elseif $activeSlave.attrXY <= 15>>
			@@color:red;Turned off by men,@@
		<<elseif $activeSlave.attrXY <= 35>>
			@@color:red;Not attracted to men,@@
		<<elseif $activeSlave.attrXY <= 65>>
			Indifferent to men,
		<<elseif $activeSlave.attrXY <= 85>>
			@@color:green;Attracted to men,@@
		<<elseif $activeSlave.attrXY <= 95>>
			@@color:green;Aroused by men,@@
		<<else>>
			@@color:green;Passionate about men,@@
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>
	<<if $activeSlave.attrXY == 100>>
		<<replace "#increaseXY">>

		<</replace>>
		<<replace "#decreaseXY">>
			<<click "Decrease">>
				<<ChangeAttr 1 0>>
			<</click>>
		<</replace>>
	<<elseif $activeSlave.attrXY == 0>>
		<<replace "#decreaseXY">>

		<</replace>>
		<<replace "#increaseXY">>
			<<click "Increase">>
				<<ChangeAttr 1 1>>
			<</click>>
		<</replace>>
	<<else>>
		<<replace "#decreaseXY">>
			<<click "Decrease">>
				<<ChangeAttr 1 0>>
			<</click>>
		<</replace>>
		<<replace "#increaseXY">>
		|
			<<click "Increase">>
				<<ChangeAttr 1 1>>
			<</click>>
		<</replace>>
	<</if>>
<<elseif ($args[0] == 1) && ($args[1] == 1)>>
	<<if $activeSlave.attrXY+10 <= 100>>
		<<set $activeSlave.attrXY += 10>>
	<<else>>
		<<set $activeSlave.attrXY = 100>>
	<</if>>
	<<set $activeSlave.attrXY == Math.clamp(0, 100)>>
	<<set $activeSlave.attrKnown = 1>>
	<<replace "#attrXY">>
		<<if $activeSlave.attrXY <= 5>>
			@@color:red;Disgusted by men,@@
		<<elseif $activeSlave.attrXY <= 15>>
			@@color:red;Turned off by men,@@
		<<elseif $activeSlave.attrXY <= 35>>
			@@color:red;Not attracted to men,@@
		<<elseif $activeSlave.attrXY <= 65>>
			Indifferent to men,
		<<elseif $activeSlave.attrXY <= 85>>
			@@color:green;Attracted to men,@@
		<<elseif $activeSlave.attrXY <= 95>>
			@@color:green;Aroused by men,@@
		<<else>>
			@@color:green;Passionate about men,@@
		<</if>>
	<</replace>>
	<<StartingGirlsCost>>

	<<if $activeSlave.attrXY == 100>>
		<<replace "#increaseXY">>

		<</replace>>
		<<replace "#decreaseXY">>
			<<click "Decrease">>
			<<ChangeAttr 1 0>>
			<</click>>
		<</replace>>
	<<elseif $activeSlave.attrXY == 0>>
		<<replace "#decreaseXY">>

		<</replace>>
		<<replace "#increaseXY">>
			<<click "Increase">>
			<<ChangeAttr 1 1>>
			<</click>>
		<</replace>>
	<<else>>
		<<replace "#decreaseXY">>
			<<click "Decrease">>
			<<ChangeAttr 1 0>>
			<</click>>
		<</replace>>
		<<replace "#increaseXY">>
		|
			<<click "Increase">>
			<<ChangeAttr 1 1>>
			<</click>>
		<</replace>>
	<</if>>
<</if>>
<</widget>>

/%
 Call as <<RandomizeAttraction>>
%/
<<widget "RandomizeAttraction">>

<<set _attraction = Math.clamp($activeSlave.energy*2, 60, 180), _sexuality = random(0,100)>>
<<if $activeSlave.balls > 0>>
	<<if _sexuality > 90>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction, 0, 100)>>
		<<set _attraction -= $activeSlave.attrXY>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction, 0, 100)>>
	<<elseif _sexuality > 70>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction+random(-5,5), 0, 100)>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction+random(-5,5), 0, 100)>>
	<<else>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction, 0, 100)>>
		<<set _attraction -= $activeSlave.attrXX>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction, 0, 100)>>
	<</if>>
<<else>>
	<<if _sexuality > 90>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction, 0, 100)>>
		<<set _attraction -= $activeSlave.attrXX>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction, 0, 100)>>
	<<elseif _sexuality > 60>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction+random(-5,5), 0, 100)>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction+random(-5,5), 0, 100)>>
	<<else>>
		<<set $activeSlave.attrXY = Math.clamp(_attraction, 0, 100)>>
		<<set _attraction -= $activeSlave.attrXY>>
		<<set $activeSlave.attrXX = Math.clamp(_attraction, 0, 100)>>
	<</if>>
<</if>>
<<set $activeSlave.attrXX = Math.clamp($activeSlave.attrXX+random(-5,5), 0, 100), $activeSlave.attrXY = Math.clamp($activeSlave.attrXY+random(-5,5), 0, 100)>>

<</widget>>

/%
 Call as <<CustomSlaveAge>>
%/
<<widget "CustomSlaveAge">>
	<<replace #age>>
		<<if $customSlave.actualAge < 5>>3-4 years old.
		<<elseif $customSlave.actualAge < 7>>5-6 years old.
		<<elseif $customSlave.actualAge < 10>>7-9 years old.
		<<elseif $customSlave.actualAge < 13>>10-12 years old.
		<<elseif $customSlave.actualAge < 15>>13-14 years old.
		<<elseif $customSlave.actualAge < 18>>15-17 years old.
		<<elseif $customSlave.actualAge < 20>>18-19 years old.
		<<elseif $customSlave.actualAge < 30>>20-29 years old.
		<<elseif $customSlave.actualAge < 40>>30-39 years old.
		<<else>>40+ years old.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveHealth>>
%/
<<widget "CustomSlaveHealth">>
	<<replace #health>>
		<<if $customSlave.health == 0>>Healthy.
		<<else>>Extremely healthy.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveMuscles>>
%/
<<widget "CustomSlaveMuscles">>
	<<replace #muscles>>
		<<if $customSlave.muscles <= 5>>Normal musculature.
		<<elseif $customSlave.muscles <= 30>>Toned.
		<<else>>Ripped.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveLips>>
%/
<<widget "CustomSlaveLips">>
	<<replace #lips>>
		<<if $customSlave.lips <= 10>>Thin lips.
		<<elseif $customSlave.lips <= 20>>Normal lips.
		<<elseif $customSlave.lips <= 40>>Plush lips.
		<<elseif $customSlave.lips <= 70>>Big lips.
		<<elseif $customSlave.lips <= 95>>Huge lips.
		<<else>>Facepussy.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveHeight>>
%/
<<widget "CustomSlaveHeight">>
	<<replace #height>>
		<<if $customSlave.height < 130>>Tiny.
		<<elseif $customSlave.height < 150>>Petite.
		<<elseif $customSlave.height < 160>>Short.
		<<elseif $customSlave.height < 170>>Average height.
		<<elseif $customSlave.height < 185>>Tall.
		<<else>>Very tall.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveFace>>
%/
<<widget "CustomSlaveFace">>
	<<replace #face>>
		<<if $customSlave.face < -1>>Very unattractive face.
		<<elseif $customSlave.face is -1>>Unattractive face.
		<<elseif $customSlave.face == 0>>Average face.
		<<elseif $customSlave.face == 1>>Attractive face.
		<<elseif $customSlave.face > 1>>Very attractive face.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveRace>>
%/
<<widget "CustomSlaveRace">>
	<<replace #ethnicity>>
		<<textbox "$customSlave.race" $customSlave.race "Custom Slave">>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSkin>>
%/
<<widget "CustomSlaveSkin">>
	<<replace #skin>>
		<<textbox "$customSlave.skin" $customSlave.skin "Custom Slave">>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveBoobs>>
%/
<<widget "CustomSlaveBoobs">>
	<<replace #boobs>>
		<<if $customSlave.boobs is 200>>Flat chest.
		<<elseif $customSlave.boobs <= 500>>Healthy breasts.
		<<else>>Big breasts.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveButt>>
%/
<<widget "CustomSlaveButt">>
	<<replace #butt>>
		<<if $customSlave.butt == 1>>Flat buttocks.
		<<elseif $customSlave.butt < 4>>Healthy buttocks.
		<<else>>Huge buttocks.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveVagina>>
%/
<<widget "CustomSlaveVagina">>
	<<replace #vagina>>
		<<if $customSlave.vagina is -1>>No vagina.
		<<elseif $customSlave.vagina == 0>>Vaginal virgin.
		<<else>>Normal vagina.
		<</if>>
		<<if $customSlave.dick > 0>>
		<<click "No vagina">>
			<<set $customSlave.vagina to -1, $customSlave.preg to -2, $customSlave.ovaries to 0>>
			<<CustomSlaveVagina>>
		<</click>>
		<<else>>//No vagina//
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveDick>>
%/
<<widget "CustomSlaveDick">>
	<<replace #dick>>
		<<if $customSlave.dick == 0>>No penis.
		<<elseif $customSlave.dick is 2>>Small penis.
		<<else>>Large penis.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveClitBalls>>
%/
<<widget "CustomSlaveClitBalls">>
	<<replace #clitballs>>
	<<if $customSlave.dick > 0>>
	<<if $customSlave.balls == 0>>No testicles.<<elseif $customSlave.balls is 3>>Small testicles.<<else>>Large testicles.<</if>>
	<<click "No testicles">>
		<<set $customSlave.balls to 0,$customSlave.clit to 0>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Small testicles">>
		<<set $customSlave.balls to 2,$customSlave.clit to 0>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Large testicles">>
		<<set $customSlave.balls to 4,$customSlave.clit to 0>>
		<<CustomSlaveClitBalls>>
	<</click>>
	<<else>>
	<<if $customSlave.clit == 0>>Normal clitoris.<<elseif $customSlave.clit == 0>>Big clitoris.<<else>>Enormous clitoris.<</if>>
	<<click "Normal clitoris">>
		<<set $customSlave.clit to 0>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Big clitoris">>
		<<set $customSlave.clit to 1>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Enormous clitoris">>
		<<set $customSlave.clit to 2>>
		<<CustomSlaveClitBalls>>
	<</click>>

	<<if $customSlave.labia == 0>>Minimal labia.<<elseif $customSlave.labia == 1>>Normal labia.<<elseif $customSlave.labia is 2>>Huge labia.<<else>>Enormous labia.<</if>>
	<<click "Minimal labia">>
		<<set $customSlave.labia to 0>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Normal labia">>
		<<set $customSlave.labia to 1>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Huge labia">>
		<<set $customSlave.labia to 2>>
		<<CustomSlaveClitBalls>>
	<</click>>
	|
	<<click "Enormous labia">>
		<<set $customSlave.labia to 3>>
		<<CustomSlaveClitBalls>>
	<</click>>
	<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveAnus>>
%/
<<widget "CustomSlaveAnus">>
	<<replace #anus>>
		<<if $customSlave.anus == 0>>Anal virgin.
		<<else>>Normal anus.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveSkills>>
%/
<<widget "CustomSlaveSkills">>
	<<replace #skills>>
		<<if $customSlave.analSkill <= 10>>Sexually unskilled.
		<<elseif $customSlave.analSkill <= 30>>Basic skills..
		<<elseif $customSlave.analSkill <= 60>>Sexually skilled.
		<<else>>Sexual expert.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveWhoreSkills>>
%/
<<widget "CustomSlaveWhoreSkills">>
	<<replace #whoreskills>>
		<<if $customSlave.whoreSkill <= 10>>Unskilled at prostitution and entertainment.
		<<elseif $customSlave.whoreSkill <= 30>>Basic prostitution and entertainment skills.
		<<elseif $customSlave.whoreSkill <= 60>>Skilled at prostitution and entertainment.
		<<else>>Prostitution and entertainment expert.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveCombatSkills>>
%/
<<widget "CustomSlaveCombatSkills">>
	<<replace #combatskills>>
		<<if $customSlave.combatSkill == 0>>Unskilled at combat.
		<<else>>Skilled at combat.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveIntelligence>>
%/
<<widget "CustomSlaveIntelligence">>
	<<replace #intelligence>>
		<<if $customSlave.intelligence >= 3>>Brilliant.
		<<elseif $customSlave.intelligence is 2>>Very smart..
		<<elseif $customSlave.intelligence == 1>>Smart.
		<<elseif $customSlave.intelligence == 0>>Average intelligence.
		<<elseif $customSlave.intelligence is -1>>Stupid.
		<<elseif $customSlave.intelligence is -2>>Very stupid.
		<<else>>Moronic.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveEducation>>
%/
<<widget "CustomSlaveEducation">>
	<<replace #education>>
		<<if $customSlave.intelligenceImplant == 1>>Educated.
		<<else>>Uneducated.
		<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<CustomSlaveNationality>>
%/
<<widget "CustomSlaveNationality">>
	<<replace #nationality>>
		Nationality: $customSlave.nationality.
	<</replace>>
<</widget>>

repo_name: ZZC/fc


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: breadedpigeon/fc

path: .gitignore


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.