code:
:: Widgets Missionary [widget]
<<widget "missionaryimg">>
<<closeimg>>
<<set _filters to $skinColor.current>>
<<set _img to setup.tanImg.missionary[$skinColor.tanImgEnabled]>>
<<set _disabled to ["disabled","hidden"]>>
<<set _xx to $enemynomax-1>>
<<if _xx is -1>>
	<<set _stanceCheck to 0>>
<<else>>
	<<set _stanceCheck to $NPCList[_xx].stance>>
<</if>>

<<leg_position>>

<<if $thighuse is "othermouth">>

<</if>>

<<if $penisstate is "othermouthimminent">>

<</if>>

<<if $penisstate is "othermouthimminent">>

<</if>>

<<if $mouthstate is "kissimminent">>

<</if>>

<<if $mouthstate is "kissentrance">>

<</if>>

<<if $vaginastate is "othermouthimminent">>

<</if>>

<<if $vaginastate is "othermouthentrance">>

<</if>>

<<if $vaginastate is "imminent" or $vaginastate is "doubleimminent">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>

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

<<if $vaginastate is "entrance" or $vaginastate is "doubleentrance">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>

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

<<if $bottomuse is "mouth">>

<</if>>

<<if $anusstate is "othermouthimminent">>

<</if>>

<<if $anusstate is "othermouthentrance">>

<</if>>

<<if $anusstate is "imminent" or $anusstate is "doubleimminent">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>

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

<<if $anusstate is "entrance" or $anusstate is "doubleentrance">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>

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

<<if $enemytype is "machine">>
	<<if $machine.tattoo>>
		<<if $machine.tattoo.use isnot "inert" and $machine.tattoo.use isnot "destroyed">>
			<<print ''>>
		<</if>>
	<</if>>
<</if>>

<<if $prop.includes("haybale")>>

<</if>>
<<if $prop.includes("table")>>

<</if>>
<<if $prop.includes("bench")>>

<</if>>
<<if $prop.includes("milk")>>
	<<if _milk_img is "milk_7">>

	<<else>>

	<</if>>
	<<if _milk_img>>

	<</if>>
<</if>>
<<if $prop.includes("semen")>>
	<<if _semen_img is "semen_7">>

	<<else>>

	<</if>>
	<<if _semen_img>>

	<</if>>
<</if>>
<<if $prop.includes("semen")>>

<</if>>
<<if $prop.includes("rails")>>

<</if>>

<<if $vaginastate isnot "penetrated"
and $anusstate isnot "penetrated"
and $mouthstate isnot "penetrated"
and $penisstate isnot "penetrated"
and $penisstate isnot "otheranus"
and $rightarm isnot "penis"
and $leftarm isnot "penis"
and $anusstate isnot "cheeks"
and $thighuse isnot "penis"
and $feetuse isnot "penis"
and $vaginastate isnot "othermouth"
and $anusstate isnot "othermouth"
and $mouthstate isnot "kiss" and $penisstate isnot "othermouth"
and $chestuse isnot "penis"
and $vaginastate isnot "tentacleentrance"
and $vaginastate isnot "tentacleimminent"
and $vaginastate isnot "tentacle"
and $vaginastate isnot "tentacledeep"
and $vaginause isnot "tentaclerub"
and $penisstate isnot "tentacleentrance"
and $penisstate isnot "tentacleimminent"
and $penisstate isnot "tentacle"
and $penisstate isnot "tentacledeep"
and $penisuse isnot "tentaclerub"
and $anusstate isnot "tentacleentrance"
and $anusstate isnot "tentacleimminent"
and $anusstate isnot "tentacle"
and $anusstate isnot "tentacledeep"
and $anusstate isnot "tentaclerub"
and $mouthstate isnot "tentacleentrance"
and $mouthstate isnot "tentacleimminent"
and $mouthstate isnot "tentacle"
and $mouthstate isnot "tentacledeep"
and $feetstate isnot "tentacle"
and $leftarmstate isnot "tentacle"
and $rightarmstate isnot "tentacle"
and _stanceCheck isnot "top">>

<<clothesidlemissionary>>

<<if _leg_position is "up">>

<<else>>

<</if>>

<<if $rightarm isnot "bound" and $rightarm isnot "grappled" and $rightarm isnot "behind">>

<<else>>

<</if>>

<<if $arousal gte ($arousalmax / 5) * 4>>

<<elseif $arousal gte ($arousalmax / 5) * 3>>

<<elseif $arousal gte ($arousalmax / 5) * 2>>

<<elseif $exposed gte 2 or $arousal gte $arousalmax / 5>>

<<elseif $exposed gte 1 or $arousal gte 100>>

<</if>>

<<if $pain gte 100>>

<<elseif $pain gte 80>>

<<elseif $pain gte 60>>

<<elseif $pain gte 40>>

<<elseif $pain gte 20>>

<</if>>

<<if $makeup.lipstick>>

<</if>>

<<if $makeup.eyeshadow>>

<</if>>

<<if $makeup.mascara>>
	<<if $pain gte 20>>

	<<else>>

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

<<if $player.freckles and $makeup.concealer isnot 1>>

<</if>>

<<if $pain gte 100 and $willpowerpain is 0>>

<</if>>

<<if $trauma gte ($traumamax * 0.9) or $possessed>>

<<else>>

<</if>>

<<if $player.penisExist>>
	<<if $worn.genitals.name is "chastity belt">>

	<<elseif $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>
		<<if $worn.genitals.name is "chastity cage">>

			<<if $anususe is "penis">>

			<<else>>

			<</if>>
		<<elseif $player.virginity.penile is true>>
			<<if $anususe is "penis">>

			<<else>>

			<</if>>
		<<else>>
			<<if $anususe is "penis">>

			<<else>>

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

<<if $fringetype is "hime">>
	<<if $hairlength gte 900>>

	<<elseif $hairlength gte 700>>

	<<elseif $hairlength gte 600>>

	<<elseif $hairlength gte 400>>

	<<elseif $hairlength gte 200>>

	<<else>>

	<</if>>
<<else>>
	<<if $hairlength gte 900>>

	<<elseif $hairlength gte 700>>

	<<elseif $hairlength gte 600>>

	<<elseif $hairlength gte 400>>

	<<elseif $hairlength gte 200>>

	<<else>>

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

	<<if $hairlength gte 200>>
		/**/
	<<else>>
		/**/
	<</if>>

<<if $worn.neck.collared is 1>>

<</if>>

<<breastsidlemissionary>>
<<img_tf_miss_idle>>

<<if $worn.genitals.name is "chastity belt">>

<<elseif $worn.genitals.name is "gold chastity belt">>

<</if>>

<<if $bodywritingImages is true>>
	<<if $skin.right_cheek.writing>>
		<<if $skin.right_cheek.type is "text">>
			<<if $skin.right_cheek.arrow is 1>>

			<<else>>

			<</if>>
		<<elseif $skin.right_cheek.type is "object">>

		<</if>>
	<</if>>
	<<if $skin.right_shoulder.writing>>
		<<if $skin.right_shoulder.type is "text">>
			<<if $rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind">>

			<<else>>

			<</if>>
		<<elseif $skin.right_shoulder.type is "object">>
			<<if $rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind">>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.breasts.writing>>
		<<if $skin.breasts.type is "text">>

		<</if>>
	<</if>>
	<<if $skin.back.writing>>
		<<if $skin.back.type is "text">>

		<</if>>
	<</if>>
	<<if $skin.pubic.writing>>
		<<if $skin.pubic.type is "object">>

		<<elseif $skin.pubic.type is "text">>
			<<if $skin.pubic.arrow is 1>>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.left_thigh.writing>>
		<<if $skin.left_thigh.type is "text">>
			<<if _leg_position is "up">>
				<<if $skin.left_thigh.arrow is 1>>

				<<else>>

				<</if>>
			<<else>>

			<</if>>
		<<elseif $skin.left_thigh.type is "object">>
			<<if _leg_position is "up">>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.right_thigh.writing>>
		<<if $skin.right_thigh.type is "text">>
			<<if _leg_position is "up">>
				<<if $skin.right_thigh.arrow is 1>>

				<<else>>

				<</if>>
			<<else>>
				<<if $skin.right_thigh.arrow is 1>>

				<<else>>

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

<<if $machine>>
	<<if $machine.arm_chains>>
		<<if $leftarm is "mechgrappled" or $leftarm is "bound" or $rightarm is "mechgrappled" or $rightarm is "bound">>

		<<else>>

		<</if>>
	<</if>>
	<<if $machine.leg_chains>>
		<<if _leg_position is "up">>

		<<else>>

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

<<if $prop.includes("neck_shackle")>>

<</if>>
<<if $prop.includes("arm_shackle")>>
	<<if $leftarm is "mechgrappled" or $leftarm is "bound" or $rightarm is "mechgrappled" or $rightarm is "bound">>

	<<else>>

	<</if>>
<</if>>
<<if $prop.includes("leg_shackle")>>
	<<if _leg_position is "up">>

	<<else>>

	<</if>>
<</if>>
<<if $prop.includes("breast_pump")>>
	<<if $breastsize gte 8>>

	<<elseif $breastsize gte 5>>

	<<elseif $breastsize gte 3>>

	<<else>>

	<</if>>
<</if>>
<<if $prop.includes("penis_pump")>>

<</if>>

<<else>>

<<beastimgmissionary>>
<<clothesactivemissionary>>

<<if $feetuse is "penis">>
	<<if $enemytype isnot "beast">>

	<<else>>

	<</if>>

	<<if $enemyarousal gte $enemyarousalmax>>

	<</if>>
<<elseif $feetstate is "tentacle">>
<<elseif $penisuse is "othervagina" or $penisuse is "otheranus">>

<<else>>

<</if>>

<<if $leftarm is "penis">>
	<<if $enemytype isnot "beast">>

	<</if>>

	<<if $enemyarousal gte $enemyarousalmax>>

	<</if>>
<<elseif $leftarm is "bound">>
<<elseif $leftarm is "grappled">>
<<elseif $leftarmstate is "tentacle">>
<<else>>
<</if>>

<<if $rightarm is "penis">>
	<<if $enemytype isnot "beast">>

	<</if>>

	<<if $enemyarousal gte $enemyarousalmax>>

	<</if>>
<<elseif $rightarm is "bound">>

<<elseif $rightarm is "grappled" or $rightarm is "behind">>

<<elseif $rightarmstate is "tentacle">>
<<elseif $enemytype is "beast" and $monster isnot 1 and _stanceCheck is "top" and $NPCList[0].type isnot "hawk">>

<<else>>

<</if>>

<<if $anusstate is "cheeks">>
	<<if $enemytype isnot "beast">>

	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>
		<<if $condomAnalImg>>
		<<else>>

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

<<if $chestuse is "penis">>

<</if>>

<<tentacleimgmiss>>

<<if $thighuse is "penis">>
	<<if $enemytype isnot "beast">>

	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>

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

<<if $arousal gte ($arousalmax / 5) * 4>>

<<elseif $arousal gte ($arousalmax / 5) * 3>>

<<elseif $arousal gte ($arousalmax / 5) * 2>>

<<elseif $exposed gte 2 or $arousal gte $arousalmax / 5>>

<<elseif $exposed gte 1 or $arousal gte 100>>

<</if>>

<<if $pain gte 100>>

<<elseif $pain gte 80>>

<<elseif $pain gte 60>>

<<elseif $pain gte 40>>

<<elseif $pain gte 20>>

<</if>>

<<if $makeup.lipstick>>

<</if>>

<<if $makeup.eyeshadow>>

<</if>>

<<if $makeup.mascara>>
	<<if $pain gte 20>>

	<<else>>

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

<<if $player.freckles and $makeup.concealer isnot 1>>

<</if>>

<<if $pain gte 100 and $willpowerpain is 0>>

<</if>>

<<if $trauma gte $traumamax>>

<<else>>

<</if>>

<<if $mouthstate is "kiss">>

<</if>>

<<if $mouthstate is "penetrated">>

		<<if $silhouettedisable is "f" and $enemytype isnot "beast">>

		<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>

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

<<if $vaginastate is "othermouth">>

<</if>>

<<if $vaginastate is "penetrated">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>

		<<if $silhouettedisable is "f">>
			<<if ($penisstate is "penetrated" or $penisstate is "otheranus" or $mouthstate is "penetrated") and $anusstate isnot "doublepenetrated">>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>
		<<if $condomVaginalImg>>
		<<else>>

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

<<if $anusstate is "othermouth">>

<</if>>

<<if $anusstate is "penetrated">>
	<<if $enemytype is "machine">>

	<<elseif $enemytype isnot "beast">>
		<<if $silhouettedisable is "f">>

		<<else>>

		<</if>>
	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>
		<<if $condomAnalImg>>
		<<else>>

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

/* DADV */
<<if $anusstate is "doublepenetrated">>
	<<if $NPCList[$anustarget].penis is "anusdouble" and $NPCList[$anusdoubletarget].penis is "anusdouble">>

		<<if $silhouettedisable is "f">>

		<</if>>
	<<else>>
		<<if $silhouettedisable is "f">>

		<<else>>

		<</if>>
	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>
		<<if $condomAnalImg>>
		<<else>>

		<</if>>
	<</if>>
<</if>>
<<if $vaginastate is "doublepenetrated">>

	<<if $NPCList[$vaginatarget].penis is "vaginadouble" and $NPCList[$vaginadoubletarget].penis is "vaginadouble">>

		<<if $silhouettedisable is "f">>

		<</if>>
	<<else>>

		<<if $silhouettedisable is "f">>
			<<if $penisstate is "penetrated" or $penisstate is "otheranus" or $mouthstate is "penetrated">>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $enemyarousal gte $enemyarousalmax>>
		<<if $condomVaginalImg>>
		<<else>>

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

<<if $penisstate is "othermouth">>

<</if>>

<<if $penisstate is "otherpenis">>

<</if>>

<<if $penisstate is "penetrated" and $enemytype isnot "beast" or $penisstate is "otheranus" and $enemytype isnot "beast">>
	<<if $silhouettedisable is "f" and $NPCList[_na].type isnot "horse" and $NPCList[_na].type isnot "centaur">>

	<</if>>
	<<if $orgasmdown gte 1 and $orgasmcount lte 24 and $femaleclimax isnot 1 and $condomPlayerPenisImg isnot true>>

	<<else>>

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

<<if $player.penisExist>>
	<<if $worn.genitals.type.includes("chastity")>>

	<<elseif $penisstate is "penetrated" or $penisstate is "otheranus">>
		<<if $enemytype isnot "beast" or $monster is 1>>
			<<if $player.virginity.penile is true>>

			<<else>>

			<</if>>
		<</if>>
	<<elseif $player.virginity.penile is true>>

	<<else>>

	<</if>>
	<<if $orgasmdown gte 1 and $penisstate isnot "penetrated" and $orgasmcount lte 24 and $femaleclimax isnot 1 and !$worn.genitals.type.includes("chastity") and $condomPlayerPenisImg isnot true>>

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

<<if $fringetype is "hime">>
	<<if $hairlength gte 900>>

	<<elseif $hairlength gte 700>>

	<<elseif $hairlength gte 600>>

	<<elseif $hairlength gte 400>>

	<<elseif $hairlength gte 200>>

	<<else>>

	<</if>>
<<else>>
	<<if $hairlength gte 900>>

		/**/
	<<elseif $hairlength gte 700>>

		/**/
	<<elseif $hairlength gte 600>>

		/**/
	<<elseif $hairlength gte 400>>

		/**/
	<<elseif $hairlength gte 200>>

		/**/
	<<else>>

		/**/
	<</if>>
<</if>>

/**/

<<if $worn.neck.collared is 1>>

<</if>>

<<breastsactivemissionary>>
<<img_tf_miss_active>>

<<if $worn.genitals.name is "chastity belt">>

<<elseif $worn.genitals.name is "gold chastity belt">>

<</if>>

<<if $bodywritingImages is true>>
	<<if $skin.right_cheek.writing>>
		<<if $skin.right_cheek.type is "text">>
			<<if $skin.right_cheek.arrow is 1>>

			<<else>>

			<</if>>
		<<elseif $skin.right_cheek.type is "object">>

		<</if>>
	<</if>>
	<<if $skin.right_shoulder.writing>>
		<<if $skin.right_shoulder.type is "text">>
			<<if $rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind">>

			<<else>>

			<</if>>
		<<elseif $skin.right_shoulder.type is "object">>
			<<if $rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind">>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.breasts.writing>>
		<<if $skin.breasts.type is "text">>

		<</if>>
	<</if>>
	<<if $skin.back.writing>>
		<<if $skin.back.type is "text">>

		<</if>>
	<</if>>
	<<if $skin.pubic.writing>>
		<<if $skin.pubic.type is "object">>

		<<elseif $skin.pubic.type is "text">>
			<<if $skin.pubic.arrow is 1>>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.left_thigh.writing>>
		<<if $skin.left_thigh.type is "text">>
			<<if _leg_position is "up">>
				<<if $skin.left_thigh.arrow is 1>>

				<<else>>

				<</if>>
			<<else>>
				<<if $skin.left_thigh.arrow is 1>>

				<<else>>

				<</if>>
			<</if>>
		<<elseif $skin.left_thigh.type is "object">>
			<<if _leg_position is "up">>

			<</if>>
		<</if>>
	<</if>>
	<<if $skin.right_thigh.writing>>
		<<if $skin.right_thigh.type is "text">>
			<<if _leg_position is "up">>
				<<if $skin.right_thigh.arrow is 1>>

				<<else>>

				<</if>>
			<<else>>
				<<if $skin.right_thigh.arrow is 1>>

				<<else>>

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

/**/

<<if $machine>>
	<<if $machine.arm_chains>>
		<<if $leftarm is "mechgrappled" or $leftarm is "bound" or $rightarm is "mechgrappled" or $rightarm is "bound">>

		<<else>>

		<</if>>
	<</if>>
	<<if $machine.leg_chains>>
		<<if _leg_position is "up">>

		<<else>>

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

<<if $prop.includes("neck_shackle")>>

<</if>>
<<if $prop.includes("arm_shackle")>>
	<<if $leftarm is "mechgrappled" or $leftarm is "bound" or $rightarm is "mechgrappled" or $rightarm is "bound">>

	<<else>>

	<</if>>
<</if>>
<<if $prop.includes("leg_shackle")>>
	<<if _leg_position is "up">>

	<<else>>

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

<</if>>

<<if $vaginastate isnot "penetrated"
and $anusstate isnot "penetrated"
and $anusstate isnot "cheeks"
and $thighuse isnot "penis"
and $vaginastate isnot "tentacle"
and $vaginastate isnot "tentacledeep"
and $vaginastate isnot "tentacleentrance"
and $vaginastate isnot "tentacleimminent"
and $anusstate isnot "tentacle"
and $anusstate isnot "tentacledeep"
and $anusstate isnot "tentacleentrance"
and $anusstate isnot "tentacleimminent"
and _stanceCheck isnot "top">>

<<elseif $penisuse isnot "othervagina" and $penisuse isnot "otheranus">>

<</if>>

<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Npc Actions [widget]

<<widget "cheeklick">>
	<<set _n to $args[0]>>
	<<set _npcff to ["enjoys","smiles at","leers at","grins at"]>>
	<<set _npccr to ["pressed","shoved","mashed","grinding"]>>
	<<set _i to random(0, 3)>>
	<<set _j to random(0, 3)>>
	<<if $args[0]>>
		<<if $NPCList[_n].penis is "mouth">>
			<<He>> _npcff[_i] the sight of your face _npccr[_j] against <<his>> crotch.
			<<neutral 1>>
		<<elseif $NPCList[_n].penis is "mouthimminent" or $NPCList[_n].penis is "mouthentrance">>
			<<He>> _npcff[_i] the sight of <<his>> penis _npccr[_j] against your mouth.
			<<neutral 1>>
		<<elseif $NPCList[_n].vagina is "mouthentrance">>
			<<He>> _npcff[_i] the sight of your face _npccr[_j] against <<his>> crotch.
			<<neutral 1>>
		<<else>>
			<<if $consensual is 1>>
				<<switch random(1, 4)>>
				<<case 1>>
					<<He>> licks your cheek.
					<<neutral 3>>
					<<if random(1, 2) is 2>>
						<<bodypart_admire left_cheek>>
					<<else>>
						<<bodypart_admire right_cheek>>
					<</if>>
				<<case 2>>
					<<He>> strokes your hair.
					<<neutral 3>>
					<<bodypart_admire forehead>>
				<<case 3>>
					<<He>> nibbles your ear.
					<<neutral 3>>
					<<bodypart_admire forehead>>
				<<case 4>>
					<<He>> nuzzles your neck.
					<<neutral 3>>
					<<bodypart_admire breasts>>
				<</switch>>
			<<else>>
				<<switch random(1, 4)>>
				<<case 1>>
					<<He>> licks your cheek.
					<<neutral 3>>
					<<if random(1, 2) is 2>>
						<<bodypart_admire left_cheek>>
					<<else>>
						<<bodypart_admire right_cheek>>
					<</if>>
				<<case 2>>
					<<He>> tugs at your hair.
					<<neutral 3>>
					<<bodypart_admire forehead>>
				<<case 3>>
					<<He>> bites your ear.
					<<neutral 3>>
					<<if random(1, 2) is 2>>
						<<bodypart_admire left_cheek>>
					<<else>>
						<<bodypart_admire right_cheek>>
					<</if>>
				<<case 4>>
					<<He>> grips your neck.
					<<neutral 3>>
					<<bodypart_admire breasts>>
				<</switch>>
			<</if>>
		<</if>>
	<</if>>
<</widget>>


code:
:: Widgets NPC Types [widget]
<<widget "npcstrip">>
	<<if $enemyno gte 1>>
		<<set $anus to "idle">>
		<<if $gender1 is "m">>
			<<set $penis to "idle">>
		<<elseif $gender1 is "f">>
			<<set $vagina to "idle">>
		<<elseif $gender1 is "h">>
			<<set $penis to "idle">>
			<<set $vagina to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand to "underclothes">>
		<</if>>
	<</if>>
	<<if $enemyno gte 2>>
		<<set $anus2 to "idle">>
		<<if $gender2 is "m">>
			<<set $penis2 to "idle">>
		<<elseif $gender2 is "f">>
			<<set $vagina2 to "idle">>
		<<elseif $gender2 is "h">>
			<<set $penis2 to "idle">>
			<<set $vagina2 to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand2 to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand2 to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand2 to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand2 to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand2 to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand2 to "underclothes">>
		<</if>>
	<</if>>
	<<if $enemyno gte 3>>
		<<set $anus3 to "idle">>
		<<if $gender3 is "m">>
			<<set $penis3 to "idle">>
		<<elseif $gender3 is "f">>
			<<set $vagina3 to "idle">>
		<<elseif $gender3 is "h">>
			<<set $penis3 to "idle">>
			<<set $vagina3 to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand3 to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand3 to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand3 to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand3 to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand3 to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand3 to "underclothes">>
		<</if>>
	<</if>>
	<<if $enemyno gte 4>>
		<<set $anus4 to "idle">>
		<<if $gender4 is "m">>
			<<set $penis4 to "idle">>
		<<elseif $gender4 is "f">>
			<<set $vagina4 to "idle">>
		<<elseif $gender4 is "h">>
			<<set $penis4 to "idle">>
			<<set $vagina4 to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand4 to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand4 to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand4 to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand4 to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand4 to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand4 to "underclothes">>
		<</if>>
	<</if>>
	<<if $enemyno gte 5>>
		<<set $anus5 to "idle">>
		<<if $gender5 is "m">>
			<<set $penis5 to "idle">>
		<<elseif $gender5 is "f">>
			<<set $vagina5 to "idle">>
		<<elseif $gender5 is "h">>
			<<set $penis5 to "idle">>
			<<set $vagina5 to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand5 to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand5 to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand5 to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand5 to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand5 to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand5 to "underclothes">>
		<</if>>
	<</if>>
	<<if $enemyno gte 6>>
		<<set $anus6 to "idle">>
		<<if $gender6 is "m">>
			<<set $penis6 to "idle">>
		<<elseif $gender6 is "f">>
			<<set $vagina6 to "idle">>
		<<elseif $gender6 is "h">>
			<<set $penis6 to "idle">>
			<<set $vagina6 to "idle">>
		<</if>>
		<<if !$worn.upper.type.includes("naked")>>
			<<set $lefthand6 to "upperclothes">>
		<<elseif !$worn.lower.type.includes("naked")>>
			<<set $lefthand6 to "lowerclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $lefthand6 to "underclothes">>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			<<set $righthand6 to "lowerclothes">>
		<<elseif !$worn.upper.type.includes("naked")>>
			<<set $righthand6 to "upperclothes">>
		<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
			<<set $righthand6 to "underclothes">>
		<</if>>
	<</if>>
	<<set $combatgoal to "strip">>
<</widget>>

<<widget "npcexhibit">>
<</widget>>

<<widget "stuck_in_wall_oral">>
<<set $position to "wall">>
<<set $walltype to "front">>
<<set $anususe to "none">>
<<set $vaginause to "none">>
<<set $penisuse to "none">>
<<set $thighuse to "none">>
<<set $bottomuse to "none">>
<<set $feetuse to "none">>
<<set $chestuse to "none">>
<<npcoral>>
<</widget>>

<<widget "npcoral">>
<<if $NPCList[0].penis isnot "none">>
	<<set $NPCList[0].penis to "mouthentrance">><<submission 5>><<set $mouthstate to "entrance">><<set $mouthuse to "penis">><<set $mouthtarget to 0>>
	<<He>> presses <<his>> penis against your lips.
	<<if $NPCList[0].type is "plant" and !["peniskiss","penislick"].includes($mouthactiondefault)>>
		Nectar glistens on the tip. It smells sweet.
	<</if>>

<<elseif $NPCList[0].vagina isnot "none">>
	<<submission 5>><<set $mouthuse to "othervagina">><<set $NPCList[0].vagina to "mouth">><<set $mouthstate to "othervagina">><<set $mouthtarget to 0>>
	<<He>> presses <<his>> pussy against your lips.
	<<if $NPCList[0].type is "plant" and !["peniskiss","penislick"].includes($mouthactiondefault)>>
		Nectar glistens at the entrance. It smells sweet.
	<</if>>

<</if>>
<<set $NPCList[0].location.genitals to "head">>
<</widget>>

<<widget "npchand">>
	<<if $NPCList[0].penis isnot "none">>
		<<set $leftarm to "penis">><<set $NPCList[0].penis to "leftarm">>
	<<else>>
		<<set $leftarm to "othervagina">><<set $NPCList[0].vagina to "leftarm">>
	<</if>>
<</widget>>

<<widget "npcidlegenitals">>
	<<for _i = 0; _i < $NPCList.length; _i++>>
		<<if $NPCList[_i].penis isnot "none">>
			<<set $NPCList[_i].penis to "idle">>
		<</if>>
		<<if $NPCList[_i].vagina isnot "none">>
			<<set $NPCList[_i].vagina to "idle">>
		<</if>>
	<</for>>
<</widget>>

<<widget "npckiss">>
	<<set $NPCList[0].mouth to "kiss">><<set $mouthstate to "kiss">><<set $mouthuse to "kiss">><<set $mouthtarget to 0>>
<</widget>>

<<widget "npcexpose">>
	<<for _i = 0; _i < $NPCList.length; _i++>>
		<<if $NPCList[_i].penis isnot "none">>
			<<set $NPCList[_i].penis to 0>>
		<</if>>
		<<if $NPCList[_i].vagina isnot "none">>
			<<set $NPCList[_i].vagina to 0>>
		<</if>>
	<</for>>
<</widget>>

<<widget "npcgrapplestripall">>
<<if $rightarm is 0>>
	<<set $rightarm to "grappled">>
	<<set $NPCList[0].lefthand to "arms">>
<</if>>
<<if $leftarm is 0>>
	<<set $leftarm to "grappled">>
	<<set $NPCList[0].lefthand to "arms">>
<</if>>
<<set $NPCList[0].righthand to 0>>
<<set $position to "missionary">>
<<set $combatgoal to "strip">>
<<set $NPCList[0].mouth to "speech_only">>
<</widget>>

<<widget "npcstripall">>
<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $position to "missionary">>
<<set $combatgoal to "strip">>
<<set $NPCList[0].mouth to "speech_only">>
<</widget>>

<<widget "npcspank">>
<<if $rightarm is 0>>
	<<set $rightarm to "grappled">>
	<<set $NPCList[0].lefthand to "arms">>
<</if>>
<<if $leftarm is 0>>
	<<set $leftarm to "grappled">>
	<<set $NPCList[0].lefthand to "arms">>
<</if>>
<<set $NPCList[0].righthand to "spank">>
<<set $position to "doggy">>
<</widget>>

<<widget "npcspankgag">>
<<hand_gag 0 left>>
<<set $NPCList[0].righthand to "spank">>
<<set $position to "doggy">>
<</widget>>

<<widget "npcgloryhole">>
<<set $gloryhole to 1>>
<<set $punishmentposition to "gloryhole">>
<<set $enemyhealthmax to 10>><<set $enemyhealth to 10>>
<<set $enemytrust += 100>>
<<set $NPCList[0].lefthand to "none">>
<<set $position to "doggy">>
<<set $NPCList[0].righthand to "none">>
<<set $NPCList[0].mouth to "speech_only">>
<<if $NPCList[0].penis isnot "none">>
	<<set $NPCList[0].penis to 0>>
<</if>>
<<if $NPCList[0].vagina isnot "none">>
	<<set $NPCList[0].vagina to 0>>
<</if>>
<</widget>>

<<widget "npcfence">>
<<set $NPCList[0].lefthand to "none">>
<<set $NPCList[0].righthand to "none">>
<<set $NPCList[0].mouth to "speech_only">>
<<if $NPCList[0].penis isnot "none">>
	<<set $NPCList[0].penis to 0>>
<</if>>
<<if $NPCList[0].vagina isnot "none">>
	<<set $NPCList[0].vagina to 0>>
<</if>>
<</widget>>

<<widget "npc_attempt_sex">>
<<if $NPCList[0].penis isnot "none">>
	<<if $player.vaginaExist>>
		<<set $NPCList[0].penis to "vaginaentrance">><<set $vaginause to "penis">><<set $vaginastate to "entrance">><<set $vaginatarget to 0>>
	<<elseif $analdisable is "f">>
		<<set $NPCList[0].penis to "anusentrance">><<set $anususe to "penis">><<set $anusstate to "entrance">><<set $anustarget to 0>>
	<</if>>
<<else>>
	<<if $player.penisExist>>
		<<set $NPCList[0].vagina to "penisentrance">><<set $penisuse to "othervagina">><<set $penisstate to "entrance">><<set $penistarget to 0>>
	<</if>>
<</if>>
<</widget>>

<<widget "npc_submissive">>
<<if $NPCList[0].penis isnot "none">>
	<<set $NPCList[0].penis to "clothed">>
<</if>>
<<if $NPCList[0].vagina isnot "none">>
	<<set $NPCList[0].vagina to "clothed">>
<</if>>
<<set $NPCList[0].lefthand to "idle">>
<<set $NPCList[0].righthand to "idle">>
<<set $NPCList[0].location.genitals to 0>>
<<set $enemyarousal to 0>>
<<set $npcSub to 1>>
<<set $promiscuityIgnore to 1>>
Your partner is submissive. You may take the lead. [Promiscuity requirements will be ignored for this encounter]
<</widget>>


code:
:: Widgets NPC Damage [widget]
<<widget "npcdamage">>

<<set _thenpc to $args[0]>>

<<if $NPCList[_thenpc].stance isnot "defeated" and $NPCList[_thenpc].health lte 0>>
	<<defeatnpc _thenpc>>
<</if>>

<</widget>>

<<widget "defeatnpc">>

<<set _i to $args[0]>>
<<personselect _i>>
<<combatPerson>> staggers back, defeated.
<<llpain>><<llstress>><<lltrauma>>

<<if $NPCList[_i].penis is "anus" or $NPCList[_i].penis is "anusimminent" or $NPCList[_i].penis is "anusentrance">>
	<<set $anusstate to 0>><<set $anususe to 0>>
<</if>>
<<if $NPCList[_i].penis is "vagina" or $NPCList[_i].penis is "vaginaimminent" or $NPCList[_i].penis is "vaginaentrance">>
	<<set $vaginastate to 0>><<set $vaginause to 0>>
<</if>>
<<if $NPCList[_i].penis is "mouth" or $NPCList[_i].penis is "mouthimminent" or $NPCList[_i].penis is "mouthentrance">>
	<<set $mouthstate to 0>><<set $mouthuse to 0>>
<</if>>
<<if $NPCList[_i].penis is "anusdouble" or $NPCList[_i].penis is "anusdoubleimminent" or $NPCList[_i].penis is "anusdoubleentrance">>
	<<set _otherNPCindex to "f">>
	<<if _i is $anustarget>>
		<<set _otherNPCindex to $anusdoubletarget>>
	<<else>>
		<<set _otherNPCindex to $anustarget>>
	<</if>>
	<<if _otherNPCindex isnot "f" and $NPCList[_otherNPCindex].penis isnot 0 and $NPCList[_otherNPCindex].penis.includes("double")>>
		<<switch $NPCList[_otherNPCindex].penis>>
			<<case "anusdouble">>
				<<set $NPCList[_otherNPCindex].penis to "anus">>
				<<set $anusstate to "penetrated">><<set $anususe to "penis">>
			<<case "anusdoubleentrance">>
				<<set $NPCList[_otherNPCindex].penis to "anusentrance">>
				<<set $anusstate to "entrance">><<set $anususe to "penis">>
			<<case "anusdoubleimminent">>
				<<set $NPCList[_otherNPCindex].penis to "anusimminent">>
				<<set $anusstate to "imminent">><<set $anususe to "penis">>
		<</switch>>
	<<else>>
		<<set $anusstate to 0>><<set $anususe to 0>>
	<</if>>
<</if>>
<<if $NPCList[_i].penis is "vaginadouble" or $NPCList[_i].penis is "vaginadoubleimminent" or $NPCList[_i].penis is "vaginadoubleentrance">>
	<<set _otherNPCindex to "f">>
	<<if _i is $vaginatarget>>
		<<set _otherNPCindex to $vaginadoubletarget>>
	<<else>>
		<<set _otherNPCindex to $vaginatarget>>
	<</if>>
	<<if _otherNPCindex isnot "f" and $NPCList[_otherNPCindex].penis isnot 0 and $NPCList[_otherNPCindex].penis.includes("double")>>
		<<switch $NPCList[_otherNPCindex].penis>>
			<<case "vaginadouble">>
				<<set $NPCList[_otherNPCindex].penis to "vagina">>
				<<set $vaginastate to "penetrated">><<set $vaginause to "penis">>
			<<case "vaginadoubleentrance">>
				<<set $NPCList[_otherNPCindex].penis to "vaginaentrance">>
				<<set $vaginastate to "entrance">><<set $vaginause to "penis">>
			<<case "vaginadoubleimminent">>
				<<set $NPCList[_otherNPCindex].penis to "vaginaimminent">>
				<<set $vaginastate to "imminent">><<set $vaginause to "penis">>
		<</switch>>
	<<else>>
		<<set $vaginastate to 0>><<set $vaginause to 0>>
	<</if>>
<</if>>

<<if $NPCList[_i].vagina is "penis" or $NPCList[_i].vagina is "penisimminent" or $NPCList[_i].vagina is "penisentrance">>
	<<set $penisstate to 0>><<set $penisuse to 0>>
<</if>>
<<if $NPCList[_i].mouth is "penis" or $NPCList[_i].mouth is "penisimminent" or $NPCList[_i].mouth is "penisentrance">>
	<<set $mouthstate to 0>><<set $mouthuse to 0>>
<</if>>
<<if $NPCList[_i].vagina is "otheranus" or $NPCList[_i].vagina is "otheranusimminent" or $NPCList[_i].vagina is "otheranusentrance">>
	<<set $penisstate to 0>><<set $penisuse to 0>>
<</if>>
<<if $NPCList[_i].penis is "otheranus" or $NPCList[_i].penis is "otheranusimminent" or $NPCList[_i].penis is "otheranusentrance">>
	<<set $penisstate to 0>><<set $penisuse to 0>>
<</if>>

<<if $NPCList[_i].vagina is "vagina" or $NPCList[_i].vagina is "vaginaimminent" or $NPCList[_i].vagina is "vaginaentrance">>
	<<set $vaginastate to 0>><<set $vaginause to 0>>
<</if>>
<<if $NPCList[_i].penis is "penis" or $NPCList[_i].penis is "penisimminent" or $NPCList[_i].penis is "penisentrance">>
	<<set $penisstate to 0>><<set $penisuse to 0>>
<</if>>

<<if $NPCList[_i].mouth is "anus" or $NPCList[_i].mouth is "anusimminent" or $NPCList[_i].mouth is "anusentrance">>
	<<set $anusstate to 0>><<set $anususe to 0>>
<</if>>
<<if $NPCList[_i].mouth is "vagina" or $NPCList[_i].mouth is "vaginaimminent" or $NPCList[_i].mouth is "vaginaentrance">>
	<<set $vaginastate to 0>><<set $vaginause to 0>>
<</if>>
<<if $NPCList[_i].mouth is "kiss" or $NPCList[_i].mouth is "kissimminent" or $NPCList[_i].mouth is "kissentrance">>
	<<set $mouthstate to 0>><<set $mouthuse to 0>>
<</if>>

<<if $NPCList[_i].penis is "feet">><<set $feetstate to 0>><<set $feetuse to 0>><</if>>
<<if $NPCList[_i].vagina is "feet">><<set $feetstate to 0>><<set $feetuse to 0>><</if>>

<<if $NPCList[_i].penis is "footjob" or $NPCList[_i].vagina is "footjob">>
	<<if $player.penisExist and $penisuse is "feet">>
		<<set $penisuse to 0>>
	<<elseif $vaginause is "feet">>
		<<set $vaginause to 0>>
	<</if>>
<</if>>

<<if $NPCList[0].chest is "mouth" or $NPCList[0].chest is "mouthentrance">>
	<<set $mouthstate to 0>><<set $mouthuse to 0>>
<</if>>

<<if $NPCList[_i].lefthand is "arms" or $NPCList[_i].righthand is "arms">>
	<<set $leftarm to 0>><<set $rightarm to 0>>
<</if>>

<<if $NPCList[_i].lefthand is "throat" or $NPCList[_i].righthand is "throat">>
	<<set $neckuse to 0>>
<</if>>

<<if $NPCList[_i].vagina is "facesit" or $NPCList[_i].vagina is "facesitanal" or $NPCList[_i].penis is "mouthotheranus">>
	<<set $mouthstate to 0>><<set $mouthuse to 0>>
<</if>>

<<set $NPCList[_i].lefthand to "none">>
<<set $NPCList[_i].righthand to "none">>
<<set $NPCList[_i].penis to "none">>
<<set $NPCList[_i].vagina to "none">>
<<set $NPCList[_i].mouth to "none">>
<<set $NPCList[_i].chest to "none">>
<<set $NPCList[_i].stance to "defeated">>

<<set $enemyno-->>

<<set $enemyarousalmax to 500 * $enemyno>>
<<set $enemyarousal to $enemyarousal * ($enemyno / ($enemyno +1))>>
<<set $enemyhealthmax -= $NPCList[_i].healthmax>>
<<set $_excessdamage to (0-$NPCList[_i].health)>><<if $debug is 1>>
 Excess damage: $_excessdamage
<</if>>
<<set $NPCList[_i].health to 0>>
<<set $enemyhealth to 0>>
<<set $oldtarget to _i>>
<<for _returnHP to 0; _returnHP lt $enemynomax; _returnHP++>>
	<<if $NPCList[_returnHP].active is "active" and $NPCList[_returnHP].stance isnot "defeated">>
		<<set $NPCList[_returnHP].health -= $_excessdamage>>
		<<if $newtarget is undefined>>
			<<set $newtarget to _returnHP>>
		<</if>>
		<<set $_excessdamage to 0>>
		<<set $enemyhealth += $NPCList[_returnHP].health>>
	<</if>>
<</for>>

<<violence -10>>
<<if $newtarget is undefined>>
	<<set $newtarget to $oldtarget>>
<</if>>

<</widget>>

<<widget "setnewtarget">>
<<if $lefttarget is $oldtarget>>
	<<set $lefttarget to $newtarget>>
<</if>>
<<if $righttarget is $oldtarget>>
	<<set $righttarget to $newtarget>>
<</if>>
<<if $feettarget is $oldtarget>>
	<<set $feettarget to $newtarget>>
<</if>>
<<if $mouthtarget is $oldtarget>>
	<<set $mouthtarget to $newtarget>>
<</if>>
<<if $vaginatarget is $oldtarget>>
	<<set $vaginatarget to $newtarget>>
<</if>>
<<if $penistarget is $oldtarget>>
	<<set $penistarget to $newtarget>>
<</if>>
<<if $anustarget is $oldtarget>>
	<<set $anustarget to $newtarget>>
<</if>>
<<if $thightarget is $oldtarget>>
	<<set $thighaction to 0>>
<</if>>
<<if $chesttarget is $oldtarget>>
	<<set $chestaction to 0>>
<</if>>
<<unset $oldtarget>>
<<unset $newtarget>>
<</widget>>


code:
:: Widgets NPC Generation [widget]
<<widget "generateNPC">>
<!-- Args are NPC#(1-6), Status, Pronoun, Gender, Level -->
<!-- Example: <<generateNPC 1 a m m 18>> would generate NPC 1 as adult male/male "burly" -->
<!-- Example: <<generateNPC 2 a f f 18>> would generate NPC 2 as adult female/female "vulgar" bodyguard type-->
<!-- Example: <<generateNPC 1 a f h 20>> would generate NPC 1 as adult female/herm "demon" monster type-->
<!-- Latter two examples can only be called via this widget; they are not autogenerated -->

<<set _n to $args[0]-1>>
<!-- Checks if endevent was properly used after the last event -->
<<checkEventNPC _n>>
<<set _status to $args[1]>> /* "t" for teen or "a" for adult */
<<set _pronoun to $args[2]>>
<<set _gender to $args[3]>>
<<set _lvl to $args[4]>>

<<if _pronoun is "m" or _pronoun is "f">>
	<<set $NPCList[_n].pronoun to _pronoun>>
<<else>>
	<<set $rng to random(1, 100)>>
	<<if _generate_victim is 1>>
		<<unset _generate_victim>>
		<<set $NPCList[_n].pronoun to ($rng lte $malevictimchance ? "m" : "f")>>
	<<elseif _generate_partner is 1>>
		<<unset _generate_partner>>
		<!-- This uses NPCList[0] to determine if the couple is homo or not. Maybe change it to be n-1? What if the partners are in slots 1 and 2? -->
		<<set $NPCList[_n].pronoun to ($rng lte $homochance ? $NPCList[0].pronoun : ($NPCList[0].pronoun is "f" ? "m" : "f"))>>
	<<else>>
		<<set $NPCList[_n].pronoun to ($rng lte $malechance ? "m" : "f")>>
	<</if>>
<</if>>

<!-- This doesn't need to be set here, but that's how it's been done in the past, so we'll set it just in case. -->
<!-- NPC gender gets properly set according to player settings in the npcattribute widget. -->
<<set $NPCList[_n].gender to $NPCList[_n].pronoun>>

<<set $NPCList[_n].lefthand to 0>>
<<set $NPCList[_n].righthand to 0>>
<<set $NPCList[_n].mouth to 0>>
<<set $NPCList[_n].location to {}>>
<<set $NPCList[_n].location.head to 0>>
<<set $NPCList[_n].location.genitals to 0>>
<<set $NPCList[_n].bold to 0>>
<<set $NPCList[_n].name to ($NPCList[_n].pronoun is "f" ? $NPC_names_f.random() : $NPC_names_m.random())>>

<<generatePronouns $NPCList[_n]>>

<!-- TODO: remove either .teen or .adult; all adults are not teens, and all teens are not adults. -->
<!-- Having two separate variables means having twice as much code to accomplish the same thing, and STILL possibly introducing bugs if you do it wrong. -->
<<if _status is "t">>
	<<set $NPCList[_n].teen to 1>>
	<<set $NPCList[_n].adult to 0>>
<<else>>
	<<set $NPCList[_n].adult to 1>>
	<<set $NPCList[_n].teen to 0>>
<</if>>

<<set $NPCList[_n].pregnancyAvoidance to random(0,100)>>
<<set $NPCList[_n].condom to false>>

<<if $enemyno lt 6>><<set $enemyno += 1>><</if>>

<<npcattribute _n _gender _lvl>>

<<run EventSystem.Push($passage, _n, $time)>>
<</widget>>

<<widget "generateRole">>
	<!-- Argument 1: The slot the new NPC should fill in $NPCList. Slot one would be "0" -->
	<!-- Argument 2: The description of the NPC. To generate a default description, use 0
	To make a description that changes based on NPC gender, split the male/female descriptions with "/"-->
	<!-- Argument 3: The role of the NPC. To generate with no role, use 0. Do not set role to "normal"
	To make a role that changes based on NPC gender, split the male/female roles with "/"-->
	<!-- Argument 4: The status of the NPC. Defaults to adult; use "t" for student -->
	<!-- Example: <<generateRole 0 "curious" "scientist">> would generate the first NPC as adult "curious scientist" -->
	<!-- Example: <<generateRole 1 "arrogant" 0 t>> would generate the second NPC as "arrogant boy" or "arrogant girl"-->
	<!-- Example: <<generateRole 2 "starstruck" "fanboy/fangirl">> would generate the third NPC as adult "starstruck fanboy" or "starstruck fangirl" -->
	<<set _slot to $args[0]>>
	<<set _desc to $args[1] ? $args[1] : 0>>
	<<set _role to $args[2] ? $args[2] : 0>>
	<<set _status to $args[3] is "t" ? "t" : "a">>

	<<generateNPC _slot+1 _status>>

	<<if _desc>>
		<<if _desc.includes("/")>>
			<<set [_descM, _descF] to _desc.split("/")>>
			<<set $NPCList[_slot].description to $NPCList[_slot].pronoun is "m" ? _descM : _descF>>
		<<else>>
			<<set $NPCList[_slot].description to _desc>>
		<</if>>
	<</if>>
	<<if _role>>
		<<if _role.includes("/")>>
			<<set [_roleM, _roleF] to _role.split("/")>>
			<<set $NPCList[_slot].role to $NPCList[_slot].pronoun is "m" ? _roleM : _roleF>>
		<<else>>
			<<set $NPCList[_slot].role to _role>>
		<</if>>
	<</if>>

	<<set $NPCList[_slot].fullDescription to $NPCList[_slot].description + " ">>
	<<if $NPCList[_slot].role isnot "normal">>
		<<set $NPCList[_slot].fullDescription += $NPCList[_slot].role>>
	<<elseif $NPCList[_slot].pronoun is "m">>
		<<set $NPCList[_slot].fullDescription += ($NPCList[_slot].teen is 1 ? "boy" : "man")>>
	<<elseif $NPCList[_slot].pronoun is "f">>
		<<set $NPCList[_slot].fullDescription += ($NPCList[_slot].teen is 1 ? "girl" : "woman")>>
	<</if>>
<</widget>>

<<widget "generate1">>
<<generateNPC 1>>
<</widget>>

<<widget "generate2">>
<<generateNPC 2>>
<</widget>>

<<widget "generate3">>
<<generateNPC 3>>
<</widget>>

<<widget "generate4">>
<<generateNPC 4>>
<</widget>>

<<widget "generate5">>
<<generateNPC 5>>
<</widget>>

<<widget "generate6">>
<<generateNPC 6>>
<</widget>>

<<widget "generatey1">>
<<generateNPC 1 t>>
<</widget>>

<<widget "generatey2">>
<<generateNPC 2 t>>
<</widget>>

<<widget "generatey3">>
<<generateNPC 3 t>>
<</widget>>

<<widget "generatey4">>
<<generateNPC 4 t>>
<</widget>>

<<widget "generatey5">>
<<generateNPC 5 t>>
<</widget>>

<<widget "generatey6">>
<<generateNPC 6 t>>
<</widget>>

<<widget "generatec1">>
<<generateNPC 1 t>>
<</widget>>

<<widget "generatec2">>
<<generateNPC 2 t>>
<</widget>>

<<widget "generatec3">>
<<generateNPC 3 t>>
<</widget>>

<<widget "generatec4">>
<<generateNPC 4 t>>
<</widget>>

<<widget "generatec5">>
<<generateNPC 5 t>>
<</widget>>

<<widget "generatec6">>
<<generateNPC 6 t>>
<</widget>>

<<widget "generatev1">>
<<set _generate_victim to 1>>
<<generateNPC 1>>
<</widget>>

<<widget "generatev2">>
<<set _generate_victim to 1>>
<<generateNPC 2>>
<</widget>>

<<widget "generatev3">>
<<set _generate_victim to 1>>
<<generateNPC 3>>
<</widget>>

<<widget "generatev4">>
<<set _generate_victim to 1>>
<<generateNPC 4>>
<</widget>>

<<widget "generatev5">>
<<set _generate_victim to 1>>
<<generateNPC 5>>
<</widget>>

<<widget "generatev6">>
<<set _generate_victim to 1>>
<<generateNPC 6>>
<</widget>>

<<widget "generateyv1">>
<<set _generate_victim to 1>>
<<generateNPC 1 t>>
<</widget>>

<<widget "generateyv2">>
<<set _generate_victim to 1>>
<<generateNPC 2 t>>
<</widget>>

<<widget "generateyv3">>
<<set _generate_victim to 1>>
<<generateNPC 3 t>>
<</widget>>

<<widget "generateyv4">>
<<set _generate_victim to 1>>
<<generateNPC 4 t>>
<</widget>>

<<widget "generateyv5">>
<<set _generate_victim to 1>>
<<generateNPC 5 t>>
<</widget>>

<<widget "generateyv6">>
<<set _generate_victim to 1>>
<<generateNPC 6 t>>
<</widget>>

<<widget "generatep2">>
<<set _generate_partner to 1>>
<<generateNPC 2>>
<</widget>>

<<widget "generatep3">>
<<set _generate_partner to 1>>
<<generateNPC 3>>
<</widget>>

<<widget "generatep4">>
<<set _generate_partner to 1>>
<<generateNPC 4>>
<</widget>>

<<widget "generatep5">>
<<set _generate_partner to 1>>
<<generateNPC 5>>
<</widget>>

<<widget "generatep6">>
<<set _generate_partner to 1>>
<<generateNPC 6>>
<</widget>>

<<widget "generateyp2">>
<<set _generate_partner to 1>>
<<generateNPC 2 t>>
<</widget>>

<<widget "generateyp3">>
<<set _generate_partner to 1>>
<<generateNPC 3 t>>
<</widget>>

<<widget "generateyp4">>
<<set _generate_partner to 1>>
<<generateNPC 4 t>>
<</widget>>

<<widget "generateyp5">>
<<set _generate_partner to 1>>
<<generateNPC 5 t>>
<</widget>>

<<widget "generateyp6">>
<<set _generate_partner to 1>>
<<generateNPC 6 t>>
<</widget>>

<<widget "generatel">>

<<if $location is "beach">>
	<<if $enemyno is 0>>
		<<generatey1>>
	<<elseif $enemyno is 1>>
		<<generatey2>>
	<<elseif $enemyno is 2>>
		<<generatey3>>
	<<elseif $enemyno is 3>>
		<<generatey4>>
	<<elseif $enemyno is 4>>
		<<generatey5>>
	<<elseif $enemyno is 5>>
		<<generatey6>>
	<</if>>
<<else>>
	<<if $enemyno is 0>>
		<<generate1>>
	<<elseif $enemyno is 1>>
		<<generate2>>
	<<elseif $enemyno is 2>>
		<<generate3>>
	<<elseif $enemyno is 3>>
		<<generate4>>
	<<elseif $enemyno is 4>>
		<<generate5>>
	<<elseif $enemyno is 5>>
		<<generate6>>
	<</if>>
<</if>>

<</widget>>

<<widget "generates1">>
<<generatey1>>
<</widget>>

<<widget "generates2">>
<<generatey2>>
<</widget>>

<<widget "generates3">>
<<generatey3>>
<</widget>>

<<widget "generates4">>
<<generatey4>>
<</widget>>

<<widget "generates5">>
<<generatey5>>
<</widget>>

<<widget "generates6">>
<<generatey6>>
<</widget>>

<<widget "generatesm1">>
<<generateym1>>
<</widget>>

<<widget "generatesm2">>
<<generateym2>>
<</widget>>

<<widget "generatesm3">>
<<generateym3>>
<</widget>>

<<widget "generatesm4">>
<<generateym4>>
<</widget>>

<<widget "generatesm5">>
<<generateym5>>
<</widget>>

<<widget "generatesm6">>
<<generateym6>>
<</widget>>

<<widget "generatesf1">>
<<generateyf1>>
<</widget>>

<<widget "generatesf2">>
<<generateyf2>>
<</widget>>

<<widget "generatesf3">>
<<generateyf3>>
<</widget>>

<<widget "generatesf4">>
<<generateyf4>>
<</widget>>

<<widget "generatesf5">>
<<generateyf5>>
<</widget>>

<<widget "generatesf6">>
<<generateyf6>>
<</widget>>

<<widget "generatem1">>
<<generateNPC 1 a m>>
<</widget>>

<<widget "generatem2">>
<<generateNPC 2 a m>>
<</widget>>

<<widget "generatem3">>
<<generateNPC 3 a m>>
<</widget>>

<<widget "generatem4">>
<<generateNPC 4 a m>>
<</widget>>

<<widget "generatem5">>
<<generateNPC 5 a m>>
<</widget>>

<<widget "generatem6">>
<<generateNPC 6 a m>>
<</widget>>

<<widget "generatef1">>
<<generateNPC 1 a f>>
<</widget>>

<<widget "generatef2">>
<<generateNPC 2 a f>>
<</widget>>

<<widget "generatef3">>
<<generateNPC 3 a f>>
<</widget>>

<<widget "generatef4">>
<<generateNPC 4 a f>>
<</widget>>

<<widget "generatef5">>
<<generateNPC 5 a f>>
<</widget>>

<<widget "generatef6">>
<<generateNPC 6 a f>>
<</widget>>

<<widget "generateym1">>
<<generateNPC 1 t m>>
<</widget>>

<<widget "generateym2">>
<<generateNPC 2 t m>>
<</widget>>

<<widget "generateym3">>
<<generateNPC 3 t m>>
<</widget>>

<<widget "generateym4">>
<<generateNPC 4 t m>>
<</widget>>

<<widget "generateym5">>
<<generateNPC 5 t m>>
<</widget>>

<<widget "generateym6">>
<<generateNPC 6 t m>>
<</widget>>

<<widget "generateyf1">>
<<generateNPC 1 t f>>
<</widget>>

<<widget "generateyf2">>
<<generateNPC 2 t f>>
<</widget>>

<<widget "generateyf3">>
<<generateNPC 3 t f>>
<</widget>>

<<widget "generateyf4">>
<<generateNPC 4 t f>>
<</widget>>

<<widget "generateyf5">>
<<generateNPC 5 t f>>
<</widget>>

<<widget "generateyf6">>
<<generateNPC 6 t f>>
<</widget>>

<<widget "generatecm1">>
<<generateNPC 1 t m>>
<</widget>>

<<widget "generatecm2">>
<<generateNPC 2 t m>>
<</widget>>

<<widget "generatecm3">>
<<generateNPC 3 t m>>
<</widget>>

<<widget "generatecm4">>
<<generateNPC 4 t m>>
<</widget>>

<<widget "generatecm5">>
<<generateNPC 5 t m>>
<</widget>>

<<widget "generatecm6">>
<<generateNPC 6 t m>>
<</widget>>

<<widget "generatecf1">>
<<generateNPC 1 t f>>
<</widget>>

<<widget "generatecf2">>
<<generateNPC 2 t f>>
<</widget>>

<<widget "generatecf3">>
<<generateNPC 3 t f>>
<</widget>>

<<widget "generatecf4">>
<<generateNPC 4 t f>>
<</widget>>

<<widget "generatecf5">>
<<generateNPC 5 t f>>
<</widget>>

<<widget "generatecf6">>
<<generateNPC 6 t f>>
<</widget>>

<<widget "generateChastity1">>
<<set _npcChastity to 1>>
<<generateNPC 1>>
<</widget>>

<<widget "generateChastity2">>
<<set _npcChastity to 1>>
<<generateNPC 2>>
<</widget>>

<<widget "generateChastity3">>
<<set _npcChastity to 1>>
<<generateNPC 3>>
<</widget>>

<<widget "generateChastity4">>
<<set _npcChastity to 1>>
<<generateNPC 4>>
<</widget>>

<<widget "generateChastity5">>
<<set _npcChastity to 1>>
<<generateNPC 5>>
<</widget>>

<<widget "generateChastity6">>
<<set _npcChastity to 1>>
<<generateNPC 6>>
<</widget>>

<<widget "generatePlant1">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 1 t>>
<</widget>>

<<widget "generatePlant2">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 2 t>>
<</widget>>

<<widget "generatePlant3">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 3 t>>
<</widget>>

<<widget "generatePlant4">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 4 t>>
<</widget>>

<<widget "generatePlant5">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 5 t>>
<</widget>>

<<widget "generatePlant6">>
<<set _npcPlant to 1>><<set _strapIgnore to 1>>
<<generateNPC 6 t>>
<</widget>>

<<widget "generateCultist1">>
<<generate1>>
<<if $awareness gte 650>>
	<<set $NPCList[0].role to "cultist">>
<<else>>
	<<set $NPCList[0].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateCultist2">>
<<generate2>>
<<if $awareness gte 650>>
	<<set $NPCList[1].role to "cultist">>
<<else>>
	<<set $NPCList[1].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateCultist3">>
<<generate3>>
<<if $awareness gte 650>>
	<<set $NPCList[2].role to "cultist">>
<<else>>
	<<set $NPCList[2].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateCultist4">>
<<generate4>>
<<if $awareness gte 650>>
	<<set $NPCList[3].role to "cultist">>
<<else>>
	<<set $NPCList[3].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateCultist5">>
<<generate5>>
<<if $awareness gte 650>>
	<<set $NPCList[4].role to "cultist">>
<<else>>
	<<set $NPCList[4].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateCultist6">>
<<generate6>>
<<if $awareness gte 650>>
	<<set $NPCList[5].role to "cultist">>
<<else>>
	<<set $NPCList[5].role to "acolyte">>
<</if>>
<</widget>>

<<widget "generateZealot1">>
<<generate1>>
<<if $awareness gte 650>>
	<<set $NPCList[0].role to "zealot">>
<<else>>
	<<set $NPCList[0].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateZealot2">>
<<generate2>>
<<if $awareness gte 650>>
	<<set $NPCList[1].role to "zealot">>
<<else>>
	<<set $NPCList[1].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateZealot3">>
<<generate3>>
<<if $awareness gte 650>>
	<<set $NPCList[2].role to "zealot">>
<<else>>
	<<set $NPCList[2].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateZealot4">>
<<generate4>>
<<if $awareness gte 650>>
	<<set $NPCList[3].role to "zealot">>
<<else>>
	<<set $NPCList[3].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateZealot5">>
<<generate5>>
<<if $awareness gte 650>>
	<<set $NPCList[4].role to "zealot">>
<<else>>
	<<set $NPCList[4].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateZealot6">>
<<generate6>>
<<if $awareness gte 650>>
	<<set $NPCList[5].role to "zealot">>
<<else>>
	<<set $NPCList[5].role to "apostle">>
<</if>>
<</widget>>

<<widget "generateDoppel">>
<<set _pAppearance to $player.gender_appearance>>
<<set _pGender to $player.gender>>
<<if $physique gte $physiquemax>>
	<<set _pLevel to 15>>
<<elseif $physique gte ($physiquemax / 5) * 4>>
	<<set _pLevel to 17>>
<<elseif $physique gte ($physiquemax / 5) * 3>>
	<<set _pLevel to 13>>
<<elseif $physique gte ($physiquemax / 5) * 2>>
	<<set _pLevel to 2>>
<<elseif $physique gte ($physiquemax / 5)>>
	<<set _pLevel to 3>>
<<else>>
	<<set _pLevel to 4>>
<</if>>
<<set $NPCList[0].role to "reflection">>
<<set $pronoun to "i">>
<<generateNPC 1 t _pAppearance _pGender _pLevel>>
<</widget>>

<<widget "npcattribute">>
<!-- V2.4 Widget set NPC attributes. $arg[0] calls NPC number (0 - 5) to be generated. NG-->
<!-- $NPCList.pronoun sets appearance, including breasts. NPCList.gender sets genitals, including pp -->
<!-- Future work this should call addns args to set pronoun, gender, and size of NPC(0-18) where larger number is more robust. This would eliminate much of the NPC calls from above and push to code. -->
<!-- Added thug Vulgar/Brutish as NPC19, can only be called with $arg[2] -->
<!-- Added strap-on functionality v2.8 -->

<!-- check if this npc has seen the player while the player was pantiless; doesn't matter if they knew it or not. -->
<<nounderwearcheck>>

<<set _n to $args[0]>>
<<set _gender to $args[1]>>
<<set _lvl to $args[2]>>

<!-- This sets genitals. -->
<!-- v2.6 adding herm demon as gender "h", must be directly called NG -->
<<set $NPCList[_n].vagina to "none">>
<<set $NPCList[_n].penis to "none">>

<<if _gender is "m" or _gender is "f" or _gender is "h">>
	<<set $NPCList[_n].gender to _gender>>
	<<if _gender is "m">>
		<<set $NPCList[_n].penis to "clothed">>
	<<elseif _gender is "f">>
		<<set $NPCList[_n].vagina to "clothed">>
	<<elseif _gender is "h">>
		<<set $NPCList[_n].vagina to "clothed">>
		<<set $NPCList[_n].penis to "clothed">>
	<</if>>
<<else>>
	<<if $NPCList[_n].pronoun is "m">>
		<<if random(0, 99) gte $cbchance>>
			<<set $NPCList[_n].penis to "clothed">>
			<<set $NPCList[_n].gender to "m">>
		<<else>>
			<<set $NPCList[_n].vagina to "clothed">>
			<<set $NPCList[_n].gender to "f">>
		<</if>>
	<<elseif $NPCList[_n].pronoun is "f">>
		<<if random(0, 99) gte $dgchance>>
			<<set $NPCList[_n].vagina to "clothed">>
			<<set $NPCList[_n].gender to "f">>
		<<else>>
			<<set $NPCList[_n].penis to "clothed">>
			<<set $NPCList[_n].gender to "m">>
		<</if>>
	<</if>>
<</if>>

/* _lvl 20 is herm demon. demons don't wear clothes. */
<<if _lvl is 20>>
	<<set $NPCList[_n].vagina to 0>>
	<<set $NPCList[_n].penis to 0>>
<</if>>

<<set $NPCList[_n].chastity to {penis:"", vagina:"", anus:""}>>
<<if _npcChastity is 1>>
	<<unset _npcChastity>>
	<<set _graceCheck to ($grace ? $grace : 25)>>
	<<if random(-100, 120) lte _graceCheck>>
		<<if $NPCList[_n].penis isnot "none">>
			<<set $NPCList[_n].chastity.penis to (random (1, 3) is 1 ? "chastity belt" : "chastity cage")>>
		<</if>>
		<<if $NPCList[_n].vagina isnot "none">>
			<!-- if npc has both, give them the same chastity type on both. -->
			<<set $NPCList[_n].chastity.vagina to ($NPCList[_n].chastity.penis isnot "" ? $NPCList[_n].chastity.penis : "chastity belt")>>
		<</if>>
		<<set $_beltPresent to ($NPCList[_n].chastity.penis is "chastity belt" or $NPCList[_n].chastity.vagina is "chastity belt")>>
		<<if $analdisable is "f" and random(-100, 150) lte _graceCheck and $_beltPresent>>
			<<set $NPCList[_n].chastity.anus to "anal shield">>
		<</if>>
	<</if>>
<</if>>

<<set $NPCList[_n].chest to 0>>

<<set $npcskinselector to ($whitechance + $blackchance)>>
<<if $npcskinselector is 0>>
	<<set $npcskinselector to 1>>
<</if>>
<<set $whitechanceselector to (($whitechance / $npcskinselector) * 100)>>
<<set $blackchanceselector to (($blackchance / $npcskinselector) * 100)>>
<<if random(1, 100) lte $blackchanceselector>>
	<<set $NPCList[_n].skincolour to "black">>
<<else>>
	<<set $NPCList[_n].skincolour to "white">>
<</if>>

<<set $rng to random(1, 100)>>
<<if $rng gte 81>>
	<<if $NPCList[_n].vagina isnot "none" and $NPCList[_n].penis isnot "none">>
		<<set $NPCList[_n].insecurity to ["penis","vagina"].random()>>
	<<elseif $NPCList[_n].penis isnot "none">>
		<<set $NPCList[_n].insecurity to "penis">>
	<<elseif $NPCList[_n].vagina isnot "none">>
		<<set $NPCList[_n].insecurity to "vagina">>
	<<else>>
		<<set $NPCList[_n].insecurity to "perfectly smooth crotch">> /* default case, shouldn't happen. */
	<</if>>
<<elseif $rng gte 61>>
	<<set $NPCList[_n].insecurity to "ethics">>
<<elseif $rng gte 41>>
	<<set $NPCList[_n].insecurity to "weak">>
<<elseif $rng gte 21>>
	<<set $NPCList[_n].insecurity to "skill">>
<<else>>
	<<set $NPCList[_n].insecurity to "looks">>
<</if>>

<!-- Select NPC 1-18 Description/Strength pair. Breast size range bound to Description. NPC19 is Brute NPC20 is Demon-->
<<if _lvl gte 0 and _lvl lte 20>>
	<<set _i to _lvl>>
<<else>>
	<<set _i to random(0, 18)>>
<</if>>

<<if $NPCList[_n].teen is 1>>
	<<if $NPCList[_n].pronoun is "f">> <!-- female appearing student -->
		<<set $_hpMax to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300,400]>>
		<<set $_desc to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","vulgar","minor demon"]>>
		<<set $_breastMin to [0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,5,5,8,3,10,12]>>
		<<set $_breastMax to [4,4,4,4,4,4,7,7,7,7,8,8,8,8,8,11,11,12,10,12,12]>>
	<<else>> <!-- male appearing student -->
		<<set $_hpMax to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300,400]>>
		<<set $_desc to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","brutish","minor demon"]>>
	<</if>>
<<else>>
	<<if $NPCList[_n].pronoun is "f">> <!-- female appearing adult -->
		<<set $_hpMax to [125,175,150,150,150,175,150,200,125,200,275,200,250,250,200,200,250,200,200,350,600]>>
		<<set $_desc to ["slight","lithe","lean","thin","slender","lissome","slim","taut","petite","trim","muscular","curvy","toned","plump","plush","shapely","robust","voluptuous","lush","vulgar","demon"]>>
		<<set $_breastMin to [0,0,0,0,2,2,2,2,2,5,5,5,5,5,5,5,8,8,9,10,12]>>
		<<set $_breastMax to [4,4,4,4,4,4,7,7,8,9,9,9,9,12,10,11,10,11,11,12,12]>>
	<<else>> <!-- male appearing adult -->
		<<set $_hpMax to [125,125,150,150,150,150,175,175,200,200,200,200,250,250,250,250,275,275,275,400,600]>>
		<<set $_desc to ["petite","slight","slim","thin","slender","lanky","lissome","lithe","trim","lean","taut","plump","toned","bulky","broad","robust","rugged","muscular","burly","brutish","demon"]>>
	<</if>>
<</if>>

<!-- Setting pp size limits separately. Changes should track with physical descriptions above, in order. -->
<!-- Brutes and demons always have the largest penis size. -->
<!-- $_penisMin is "smallest possible penis size", $_penisMax is "largest possible penis size" -->
<<if $NPCList[_n].penis isnot "none">>
	<<if $NPCList[_n].teen is 1>>
		<<set $_penisMin to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8]>>
		<<set $_penisMax to [8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]>>
	<<else>>
		<<set $_penisMin to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8]>>
		<<set $_penisMax to [8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]>>
	<</if>>
<</if>>

<<set _brdes to ["nipple","budding","tiny","small","pert","modest","full","large","ample","massive","huge","gigantic","enormous"]>>

<<set $NPCList[_n].healthmax to $_hpMax[_i]>>
<<set $NPCList[_n].health to $NPCList[_n].healthmax>>
<<set $NPCList[_n].description to $_desc[_i]>>

<<if $NPCList[_n].penis isnot "none">><!-- set pp size based on the upper and lower bounds for the selected description -->
	<<if $penis_mod gte $_penisMin[_i]>><<set $_penisMin[_i] to $penis_mod>><</if>>
	<<if $penis_mod gte $_penisMax[_i]>><<set $_penisMax[_i] to $penis_mod>><</if>>
	<<if $penis_mod lt 0>> <!-- Why is this only when $penis_mod is negative? -->
		<<set $_penisMin[_i] to Math.clamp($_penisMin[_i]+$penis_mod, 0, 8)>>
		<<set $_penisMax[_i] to Math.clamp($_penisMax[_i]+$penis_mod, 0, 8)>>
	<</if>>
<</if>>

<<if $NPCList[_n].pronoun is "f">><!-- set breast size based on the upper and lower bounds for the selected description-->
	<<if $breast_mod gte $_breastMin[_i]>><<set $_breastMin[_i] to $breast_mod>><</if>>
	<<if $breast_mod gte $_breastMax[_i]>><<set $_breastMax[_i] to $breast_mod>><</if>>
	<<if $breast_mod lt 0>> <!-- Why is this only when $breast_mod is negative? -->
		<<set $_breastMin[_i] to Math.clamp($_breastMin[_i]+$breast_mod, 0, 12)>>
		<<set $_breastMax[_i] to Math.clamp($_breastMax[_i]+$breast_mod, 0, 12)>>
	<</if>>
<</if>>

<<if $NPCList[_n].pronoun is "f">><<set _rngbr to random($_breastMin[_i], $_breastMax[_i])>><</if>>
<<if $NPCList[_n].penis isnot "none">><<set _rngpp to random($_penisMin[_i], $_penisMax[_i])>><</if>>

<<set $NPCList[_n].fullDescription to $NPCList[_n].description + " ">>
<<if $NPCList[_n].pronoun is "m">>
	<<set $NPCList[_n].fullDescription += ($NPCList[_n].teen is 1 ? "boy" : "man")>>
<<elseif $NPCList[_n].pronoun is "f">>
	<<set $NPCList[_n].fullDescription += ($NPCList[_n].teen is 1 ? "girl" : "woman")>>
<</if>>

<<set $NPCList[_n].role to "normal">>

/*Sets up multiple orgasms, code needs work*/
/*<<set $NPCList[_n].maxOrgasms to 1>>
<<set $NPCList[_n].orgasms to 0>>
<<if $NPCList[_n].fullDescription is "Robin">>
	<<set $NPCList[_n].maxOrgasms to 2>>
	<<set $setupMidOrgasm to true>>
<</if>>
*/

<<if $NPCList[_n].pronoun is "m">>
	<<set $NPCList[_n].breastsize to 0>>
	<<set $NPCList[_n].breastsdesc to "nipples">>
	<<set $NPCList[_n].breastdesc to "nipple">>
<<else>>
	<<if $NPCList[_n].adult is 1>> <!-- set adult breast size -->
		<<set $NPCList[_n].breastsize to _rngbr>>
		<<switch _rngbr>>
		<<case 0>>
			<<set $NPCList[_n].breastsdesc to "nipples">>
			<<set $NPCList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $NPCList[_n].breastsdesc to _brdes[_rngbr]+" breasts">>
			<<set $NPCList[_n].breastdesc to _brdes[_rngbr]+" breast">>
		<</switch>>
	<<else>> <!-- set student breast size -->
		<<set $NPCList[_n].breastsize to _rngbr>>
		<<switch _rngbr>>
		<<case 0>>
			<<set $NPCList[_n].breastsdesc to "nipples">>
			<<set $NPCList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $NPCList[_n].breastsdesc to _brdes[_rngbr]+" breasts">>
			<<set $NPCList[_n].breastdesc to _brdes[_rngbr]+" breast">>
		<</switch>>
	<</if>>
<</if>>

<<if $NPCList[_n].penis isnot "none">>
	<<if $NPCList[_n].adult is 1 or _npcPlant is 1>> <!-- set adult/plantperson pp size -->
		<<switch _rngpp>>
		<<case 0>>
			<<set $NPCList[_n].penisdesc to "tiny penis">>
			<<set $NPCList[_n].penissize to 1>>
		<<case 5 6 7>>
			<<set $NPCList[_n].penisdesc to either("thick cock","hefty cock","big cock","large cock","veiny cock","meaty cock")>>
			<<set $NPCList[_n].penissize to 3>>
		<<case 8>>
			<<set $NPCList[_n].penisdesc to either("massive cock","huge cock","humongous cock","immense cock","gigantic cock","enormous cock")>>
			<<set $NPCList[_n].penissize to 4>>
		<<default>>
			<<set $NPCList[_n].penisdesc to "penis">>
			<<set $NPCList[_n].penissize to 2>>
		<</switch>>
	<<else>> <!-- set student pp size -->
		<<switch _rngpp>>
		<<case 0>>
			<<set $NPCList[_n].penisdesc to "tiny penis">>
			<<set $NPCList[_n].penissize to 1>>
		<<case 7 8>>
			<<set $NPCList[_n].penisdesc to either("thick cock","hefty cock","big cock","large cock","veiny cock","meaty cock")>>
			<<set $NPCList[_n].penissize to 3>>
		<<default>>
			<<set $NPCList[_n].penisdesc to "penis">>
			<<set $NPCList[_n].penissize to 2>>
		<</switch>>
	<</if>>
<</if>>

<<set $rng to random(1, 100)>>
<<if $NPCList[_n].pronoun is "f">>
	<<if $NPCList[_n].adult is 1>><<set $rng += 20>><</if>>
	<<if $rng gte 81>>
		<<set $NPCList[_n].lactation to 1>>
	<<else>>
		<<set $NPCList[_n].lactation to 0>>
	<</if>>
<</if>>

<!-- Sets females with strap-ons as adjustment-->
<<if $NPCList[_n].gender is "f" and !_strapIgnore>>
	<<if random(0, 99) lt $straponchance>>
		<<npcstrapon _n>>
	<</if>>
<</if>>

/*Location is relative to the PC*/
<<set $NPCList[_n].location to {
	head: 0,
	genitals: 0,
}>>

<<set $NPCList[_n].trust to 0>>

<<set _rng to random(1, 6)>>
<<if _rng gte 6>>
	<<set $NPCList[_n].size to "large">>
<<elseif _rng gte 3>>
	<<set $NPCList[_n].size to "normal">>
<<elseif _rng gte 1>>
	<<set $NPCList[_n].size to "small">>
<<else>>
	<<set $NPCList[_n].size to "tiny">>
<</if>>

<<generate_npc_traits>>
<<generate_npc_skills>>

<<if _npcPlant is 1>>
	<<set $NPCList[_n].type to "plant">>
	<<set $NPCList[_n].fullDescription to $NPCList[_n].description + " plant">>
	<<if $NPCList[_n].pronoun is "m">>
		<<set $NPCList[_n].fullDescription += "boy">>
	<<elseif $NPCList[_n].pronoun is "f">>
		<<set $NPCList[_n].fullDescription += "girl">>
	<</if>>
	<<unset _npcPlant>>
<<else>>
	<<set $NPCList[_n].type to "human">>
<</if>>
<</widget>>

<<widget "npcstrapon">>
<!-- NG Converts NPCs to strap-on -->
<<switch $args[0]>>
<<case 0 1 2 3 4 5>>
	<<set _xx to $args[0]>>
<<default>>
	<span class="red">NPCSTRAPON Error: No NPC Identifier</span>
	<br><br>
<</switch>>

<<set $NPCList[_xx].penis to "clothed">>
<<set $NPCList[_xx].vagina to "none">>
<<set $NPCList[_xx].gender to "m">>

<<switch random(1, 4)>>
<<case 1 2 3>>
	<<set $NPCList[_xx].penisdesc to "large "+either("black","red","blue","pink","purple","fleshy")+" strap-on cock">>
	<<set $NPCList[_xx].penissize to 3>>
<<default>>
	<<set $NPCList[_xx].penisdesc to "massive "+either("black","red","blue","pink","purple","fleshy")+" strap-on cock">>
	<<set $NPCList[_xx].penissize to 4>>
<</switch>>

<</widget>>

<<widget "generate_npc_traits">>
<<set $NPCList[_n].traits to []>>
<<set _rng to random(1, 4)>>
<<switch _rng>>
<<case 1>>
	<<set $NPCList[_n].traits.push("relaxed")>>
<<case 2>>
	<<set $NPCList[_n].traits.push("sociable")>>
<<case 3>>
	<<set $NPCList[_n].traits.push("brooding")>>
<<case 4>>
	<<set $NPCList[_n].traits.push("lecher")>>
<</switch>>
/*
<<if random(1, 5) is 5>>
	<<if random(1, 2) is 2>>
		<<set $NPCList[_n].traits.push("lazy")>>
	<<else>>
		<<set $NPCList[_n].traits.push("energetic")>>
	<</if>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("watchful")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("needs glasses")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("scrappy")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("skulduggerous")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("promiscuous")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("exhibitionist")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("deviant")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("willful")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("strong")>>
<</if>>
<<if random(1, 10) is 10>>
	<<set $NPCList[_n].traits.push("beautiful")>>
<</if>>
*/
<</widget>>

<<widget "generate_npc_skills">>
<<set $NPCList[_n].skills to {}>>
<<set $NPCList[_n].skills.security to random(1, 1000)>>
<<set $NPCList[_n].skills.athletics to random(1, 1000)>>
<</widget>>