code:
:: pregmod widgets [nobr widget]

<<widget "setLocalPronouns">>
/*
	"He has a camera. The camera belongs to him. It is his camera. The camera is his."
	"She has a diamond ring. The diamond ring belongs to her. It is her diamond ring. The diamond ring is hers."

	Pronouns are tricky to get right, and this widget should make it easier to use variables naturally in writing. There are two problems in English pronouns that matter here:

	1. Her/her vs his/him. To solve this ambiguity, variables use male pronouns throughout, although players will of course see the contents of the variable. "$He glared" can be printed as "She glared."

	2. Her/hers vs his/his. Here, the opposite problem. In this one case and this alone, where you would use "hers," (the possessive pronoun) the variable is female, since the distinction is only important there. I am very sorry for English.
*/
	<<run App.Utils.setLocalPronouns($args[0], $args[1])>>
<</widget>>

<<widget "setNonlocalPronouns">>
	/* a fake slave object, we need the .pronoun attribute only */
	<<set _fSlave = {pronoun: App.Data.Pronouns.Kind.female}>>
	/* Used for generic slaves, citizens, security, etc. */
	<<if $diversePronouns == 1>>
		<<if $args[0] === 100>>
			<<set _fSlave.pronoun = App.Data.Pronouns.Kind.male>>
		<<elseif ($args[0] > 0) && (random(1,100) <= $args[0])>>
			<<set _fSlave.pronoun = App.Data.Pronouns.Kind.male>>
		<</if>>
	<</if>>
	<<run App.Utils.setLocalPronouns(_fSlave, 'U')>>
<</widget>>

<<widget "setPlayerPronouns">>
	<<set _pl = ["he", "his", "hers", "him", "himself", "woman", "women", "loli", "girl", "daughter", "sister", "wife", "wives",
		"He", "His", "Hers", "Him", "Himself", "Woman", "Women", "Loli", "Girl", "Daughter", "Sister", "Wife", "Wives"]>>
	<<run App.Utils.setLocalPronouns($PC, 'P', _pl)>>
	<<unset _pl>>
<</widget>>

<<widget "setAssistantPronouns">>
	<<set _apl = ["he", "his", "hers", "him", "himself", "woman", "women", "loli", "girl", "daughter", "sister", "wife", "wives",
		"He", "His", "Hers", "Him", "Himself", "Woman", "Women", "Loli", "Girl", "Daughter", "Sister", "Wife", "Wives"]>>

	<<run App.Utils.setLocalPronouns($assistantPronouns, 'A', _apl)>>
	<<run App.Utils.setLocalPronouns($marketAssistantPronouns, 'M', _apl)>>
	<<unset _apl>>
<</widget>>

/*
	Should be called with two slave objects as arguments, the primary and secondary. E.g. <<setSpokenLocalPronouns $activeSlave $subSlave>>
	_primarySlaveLisp and _secondarySlaveLisp only exist so that we don't have to rely on using the exact variables $activeSlave and $subSlave
*/
<<widget "setSpokenLocalPronouns">>
	<<set _primarySlaveLisp = SlaveStatsChecker.checkForLisp($args[0])>>

	<<set _heLisp = lispReplace($he)>>
	<<set _hisLisp = lispReplace($his)>>
	<<set _hersLisp = lispReplace($hers)>>
	<<set _himselfLisp = lispReplace($himself)>>
	<<set _daughterLisp = lispReplace($daughter)>>
	<<set _sisterLisp = lispReplace($sister)>>
	<<set _loliLisp = lispReplace($loli)>>
	<<set _wifeLisp = lispReplace($wife)>>
	<<set _wivesLisp = lispReplace($wives)>>

	<<set _HeLisp = lispReplace($He)>>
	<<set _HisLisp = lispReplace($His)>>
	<<set _HersLisp = lispReplace($Hers)>>
	<<set _HimselfLisp = lispReplace($Himself)>>
	<<set _DaughterLisp = lispReplace($Daughter)>>
	<<set _SisterLisp = lispReplace($Sister)>>
	<<set _LoliLisp = lispReplace($Loli)>>
	<<set _WifeLisp = lispReplace($Wife)>>
	<<set _WivesLisp = lispReplace($Wives)>>

	<<if def _he2>>
		<<set _secondarySlaveLisp = SlaveStatsChecker.checkForLisp($args[1])>>

		<<set _he2Lisp = lispReplace(_he2)>>
		<<set _his2Lisp = lispReplace(_his2)>>
		<<set _hers2Lisp = lispReplace(_hers2)>>
		<<set _himself2Lisp = lispReplace(_himself2)>>
		<<set _daughter2Lisp = lispReplace(_daughter2)>>
		<<set _sister2Lisp = lispReplace(_sister2)>>
		<<set _loli2Lisp = lispReplace(_loli2)>>
		<<set _wife2Lisp = lispReplace(_wife2)>>
		<<set _wives2Lisp = lispReplace(_wives2)>>

		<<set _He2Lisp = lispReplace(_He2)>>
		<<set _His2Lisp = lispReplace(_His2)>>
		<<set _Hers2Lisp = lispReplace(_Hers2)>>
		<<set _Himself2Lisp = lispReplace(_Himself2)>>
		<<set _Daughter2Lisp = lispReplace(_Daughter2)>>
		<<set _Sister2Lisp = lispReplace(_Sister2)>>
		<<set _Loli2Lisp = lispReplace(_Loli2)>>
		<<set _Wife2Lisp = lispReplace(_Wife2)>>
		<<set _Wives2Lisp = lispReplace(_Wives2)>>
	<</if>>
<</widget>>

<<widget "setSpokenPlayerPronouns">>
	<<set _playerSlaveLisp = SlaveStatsChecker.checkForLisp($args[0])>>

	<<set _hePLisp = lispReplace(_heP)>>
	<<set _hisPLisp = lispReplace(_hisP)>>
	<<set _hersPLisp = lispReplace(_hersP)>>
	<<set _himselfPLisp = lispReplace(_himselfP)>>
	<<set _daughterPLisp = lispReplace(_daughterP)>>
	<<set _sisterPLisp = lispReplace(_sisterP)>>
	<<set _loliPLisp = lispReplace(_loliP)>>
	<<set _wifePLisp = lispReplace(_wifeP)>>
	<<set _wivesPLisp = lispReplace(_wivesP)>>

	<<set _HePLisp = lispReplace(_HeP)>>
	<<set _HisPLisp = lispReplace(_HisP)>>
	<<set _HersPLisp = lispReplace(_HersP)>>
	<<set _HimselfPLisp = lispReplace(_HimselfP)>>
	<<set _DaughterPLisp = lispReplace(_DaughterP)>>
	<<set _SisterPLisp = lispReplace(_SisterP)>>
	<<set _LoliPLisp = lispReplace(_LoliP)>>
	<<set _WifePLisp = lispReplace(_WifeP)>>
	<<set _WivesPLisp = lispReplace(_WivesP)>>
<</widget>>

<<widget "setSpokenAssistantPronouns">>
	<<set _assistantSlaveLisp = SlaveStatsChecker.checkForLisp($args[0])>>

	<<set _heALisp = lispReplace(_heA)>>
	<<set _hisALisp = lispReplace(_hisA)>>
	<<set _hersALisp = lispReplace(_hersA)>>
	<<set _himselfALisp = lispReplace(_himselfA)>>
	<<set _daughterALisp = lispReplace(_daughterA)>>
	<<set _sisterALisp = lispReplace(_sisterA)>>
	<<set _loliALisp = lispReplace(_loliA)>>
	<<set _wifeALisp = lispReplace(_wifeA)>>
	<<set _wivesALisp = lispReplace(_wivesA)>>

	<<set _HeALisp = lispReplace(_HeA)>>
	<<set _HisALisp = lispReplace(_HisA)>>
	<<set _HersALisp = lispReplace(_HersA)>>
	<<set _HimselfALisp = lispReplace(_HimselfA)>>
	<<set _DaughterALisp = lispReplace(_DaughterA)>>
	<<set _SisterALisp = lispReplace(_SisterA)>>
	<<set _LoliALisp = lispReplace(_LoliA)>>
	<<set _WifeALisp = lispReplace(_WifeA)>>
	<<set _WivesALisp = lispReplace(_WivesA)>>
<</widget>>

<<widget "PCAgeImplantAdjustmentUp">>
	<<if $PC.visualAge < 35>>
		<<set $PC.visualAge += 15>>
	<<elseif $PC.visualAge <= 50>>
		<<set $PC.visualAge += 10>>
	<<elseif $PC.visualAge < 60>>
		<<set $PC.visualAge += 5>>
	<<elseif $PC.visualAge < 80>>
		<<set $PC.visualAge += 3>>
	<<else>>
		<<set $PC.visualAge += 1>>
	<</if>>
<</widget>>

<<widget "PCAgeImplantAdjustmentDown">>
	<<if $PC.visualAge > 80>>
		<<set $PC.visualAge -= 40>>
	<<elseif $PC.visualAge >= 70>>
		<<set $PC.visualAge -= 30>>
	<<elseif $PC.visualAge > 50>>
		<<set $PC.visualAge -= 20>>
	<<elseif $PC.visualAge > 36>>
		<<set $PC.visualAge -= 10>>
	<<else>>
		<<set $PC.visualAge -= 5>>
	<</if>>
<</widget>>

<<widget "InitStandards">>

<<set $activeStandard = {age: 24, weightMax: 0, weightMin: 0, musclesMin: 0, musclesMax: 0, raceSup: "white", raceSub: "white", boobs: 0, boobsImplant: 0, lactation: 0, hips: 0, hipsImplant: 0, butt: 0, buttImplant: 0, face: 0, faceImplant: 0, lips: 15, lipsImplant: 0, chem: 0, addict: 0, intelligence: 0, intelligenceImplant: 0, bellyImplant: -1, beauty: 0, dick: 0, balls: 0, health: 0, skill: 0, accent: 0, height: 150, energy: 100}>>

<<UpdateStandards>>
<<BreedingStandards>>
<</widget>>

<<widget "UpdateStandards">>
<<if $failedElite > 100>>
	<<set $activeStandard.intelligence = 95>>
	<<set $activeStandard.beauty = 120>>
	<<set $activeStandard.face = 95>>
<<else>>
	<<set $activeStandard.intelligence = 50>>
	<<set $activeStandard.beauty = 100>>
	<<set $activeStandard.face = 40>>
<</if>>
<<if $arcologies[0].FSIntellectualDependency > 20>>
	<<set $activeSlave.energy = 100>>
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>
	<<if $failedElite > 100>>
		<<set $activeStandard.skill = 500>>
	<<else>>
		<<set $activeStandard.skill = 400>>
	<</if>>
	<<set $activeStandard.accent = 1>>
<</if>>
<<if $arcologies[0].FSPetiteAdmiration > 20>>
	<<set $activeStandard.height = 150>>
<<elseif $arcologies[0].FSStatuesqueGlorification > 20>>
	<<set $activeStandard.height = 185>>
<</if>>
<<set $activeStandard.chem = 20>>
<<set $activeStandard.addict = 0>>
<<if $arcologies[0].FSSupremacist > 20>>
	<<set $activeStandard.raceSup = $arcologies[0].FSSupremacistRace>>
<</if>>
<<if $arcologies[0].FSSubjugationist > 20>>
	<<set $activeStandard.raceSub = $arcologies[0].FSSubjugationistRace>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist > 20>>
	<<set $activeStandard.dick = 1>>
	<<set $activeStandard.balls = 1>>
<<elseif $arcologies[0].FSGenderFundamentalist > 20>>
	<<set $activeStandard.dick = 0>>
	<<set $activeStandard.balls = 0>>
<</if>>
<<if $arcologies[0].FSPaternalist > 20>>
	<<set $activeStandard.intelligenceImplant = 15>>
	<<set $activeStandard.health = 60>>
<<elseif $arcologies[0].FSDegradationist > 20>>
	<<set $activeStandard.intelligenceImplant = 15>>
	<<set $activeStandard.health = 0>>
<</if>>
<<if $arcologies[0].FSSlaveProfessionalism > 20>>
	<<set $activeStandard.intelligenceImplant = 30>>
<</if>>
<<if $arcologies[0].FSBodyPurist > 20>>
	<<if $failedElite > 100>>
		<<set $activeStandard.chem = 0>>
	<<else>>
		<<set $activeStandard.chem = 15>>
	<</if>>
	<<set $activeStandard.boobsImplant = 0>>
	<<set $activeStandard.buttImplant = 0>>
	<<set $activeStandard.lipsImplant = 0>>
	<<set $activeStandard.hipsImplant = 0>>
	<<set $activeStandard.shouldersImplant = 0>>
	<<set $activeStandard.faceImplant = 5>>
	<<set $activeStandard.bellyImplant = -1>>
<<elseif $arcologies[0].FSTransformationFetishist > 20>>
	<<set $activeStandard.chem = 20>>
<</if>>
<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
	<<if $arcologies[0].FSHedonisticDecadence > 20>>
		<<set $activeStandard.weightMax = 30>>
	<<else>>
		<<set $activeStandard.weightMax = 0>>
	<</if>>
	<<set $activeStandard.butt = 2>>
	<<set $activeStandard.boobs = 400>>
<<elseif $arcologies[0].FSAssetExpansionist > 20>>
	<<set $activeStandard.butt = 6>>
	<<set $activeStandard.boobs = 1000>>
<</if>>
<<if $arcologies[0].FSPastoralist > 20>>
	<<set $activeStandard.lactation = 1>>
<</if>>
<<if $arcologies[0].FSPhysicalIdealist > 20>>
	<<if $arcologies[0].FSPhysicalIdealistLaw == 1>>
		<<set $activeStandard.weightMax = 30>>
		<<set $activeStandard.musclesMin = 20>>
		<<set $activeStandard.musclesMax = 50>>
	<<else>>
		<<set $activeStandard.musclesMin = 95>>
	<</if>>
<<elseif $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
		<<set $activeStandard.weightMin = 10>>
	<<else>>
		<<set $activeStandard.weightMin = 95>>
	<</if>>
<</if>>
<</widget>>

<<widget "BreedingStandards">>

In order to be eligible to be bred, the potential breeding bitch must first satisfy the following conditions:
<<if $failedElite > 100>>

She must be of finest intelligence.

She must be unbelievably beautiful.

Her face must be breathtaking.
<<else>>

She must be very smart.

She must be beautiful.

Her face must be gorgeous.
<</if>>

Her health must not be overly impacted by drug use.

She must not be addicted to drugs.
<<if $arcologies[0].FSPetiteAdmiration > 20>>

She must be very short. (150cm)

She must be very short for her age.

She must not have had height altering surgery to reach it.
<<elseif $arcologies[0].FSStatuesqueGlorification > 20>>

She must be very tall. (186cm)

She must not have had height altering surgery to reach it.
<</if>>
<<if $arcologies[0].FSSupremacist > 20>>

She must be $arcologies[0].FSSupremacistRace.
<</if>>
<<if $arcologies[0].FSSubjugationist > 20>>

She must not be $arcologies[0].FSSubjugationistRace.
<</if>>
<<if $arcologies[0].FSGenderRadicalist > 20>>

She must have a functional penis.
<<elseif $arcologies[0].FSGenderFundamentalist > 20>>

She must be physically female.
<</if>>
<<if $arcologies[0].FSPaternalist > 20>>
	<<if $arcologies[0].FSSlaveProfessionalism > 20>>

She must be well educated.
	<<else>>

She must be educated.
	<</if>>

She must be in good health.
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>

She must be well educated.
<</if>>
<<if $arcologies[0].FSIntellectualDependency > 20>>

She must be sexually receptive at all times.
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>

She must be capable of mastering her skills.

She must be capable of eloquent and accurate speech.
<</if>>
<<if $arcologies[0].FSBodyPurist > 20>>

She must have low carcinogen levels.

She must be implant free.
<</if>>
<<if $arcologies[0].FSMaturityPreferentialist > 20>>

She must be older than 24.
<<elseif $arcologies[0].FSYouthPreferentialist > 20>>

She must be younger than 24.
<</if>>
<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
	<<if $arcologies[0].FSHedonisticDecadence > 20>>

She may be no larger than "plush".
	<<else>>

She must be thin.
	<</if>>

She must have a trim rear.

She must have a sleek chest.
<<elseif $arcologies[0].FSAssetExpansionist > 20>>

She must have a naturally gigantic rear.

She must be naturally busty.
<</if>>
<<if $arcologies[0].FSPastoralist > 20>>

She must be lactating naturally.
<</if>>
<<if $arcologies[0].FSPhysicalIdealist > 20>>
	<<if $arcologies[0].FSPhysicalIdealistLaw == 1>>

She must not be overweight.

She must be fit, but not too muscular.
	<<else>>

She must be extremely muscular.
	<</if>>

<<elseif $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $arcologies[0].FSSlimnessEnthusiast > 20>>

She must be more than "trim".
	<<else>>

She must be big, soft and fat.
	<</if>>
<</if>>

For each slave examined, a fee of @@.yellowgreen;<<print cashFormat(5000)>>@@ will be deducted from your account.

Failures will be sterilized. Please make sure your slave fits the criteria before submitting them for testing. We shall not be held responsible for time wasted.

Updates will be posted periodically. It is your responsibility to keep up to date with current standards.
<</widget>>

<<widget "BreedingEligibility">>
<<set _passing = 0>>

$activeSlave.slaveName is up for review:
<<if $activeSlave.intelligence+$activeSlave.intelligenceImplant >= $activeStandard.intelligence>>

$He @@.lime;PASSED@@ the intelligence test.
<<else>>

$He @@.red;FAILED@@ the intelligence test.
	<<set _passing-->>
<</if>>
<<if Beauty($activeSlave) >= $activeStandard.beauty>>

$He @@.lime;PASSED@@ the beauty test.
<<else>>

$He @@.red;FAILED@@ the beauty test.
	<<set _passing-->>
<</if>>
<<if $activeSlave.face >= $activeStandard.face>>

$He @@.lime;PASSED@@ the facial attractiveness test.
<<else>>

$He @@.red;FAILED@@ the facial attractiveness test.
	<<set _passing-->>
<</if>>
<<if $activeSlave.chem <= $activeStandard.chem>>

$He @@.lime;PASSED@@ the carcinogen test.
<<else>>

$He @@.red;FAILED@@ the carcinogen test.
	<<set _passing-->>
<</if>>
<<if $activeSlave.addict <= $activeStandard.addict>>

$He @@.lime;PASSED@@ the drug test.
<<else>>

$He @@.red;FAILED@@ the drug test.
	<<set _passing-->>
<</if>>
<<if $arcologies[0].FSSupremacist > 20>>
	<<if $activeSlave.race == $activeStandard.raceSup>>

$He @@.lime;PASSED@@ racial testing.
	<<else>>

$He @@.red;FAILED@@ racial testing.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSSubjugationist > 20>>
	<<if $activeSlave.race != $activeStandard.raceSub>>

$He @@.lime;PASSED@@ racial testing.
	<<else>>

$He @@.red;FAILED@@ racial testing.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSPetiteAdmiration > 20>>
	<<if ($activeSlave.height-($activeSlave.heightImplant*10)) > $activeStandard.height>>
		<<if $activeSlave.height-($activeSlave.heightImplant*10)) < Height.mean($activeSlave)-15>>

$He @@.lime;MET@@ height requirements.
		<<else>>

$He @@.red;FAILED@@ to meet height requirements.
		<</if>>
	<<else>>

$He @@.red;FAILED@@ to meet height requirements.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSStatuesqueGlorification > 20>>
	<<if ($activeSlave.height-($activeSlave.heightImplant*10)) > $activeStandard.height>>

$He @@.lime;MET@@ height requirements.
	<<else>>

$He @@.red;FAILED@@ to meet height requirements.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist > 20>>
	<<if $activeSlave.dick >= $activeStandard.dick && $activeSlave.balls >= $activeStandard.balls>>

$He @@.lime;PASSED@@ penis inspection.
	<<else>>

$He @@.red;FAILED@@ penis inspection.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSGenderFundamentalist > 20>>
	<<if $activeSlave.dick == $activeStandard.dick && $activeSlave.balls == $activeStandard.balls>>

$He @@.lime;PASSED@@ genital inspection.
	<<else>>

$He @@.red;FAILED@@ genital inspection.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSPaternalist > 20>>
	<<if $activeSlave.intelligenceImplant >= $activeStandard.intelligenceImplant>>

$He @@.lime;PASSED@@ educational trials.
	<<else>>

$He @@.red;FAILED@@ educational trials.
		<<set _passing-->>
	<</if>>
	<<if $activeSlave.health.condition >= $activeStandard.health>>

$He @@.lime;PASSED@@ health examinations.
	<<else>>

$He @@.red;FAILED@@ health examinations.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>
	<<if $activeSlave.intelligenceImplant >= $activeStandard.intelligenceImplant>>

$He @@.lime;PASSED@@ educational trials.
	<<else>>

$He @@.red;FAILED@@ educational trials.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSIntellectualDependency > 20>>
	<<if $activeSlave.energy >= $activeStandard.energy>>

$He @@.lime;PASSED@@ libido testing.
	<<else>>

$He @@.red;FAILED@@ libido testing.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSSlaveProfessionalism > 20>>
	<<if $activeSlave.skill.vaginal + $activeSlave.skill.anal + $activeSlave.skill.oral + $activeSlave.skill.entertainment + $activeSlave.skill.vaginal >= $activeStandard.skill>>

$He @@.lime;PASSED@@ skill retention trails.
	<<else>>

$He @@.red;FAILED@@ skill retention trails.
		<<set _passing-->>
	<</if>>
	<<if $activeSlave.accent <= $activeStandard.accent>>

$He @@.lime;PASSED@@ $his speech test.
	<<else>>

$He @@.red;FAILED@@ $his speech test.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSBodyPurist > 20>>
	<<if $activeSlave.chem <= $activeStandard.chem>>

$He @@.lime;PASSED@@ health examinations.
	<<else>>

$He @@.red;FAILED@@ health examinations.
		<<set _passing-->>
	<</if>>
	<<if $activeSlave.boobsImplant == 0 && $activeSlave.buttImplant == 0 && $activeSlave.lipsImplant == 0 && $activeSlave.hipsImplant == 0 && $activeSlave.shouldersImplant == 0 && $activeSlave.faceImplant <= 5 && $activeSlave.bellyImplant == -1>>

$He @@.lime;PASSED@@ implant examinations.
	<<else>>

$He @@.red;FAILED@@ implant examinations.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSMaturityPreferentialist > 20>>
	<<if $activeSlave.physicalAge > $activeStandard.age>>

$He @@.lime;PASSED@@ age examinations.
	<<else>>

$He @@.red;FAILED@@ age examinations.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSYouthPreferentialist > 20>>
	<<if $activeSlave.physicalAge < $activeStandard.age>>

$He @@.lime;PASSED@@ age examinations.
	<<else>>

$He @@.red;FAILED@@ age examinations.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
	<<if $activeSlave.weight <= $activeStandard.weightMax>>

$He @@.lime;MET@@ weight limits.
	<<else>>

$He @@.red;EXCEEDED@@ weight limits.
		<<set _passing-->>
	<</if>>
	<<if $activeSlave.butt <= $activeStandard.butt>>

$He @@.lime;MET@@ ass measurements.
	<<else>>

$He @@.red;EXCEEDED@@ ass measurements.
		<<set _passing-->>
	<</if>>
	<<if $activeSlave.boobs <= $activeStandard.boobs>>

$He @@.lime;MET@@ chest measurements.
	<<else>>

$He @@.red;EXCEEDED@@ chest measurements.
		<<set _passing-->>
	<</if>>
<<elseif $arcologies[0].FSAssetExpansionist > 20>>
	<<if ($activeSlave.butt - $activeSlave.buttImplant) >= $activeStandard.butt>>

$He @@.lime;MET@@ ass measurements.
	<<else>>

$He @@.red;FAILED@@ to meet ass measurements.
		<<set _passing-->>
	<</if>>
	<<if ($activeSlave.boobs - $activeSlave.boobsImplant) >= $activeStandard.boobs>>

$He @@.lime;MET@@ chest measurements.
	<<else>>

$He @@.red;FAILED@@ to meet chest measurements.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSPastoralist > 20>>
	<<if $activeSlave.lactation == $activeStandard.lactation>>

$He @@.lime;MET@@ milk production standards.
	<<elseif $activeSlave.lactation > $activeStandard.lactation>>

$He @@.red;EXCEEDED@@ milk production standards.
		<<set _passing-->>
	<<else>>

$He @@.red;FAILED@@ to meet milk production standards.
		<<set _passing-->>
	<</if>>
<</if>>
<<if $arcologies[0].FSPhysicalIdealist > 20>>
	<<if $arcologies[0].FSPhysicalIdealistLaw == 1>>
		<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
			<<if $activeSlave.weight <= $activeStandard.weightMax>>

$He @@.lime;MET@@ weight limits.
			<<else>>

$He @@.red;EXCEEDED@@ weight limits.
				<<set _passing-->>
			<</if>>
		<</if>>
		<<if $activeSlave.muscles > $activeStandard.musclesMin && $activeSlave.muscles < $activeStandard.musclesMax>>

$He @@.lime;MET@@ the required muscle standard.
		<<elseif ($activeSlave.muscles <= $activeStandard.musclesMin && $activeSlave.muscles > $activeStandard.musclesMin-20) || ($activeSlave.muscles >= $activeStandard.musclesMax && $activeSlave.muscles < $activeStandard.musclesMax+30)>>

$He @@.yellow;failed@@ to match the required muscle standard, but was deemed within fixable range.
			<<if _passing == 0>>
				<<set _passing = 2>>
			<</if>>
		<<else>>

$He @@.red;FAILED@@ to match the required muscle standard.
			<<set _passing-->>
		<</if>>
	<<else>>
		<<if $activeSlave.muscles > $activeStandard.musclesMin>>

$He @@.lime;MET@@ the required muscle mass.
		<<else>>

$He @@.red;FAILED@@ to meet the required muscle mass.
			<<set _passing-->>
		<</if>>
	<</if>>
<<elseif $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $activeSlave.weight > $activeStandard.weightMin>>

$He @@.lime;MET@@ the minimum weight limit.
	<<else>>

$He @@.red;failed@@ to meet minimum weight limits.
		<<set _passing-->>
	<</if>>
<</if>>

<<if _passing == 2>>
	The slave known as "<<= SlaveFullName($activeSlave)>>" has been deemed @@.yellow;currently unsuitable@@ for breeding, but may be resubmitted after corrections are applied. We understand the subjective nature of "fit" and do not wish to preclude the use a viable breeder over such a trivial fix. $He has been placed on a contraceptive routine to protect against "accidents" in the interim.
<<elseif _passing != 0>>
	The slave known as "<<= SlaveFullName($activeSlave)>>" has been deemed @@.red;unsuitable@@ for breeding and has been @@.green;sterilized@@ as per agreement.
	<<set $activeSlave.preg = -3>>
<<else>>
	The slave known as "<<= SlaveFullName($activeSlave)>>" has been deemed @@.green;worthy@@ of being used for breeding and has been marked as such. Please note the increased restrictions on breeding slaves.

They are not permitted for public use or anything that may harm their growing child. The child within them is considered a member of the Elite class and as such, any harm that comes to them will result in severe penalties to the breeder's owner. Development of the child will be closely monitored; should the fetus be identified as not of the owner's blood (or any other member of the Elite class), said owner shall face severe fines.
	<<set $activeSlave.breedingMark = 1, $activeSlave.pregControl = "none">>
<</if>>

@@.yellowgreen;<<print cashFormat(5000)>>@@ has been deducted from your account as agreed.
<<= removeJob($activeSlave, $activeSlave.assignment)>>
<</widget>>

<<widget "PlayerRace">>
	<<replace #ethnicity>>
		You're $PC.race.
	<</replace>>
<</widget>>

<<widget "PlayerSkin">>
	<<replace #skin>>
		You have $PC.origSkin skin.
	<</replace>>
<</widget>>

<<widget "PlayerMarkings">>
	<<replace #markings>>
		<<if $PC.markings == "none">>
			Your skin is pure and clear of any freckles.
		<<elseif $PC.markings == "freckles">>
			You have some freckles on your cheeks and elsewhere.
		<<elseif $PC.markings == "heavily freckled">>
			You have dense freckles on your cheeks and elsewhere.
		<</if>>
	<</replace>>
<</widget>>

<<widget "ResyncHeight">>

<<set $args[0].height = Math.round(Height.random($args[0]))>>
/*
<<switch $activeSlave.actualAge>>
<<case 3>>
	<<set $activeSlave.height = random(91,96)>>
<<case 4>>
	<<set $activeSlave.height = random(97,104)>>
<<case 5>>
	<<set $activeSlave.height = random(104,111)>>
<<case 6>>
	<<set $activeSlave.height = random(112,119)>>
<<case 7>>
	<<set $activeSlave.height = random(118,126)>>
<<case 8>>
	<<set $activeSlave.height = random(124,132)>>
<<case 9>>
	<<set $activeSlave.height = random(129,137)>>
<<case 10>>
	<<set $activeSlave.height = random(133,142)>>
<<case 11>>
	<<set $activeSlave.height = random(140,149)>>
<<case 12>>
	<<set $activeSlave.height = random(147,156)>>
<<case 13>>
	<<set $activeSlave.height = random(152,162)>>
<<case 14>>
	<<set $activeSlave.height = random(156,165)>>
<<case 15>>
	<<set $activeSlave.height = random(157,166)>>
<<default>>
	<<set $activeSlave.height = random(159,167)>>
<</switch>>
*/

<</widget>>

<<widget "BodyguardWeapon">>

<<if ($activeSlave.muscles+$activeSlave.height-100)/25 > 5>>
	$He has a long ceramic sword strapped to $his back,
	<<switch $activeSlave.nationality>>
	<<case "American">>
		and, in keeping with $his heritage, a US Ordnance Mk43 Mod.1 GPMG
	<<case "Armenian" "Belarusian" "Cuban" "Hungarian" "Kazakh" "Uzbek">>
		and, in keeping with $his heritage, a PKM GPMG
	<<case "Australian">>
		and, in keeping with $his heritage, a Lithgow F89 Maximi GPMG
	<<case "Austrian">>
		and, in keeping with $his heritage, a Steyr MG 74 GPMG
	<<case "Belgian">>
		and, in keeping with $his heritage, a FN Minimi M3 LMG
	<<case "British" "Scottish">>
		and, in keeping with $his heritage, an L7A2 GPMG
	<<case "Canadian">>
		and, in keeping with $his heritage, a Colt Canada 5.56-LSW LMG
	<<case "Chilean" "German">>
		and, in keeping with $his heritage, a Rheinmetall MG3 GPMG
	<<case "Chinese">>
		and, in keeping with $his heritage, a Norinco QJY-88 LMG
	<<case "Czech" "Slovak">>
		and, in keeping with $his heritage, a ZVI Uk vz.59 Rachot GPMG
	<<case "Filipina">>
		and, in keeping with $his heritage, a Government Arsenal M60E4 GPMG
	<<case "Finnish">>
		and, in keeping with $his heritage, a Valmet KvKK 62 LMG
	<<case "French">>
		and, in keeping with $his heritage, a MAS AAT-F1 GPMG
	<<case "Indian">>
		and, in keeping with $his heritage, an OFB MG 2A1 GPMG
	<<case "Indonesian">>
		and, in keeping with $his heritage, a Pindad SM2 LMG
	<<case "Iranian">>
		and, in keeping with $his heritage, a DIO MGA3 GPMG
	<<case "Israeli">>
		and, in keeping with $his heritage, an IWI Negev NG7 GPMG
	<<case "Japanese">>
		and, in keeping with $his heritage, a Sumitomo Type 62 GPMG
	<<case "Korean">>
		and, in keeping with $his heritage, a S&T K12 GPMG
	<<case "Mexican">>
		and, in keeping with $his heritage, a SEDENA MG-21 GPMG
	<<case "Polish">>
		and, in keeping with $his heritage, a ZMT UKM-2000 GPMG
	<<case "Romanian">>
		and, in keeping with $his heritage, a FACSA PM md.93 LMG
	<<case "Russian">>
		and, in keeping with $his heritage, a PKP Pecheneg GPMG
	<<case "Serbian">>
		and, in keeping with $his heritage, a Zastava M09 LMG
	<<case "South African">>
		and, in keeping with $his heritage, a Vektor SS-77 GPMG
	<<case "Spanish">>
		and, in keeping with $his heritage, a CETME MG 82 Ameli LMG
	<<case "Swiss">>
		and, in keeping with $his heritage, a W+F-Bern MG51 GPMG
	<<case "Turkish">>
		and, in keeping with $his heritage, a MKEK MG3 GPMG
	<<case "Ukrainian">>
		and, in keeping with $his heritage, a Fort-401 LMG
	<<case "Vietnamese">>
		and, in keeping with $his heritage, a Z111 RPK LMG
	<<case "Zimbabwean">>
		<<if $activeSlave.race == "white">>
			and, in keeping with $his heritage, a FN MAG-58 GPMG
		<<else>>
			and a FN MAG 60.20 GPMG
		<</if>>
	<<default>>
		and a FN MAG 60.20 GPMG
	<</switch>>
	slung crosswise on $his chest.
<<elseif ($activeSlave.muscles+$activeSlave.height-100)/25 > 4>>
	$He has a ceramic sword strapped to $his back
	<<switch $activeSlave.nationality>>
	<<case "American">>
		and, in keeping with $his heritage, a Colt M16A4 assault rifle
	<<case "Argentinian">>
		and, in keeping with $his heritage, a FMAP FARA-83 assault rifle
	<<case "Armenian" "Belarusian" "Kazakh" "Uzbek">>
		and, in keeping with $his heritage, a Kalashnikov AK-74M assault rifle
	<<case "Australian">>
		and, in keeping with $his heritage, a Lithgow EF88 Austeyr bullpup assault rifle
	<<case "Austrian">>
		and, in keeping with $his heritage, a Steyr AUG A3 bullpup assault rifle
	<<case "Belgian">>
		and, in keeping with $his heritage, a FN FNC M2 assault rifle
	<<case "Brazilian">>
		and, in keeping with $his heritage, an IMBEL IA2 assault rifle
	<<case "British" "Scottish">>
		and, in keeping with $his heritage, an L85A3 bullpup assault rifle
	<<case "Canadian">>
		and, in keeping with $his heritage, a Colt Canada MRR assault rifle
	<<case "Chilean">>
		and, in keeping with $his heritage, a FAMAE ACE 22NC assault rifle
	<<case "Chinese">>
		and, in keeping with $his heritage, a Norinco QBZ-95-1 bullpup assault rifle
	<<case "Colombian">>
		and, in keeping with $his heritage, an Indumil ACE 22 assault rifle
	<<case "Croatian">>
		and, in keeping with $his heritage, an HS Produkt VHS-2 bullpup assault rifle
	<<case "Cuban">>
		and, in keeping with $his heritage, an AKM assault rifle
	<<case "Czech" "Slovak">>
		and, in keeping with $his heritage, a CZUB CZ-806 BREN-2 assault rifle
	<<case "Filipina">>
		and, in keeping with $his heritage, an Elitool M653P carbine
	<<case "Finnish">>
		and, in keeping with $his heritage, a SAKO Rk 95 TP assault rifle
	<<case "French">>
		and, in keeping with $his heritage, a Nexter FAMAS G2 bullpup assault rifle
	<<case "German">>
		and, in keeping with $his heritage, a H&K G36A2 assault rifle
	<<case "Hungarian">>
		and, in keeping with $his heritage, a FEG AMD-65M assault rifle
	<<case "Indian">>
		and, in keeping with $his heritage, an OFB MCIWS assault rifle
	<<case "Indonesian">>
		and, in keeping with $his heritage, a Pindad SS2 assault rifle
	<<case "Iranian">>
		and, in keeping with $his heritage, a DIO KH-2002 Khaybar bullpup assault rifle
	<<case "Israeli">>
		and, in keeping with $his heritage, an IWI MTAR-21 bullpup assault rifle
	<<case "Italian">>
		and, in keeping with $his heritage, a Beretta ARX-160 assault rifle
	<<case "Japanese">>
		and, in keeping with $his heritage, a Howa Type 89 assault rifle
	<<case "Korean">>
		and, in keeping with $his heritage, a Daewoo K2C1 assault rifle
	<<case "Mexican">>
		and, in keeping with $his heritage, a DGIM FX-05 Xiuhcoatl assault rifle
	<<case "Peruvian">>
		and, in keeping with $his heritage, a SIMA FAD bullpup assault rifle
	<<case "Polish">>
		and, in keeping with $his heritage, a FB MSBS assault rifle
	<<case "Romanian">>
		and, in keeping with $his heritage, a ROMARM PA md.86 assault rifle
	<<case "Russian">>
		and, in keeping with $his heritage, an Izhmash AN-94 Abakan assault rifle
	<<case "Serbian">>
		and, in keeping with $his heritage, a Zastava M21A assault rifle
	<<case "South African">>
		and, in keeping with $his heritage, a Vektor R4 assault rifle
	<<case "Spanish">>
		and, in keeping with $his heritage, a CETME Model C battle rifle
	<<case "Swedish">>
		and, in keeping with $his heritage, a Bofors Ak-5C assault rifle
	<<case "Swiss">>
		and, in keeping with $his heritage, a SIG SG 550 assault rifle
	<<case "Thai">>
		and, in keeping with $his heritage, a MND Type 11 assault rifle
	<<case "Turkish">>
		and, in keeping with $his heritage, a MKEK MPT-76 assault rifle
	<<case "Ukrainian">>
		and, in keeping with $his heritage, a Fort-227 assault rifle
	<<case "Vietnamese">>
		and, in keeping with $his heritage, a Z111 AKM assault rifle
	<<case "Zimbabwean">>
		<<if $activeSlave.race == "white">>
			and, in keeping with $his heritage, a FN FAL battle rifle
		<<else>>
			and a FN F2000 bullpup assault rifle
		<</if>>
	<<default>>
		and a FN F2000 bullpup assault rifle
	<</switch>>
	slung across $his chest.
<<elseif ($activeSlave.muscles+$activeSlave.height-100)/25 > 3>>
	$He has a straight ceramic sword strapped to $his back
	<<switch $activeSlave.nationality>>
	<<case "American">>
		and, in keeping with $his heritage, a KRISS Vector SMG
	<<case "Argentinian">>
		and, in keeping with $his heritage, a Halcon ML-63 SMG
	<<case "Armenian" "Belarusian" "Kazakh" "Uzbek">>
		and, in keeping with $his heritage, a Kalashnikov AKS-74U PDW
	<<case "Austrian">>
		and, in keeping with $his heritage, a Steyr AUG A3 Para XS bullpup SMG
	<<case "Belgian">>
		and, in keeping with $his heritage, a FN P90 bullpup PDW
	<<case "Brazilian">>
		and, in keeping with $his heritage, a Taurus MT40 G2 SMG
	<<case "British" "Scottish">>
		and, in keeping with $his heritage, an L91A1 SMG
	<<case "Chilean">>
		and, in keeping with $his heritage, a FAMAE SAF-200 SMG
	<<case "Chinese">>
		and, in keeping with $his heritage, a Norinco QCQ-05 SMG
	<<case "Croatian">>
		and, in keeping with $his heritage, a PM Agram 2000 SMG
	<<case "Filipina">>
		and, in keeping with $his heritage, a Ferfrans SCW7 PDW
	<<case "German">>
		and, in keeping with $his heritage, an H&K MP7A1 PDW
	<<case "Indian">>
		and, in keeping with $his heritage, an OFB MSMC SMG
	<<case "Indonesian">>
		and, in keeping with $his heritage, a Pindad PM1A1 SMG
	<<case "Iranian">>
		and, in keeping with $his heritage, a DIO MPT-9 Tondar SMG
	<<case "Israeli">>
		and, in keeping with $his heritage, an IWI Uzi SMG
	<<case "Italian">>
		and, in keeping with $his heritage, a Beretta MX4 SMG
	<<case "Korean">>
		and, in keeping with $his heritage, a Daewoo K1A PDW
	<<case "Mexican">>
		and, in keeping with $his heritage, a Mendoza Cobra SMG
	<<case "Polish">>
		and, in keeping with $his heritage, a FB PM-06 Glauberyt SMG
	<<case "Romanian">>
		and, in keeping with $his heritage, a UM Cugir LP7 SMG
	<<case "Russian">>
		and, in keeping with $his heritage, a KBP PP-90M1 SMG
	<<case "Serbian">>
		and, in keeping with $his heritage, a Zastava Master FLG SMG
	<<case "South African">>
		and, in keeping with $his heritage, a Milkor BXP SMG
	<<case "Spanish">>
		and, in keeping with $his heritage, a Star Z84 SMG
	<<case "Swedish">>
		and, in keeping with $his heritage, a Carl Gustav m/45 SMG
	<<case "Swiss">>
		and, in keeping with $his heritage, a SIG MPX SMG
	<<case "Turkish">>
		and, in keeping with $his heritage, a Sarsilmaz SAR 109 SMG
	<<case "Ukrainian">>
		and, in keeping with $his heritage, a Fort-224 bullpup SMG
	<<case "Vietnamese">>
		and, in keeping with $his heritage, a Z111 K-50M LMG
	<<case "Zimbabwean">>
		<<if $activeSlave.race == "white">>
			and, in keeping with $his heritage, a Sterling Mk.IV SMG
		<<else>>
			and a H&K MP5 SMG
		<</if>>
	<<default>>
		and a H&K MP5 SMG
	<</switch>>
	slung across $his chest.
<<else>>
	$He has a short ceramic sword strapped to $his back
	<<switch $activeSlave.nationality>>
	<<case "American">>
		and, in keeping with $his heritage, a MAC-10 machine pistol
	<<case "Armenian" "Belarusian" "Cuban" "Kazakh" "Ukrainian" "Uzbek">>
		and, in keeping with $his heritage, a Molot Ordnance Stechkin APS machine pistol
	<<case "Austrian">>
		and, in keeping with $his heritage, a Steyr TMP machine pistol
	<<case "Belgian">>
		and, in keeping with $his heritage, a VBR-Belgium PDW machine pistol
	<<case "Chinese">>
		and, in keeping with $his heritage, a Chongqing Changfeng CF-05 machine pistol
	<<case "Czech" "Slovak">>
		and, in keeping with $his heritage, a CZUB CZ 75 Automatic machine pistol
	<<case "German">>
		and, in keeping with $his heritage, a H&K VP70 machine pistol
	<<case "Hungarian">>
		and, in keeping with $his heritage, a FEG KGP-9 machine pistol
	<<case "Israeli">>
		and, in keeping with $his heritage, an IWI Uzi Pro machine pistol
	<<case "Italian">>
		and, in keeping with $his heritage, a Beretta 93R machine pistol
	<<case "Japanese">>
		and, in keeping with $his heritage, a Minebea PM-9 machine pistol
	<<case "Mexican">>
		and, in keeping with $his heritage, a Trejo Modelo 2 Especial machine pistol
	<<case "Peruvian">>
		and, in keeping with $his heritage, a SIMA MGP-87 machine pistol
	<<case "Polish">>
		and, in keeping with $his heritage, a WITU PMM machine pistol
	<<case "Romanian">>
		and, in keeping with $his heritage, a UMS Pistolul md.98 Dracula machine pistol
	<<case "Russian">>
		and, in keeping with $his heritage, a KBP OTs-33 Pernach machine pistol
	<<case "Swedish">>
		and, in keeping with $his heritage, a Saab Bofors Dynamics CBJ-MS machine pistol
	<<case "Swiss">>
		and, in keeping with $his heritage, a B+T MP9 machine pistol
	<<case "Turkish">>
		and, in keeping with $his heritage, a TiSAS Zigana F machine pistol
	<<default>>
		and a Glock 18 machine pistol
	<</switch>>
	at $his side.
<</if>>

<</widget>>

/*
<<widget "GenSkinTone">>

black 5
brown 4
dark 3
olive 2
light brown 1
natural 0
light -1
white -2
fair -3
pale -4
extremely pale -5

<<set _skin = 0>>
<<set _skin0 = 0>>
<<set _skin1 = 0>>

<<switch $args[0].skin>>
<<case "black">>
	<<set _skin0 = 10>>
<<case "brown">>
	<<set _skin0 = 9>>
<<case "dark">>
	<<set _skin0 = 8>>
<<case "olive">>
	<<set _skin0 = 7>>
<<case "light brown">>
	<<set _skin0 = 6>>
<<case "natural">>
	<<set _skin1 = 5>>
<<case "light">>
	<<set _skin0 = 4>>
<<case "white">>
	<<set _skin0 = 3>>
<<case "fair">>
	<<set _skin0 = 2>>
<<case "pale">>
	<<set _skin0 = 1>>
<<case "extremely pale">>
	<<set _skin0 = 0>>
<<default>>
	<<set _skin0 = 5>>
<</switch>>

<<switch $args[1].skin>>
<<case "black">>
	<<set _skin1 = 10>>
<<case "brown">>
	<<set _skin1 = 9>>
<<case "dark">>
	<<set _skin1 = 8>>
<<case "olive">>
	<<set _skin1 = 7>>
<<case "light brown">>
	<<set _skin1 = 6>>
<<case "natural">>
	<<set _skin1 = 5>>
<<case "light">>
	<<set _skin1 = 4>>
<<case "white">>
	<<set _skin1 = 3>>
<<case "fair">>
	<<set _skin1 = 2>>
<<case "pale">>
	<<set _skin1 = 1>>
<<case "extremely pale">>
	<<set _skin1 = 0>>
<<default>>
	<<set _skin1 = 5>>
<</switch>>

<<set _skin = Math.round((_skin1+_skin0)/2)>>

<<switch _skin>>
<<case 10>>
	<<set $activeSlave.skin = "black">>
<<case 9>>
	<<set $activeSlave.skin = "brown">>
<<case 8>>
	<<set $activeSlave.skin = "dark">>
<<case 7>>
	<<set $activeSlave.skin = "olive">>
<<case 6>>
	<<set $activeSlave.skin = "light brown">>
<<case 5>>
	<<set $activeSlave.skin = "natural">>
<<case 4>>
	<<set $activeSlave.skin = "light">>
<<case 3>>
	<<set $activeSlave.skin = "white">>
<<case 2>>
	<<set $activeSlave.skin = "fair">>
<<case 1>>
	<<set $activeSlave.skin = "pale">>
<<case 0>>
	<<set $activeSlave.skin = "extremely pale">>
<<default>>
	<<set $activeSlave.skin = either($args[0].skin, $args[1].skin)>>
<</switch>>

<</widget>>
*/

<<widget "GenSkinTone">>
<>
<</widget>>

<<widget "ParentNames">>
<<set _currentSlaveNames = $slaves.map(s => s.slaveName)>>
<<if $allowMaleSlaveNames>>
	<<set _sanityCheck = '>>', /* to appease sanityCheck */
		$args[1].slaveName = generateName($args[0].nationality, $args[1].race, $args[1].genes === "XY", sn => !_currentSlaveNames.includes(sn))>>
	<<if !$args[1].slaveName>>
		/* we ran out of names ... How? */
		<<set _maxTries = 10>>
		<<for _maxTries > 0 && !$args[1].slaveName>>
			<<set _continentNationality = hashChoice($nationalities)>>
			<<set _sanityCheck = '>>', /* to appease sanityCheck */
				$args[1].slaveName = generateName(_continentNationality, $args[1].race, $args[1].genes === "XY", sn => !_currentSlaveNames.includes(sn))>>
		<</for>>
	<</if>>
	<<if !$args[1].slaveName>>
		/* give up, duplicate name is fine I guess */
		<<set $args[1].slaveName = generateName($args[0].nationality, $args[1].race, $args[1].genes === "XY")>>
	<</if>>
<<else>>
	<<set _sanityCheck = '>>', /* to appease sanityCheck */
		$args[1].slaveName = generateName($args[0].nationality, $args[1].race, false, sn => !_currentSlaveNames.includes(sn))>>
	<<if !$args[1].slaveName>>
		/* we ran out of names ... How? */
		<<set _maxTries = 10>>
		<<for _maxTries > 0 && !$args[1].slaveName>>
			<<set _continentNationality = hashChoice($nationalities)>>
			<<set _sanityCheck = '>>', /* to appease sanityCheck */
				$args[1].slaveName = generateName(_continentNationality, $args[1].race, false, sn => !_currentSlaveNames.includes(sn))>>
		<</for>>
	<</if>>
	<<if !$args[1].slaveName>>
		/* give up, duplicate name is fine I guess */
		<<set $args[1].slaveName = generateName($args[0].nationality, $args[1].race, false)>>
	<</if>>
<</if>>
<<unset _currentSlaveNames, _maxTries, _continentNationality>>
<</widget>>

<<widget "NewChildName">>
<<set $args[0].birthName = generateName($args[0].nationality, $args[0].race, $args[0].genes === "XY")>>
<<if $args[0].genes === "XY" && !$allowMaleSlaveNames && isMaleName($args[0].birthName, $args[0].nationality, $args[0].race)>>
	/* grab a female name for the slave name instead */
	<<set $args[0].slaveName = generateName($args[0].nationality, $args[0].race, false)>>
<<else>>
	<<set $args[0].slaveName = $args[0].birthName>>
<</if>>
<</widget>>

<<widget "AgePCEffects">>
<<switch $PC.actualAge>>
<<case 3>>
	<<set $AgeTrainingLowerBoundPC = 18, $AgeTrainingUpperBoundPC = 20, $AgeEffectOnTrainerPricingPC = .1, $AgeEffectOnTrainerEffectivenessPC = .1>>
<<case 4>>
	<<set $AgeTrainingLowerBoundPC = 17, $AgeTrainingUpperBoundPC = 19, $AgeEffectOnTrainerPricingPC = .15, $AgeEffectOnTrainerEffectivenessPC = .15>>
<<case 5>>
	<<set $AgeTrainingLowerBoundPC = 16, $AgeTrainingUpperBoundPC = 18, $AgeEffectOnTrainerPricingPC = .35, $AgeEffectOnTrainerEffectivenessPC = .35>>
<<case 6>>
	<<set $AgeTrainingLowerBoundPC = 15, $AgeTrainingUpperBoundPC = 17, $AgeEffectOnTrainerPricingPC = .55, $AgeEffectOnTrainerEffectivenessPC = .55>>
<<case 7>>
	<<set $AgeTrainingLowerBoundPC = 14, $AgeTrainingUpperBoundPC = 16, $AgeEffectOnTrainerPricingPC = .75, $AgeEffectOnTrainerEffectivenessPC = .75>>
<<case 8>>
	<<set $AgeTrainingLowerBoundPC = 13, $AgeTrainingUpperBoundPC = 15, $AgeEffectOnTrainerPricingPC = .85, $AgeEffectOnTrainerEffectivenessPC = .85>>
<<case 9>>
	<<set $AgeTrainingLowerBoundPC = 12, $AgeTrainingUpperBoundPC = 14, $AgeEffectOnTrainerPricingPC = 1.00, $AgeEffectOnTrainerEffectivenessPC = 1.00>>
<<case 10>>
	<<set $AgeTrainingLowerBoundPC = 11, $AgeTrainingUpperBoundPC = 13, $AgeEffectOnTrainerPricingPC = 1.0005, $AgeEffectOnTrainerEffectivenessPC = 1.0005>>
<<case 11>>
	<<set $AgeTrainingLowerBoundPC = 10, $AgeTrainingUpperBoundPC = 12, $AgeEffectOnTrainerPricingPC = 1.01, $AgeEffectOnTrainerEffectivenessPC = 1.01>>
<<case 12>>
	<<set $AgeTrainingLowerBoundPC = 9, $AgeTrainingUpperBoundPC = 11, $AgeEffectOnTrainerPricingPC = 1.02, $AgeEffectOnTrainerEffectivenessPC = 1.02>>
<<case 13>>
	<<set $AgeTrainingLowerBoundPC = 8, $AgeTrainingUpperBoundPC = 10, $AgeEffectOnTrainerPricingPC = 1.03, $AgeEffectOnTrainerEffectivenessPC = 1.03>>
<<case 14>>
	<<set $AgeTrainingLowerBoundPC = 7, $AgeTrainingUpperBoundPC = 9, $AgeEffectOnTrainerPricingPC = 1.04, $AgeEffectOnTrainerEffectivenessPC = 1.04>>
<<case 15>>
	<<set $AgeTrainingLowerBoundPC = 6, $AgeTrainingUpperBoundPC = 8, $AgeEffectOnTrainerPricingPC = 1.05, $AgeEffectOnTrainerEffectivenessPC = 1.05>>
<<case 16>>
	<<set $AgeTrainingLowerBoundPC = 5, $AgeTrainingUpperBoundPC = 7, $AgeEffectOnTrainerPricingPC = 1.06, $AgeEffectOnTrainerEffectivenessPC = 1.06>>
<<case 17>>
	<<set $AgeTrainingLowerBoundPC = 4, $AgeTrainingUpperBoundPC = 6, $AgeEffectOnTrainerPricingPC = 1.07, $AgeEffectOnTrainerEffectivenessPC = 1.07>>
<<case 18>>
	<<set $AgeTrainingLowerBoundPC = 3, $AgeTrainingUpperBoundPC = 5, $AgeEffectOnTrainerPricingPC = 1.08, $AgeEffectOnTrainerEffectivenessPC = 1.08>>
<</switch>>
<</widget>>

<<widget "HeroSlavesCleanup">>
<<run $heroSlaves.forEach(function(s) {
	/* Nationalities, races, surnames random fill */
	if(!s.nationality) {
		/* Check for a pre-set race and if the nationality fits, else regenerate */
		if(s.race && setup.filterRacesLowercase.includes(s.race)) {
				raceToNationality(s);
		} else {
			s.nationality = hashChoice($nationalities);
		}
	}
	if(!s.race || !setup.filterRacesLowercase.includes(s.race)) {
		nationalityToRace(s);
	}
	if(!s.birthSurname && s.birthSurname !== "") {
		s.birthSurname = (setup.surnamePoolSelector[s.nationality + "." + s.race]
			|| setup.surnamePoolSelector[s.nationality]
			|| setup.whiteAmericanSlaveSurnames).random();
	}
	if(!s.birthName && s.birthName !== "") {
		s.birthName = (setup.namePoolSelector[s.nationality + "." + s.race]
			|| setup.namePoolSelector[s.nationality]
			|| setup.whiteAmericanSlaveNames).random();
	}
	generatePronouns(s);
	if(s.geneMods == undefined) {
		s.geneMods = {NCS: 0, rapidCellGrowth: 0};
	} else {
		if(s.geneMods.NCS == undefined) {
			s.geneMods.NCS = 0;
		}
		if(s.geneMods.rapidCellGrowth == undefined) {
			s.geneMods.rapidCellGrowth = 0;
		}
	}
	/*WombInit(s);*/
})>>
<</widget>>

license: mit


code:
:: slave trade preset widgets [widget nobr]

/* To add presets, add <<widget "NationalityPresetName">> and define it as [[Name|passage()][$nationalities = [nationalities go here]]] (old method)*/
/* Presets are weighted according to the number of times the player has incremented that nationality. */

<<widget "NationalityPresetVanillaGlobal">>
<<link "Vanilla Global">>
	<<set $nationalities = {
		Afghan: 2,
		Albanian: 1,
		Algerian: 3,
		American: 6,
		Andorran: 1,
		Angolan: 1,
		Antiguan: 1,
		Argentinian: 4,
		Armenian: 2,
		Aruban: 1,
		Australian: 3,
		Austrian: 2,
		Azerbaijani: 1,
		Bahamian: 1,
		Bahraini: 1,
		Bangladeshi: 4,
		Barbadian: 1,
		Belarusian: 1,
		Belgian: 2,
		Belizean: 1,
		Beninese: 1,
		Bermudian: 1,
		Bhutanese: 1,
		"Bissau-Guinean": 1,
		Bolivian: 2,
		Bosnian: 1,
		Brazilian: 4,
		British: 3,
		Bruneian: 1,
		Bulgarian: 2,
		Burkinabé: 1,
		Burmese: 2,
		Burundian: 1,
		Cambodian: 1,
		Cameroonian: 1,
		Canadian: 2,
		"Cape Verdean": 1,
		Catalan: 1,
		"Central African": 1,
		Chadian: 1,
		Chilean: 2,
		Chinese: 15,
		Colombian: 3,
		Comorian: 1,
		Congolese: 1,
		"a Cook Islander": 1,
		"Costa Rican": 1,
		Croatian: 1,
		Cuban: 2,
		Curaçaoan: 1,
		Cypriot: 1,
		Czech: 2,
		Danish: 2,
		Djiboutian: 1,
		Dominican: 2,
		Dominiquais: 1,
		Dutch: 2,
		"East Timorese": 1,
		Ecuadorian: 1,
		Egyptian: 3,
		Emirati: 2,
		Equatoguinean: 1,
		Eritrean: 1,
		Estonian: 2,
		Ethiopian: 3,
		Fijian: 1,
		Filipina: 3,
		Finnish: 2,
		French: 3,
		"French Guianan": 1,
		"French Polynesian": 1,
		Gabonese: 1,
		Gambian: 1,
		Georgian: 1,
		German: 3,
		Ghanan: 2,
		Greek: 2,
		Greenlandic: 1,
		Grenadian: 1,
		Guamanian: 1,
		Guatemalan: 1,
		Guinean: 1,
		Guyanese: 1,
		Haitian: 2,
		Honduran: 1,
		Hungarian: 2,
		"I-Kiribati": 1,
		Icelandic: 2,
		Indian: 11,
		Indonesian: 5,
		Iranian: 3,
		Iraqi: 2,
		Irish: 2,
		Israeli: 2,
		Italian: 3,
		Ivorian: 1,
		Jamaican: 2,
		Japanese: 3,
		Jordanian: 2,
		Kazakh: 2,
		Kenyan: 3,
		Kittitian: 1,
		Korean: 2,
		Kosovan: 1,
		Kurdish: 1,
		Kuwaiti: 1,
		Kyrgyz: 1,
		Laotian: 1,
		Latvian: 1,
		Lebanese: 2,
		Liberian: 1,
		Libyan: 2,
		"a Liechtensteiner": 1,
		Lithuanian: 2,
		Luxembourgian: 1,
		Macedonian: 1,
		Malagasy: 1,
		Malawian: 1,
		Malaysian: 3,
		Maldivian: 1,
		Malian: 2,
		Maltese: 1,
		Marshallese: 1,
		Mauritanian: 1,
		Mauritian: 1,
		Mexican: 4,
		Micronesian: 1,
		Moldovan: 1,
		Monégasque: 1,
		Mongolian: 1,
		Montenegrin: 1,
		Moroccan: 2,
		Mosotho: 1,
		Motswana: 1,
		Mozambican: 1,
		Namibian: 1,
		Nauruan: 1,
		Nepalese: 2,
		"New Caledonian": 1,
		"a New Zealander": 2,
		"Ni-Vanuatu": 1,
		Nicaraguan: 2,
		Nigerian: 4,
		Nigerien: 2,
		Niuean: 1,
		Norwegian: 2,
		Omani: 2,
		Pakistani: 3,
		Palauan: 1,
		Palestinian: 1,
		Panamanian: 1,
		"Papua New Guinean": 1,
		Paraguayan: 1,
		Peruvian: 2,
		Polish: 3,
		Portuguese: 2,
		"Puerto Rican": 1,
		Qatari: 1,
		Romanian: 2,
		Russian: 4,
		Rwandan: 1,
		Sahrawi: 1,
		"Saint Lucian": 1,
		Salvadoran: 2,
		Sammarinese: 1,
		Samoan: 1,
		"São Toméan": 1,
		Saudi: 2,
		Scottish: 1,
		Senegalese: 1,
		Serbian: 2,
		Seychellois: 1,
		"Sierra Leonean": 1,
		Singaporean: 1,
		Slovak: 2,
		Slovene: 1,
		"a Solomon Islander": 1,
		Somali: 1,
		"South African": 4,
		"South Sudanese": 1,
		Spanish: 3,
		"Sri Lankan": 1,
		Sudanese: 3,
		Surinamese: 1,
		Swazi: 1,
		Swedish: 2,
		Swiss: 2,
		Syrian: 1,
		Taiwanese: 1,
		Tajik: 1,
		Tanzanian: 2,
		Thai: 3,
		Tibetan: 1,
		Togolese: 1,
		Tongan: 1,
		Trinidadian: 1,
		Tunisian: 2,
		Turkish: 3,
		Turkmen: 1,
		Tuvaluan: 1,
		Ugandan: 2,
		Ukrainian: 3,
		Uruguayan: 2,
		Uzbek: 2,
		Vatican: 1,
		Venezuelan: 3,
		Vietnamese: 3,
		Vincentian: 1,
		Yemeni: 2,
		Zairian: 3,
		Zambian: 1,
		Zimbabwean: 2
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaNA">>
<<link "Vanilla North America">>
	<<set $nationalities = {
		American: 6,
		Antiguan: 1,
		Aruban: 1,
		Bahamian: 1,
		Barbadian: 1,
		Belizean: 1,
		Bermudian: 1,
		Canadian: 2,
		"Costa Rican": 1,
		Cuban: 2,
		Curaçaoan: 1,
		Dominican: 2,
		Dominiquais: 1,
		Greenlandic: 1,
		Grenadian: 1,
		Guatemalan: 1,
		Haitian: 2,
		Honduran: 1,
		Jamaican: 2,
		Kittitian: 1,
		Mexican: 4,
		Nicaraguan: 2,
		Panamanian: 1,
		"Puerto Rican": 1,
		"Saint Lucian": 1,
		Salvadoran: 2,
		Trinidadian: 1,
		Vincentian: 1
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaSA">>
<<link "Vanilla South America">>
	<<set $nationalities = {
		Argentinian: 4,
		Bolivian: 2,
		Brazilian: 4,
		Chilean: 2,
		Colombian: 3,
		Ecuadorian: 1,
		"French Guianan": 1,
		Guyanese: 1,
		Paraguayan: 1,
		Peruvian: 2,
		Surinamese: 1,
		Uruguayan: 2,
		Venezuelan: 3
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaME">>
<<link "Vanilla Middle East">>
	<<set $nationalities = {
		Afghan: 2,
		Armenian: 2,
		Azerbaijani: 1,
		Bahraini: 1,
		Cypriot: 1,
		Egyptian: 3,
		Emirati: 2,
		Georgian: 1,
		Iranian: 3,
		Iraqi: 2,
		Israeli: 2,
		Jordanian: 2,
		Kurdish: 1,
		Kuwaiti: 1,
		Lebanese: 2,
		Omani: 2,
		Palestinian: 1,
		Qatari: 1,
		Saudi: 2,
		Syrian: 1,
		Turkish: 3,
		Yemeni: 2
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaAfrica">>
<<link "Vanilla Africa">>
	<<set $nationalities = {
		Algerian: 3,
		Angolan: 1,
		Beninese: 1,
		"Bissau-Guinean": 1,
		Burkinabé: 1,
		Burundian: 1,
		Cameroonian: 1,
		"Cape Verdean": 1,
		"Central African": 1,
		Chadian: 1,
		Comorian: 1,
		Congolese: 1,
		Djiboutian: 1,
		Equatoguinean: 1,
		Eritrean: 1,
		Ethiopian: 3,
		Gabonese: 1,
		Gambian: 1,
		Ghanan: 2,
		Guinean: 1,
		Ivorian: 1,
		Kenyan: 3,
		Liberian: 1,
		Libyan: 2,
		Malagasy: 1,
		Malawian: 1,
		Malian: 2,
		Mauritanian: 1,
		Mauritian: 1,
		Moroccan: 2,
		Mosotho: 1,
		Motswana: 1,
		Mozambican: 1,
		Namibian: 1,
		Nigerian: 4,
		Nigerien: 2,
		Rwandan: 1,
		Sahrawi: 1,
		"São Toméan": 1,
		Senegalese: 1,
		Seychellois: 1,
		"Sierra Leonean": 1,
		Somali: 1,
		"South African": 4,
		"South Sudanese": 1,
		Sudanese: 3,
		Swazi: 1,
		Tanzanian: 2,
		Togolese: 1,
		Tunisian: 2,
		Ugandan: 2,
		Zairian: 3,
		Zambian: 1,
		Zimbabwean: 2
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaAsia">>
<<link "Vanilla Asia">>
	<<set $nationalities = {
		Bangladeshi: 4,
		Bhutanese: 1,
		Bruneian: 1,
		Burmese: 2,
		Cambodian: 1,
		Chinese: 15,
		"East Timorese": 1,
		Filipina: 3,
		Indian: 11,
		Indonesian: 5,
		Japanese: 3,
		Kazakh: 2,
		Korean: 2,
		Kyrgyz: 1,
		Laotian: 1,
		Malaysian: 3,
		Maldivian: 1,
		Mongolian: 1,
		Nepalese: 2,
		Pakistani: 3,
		Singaporean: 1,
		"Sri Lankan": 1,
		Taiwanese: 1,
		Tajik: 1,
		Thai: 3,
		Tibetan: 1,
		Turkmen: 1,
		Uzbek: 2,
		Vietnamese: 3
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaEU">>
<<link "Vanilla Europe">>
	<<set $nationalities = {
		Albanian: 1,
		Andorran: 1,
		Austrian: 2,
		Belarusian: 1,
		Belgian: 2,
		Bosnian: 1,
		British: 3,
		Bulgarian: 2,
		Catalan: 1,
		Croatian: 1,
		Czech: 2,
		Danish: 2,
		Dutch: 2,
		Estonian: 2,
		Finnish: 2,
		French: 3,
		German: 3,
		Greek: 2,
		Hungarian: 2,
		Icelandic: 2,
		Irish: 2,
		Italian: 3,
		Kosovan: 1,
		Latvian: 1,
		"a Liechtensteiner": 1,
		Lithuanian: 2,
		Luxembourgian: 1,
		Macedonian: 1,
		Maltese: 1,
		Moldovan: 1,
		Monégasque: 1,
		Montenegrin: 1,
		Norwegian: 2,
		Polish: 3,
		Portuguese: 2,
		Romanian: 2,
		Russian: 4,
		Sammarinese: 1,
		Scottish: 1,
		Serbian: 2,
		Slovak: 2,
		Slovene: 1,
		Spanish: 3,
		Swedish: 2,
		Swiss: 2,
		Ukrainian: 3,
		Vatican: 1
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetVanillaAU">>
<<link "Vanilla Australia">>
	<<set $nationalities = {
		Australian: 3,
		"a Cook Islander": 1,
		Fijian: 1,
		"French Polynesian": 1,
		Guamanian: 1,
		"I-Kiribati": 1,
		Marshallese: 1,
		Micronesian: 1,
		Nauruan: 1,
		"New Caledonian": 1,
		"a New Zealander": 2,
		"Ni-Vanuatu": 1,
		Niuean: 1,
		Palauan: 1,
		"Papua New Guinean": 1,
		Samoan: 1,
		"a Solomon Islander": 1,
		Tongan: 1,
		Tuvaluan: 1
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModNA">>
<<link "Realism North America">>
	<<set $nationalities = {
		American: 36503,
		Antiguan: 11,
		Aruban: 10,
		Bahamian: 45,
		Barbadian: 28,
		Belizean: 50,
		Bermudian: 5,
		Canadian: 4188,
		"Costa Rican": 555,
		Cuban: 1141,
		Curaçaoan: 17,
		Dominican: 1249,
		Dominiquais: 7,
		Greenlandic: 5,
		Grenadian: 11,
		Guatemalan: 2277,
		Haitian: 1303,
		Honduran: 1177,
		Jamaican: 290,
		Kittitian: 6,
		Mexican: 15306,
		Nicaraguan: 731,
		Panamanian: 515,
		"Puerto Rican": 354,
		"Saint Lucian": 18,
		Salvadoran: 688,
		Trinidadian: 136,
		Vincentian: 11
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModSA">>
<<link "Realism South America">>
	<<set $nationalities = {
		Argentinian: 5102,
		Bolivian: 1392,
		Brazilian: 22920,
		Chilean: 2005,
		Colombian: 5105,
		Ecuadorian: 2055,
		"French Guianan": 41,
		Guyanese: 83,
		Paraguayan: 817,
		Peruvian: 3829,
		Surinamese: 63,
		Uruguayan: 362,
		Venezuelan: 3826
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModME">>
<<link "Realism Middle East">>
	<<set $nationalities = {
		Afghan: 5090,
		Armenian: 286,
		Azerbaijani: 1086,
		Bahraini: 212,
		Cypriot: 131,
		Egyptian: 12826,
		Emirati: 1164,
		Georgian: 366,
		Iranian: 9047,
		Iraqi: 5982,
		Israeli: 1062,
		Jordanian: 1184,
		Kurdish: 7258,
		Kuwaiti: 511,
		Lebanese: 533,
		Omani: 612,
		Palestinian: 746,
		Qatari: 340,
		Saudi: 4131,
		Syrian: 2888,
		Turkish: 9091,
		Yemeni: 3996
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModAfrica">>
<<link "Realism Africa">>
	<<set $nationalities = {
		Algerian: 5107,
		Angolan: 5166,
		Beninese: 1756,
		"Bissau-Guinean": 275,
		Burkinabé: 3105,
		Burundian: 1797,
		Cameroonian: 3688,
		"Cape Verdean": 66,
		"Central African": 679,
		Chadian: 2431,
		Comorian: 116,
		Congolese: 827,
		Djiboutian: 118,
		Equatoguinean: 210,
		Eritrean: 742,
		Ethiopian: 15303,
		Gabonese: 282,
		Gambian: 338,
		Ghanan: 4071,
		Guinean: 1978,
		Ivorian: 3741,
		Kenyan: 7408,
		Liberian: 727,
		Libyan: 760,
		Malagasy: 3989,
		Malawian: 3010,
		Malian: 3098,
		Mauritanian: 676,
		Mauritian: 128,
		Moroccan: 4240,
		Mosotho: 275,
		Motswana: 297,
		Mozambican: 4824,
		Namibian: 352,
		Nigerian: 29732,
		Nigerien: 4187,
		Rwandan: 1754,
		Sahrawi: 80,
		"São Toméan": 29,
		Senegalese: 2486,
		Seychellois: 9,
		"Sierra Leonean": 1056,
		Somali: 2469,
		"South African": 6688,
		"South Sudanese": 1918,
		Sudanese: 6099,
		Swazi: 177,
		Tanzanian: 9586,
		Togolese: 1166,
		Tunisian: 1316,
		Ugandan: 7338,
		Zairian: 13815,
		Zambian: 2844,
		Zimbabwean: 2355
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModAsia">>
<<link "Realism Asia">>
	<<set $nationalities = {
		Bangladeshi: 19160,
		Bhutanese: 94,
		Bruneian: 50,
		Burmese: 6043,
		Cambodian: 1972,
		Chinese: 143350,
		"East Timorese": 187,
		Filipina: 13266,
		Indian: 156457,
		Indonesian: 30475,
		Japanese: 11849,
		Kazakh: 2095,
		Korean: 7977,
		Kyrgyz: 730,
		Laotian: 841,
		Malaysian: 3838,
		Maldivian: 52,
		Mongolian: 369,
		Nepalese: 3456,
		Pakistani: 26109,
		Singaporean: 647,
		"Sri Lankan": 2149,
		Taiwanese: 2410,
		Tajik: 1202,
		Thai: 6919,
		Tibetan: 435,
		Turkmen: 707,
		Uzbek: 3805,
		Vietnamese: 3255
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

/* I need reweighting and possibly country additions */
<<widget "NationalityPresetModEurope">>
<<link "Realism Europe">>
	<<set $nationalities = {
		Albanian: 289,
		Andorran: 7,
		Austrian: 897,
		Belarusian: 899,
		Belgian: 1215,
		Bosnian: 333,
		British: 7189,
		Bulgarian: 615,
		Catalan: 767,
		Croatian: 379,
		Czech: 1039,
		Danish: 611,
		Dutch: 1769,
		Estonian: 122,
		Finnish: 578,
		French: 6886,
		German: 8173,
		Greek: 1062,
		Hungarian: 900,
		Icelandic: 37,
		Irish: 537,
		Italian: 5753,
		Kosovan: 193,
		Latvian: 168,
		"a Liechtensteiner": 4,
		Lithuanian: 263,
		Luxembourgian: 70,
		Macedonian: 205,
		Maltese: 43,
		Moldovan: 372,
		Monégasque: 4,
		Montenegrin: 61,
		Norwegian: 619,
		Polish: 3569,
		Portuguese: 969,
		Romanian: 1797,
		Russian: 13807,
		Sammarinese: 3,
		Scottish: 575,
		Serbian: 814,
		Slovak: 530,
		Slovene: 203,
		Spanish: 4586,
		Swedish: 1094,
		Swiss: 941,
		Ukrainian: 3989,
		Vatican: 1
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModAustralia">>
<<link "Realism Australia">>
	<<set $nationalities = {
		Australian: 2952,
		"a Cook Islander": 1,
		Fijian: 98,
		"French Polynesian": 31,
		Guamanian: 18,
		"I-Kiribati": 15,
		Marshallese: 5,
		Micronesian: 12,
		Nauruan: 1,
		"New Caledonian": 33,
		"a New Zealander": 536,
		"Ni-Vanuatu": 38,
		Niuean: 1,
		Palauan: 2,
		"Papua New Guinean": 1136,
		Samoan: 22,
		"a Solomon Islander": 83,
		Tongan: 12,
		Tuvaluan: 1
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModEastAsia">>
<<link "East Asia">>
	<<set $nationalities = {Chinese: 21, Japanese: 2, Korean: 1}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModUSA">>
<<link USA>>
	<<set $nationalities = {American: 8, Canadian: 1, Mexican: 3}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModJapan">>
<<link Japan>>
	<<set $nationalities = {Japanese: 3}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModBrazil">>
<<link Brazil>>
	<<set $nationalities = {
		Argentinian: 4,
		Bolivian: 2,
		Brazilian: 30,
		Chilean: 2,
		Colombian: 3,
		Ecuadorian: 1,
		"French Guianan": 1,
		Guyanese: 1,
		Paraguayan: 1,
		Peruvian: 2,
		Surinamese: 1,
		Uruguayan: 2,
		Venezuelan: 2
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

/* I need reweighting */
<<widget "NationalityPresetModGlobalRealism">>
<<link "Realism Global">>
	<<set $nationalities = {
		Afghan: 5090,
		Albanian: 289,
		Algerian: 5107,
		American: 36503,
		Andorran: 7,
		Angolan: 5166,
		Antiguan: 11,
		Argentinian: 5102,
		Armenian: 286,
		Aruban: 10,
		Australian: 2952,
		Austrian: 897,
		Azerbaijani: 1086,
		Bahamian: 45,
		Bahraini: 212,
		Bangladeshi: 19160,
		Barbadian: 28,
		Belarusian: 899,
		Belgian: 1215,
		Belizean: 50,
		Beninese: 1756,
		Bermudian: 5,
		Bhutanese: 94,
		"Bissau-Guinean": 275,
		Bolivian: 1392,
		Bosnian: 333,
		Brazilian: 22920,
		British: 7189,
		Bruneian: 50,
		Bulgarian: 615,
		Burkinabé: 3105,
		Burmese: 6043,
		Burundian: 1797,
		Cambodian: 1972,
		Cameroonian: 3688,
		Canadian: 4188,
		"Cape Verdean": 66,
		Catalan: 767,
		"Central African": 679,
		Chadian: 2431,
		Chilean: 2005,
		Chinese: 143350,
		Colombian: 5405,
		Comorian: 116,
		Congolese: 827,
		"a Cook Islander": 1,
		"Costa Rican": 555,
		Croatian: 379,
		Cuban: 1141,
		Curaçaoan: 17,
		Cypriot: 131,
		Czech: 1039,
		Danish: 611,
		Djiboutian: 118,
		Dominican: 1249,
		Dominiquais: 7,
		Dutch: 1769,
		"East Timorese": 187,
		Ecuadorian: 2055,
		Egyptian: 12826,
		Emirati: 1164,
		Equatoguinean: 210,
		Eritrean: 742,
		Estonian: 122,
		Ethiopian: 15303,
		Fijian: 98,
		Filipina: 13266,
		Finnish: 578,
		French: 6886,
		"French Guianan": 41,
		"French Polynesian": 31,
		Gabonese: 282,
		Gambian: 338,
		Georgian: 366,
		German: 8173,
		Ghanan: 4071,
		Greek: 1062,
		Greenlandic: 5,
		Grenadian: 11,
		Guamanian: 18,
		Guatemalan: 2277,
		Guinean: 1978,
		Guyanese: 83,
		Haitian: 1303,
		Honduran: 1177,
		Hungarian: 900,
		"I-Kiribati": 15,
		Icelandic: 37,
		Indian: 156457,
		Indonesian: 30475,
		Iranian: 9047,
		Iraqi: 5982,
		Irish: 537,
		Israeli: 1062,
		Italian: 5753,
		Ivorian: 3741,
		Jamaican: 290,
		Japanese: 11849,
		Jordanian: 1184,
		Kazakh: 2095,
		Kenyan: 7408,
		Kittitian: 6,
		Korean: 7977,
		Kosovan: 193,
		Kurdish: 7258,
		Kuwaiti: 511,
		Kyrgyz: 730,
		Laotian: 841,
		Latvian: 168,
		Lebanese: 533,
		Liberian: 727,
		Libyan: 760,
		"a Liechtensteiner": 4,
		Lithuanian: 263,
		Luxembourgian: 70,
		Macedonian: 205,
		Malagasy: 3989,
		Malawian: 3010,
		Malaysian: 3838,
		Maldivian: 52,
		Malian: 3098,
		Maltese: 43,
		Marshallese: 5,
		Mauritanian: 676,
		Mauritian: 128,
		Mexican: 15306,
		Micronesian: 12,
		Moldovan: 372,
		Monégasque: 4,
		Mongolian: 369,
		Montenegrin: 61,
		Moroccan: 4240,
		Mosotho: 275,
		Motswana: 297,
		Mozambican: 4824,
		Namibian: 352,
		Nauruan: 1,
		Nepalese: 3456,
		"New Caledonian": 33,
		"a New Zealander": 536,
		"Ni-Vanuatu": 38,
		Nicaraguan: 731,
		Nigerian: 29732,
		Nigerien: 4187,
		Niuean: 1,
		Norwegian: 619,
		Omani: 612,
		Pakistani: 26109,
		Palauan: 2,
		Palestinian: 746,
		Panamanian: 515,
		"Papua New Guinean": 1136,
		Paraguayan: 817,
		Peruvian: 3829,
		Polish: 3569,
		Portuguese: 969,
		"Puerto Rican": 354,
		Qatari: 340,
		Romanian: 1797,
		Russian: 13807,
		Rwandan: 1754,
		Sahrawi: 80,
		"Saint Lucian": 18,
		Salvadoran: 688,
		Sammarinese: 3,
		Samoan: 22,
		"São Toméan": 29,
		Saudi: 4131,
		Scottish: 575,
		Senegalese: 2486,
		Serbian: 814,
		Seychellois: 9,
		"Sierra Leonean": 1056,
		Singaporean: 647,
		Slovak: 530,
		Slovene: 203,
		"a Solomon Islander": 83,
		Somali: 2469,
		"South African": 6688,
		"South Sudanese": 1918,
		Spanish: 4586,
		"Sri Lankan": 2149,
		Sudanese: 6099,
		Surinamese: 63,
		Swazi: 177,
		Swedish: 1094,
		Swiss: 941,
		Syrian: 2888,
		Taiwanese: 2410,
		Tajik: 1202,
		Tanzanian: 9586,
		Thai: 6919,
		Tibetan: 435,
		Togolese: 1166,
		Tongan: 12,
		Trinidadian: 136,
		Tunisian: 1316,
		Turkish: 9091,
		Turkmen: 707,
		Tuvaluan: 1,
		Ugandan: 7338,
		Ukrainian: 3989,
		Uruguayan: 362,
		Uzbek: 3805,
		Vatican: 1,
		Venezuelan: 3826,
		Vietnamese: 10898,
		Vincentian: 11,
		Yemeni: 3996,
		Zairian: 13815,
		Zambian: 2844,
		Zimbabwean: 2355
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>

<<widget "NationalityPresetModMediterranean">>
<<link Mediterranean>>
	<<set $nationalities = {
		Albanian: 29,
		Algerian: 404,
		Andorran: 1,
		Bosnian: 35,
		British: 1,
		Bulgarian: 71,
		Catalan: 75,
		Croatian: 42,
		Cypriot: 12,
		Egyptian: 948,
		French: 671,
		Georgian: 49,
		Greek: 108,
		Israeli: 89,
		Italian: 605,
		Lebanese: 60,
		Libyan: 63,
		Maltese: 5,
		Monégasque: 1,
		Montenegrin: 7,
		Moroccan: 358,
		Palestinian: 18,
		Portuguese: 102,
		Romanian: 132,
		Russian: 40,
		Sammarinese: 1,
		Slovene: 21,
		Spanish: 466,
		Syrian: 171,
		Tunisian: 113,
		Turkish: 808,
		Ukrainian: 105,
		Vatican: 1,
		}>>
	<<set _gotoPassage = passage()>>
	<<goto _gotoPassage>>
<</link>>
<</widget>>


code:
all .tw passages that are included from other passages via the <<include>> macro should be stored in this folder or its subfolders for organizational purposes

for these included passages, it is not safe to assume that a temporary variable (starting with underscore _ character) will be confined in scope to that file alone

when passages are included by other passages, any variables that they set will override variables in the calling passage, so extra care should be taken in these passages if they use $i, _i, _j or other common variable names to ensure that callers are not expecting those variables to be unchanged after the include

all sa... passages

arcologyDescription
neighborDescription
officeDescription

surgeryDegradation

weekly

	persBusiness
	rulesAssistantReport

penthouse

	fullReport
	penthouseReport

neighbors

	neighborsDevelopment
	neighborsFSAdoption

facilities

	arcadeReport
	brothelReport
	cellblockReport
	clinicReport
	clubReport
	dairyReport
	labReport
	masterSuiteReport
	schoolroomReport
	servantsQuartersReport
	spaReport
	nurseryReport

economics

	corporationDevelopments
	marketsReport

npc

	hgApplication
	lawCompliance
	longSlaveDescription
	newSlaveIntro

init

	initRules
	BackwardsCompatibility