code:
:: assay widgets [widget nobr]

<<widget "Beauty">>

<<modScore $args[0]>>

<<set $beauty = 0>>

<<if $args[0].fuckdoll == 0>> /* NOT A FUCKDOLL */

<<set $beauty += 150 - ($args[0].visualAge*3) + (Math.min($args[0].health,100)/5) - ($args[0].waist/20) - ($args[0].muscles/30) +($args[0].lips/10) + ($args[0].face/5) + ($args[0].clit) + (($args[0].height-160)/10) + ($args[0].voice) + (3*$args[0].intelligence) + ($args[0].entertainSkill/10) + ($args[0].whoreSkill/10) + (2*$args[0].hips)>>

<<if $arcologies[0].FSDegradationist != "unset">>
	<<set $beauty -= ($arcologies[0].FSDegradationist/10)*$args[0].intelligence>>
<</if>>

<<if $arcologies[0].FSGenderFundamentalistLawBimbo == 1>>
	<<set $beauty -= 6*$args[0].intelligence>>
<</if>>

<<if $args[0].teeth == "crooked">>
	<<set $beauty -= 3>>
<<elseif ($args[0].teeth == "braces" || $args[0].teeth == "cosmetic braces") && ($args[0].visualAge > 14) && ($args[0].visualAge < 18)>>
	<<set $beauty += 1>>
<<elseif $args[0].teeth != "normal">>
	<<set $beauty -= 1>>
<</if>>

<<if $args[0].faceShape == "masculine">>
	<<if ($arcologies[0].FSGenderRadicalist != "unset")>>
	<<set $beauty -= (2-($arcologies[0].FSGenderRadicalist/25))*($args[0].face/30)>>
	<<elseif ($arcologies[0].FSGenderFundamentalist != "unset")>>
	<<set $beauty -= (2+($arcologies[0].FSGenderFundamentalist/25))*($args[0].face/30)>>
	<<else>>
	<<set $beauty -= 2*($args[0].face/30)>>
	<</if>>
<<elseif $args[0].faceShape == "androgynous">>
	<<if ($arcologies[0].FSGenderRadicalist != "unset")>>
	<<set $beauty += 2-((1-($arcologies[0].FSGenderRadicalist/25))*($args[0].face/30))>>
	<<elseif ($arcologies[0].FSGenderFundamentalist != "unset")>>
	<<set $beauty += 2-((1+($arcologies[0].FSGenderFundamentalist/25))*($args[0].face/30))>>
	<<else>>
	<<set $beauty += 2-($args[0].face/30)>>
	<</if>>
<<elseif $args[0].faceShape == "exotic">>
	<<set $beauty += 2*($args[0].face/30)>>
<<elseif $args[0].faceShape == "sensual">>
	<<set $beauty += 2+($args[0].face/30)>>
<<elseif $args[0].faceShape == "cute">>
	<<set $beauty += 8/3>>
<</if>>

<<if $args[0].brand != 0>>
	<<if $rep > 10000>>
	<<set $beauty += 1>>
	<<elseif $rep < 5000>>
	<<set $beauty -= 1>>
	<</if>>
<</if>>

<<if $args[0].minorInjury != 0>>
	<<set $beauty -= 2>>
<</if>>

<<if $args[0].cSec == 1>>
	<<set $beauty -= 2>>
<</if>>

<<if $args[0].nails > 0>><<set $beauty += 1>><</if>>
<<if $args[0].makeup > 0>><<set $beauty += 1>><</if>>

<<if ($arcologies[0].FSTransformationFetishist > 20) || ($arcologies[0].FSDegradationist > 20)>>
	<<if $modScore > 15 || ($piercingScore > 8 && $tatScore > 5)>>
	<<set $beauty += 8+($modScore*0.25)>>
	<<elseif $modScore > 7>>
	<<set $beauty += $modScore-7>>
	<</if>>
<<elseif ($arcologies[0].FSBodyPurist > 20) || ($arcologies[0].FSPaternalist > 20)>>
	<<if $modScore <= 7>>
	<<set $beauty += 10>>
	<<else>>
	<<set $beauty += 15-$modScore>>
	<</if>>
<<else>>
	<<if $modScore <= 7>>
	<<set $beauty += $modScore>>
	<<elseif $modScore > 15 || ($piercingScore > 8 && $tatScore > 5)>>
	<<set $beauty += 11>>
	<<else>>
	<<set $beauty += 7+(0.5*($modScore-7))>>
	<</if>>
<</if>>

<<if $arcologies[0].FSSupremacist != "unset">>
	<<if $args[0].race == $arcologies[0].FSSupremacistRace>>
		<<set $beauty += ($arcologies[0].FSSupremacist/3)+($arcologies[0].FSSupremacistLawME*10)>>
	<</if>>
<</if>>
<<if $arcologies[0].FSSubjugationist != "unset">>
	<<if $args[0].race == $arcologies[0].FSSubjugationistRace>>
		<<set $beauty -= ($arcologies[0].FSSubjugationist/2)-($arcologies[0].FSSubjugationistLawME*10)>>
	<</if>>
<</if>>
<<if $arcologies[0].FSEdoRevivalist != "unset">>
<<if ($args[0].nationality == "Japanese") || ($args[0].nationality == "Edo Revivalist")>>
	<<set $beauty += ($arcologies[0].FSEdoRevivalist/2)>>
<<elseif $args[0].race == "asian" || $args[0].race == "surgically altered to look asian">>
	<<set $beauty += ($arcologies[0].FSEdoRevivalist/5)>>
<<else>>
	<<set $beauty -= ($arcologies[0].FSEdoRevivalist/4)>>
<</if>>
<<if $language == "Japanese" && canTalk($args[0])>>
	<<if $args[0].accent > 1>>
		<<set $beauty -= ($arcologies[0].FSEdoRevivalist/2)>>
	<<elseif $args[0].accent > 0>>
		<<set $beauty -= ($arcologies[0].FSEdoRevivalist/5)>>
	<<else>>
		<<set $beauty += ($arcologies[0].FSEdoRevivalist/10)>>
	<</if>>
<</if>>
<</if>>
<<if $arcologies[0].FSChineseRevivalist != "unset">>
<<if ($args[0].nationality == "Chinese") || ($args[0].nationality == "Ancient Chinese Revivalist")>>
	<<set $beauty += ($arcologies[0].FSChineseRevivalist/2)>>
<<elseif $args[0].race == "asian" || $args[0].race == "surgically altered to look asian">>
	<<set $beauty += ($arcologies[0].FSChineseRevivalist/5)>>
<<else>>
	<<set $beauty -= ($arcologies[0].FSChineseRevivalist/4)>>
<</if>>
<<if $language == "Chinese" && canTalk($args[0])>>
	<<if $args[0].accent > 1>>
		<<set $beauty -= ($arcologies[0].FSChineseRevivalist/2)>>
	<<elseif $args[0].accent > 0>>
		<<set $beauty -= ($arcologies[0].FSChineseRevivalist/5)>>
	<<else>>
		<<set $beauty += ($arcologies[0].FSChineseRevivalist/10)>>
	<</if>>
<</if>>
<</if>>

<<if $args[0].race == "white">>
	<<set $beauty += 4>>
<<elseif $args[0].race == "surgically altered to look white">>
	<<set $beauty += 2>>
<</if>>

<<if $arcologies[0].FSYouthPreferentialist != "unset">>
	<<set $beauty += (30-$args[0].visualAge)/(30-$minimumSlaveAge)*(($arcologies[0].FSYouthPreferentialist/2)+($arcologies[0].FSYouthPreferentialistLaw*10))>> /*60*/
<<elseif $arcologies[0].FSMaturityPreferentialist != "unset">>
	<<set $beauty += (30-$args[0].visualAge)/(30-$retirementAge)*(($arcologies[0].FSMaturityPreferentialist/2)+($arcologies[0].FSMaturityPreferentialistLaw*10))>> /*60*/
<</if>>

<<if ($args[0].markings != "none")>>
	<<if ($args[0].markings == "beauty mark")>>
	<<if ($args[0].face > 40)>>
		<<set $beauty += 6>>
	<<elseif ($args[0].face < -10)>>
		<<set $beauty -= 6>>
	<</if>>
	<<elseif ($args[0].markings == "birthmark")>>
	<<if ($args[0].prestige > 0)>>
		<<set $beauty += 4>>
	<<else>>
		<<set $beauty -= 4>>
	<</if>>
	<<else>>
	<<if ($args[0].skin == "pale") || ($args[0].skin == "fair")>>
		<<set $beauty += 2>>
		<<if ($args[0].hColor == "red")>>
		<<set $beauty += 2>>
		<</if>>
	<</if>>
	<</if>>
<</if>>

<<if setup.entertainmentCareers.includes($args[0].career)>>
	<<set $beauty += 20>>
<<elseif ($week-$args[0].weekAcquired >= 20) && ($args[0].entertainSkill >= 100)>>
	<<set $beauty += 10>>
<</if>>

<<if ($arcologies[0].FSBodyPurist > 20)>> /*bonus for virgin slaves*/
	<<if $args[0].vagina == 0 && $args[0].vaginalCount == 0>>
		<<set $beauty += 30*($arcologies[0].FSBodyPurist/100)>>
	<</if>>
	<<if $args[0].anus == 0 && $args[0].analCount == 0>>
		<<set $beauty += 30*($arcologies[0].FSBodyPurist/100)>>
	<</if>>
<</if>>

<<if $seeAge == 1>>
<<if $args[0].physicalAge == $minimumSlaveAge && $args[0].physicalAge == $fertilityAge && canGetPregnant($args[0]) && ($arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderFundamentalist != "unset") && $arcologies[0].FSRestart == "unset">>
	<<set $beauty += 1>>
	<<if $args[0].birthWeek == 0>>
		<<set $beauty += 1.6*$beauty>>
	<<elseif $args[0].birthWeek < 4>>
		<<set $beauty += 0.2*$beauty>>
	<</if>>
<<elseif $args[0].physicalAge == $minimumSlaveAge>>
	<<set $beauty += 1>>
	<<if $args[0].birthWeek == 0>>
		<<set $beauty += 0.8*$beauty>>
	<<elseif $args[0].birthWeek < 4>>
		<<set $beauty += 0.1*$beauty>>
	<</if>>
<<elseif $args[0].physicalAge == $fertilityAge && canGetPregnant($args[0]) && ($arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderFundamentalist != "unset")>>
	<<set $beauty += 1>>
	<<if $args[0].birthWeek == 0>>
		<<set $beauty += 0.8*$beauty>>
	<<elseif $args[0].birthWeek < 4>>
		<<set $beauty += 0.1*$beauty>>
	<</if>>
<</if>>
<</if>>

<<else>> /* FUCKDOLL */

<<set $beauty += 120 - ($args[0].waist/20) - ($args[0].muscles/30) + ($args[0].lips/10) + ($args[0].clit) + (($args[0].height-160)/10) + (2*$args[0].hips)>>

<</if>> /* CLOSES FUCKDOLL CHECK */

<<if ($arcologies[0].FSTransformationFetishist > 20)>>
	<<if $args[0].lips > 70>>
	<<if ($args[0].lipsImplant/$args[0].lips < .50)>>
		<<set $beauty -= (($args[0].lips/10)+($arcologies[0].FSTransformationFetishist/20))>>
	<</if>>
	<</if>>
<</if>>

<<if $args[0].butt <= 10>>
	<<set $beauty += (1.5*$args[0].butt)>> /*15*/
<<else>>
	<<set $beauty += (15+($args[0].butt/4))>> /*20*/
<</if>>

/* Cock + Balls */

<<if ($arcologies[0].FSAssetExpansionist > 20) && $arcologies[0].FSGenderFundamentalist == "unset">>
	<<if $args[0].dick >= 20>>
		<<set $beauty += 17+($args[0].dick*($arcologies[0].FSAssetExpansionist/500))>> /*23*/
	<<elseif $args[0].dick >= 10>>
		<<set $beauty += 10+($args[0].dick*($arcologies[0].FSAssetExpansionist/300))>> /*16.3*/
	<<elseif $args[0].dick > 6>>
		<<set $beauty += $args[0].dick*(1+($arcologies[0].FSAssetExpansionist/100))>> /*10*/
	<</if>>
	<<if $args[0].balls > 100>>
		<<set $beauty += 41+($args[0].balls*($arcologies[0].FSAssetExpansionist/500))>> /*66*/
	<<elseif $args[0].balls > 80>>
		<<set $beauty += 16+($args[0].balls*($arcologies[0].FSAssetExpansionist/400))>> /*41*/
	<<elseif $args[0].balls > 60>>
		<<set $beauty += 6+($args[0].balls*($arcologies[0].FSAssetExpansionist/800))>> /*16*/
	<<elseif $args[0].balls > 10>>
		<<set $beauty += $args[0].balls*(($arcologies[0].FSAssetExpansionist/1000))>> /*6*/
	<</if>>
<<elseif $arcologies[0].FSGenderFundamentalist != "unset">>
	<<if $args[0].dick > 0>>
		<<set $beauty += 3-$args[0].dick>>
	<</if>>
	<<if $args[0].scrotum > 0>>
		<<set $beauty -= $args[0].balls*(1+($arcologies[0].FSGenderFundamentalist/200))>>
		<<if $args[0].pubertyXY == 0>>
			<<set $beauty += 5>>
		<</if>>
	<</if>>
<<elseif $arcologies[0].FSGenderRadicalist != "unset">>
	<<if $args[0].dick > 20>>
		<<set $beauty += 20+($args[0].dick*($arcologies[0].FSGenderRadicalist/400))>> /*27.5*/
	<<elseif $args[0].dick >= 10>>
		<<set $beauty += 10+($args[0].dick*($arcologies[0].FSGenderRadicalist/200))>> /*20*/
	<<elseif $args[0].dick > 0>>
		<<set $beauty += $args[0].dick*(1+($arcologies[0].FSGenderRadicalist/100))>> /*10*/
	<</if>>
	<<if $args[0].scrotum > 0>>
		<<if $args[0].balls > 100>>
			<<set $beauty += 40+($args[0].balls*($arcologies[0].FSGenderRadicalist/2000))>> /*46.25*/
		<<elseif $args[0].balls > 60>>
			<<set $beauty += 30+($args[0].balls*($arcologies[0].FSGenderRadicalist/1000))>> /*40*/
		<<elseif $args[0].balls > 10>>
			<<set $beauty += 15+($args[0].balls*($arcologies[0].FSGenderRadicalist/400))>> /*30*/
		<<else>>
			<<set $beauty += $args[0].balls*(1+($arcologies[0].FSGenderRadicalist/200))>> /*15*/
		<</if>>
	<</if>>
<<else>>
	<<set $beauty -= 2*$args[0].dick>>
	<<if $args[0].scrotum > 0>>
		<<set $beauty -= $args[0].balls>>
	<</if>>
<</if>>

/* bonus for dick focused genderrads */
<<if $arcologies[0].FSGenderRadicalistLawFuta != 0>>
	<<if ($arcologies[0].FSGenderRadicalistLawFuta == 1)>>
		<<if $args[0].dick > 0>>
			<<if $args[0].vagina > -1>>
				<<if $args[0].dick > 0 && $args[0].dick <= 10>>
					<<set $beauty += $args[0].dick>> /*10*/
				<</if>>
				<<if $args[0].dick > 20>>
					<<set $beauty += 2>>
				<<elseif $args[0].dick > 10>>
					<<set $beauty += 4>>
				<</if>>
			<</if>>
		<</if>>
	<<elseif ($arcologies[0].FSGenderRadicalistLawFuta == 2)>> /* erection! */
		<<if $args[0].dick > 0>>
		<<if $args[0].balls > 0>>
		<<if $args[0].scrotum > 0>>
		<<if canAchieveErection($args[0])>>
			<<set $beauty += $args[0].dick>>
			<<if $args[0].balls > 0 && $args[0].balls <= 10>>
				<<set $beauty += $args[0].balls>> /*10*/
			<</if>>
			<<if $args[0].balls > 120>>
				<<set $beauty += 14>>
			<<elseif $args[0].balls > 100>>
				<<set $beauty += 12>>
			<<elseif $args[0].balls > 80>>
				<<set $beauty += 10>>
			<<elseif $args[0].balls > 60>>
				<<set $beauty += 8>>
			<<elseif $args[0].balls > 40>>
				<<set $beauty += 6>>
			<<elseif $args[0].balls > 20>>
				<<set $beauty += 4>>
			<<elseif $args[0].balls > 10>>
				<<set $beauty += 2>>
			<</if>>
		<</if>>
		<</if>>
		<</if>>
		<</if>>
	<<elseif ($arcologies[0].FSGenderRadicalistLawFuta == 3)>>
		<<if $args[0].butt >= 5>>
			<<set $beauty += ($args[0].butt-5)>> /*15*/
		<</if>>
		<<if $args[0].hips >= 1>>
			<<set $beauty += 4*($args[0].hips-1)>> /*8*/
			<<if $arcologies[0].FSSlimnessEnthusiast != "unset">>
				<<set $beauty += 4*($args[0].hips-1)>> /*8*/ /* offsets the malus for big butts */
			<</if>>
		<</if>>
		<<if $args[0].analSkill > 60 && $args[0].anus >= 2>>
			<<set $beauty += 2*($args[0].anus-2)>> /*6*/
			<<if $arcologies[0].FSSlimnessEnthusiast != "unset">>
				<<set $beauty += 2*($args[0].anus-2)>> /*6*/ /* offsets the malus for big butts */
			<</if>>
		<</if>>
	<<elseif ($arcologies[0].FSGenderRadicalistLawFuta == 4)>>
		<<if $args[0].dick > 0 && $args[0].vagina == -1 && $args[0].faceShape != "masculine">>
			<<if $args[0].boobs < 500 &&  $args[0].dick < 4 && $args[0].balls < 4>>
				<<if $arcologies[0].FSSlimnessEnthusiast == "unset">> /*balance with slimness*/
					<<set $beauty += 20>>
					<<if $args[0].boobs < 300>>
						<<set $beauty += 12>>
					<<elseif $args[0].boobs < 400>>
						<<set $beauty += 6>>
					<</if>>
				<</if>>
				<<if $args[0].dick == 1>>
					<<set $beauty += 12>>
				<<elseif $args[0].dick == 2>>
					<<set $beauty += 6>>
				<</if>>
				<<if $args[0].balls <= 2>>
					<<set $beauty += 8>>
				<</if>>
				<<if $args[0].faceShape == "cute" && $args[0].face > 0>> /*uggos need not apply, maybe a small boost for other faceShapes*/
					<<set $beauty += ((($arcologies[0].FSGenderRadicalist/25)*($args[0].face/30))-2)>> /*gives a slightly better boost than androgynous does with gendrad boost, 15.3*/
				<</if>>
				<<if $args[0].nipples == "tiny">>
					<<set $beauty += 5>>
				<<elseif $args[0].nipples == "cute">>
					<<set $beauty += 2>>
				<<else>>
					<<set $beauty -= 5>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if ($arcologies[0].FSTransformationFetishist > 20 && $arcologies[0].FSSlimnessEnthusiast == "unset") || ($arcologies[0].FSAssetExpansionist > 20)>>
	<<if $args[0].boobs <= 500>>
		<<set $beauty += (0.02*($args[0].boobs-250))>> /*5*/
	<<elseif $args[0].boobs <= 1500>>
		<<set $beauty += 5+(0.015*($args[0].boobs-500))>> /*20*/
	<<elseif $args[0].boobs <= 3000>>
		<<set $beauty += 20+(0.01*($args[0].boobs-1500))>> /*42.5*/
	<<elseif $args[0].boobs <= 25000>>
		<<set $beauty += 50+(0.005*($args[0].boobs-3000))>> /*160 - this might need to be lowered. Maybe drop the 50? Otherwise break it down more.*/
	<<else>>
		<<set $beauty += 145+(0.001*($args[0].boobs-10000))>> /* 185 */
	<</if>>
	<<if $args[0].butt <= 2>>
		<<set $beauty += (2*($args[0].butt-1))>> /*2*/
	<<elseif $args[0].butt <= 4>>
		<<set $beauty += 2+(1.5*($args[0].butt-2))>> /*5*/
	<<elseif $args[0].butt <= 10>>
		<<set $beauty += 5+(1*($args[0].butt-4))>> /*11*/
	<<else>>
		<<set $beauty += 7+(.5*($args[0].butt-5))>> /*14.5*/
	<</if>> /* maybe buff butts? */
<<elseif ($arcologies[0].FSSlimnessEnthusiast > 20)>>
	<<if $args[0].boobs <= 500>>
		<<set $beauty += (0.08*($args[0].boobs))>> /*40 - buff me to be in line with higher end asset exp*/
	<<elseif $args[0].boobs <= 1000>>
		<<set $beauty += 10>>
	<<elseif $args[0].boobs <= 3000>>
		<<set $beauty += 5>>
	<<else>>
		<<set $beauty -= 5+(0.005*($args[0].boobs-3000))>> /*-110*/
	<</if>>
	<<if $args[0].butt <= 3>>
		<<set $beauty += 12+(3*($args[0].butt-1))>> /*18 buff if asses get buffed*/
	<<elseif $args[0].butt <= 5>>
		<<set $beauty += 9>>
	<<else>>
		<<set $beauty -= 10+($args[0].butt*3)>> /*-70*/
	<</if>>
<<else>>
	<<if $args[0].boobs <= 1200>>
		<<set $beauty += (0.02*($args[0].boobs-200))>> /*20*/
	<<elseif $args[0].boobs <= 2400>>
		<<set $beauty += 20+(0.01*($args[0].boobs-1200))>> /*32*/
	<<elseif $args[0].boobs <= 3600>>
		<<set $beauty += 32+(0.005*($args[0].boobs-2400))>> /*38*/
	<<elseif $args[0].boobs <= 10000>>
		<<set $beauty += 38>>
	<<elseif $args[0].boobs <= 25000>>
		<<set $beauty += 30>>
	<<else>>
		<<set $beauty += 20>>
	<</if>>
	<<if $args[0].butt <= 2>>
		<<set $beauty += (2*($args[0].butt-1))>> /*2*/
	<<elseif $args[0].butt <= 4>>
		<<set $beauty += 2+(1.5*($args[0].butt-2))>> /*5*/
	<<elseif $args[0].butt <= 8>>
		<<set $beauty += 2+(1.5*($args[0].butt-2))>> /*11*/
	<<else>>
		<<set $beauty += 9>>
	<</if>>
<</if>>
<<if $arcologies[0].FSTransformationFetishist > 20>> /* the cost of using AE's values */
	<<if ($arcologies[0].FSSlimnessEnthusiast != "unset")>>
		<<if $args[0].boobs >= 400>>
			<<if $args[0].boobs >= 10000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .75>>
					<<set $beauty -= ((0.05*($args[0].boobs))+10)>>
				<</if>>
			<<elseif $args[0].boobs >= 2000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .50>>
					<<set $beauty -= ((0.05*($args[0].boobs))+10)>>
				<</if>>
			<<elseif $args[0].boobs >= 1000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .25>>
					<<set $beauty -= ((0.05*($args[0].boobs))+10)>>
				<</if>>
			<<else>>
				<<if $args[0].boobsImplant/$args[0].boobs < .10>>
					<<set $beauty -= ((0.05*($args[0].boobs))+10)>>
				<</if>>
			<</if>>
		<</if>>
		<<if $args[0].butt >= 3>>
			<<if $args[0].buttImplant/$args[0].butt < .25>>
				<<set $beauty -= ((2*($args[0].butt-1))+10)>>
			<</if>>
		<</if>>
	<<else>>
		<<if $args[0].butt >= 6>>
			<<if $args[0].buttImplant/$args[0].butt < .50>>
				<<set $beauty -= ((1.5*$args[0].butt)+6)>> /* will get nasty at huge sizes */
			<</if>>
		<</if>>
		<<if $args[0].boobs >= 600>>
			<<if $args[0].boobs >= 10000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .75>>
					<<set $beauty -= 30+(0.005*($args[0].boobs))>> /* will get nasty at huge sizes */
				<</if>>
			<<elseif $args[0].boobs >= 2000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .50>>
					<<set $beauty -= 30+(0.005*($args[0].boobs))>> /* will get nasty at huge sizes */
				<</if>>
			<<elseif $args[0].boobs >= 1000>>
				<<if $args[0].boobsImplant/$args[0].boobs < .25>>
					<<set $beauty -= 30+(0.005*($args[0].boobs))>> /* will get nasty at huge sizes */
				<</if>>
			<<else>>
				<<if $args[0].boobsImplant/$args[0].boobs < .10>>
					<<set $beauty -= 30+(0.005*($args[0].boobs))>> /* will get nasty at huge sizes */
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if ($arcologies[0].FSTransformationFetishist > 20)>>
	<<if $args[0].hips >= 3>>
		<<set $beauty += 10>>
	<</if>>
<</if>>

<<if $args[0].hips < -1>> /* butts in general may need buffs */
	<<if $args[0].butt > 2>>
	<<if $arcologies[0].FSTransformationFetishist == "unset" && $arcologies[0].FSHedonisticDecadence == "unset">>
		<<set $beauty += 2-$args[0].butt>>
	<<else>>
		<<set $beauty += 1>>
	<</if>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<<elseif $args[0].hips < 0>>
	<<if $args[0].butt > 4>>
	<<if $arcologies[0].FSTransformationFetishist == "unset" && $arcologies[0].FSHedonisticDecadence == "unset">>
		<<set $beauty += 4-$args[0].butt>>
	<<else>>
		<<set $beauty += 1>>
	<</if>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<<elseif $args[0].hips > 2>>
	<<if $args[0].butt <= 8>>
	<<set $beauty += $args[0].butt-8>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<<elseif $args[0].hips > 1>>
	<<if $args[0].butt <= 3>>
	<<set $beauty += $args[0].butt-4>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<<elseif $args[0].hips > 0>>
	<<if $args[0].butt > 8>>
	<<if $arcologies[0].FSTransformationFetishist == "unset" && $arcologies[0].FSHedonisticDecadence == "unset">>
		<<set $beauty += 8-$args[0].butt>>
	<<else>>
		<<set $beauty += 1>>
	<</if>>
	<<elseif $args[0].butt <= 2>>
	<<set $beauty += $args[0].butt-3>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<<else>>
	<<if $args[0].butt > 6>>
	<<if $arcologies[0].FSTransformationFetishist == "unset" && $arcologies[0].FSHedonisticDecadence == "unset">>
		<<set $beauty += 6-$args[0].butt>>
	<<else>>
		<<set $beauty += 1>>
	<</if>>
	<<elseif $args[0].butt <= 1>>
	<<set $beauty += $args[0].butt-2>>
	<<else>>
	<<set $beauty += 1>>
	<</if>>
<</if>>

<<if $args[0].boobs > 250>>
<<if $args[0].boobShape == "perky">>
	<<set $beauty += 6>>
<<elseif $args[0].boobShape == "torpedo-shaped">>
	<<set $beauty += 6>>
<<elseif $args[0].boobShape == "downward-facing">>
	<<set $beauty -= 4>>
<<elseif $args[0].boobShape == "saggy">>
	<<set $beauty -= 4>>
<</if>>
<</if>>

<<if $args[0].nipples == "huge">>
	<<set $beauty += 4>>
<<elseif $args[0].nipples == "inverted">>
	<<set $beauty += 2>>
<<elseif $args[0].nipples == "puffy">>
	<<set $beauty += 2>>
<<elseif $args[0].nipples == "tiny">>
	<<set $beauty -= 2>>
<</if>>

<<if $args[0].anus > 3>>
	<<set $beauty -= 10+($args[0].anus*2)>> /*-20*/
<</if>>
<<if $args[0].vagina > 3>>
	<<set $beauty -= 10+($args[0].vagina*2)>> /*-20*/
<</if>>

<<if $arcologies[0].FSHedonisticDecadence > 20>>
	<<if $args[0].weight < -95>>
		<<set $beauty += -70+($args[0].weight/10)>> /*-80*/
	<<elseif $args[0].weight < -30>>
		<<set $beauty += -30+($args[0].weight/3)>> /*-61*/
	<<elseif $args[0].weight < -10>>
		<<set $beauty += ($args[0].weight)>> /*-30*/
	<<elseif $args[0].weight <= 10>>
	<<elseif $args[0].weight <= 30>>
		<<set $beauty += ($args[0].weight/2)>> /*15*/
	<<elseif $args[0].weight <= 95>>
		<<set $beauty += 15+($args[0].weight/7)>> /*28.5*/
	<<elseif $args[0].weight <= 130>>
		<<set $beauty += 28+($args[0].weight/10)>> /*41*/
	<<elseif $args[0].weight <= 160>>
		<<set $beauty += 42+($args[0].weight/20)>> /*50*/
	<<elseif $args[0].weight <= 190>>
		<<set $beauty += 50-($args[0].weight/25)>> /*42.5*/
	<<else>>
		<<set $beauty += 40-($args[0].weight/20)>> /*30*/
	<</if>>
<<else>>
	<<if ($args[0].weight > 130)>>
		<<set $beauty -= Math.abs($args[0].weight)/5>>
	<<elseif ($args[0].hips > 2)>>
		<<if ($args[0].weight < -10)>>
			<<set $beauty -= Math.abs($args[0].weight)/10>>
		<</if>>
	<<elseif ($args[0].hips > 1)>>
		<<if ($args[0].weight > 95)>>
			<<set $beauty -= Math.abs($args[0].weight)/15>>
		<<elseif ($args[0].weight < -30)>>
			<<set $beauty -= Math.abs($args[0].weight)/10>>
		<</if>>
	<<elseif ($args[0].hips < -1)>>
		<<if ($args[0].weight < -95) || ($args[0].weight > 30)>>
			<<set $beauty -= Math.abs($args[0].weight)/10>>
		<</if>>
	<<else>>
		<<if Math.abs($args[0].weight) > 30>>
			<<set $beauty -= Math.abs($args[0].weight)/10>>
		<</if>>
	<</if>>
<</if>>

<<if ($arcologies[0].FSGenderRadicalist > 20 && $arcologies[0].FSGenderRadicalistLawFuta != 3) || ($arcologies[0].FSSlimnessEnthusiast > 20)>>
	<<if $args[0].hips < 0>>
	<<set $beauty += Math.abs($args[0].hips)>>
	<</if>>
<</if>>
<<if $arcologies[0].FSRestart != "unset">> /* Eugenics does not like slaves having working balls */
	<<if $args[0].balls > 0 && $args[0].ballType == "human">>
		<<set $beauty -= $args[0].balls*(1+($arcologies[0].FSRestart/100))>>
	<</if>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist != "unset">>
	<<if ($args[0].bellyPreg >= 500) && $arcologies[0].FSRepopulationFocus == "unset" && $arcologies[0].FSRestart == "unset" && $args[0].mpreg == 0>>
		<<if $args[0].mpreg == 1>>
			<<set $beauty = ($beauty*0.9)>>
		<<else>>
			<<set $beauty = ($beauty*0.7)>>
		<</if>>
	<</if>>
<<elseif $arcologies[0].FSGenderFundamentalist != "unset">>
	<<if $args[0].shoulders > $args[0].hips>>
	<<if $args[0].boobs <= 2000*($args[0].shoulders-$args[0].hips)>>
		<<set $beauty -= ($args[0].shoulders-$args[0].hips)*(1+($arcologies[0].FSGenderFundamentalist/200))>>
	<</if>>
	<</if>>
<<else>>
	<<if $args[0].shoulders > $args[0].hips>>
	<<if $args[0].boobs <= 2000*($args[0].shoulders-$args[0].hips)>>
		<<set $beauty -= $args[0].shoulders-$args[0].hips>>
	<</if>>
	<</if>>
	<<if $args[0].preg > 10 && $arcologies[0].FSRepopulationFocus == "unset" && $arcologies[0].FSRestart == "unset">>
		<<set $beauty = ($beauty*0.8)>>
	<</if>>
<</if>>

<<if $arcologies[0].FSPhysicalIdealist != "unset">>
	<<if $arcologies[0].FSPhysicalIdealistLaw == 1>>
		<<if (Math.abs($args[0].weight) <= 30) && $args[0].health >= 20 && $args[0].muscles >= 20 && $args[0].muscles <= 50>>
			<<set $beauty += ($args[0].muscles+(Math.min($args[0].health,300)/5))*($arcologies[0].FSPhysicalIdealist/100)>>
		<<else>>
			<<set $beauty -= 30>>
		<</if>>
	<<else>>
		<<if $args[0].muscles > 30 || $args[0].muscles <= -5>>
			<<set $beauty += ($args[0].muscles*($arcologies[0].FSPhysicalIdealist/120))>> /*+-83*/
		<</if>>
	<</if>>
	<<if $arcologies[0].FSPhysicalIdealistStrongFat == 1>>
		<<if $args[0].weight > 10 && $args[0].weight <= 130>>
			<<set $beauty += ($args[0].weight*($arcologies[0].FSPhysicalIdealist/200))>> /*65*/
		<<else>>
			<<set $beauty -= Math.abs($args[0].weight)/2>>
		<</if>>
	<</if>>
	<<if $args[0].height > Height.mean($args[0])>>
		<<set $beauty += 10>>
	<</if>>
<<elseif $arcologies[0].FSHedonisticDecadence != "unset">>
	<<if $args[0].muscles < -10>>
		<<set $beauty += (Math.abs($args[0].muscles)*($arcologies[0].FSHedonisticDecadence/160))>> /*62.5*/
	<<elseif $args[0].muscles > 5>>
		<<if $arcologies[0].FSHedonisticDecadenceStrongFat == 1>>
			<<set $beauty += ($args[0].muscles*($arcologies[0].FSHedonisticDecadence/200))>> /*50*/
		<<else>>
			<<set $beauty -= ($args[0].muscles*($arcologies[0].FSHedonisticDecadence/200))>> /*-50*/
		<</if>>
	<</if>>
<</if>>
<<if $args[0].vagina == 10>>
	<<set $beauty -= 30>>
<</if>>

<<if $args[0].customDesc == "She has a massive scar down her front from where her body exploded under the pressure of her bloated womb.">>
	<<if $arcologies[0].FSDegradationist != "unset">>
		<<set $beauty += 15>>
	<<else>>
		<<set $beauty -= 15>>
	<</if>>
<</if>>

<<if $arcologies[0].FSRepopulationFocus > 40>>
<<if $args[0].preg > 30>> /*limited huge boost for full term */
	<<if $args[0].broodmother > 0>>
		<<set $beauty += 10*$args[0].broodmother*($arcologies[0].FSRepopulationFocus/25)>> /*40-80 limited due to constant presence. Also good breeders, but subpar mothers*/
	<<elseif $args[0].bellyPreg >= 600000>>
		<<set $beauty += 15*($arcologies[0].FSRepopulationFocus/10)>> /*150*/
	<<elseif $args[0].bellyPreg >= 300000>>
		<<set $beauty += 10*($arcologies[0].FSRepopulationFocus/10)>> /*100*/
	<<elseif $args[0].bellyPreg >= 120000>>
		<<set $beauty += 9*($arcologies[0].FSRepopulationFocus/10)>> /*90*/
	<<else>>
		<<set $beauty += 8*($arcologies[0].FSRepopulationFocus/10)>> /*80*/
	<</if>>
<<elseif $args[0].preg > 20>>
	<<if $args[0].pregType >= 20>>
		<<set $beauty += 10*($arcologies[0].FSRepopulationFocus/40)>> /*25*/
	<<elseif $args[0].pregType >= 10>>
		<<set $beauty += 9*($arcologies[0].FSRepopulationFocus/40)>> /*22.5*/
	<<else>>
		<<set $beauty += 8*($arcologies[0].FSRepopulationFocus/40)>> /*20*/
	<</if>>
<<elseif $args[0].preg > 10>>
	<<if $args[0].pregType >= 20>>
		<<set $beauty += 10*($arcologies[0].FSRepopulationFocus/50)>> /*20*/
	<<elseif $args[0].pregType >= 10>>
		<<set $beauty += 8*($arcologies[0].FSRepopulationFocus/50)>> /*16*/
	<<else>>
		<<set $beauty += 5*($arcologies[0].FSRepopulationFocus/50)>> /*10*/
	<</if>>
<<elseif $args[0].pregWeek < 0>>
	<<set $beauty += $arcologies[0].FSRepopulationFocus/10>> /*10*/
<<elseif $args[0].preg > 0 && $args[0].collar == "preg biometrics">>
	<<set $beauty += $arcologies[0].FSRepopulationFocus/12>> /*8.33*/
<<else>>
	<<set $beauty -= 2*($arcologies[0].FSRepopulationFocus/5)>> /*-40*/
<</if>>
<<if $args[0].births > 50>>
	<<set $beauty += 50*($arcologies[0].FSRepopulationFocus/75)>> /*66.6*/
<<else>>
	<<set $beauty += $args[0].births*($arcologies[0].FSRepopulationFocus/75)>>
<</if>>
<<elseif $arcologies[0].FSRestart > 40>>
<<if $args[0].breedingMark == 1>>
	<<if $args[0].preg > 5 && $args[0].pregSource == -1>>
		<<set $beauty += $arcologies[0].FSRestart>> /*100*/
	<</if>>
<<else>>
<<if $args[0].preg > 30>>
	<<if $args[0].bellyPreg >= 600000>>
		<<set $beauty -= 100*($arcologies[0].FSRestart/40)>> /*-250*/
	<<elseif $args[0].bellyPreg >= 300000>>
		<<set $beauty -= 50*($arcologies[0].FSRestart/40)>> /*-125*/
	<<elseif $args[0].bellyPreg >= 120000>>
		<<set $beauty -= 40*($arcologies[0].FSRestart/40)>> /*-100*/
	<<else>>
		<<set $beauty -= 30*($arcologies[0].FSRestart/40)>> /*-75*/
	<</if>>
<<elseif $args[0].preg > 20>>
	<<if $args[0].pregType >= 20>>
		<<set $beauty -= 40*($arcologies[0].FSRestart/60)>> /*-66.6*/
	<<elseif $args[0].pregType >= 10>>
		<<set $beauty -= 30*($arcologies[0].FSRestart/60)>> /*-50*/
	<<else>>
		<<set $beauty -= 20*($arcologies[0].FSRestart/60)>> /*-33.3*/
	<</if>>
<<elseif $args[0].preg > 10>>
	<<if $args[0].pregType >= 20>>
		<<set $beauty -= 30*($arcologies[0].FSRestart/80)>> /*-37.5*/
	<<elseif $args[0].pregType >= 10>>
		<<set $beauty -= 20*($arcologies[0].FSRestart/80)>> /*-25*/
	<<else>>
		<<set $beauty -= 10*($arcologies[0].FSRestart/80)>> /*-12.5*/
	<</if>>
<<elseif $args[0].preg == -2>>
	<<set $beauty += 10*($arcologies[0].FSRestart/70)>> /*14.2*/
<<elseif $args[0].preg < 1>>
	<<set $beauty += 10*($arcologies[0].FSRestart/50)>> /*20*/
<</if>>
<<if $args[0].births > 50>>
	<<set $beauty -= 50*($arcologies[0].FSRestart/50)>> /*-100*/
<<else>>
	<<set $beauty -= $args[0].births*($arcologies[0].FSRestart/50)>>
<</if>>
<</if>>
<</if>>

<<if $args[0].bellyImplant >= 1500>>
	<<if $arcologies[0].FSTransformationFetishist > 20>>
		<<set $beauty += Math.min(Math.trunc($args[0].bellyImplant/1000), 50)>> /*50*/
	<<elseif $arcologies[0].FSRepopulationFocus > 60>>
		<<if ($args[0].ovaries == 0 && $args[0].mpreg == 0) || $args[0].preg < -1>>
			<<set $beauty += 20>>
		<</if>>
	<<else>>
		<<if $args[0].bellyImplant >= 750000>>
			<<set $beauty = ($beauty*0.2)>>
		<<elseif $args[0].bellyImplant >= 450000>>
			<<set $beauty = ($beauty*0.5)>>
		<<elseif $args[0].bellyImplant >= 300000>>
			<<set $beauty = ($beauty*0.7)>>
		<<elseif $args[0].bellyImplant >= 100000>>
			<<set $beauty = ($beauty*0.80)>>
		<<elseif $args[0].bellyImplant >= 50000>>
			<<set $beauty = ($beauty*0.85)>>
		<<else>>
			<<set $beauty = ($beauty*0.9)>>
		<</if>>
	<</if>>
<</if>>

<<if $args[0].bellySag > 0>>
<<if $args[0].belly < 100>>
<<if $arcologies[0].FSRepopulationFocus != "unset">>
<<else>>
	<<set $beauty -= 20>>
<</if>>
<</if>>
<</if>>

<<if $args[0].pubertyXX == 1>>
	<<set $beauty += 5>>
<</if>>
<<if $args[0].pubertyXY == 0 && $args[0].physicalAge > $potencyAge && $args[0].balls > 0>>
	<<set $beauty += 10>>
<</if>>

<<if ($args[0].butt > 4) && ($args[0].boobs > 800)>>
	<<if $arcologies[0].FSSlimnessEnthusiast == "unset">>
	<<set $beauty += 1>>
	<</if>>
	<<if $arcologies[0].FSAssetExpansionist != "unset">>
	<<set $beauty += ($arcologies[0].FSAssetExpansionist/20)>>
	<<if canTalk($args[0])>>
	<<if $args[0].voice == 3>>
		<<set $beauty += ($arcologies[0].FSAssetExpansionist/40)>>
	<</if>>
	<</if>>
	<</if>>
<</if>>

<<if ($args[0].boobs < 500) && ($args[0].butt < 3)>>
	<<if ($args[0].muscles <= 30) && $arcologies[0].FSPhysicalIdealist == "unset" && ($args[0].weight <= 10) && $arcologies[0].FSHedonisticDecadence == "unset">>
		<<set $beauty += 40>>
		<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
		<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/20)>>
		<<if canTalk($args[0])>>
		<<if $args[0].voice == 3>>
			<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/40)>>
		<</if>>
		<</if>>
		<</if>>
	<<elseif $arcologies[0].FSPhysicalIdealist != "unset">> /* no muscle malus for muscle loving societies */
		<<if $arcologies[0].FSPhysicalIdealistStrongFat == 1 && ($args[0].weight <= 30)>> /* reduced weight malus for fat loving societies */
			<<set $beauty += 40>>
			<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
				<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/20)>>
				<<if canTalk($args[0]) && $args[0].voice == 3>>
					<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/40)>>
				<</if>>
			<</if>>
		<<elseif ($args[0].weight <= 10)>>
			<<set $beauty += 40>>
			<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
				<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/20)>>
				<<if canTalk($args[0]) && $args[0].voice == 3>>
					<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/40)>>
				<</if>>
			<</if>>
		<</if>>
	<<elseif $arcologies[0].FSHedonisticDecadence != "unset" && ($args[0].weight <= 30)>> /* reduced weight malus for fat loving societies */
		<<if $arcologies[0].FSHedonisticDecadenceStrongFat == 1>> /* no muscle malus for muscle loving societies */
			<<set $beauty += 40>>
			<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
				<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/20)>>
				<<if canTalk($args[0]) && $args[0].voice == 3>>
					<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/40)>>
				<</if>>
			<</if>>
		<<elseif ($args[0].muscles <= 30)>>
			<<set $beauty += 40>>
			<<if $arcologies[0].FSSlimnessEnthusiast > 20>>
				<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/20)>>
				<<if canTalk($args[0]) && $args[0].voice == 3>>
					<<set $beauty += ($arcologies[0].FSSlimnessEnthusiast/40)>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if $arcologies[0].FSGenderFundamentalistLawBeauty + $arcologies[0].FSGenderRadicalistLawBeauty > 0>>
	<<set $genderLawPass = 1>>
	<<if $arcologies[0].FSPhysicalIdealist == "unset" && $arcologies[0].FSHedonisticDecadenceStrongFat == 0 && $args[0].muscles > 30>> /*muscle check*/
		<<set $genderLawPass = 0>>
	<</if>>
	<<if $genderLawPass == 1>>
		<<if $arcologies[0].FSHedonisticDecadence != "unset" || $arcologies[0].FSPhysicalIdealistStrongFat == 1>> /*weight check*/
			<<if $args[0].weight > 130 || $args[0].weight <= -30>>
				<<set $genderLawPass = 0>>
			<</if>>
		<<elseif (Math.abs($args[0].weight) > 30)>>
			<<set $genderLawPass = 0>>
		<</if>>
	<</if>>
	<<if $genderLawPass == 1>> /*asset check*/
		<<if $arcologies[0].FSAssetExpansionist != "unset">>
			<<if $args[0].boobs < 500 || $args[0].boobs > 1600 || $args[0].butt < 3 || $args[0].butt > 6>>
				<<set $genderLawPass = 0>>
			<</if>>
		<<elseif $args[0].boobs < 500 || $args[0].boobs > 800 || $args[0].butt < 3 || $args[0].butt > 4>>
			<<set $genderLawPass = 0>>
		<</if>>
	<</if>>
	<<if $genderLawPass == 1>>
		<<set $beauty += 60>>
	<<else>>
		<<set $beauty -= 10>>
	<</if>>
<</if>>

<<if $arcologies[0].FSSlimnessEnthusiastLaw == 1>>
	<<if ($args[0].boobs < 300) && ($args[0].butt <= 1) && ($args[0].waist <= 10)>>
		<<set _slimPass = 1>>
		<<if $arcologies[0].FSPhysicalIdealist == "unset" && $arcologies[0].FSHedonisticDecadenceStrongFat == 0 && $args[0].muscles > 30>> /*muscle check*/
			<<set _slimPass = 0>>
		<</if>>
		<<if _slimPass == 1>>
			<<if $arcologies[0].FSHedonisticDecadence != "unset" || $arcologies[0].FSPhysicalIdealistStrongFat == 1>> /*weight check*/
				<<if $args[0].weight > 30>>
					<<set _slimPass = 0>>
				<</if>>
			<<elseif $args[0].weight > 10>>
				<<set _slimPass = 0>>
			<</if>>
		<</if>>
		<<if _slimPass == 1>>
			<<set $beauty += 40+($arcologies[0].FSSlimnessEnthusiast/20)>> /*45*/
		<<else>>
			<<set $beauty -= ($arcologies[0].FSSlimnessEnthusiast/20)>>
		<</if>>
	<</if>>
<</if>>

<<if $arcologies[0].FSHedonisticDecadenceLaw2 == 1>>
	<<if ($args[0].boobs >= 2000) && ($args[0].butt >= 5) && ($args[0].weight > 95)>>
		<<set $beauty += 5+($arcologies[0].FSHedonisticDecadence/20)>> /*10*/
	<<else>>
		<<set $beauty -= 15+($arcologies[0].FSHedonisticDecadence/20)>> /*-20*/
	<</if>>
<</if>>

<<if ($args[0].boobsImplant == 0) && ($args[0].buttImplant == 0) && ($args[0].waist >= -95) && ($args[0].lipsImplant == 0) && ($args[0].faceImplant < 30) && ($args[0].bellyImplant == -1) && (Math.abs($args[0].shouldersImplant) < 2) && (Math.abs($args[0].hipsImplant) < 2)>>
	<<set $pure += 1>>
	<<if $arcologies[0].FSBodyPurist != "unset">>
	<<set $beauty += ($arcologies[0].FSBodyPurist/5)>>
	<</if>>
	<<if $arcologies[0].FSTransformationFetishist == "unset">>
	<<set $beauty += 2>>
	<</if>>
<<else>>
	<<if $arcologies[0].FSTransformationFetishist != "unset">>
	<<set $beauty += ($arcologies[0].FSTransformationFetishist/40)>>
	<</if>>
<</if>>

<<if $arcologies[0].FSTransformationFetishist != "unset">>
	<<if (Math.abs($args[0].shouldersImplant) > 1)>>
		<<set $beauty += ($arcologies[0].FSTransformationFetishist/20)+(Math.abs($args[0].shouldersImplant))>>
	<</if>>
	<<if (Math.abs($args[0].hipsImplant) > 1)>>
		<<set $beauty += ($arcologies[0].FSTransformationFetishist/20)+(Math.abs($args[0].hipsImplant))>>
	<</if>>
	<<set _race = $args[0].race>>
	<<if _race.indexOf("surgically") != -1>>
		<<set $beauty += ($arcologies[0].FSTransformationFetishist/20)>>
	<</if>>
	<<if $args[0].faceImplant > 95 && $args[0].face > 40>>
		<<set $beauty += ($arcologies[0].FSTransformationFetishist/4)>>
	<</if>>
	<<if $args[0].nipples == "fuckable">>
		<<set $beauty += ($arcologies[0].FSTransformationFetishist/10)>>
	<</if>>
<</if>>

<<if $arcologies[0].FSBodyPurist != "unset">>
	<<if $args[0].faceImplant > 5>>
		<<set $beauty -= ($arcologies[0].FSBodyPurist/100)*($args[0].faceImplant/10)>>
	<</if>>
	<<set _race = $args[0].race>>
	<<if _race.indexOf("surgically") != -1>>
		<<set $beauty -= ($arcologies[0].FSBodyPurist/20)>>
	<</if>>
<<elseif $arcologies[0].FSTransformationFetishist == "unset">>
	<<if $args[0].faceImplant > 30>>
		<<set $beauty -= ($args[0].faceImplant-30)/10>>
	<</if>>
<</if>>

<<if !canTalk($args[0])>>
	<<set $beauty -= 2>>
<<else>>
	<<if ($args[0].accent >= 3)>>
	<<set $beauty -= 1>>
	<<elseif ($args[0].accent == 1)>>
	<<set $beauty += 1>>
	<</if>>
<</if>>

<<if ($args[0].physicalAge < 11)>>
	<<set $beauty += 2>>
<<elseif ($args[0].physicalAge < 13)>>
<<elseif $args[0].underArmHStyle == "neat">>
<<elseif $args[0].underArmHStyle == "hairless">>
	<<set $beauty += 2>>
<<elseif $args[0].underArmHStyle == "bald">>
	<<set $beauty += 2>>
<<elseif ($args[0].underArmHStyle == "waxed")>>
	<<set $beauty += 2>>
<<elseif $args[0].underArmHStyle == "shaved">>
	<<set $beauty += 2>>
<<elseif $args[0].underArmHStyle == "bushy">>
	<<set $beauty -= 2>>
<</if>>

<<if ($args[0].physicalAge < 11)>>
	<<set $beauty += 2>>
<<elseif ($args[0].physicalAge < 13)>>
<<elseif $args[0].pubicHStyle == "neat">>
<<elseif $args[0].pubicHStyle == "in a strip">>
<<elseif $args[0].pubicHStyle == "hairless">>
	<<set $beauty += 2>>
<<elseif $args[0].pubicHStyle == "bald">>
	<<set $beauty += 2>>
<<elseif ($args[0].pubicHStyle == "waxed")>>
	<<set $beauty += 2>>
<<elseif $args[0].pubicHStyle == "bushy">>
	<<set $beauty -= 4>>
<<elseif $args[0].pubicHStyle == "bushy in the front and neat in the rear">>
	<<set $beauty -= 2>>
<</if>>

<<if $args[0].amp == 0>>
<<elseif $args[0].amp == 1>>
	<<set $beauty -= 10>>
<<elseif $args[0].amp == -3>>
<<elseif $args[0].amp == -5>>
<<else>>
	<<set $beauty -= 2>>
<</if>>

<<if $arcologies[0].FSChattelReligionistCreed == 1>>
<<if $nicaeaAssignment == $args[0].assignment>>
	<<set $beauty += $nicaeaPower*2>>
<</if>>
<</if>>

<<if $args[0].prestige > 0>>
	<<set $beauty = $beauty+($beauty*$args[0].prestige*0.1)>>
<</if>>

<<if $args[0].breedingMark == 1>>
	<<set $beauty = Math.trunc($beauty*2)>>
<</if>>

<<if $beauty < 1>>
	<<set $beauty = 1>>
<<else>>
	<<set $beauty = Math.trunc($beauty*0.5)>>
<</if>>

<</widget>>

<<widget "Deadliness">>

<<set $deadliness = 2>>

<<if $args[0].combatSkill > 0>>
	<<set $deadliness += 2>>
<</if>>

<<if setup.bodyguardCareers.includes($Bodyguard.career)>>
	<<set $deadliness += 1>>
<<elseif $Bodyguard.skillBG >= $masteredXP>>
	<<set $deadliness += 1>>
<</if>>

<<if ($args[0].muscles > 30) && ($args[0].muscles <= 95)>>
	<<set $deadliness += 1>>
<<elseif ($args[0].muscles > 95) && ($args[0].height >= 185)>>
	<<set $deadliness += 2>>
<<elseif ($args[0].muscles > 95)>>
	<<set $deadliness -= 1>>
<<elseif ($args[0].muscles < -95)>>
	<<set $deadliness -= 20>>
<<elseif ($args[0].muscles < -30)>>
	<<set $deadliness -= 7>>
<<elseif ($args[0].muscles < -5)>>
	<<set $deadliness -= 3>>
<</if>>

<<if $args[0].height >= 170>>
	<<set $deadliness += 1>>
<</if>>

<<if $args[0].health > 50>>
	<<set $deadliness += 1>>
<</if>>

<<if $args[0].boobs > 4000>>
	<<set $deadliness -= 2>>
<<elseif $args[0].boobs > 2000>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].butt > 6>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].hips > 2>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].weight > 190>>
	<<set $deadliness -= 20>>
<<elseif $args[0].weight > 160>>
	<<set $deadliness -= 10>>
<<elseif $args[0].weight > 130>>
	<<set $deadliness -= 3>>
<<elseif $args[0].weight > 30 || $args[0].weight < -10>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].health < -50>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].bellyFluid >= 10000>>
	<<set $deadliness -= 3>>
<<elseif $args[0].bellyFluid >= 5000>>
	<<set $deadliness -= 2>>
<<elseif $args[0].bellyFluid >= 2000>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].pregKnown == 1 || $args[0].bellyPreg >= 1500 || $args[0].bellyImplant >= 1500>>
	<<if $args[0].belly >= 750000>>
		<<set $deadliness -= 50>>
	<<elseif $args[0].belly >= 600000>>
		<<set $deadliness -= 25>>
	<<elseif $args[0].belly >= 450000>>
		<<set $deadliness -= 15>>
	<<elseif $args[0].belly >= 300000>>
		<<set $deadliness -= 10>>
	<<elseif $args[0].belly >= 150000>>
		<<set $deadliness -= 8>>
	<<elseif $args[0].belly >= 100000>>
		<<set $deadliness -= 7>>
	<<elseif $args[0].belly >= 10000>>
		<<set $deadliness -= 3>>
	<<elseif $args[0].belly >= 5000>>
		<<set $deadliness -= 2>>
	<<else>>
		<<set $deadliness -= 1>>
	<</if>>
<</if>>
<<if $args[0].labor == 1>>
	<<set $deadliness -= 15>>
<<elseif $args[0].preg >= 40 && $args[0].pregControl != "labor supressors">>
	<<set $deadliness -= 5>>
<</if>>

<<if $args[0].balls >= 15>>
	<<set $deadliness -= 1>>
<</if>>
<<if $args[0].dick >= 10>>
	<<set $deadliness -= 1>>
<</if>>

<<if $args[0].amp == 0>>
  <<if !canWalk($args[0])>>
	<<set $deadliness -= 20>>
  <</if>>
<<elseif $args[0].amp == 1>>
	<<set $deadliness -= 20>>
<<elseif $args[0].amp == -5>>
	<<set $deadliness += 10>>
<<elseif $args[0].amp == -4>>
	<<set $deadliness += 5>>
<<else>>
	<<set $deadliness -= 1>>
<</if>>

<<if !canSee($args[0])>>
	<<set $deadliness -= 8>>
<<elseif (($args[0].eyes == -1 && !["corrective glasses", "corrective contacts"].includes($args[0].eyewear)) || ($args[0].eyes == 1 && ["blurring glasses", "blurring contacts"].includes($args[0].eyewear))>>
	<<set $deadliness -= 1>>

<</if>>

<<if $deadliness < 1>>
	<<set $deadliness = 1>>
<</if>>

<</widget>>

<<widget "SlaveTitle">>

<<if $newDescriptions == 1>>

<<if $args[0].dick > 0 && $args[0].balls > 0 && $args[0].boobs > 300 && $args[0].vagina > -1 && $args[0].ovaries == 1>>
	<<if random(1,100) > 50>>
		<<set $desc = "futanari">>
	<<else>>
		<<set $desc = "herm">>
	<</if>>
<<elseif $args[0].dick > 0 && $args[0].balls == 0 && $args[0].boobs > 300 && $args[0].vagina > -1 && $args[0].ovaries == 1>>
	<<set $desc = "dickgirl">>
<<elseif $args[0].dick > 0 && $args[0].vagina > -1 && $args[0].ovaries == 0>>
	<<set $desc = "shemale">>
<<elseif $args[0].dick > 0 && $args[0].balls == 0 && $args[0].vagina == -1 && $args[0].ovaries == 0>>
	<<set $desc = "eunuch">>
<<elseif $args[0].dick > 0 && $args[0].balls > 0 && $args[0].vagina == -1 && $args[0].ovaries == 0>>
	<<if $args[0].face > 10 && $args[0].hips > -1 && $args[0].shoulders < 1 && $args[0].faceShape != "masculine">>
		<<set $desc = "trap">>
	<<elseif $args[0].boobs > 800>>
		<<set $desc = "tittyboy">>
	<<elseif $args[0].dick == 1 && $args[0].balls == 1>>
		<<set $desc = "sissy">>
	<<elseif $args[0].dick > 1 && $args[0].balls > 1 && $args[0].height < 165 && $args[0].muscles < 5 && $args[0].visualAge < 19 && $args[0].faceShape != "masculine">>
		<<set $desc = "twink">>
	<<elseif $args[0].dick > 1 && $args[0].balls > 1 && $args[0].height < 160 && $args[0].muscles < 5 && $args[0].visualAge < 19>>
		<<set $desc = "boytoy">>
	<<elseif $args[0].muscles > 95 && $args[0].height >= 185>>
		<<set $desc = "titan">>
	<<elseif $args[0].muscles > 30>>
		<<set $desc = "muscleboy">>
	<<else>>
		<<set $desc = "slaveboy">>
	<</if>>
<<elseif $args[0].dick == 0 && $args[0].balls == 0 && $args[0].vagina > -1>>
	<<if ($args[0].shoulders > $args[0].hips || $args[0].faceShape == "masculine") && $args[0].boobs < 400 && $args[0].genes == "XY">>
		<<set $desc = "cuntboy">>
	<<elseif $args[0].ovaries == 0 && $args[0].genes == "XY">>
		<<set $desc = "tranny">>
	<<elseif $args[0].weight > 10 && $args[0].boobs > 800 && $args[0].birthsTotal > 0 && $args[0].physicalAge > 59>>
		<<set $desc = "GMILF">>
	<<elseif $args[0].weight > 10 && $args[0].boobs > 800 && $args[0].birthsTotal > 0 && $args[0].physicalAge > 35>>
		<<set $desc = "MILF">>
	<<elseif $args[0].lips > 70 && $args[0].boobs > 2000 && $args[0].butt > 3>>
		<<set $desc = "bimbo">>
	<<elseif $args[0].hips > 1 && $args[0].boobs > 2000 && $args[0].butt > 3 && $args[0].waist < 50>>
		<<set $desc = "hourglass">>
	<<elseif $args[0].muscles > 95 && $args[0].height >= 185>>
		<<set $desc = "amazon">>
	<<elseif $args[0].muscles > 30>>
		<<set $desc = "musclegirl">>
	<<else>>
		<<set $desc = "slavegirl">>
	<</if>>
<<elseif $args[0].dick == 0 && $args[0].balls == 0 && $args[0].vagina == -1>>
	<<set $desc = "neuter">>
<<elseif $args[0].dick == 0 && $args[0].vagina == -1>>
	<<set $desc = "ballslave">>
<<else>>
	<<set $desc = "slave">>
<</if>>

<<if $args[0].visualAge < 13>>
	<<if $args[0].genes == "XY" && $args[0].vagina == -1>>
		<<set $desc = "shota " + $desc>>
	<<else>>
		<<set $desc = "loli " + $desc>>
	<</if>>
<</if>>

<<if $args[0].dick > 9 && $args[0].balls > 9 && $args[0].boobs > 12000>>
	<<set $desc = "hyper " + $desc>>
<</if>>

<<if $args[0].boobs > 4000 && $args[0].lactation > 0>>
	<<if $args[0].physicalAge < 13>>
		<<set $desc = $desc + " calf">>
	<<else>>
		<<set $desc = $desc + " cow">>
	<</if>>
<<elseif $args[0].lactation > 0>>
	<<set $desc = "milky " + $desc>>
<</if>>

<<if $args[0].boobs > 20000>>
	<<set $desc = "supermassive titted " + $desc>>
<<elseif $args[0].boobs > 10000>>
	<<set $desc = "giant titted " + $desc>>
<<elseif $args[0].boobs > 4000>>
	<<set $desc = "huge titted " + $desc>>
<<elseif $args[0].boobs > 1000>>
	<<set $desc = "busty " + $desc>>
<</if>>

<<if $args[0].dick > 5 && $args[0].balls > 5>>
	<<set $desc = "womb filling " + $desc>>
<<elseif $args[0].dick > 5>>
	<<set $desc = "well hung " + $desc>>
<</if>>

<<if $args[0].butt >= 12>>
	<<set $desc = "colossal assed " + $desc>>
<<elseif $args[0].butt >= 12>>
	<<set $desc = "massive assed " + $desc>>
<<elseif $args[0].butt >= 8>>
	<<set $desc = "fat assed " + $desc>>
<<elseif $args[0].butt >= 6>>
	<<set $desc = "bottom heavy " + $desc>>
<<elseif $args[0].butt >= 4>>
	<<set $desc = "big bottomed " + $desc>>
<</if>>

<<if $args[0].weight > 10 && $args[0].weight < 100 && $args[0].boobs > 5000 && $args[0].butt > 5 && $args[0].hips >= 2 && $args[0].bellyPreg >= 30000 && $args[0].births >= 10>>
	<<set $desc = $desc + "fertility goddess">>
<<elseif $args[0].births >= 6>>
	<<set $desc = $desc + " broodmother">>
<<elseif $args[0].births >= 3>>
	<<set $desc = $desc + " breeder">>
<</if>>

<<if $args[0].indenture > -1>>
	<<set $desc = "indentured " + $desc>>
<</if>>

<<if $args[0].preg > 10 && $args[0].pregKnown == 1>>
	<<set $desc = "pregnant " + $desc>>
<<elseif $args[0].bellyFluid >= 5000>>
	<<set $desc = "bloated " + $desc>>
<<elseif $args[0].belly >= 5000>>
	<<set $desc = "gravid " + $desc>>
<</if>>

<<if $args[0].fuckdoll > 0>>
	<<set $desc = $desc + " fuckdoll">>
<</if>>

<<else>>

<<set $desc = "slave">> /* I don't tihnk there is an 'else'? */
<<if ($args[0].dick == 0) && ($args[0].vagina == -1)>> /* NULLS */
	<<set $desc = "null">>
		<<if ($args[0].lactation > 0) && ($args[0].boobs > 2000)>>
			<<set $desc = $desc + " cow">>
		<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
			<<set $desc = $desc + " bimbo ">>
		<<elseif $args[0].boobs > 6000>>
			<<set $desc = $desc + " boob">>
		<<elseif $args[0].butt > 6>>
			<<set $desc = $desc + " ass">>
		<<elseif ($args[0].muscles > 30) && ($args[0].height < 185)>>
				<<set $desc = $desc + " muscle">>
		<</if>>
			<<if $args[0].visualAge > 55>>
				<<set $desc = $desc + "GILF">>
			<<elseif $args[0].visualAge > 35>>
				<<set $desc = $desc + "MILF">>
			<<elseif $args[0].visualAge >= 25>>
				<<set $desc = $desc + "slave">>
			<<else>>
				<<set $desc = $desc + "girl">>
			<</if>>
<</if>>

<<if ($args[0].dick == 0) && ($args[0].vagina != -1)>> /* FEMALES */
	<<if $args[0].visualAge > 55>>
		<<set $desc = "GILF">>
	<<elseif $args[0].visualAge > 35>>
		<<set $desc = "MILF">>
	<<elseif $args[0].visualAge >= 25>>
		<<set $desc = "slave">>
	<<else>>
		<<set $desc = "slavegirl">>
	<</if>>
		<<if ($args[0].muscles > 30) && ($args[0].height < 185)>>
				<<set $desc = "muscle " + $desc>>
		<<elseif ($args[0].lactation > 0) && ($args[0].boobs > 2000)>>
			<<set $desc = $desc + " cow">>
		<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
			<<set $desc = $desc + " bimbo">>
		<<elseif $args[0].boobs > 6000>>
			<<set $desc = "boob" + $desc>>
		<<elseif $args[0].butt > 6>>
			<<set $desc = "ass" + $desc>>
		<</if>>
<</if>>

<<if ($args[0].dick != 0) && ($args[0].vagina != -1)>>
		<<if $args[0].balls > 0>> /* FUTANARI: cock & balls & vagina */
			<<set $desc = "futanari ">>
		<<else>> /* FUTANARI: cock & vagina */
			<<set $desc = "futa ">>
		<</if>>
			<<if ($args[0].lactation > 0) && ($args[0].boobs > 2000)>>
				<<set $desc = $desc + "cow">>
			<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
				<<set $desc = $desc + "bimbo ">>
			<<elseif $args[0].boobs > 6000>>
				<<set $desc = $desc + "boob">>
			<<elseif $args[0].butt > 6>>
				<<set $desc = $desc + "ass">>
			<<elseif ($args[0].muscles > 30) && ($args[0].height < 185)>>
				<<set $desc = $desc + "muscle">>
			<</if>>
				<<if $args[0].visualAge > 55>>
					<<set $desc = $desc + "GILF">>
				<<elseif $args[0].visualAge > 35>>
					<<set $desc = $desc + "MILF">>
				<<elseif $args[0].visualAge >= 25>>
					<<set $desc = $desc + "slave">>
				<<else>>
					<<set $desc = $desc + "girl">>
				<</if>>
					<<if $args[0].dick > 5 && $args[0].balls > 5 && $args[0].boobs > 5000>>
						<<set $desc = "hyper " + $desc>>
					<</if>>
<</if>>

<<if ($args[0].dick != 0) && ($args[0].vagina == -1) && ($args[0].balls > 0) && ($args[0].boobs > 300) && ($args[0].butt > 2)>> /* SHEMALES: cock & balls, T&A above minimum */
	<<if $args[0].visualAge > 55>>
		<<set $desc = "sheGILF">>
	<<elseif $args[0].visualAge > 35>>
		<<set $desc = "sheMILF">>
	<<elseif $args[0].visualAge >= 25>>
		<<set $desc = "shemale">>
	<<else>>
		<<set $desc = "tgirl">>
	<</if>>
		<<if ($args[0].muscles > 30) && ($args[0].height < 185)>>
				<<set $desc = "muscle" + $desc>>
		<<elseif ($args[0].lactation > 0) && ($args[0].boobs > 2000)>>
			<<set $desc = $desc + " cow">>
		<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
			<<set $desc = $desc + " bimbo">>
		<<elseif $args[0].boobs > 6000>>
			<<set $desc = "topheavy " + $desc>>
		<<elseif $args[0].butt > 6>>
			<<set $desc = "bottomheavy " + $desc>>
		<</if>>
<</if>>

<<if ($args[0].boobs < 300) || ($args[0].butt < 2)>>
	<<if ($args[0].dick != 0) && ($args[0].vagina == -1) && ($args[0].balls > 0)>>
		<<if ($args[0].shoulders < 1) || ($args[0].muscles <= 30)>>
			<<if ($args[0].faceShape == "masculine") || ($args[0].faceShape == "androgynous")>> /* SISSIES: feminine shoulders or muscles, masculine faces */
				<<if $args[0].visualAge > 55>>
					<<set $desc = "sissyGILF">>
				<<elseif $args[0].visualAge > 35>>
					<<set $desc = "sissyMILF">>
				<<else>>
					<<set $desc = "sissy">>
				<</if>>
			<<else>> /* TRAPS: feminine shoulders or muscles, feminine faces */
				<<if $args[0].visualAge > 55>>
					<<set $desc = "trapGILF">>
				<<elseif $args[0].visualAge > 35>>
					<<set $desc = "trapMILF">>
				<<elseif $args[0].visualAge >= 25>>
					<<set $desc = "trap">>
				<<else>>
					<<set $desc = "trapgirl">>
				<</if>>
			<</if>>
				<<if $args[0].lactation > 0>>
					<<set $desc = $desc + " cow">>
				<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
					<<set $desc = $desc + " bimbo">>
				<</if>>
		<</if>>
	<</if>>
<</if>>

<<if ($args[0].boobs < 300) || ($args[0].butt < 2)>>
	<<if ($args[0].dick != 0) && ($args[0].vagina == -1) && ($args[0].balls > 0)>>
		<<if ($args[0].shoulders > 1) || ($args[0].muscles >= 30)>>	/* BITCHES: masculine shoulders or muscles */
			<<set $desc = "bitch">>
				<<if ($args[0].muscles > 30) && ($args[0].height < 185)>>
						<<set $desc = "muscle" + $desc>>
				<<elseif $args[0].lactation > 0>>
						<<set $desc = $desc + "cow">>
				<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
						<<set $desc = "bimbo " + $desc>>
				<</if>>
					<<if $args[0].visualAge > 55>>
						<<set $desc = "aged " + $desc>>
					<<elseif $args[0].visualAge > 35>>
						<<set $desc = "mature " + $desc>>
					<<elseif $args[0].visualAge < 25>>
						<<set $desc = "young " + $desc>>
					<</if>>
		<</if>>
	<</if>>
<</if>>

<<if ($args[0].dick != 0) && ($args[0].vagina == -1) && ($args[0].balls == 0)>>
	<<set $desc = "dick">>
		<<if $args[0].visualAge > 55>>
			<<set $desc = $desc + "GILF">>
		<<elseif $args[0].visualAge > 35>>
			<<set $desc = $desc + "MILF">>
		<<elseif $args[0].visualAge >= 25>>
			<<set $desc = $desc + "slave">>
		<<else>>
			<<set $desc = $desc + "girl">>
		<</if>>
			<<if ($args[0].muscles > 30) && ($args[0].height < 185)>>
				<<set $desc = "muscle" + $desc>>
			<<elseif ($args[0].lactation > 0) && ($args[0].boobs > 2000)>>
				<<set $desc = $desc + " cow">>
			<<elseif ($args[0].boobsImplant > 0) && ($args[0].buttImplant > 0)>>
				<<set $desc = $desc + " bimbo">>
			<<elseif $args[0].boobs > 6000>>
				<<set $desc = "boob " + $desc>>
			<<elseif $args[0].butt > 6>>
				<<set $desc = "ass " + $desc>>
			<</if>>
<</if>>

<<if ($args[0].muscles > 30) && ($args[0].height > 185)>>
	<<set $desc = "amazon " + $desc>>
<<elseif ($args[0].muscles < 30) && ($args[0].height > 185)>>
	<<set $desc = "statuesque " + $desc>>
<<elseif ($args[0].boobs < 800) && ($args[0].height < 150)>>
	<<set $desc = "petite " + $desc>>
<<elseif ($args[0].boobs > 800) && ($args[0].height < 150)>>
	<<set $desc = "shortstack " + $desc>>
<</if>>

<<if $args[0].births >= 5>>
	<<set $desc = $desc + " broodmother">>
<<elseif $args[0].births >= 2>>
	<<set $desc = $desc + " breeder">>
<</if>>

<<if $args[0].indenture > -1>>
	<<set $desc = "indentured " + $desc>>
<</if>>

<<if $args[0].preg > 10 && $args[0].pregKnown == 1>>
	<<set $desc = "pregnant " + $desc>>
<<elseif $args[0].bellyFluid >= 5000>>
	<<set $desc = "bloated " + $desc>>
<<elseif $args[0].belly >= 5000>>
	<<set $desc = "gravid " + $desc>>
<</if>>

<<if $args[0].fuckdoll > 0>>
	<<set $desc = $desc + " fuckdoll">>
<</if>>

<</if>>

<</widget>>

/* Use is <<modScore $someSlave>> where $someSlave is any variable that points to a valid slave */

<<widget "modScore">>
<<set $piercingScore = 0>>
<<set $tatScore = 0>>
<<if $args[0].earPiercing > 0>><<set $piercingScore += $args[0].earPiercing*0.75-0.5>><</if>>
<<if $args[0].nosePiercing > 0>><<set $piercingScore += $args[0].nosePiercing*0.75-0.5>><</if>>
<<if $args[0].eyebrowPiercing > 0>><<set $piercingScore += $args[0].eyebrowPiercing*0.75-0.5>><</if>>
<<if $args[0].navelPiercing > 0>><<set $piercingScore += $args[0].navelPiercing*0.75-0.5>><</if>>
<<if $args[0].corsetPiercing > 0>><<set $piercingScore += $args[0].corsetPiercing*0.75+0.5>><</if>>
<<if $args[0].nipplesPiercing > 0>><<set $piercingScore += $args[0].nipplesPiercing*0.75-0.25>><</if>>
<<if $args[0].areolaePiercing > 0>><<set $piercingScore += $args[0].areolaePiercing*0.75+0.5>><</if>>
<<if $args[0].lipsPiercing > 0>><<set $piercingScore += $args[0].lipsPiercing*0.75-0.25>><</if>>
<<if $args[0].tonguePiercing > 0 >><<set $piercingScore += $args[0].tonguePiercing*0.75-0.25>><</if>>
<<if $args[0].clitPiercing == 3>><<set $piercingScore += 1.25>> /* smart piercing */
	<<elseif $args[0].clitPiercing > 0>><<set $piercingScore += $args[0].clitPiercing*0.75-0.25>><</if>>
<<if $args[0].vaginaPiercing > 0>><<set $piercingScore += $args[0].vaginaPiercing*0.75-0.25>><</if>>
<<if $args[0].dickPiercing > 0>><<set $piercingScore += $args[0].dickPiercing*0.75-0.25>><</if>>
<<if $args[0].anusPiercing > 0>><<set $piercingScore += $args[0].anusPiercing*0.75-0.25>><</if>>
<<if $args[0].boobsTat != 0>><<set $tatScore += 1.25>><</if>>
<<if $args[0].buttTat != 0>><<set $tatScore += 1.25>><</if>>
<<if $args[0].lipsTat != 0>><<set $tatScore += 1.25>><</if>>
<<if $args[0].shouldersTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].backTat != 0>><<set $tatScore += 1.25>><</if>>
<<if $args[0].armsTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].legsTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].stampTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].vaginaTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].dickTat != 0>><<set $tatScore += 1>><</if>>
<<if $args[0].bellyTat != 0>>
<<if ($args[0].belly >= 300000)>>
	<<set $tatScore += 0.75>>
<<elseif ($args[0].belly >= 150000)>>
	<<set $tatScore += 1>>
<<elseif ($args[0].belly >= 10000)>>
	<<set $tatScore += 1>>
<<elseif ($args[0].belly >= 5000)>>
	<<set $tatScore += 0.5>>
<<elseif ($args[0].belly >= 1500)>>
	<<set $tatScore += 0.25>>
<<else>>
	<<set $tatScore += 0.1>>
<</if>>
<</if>>
<<if $args[0].anusTat == "bleached">><<set $tatScore += 0.5>>
	<<elseif $args[0].anusTat != 0>><<set $tatScore += 1.25>><</if>>
<<set $modScore = $piercingScore+$tatScore>> /* note: always overwrites previous $modScore */
<</widget>>

<<widget "fetishChangeChance">>

<<if $args[0].clitSetting != $args[0].fetish>>
	<<if $args[0].balls>>
		<<set _sex = $potencyAge-$args[0].actualAge>>
	<<elseif $args[0].ovaries || $args[0].mpreg>>
		<<set _sex = $fertilityAge-$args[0].actualAge>>
	<<else>>
		<<set _sex = 0>>
	<</if>>
	<<set $fetishChangeChance = Math.trunc(Math.clamp(($args[0].devotion/4)-($args[0].fetishStrength/4)-(Math.max(_sex,0)*10), 0, 100))>>
<<else>>
	<<set $fetishChangeChance = 0>>
<</if>>

<</widget>>

<<widget "slaveCost">>

<<Beauty $args[0]>>
<<set FResult($args[0])>>

<<set $slaveCost = ($beauty*$FResult)>>

<<set _slaveMultiplier = $slaveCostFactor>>

<<if $args[0].behavioralFlaw != "none">>
	<<set _slaveMultiplier -= 0.1>>
<</if>>
<<if $args[0].behavioralQuirk != "none">>
	<<set _slaveMultiplier += 0.1>>
<</if>>
<<if $args[0].sexualFlaw == "breeder" && $arcologies[0].FSRepopulationFocus != "unset">>
	<<set _slaveMultiplier += 0.3>>
<<elseif $args[0].sexualFlaw != "none">>
	<<set _slaveMultiplier -= 0.1>>
<</if>>
<<if $args[0].sexualQuirk != "none">>
	<<set _slaveMultiplier += 0.1>>
<</if>>

<<if $args[0].fetishKnown == 1>>
	<<if $args[0].fetish == "mindbroken">>
		<<set _slaveMultiplier -= 0.3>>
	<<elseif $args[0].fetish != "none">>
		<<set _slaveMultiplier += $args[0].fetishStrength/1000>>
	<</if>>
<<else>>
	<<set _slaveMultiplier -= 0.1>>
<</if>>

<<if $args[0].attrKnown == 1>>
	<<if $args[0].energy > 95>>
	<<set _slaveMultiplier += 0.2>>
	<</if>>
<</if>>

<<if $args[0].vagina == 0>>
	<<set _slaveMultiplier += 0.1>>
<</if>>
<<if $args[0].mpreg == 1>>
	<<set _slaveMultiplier += 0.2>>
<</if>>
<<if $arcologies[0].FSRepopulationFocusSMR == 1>>
	<<if $args[0].preg < -1>>
		<<set _slaveMultiplier -= 0.5>>
	<<elseif ($args[0].bellyPreg >= 300000)>>
		<<set _slaveMultiplier += 1>>
	<<elseif ($args[0].bellyPreg >= 120000)>>
		<<set _slaveMultiplier += 0.5>>
	<<elseif $args[0].preg > 10>>
		<<set _slaveMultiplier += 0.1>>
	<</if>>
<<elseif $arcologies[0].FSRestartSMR == 1>>
	<<if $args[0].preg < -1>>
		<<set _slaveMultiplier += 0.5>>
	<<elseif ($args[0].bellyPreg >= 300000)>>
		<<set _slaveMultiplier -= 2.5>>
	<<elseif ($args[0].bellyPreg >= 30000)>>
		<<set _slaveMultiplier -= 1.5>>
	<<elseif $args[0].preg > 10>>
		<<set _slaveMultiplier -= 1.0>>
	<</if>>
<<else>>
	<<if $args[0].preg < -1>>
		<<set _slaveMultiplier -= 0.1>>
	<<elseif ($activeSlave.bellyPreg >= 300000)>>
		<<set _slaveMultiplier -= 1.5>>
	<<elseif ($activeSlave.bellyPreg >= 120000)>>
		<<set _slaveMultiplier -= 0.5>>
	<<elseif $args[0].preg > 10>>
		<<set _slaveMultiplier -= 0.1>>
	<</if>>
<</if>>
<<set _slaveMultiplier += 0.05*$args[0].intelligence>>
<<if $args[0].intelligenceImplant == 1>>
	<<set _slaveMultiplier += 0.1-($args[0].intelligence*0.02)>>
<</if>>

<<if $args[0].vagina > -1 && $arcologies[0].FSRestartSMR == 1>>
	<<if $args[0].dick > 0>>
	<<if $args[0].ovaries == 0 && $args[0].balls == 0>>
		<<set _slaveMultiplier += 0.8>>
	<</if>>
	<</if>>
<<elseif $args[0].vagina > -1>>
	<<if $args[0].dick > 0>>
		<<if ($ui != "start") || ($PC.dick == 0) || ($PC.vagina == 0)>>
			<<set _slaveMultiplier += 0.2>>
			<<if $args[0].ovaries > 0>>
			<<if $args[0].balls > 0>>
				<<set _slaveMultiplier += 0.8>>
			<</if>>
			<</if>>
		<<else>>
			<<set _slaveMultiplier += 0.1>>
			<<if $args[0].ovaries > 0>>
			<<if $args[0].balls > 0>>
				<<set _slaveMultiplier += 0.2>>
			<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if $args[0].pubertyXY == 0 && $args[0].physicalAge >= $potencyAge && $args[0].genes == "XY" && $arcologies[0].FSGenderRadicalist == "unset">>
	<<set _slaveMultiplier += 0.5>>
<</if>>

<<if $args[0].prestige > 0>>
	<<set _slaveMultiplier += 0.7*$args[0].prestige>>
<</if>>

<<if $specialSlavesPriceOverride == 1>>
	<<if $args[0].devotion >= 50>>
		<<set _slaveMultiplier += $args[0].devotion/200>>
	<</if>>
	<<if $args[0].trust >= 50>>
		<<set _slaveMultiplier += $args[0].trust/200>>
	<</if>>
<<else>>
<<set _slaveMultiplier += $args[0].devotion/200>>
<<if $args[0].devotion <= 50>>
	<<set _slaveMultiplier += $args[0].trust/200>>
<<else>>
	<<if $args[0].trust > 0>>
		<<set _slaveMultiplier += $args[0].trust/200>>
	<</if>>
<</if>>
<</if>>

<<if $args[0].brand != 0>>
	<<if $rep > 10000>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif $rep < 5000>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
<</if>>

<<if $arcologies[0].FSSupremacistLawME != 0>>
	<<if $args[0].race != $arcologies[0].FSSupremacistRace>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
<</if>>
<<if $arcologies[0].FSSubjugationistLawME != 0>>
	<<if $args[0].race == $arcologies[0].FSSubjugationistRace>>
	<<set _slaveMultiplier -= 0.2>>
	<</if>>
<</if>>
<<if $arcologies[0].FSRepopulationFocusSMR != 0>>
	<<if $args[0].preg > 0>>
		<<set _slaveMultiplier += 0.1>>
	<</if>>
<</if>>
<<if $arcologies[0].FSHedonisticDecadenceSMR != 0>>
	<<if $args[0].weight > 60 && $args[0].muscles < 5>>
		<<set _slaveMultiplier += 0.1>>
	<</if>>
<</if>>
<<if $arcologies[0].FSRestartSMR != 0>>
	<<if $args[0].dick > 0>>
		<<set _slaveMultiplier -= 0.1>>
	<</if>>
	<<if $args[0].balls > 0>>
		<<set _slaveMultiplier -= 0.2>>
	<</if>>
	<<if $args[0].vagina > 0>>
		<<set _slaveMultiplier -= 0.1>>
	<</if>>
	<<if $args[0].ovaries > 0>>
		<<set _slaveMultiplier -= 0.5>>
	<</if>>
<</if>>
<<if $arcologies[0].FSGenderFundamentalistSMR != 0>>
	<<if $args[0].dick > 0>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
	<<if $args[0].balls > 0>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist != "unset">>
	<<if $args[0].dick > 0>>
	<<set _slaveMultiplier += 0.1>>
	<</if>>
	<<if $args[0].balls > 0>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
<</if>>
<<if $arcologies[0].FSArabianRevivalist > 50>>
	<<set _slaveMultiplier += 0.1>>
<</if>>

<<if $args[0].career != 0>>
	<<if $args[0].career == "a slave">>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.bodyguardCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.wardenessCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.attendantCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.schoolteacherCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.stewardessCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.milkmaidCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.madamCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.DJCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.HGCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.recruiterCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.1>>
	<<elseif setup.entertainmentCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.05>>
	<<elseif setup.whoreCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.05>>
	<<elseif setup.gratefulCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.05>>
	<<elseif setup.menialCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.05>>
	<<elseif setup.servantCareers.includes($args[0].career)>>
	<<set _slaveMultiplier += 0.05>>
	<</if>>
<</if>>
<<if ($week-$args[0].weekAcquired >= 20) && ($args[0].entertainSkill >= 100)>>
<<if setup.entertainmentCareers.includes($args[0].career)>>
<<else>>
	<<set _slaveMultiplier += 0.05>>
<</if>>
<</if>>
<<if ($args[0].oralCount + $args[0].analCount + $args[0].vaginalCount + $args[0].mammaryCount + $args[0].penetrativeCount > 1000)>>
<<if setup.whoreCareers.includes($args[0].career)>>
<<else>>
	<<set _slaveMultiplier += 0.05>>
<</if>>
<</if>>

<<if $seeAge == 1>>
<<if $args[0].physicalAge == $minimumSlaveAge && $args[0].physicalAge == $fertilityAge && canGetPregnant($args[0]) && ($arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderFundamentalist != "unset")>>
	<<if $args[0].birthWeek == 0>>
	<<set _slaveMultiplier -= 0.4>>
	<<elseif $args[0].birthWeek < 4>>
	<<set _slaveMultiplier -= 0.1>>
	<</if>>
<<elseif $args[0].physicalAge == $minimumSlaveAge>>
	<<if $args[0].birthWeek == 0>>
		<<set _slaveMultiplier -= 0.2>>
	<<elseif $args[0].birthWeek < 4>>
		<<set _slaveMultiplier -= 0.05>>
	<</if>>
<<elseif $args[0].physicalAge == $fertilityAge && canGetPregnant($args[0]) && ($arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderFundamentalist != "unset")>>
	<<if $args[0].birthWeek == 0>>
	<<set _slaveMultiplier -= 0.2>>
	<<elseif $args[0].birthWeek < 4>>
	<<set _slaveMultiplier -= 0.05>>
	<</if>>
<</if>>
<</if>>

<<if $args[0].amp == 1>>
	<<set _slaveMultiplier -= 0.2>>
<</if>>

<<if $args[0].eyes == -2>>
	<<set _slaveMultiplier -= 0.2>>
<</if>>

<<if $args[0].indenture > -1>>
	<<set _slaveMultiplier -= 0.1*$args[0].indentureRestrictions>>
	<<set _slaveMultiplier -= (260-$args[0].indenture)/260>>
<<elseif $seeAge == 1>>
<<if $args[0].actualAge >= ($retirementAge-5) && $PhysicalRetirementAgePolicy != 1>>
	<<set $seed = 52*($retirementAge-$args[0].actualAge)>>
	<<set _slaveMultiplier = _slaveMultiplier*($seed/260)>>
<</if>>
<<if $args[0].physicalAge >= ($retirementAge-5) && $PhysicalRetirementAgePolicy == 1>>
	<<set $seed = 52*($retirementAge-$args[0].physicalAge)>>
	<<set _slaveMultiplier = _slaveMultiplier*($seed/260)>>
<</if>>
<</if>>

<<set $slaveCost = ($slaveCost*_slaveMultiplier*50)>>
<<set $slaveCost = Number($slaveCost) || 0>>

<<if $slaveCost < $minimumSlaveCost>>
	<<set $slaveCost = $minimumSlaveCost>>
<<elseif $slaveCost <= 100000>>
<<elseif $slaveCost <= 200000>>
	<<set $slaveCost -= (($slaveCost-100000)*0.1)>>
<<elseif $slaveCost <= 300000>>
	<<set $slaveCost -= 10000 + (($slaveCost-200000)*0.2)>>
<<elseif $slaveCost <= 400000>>
	<<set $slaveCost -= 30000 + (($slaveCost-300000)*0.3)>>
<<elseif $slaveCost <= 500000>>
	<<set $slaveCost -= 60000 + (($slaveCost-400000)*0.4)>>
<<else>>
	<<set $slaveCost -= 100000 + (($slaveCost-500000)*0.5)>>
<</if>>
<<if $slaveCost < 1000>>
	<<set $slaveCost = 1000>>
<</if>>

<<set $slaveCost = 500*Math.trunc($slaveCost/500)>>

<</widget>>

/%
 Call as <<StartingSlaveCost $activeSlave>> or equivalent
 $args[0] is the slave.
 Fires <<slaveCost>> and adds punishment multipliers for starting with trained and/or devoted slaves.
%/
<<widget "StartingSlaveCost">>

<<slaveCost $args[0]>>

<<set _slaveMultiplier = 0>>

<<if $args[0].devotion > 20>>
	<<set _slaveMultiplier += (0.000117*($args[0].devotion-20)*($args[0].devotion-20))+(0.003167*($args[0].devotion-20))>>
<</if>>

<<if $args[0].whoreSkill>>
	<<set _slaveMultiplier += 0.00001*$args[0].whoreSkill*$args[0].whoreSkill>>
<</if>>
<<if $args[0].entertainSkill>>
	<<set _slaveMultiplier += 0.00001*$args[0].entertainSkill*$args[0].entertainSkill>>
<</if>>
<<if $args[0].vaginalSkill>>
	<<set _slaveMultiplier += 0.00001*$args[0].vaginalSkill*$args[0].vaginalSkill>>
<</if>>
<<if $args[0].analSkill>>
	<<set _slaveMultiplier += 0.00001*$args[0].analSkill*$args[0].analSkill>>
<</if>>
<<if $args[0].oralSkill>>
	<<set _slaveMultiplier += 0.00001*$args[0].oralSkill*$args[0].oralSkill>>
<</if>>
<<if $args[0].combatSkill>>
	<<set _slaveMultiplier += 0.1>>
<</if>>

<<if _slaveMultiplier>>
	<<if $args[0].actualAge > 25>>
		<<set _slaveMultiplier -= _slaveMultiplier*($args[0].actualAge-25)*0.05>>
	<</if>>
<</if>>

<<if $args[0].prestige>>
	<<set _slaveMultiplier += $args[0].prestige>>
<</if>>

<<if _slaveMultiplier>>
	<<set _slaveMultiplier = Math.clamp(_slaveMultiplier,0,10)>>
	<<set $slaveCost += $slaveCost*_slaveMultiplier>>
	<<set $slaveCost = 500*Math.trunc($slaveCost/500)>>
<</if>>

<<if $PC.career == "slaver">>
	<<set $slaveCost = $slaveCost*.5>>
<</if>>

<</widget>>


code:
:: Assign Widgets [widget nobr]

/%
	Call as <<assignJob slaveObject $returnTo | _currentRule.facilityRemove | "serve in the master suite"
	$args[0] slave object. *MUST be present*
	$args[1] Job to assign slave to. Will accept the $returnTo vars and the _currentRule.assignFacility vars and the actual job assignments "serve in the master suite" etc.

	This is basically a Widget version of assign but will work anywhere, and saves to the slaves[..] array, and changes your $args[0] var sent.
%/
<<widget assignJob>>
<<if ($args[1] != "Pit") && ($args[1] != "Coursing Association")>>

	<<removeJob $args[0] $args[0].assignment>> /* sets _wID and _wi */

	/% use .toLowerCase() to get rid of a few dupe conditions. %/
	<<switch $args[1].toLowerCase()>>
		<<case "be confined in the arcade" "arcade">>
			<<set $args[0].assignment = "be confined in the arcade",    $args[0].assignmentVisible = 0, $arcadeSlaves++, $ArcadeiIDs.push(_wID)>>
			<<set $args[0].clothing = "none", $args[0].shoes = "none", $args[0].collar = "none", $args[0].livingRules = "spare">>
		<<case "work in the brothel" "brothel">>
			<<set $args[0].assignment = "work in the brothel",          $args[0].assignmentVisible = 0, $brothelSlaves++, $BrothiIDs.push(_wID)>>
			<<switch $brothelDecoration>>
			<<case "Degradationist" "standard">>
				<<set $args[0].livingRules = "spare">>
			<<default>>
				<<set $args[0].livingRules = "normal">>
			<</switch>>
		<<case "be confined in the cellblock" "cellblock">>
			<<set $args[0].assignment = "be confined in the cellblock", $args[0].assignmentVisible = 0, $cellblockSlaves++, $CellBiIDs.push(_wID)>>
			<<switch $cellblockDecoration>>
			<<case "Paternalist">>
				<<set $args[0].livingRules = "normal">>
			<<default>>
				<<set $args[0].livingRules = "spare">>
			<</switch>>
		<<case "get treatment in the clinic" "clinic">>
			<<set $args[0].assignment = "get treatment in the clinic",  $args[0].assignmentVisible = 0, $clinicSlaves++, $CliniciIDs.push(_wID)>>
			<<switch $clinicDecoration>>
			<<case "Repopulation Focus" "Eugenics" "Gender Radicalist" "Gender Fundamentalist" "Paternalist" "Maturity Preferentialist" "Youth Preferentialist" "Slimness Enthusiast" "Hedonistic">>
				<<set $args[0].livingRules = "luxurious">>
			<<case "Roman Revivalist" "Aztec Revivalist" "Egyptian Revivalist" "Arabian Revivalist" "Chinese Revivalist" "Chattel Religionist" "Edo Revivalist">>
				<<set $args[0].livingRules = "normal">>
			<<default>>
				<<set $args[0].livingRules = "spare">>
			<</switch>>
		<<case "serve in the club" "club">>
			<<set $args[0].assignment = "serve in the club",            $args[0].assignmentVisible = 0, $clubSlaves++, $ClubiIDs.push(_wID)>>
			<<set $args[0].livingRules = "normal">>
		<<case "work in the dairy" "dairy">>
			<<set $args[0].assignment = "work in the dairy",            $args[0].assignmentVisible = 0, $dairySlaves++, $DairyiIDs.push(_wID)>>
			<<switch $dairyDecoration>>
			<<case "Roman Revivalist" "Aztec Revivalist" "Chinese Revivalist" "Chattel Religionist" "Edo Revivalist" "Arabian Revivalist" "Egyptian Revivalist" "Supremacist" "Subjugationist" "Degradationist">>
				<<set $args[0].livingRules = "spare">>
			<<default>>
				<<set $args[0].livingRules = "normal">>
			<</switch>>
		<<case "live with your head girl" "head girl suite" "hgsuite">>
			<<set $args[0].assignment = "live with your Head Girl",     $args[0].assignmentVisible = 0, $HGSuiteSlaves++, $HGSuiteiIDs.push(_wID)>>
			<<set $args[0].livingRules = "luxurious">>
		<<case "serve in the master suite" "master suite" "mastersuite">>
			<<set $args[0].assignment = "serve in the master suite",    $args[0].assignmentVisible = 0, $masterSuiteSlaves++, $MastSiIDs.push(_wID)>>
			<<if $masterSuiteUpgradeLuxury > 0>>
				<<set $args[0].livingRules = "luxurious">>
			<<else>>
				<<set $args[0].livingRules = "spare">>
			<</if>>
		<<case "learn in the schoolroom" "schoolroom">>
			<<set $args[0].assignment = "learn in the schoolroom",      $args[0].assignmentVisible = 0, $schoolroomSlaves++, $SchlRiIDs.push(_wID)>>
			<<set $args[0].livingRules = "normal">>
		<<case "work as a servant" "servants' quarters" "servantsquarters">>
			<<set $args[0].assignment = "work as a servant",            $args[0].assignmentVisible = 0, $servantsQuartersSlaves++, $ServQiIDs.push(_wID)>>
			<<switch $servantsQuartersDecoration>>
			<<case "Roman Revivalist" "Aztec Revivalist" "Chinese Revivalist" "Chattel Religionist" "Edo Revivalist" "Supremacist" "Subjugationist" "Degradationist" "Arabian Revivalist" "Egyptian Revivalist">>
				<<set $args[0].livingRules = "spare">>
			<<default>>
				<<set $args[0].livingRules = "normal">>
			<</switch>>
		<<case "rest in the spa" "spa">>
			<<set $args[0].assignment = "rest in the spa",              $args[0].assignmentVisible = 0, $spaSlaves++, $SpaiIDs.push(_wID)>>
			<<switch $spaDecoration>>
			<<case "Chattel Religionist" "Chinese Revivalist">>
				<<set $args[0].livingRules = "normal">>
			<<case "Degradationist">>
				<<set $args[0].livingRules = "spare">>
			<<default>>
				<<set $args[0].livingRules = "luxurious">>
			<</switch>>
		<<case "be the attendant" "be the dj" "be the madam" "be the milkmaid" "be the nurse" "be the schoolteacher" "be the stewardess" "be the wardeness">>
			<<set $args[0].assignment = $args[1],                       $args[0].assignmentVisible = 0>>     /* non-visible leadership roles */
			<<set $args[0].livingRules = "luxurious">>
		<<case "be your concubine">>
			<<set $args[0].assignment = $args[1],                       $args[0].assignmentVisible = 0>>     /* non-visible leadership roles */
			<<if $masterSuiteUpgradeLuxury > 0>>
				<<set $args[0].livingRules = "luxurious">>
			<<else>>
				<<set $args[0].livingRules = "normal">>
			<</if>>
		<<case "be your head girl">>
			<<set $args[0].assignment = $args[1]>>
			<<if $HGSuite == 1>>
				<<set $args[0].livingRules = "luxurious">>
			<</if>>
		<<case "guard you">>
			<<set $args[0].assignment = $args[1]>>
			<<if $dojo > 1>>
				<<set $args[0].livingRules = "luxurious">>
			<</if>>
			<<if $pitBG == 1 && $fighterIDs.includes(_wID)>>
				<<set $fighterIDs.delete(_wID)>>
			<</if>>
		<<case "be your agent" "live with your agent">>
			<<set $args[0].assignment = $args[1],                       $args[0].assignmentVisible = 0,      $args[0].useRulesAssistant = 0>> /* non-visible roles exempt from Rules Assistant */
			<<if $args[1] == "be your agent">>
				<<set $leaders.push($args[0])>>
			<</if>>
		<<case "choose her own job">>
			<<set $args[0].assignment = $args[1],                       $args[0].choosesOwnAssignment = 1>>  /* removeJob already set assignmentVisible = 1 */
		<<default>>
			<<set $args[0].assignment = $args[1]>>                      /* removeJob already set assignmentVisible = 1 and choosesOwnAssignment = 0 */
	<</switch>>

	<<if $args[0].assignmentVisible == 0 && Array.isArray($personalAttention)>>
		<<set _awi = $personalAttention.findIndex(function(s) { return s.ID == _wID; })>>
		<<if _awi != -1>>
			<<set $personalAttention.deleteAt(_awi)>>
			<<if $personalAttention.length == 0>>
				<<if $PC.career == "escort">>
					<<set $personalAttention = "whoring">>
				<<elseif $PC.career == "servant">>
					<<set $personalAttention = "upkeep">>
				<<else>>
					<<set $personalAttention = "business">>
				<</if>>
				$args[0].slaveName no longer has your personal attention; you plan to focus on $personalAttention.
			<<else>>
				$args[0].slaveName no longer has your personal attention.
			<</if>>
		<</if>>
	<</if>>

	<<if _wi >= 0>>
		<<set $slaves[_wi] = $args[0]>> /* save changes to slave array */
	<</if>>

<</if>> /* not Pit or Coursing Association */
<</widget>>

/%
	Call as <<removeJob slaveObject $returnTo | _currentRule.facilityRemove | "serve in the master suite">>
	$args[0] slave object. *MUST be present*
	$args[1] Job to remove slave from. Will accept the $returnTo vars and the _currentRule.assignFacility vars and the actual job assignments "serve in the master suite" etc.

	This is basically a Widget version of Retrieve but will work anywhere. It changes the assignment and saves to the slaves[..] array, and changes your $args[0] var sent.
	Retrieve overrides the 'rest' in most cases.
%/
<<widget removeJob>>
<<set _wID = $args[0].ID>>
<<set _wi = $slaveIndices[_wID]>>

<<if ($args[1] == "Pit")>>
	<<set $fighterIDs.delete(_wID)>>

<<elseif ($args[1] == "Coursing Association")>>
	<<set $Lurcher = 0>>

<<else>>

	<<if $HeadGirl != 0      && _wID == $HeadGirl.ID>><<set $HeadGirl = 0>><</if>>
	<<if $Recruiter != 0     && _wID == $Recruiter.ID>><<set $Recruiter = 0>><</if>>
	<<if $Bodyguard != 0     && _wID == $Bodyguard.ID>><<set $Bodyguard = 0>><</if>>
	<<if $Madam != 0         && _wID == $Madam.ID>><<set $Madam = 0>><</if>>
	<<if $DJ != 0            && _wID == $DJ.ID>><<set $DJ = 0>><</if>>
	<<if $Milkmaid != 0      && _wID == $Milkmaid.ID>><<set $Milkmaid = 0>><</if>>
	<<if $Schoolteacher != 0 && _wID == $Schoolteacher.ID>><<set $Schoolteacher = 0>><</if>>
	<<if $Attendant != 0     && _wID == $Attendant.ID>><<set $Attendant = 0>><</if>>
	<<if $Nurse != 0         && _wID == $Nurse.ID>><<set $Nurse = 0>><</if>>
	<<if $Stewardess != 0    && _wID == $Stewardess.ID>><<set $Stewardess = 0>><</if>>
	<<if $Wardeness != 0     && _wID == $Wardeness.ID>><<set $Wardeness = 0>><</if>>
	<<if $Concubine != 0     && _wID == $Concubine.ID>><<set $Concubine = 0>><</if>>
	<<if $Collectrix != 0    && _wID == $Collectrix.ID>><<set $Collectrix = 0>><</if>>

	/% use .toLowerCase() to get rid of a few dupe conditions. %/
	<<switch $args[1].toLowerCase()>>
		<<case "be confined in the arcade" "arcade">>
			<<set $args[0].assignment = "work a glory hole">>
			<<set $ArcadeiIDs.delete(_wID), $arcadeSlaves-->>
		<<case "work in the brothel" "brothel">>
			<<set $args[0].assignment = "whore">>
			<<set $BrothiIDs.delete(_wID), $brothelSlaves-->>
		<<case "be confined in the cellblock" "cellblock">>
			<<set $args[0].assignment = "rest">>
			<<if ($args[0].inflation > 0)>>
				<<set $args[0].inflation = 0, $args[0].inflationType = "none", $args[0].inflationMethod = 0>>
				<<SetBellySize $args[0]>>
			<</if>>
			<<set $CellBiIDs.delete(_wID), $cellblockSlaves-->>
		<<case "get treatment in the clinic" "clinic">>
			<<set $args[0].assignment = "rest">>
			<<set $CliniciIDs.delete(_wID), $clinicSlaves-->>
		<<case "serve in the club" "club">>
			<<set $args[0].assignment = "serve the public">>
			<<set $ClubiIDs.delete(_wID), $clubSlaves-->>
		<<case "work in the dairy" "dairy">>
			<<set $args[0].assignment = "get milked">>
			<<set $DairyiIDs.delete(_wID), $dairySlaves-->>
		<<case "learn in the schoolroom" "schoolroom">>
			<<set $args[0].assignment = "rest">>
			<<set $SchlRiIDs.delete(_wID), $schoolroomSlaves-->>
		<<case "rest in the spa" "spa">>
			<<set $args[0].assignment = "rest">>
			<<set $SpaiIDs.delete(_wID), $spaSlaves-->>
		<<case "work as a servant" "servants' quarters" "servantsquarters">>
			<<set $args[0].assignment = "be a servant">>
			<<set $ServQiIDs.delete(_wID), $servantsQuartersSlaves-->>
		<<case "serve in the master suite" "master suite" "mastersuite">>
			<<set $args[0].assignment = "please you">>
			<<set $MastSiIDs.delete(_wID), $masterSuiteSlaves-->>
		<<case "live with your head girl" "head girl suite" "hgsuite">>
			<<set $args[0].assignment = "rest">>
			<<set $HGSuiteiIDs.delete(_wID), $HGSuiteSlaves-->>
		<<case "be your head girl">>
			<<set $args[0].assignment = "rest">>
			<<if $HGSuiteEquality == 0 && $personalAttention == "HG">>
				<<if $PC.career == "escort">>
					<<set $personalAttention = "whoring">>
				<<elseif $PC.career == "servant">>
					<<set $personalAttention = "upkeep">>
				<<else>>
					<<set $personalAttention = "business">>
				<</if>>
				You no longer have a slave assigned to be your Head Girl, so you turn your personal attention to focus on $personalAttention.
			<</if>>
		<<case "be your agent" "live with your agent">>
			<<set $args[0].assignment = "rest">>
			<<set _leaderIndex = $leaders.findIndex(function(x) { return x.ID == $args[0].ID })>>
			<<if _leaderIndex != -1>>
				<<set $leaders.deleteAt(_leaderIndex)>>
			<</if>>
			<<if $args[0].relationshipTarget > 0>> /* following code assumes there can be at most one companion */
				<<set _lover = $slaves.findIndex(function(s) { return s.relationshipTarget == $args[0].ID && s.assignment == "live with your agent"; })>>
				<<if _lover != -1>>
					<<set $slaves[_lover].assignment = "rest", $slaves[_lover].assignmentVisible = 1>>
				<</if>>
			<</if>>
		<<default>>
			<<set $args[0].assignment = "rest">>
	<</switch>>

	<<set $args[0].assignmentVisible = 1, $args[0].choosesOwnAssignment = 0, $args[0].sentence = 0>>
	<<if $args[0].livingRules == "luxurious">>
		<<set $args[0].livingRules = "normal">>
	<</if>>

	<<if _wi >= 0>>
		<<set $slaves[_wi] = $args[0]>> /* save changes to slave array */
	<</if>>

<</if>> /* not Pit or Coursing Association */
<</widget>>

repo_name: drakeashordcataclysm/fc