code:
:: Widgets Missionary [widget]
<<widget "missionaryimg">><<nobr>>

<<closeimg>>

<<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">>
	<<if $enemytype isnot "beast">>

	<</if>>

<</if>>

<<if $vaginastate is "entrance">>
	<<if $enemytype isnot "beast">>

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

<<if $bottomuse is "othermouth">>

<</if>>

<<if $anusstate is "othermouthimminent">>

<</if>>

<<if $anusstate is "othermouthentrance">>

<</if>>

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

	<</if>>

<</if>>

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

	<</if>>
<</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 $swarmfront is 0
and $swarmback is 0
and $swarmfrontinside is 0
and $swarmbackinside is 0
and $beaststance isnot "top">>

<<if $anususe is "penis">>

<<else>>

<</if>>

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

	<<else>>

	<</if>>

	<<if $arousal gte 8000>>

<<elseif $arousal gte 6000>>

<<elseif $arousal gte 4000>>

<<elseif $exposed gte 2>>

<<elseif $arousal gte 2000>>

<<elseif $exposed gte 1>>

<<elseif $arousal gte 100>>

	<</if>>

	<<if $pain gte 80>>

	<<elseif $pain gte 60>>

	<<elseif $pain gte 40>>

	<<elseif $pain gte 20>>

	<</if>>

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

<</if>>

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

<<else>>

<</if>>

<<if $penisexist is 1>>
	<<if $worn.under_lower.type.includes("chastity")>>

	<<elseif $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>
		<<if $penilevirginity is 1>>
			<<if $anususe is "penis">>

			<<else>>

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

			<<else>>

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

<<if $hairlength gte 900>>

<<elseif $hairlength gte 700>>

<<elseif $hairlength gte 600>>

<<elseif $hairlength gte 400>>

<<elseif $hairlength gte 200>>

<<else>>

<</if>>

	<<if $hairlength gte 200>>

	<<else>>

	<</if>>

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

<</if>>

<<breastsidlemissionary>>
<<transformationwolfimgmiss>>

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

<</if>>

<<else>>

<<beastimgmissionary>>

<<if $feetuse is "penis">>

	<<if $enemyarousal gte $enemyarousalmax>>

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

<<else>>

<</if>>

<<if $leftarm is "penis">>

	<<if $enemyarousal gte $enemyarousalmax>>

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

<<if $rightarm is "penis">>

	<<if $enemyarousal gte $enemyarousalmax>>

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

<<elseif $rightarm is "grappled">>

<<elseif $rightarmstate is "tentacle">>
<<elseif $enemytype is "beast" and $monster isnot 1 and $beaststance is "top">>

<<else>>

<</if>>

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

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

	<</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 8000>>

<<elseif $arousal gte 6000>>

<<elseif $arousal gte 4000>>

<<elseif $exposed gte 2>>

<<elseif $arousal gte 2000>>

<<elseif $exposed gte 1>>

<<elseif $arousal gte 100>>

	<</if>>

	<<if $pain gte 80>>

<<elseif $pain gte 60>>

<<elseif $pain gte 40>>

<<elseif $pain gte 20>>

<<else>>

	<</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 isnot "beast">>

		<<if $silhouettedisable is "f">>

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

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

<<if $anusstate is "othermouth">>

<</if>>

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

		<<if $silhouettedisable is "f">>

		<<else>>

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

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

<<if $penisstate is "othermouth">>

<</if>>

<<if $penisstate is "penetrated" and ($enemytype isnot "beast" or $monster is 1) or $penisstate is "otheranus" and ($enemytype isnot "beast" or $monster is 1)>>
		<<if $silhouettedisable is "f">>

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

	<<else>>

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

<<if $penisexist is 1>>
	<<if $worn.under_lower.type.includes("chastity")>>

	<<elseif $penisstate is "penetrated" or $penisstate is "otheranus">>
		<<if $enemytype isnot "beast" or $monster is 1>>
			<<if $penilevirginity is 1>>

			<<else>>

			<</if>>
		<</if>>
	<<elseif $penilevirginity is 1>>

	<<else>>

	<</if>>
	<<if $orgasmdown gte 1 and $penisstate isnot "penetrated" and $orgasmcount lte 24 and $femaleclimax isnot 1>>

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

<<if $hairlength gte 900>>

<<elseif $hairlength gte 700>>

<<elseif $hairlength gte 600>>

<<elseif $hairlength gte 400>>

<<elseif $hairlength gte 200>>

<<else>>

<</if>>

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

<</if>>

<<breastsactivemissionary>>
<<transformationwolfimgmissactive>>

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

<</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 $swarmfront is 0
and $swarmback is 0
and $swarmfrontinside is 0
and $swarmbackinside is 0
and $beaststance isnot "top">>

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

<</if>>

<</nobr>><</widget>>

repo_name: ammm/more

license: mit


code:
:: Widgets Npc Actions [widget]

<<widget "cheeklick">><<nobr>>
	<<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>>
				<<case 2>>
					<<He>> strokes your hair.
					<<neutral 3>>
				<<case 3>>
					<<He>> nibbles your ear.
					<<neutral 3>>
				<<case 4>>
					<<He>> nuzzles your neck.
					<<neutral 3>>
				<</switch>>
			<<else>>
				<<switch random(1, 4)>>
				<<case 1>>
					<<He>> licks your cheek.
					<<neutral 3>>
				<<case 2>>
					<<He>> tugs at your hair.
					<<neutral 3>>
				<<case 3>>
					<<He>> bites your ear.
					<<neutral 3>>
				<<case 4>>
					<<He>> grips your neck.
					<<neutral 3>>
				<</switch>>
			<</if>>
		<</if>>
	<</if>>
<</nobr>><</widget>>


code:
:: Widgets NPC Types [widget]
<<widget "npcstrip">><<nobr>>
<<if $enemyno gte 1>><<set $NPCList[0].anus to "idle">>
	<<if $NPCList[0].gender is "m">>
<<set $NPCList[0].penis to "idle">>
	<<elseif $NPCList[0].gender is "f">>
<<set $NPCList[0].vagina to "idle">>
	<<elseif $NPCList[0].gender is "h">>
<<set $NPCList[0].penis to "idle">>
<<set $NPCList[0].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[0].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[0].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[0].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[0].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[0].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[0].righthand to "underclothes">>
	<</if>>
<</if>>

<<if $enemyno gte 2>><<set $NPCList[1].anus to "idle">>
	<<if $NPCList[1].gender is "m">>
<<set $NPCList[1].penis to "idle">>
	<<elseif $NPCList[1].gender is "f">>
<<set $NPCList[1].vagina to "idle">>
	<<elseif $NPCList[1].gender is "h">>
<<set $NPCList[1].penis to "idle">>
<<set $NPCList[1].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[1].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[1].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[1].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[1].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[1].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[1].righthand to "underclothes">>
	<</if>>
<</if>>

<<if $enemyno gte 3>><<set $NPCList[2].anus to "idle">>
	<<if $NPCList[2].gender is "m">>
<<set $NPCList[2].penis to "idle">>
	<<elseif $NPCList[2].gender is "f">>
<<set $NPCList[2].vagina to "idle">>
	<<elseif $NPCList[2].gender is "h">>
<<set $NPCList[2].penis to "idle">>
<<set $NPCList[2].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[2].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[2].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[2].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[2].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[2].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[2].righthand to "underclothes">>
	<</if>>
<</if>>

<<if $enemyno gte 4>><<set $NPCList[3].anus to "idle">>
	<<if $NPCList[3].gender is "m">>
<<set $NPCList[3].penis to "idle">>
	<<elseif $NPCList[3].gender is "f">>
<<set $NPCList[3].vagina to "idle">>
	<<elseif $NPCList[3].gender is "h">>
<<set $NPCList[3].penis to "idle">>
<<set $NPCList[3].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[3].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[3].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[3].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[3].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[3].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[3].righthand to "underclothes">>
	<</if>>
<</if>>

<<if $enemyno gte 5>><<set $NPCList[4].anus to "idle">>
	<<if $NPCList[4].gender is "m">>
<<set $NPCList[4].penis to "idle">>
	<<elseif $NPCList[4].gender is "f">>
<<set $NPCList[4].vagina to "idle">>
	<<elseif $NPCList[4].gender is "h">>
<<set $NPCList[4].penis to "idle">>
<<set $NPCList[4].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[4].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[4].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[4].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[4].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[4].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[4].righthand to "underclothes">>
	<</if>>
<</if>>

<<if $enemyno gte 6>><<set $NPCList[5].anus to "idle">>
	<<if $NPCList[5].gender is "m">>
<<set $NPCList[5].penis to "idle">>
	<<elseif $NPCList[5].gender is "f">>
<<set $NPCList[5].vagina to "idle">>
	<<elseif $NPCList[5].gender is "h">>
<<set $NPCList[5].penis to "idle">>
<<set $NPCList[5].vagina to "idle">>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
<<set $NPCList[5].lefthand to "upperclothes">>
	<<elseif !$worn.lower.type.includes("naked")>>
<<set $NPCList[5].lefthand to "lowerclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[5].lefthand to "underclothes">>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
<<set $NPCList[5].righthand to "lowerclothes">>
	<<elseif !$worn.upper.type.includes("naked")>>
<<set $NPCList[5].righthand to "upperclothes">>
	<<elseif !$worn.under_lower.type.includes("naked") and !$worn.under_lower.type.includes("chastity")>>
<<set $NPCList[5].righthand to "underclothes">>
	<</if>>
<</if>>

<</nobr>><</widget>>

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

<<widget "npcgag">><<nobr>>
<<set $mouthuse to "lefthand">><<set $NPCList[0].lefthand to "mouth">>
<</nobr>><</widget>>

<<widget "npcoral">><<nobr>>
<<if $NPCList[0].penis isnot "none">>
<<set $NPCList[0].penis to "mouthentrance">><<submission 5>><<set $mouthstate to "entrance">><<set $mouthuse to "penis">>
<<He>> presses <<his>> penis against your lips.

<<elseif $NPCList[0].vagina isnot "none">>
<<submission 5>><<set $mouthuse to "othervagina">><<set $NPCList[0].vagina to "mouth">><<set $mouthstate to "othervagina">>
<<He>> presses <<his>> pussy against your lips.

<</if>>
<</nobr>><</widget>>

<<widget "npchand">><<nobr>>
<<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>>
<</nobr>><</widget>>

<<widget "npcidlegenitals">><<nobr>>
	<<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>>
<</nobr>><</widget>>

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

<<widget "npcexpose">><<nobr>>
	<<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>>
<</nobr>><</widget>>

<<widget "npcspank">><<nobr>>
<<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">>
<</nobr>><</widget>>

<<widget "npcgloryhole">><<nobr>>
<<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 "doggie">>
<<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>>
<</nobr>><</widget>>


code:
:: Widgets NPC Generation [widget]
<<widget "generateNPC">><<nobr>>
<!-- 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" -->

<!-- Checks if endevent was properly used after the last event -->
<<if $enemyno gte 1>>
<<set $endeventerror to $lastgenerated>>
<</if>>
<<set $lastgenerated to $passage>>

<<set _n to $args[0]-1>>
<<set _stat to $args[1]>>
<<set _pro to $args[2]>>
<<set _gen to $args[3]>>
<<set _lvl to $args[4]>>

<<if _pro is "m" or _pro is "f">>
	<<set $NPCList[_n].pronoun to _pro>>
<<else>>
	<<set $rng to random(1, 100)>>
	<<if $malechance lt $rng>>
	<<set $NPCList[_n].gender to "f">><<set $NPCList[_n].pronoun to "f">>
	<<else>>
	<<set $NPCList[_n].gender to "m">><<set $NPCList[_n].pronoun to "m">>
	<</if>>
<</if>>

<<set $NPCList[_n].lefthand to 0>>
<<set $NPCList[_n].righthand to 0>>
<<set $NPCList[_n].mouth to 0>>

<<if _stat is "t">>
	<<set $NPCList[_n].teen to 1>>
<<else>>
	<<set $NPCList[_n].adult to 1>>
<</if>>

<<set $enemyno += 1>>

<<npcattribute _n _gen _lvl>>

<</nobr>><</widget>>

<<widget "generate1">><<nobr>>

/*Checks if endevent was properly used after the last event*/

<<if $enemyno gte 1>>
<<set $endeventerror to $lastgenerated>>
<</if>>
<<set $lastgenerated to $passage>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>
<<else>>
<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>
<</if>>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generate2">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>
<<else>>
<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>
<</if>>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generate3">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>
<<else>>
<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>
<</if>>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generate4">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>
<<else>>
<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>
<</if>>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generate5">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>
<<else>>
<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>
<</if>>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generate6">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>
<<else>>
<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>
<</if>>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatey1">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>
<<else>>
<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>
<</if>>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatey2">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>
<<else>>
<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>
<</if>>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatey3">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>
<<else>>
<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>
<</if>>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatey4">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>
<<else>>
<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>
<</if>>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

/%  %/

<</nobr>><</widget>>

<<widget "generatey5">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>
<<else>>
<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>
<</if>>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatey6">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>
<<else>>
<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>
<</if>>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatec1">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>
<<else>>
<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>
<</if>>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 1>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatec2">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>
<<else>>
<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>
<</if>>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 1>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatec3">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>
<<else>>
<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>
<</if>>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 1>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatec4">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>
<<else>>
<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>
<</if>>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 1>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generatec5">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>
<<else>>
<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>
<</if>>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 1>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatec6">><<nobr>>

<<set $rng to random(1, 100)>>
<<if $malechance lt $rng>>
<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>
<<else>>
<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>
<</if>>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 1>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatel">><<nobr>>

<<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>>

<</nobr>><</widget>>

<<widget "generates1">><<nobr>>

<<generatey1>>

<</nobr>><</widget>>

<<widget "generates2">><<nobr>>

<<generatey2>>

<</nobr>><</widget>>

<<widget "generates3">><<nobr>>

<<generatey3>>

<</nobr>><</widget>>

<<widget "generates4">><<nobr>>

<<generatey4>>

<</nobr>><</widget>>

<<widget "generates5">><<nobr>>

<<generatey5>>

<</nobr>><</widget>>

<<widget "generates6">><<nobr>>

<<generatey6>>

<</nobr>><</widget>>

<<widget "generatesm1">><<nobr>>

<<generateym1>>

<</nobr>><</widget>>

<<widget "generatesm2">><<nobr>>

<<generateym2>>

<</nobr>><</widget>>

<<widget "generatesm3">><<nobr>>

<<generateym3>>

<</nobr>><</widget>>

<<widget "generatesm4">><<nobr>>

<<generateym4>>

<</nobr>><</widget>>

<<widget "generatesm5">><<nobr>>

<<generateym5>>

<</nobr>><</widget>>

<<widget "generatesm6">><<nobr>>

<<generateym6>>

<</nobr>><</widget>>

<<widget "generatesf1">><<nobr>>

<<generateyf1>>

<</nobr>><</widget>>

<<widget "generatesf2">><<nobr>>

<<generateyf2>>

<</nobr>><</widget>>

<<widget "generatesf3">><<nobr>>

<<generateyf3>>

<</nobr>><</widget>>

<<widget "generatesf4">><<nobr>>

<<generateyf4>>

<</nobr>><</widget>>

<<widget "generatesf5">><<nobr>>

<<generateyf5>>

<</nobr>><</widget>>

<<widget "generatesf6">><<nobr>>

<<generateyf6>>

<</nobr>><</widget>>

<<widget "generatem1">><<nobr>>

<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatem2">><<nobr>>

<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatem3">><<nobr>>

<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatem4">><<nobr>>

<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generatem5">><<nobr>>

<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatem6">><<nobr>>

<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatef1">><<nobr>>

<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatef2">><<nobr>>

<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatef3">><<nobr>>

<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatef4">><<nobr>>

<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generatef5">><<nobr>>

<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatef6">><<nobr>>

<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 1>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generateym1">><<nobr>>

<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generateym2">><<nobr>>

<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generateym3">><<nobr>>

<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generateym4">><<nobr>>

<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generateym5">><<nobr>>

<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generateym6">><<nobr>>

<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generateyf1">><<nobr>>

<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 0>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generateyf2">><<nobr>>

<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 0>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generateyf3">><<nobr>>

<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 0>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generateyf4">><<nobr>>

<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 0>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generateyf5">><<nobr>>

<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 0>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generateyf6">><<nobr>>

<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 0>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatecm1">><<nobr>>

<<set $NPCList[0].gender to "m">><<set $NPCList[0].pronoun to "m">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 1>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatecm2">><<nobr>>

<<set $NPCList[1].gender to "m">><<set $NPCList[1].pronoun to "m">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 1>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatecm3">><<nobr>>

<<set $NPCList[2].gender to "m">><<set $NPCList[2].pronoun to "m">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 1>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatecm4">><<nobr>>

<<set $NPCList[3].gender to "m">><<set $NPCList[3].pronoun to "m">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 1>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generatecm5">><<nobr>>

<<set $NPCList[4].gender to "m">><<set $NPCList[4].pronoun to "m">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 1>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatecm6">><<nobr>>

<<set $NPCList[5].gender to "m">><<set $NPCList[5].pronoun to "m">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 1>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "generatecf1">><<nobr>>

<<set $NPCList[0].gender to "f">><<set $NPCList[0].pronoun to "f">>

<<set $NPCList[0].lefthand to 0>>
<<set $NPCList[0].righthand to 0>>
<<set $NPCList[0].mouth to 0>>

<<set $NPCList[0].teen to 1>>
<<set $NPCList[0].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 0>>

<</nobr>><</widget>>

<<widget "generatecf2">><<nobr>>

<<set $NPCList[1].gender to "f">><<set $NPCList[1].pronoun to "f">>

<<set $NPCList[1].lefthand to 0>>
<<set $NPCList[1].righthand to 0>>
<<set $NPCList[1].mouth to 0>>

<<set $NPCList[1].teen to 1>>
<<set $NPCList[1].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 1>>

<</nobr>><</widget>>

<<widget "generatecf3">><<nobr>>

<<set $NPCList[2].gender to "f">><<set $NPCList[2].pronoun to "f">>

<<set $NPCList[2].lefthand to 0>>
<<set $NPCList[2].righthand to 0>>
<<set $NPCList[2].mouth to 0>>

<<set $NPCList[2].teen to 1>>
<<set $NPCList[2].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 2>>

<</nobr>><</widget>>

<<widget "generatecf4">><<nobr>>

<<set $NPCList[3].gender to "f">><<set $NPCList[3].pronoun to "f">>

<<set $NPCList[3].lefthand to 0>>
<<set $NPCList[3].righthand to 0>>
<<set $NPCList[3].mouth to 0>>

<<set $NPCList[3].teen to 1>>
<<set $NPCList[3].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 3>>

<</nobr>><</widget>>

<<widget "generatecf5">><<nobr>>

<<set $NPCList[4].gender to "f">><<set $NPCList[4].pronoun to "f">>

<<set $NPCList[4].lefthand to 0>>
<<set $NPCList[4].righthand to 0>>
<<set $NPCList[4].mouth to 0>>

<<set $NPCList[4].teen to 1>>
<<set $NPCList[4].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 4>>

<</nobr>><</widget>>

<<widget "generatecf6">><<nobr>>

<<set $NPCList[5].gender to "f">><<set $NPCList[5].pronoun to "f">>

<<set $NPCList[5].lefthand to 0>>
<<set $NPCList[5].righthand to 0>>
<<set $NPCList[5].mouth to 0>>

<<set $NPCList[5].teen to 1>>
<<set $NPCList[5].adult to 0>>
<<set $enemyno += 1>>

<<npcattribute 5>>

<</nobr>><</widget>>

<<widget "npcattribute">><<nobr>>
<!-- V2.4 Widget set NPC attributes. $arg[0] calls NPC number to be generated. NG-->
<!-- For transgender, $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/Bruitish as NPC19, can only be called with $arg[2] -->

<<nounderwearcheck>>

<<set _n to $args[0]>>
<<set _gen to $args[1]>>
<<set _lvl to $args[2]>>
/% DEBUG _n _gen _lvl %/

<!-- This sets transgender. This should be pushed up to npcgenerate later... should be established for generation-->
<<if _gen is "m" or _gen is "f">>
	<<set $NPCList[_n].gender to _gen>>
	<<if _gen is "m">>
		<<set $NPCList[_n].penis to "clothed">>
	<<elseif _gen is "f">>
		<<set $NPCList[_n].vagina 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>>

<<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 91>>
	<<if $NPCList[_n].penis isnot "none">>
	<<set $NPCList[_n].insecurity to "penis">>
	<<else>>
	<<set $NPCList[_n].insecurity to "vagina">>
	<</if>>
<<elseif $rng gte 81>>
	<<if $NPCList[_n].vagina isnot "none">>
	<<set $NPCList[_n].insecurity to "vagina">>
	<<else>>
	<<set $NPCList[_n].insecurity to "penis">>
	<</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 -->
<<if _lvl gte 0 and _lvl lte 19>>
	<<set _i to _lvl>>
<<else>>
	<<set _i to random(0, 18)>>
<</if>>
/% DEBUG NPC: _i<br> %/
<<if $NPCList[_n].teen is 1>>
	<<if $NPCList[_n].pronoun is "f">> <!-- female appearing student -->
		<<set _h to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","vulgar"]>>
		<<set _blo to [0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,5,5,8,3,10]>>
		<<set _bhi to [4,4,4,4,4,4,7,7,7,7,8,8,8,8,8,11,11,12,10,12]>>
	<<else>> <!-- male appearing student  -->
		<<set _h to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","brutish"]>>
	<</if>>
<<else>>
	<<if $NPCList[_n].pronoun is "f">> <!-- female appearing adult -->
		<<set _h to [125,175,150,150,150,175,150,200,125,200,275,200,250,250,200,200,250,200,200,350]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","petite","trim","muscular","curvy","toned","plump","plush","shapely","robust","voluptuous","lush","vulgar"]>>
		<<set _blo to [0,0,0,0,2,2,2,2,2,5,5,5,5,5,5,5,8,8,9,10]>>
		<<set _bhi to [4,4,4,4,4,4,7,7,8,9,9,9,9,12,10,11,10,11,11,12]>>
	<<else>> <!-- male appearing adult -->
		<<set _h to [125,125,150,150,150,150,175,175,200,200,200,200,250,250,250,250,275,275,275,400]>>
		<<set _d to ["petite","slight","slim","thin","slender","lanky","lissome","lithe","trim","lean","taut","plump","toned","bulky","broad","robust","rugged","muscular","burly","brutish"]>>
	<</if>>
<</if>>

<!-- Set pp size seperately to allow for transgender NPCs. Changes should track with physical descriptions above, in order. -->
<<if $NPCList[_n].teen is 1>>
	<<if $NPCList[_n].gender is "m">> <!-- male genitals student, pronoun M or F -->
		<<set _plo to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8]>>
		<<set _phi to [8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]>>
	<</if>>
<<else>>
	<<if $NPCList[_n].gender is "m">> <!-- male genitals student, pronoun M or F -->
		<<set _plo to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8]>>
		<<set _phi to [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].health to _h[_i]>>
<<set $NPCList[_n].description to _d[_i]>>

/% DEBUG NPC _n : $NPCList[_n].pronoun , $NPCList[_n].gender $NPCList[_n].description<br> %/

<<if $NPCList[_n].gender is "m">><!-- set pp on size based on MODs for male genitals -->
	<<if $penis_mod gte _plo[_i]>><<set _plo[_i] to $penis_mod>><</if>>
	<<if $penis_mod gte _phi[_i]>><<set _phi[_i] to $penis_mod>><</if>>
	<<if $penis_mod lt 0>><<set _plo[_i] to Math.clamp(_plo[_i]+$penis_mod, 0, 8)>><<set _phi[_i] to Math.clamp(_phi[_i]+$penis_mod, 0, 8)>><</if>>
<</if>>

<<if $NPCList[_n].pronoun is "f">><!-- set breast on size based on MODs for female appearance-->
	<<if $breast_mod gte _blo[_i]>><<set _blo[_i] to $breast_mod>><</if>>
	<<if $breast_mod gte _bhi[_i]>><<set _bhi[_i] to $breast_mod>><</if>>
	<<if $breast_mod lt 0>><<set _blo[_i] to Math.clamp(_blo[_i]+$breast_mod, 0, 12)>><<set _bhi[_i] to Math.clamp(_bhi[_i]+$breast_mod, 0, 12)>><</if>>
<</if>>

<<if $NPCList[_n].pronoun is "f">><<set _rng to random(_blo[_i], _bhi[_i])>><</if>>
<<if $NPCList[_n].gender is "m">><<set _rngpp to random(_plo[_i], _phi[_i])>><</if>>

<<if $NPCList[_n].adult is 1>> <!-- set adult breast size -->
	<<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>>
		<<set $NPCList[_n].breastsize to _rng>>
		<<switch _rng>>
		<<case 0>>
			<<set $NPCList[_n].breastsdesc to "nipples">>
			<<set $NPCList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $NPCList[_n].breastsdesc to _brdes[_rng]+" breasts">>
			<<set $NPCList[_n].breastdesc to _brdes[_rng]+" breast">>
		<</switch>>
	<</if>>
<<else>> <!-- set student breast size -->
	<<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>>
		<<set $NPCList[_n].breastsize to _rng>>
		<<switch _rng>>
		<<case 0>>
			<<set $NPCList[_n].breastsdesc to "nipples">>
			<<set $NPCList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $NPCList[_n].breastsdesc to _brdes[_rng]+" breasts">>
			<<set $NPCList[_n].breastdesc to _brdes[_rng]+" breast">>
		<</switch>>
	<</if>>
<</if>>

<<if $NPCList[_n].adult is 1>> <!-- set adult pp size -->
	<<if $NPCList[_n].gender is "m">>
	<<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>>
	<</if>>
<<else>> <!-- set student pp size -->
	<<if $NPCList[_n].gender is "m">>
	<<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>>

/% DEBUG NPC: _rng : $NPCList[_n].breastsize : $NPCList[_n].breastsdesc : $NPCList[_n].breastdesc<br> %/

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

<</nobr>><</widget>>


code:
:: Widgets NPC Attributes Disjoint [widget]

<<widget "npcattributeDisjoint">><<nobr>>

<<nounderwearcheck>>

<<if $args[0]>>
    <<set _n to $args[0]>>
<<else>>
    <<set _n to 1>>
<</if>>

<<if $args[1]>>
    <<set _gen to $args[1]>>
<<else>>
    <<set _gen to "default value">>
<</if>>

<<if $args[2]>>
    <<set _lvl to $args[2]>>
<<else>>
    <<set _lvl to "default value">>
<</if>>

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

<<set $npcFightList[_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 $npcFightList[_n].skincolour to "black">>
<<else>>
    <<set $npcFightList[_n].skincolour to "white">>
<</if>>

<<set $rng to random(1, 100)>>
<<if $rng gte 91>>
	<<if $npcFightList[_n].penis isnot "none">>
	<<set $npcFightList[_n].insecurity to "penis">>
	<<else>>
	<<set $npcFightList[_n].insecurity to "vagina">>
	<</if>>
<<elseif $rng gte 81>>
	<<if $npcFightList[_n].vagina isnot "none">>
	<<set $npcFightList[_n].insecurity to "vagina">>
	<<else>>
	<<set $npcFightList[_n].insecurity to "penis">>
	<</if>>
<<elseif $rng gte 61>>
    <<set $npcFightList[_n].insecurity to "ethics">>
<<elseif $rng gte 41>>
    <<set $npcFightList[_n].insecurity to "weak">>
<<elseif $rng gte 21>>
    <<set $npcFightList[_n].insecurity to "skill">>
<<else>>
    <<set $npcFightList[_n].insecurity to "looks">>
<</if>>

<<if _lvl gte 0 and _lvl lte 19>>
	<<set _i to _lvl>>
<<else>>
	<<set _i to random(0, 18)>>
<</if>>
/% DEBUG NPC: _i
 %/
<<if $npcFightList[_n].teen is 1>>
	<<if $npcFightList[_n].pronoun is "f">>
		<<set _h to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","vulgar"]>>
		<<set _blo to [0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,5,5,8,3,10]>>
		<<set _bhi to [4,4,4,4,4,4,7,7,7,7,8,8,8,8,8,11,11,12,10,12]>>
	<<else>>
		<<set _h to [125,175,150,150,150,175,150,200,200,200,125,200,250,125,250,200,250,250,200,300]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","graceful","trim","mousy","cute","fit","petite","toned","shapely","robust","plump","wide-eyed","brutish"]>>
	<</if>>
<<else>>
	<<if $npcFightList[_n].pronoun is "f">>
		<<set _h to [125,175,150,150,150,175,150,200,125,200,275,200,250,250,200,200,250,200,200,350]>>
		<<set _d to ["slight","lithe","lean","thin","slender","lissome","slim","taut","petite","trim","muscular","curvy","toned","plump","plush","shapely","robust","voluptuous","lush","vulgar"]>>
		<<set _blo to [0,0,0,0,2,2,2,2,2,5,5,5,5,5,5,5,8,8,9,10]>>
		<<set _bhi to [4,4,4,4,4,4,7,7,8,9,9,9,9,12,10,11,10,11,11,12]>>
	<<else>>
		<<set _h to [125,125,150,150,150,150,175,175,200,200,200,200,250,250,250,250,275,275,275,400]>>
		<<set _d to ["petite","slight","slim","thin","slender","lanky","lissome","lithe","trim","lean","taut","plump","toned","bulky","broad","robust","rugged","muscular","burly","brutish"]>>
	<</if>>
<</if>>

<<if $npcFightList[_n].teen is 1>>
	<<if $npcFightList[_n].gender is "m">>
		<<set _plo to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8]>>
		<<set _phi to [8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]>>
	<</if>>
<<else>>
	<<if $npcFightList[_n].gender is "m">>
		<<set _plo to [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8]>>
		<<set _phi to [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 $npcFightList[_n].health to _h[_i]>>
<<set $npcFightList[_n].description to _d[_i]>>

/% DEBUG NPC _n : $npcFightList[_n].pronoun , $npcFightList[_n].gender $npcFightList[_n].description
 %/

<<if $npcFightList[_n].gender is "m">>
	<<if $penis_mod gte _plo[_i]>><<set _plo[_i] to $penis_mod>><</if>>
	<<if $penis_mod gte _phi[_i]>><<set _phi[_i] to $penis_mod>><</if>>
	<<if $penis_mod lt 0>><<set _plo[_i] to Math.clamp(_plo[_i]+$penis_mod, 0, 8)>><<set _phi[_i] to Math.clamp(_phi[_i]+$penis_mod, 0, 8)>><</if>>
<</if>>

<<if $npcFightList[_n].pronoun is "f">>
	<<if $breast_mod gte _blo[_i]>><<set _blo[_i] to $breast_mod>><</if>>
	<<if $breast_mod gte _bhi[_i]>><<set _bhi[_i] to $breast_mod>><</if>>
	<<if $breast_mod lt 0>><<set _blo[_i] to Math.clamp(_blo[_i]+$breast_mod, 0, 12)>><<set _bhi[_i] to Math.clamp(_bhi[_i]+$breast_mod, 0, 12)>><</if>>
<</if>>

<<if $npcFightList[_n].pronoun is "f">><<set _rng to random(_blo[_i], _bhi[_i])>><</if>>
<<if $npcFightList[_n].gender is "m">><<set _rngpp to random(_plo[_i], _phi[_i])>><</if>>

<<if $npcFightList[_n].adult is 1>>
	<<if $npcFightList[_n].pronoun is "m">>
		<<set $npcFightList[_n].breastsize to 0>>
		<<set $npcFightList[_n].breastsdesc to "nipples">>
		<<set $npcFightList[_n].breastdesc to "nipple">>
	<<else>>
		<<set $npcFightList[_n].breastsize to _rng>>
		<<switch _rng>>
		<<case 0>>
			<<set $npcFightList[_n].breastsdesc to "nipples">>
			<<set $npcFightList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $npcFightList[_n].breastsdesc to _brdes[_rng]+" breasts">>
			<<set $npcFightList[_n].breastdesc to _brdes[_rng]+" breast">>
		<</switch>>
	<</if>>
<<else>>
	<<if $npcFightList[_n].pronoun is "m">>
		<<set $npcFightList[_n].breastsize to 0>>
		<<set $npcFightList[_n].breastsdesc to "nipples">>
		<<set $npcFightList[_n].breastdesc to "nipple">>
	<<else>>
		<<set $npcFightList[_n].breastsize to _rng>>
		<<switch _rng>>
		<<case 0>>
			<<set $npcFightList[_n].breastsdesc to "nipples">>
			<<set $npcFightList[_n].breastdesc to "nipple">>
		<<default>>
			<<set $npcFightList[_n].breastsdesc to _brdes[_rng]+" breasts">>
			<<set $npcFightList[_n].breastdesc to _brdes[_rng]+" breast">>
		<</switch>>
	<</if>>
<</if>>

<<if $npcFightList[_n].adult is 1>>
	<<if $npcFightList[_n].gender is "m">>
	<<switch _rngpp>>
	<<case 0>>
		<<set $npcFightList[_n].penisdesc to "tiny penis">>
		<<set $npcFightList[_n].penissize to 1>>
	<<case 5 6 7>>
		<<set $npcFightList[_n].penisdesc to either("thick cock","hefty cock","big cock","large cock","veiny cock","meaty cock")>>
		<<set $npcFightList[_n].penissize to 3>>
	<<case 8>>
		<<set $npcFightList[_n].penisdesc to either("massive cock","huge cock","humongous cock","immense cock","gigantic cock","enormous cock")>>
		<<set $npcFightList[_n].penissize to 4>>
	<<default>>
		<<set $npcFightList[_n].penisdesc to "penis">>
		<<set $npcFightList[_n].penissize to 2>>
	<</switch>>
	<</if>>
<<else>>
	<<if $npcFightList[_n].gender is "m">>
	<<switch _rngpp>>
	<<case 0>>
		<<set $npcFightList[_n].penisdesc to "tiny penis">>
		<<set $npcFightList[_n].penissize to 1>>
	<<case 7 8>>
		<<set $npcFightList[_n].penisdesc to either("thick cock","hefty cock","big cock","large cock","veiny cock","meaty cock")>>
		<<set $npcFightList[_n].penissize to 3>>
	<<default>>
		<<set $npcFightList[_n].penisdesc to "penis">>
		<<set $npcFightList[_n].penissize to 2>>
	<</switch>>
	<</if>>
<</if>>

/% DEBUG NPC: _rng : $npcFightList[_n].breastsize : $npcFightList[_n].breastsdesc : $npcFightList[_n].breastdesc
 %/

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

<</nobr>><</widget>>


code:
:: Widgets NPC Generation Disjoint [widget]
<<widget "generateNPCDisjoin">><<nobr>>
<!-- Copy example from the old code -->
<!-- Args are NPC#(1-*), Age for all the npcs -->
<!-- Example: <<generateNPCDisjoin 10 a>> would generate 10 NPCs as adult -->

<!-- Check from the old code -->
<!-- Checks if endevent was properly used after the last event -->
<<if $enemyno gte 1>>
    <<set $endeventerror to $lastgenerated>>
<</if>>
<<set $lastgenerated to $passage>>

<!-- Dinamically creating a list to alocate all to npcs -->
<<set $npcFightList = [$args[0]]>>

<!-- Generating all the npc specify by the args[0] -->
<<for _i to 0; _i lt $args[0]; _i++>>
    <!-- Defining npc characteristics -->
    <<set _age to "a">>
    <<set _gender to "m">>
    <<set _pronoun to "m">>
    <<set _arousal to ($allure / 50 + $audiencearousal)>>

    <!-- Defining npc age -->
    <<if $args[1]>>
        <<set _age to $args[1]>>
    <</if>>

    <!-- Defining npc gender -->
    <<set $rng to random(1, 100)>>
    <<if $malechance lt $rng>>
        <<set _gender to "f">>
        <<set _pronoun to "f">>
    <</if>>

    <!-- Defining npc health -->
    <!-- ToDo: Define a roof value than create a function to change the damage according to difficult -->
    <!-- Natural exponential function maybe... roof = 400? -->
    <<set _maxHealth to 200>>

    <!-- See this model in the folder model, file NPC-Human_Model -->
    <<set $npcFightList[_i] to new NpcModel(
        '_age',
        '_gender',
        '_pronoun',
        '_maxHealth'
    )>>

    <<set $npcFightList[_i].arousal to _arousal>>
    <<npcattributeDisjoint _i>>

<</for>>

<</nobr>><</widget>>


code:
:: Widgets Player Combat Start [widget]
<!-- Widgets to start the combat var for player -->
<!-- For now it's only the target -->
<!-- What is best, target for every limb or focus? -->
<!-- In sex, best is every limb, in fight, best is focus -->

<<widget "playerStart">><<nobr>>

<!-- ToDo: Creat a object for the player instead of this format -->
<!-- for the legibility of the code i'll create variables instead of vector -->
<<set $rightHandTarget to 0>>
<<set $rightLegTarget to 0>>
<<set $leftHandTarget to 0>>
<<set $leftLegTarget to 0>>

<</nobr>><</widget>>