code:
:: Widgets Img [widget]
<<widget "img">>
<<set _filters to $skinColor.current>>
<<set _img to setup.tanImg.sidebar[$skinColor.tanImgEnabled]>>

<<if $sidebarRenderer is 'canvas'>>
	<<for _i to 1; _i lte $spraymax; _i++>>
		<<if $spray gte _i>>

		<<else>>

		<</if>>
	<</for>>
	<<canvasimg>>
<<else>>
	<<if $sidebarRenderer is 'both'>>
		<<canvasimg 'canvasimg-both'>>
	<</if>>
	/*Prep for image checks*/
	<<if $worn.under_upper.type.includes("chest_bind")>>
		<<set _breastSize to 1>>
	<<else>>
		<<switch $player.perceived_breastsize>>
		<<case 12>>
			<<set _breastSize to 6>>
		<<case 8 9 10 11>>
			<<set _breastSize to 5>>
		<<case 6 7>>
			<<set _breastSize to 4>>
		<<case 4 5>>
			<<set _breastSize to 3>>
		<<case 3>>
			<<set _breastSize to 2>>
		<<case 0 1 2>>
			<<set _breastSize to 1>>
		<</switch>>
	<</if>>
	<<if $player.penisExist>>
		<<set _penisSize to Math.clamp($penissize, -2, 4)>>
	<</if>>
	<<if ($worn.over_head.hood is 1 or $worn.head.hood is 1) and $hoodDown is 0>>
		<<set _hairlengthstage to "short">>
		<<set _fringelengthstage to "short">>
	<<else>>
		<<set _hairlengthstage to $hairlengthstage>>
		<<set _fringelengthstage to $fringelengthstage>>
	<</if>>
	<<set _disabled to ["disabled","hidden"]>>

	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $dontHide is false and $worn.over_upper.exposed gte 1 and ($worn.upper.exposed gte 1 or $upperwetstage gte 3)
		and ($exposed gte 2 and $uncomfortable.nude is true or $exposed is 1 and $uncomfortable.underwear is true)>>
			<<set _coverLeft to true>>
		<<else>>
			<<set _coverLeft to false>>
		<</if>>
	<</if>>

	<<if $rightarm isnot "bound" and $rightarm isnot "grappled" and $rightarm isnot "behind">>
		<<if $dontHide is false and $worn.over_lower.exposed gte 1 and ($worn.lower.exposed gte 1 or $lowerwetstage gte 3)
		and ($exposed gte 2 and $uncomfortable.nude is true or $exposed is 1 and $uncomfortable.underwear is true)>>
			<<set _coverRight to true>>
		<<else>>
			<<set _coverRight to false>>
		<</if>>
	<</if>>

	<<for _i to 1; _i lte $spraymax; _i++>>
		<<if $spray gte _i>>

		<<else>>

		<</if>>
	<</for>>
	<<if $skinColor.tanImgEnabled is "t">>
		<<if $skinColor.tanValues[0] isnot $skinColor.tanValues[2]>>

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

	<<if $worn.upper.type.includes("naked") and $worn.over_upper.type.includes("naked")>>
		<<if !$worn.under_upper.type.includes("naked")>>

		<<else>>

		<</if>>
		<<if $skinColor.tanImgEnabled is "t" and $skinColor.tanValues[0] isnot $skinColor.tanValues[1]>>

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

	<<if $pbdisable is "f" and $worn.lower.type.includes("naked") and $worn.under_lower.type.includes("naked")>>
		<<set _pbColour = ($makeup.pbcolour != 0 ? $makeup.pbcolour : $naturalhaircolour).replace(/ /g, '-')>>
		<<if $pblevel gt 1>>

		<</if>>
		<<if $pbstrip gte 1>>

		<</if>>
		<<if $player.ballsExist is true and $pblevelballs gt 1 and !$worn.genitals.name.startsWith("chastity")>>

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

	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $masturbationimages is 1>>
			<<if $leftaction is "mpenisentrance">>

			<<elseif $leftaction is "mvaginaentrance">>

			<<elseif $leftaction is "manus">>

			<<elseif $leftaction is "manusentrance">>

			<<elseif $leftaction is "manusrub">>

			<<elseif $leftaction is "manustease">>

			<<elseif $leftaction is "manusprostate">>

			<<elseif $leftaction is "mpenisshaft">>

			<<elseif $leftaction is "mpenisglans">>

			<<elseif $leftaction is "mvagina">>

			<<elseif $leftaction is "mvaginaclit">>

			<<elseif $leftaction is "mvaginatease">>

			<</if>>
		<<elseif _coverLeft is false>>

			<<if !_disabled.includes($transformationParts.demon.wings)>>
				<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>

				<<else>>

				<</if>>
			<</if>>
			<<if !_disabled.includes($transformationParts.angel.wings)>>

			<</if>>
			<<if !_disabled.includes($transformationParts.fallenAngel.wings)>>

			<</if>>
			<<if !_disabled.includes($transformationParts.bird.wings)>>

			<</if>>
		<<elseif _coverLeft is true>>
			<<if !_disabled.includes($transformationParts.demon.wings)>>

				<<set _coverLeft to false>>
			<<elseif !_disabled.includes($transformationParts.angel.wings)>>

				<<set _coverLeft to false>>
			<<elseif !_disabled.includes($transformationParts.fallenAngel.wings)>>

				<<set _coverLeft to false>>
			<<elseif !_disabled.includes($transformationParts.bird.wings)>>

				<<set _coverLeft to false>>
			<<else>>

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

	<<if $rightarm isnot "bound" and $rightarm isnot "grappled" and $rightarm isnot "behind">>
		<<if $masturbationimages is 1>>
			<<if $rightaction is "mpenisentrance">>

			<<elseif $rightaction is "mvaginaentrance">>

			<<elseif $rightaction is "manus">>

			<<elseif $rightaction is "manusentrance">>

			<<elseif $rightaction is "manusrub">>

			<<elseif $rightaction is "manustease">>

			<<elseif $rightaction is "manusprostate">>

			<<elseif $rightaction is "mpenisshaft">>

			<<elseif $rightaction is "mpenisglans">>

			<<elseif $rightaction is "mvagina">>

			<<elseif $rightaction is "mvaginaclit">>

			<<elseif $rightaction is "mvaginatease">>

			<</if>>
		<<elseif _coverRight is false>>

			<<if !_disabled.includes($transformationParts.demon.tail)>>
				<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>

				<<else>>

				<</if>>
			<</if>>
			<<if !_disabled.includes($transformationParts.angel.wings)>>

			<</if>>
			<<if !_disabled.includes($transformationParts.fallenAngel.wings)>>

			<</if>>
			<<if !_disabled.includes($transformationParts.bird.wings)>>

			<</if>>
		<<elseif _coverRight is true>>
			<<if !_disabled.includes($transformationParts.demon.wings)>>

				<<set _coverRight to false>>
			<<elseif !_disabled.includes($transformationParts.angel.wings)>>

				<<set _coverRight to false>>
			<<elseif !_disabled.includes($transformationParts.fallenAngel.wings)>>

				<<set _coverRight to false>>
			<<elseif !_disabled.includes($transformationParts.bird.wings)>>

				<<set _coverRight to false>>
			<<else>>

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

	<<if $bodywritingImages is true>>
		<<if $skin.forehead.writing>>
			<<if $skin.forehead.type is "text">>

			<<elseif $skin.forehead.type is "object">>

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

			<<elseif $skin.left_cheek.type is "object">>

			<</if>>
		<</if>>
		<<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.breasts.writing>>
			<<if $skin.breasts.type is "text">>

				<<if _breastSize gte 2>>

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

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

			<<elseif $skin.left_shoulder.type is "object">>

			<</if>>
		<</if>>
		<<if $skin.right_shoulder.writing>>
			<<if $masturbationimages is 1 or _coverRight is true>>
				<<set _skin to "armS">>
			<<else>>
				<<set _skin to "s">>
			<</if>>
			<<if $skin.right_shoulder.type is "text">>

			<<elseif $skin.right_shoulder.type is "object">>

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

			<<elseif $skin.pubic.arrow is 1>>

			<<elseif $skin.pubic.type is "text">>

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

			<<elseif $skin.left_thigh.type is "text">>

			<<elseif $skin.left_thigh.type is "object">>

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

			<<elseif $skin.right_thigh.type is "text">>

			<<elseif $skin.right_thigh.type is "object">>

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

	<<faceimg>>

	<<switch setup.bodyliquid.combined("vagina")>>
		<<case 5 6 7 8 9 10>>
		<<case 4>>
		<<case 3>>
		<<case 2>>
		<<case 1>>
	<</switch>>

	<<switch setup.bodyliquid.combined("anus")>>
		<<case 5 6 7 8 9 10>>
		<<case 4>>
		<<case 3>>
		<<case 2>>
		<<case 1>>
	<</switch>>

	<<set _shift = $facestyle == "small-eyes" ? "shift-right-2" : "">>
	<<switch setup.bodyliquid.combined("mouth")>>
		<<case 5 6 7 8 9 10>>
		<<case 4>>
		<<case 3>>
		<<case 2>>
		<<case 1>>
	<</switch>>
	<<if !_disabled.includes($transformationParts.fallenAngel.halo)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.angel.halo)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.wolf.tail)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.cat.tail)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.wolf.ears)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.wolf.pits)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.wolf.pubes)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.wolf.cheeks)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.cat.ears)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bunny.ears)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.demon.horns)>>

		/**/
	<</if>>

	<<if !_disabled.includes($transformationParts.cow.horns)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.cow.ears)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.cow.tail)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bird.tail)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bird.eyes)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bird.malar)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bird.plumage)>>

	<</if>>

	<<if !_disabled.includes($transformationParts.bird.pubes)>>

	<</if>>

	<<if $hairposition is "front">>

	<<else>>

	<</if>>

	<<if _hairlengthstage is "thighs">>
		<<switch $hairtype>>
			<<case "default">>

			<<case "loose">>

			<<case "curl">>

			<<case "defined curl">>

			<<case "neat">>

			<<default>>
		<</switch>>
	<<elseif _hairlengthstage is "feet">>
		<<switch $hairtype>>
			<<case "default">>

			<<case "loose">>

			<<case "straight">>

			<<case "curl">>

			<<case "defined curl">>

			<<case "neat">>

			<<default>>
		<</switch>>
	<</if>>

	<<upperimg>>
	<<overupperimg>>
	<<genitalsimg>>
	<<lowerimg>>
	<<overlowerimg>>
	<<underlowerimg>>
	<<underupperimg>>
	<<handsimg>>
	<<baseClothingImg "head">>
	<<baseClothingImg "over_head">>
	<<baseClothingImg "face">>
	<<neckimg>>
	<<baseClothingImg "legs">>
	<<baseClothingImg "feet">>

	<<if _penisSize isnot undefined>>
		<<if $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>
			<<if $worn.genitals.type.includes("chastity")>>

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

			<<else>>

			<</if>>
		<<elseif ($lowerwetstage gt 0 or $worn.lower.type.includes("naked")) and ($underlowerwetstage gt 0 or $worn.under_lower.type.includes("naked"))>>
			<<if $worn.genitals.type.includes("chastity")>>

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

			<<else>>

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

	<<if $parasite.nipples.name isnot undefined>>
		<<switch $parasite.nipples.name>>
			<<case "urchin">><<set _nippleImage to "chestparasite">>
			<<case "slime">><<set _nippleImage to "chestslime">>
		<</switch>>
		<<if _nippleImage and $worn.upper.exposed gte 2 and $worn.under_upper.exposed gte 1>>

		<<elseif _nippleImage and ($upperwetstage gt 0 or $worn.upper.type.includes("naked")) and ($underupperwetstage gt 0 or $worn.under_upper.type.includes("naked"))>>

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

	<<if _penisSize isnot undefined and $parasite.penis.name isnot undefined and !$worn.genitals.type.includes("chastity")>>
		<<switch $parasite.penis.name>>
			<<case "urchin">><<set _penisImage to "penisparasite">>
			<<case "slime">><<set _penisImage to "penisslime">>
		<</switch>>
		<<if _penisImage and $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>

		<<elseif _penisImage and ($lowerwetstage gt 0 or $worn.lower.type.includes("naked")) and ($underlowerwetstage gt 0 or $worn.under_lower.type.includes("naked"))>>

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

	<<if $player.vaginaExist and $parasite.clit.name isnot undefined and !$worn.genitals.type.includes("chastity")>>
		<<switch $parasite.clit.name>>
			<<case "urchin">><<set _clitImage to "clitparasite">>
			<<case "slime">><<set _clitImage to "clitslime">>
		<</switch>>
		<<if _clitImage and $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>

		<<elseif _penisImage and ($lowerwetstage gt 0 or $worn.lower.type.includes("naked")) and ($underlowerwetstage gt 0 or $worn.under_lower.type.includes("naked"))>>

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

<</widget>>

<<widget "faceimg">>
	<<set _diagram = $args[0] ? 1 : 0>>
	<<set _animIdle = _diagram ? "" : "anim-idle-2f">>

	<<if $skinColor.tanImgEnabled is "t">>
		<<set _red = "/red">>
	<<else>>
		<<set _red = "">>
	<</if>>

	<<if $player.freckles == true and $makeup.concealer != 1>>

	<</if>>

	<<if ($trauma gte ($traumamax * 0.9) and _diagram is 0) or $possessed>>
		<<set _iris = "irisempty">>
		<<set _trauma = "-trauma">>
	<<else>>
		<<set _iris = "iris">>
		<<set _trauma = "">>
	<</if>>
	<<if $blinkingdisable is "f" and _diagram is 0>>
		<<set _blink = "eyes-blink" + _trauma>>
	<<else>>
		<<set _blink = "">>
	<</if>>
	<<if $pain gte 100 and $willpowerpain is 0 and _diagram is 0>>
		<<set _sclera = "sclerabloodshot">>
	<<else>>
		<<set _sclera = "sclera">>
	<</if>>
	<<if $halfcloseddisable isnot "t" and ($arousal gte ($arousalmax / 5) * 4 or $orgasmdown gte 1) and _trauma is "" and $pain lt 60 and _diagram is 0 and $eyelidTEST is true or $possessed>>
		<<set _half = "_halfclosed">>
	<<else>>
		<<set _half = "">>
	<</if>>
	<<if $possessed>>
		<<set _colourEye to ($wraith.state is "haunt" and !$schism ? "eye-redPossessed" : "eye-bluePossessed")>>
	<<else>>
		<<set _colourEye to "colour-eye">>
	<</if>>

	<<if _diagram is 0>>
		<<if $makeup.eyeshadow != 0>>

		<</if>>
		<<if $makeup.mascara != 0>>

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

	<<if $trauma gte $traumamax or $possessed or _diagram is 1>>
		<<set _brows = "top">>
	<<elseif $pain gte 60>>
		<<set _brows = "low">>
	<<elseif $arousal gte ($arousalmax / 5) * 4 or $orgasmdown gte 1>>
		<<set _brows = "orgasm">>
	<<elseif $pain gte 20>>
		<<set _brows = "mid">>
	<<else>>
		<<set _brows = "top">>
	<</if>>
	<<if $makeup.browscolour != 0>>
		<<set _naturalColour = "">>
		<<set _browsColour = "brows-" + $makeup.browscolour.replace(/ /g, '-')>>
	<<else>>
		<<set _naturalColour = "hair-" + $naturalhaircolour.replace(/ /g, '-')>>
		<<set _browsColour = "colour-hair">>
	<</if>>

	<<if $trauma gte $traumamax or _diagram is 1>>
		<<set _mouth = "neutral">>
	<<elseif $pain gte 60 or $orgasmdown gte 1 or ($possessed and !$schism)>>
		<<set _mouth = "cry">>
	<<elseif $exposed is 2 and $uncomfortable.nude is true and $dontHide is false or $pain gte 20>>
		<<set _mouth = "frown">>
	<<elseif $pain gte 1 or ($exposed is 1 and $uncomfortable.underwear is true) or ($combat is 1 and $consensual isnot 1)>>
		<<set _mouth = "neutral">>
	<<else>>
		<<set _mouth = "smile">>
	<</if>>

	<<if $makeup.lipstick != 0 and _diagram is 0>>

	<</if>>

	<<if _diagram is 0>>

		<<set _blush = Math.min(5, Math.floor($arousal / 2000) + 1)>>
		<<if _blush lt 2 and $exposed gte 2>>
			<<set _blush = 2>>
		<<elseif $arousal lt 100 and $exposed lt 1>>
			<<set _blush = 0>>
		<</if>>
		<<if !$worn.over_upper.type.includes("naked") and !$worn.over_lower.type.includes("naked") and
		$worn.upper.type.includes("naked") and $worn.lower.type.includes("naked") and
		$worn.under_upper.type.includes("naked") and $worn.under_lower.type.includes("naked")>>
			<<set _blush = 2>>
		<</if>>
		<<if _blush gte 1>>

		<</if>>

		<<if $pain gte 20>>

			<<if $makeup.mascara != 0>>

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

:: Widgets Combat Clothes Img [widget]
<<widget "clothesactive">>
<<imgOpacity>>

<<if $worn.head.name is "mini snowman">>

<</if>>

<<if $worn.upper.set is $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if $worn.upper.state is "waist">>
		<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt_down is 1>>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt_down is 0>>

		<</if>>
	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

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

/* _feet_pos is set to "footjob_" for doggy images, but "feetjob_" for missionary images. */
<<if $feetuse is "penis" or $feetstate is "tentacles">>
	<<set _feet_pos to "footjob_">>
<<else>>
	<<set _feet_pos to "">>
<</if>>

<<if $worn.lower.name is "gym bloomers">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>

	<</if>>
<<elseif $worn.lower.name is "denim shorts">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>
		<<if _feet_pos is "footjob_">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "booty jorts">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>
		<<if _feet_pos is "footjob_">>

		<<else>>

		<</if>>
	<</if>>
<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
		<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>
			<<if $worn.lower.skirt_down is 0 and $worn.lower.state is "waist">>

			<<elseif $worn.lower.vagina_exposed is 1>>

			<<elseif $worn.lower.state is "waist">>

			<<elseif $worn.lower.state is "thighs">>

			<<elseif $worn.lower.state is "knees">>

			<<elseif $worn.lower.state is "ankles">>

			<</if>>
		<<else>>
			<<if $worn.lower.state is "waist">>

			<<elseif $worn.lower.state is "thighs">>

			<<elseif $worn.lower.state is "knees">>

			<<elseif $worn.lower.state is "ankles">>

			<</if>>
		<</if>>
	<<elseif $worn.lower.state is "waist">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "thighs">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "knees">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "ankles">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

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

<<if $worn.under_lower.name is "bikini bottoms">>

<<elseif !$worn.under_lower.type.includes("naked")>>
	<<if $worn.under_lower.state is "waist" or $worn.under_lower.state is "totheside">>

	<<elseif $worn.under_lower.state is "thighs">>

	<<elseif $worn.under_lower.state is "knees">>

	<<elseif $worn.under_lower.state is "ankles">>

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

<<if $worn.upper.name is "tank top">>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

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

<<elseif $worn.upper.name is "tube top" or $worn.upper.name is "towel top">>
	<<if $worn.upper.state_top is "chest">>
		<<if $player.perceived_breastsize is 0>>
			<<set _tit = "none">>
		<<elseif $player.perceived_breastsize lte 2>>
			<<set _tit = "tiny">>
		<<elseif $player.perceived_breastsize lte 4>>
			<<set _tit = "small">>
		<<elseif $player.perceived_breastsize lte 6>>
			<<set _tit = "large">>
		<<else>>
			<<set _tit = "huge">>
		<</if>>
	<</if>>
	<<set _tubeimg = $worn.upper.state_top>>
	<<if _tubeimg is "ankles" and ($feetuse is "penis" or $feetstate is "tentacle")>>
		<<set _tubeimg += "feetjob">>
	<</if>>
	<<if (_tubeimg is "chest" or _tubeimg is "midriff") and ($leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind")>>
		<<set _tubeimg += "bound">>
	<</if>>

	<<if _tit>>

	<</if>>

<<elseif $worn.upper.name is "gym shirt">>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

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

<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater">>

<<elseif $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>

<<elseif $worn.upper.name is "turtleneck">>
	<<switch $player.perceived_breastsize>>
		<<case 8 9 10 11 12>>

		<<case 5 6 7>>

		<<case 3 4>>

		<<case 1 2>>

		<<case 0>>

	<</switch>>
<<elseif !$worn.upper.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

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

<<if setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1 and $worn.upper.name isnot "t-shirt">>
	<<if $worn.upper.name is "turtleneck">>
		<<set _sleeves to "turtleneck">>
	<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater" or $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>
		<<set _sleeves to "sweatersleeves">>
	<<else>>
		<<set _sleeves to "sleeves">>
	<</if>>
	<<if $leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind">>

	<<elseif $leftarm is "penis" or $leftarmstate is "tentacle">>
		<<if $enemytype is "beast">>

		<<else>>

		<</if>>
	<<else>>

	<</if>>
	<<if $rightarm is "penis" or $rightarmstate is "tentacle">>
		<<if $enemytype is "beast">>

		<<else>>

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

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

<<if $worn.under_upper.name is "bikini top">>
	<<if $worn.under_upper.state isnot "chest" and $worn.under_upper.state isnot "midriff">>

	<<else>>

	<</if>>
<<elseif $worn.under_upper.name is "tape">>
	<<if $player.perceived_breastsize is 0>>
		<<set _size to "none">>
	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
		<<set _size to "tiny">>
	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
		<<set _size to "small">>
	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
		<<set _size to "large">>
	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
		<<set _size to "huge">>
	<</if>>

<<elseif $worn.under_upper.name is "mesh shirt">>
	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>
			<<set _size to "none">>
		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
			<<set _size to "tiny">>
		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
			<<set _size to "small">>
		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
			<<set _size to "large">>
		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
			<<set _size to "huge">>
		<</if>>

	<</if>>

	<<if $worn.under_upper.state is "midriff">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<set _bound to "">>
	<<else>>
		<<set _bound to "bound">>
	<</if>>

<<elseif $worn.under_upper.name is "chest wrap">>
	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>

		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>

		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>

		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>

		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>

		<</if>>
	<</if>>
<<elseif $worn.under_upper.name is "swim shirt">>
	<<if $worn.under_upper.state is "midriff" or $worn.under_upper.state is "waist">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<set _bound to "">>
	<<else>>
		<<set _bound to "bound">>
	<</if>>

<<elseif !$worn.under_upper.type.includes("naked")>>
	<<if $worn.under_upper.state isnot "chest" and $worn.under_upper.state isnot "midriff">>

	<<else>>

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

<<if $worn.face.name is "muzzle">>

<<elseif $worn.face.type.includes("gag")>>

<</if>>
<<if $worn.face.type.includes("blindfold")>>

<</if>>
<<if $worn.neck.name is "cow bell">>

<<elseif $worn.neck.name is "necktie">>

<<elseif $worn.neck.name is "scarf">>

<</if>>

<<if $worn.hands.name isnot "naked">>
	<<if $worn.hands.leftImage is 1>>
		<<if $leftarm is "penis">>
			<<if $enemytype isnot "beast">>

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

		<</if>>
	<</if>>
	<<if $worn.hands.rightImage is 1>>
		<<if $rightarm is "penis">>
			<<if $enemytype isnot "beast">>

			<</if>>
		<<elseif $rightarm is "bound">>
		<<elseif $rightarm is "grappled">>
		<<elseif $rightarm is "behind">>
		<<elseif $rightarmstate is "tentacle">>
		<<else>>

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

<<if $worn.feet.type.includes("heels") or $worn.feet.name is "wedge sandals" or $worn.feet.name is "light-up trainers">>
	<<set _feetjob to ($feetuse is 'penis' ? 'feetjob' : $feetstate is 'tentacle' ? 'feetjob' : 'thighs')>>
	<<if $worn.feet.colour>>
		<<set _shoeColour to $worn.feet.colourCustom>>
	<</if>>
	<<if $worn.feet.accessory_colour>>
		<<set _shoeAccColour to $worn.feet.accessory_colourCustom>>
	<</if>>

	<<if $worn.feet.accessory>>
		<<if $worn.feet.accessory_colour isnot 0>>

		<<else>>

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

<<if !$worn.legs.type.includes("naked")>>
	<<if $feetuse is "penis" or $feetstate is "tentacle">>
		<<set _feetjob to "feetjob">>
	<<else>>
		<<set _feetjob to "rest">>
	<</if>>
	<<if $worn.legs.state is setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base>>
		<<set _feetposition to "full">>
	<<else>>
		<<set _feetposition to "knees">>
	<</if>>
	<<if $worn.legs.colour>>
		<<set _legColour to $worn.legs.colourCustom>>
	<</if>>
	<<if $worn.legs.accessory_colour>>
		<<set _legAccColour to $worn.legs.accessory_colourCustom>>
	<</if>>

	<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

	<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>

	<<else>>

	<</if>>
	<<if $worn.legs.accessory>>
		<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

		<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>

		<<else>>

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

<</widget>>

<<widget "clothesidle">>
<<imgOpacity>>

<<if $worn.head.name is "mini snowman">>

<</if>>

<<if $worn.upper.set is $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if $worn.upper.state is "waist">>
		<<if $worn.lower.skirt_down is 1>>

		<<elseif $worn.lower.skirt_down is 0>>

		<</if>>
	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

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

<<if $feetuse is "penis" or $feetstate is "tentacles">>
	<<set _feet_pos to "footjob_">>
<<else>>
	<<set _feet_pos to "">>
<</if>>

<<if $worn.lower.name is "towel skirt">>
	<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1 and $worn.lower.skirt_down is 0 and $worn.lower.state is "waist">>

	<<else>>

	<</if>>
<<elseif $worn.lower.name is "gym bloomers">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>

	<</if>>
<<elseif $worn.lower.name is "denim shorts">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>
		<<if _feet_pos is "footjob_">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "booty jorts">>
	<<if $worn.lower.state is "waist">>

	<<elseif $worn.lower.state is "thighs">>

	<<elseif $worn.lower.state is "knees">>

	<<elseif $worn.lower.state is "ankles">>
		<<if _feet_pos is "footjob_">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "micro pleated skirt">>
	<<switch $worn.lower.state>>
		<<case "waist">>
			<<if $worn.lower.skirt_down is 0>>

			<<else>>

			<</if>>
		<<case "thighs">>

		<<case "knees">>

		<<case "ankles">>

	<</switch>>
<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
		<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>
			<<if $worn.lower.skirt_down is 0 and $worn.lower.state is "waist">>

			<<elseif $worn.lower.vagina_exposed is 1>>

			<<elseif $worn.lower.state is "waist">>

			<<elseif $worn.lower.state is "thighs">>

			<<elseif $worn.lower.state is "knees">>

			<<elseif $worn.lower.state is "ankles">>

			<</if>>
		<<else>>
			<<if $worn.lower.state is "waist">>

			<<elseif $worn.lower.state is "thighs">>

			<<elseif $worn.lower.state is "knees">>

			<<elseif $worn.lower.state is "ankles">>

			<</if>>
		<</if>>
	<<elseif $worn.lower.state is "waist">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "thighs">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "knees">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

		<</if>>
	<<elseif $worn.lower.state is "ankles">>
		<<if $worn.lower.name is "jeans">>

		<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

		<<else>>

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

<<if $worn.under_lower.name is "bikini bottoms">>

<<elseif !$worn.under_lower.type.includes("naked")>>
	<<if $worn.under_lower.state is "waist" or $worn.under_lower.state is "totheside">>

	<<elseif $worn.under_lower.state is "thighs">>

	<<elseif $worn.under_lower.state is "knees">>

	<<elseif $worn.under_lower.state is "ankles">>

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

<<if $worn.upper.name is "tube top" or $worn.upper.name is "towel top">>
	<<if $worn.upper.state_top is "chest">>
		<<if $player.perceived_breastsize is 0>>
			<<set _tit = "none">>
		<<elseif $player.perceived_breastsize lte 2>>
			<<set _tit = "tiny">>
		<<elseif $player.perceived_breastsize lte 4>>
			<<set _tit = "small">>
		<<elseif $player.perceived_breastsize lte 6>>
			<<set _tit = "large">>
		<<else>>
			<<set _tit = "huge">>
		<</if>>
	<</if>>
	<<set _tubeimg = $worn.upper.state_top>>
	<<if _tubeimg is "ankles" and ($feetuse is "penis" or $feetstate is "tentacle")>>
		<<set _tubeimg += "feetjob">>
	<</if>>
	<<if (_tubeimg is "chest" or _tubeimg is "midriff") and ($leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind")>>
		<<set _tubeimg += "bound">>
	<</if>>

	<<if _tit>>

	<</if>>

<<elseif $worn.upper.name is "tank top">>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.upper.name is "gym shirt">>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater">>

<<elseif $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>

<<elseif $worn.upper.name is "turtleneck">>
	<<switch $player.perceived_breastsize>>
		<<case 8 9 10 11 12>>

		<<case 5 6 7>>

		<<case 3 4>>

		<<case 1 2>>

		<<case 0>>

	<</switch>>
<<elseif $worn.upper.name is "tie-front top">>
	<<if $worn.upper.state is "waist">>
		<<switch $player.perceived_breastsize>>
			<<case 8 9 10 11 12>>

			<<case 5 6 7>>

			<<case 3 4>>

			<<case 1 2>>

			<<case 0>>

		<</switch>>
	<</if>>
<<elseif !$worn.upper.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<if $worn.upper.state is "waist">>

		<<else>>

		<</if>>
	<<else>>
		<<if $worn.upper.state is "waist">>

		<<else>>

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

<<if setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1 and $worn.upper.name isnot "t-shirt">>
	<<if $worn.upper.name is "turtleneck">>
		<<set _sleeves to "turtleneck">>
	<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater" or $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>
		<<set _sleeves to "sweatersleeves">>
	<<else>>
		<<set _sleeves to "sleeves">>
	<</if>>
	<<if $leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind">>

	<<elseif $leftarm is "penis" or $leftarmstate is "tentacle">>

	<<else>>

	<</if>>
	<<if $rightarm is "penis" or $rightarmstate is "tentacle">>

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

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

<<if $worn.under_upper.name is "bikini top">>
	<<if $worn.under_upper.state isnot "chest" and $worn.under_upper.state isnot "midriff">>

	<<else>>

	<</if>>
<<elseif $worn.under_upper.name is "tape">>
	<<if $player.perceived_breastsize is 0>>
		<<set _size to "none">>
	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
		<<set _size to "tiny">>
	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
		<<set _size to "small">>
	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
		<<set _size to "large">>
	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
		<<set _size to "huge">>
	<</if>>

<<elseif $worn.under_upper.name is "mesh shirt">>
	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>
			<<set _size to "none">>
		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
			<<set _size to "tiny">>
		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
			<<set _size to "small">>
		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
			<<set _size to "large">>
		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
			<<set _size to "huge">>
		<</if>>

	<</if>>

	<<if $worn.under_upper.state is "midriff">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<set _bound to "">>
	<<else>>
		<<set _bound to "bound">>
	<</if>>

<<elseif $worn.under_upper.name is "chest wrap">>
	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>

		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>

		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>

		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>

		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>

		<</if>>
	<</if>>
<<elseif $worn.under_upper.name is "swim shirt">>
	<<if $worn.under_upper.state is "midriff" or $worn.under_upper.state is "waist">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>
	<<if $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
		<<set _bound to "">>
	<<else>>
		<<set _bound to "bound">>
	<</if>>

<<elseif !$worn.under_upper.type.includes("naked")>>
	<<if $worn.under_upper.state isnot "chest" and $worn.under_upper.state isnot "midriff">>

	<<else>>

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

<<if $worn.face.name is "muzzle">>

<<elseif $worn.face.type.includes("gag")>>

<</if>>
<<if $worn.face.type.includes("blindfold")>>

<</if>>
<<if $worn.neck.name is "cow bell">>

<<elseif $worn.neck.name is "necktie">>

<<elseif $worn.neck.name is "scarf">>

<</if>>

<<if $worn.hands.name isnot "naked">>
	<<if $worn.hands.leftImage is 1>>
		<<if $leftarm is "penis">>

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

		<</if>>
	<</if>>
	<<if $worn.hands.rightImage is 1>>
		<<if $rightarm is "penis">>

		<<elseif $rightarm is "bound">>
		<<elseif $rightarm is "grappled">>
		<<elseif $rightarm is "behind">>
		<<elseif $rightarmstate is "tentacle">>
		<<else>>

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

<<if $worn.feet.type.includes("heels") or $worn.feet.name is "wedge sandals" or $worn.feet.name is "light-up trainers">>
	<<set _feetjob to ($feetuse is 'penis' ? 'feetjob' : 'thighs')>>
	<<if $worn.feet.colour>>
		<<set _shoeColour to $worn.feet.colourCustom>>
	<</if>>
	<<if $worn.feet.accessory_colour>>
		<<set _shoeAccColour to $worn.feet.accessory_colourCustom>>
	<</if>>

	<<if $worn.feet.accessory>>
		<<if $worn.feet.accessory_colour isnot 0>>

		<<else>>

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

<<if !$worn.legs.type.includes("naked")>>
	<<if $feetuse is "penis" or $feetstate is "tentacle">>
		<<set _feetjob to "feetjob">>
	<<else>>
		<<set _feetjob to "rest">>
	<</if>>
	<<if $worn.legs.state is setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base>>
		<<set _feetposition to "full">>
	<<else>>
		<<set _feetposition to "knees">>
	<</if>>
	<<if $worn.legs.colour>>
		<<set _legColour to $worn.legs.colourCustom>>
	<</if>>
	<<if $worn.legs.accessory_colour>>
		<<set _legAccColour to $worn.legs.accessory_colourCustom>>
	<</if>>

	<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

	<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>

	<<else>>

	<</if>>
	<<if $worn.legs.accessory>>
		<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

		<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>

		<<else>>

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

<</widget>>

<<widget "clothesidlemissionary">>
<<imgOpacity>>
<<leg_position>>

<<if $worn.head.name is "mini snowman">>

<</if>>

<<if !$worn.upper.type.includes("naked") and $worn.upper.name isnot "gym shirt"
										 and $worn.upper.name isnot "tube top"
										 and $worn.upper.name isnot "towel top">>
	<<if $worn.upper.name is "turtleneck" and $worn.upper.state is "chest">>

	<<elseif $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

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

<<if !$worn.under_upper.type.includes("naked") and $worn.under_upper.state_top is setup.clothes.under_upper[clothesIndex('under_upper', $worn.under_upper)].state_top_base and $worn.under_upper.name isnot "chest wrap" and $worn.under_upper.name isnot "mesh shirt" and $worn.under_upper.name isnot "tape">>
	<<if $worn.upper.name is "turtleneck" and $worn.upper.state is "midriff">>
	<<elseif $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

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

<<if $worn.upper.set is $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if $worn.upper.state is "waist">>
		<<if $worn.lower.skirt_down is 1>>
			<<if $anususe is "penis" or _leg_position is "up">>

			<<else>>

			<</if>>
		<<elseif $worn.lower.skirt_down is 0>>

		<</if>>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

	<<else>>
		<<if $anususe is "penis" or _leg_position is "up">>

		<<else>>

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

	<<if $leftarm is "penis" or $leftarmstate is "tentacle">>

	<</if>>
	<<if $rightarm is "penis" or $rightarmstate is "tentacle">>

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

<<if $worn.upper.name is "tie-front top">>
	<<if $worn.upper.state is "waist">>
		<<switch $player.perceived_breastsize>>
			<<case 8 9 10 11 12>>

			<<case 5 6 7>>

			<<case 3 4>>

			<<case 1 2>>

			<<case 0>>

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

<<elseif $worn.upper.name is "gym shirt">>
	<<if $worn.upper.state is "waist">>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

	<</if>>
	<<if $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

	<</if>>
<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater">>

<<elseif $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>

<<elseif $worn.upper.name is "turtleneck">>
	= 8 ? '_huge' : '') + '.png'" @style="($worn.upper.colour is 'custom' ? $worn.upper.colourCustom + _upperOpacity : '')">
<<elseif $worn.upper.name is "tube top" or $worn.upper.name is "towel top">>
	<<if $worn.upper.state_top is "chest">>
		<<if $player.perceived_breastsize is 0>>
			<<set _tubeimg = "none">>
		<<elseif $player.perceived_breastsize lte 2>>
			<<set _tubeimg = "tiny">>
		<<elseif $player.perceived_breastsize lte 4>>
			<<set _tubeimg = "small">>
		<<elseif $player.perceived_breastsize lte 6>>
			<<set _tubeimg = "large">>
		<<else>>
			<<set _tubeimg = "huge">>
		<</if>>
		<<set _anim = "">>
	<<else>>
		<<set _tubeimg = $worn.upper.state_top>>
		<<set _anim = " anim-idle-2f">>
	<</if>>
	<<if ($anususe is "penis" or _leg_position is "up") and
		 (_tubeimg is "ankles" or _tubeimg is "knees" or _tubeimg is "thighs")>>
		<<set _tubeimg += "up">>
	<</if>>

<<elseif !$worn.upper.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $worn.upper.state is "waist">>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

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

<<if setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1 and $worn.upper.name isnot "t-shirt">>
	<<if $worn.upper.name is "turtleneck">>
		<<set _sleeves to "turtleneck">>
	<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater" or $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>
		<<set _sleeves to "sweatersleeves">>
	<<else>>
		<<set _sleeves to "sleeves">>
	<</if>>
	<<if ($leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind") and ($rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind")>>

	<<else>>
		<<if $leftarm is "penis" or $leftarmstate is "tentacle">>

		<</if>>
		<<if $rightarm is "penis" or $rightarmstate is "tentacle">>

		<<elseif ($rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind") and $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>

		<<elseif $enemytype is "beast" and $monster isnot 1 and _stanceCheck is "top" and $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>

		<<else>>

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

<<if $feetuse is "penis" or $feetstate is "tentacle">>
	<<set _feet_pos to "_feetjob">>
<<elseif $penisuse is "othervagina" or $penisuse is "otheranus">>
	<<set _feet_pos to "_left">>
<<elseif _leg_position is "up">>
	<<set _feet_pos to "_up">>
<<else>>
	<<set _feet_pos to "_down">>
<</if>>

<<if $worn.lower.name is "micro pleated skirt" and $debug is 1>>
	<<switch $worn.lower.state>>
		<<case "waist">>
			<<if $worn.lower.skirt_down is 0>>

			<<else>>

			<</if>>
		<<case "thighs">>

		<<case "knees">>

		<<case "ankles">>

		<<case "midriff">>

	<</switch>>
<<elseif $worn.lower.name is "gym bloomers">>
	<<if $worn.lower.state is "waist">>
		<<if $anususe is "penis" or _leg_position is "up">>

		<<else>>

		<</if>>
	<<else>>
		<<if $anususe is "penis" or _leg_position is "up">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "denim shorts">>

<<elseif $worn.lower.name is "booty jorts">>

<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>
		<<if $worn.lower.state is "waist">>
			<<if $worn.lower.skirt_down is 1>>
				<<if $anususe is "penis" or _leg_position is "up">>

				<<else>>

				<</if>>
			<<elseif $worn.lower.skirt_down is 0>>

			<</if>>
		<<elseif $worn.lower.state is "midriff">>

		<<elseif $worn.lower.state is "chest">>

		<<else>>
			<<if $anususe is "penis" or _leg_position is "up">>

			<<else>>

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

	<</if>>
<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $worn.lower.name is "jeans">>

	<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

	<<else>>

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

<<if !$worn.under_lower.type.includes("naked")>>
	<<if $worn.under_lower.state is "waist" or $worn.under_lower.state is "totheside">>
		<<if $anususe is "penis" or _leg_position is "up">>

		<<else>>

		<</if>>
	<<else>>
		<<if $anususe is "penis" or $vaginause is "penis" or _leg_position is "up">>

		<<else>>

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

<<if $worn.under_upper.name is "chest wrap" and $worn.under_upper.exposed is 0>>
	<<if $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>

	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>

	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>

	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>

	<</if>>
<<elseif $worn.under_upper.name is "tape">>
	<<if $player.perceived_breastsize is 0>>
		<<set _size to "none">>
	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
		<<set _size to "tiny">>
	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
		<<set _size to "small">>
	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
		<<set _size to "large">>
	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
		<<set _size to "huge">>
	<</if>>

<<elseif $worn.under_upper.name is "mesh shirt">>
	<<if $worn.under_upper.state is "midriff">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>

	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>
			<<set _size to "none">>
		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
			<<set _size to "tiny">>
		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
			<<set _size to "small">>
		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
			<<set _size to "large">>
		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
			<<set _size to "huge">>
		<</if>>

	<</if>>

<<elseif $worn.under_upper.name is "swim shirt">>
	<<if $worn.under_upper.state is "waist">>
		<<set _state to "waist">>
	<<elseif $worn.under_upper.state is "midriff">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "chest">>
	<</if>>

<<elseif !$worn.under_upper.type.includes("naked")>>

<</if>>

<<if $worn.face.name is "muzzle">>

<<elseif $worn.face.type.includes("gag")>>

<<elseif $worn.face.name is "aviators">>

<<elseif $worn.face.name is "cool shades" or $worn.face.name is "square shades" or $worn.face.name is "round shades" or $worn.face.name is "shield shades" or $worn.face.name is "cat eye shades" or $worn.face.name is "punk shades">>

	<<if $worn.face.name.accessory_colour isnot 0>>

	<</if>>
<</if>>
<<if $worn.face.type.includes("blindfold")>>

<</if>>
<<if $worn.neck.name is "cow bell">>

<<elseif $worn.neck.name is "necktie">>

<<elseif $worn.neck.name is "scarf">>

<</if>>

<<if $worn.hands.name isnot "naked">>
	<<if $worn.hands.leftImage is 1>>
		<<if $leftarm is "penis">>

		<<elseif $leftarm is "bound">>
		<<elseif $leftarm is "grappled">>
		<<elseif $leftarm is "behind">>
		<<elseif $leftarmstate is "tentacle">>
		<<else>>
		<</if>>
	<</if>>
	<<if $worn.hands.rightImage is 1>>
		<<if $rightarm is "penis">>

		<<elseif $rightarm is "bound">>
		<<elseif $rightarm is "grappled">>
		<<elseif $rightarm is "behind">>
		<<elseif $rightarmstate is "tentacle">>
		<<else>>

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

<<if $worn.feet.type.includes("heels") or $worn.feet.name is "wedge sandals" or $worn.feet.name is "light-up trainers">>
	<<set _legl to ((_leg_position is "up") ? 'legl' : 'legldown')>>
	<<set _legr to ((_leg_position is "up") ? 'legr' : 'legrdown')>>
	<<if $worn.feet.colour>>
		<<set _shoeColour to $worn.feet.colourCustom>>
	<</if>>
	<<if $worn.feet.accessory_colour>>
		<<set _shoeAccColour to $worn.feet.accessory_colourCustom>>
	<</if>>

	<<if $worn.feet.accessory>>
		<<if $worn.feet.accessory_colour isnot 0>>

		<<else>>

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

<<if !$worn.legs.type.includes("naked")>>
	<<if $feetuse is "penis" or $feetstate is "tentacle">>
		<<set _feetjob to "feetjob">>
	<<elseif _leg_position is "up">>
		<<set _feetjob to "up">>
	<<else>>
		<<set _feetjob to "down">>
	<</if>>
	<<if $worn.legs.state is setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base>>
		<<set _feetposition to "full">>
	<<else>>
		<<set _feetposition to "knees">>
	<</if>>
	<<if $worn.legs.colour>>
		<<set _legColour to $worn.legs.colourCustom>>
	<</if>>
	<<if $worn.legs.accessory_colour>>
		<<set _legAccColour to $worn.legs.accessory_colourCustom>>
	<</if>>

	<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

	<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>
		<<if _feetjob is "feetjob">>

		<<else>>

		<</if>>
	<<else>>
		<<if _feetjob is "feetjob">>

		<<else>>

		<</if>>
	<</if>>
	<<if $worn.legs.accessory>>
		<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

		<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>

		<<else>>

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

<</widget>>

<<widget "clothesactivemissionary">>
<<imgOpacity>>

<<if $worn.head.name is "mini snowman">>

<</if>>

<<if !$worn.upper.type.includes("naked") and $worn.upper.name isnot "gym shirt"
										 and $worn.upper.name isnot "tube top"
										 and $worn.upper.name isnot "towel top">>
	<<if $worn.upper.name is "turtleneck" and $worn.upper.state is "chest">>
	<<elseif $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

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

<<if !$worn.under_upper.type.includes("naked") and $worn.under_upper.state_top is setup.clothes.under_upper[clothesIndex('under_upper', $worn.under_upper)].state_top_base and $worn.under_upper.name isnot "chest wrap" and $worn.under_upper.name isnot "mesh shirt" and $worn.under_upper.name isnot "tape">>
	<<if $worn.upper.name is "turtleneck" and $worn.upper.state is "midriff">>
	<<elseif $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

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

<<if $worn.upper.set is $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if $worn.upper.state is "waist">>
		<<if $worn.lower.skirt_down is 1>>

		<<elseif $worn.lower.skirt_down is 0>>

		<</if>>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

	<<else>>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

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

	<<if $leftarm is "penis" or $leftarmstate is "tentacle">>

	<</if>>
	<<if $rightarm is "penis" or $rightarmstate is "tentacle">>

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

<<if $worn.upper.name is "gym shirt">>
	<<if $worn.upper.state is "waist">>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

	<</if>>

	<<if $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize lte 2>>

	<<elseif $player.perceived_breastsize lte 4>>

	<<elseif $player.perceived_breastsize lte 6>>

	<<else>>

	<</if>>

<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater">>

<<elseif $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>

<<elseif $worn.upper.name is "turtleneck">>
	= 8 ? '_huge' : '') + '.png'" @style="($worn.upper.colour is 'custom' ? $worn.upper.colourCustom + _upperOpacity : '')">
<<elseif $worn.upper.name is "tube top" or $worn.upper.name is "towel top">>
	<<if $worn.upper.state_top is "chest">>
		<<if $player.perceived_breastsize is 0>>
			<<set _tubeimg = "none">>
		<<elseif $player.perceived_breastsize lte 2>>
			<<set _tubeimg = "tiny">>
		<<elseif $player.perceived_breastsize lte 4>>
			<<set _tubeimg = "small">>
		<<elseif $player.perceived_breastsize lte 6>>
			<<set _tubeimg = "large">>
		<<else>>
			<<set _tubeimg = "huge">>
		<</if>>
	<<else>>
		<<set _tubeimg = $worn.upper.state_top>>
	<</if>>
	<<if ($anususe is "penis" or _leg_position is "up") and
		 (_tubeimg is "ankles" or _tubeimg is "knees" or _tubeimg is "thighs")>>
		<<set _tubeimg += "up">>
	<</if>>

<<elseif !$worn.upper.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $worn.upper.state is "waist">>

	<<elseif $worn.upper.state is "midriff">>

	<<elseif $worn.upper.state is "chest">>

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

<<if setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1 and $worn.upper.name isnot "t-shirt">>
	<<if $worn.upper.name is "turtleneck">>
		<<set _sleeves to "turtleneck">>
	<<elseif $worn.upper.name is "sweater" or $worn.upper.name is "girl's sweater" or $worn.upper.name is "cable knit turtleneck" or $worn.upper.name is "turtleneck jumper">>
		<<set _sleeves to "sweatersleeves">>
	<<else>>
		<<set _sleeves to "sleeves">>
	<</if>>
	<<if ($leftarm is "bound" or $leftarm is "grappled" or $leftarm is "behind") and ($rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind")>>

	<<else>>
		<<if $leftarm is "penis" or $leftarmstate is "tentacle">>

		<</if>>
		<<if $rightarm is "penis" or $rightarmstate is "tentacle">>

		<<elseif ($rightarm is "bound" or $rightarm is "grappled" or $rightarm is "behind") and $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>

		<<elseif $enemytype is "beast" and $monster isnot 1 and _stanceCheck is "top" and $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>

		<<else>>

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

<<if $feetuse is "penis" or $feetstate is "tentacle">>
	<<set _feet_pos to "_feetjob">>
<<elseif $penisuse is "othervagina" or $penisuse is "otheranus">>
	<<set _feet_pos to "_left">>
<<elseif _leg_position is "up">>
	<<set _feet_pos to "_up">>
<<else>>
	<<set _feet_pos to "_down">>
<</if>>

<<if $worn.lower.name is "micro pleated skirt">>
	<<if $worn.lower.state is "waist">>
		<<if $worn.lower.skirt_down is 1>>

		<<elseif $worn.lower.skirt_down is 0>>

		<</if>>
	<<elseif $worn.lower.state is "midriff">>

	<<elseif $worn.lower.state is "chest">>

	<<else>>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "gym bloomers">>
	<<if $worn.lower.state is "waist">>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

		<</if>>
	<<else>>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

		<</if>>
	<</if>>
<<elseif $worn.lower.name is "denim shorts">>

<<elseif $worn.lower.name is "booty jorts">>

<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
	<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>
		<<if $worn.lower.state is "waist">>
			<<if $worn.lower.skirt_down is 1>>

			<<elseif $worn.lower.skirt_down is 0>>

			<</if>>
		<<elseif $worn.lower.state is "midriff">>

		<<elseif $worn.lower.state is "chest">>

		<<else>>
			<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

			<<else>>

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

	<</if>>
<<elseif !$worn.lower.type.includes("naked") and $worn.upper.set isnot $worn.lower.set>>
	<<if $worn.lower.name is "jeans">>

	<<elseif setup.clothes.lower[clothesIndex('lower', $worn.lower)].short is 1>>

	<<else>>

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

<<if !$worn.under_lower.type.includes("naked")>>
	<<if $worn.under_lower.state is "waist" or $worn.under_lower.state is "totheside">>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

		<</if>>
	<<else>>
		<<if $penisuse is "othervagina" or $penisuse is "otheranus">>

		<<else>>

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

<<if $worn.under_upper.name is "chest wrap" and $worn.under_upper.exposed is 0>>
	<<if $player.perceived_breastsize is 0>>

	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>

	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>

	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>

	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>

	<</if>>
<<elseif $worn.under_upper.name is "tape">>
	<<if $player.perceived_breastsize is 0>>
		<<set _size to "none">>
	<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
		<<set _size to "tiny">>
	<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
		<<set _size to "small">>
	<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
		<<set _size to "large">>
	<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
		<<set _size to "huge">>
	<</if>>

<<elseif $worn.under_upper.name is "mesh shirt">>
	<<if $worn.under_upper.state is "midriff">>
		<<set _state to "midriff">>
	<<else>>
		<<set _state to "neck">>
	<</if>>

	<<if $worn.under_upper.exposed is 0>>
		<<if $player.perceived_breastsize is 0>>
			<<set _size to "none">>
		<<elseif $player.perceived_breastsize is 1 or $player.perceived_breastsize is 2>>
			<<set _size to "tiny">>
		<<elseif $player.perceived_breastsize is 3 or $player.perceived_breastsize is 4>>
			<<set _size to "small">>
		<<elseif $player.perceived_breastsize gte 5 and $player.perceived_breastsize lte 7>>
			<<set _size to "large">>
		<<elseif $player.perceived_breastsize gte 8 and $player.perceived_breastsize lte 12>>
			<<set _size to "huge">>
		<</if>>

	<</if>>
<<elseif !$worn.under_upper.type.includes("naked")>>

<</if>>

<<if $worn.face.name is "muzzle">>

<<elseif $worn.face.type.includes("gag")>>

<<elseif $worn.face.name is "aviators">>

<<elseif $worn.face.name is "cool shades" or $worn.face.name is "square shades" or $worn.face.name is "round shades" or $worn.face.name is "shield shades" or $worn.face.name is "cat eye shades" or $worn.face.name is "punk shades">>

	<<if $worn.face.name.accessory_colour isnot 0>>

	<</if>>
<</if>>
<<if $worn.face.type.includes("blindfold")>>

<</if>>
<<if $worn.neck.name is "cow bell">>

<<elseif $worn.neck.name is "necktie">>

<<elseif $worn.neck.name is "scarf">>

<</if>>

<<if $worn.hands.name isnot "naked">>
	<<if $worn.hands.leftImage is 1>>
		<<if $leftarm is "penis">>

		<<elseif $leftarm is "bound">>
		<<elseif $leftarm is "grappled">>
		<<elseif $leftarm is "behind">>
		<<elseif $leftarmstate is "tentacle">>
		<<else>>
		<</if>>
	<</if>>
	<<if $worn.hands.rightImage is 1>>
		<<if $rightarm is "penis">>

		<<elseif $rightarm is "bound">>
		<<elseif $rightarm is "grappled">>
		<<elseif $rightarm is "behind">>
		<<elseif $rightarmstate is "tentacle">>
		<<elseif $enemytype is "beast" and $monster isnot 1 and _stanceCheck is "top">>

		<<else>>

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

<<if $worn.feet.type.includes("heels") or $worn.feet.name is "wedge sandals" or $worn.feet.name is "light-up trainers">>
	<<if $feetuse is "penis" or $feetstate is "tentacle">>
		<<set _legl to 'legl'>>
		<<set _legr to 'feetjob'>>
	<<else>>
		<<set _legl to (($penisuse is "othervagina" or $penisuse is "otheranus") ? 'legldown' : 'legl')>>
		<<set _legr to (($penisuse is "othervagina" or $penisuse is "otheranus") ? 'legrdown' : 'legr')>>
	<</if>>
	<<if $worn.feet.colour>>
		<<set _shoeColour to $worn.feet.colourCustom>>
	<</if>>
	<<if $worn.feet.accessory_colour>>
		<<set _shoeAccColour to $worn.feet.accessory_colourCustom>>
	<</if>>

	<<if $worn.feet.accessory>>
		<<if $worn.feet.accessory_colour isnot 0>>

		<<else>>

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

<<if !$worn.legs.type.includes("naked")>>
	<<if $feetuse is "penis" or $feetstate is "tentacle">>
		<<set _legl to 'up'>>
		<<set _legr to 'feetjob'>>
	<<elseif $penisuse isnot "othervagina" and $penisuse isnot "otheranus">>
		<<set _legl to 'up'>>
		<<set _legr to 'up'>>
	<<elseif $penisuse is "othervagina" or $penisuse is "otheranus">>
		<<set _legl to 'up'>>
		<<set _legr to 'down'>>
	<<else>>
		<<set _legl to 'down'>>
		<<set _legr to 'down'>>
	<</if>>
	<<if $worn.legs.state is setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base>>
		<<set _feetposition to "full">>
	<<else>>
		<<set _feetposition to "knees">>
	<</if>>
	<<if $worn.legs.colour>>
		<<set _legColour to $worn.legs.colourCustom>>
	<</if>>
	<<if $worn.legs.accessory_colour>>
		<<set _legAccColour to $worn.legs.accessory_colourCustom>>
	<</if>>

	<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

	<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>
		<<if _legr is "feetjob">>

		<<else>>

		<</if>>
	<<else>>
		<<if _legr is "feetjob">>

		<<else>>

		<</if>>
	<</if>>
	<<if $worn.legs.accessory>>
		<<if setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "waist">>

		<<elseif setup.clothes.legs[clothesIndex('legs', $worn.legs)].state_base is "ankles">>
			<<if _legr is "feetjob">>

			<<else>>

			<</if>>
		<<else>>
			<<if _legr is "feetjob">>

			<<else>>

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

<</widget>>

:: Widgets Clothes Img [widget]

<<widget "baseClothingStrings">>
<<set _worn = $worn[$args[0]]>>
<<set _class to 'anim-idle-2f' + (_worn.colour_sidebar and typeof(_worn.colour) == "string" ? ' clothes-'+_worn.colour.replace(/ /g, '-'):'')>>
<<set _classAcc to 'anim-idle-2f ' + (_worn.accessory_colour_sidebar and typeof(_worn.accessory_colour) == "string" ? ' clothes-'+_worn.accessory_colour.replace(/ /g, '-') :'')>>
<<set _style to (_worn.colourCustom ? _worn.colourCustom :'')>>
<<set _styleAcc to (_worn.accessory_colourCustom ? _worn.accessory_colourCustom :'')>>
<</widget>>

<<widget "baseClothingImg">>
<<if $worn[$args[0]].name isnot "naked">>
	<<baseClothingStrings $args[0]>>
	<<set _isHoodDown = $hoodDown and $worn[$args[0]].hood and $worn[$args[0]].outfitSecondary isnot undefined>>
	<<set _hoodDown = _isHoodDown ? "_down" : "">>

		<<if $worn[$args[0]].mainImage isnot 0>>

		<</if>>
		<<if $worn[$args[0]].accessory is 1>>

		<</if>>

	<<if $worn[$args[0]].back_img is 1 and !_isHoodDown>>

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

<<widget "neckimg">>
<<if $worn.neck.name isnot "naked">>
	<<if $worn.neck.name is "necktie">>
		<<baseClothingStrings "neck">>
		<<if $worn.upper.has_collar is 1>>
			<<set _tieimg = "full_nocollar">>
		<<else>>
			<<set _tieimg = "full">>
		<</if>>

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

		<</if>>

	<<else>>
		<<baseClothingImg "neck">>
	<</if>>
<</if>>
<</widget>>

<<widget "handsimg">>
<<if $worn.hands.name isnot "naked">>
	<<baseClothingStrings "hands">>

		<<if $worn.hands.mainImage isnot 0>>

		<</if>>
		<<if $worn.hands.leftImage is 1 and $leftarm isnot "bound" and $leftarm isnot "grappled" and $leftarm isnot "behind">>
			<<set _leftImage to "left">>
			<<if _coverLeft is true>>
				<<run _leftImage += "_cover">>
			<</if>>

			<<if $worn.hands.accessory is 1>>

			<</if>>
		<</if>>
		<<if $worn.hands.rightImage is 1 and $rightarm isnot "bound" and $rightarm isnot "grappled" and $rightarm isnot "behind">>
			<<set _rightImage to "right">>
			<<if _coverRight is true>>
				<<run _rightImage += "_cover">>
			<</if>>

			<<if $worn.hands.accessory is 1>>

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

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

<<widget "underupperimg">>
<<if $worn.under_upper.name isnot "naked">>
	<<baseClothingStrings "under_upper">>
	<<switch $underupperwetstage>>
		<<case 1>><<set _underUpperWetness to " clothes-damp">>
		<<case 2>><<set _underUpperWetness to " clothes-wet">>
		<<case 3>><<set _underUpperWetness to " clothes-drenshed">>
		<<default>><<set _underUpperWetness to "">>
	<</switch>>

	<<if $worn.under_upper.integrity lte (clothingData('under_upper',$worn.under_upper,'integrity_max') / 10) * 2>>
		<<set _imgName to "tattered">>
	<<elseif $worn.under_upper.integrity lte (clothingData('under_upper',$worn.under_upper,'integrity_max') / 10) * 5>>
		<<set _imgName to "torn">>
	<<elseif $worn.under_upper.integrity lte (clothingData('under_upper',$worn.under_upper,'integrity_max') / 10) * 9>>
		<<set _imgName to "frayed">>
	<<else>>
		<<set _imgName to "full">>
	<</if>>

		<<if $worn.under_upper.mainImage isnot 0>>

		<</if>>
		<<if setup.clothes.under_upper[clothesIndex('under_upper', $worn.under_upper)].breast_img is 1>>

		<</if>>
		<<if $worn.under_upper.accessory is 1>>

		<</if>>
		<<if $worn.under_upper.breast_acc_img is 1>>

		<</if>>

	<<set _sleeveClass to {
		"": _class,
		"primary": _class,
		"no": "",
		"secondary": _classAcc
	}[$worn.under_upper.sleeve_colour||""]>>
	<<if _coverRight isnot undefined and $worn.under_upper.sleeve_img is 1>>

		<<if _coverRight is true>>

		<<else>>

		<</if>>

	<</if>>
	<<if _coverLeft isnot undefined and $worn.under_upper.sleeve_img is 1>>

		<<if _coverLeft is true>>

		<<else>>

		<</if>>

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

<</widget>>

<<widget "underlowerimg">>
<<if $worn.under_lower.name isnot "naked">>
	<<baseClothingStrings "under_lower">>
	<<switch $underlowerwetstage>>
		<<case 1>><<set _underlowerWetness to " clothes-damp">>
		<<case 2>><<set _underlowerWetness to " clothes-wet">>
		<<case 3>><<set _underlowerWetness to " clothes-drenshed">>
		<<default>><<set _underlowerWetness to "">>
	<</switch>>

	<<if $worn.under_lower.integrity lte (clothingData('under_lower',$worn.under_lower,'integrity_max') / 10) * 2>>
		<<set _imgName to "tattered">>
	<<elseif $worn.under_lower.integrity lte (clothingData('under_lower',$worn.under_lower,'integrity_max') / 10) * 5>>
		<<set _imgName to "torn">>
	<<elseif $worn.under_lower.integrity lte (clothingData('under_lower',$worn.under_lower,'integrity_max') / 10) * 9>>
		<<set _imgName to "frayed">>
	<<else>>
		<<set _imgName to "full">>
	<</if>>
	<<if $worn.under_lower.mainImage isnot 0 and $worn.under_lower.high_img is 1>>

	<</if>>

		<<if $worn.under_lower.mainImage isnot 0 and $worn.under_lower.high_img isnot 1>>

		<</if>>
		<<if $worn.under_lower.accessory is 1>>

		<</if>>

	<<if $worn.under_lower.penis_img is 1 and $player.penisExist>>

			<<if $worn.under_lower.accessory is 1>>

			<</if>>

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

<<widget "lowerimg">>
<<if $worn.lower.name isnot "naked">>
	<<baseClothingStrings "lower">>
	<<switch $lowerwetstage>>
		<<case 1>><<set _lowerWetness to " clothes-damp">>
		<<case 2>><<set _lowerWetness to " clothes-wet">>
		<<case 3>><<set _lowerWetness to " clothes-drenshed">>
		<<default>><<set _lowerWetness to "">>
	<</switch>>

	<<if $worn.lower.integrity lte (clothingData('lower',$worn.lower,'integrity_max') / 10) * 2>>
		<<set _imgName to "tattered">>
	<<elseif $worn.lower.integrity lte (clothingData('lower',$worn.lower,'integrity_max') / 10) * 5>>
		<<set _imgName to "torn">>
	<<elseif $worn.lower.integrity lte (clothingData('lower',$worn.lower,'integrity_max') / 10) * 9>>
		<<set _imgName to "frayed">>
	<<else>>
		<<set _imgName to "full">>
	<</if>>

	<<if $worn.lower.mainImage isnot 0 and $worn.lower.high_img is 1>>

	<</if>>

		<<if $worn.lower.mainImage isnot 0 and $worn.lower.high_img isnot 1>>

		<</if>>
		<<if $worn.lower.accessory is 1>>

		<</if>>

	<<if $worn.lower.back_img is 1>>

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

<<widget "overlowerimg">>
<<if $worn.over_lower.name isnot "naked">>
	<<baseClothingStrings "over_lower">>
	<<if $worn.over_lower.integrity lte (clothingData('over_lower',$worn.over_lower,'integrity_max') / 10) * 2>>
		<<set _imgName to "tattered">>
	<<elseif $worn.over_lower.integrity lte (clothingData('over_lower',$worn.over_lower,'integrity_max') / 10) * 5>>
		<<set _imgName to "torn">>
	<<elseif $worn.over_lower.integrity lte (clothingData('over_lower',$worn.over_lower,'integrity_max') / 10) * 9>>
		<<set _imgName to "frayed">>
	<<else>>
		<<set _imgName to "full">>
	<</if>>

		<<if $worn.over_lower.mainImage isnot 0>>

		<</if>>
		<<if $worn.over_lower.accessory is 1>>

		<</if>>

	<<if $worn.over_lower.back_img is 1>>

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

<</widget>>

<<widget "genitalsimg">>
<<if $worn.genitals.name isnot "naked">>
	<<set _genitalsColour = ($worn.genitals.colour ? " clothes-"+$worn.genitals.colour.replace(/ /g, '-') : "")>>

		<<if $worn.genitals.mainImage isnot 0 and !$worn.genitals.hideUnderLower.includes($worn.under_lower.name)>>
			<<if $worn.genitals.name is "chastity cage" and $parasite.penis.name is "urchin">>
				<<if $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 2>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 5>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 9>>

				<<else>>

				<</if>>
			<<elseif $worn.genitals.name is "chastity cage" and $parasite.penis.name is "slime">>
				<<if $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 2>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 5>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 9>>

				<<else>>

				<</if>>
			<<else>>
				<<if $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 2>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 5>>

				<<elseif $worn.genitals.integrity lte (clothingData('genitals',$worn.genitals,'integrity_max') / 10) * 9>>

				<<else>>

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

<</if>>

<</widget>>

<<widget "upperimg">>
<<if $worn.upper.name isnot "naked">>
	<<baseClothingStrings "upper">>
	<<switch $upperwetstage>>
		<<case 1>><<set _upperWetness to " clothes-damp">>
		<<case 2>><<set _upperWetness to " clothes-wet">>
		<<case 3>><<set _upperWetness to " clothes-drenshed">>
		<<default>><<set _upperWetness to "">>
	<</switch>>
	<<set _tucked = $upperTucked and !setup.clothes.upper[clothesIndex('upper', $worn.upper)].notuck and $worn.upper.outfitPrimary is undefined ? " tucked" : "">>

		<<if $worn.upper.mainImage isnot 0>>
			<<if $worn.upper.integrity lte (clothingData('upper',$worn.upper,'integrity_max') / 10) * 2>>
				<<set _imgName to "tattered">>
			<<elseif $worn.upper.integrity lte (clothingData('upper',$worn.upper,'integrity_max') / 10) * 5>>
				<<set _imgName to "torn">>
			<<elseif $worn.upper.integrity lte (clothingData('upper',$worn.upper,'integrity_max') / 10) * 9>>
				<<set _imgName to "frayed">>
			<<else>>
				<<set _imgName to "full">>
			<</if>>

		<</if>>
		<<if setup.clothes.upper[clothesIndex('upper', $worn.upper)].breast_img is 1>>

		<</if>>
		<<if $worn.upper.accessory is 1>>

		<</if>>
		<<if $worn.upper.breast_acc_img is 1>>

		<</if>>

	<<set _sleeveClass to {
		"": _class,
		"primary": _class,
		"no": "",
		"secondary": _classAcc
	}[$worn.upper.sleeve_colour||""]>>
	<<if _coverRight isnot undefined and setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1>>

			<<if _coverRight is true>>

			<<else>>

			<</if>>

	<</if>>
	<<if _coverLeft isnot undefined and setup.clothes.upper[clothesIndex('upper', $worn.upper)].sleeve_img is 1>>

			<<if _coverLeft is true>>

			<<else>>

			<</if>>

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

<<widget "overupperimg">>
<<if $worn.over_upper.name isnot "naked">>
	<<baseClothingStrings "over_upper">>
	<<if $worn.over_upper.integrity lte (clothingData('over_upper',$worn.over_upper,'integrity_max') / 10) * 2>>
		<<set _imgName to "tattered">>
	<<elseif $worn.over_upper.integrity lte (clothingData('over_upper',$worn.over_upper,'integrity_max') / 10) * 5>>
		<<set _imgName to "torn">>
	<<elseif $worn.over_upper.integrity lte (clothingData('over_upper',$worn.over_upper,'integrity_max') / 10) * 9>>
		<<set _imgName to "frayed">>
	<<else>>
		<<set _imgName to "full">>
	<</if>>

		<<if $worn.over_upper.mainImage isnot 0>>

		<</if>>
		<<if setup.clothes.over_upper[clothesIndex('over_upper', $worn.over_upper)].breast_img is 1>>

		<</if>>
		<<if $worn.over_upper.accessory is 1>>

		<</if>>

	<<set _sleeveClass to {
		"": _class,
		"primary": _class,
		"no": "",
		"secondary": _classAcc
	}[$worn.over_upper.sleeve_colour||""]>>
	<<if _coverRight isnot undefined and setup.clothes.over_upper[clothesIndex('over_upper', $worn.over_upper)].sleeve_img is 1>>

			<<if _coverRight is true>>

			<<else>>

			<</if>>

	<</if>>
	<<if _coverLeft isnot undefined and setup.clothes.over_upper[clothesIndex('over_upper', $worn.over_upper)].sleeve_img is 1>>

			<<if _coverLeft is true>>

			<<else>>

			<</if>>

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

<</widget>>

<<widget "imgOpacity">>
<<if _underUpperOpacity is undefined>>
	<<set _opacity to 1>>
	<<if !$worn.under_upper.type.includes("swim")>>
		<<if $underupperwetstage gte 3>>
			<<set _opacity = Math.clamp(_opacity - 0.5, 0, 1)>>
		<<elseif $underupperwetstage gte 2>>
			<<set _opacity = Math.clamp(_opacity - 0.25, 0, 1)>>
		<</if>>
	<</if>>
	<<set _underUpperOpacity to " opacity("+_opacity+")">>
<</if>>

<<if _underLowerOpacity is undefined>>
	<<set _opacity to 1>>
	<<if !$worn.under_lower.type.includes("swim")>>
		<<if $underlowerwetstage gte 3>>
			<<set _opacity = Math.clamp(_opacity - 0.5, 0, 1)>>
		<<elseif $underlowerwetstage gte 2>>
			<<set _opacity = Math.clamp(_opacity - 0.25, 0, 1)>>
		<</if>>
	<</if>>
	<<set _underLowerOpacity to " opacity("+_opacity+")">>
<</if>>

<<if _lowerOpacity is undefined>>
	<<set _opacity to 1>>
	<<if !$worn.lower.type.includes("swim")>>
		<<if $lowerwetstage gte 3>>
			<<set _opacity = Math.clamp(_opacity - 0.5, 0, 1)>>
		<<elseif $lowerwetstage gte 2>>
			<<set _opacity = Math.clamp(_opacity - 0.25, 0, 1)>>
		<</if>>
	<</if>>
	<<set _lowerOpacity to " opacity("+_opacity+")">>
<</if>>

<<if _upperOpacity is undefined>>
	<<set _opacity to 1>>
	<<if !$worn.upper.type.includes("swim")>>
		<<if $upperwetstage gte 3>>
			<<set _opacity = Math.clamp(_opacity - 0.5, 0, 1)>>
		<<elseif $upperwetstage gte 2>>
			<<set _opacity = Math.clamp(_opacity - 0.25, 0, 1)>>
		<</if>>
	<</if>>
	<<set _upperOpacity to " opacity("+_opacity+")">>
<</if>>
<</widget>>

<<widget "player-base-body">>
	<<set _filters to $skinColor.current>>
	<<set _img to setup.tanImg.sidebar[$skinColor.tanImgEnabled]>>

		<<if $sidebarRenderer is 'canvas' or $sidebarRenderer is 'both'>> /*  renderer */
			<<canvas-player-base-body>>
		<</if>>
		<<if $sidebarRenderer is 'img' or $sidebarRenderer is 'both'>> /* legacy renderer */
		/*Prep for image checks*/
		<<switch $player.perceived_breastsize>>
		<<case 12>>
			<<set _breastSize to 6>>
		<<case 8 9 10 11>>
			<<set _breastSize to 5>>
		<<case 6 7>>
			<<set _breastSize to 4>>
		<<case 4 5>>
			<<set _breastSize to 3>>
		<<case 3>>
			<<set _breastSize to 2>>
		<<case 0 1 2>>
			<<set _breastSize to 1>>
		<</switch>>
		<<if $player.penisExist>>
			<<set _penisSize to Math.clamp($penissize, -2, 4)>>
		<</if>>
		<<set _disabled to ["disabled","hidden"]>>

		<<if $skinColor.tanImgEnabled is "t">>
			<<if $skinColor.tanValues[0] isnot $skinColor.tanValues[2]>>

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

		<<if !_disabled.includes($transformationParts.demon.wings)>>
			<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>

			<<else>>

			<</if>>
		<</if>>
		<<if !_disabled.includes($transformationParts.angel.wings)>>

		<</if>>
		<<if !_disabled.includes($transformationParts.fallenAngel.wings)>>

		<</if>>
		<<if !_disabled.includes($transformationParts.bird.wings)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.demon.tail)>>
			<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>

			<<else>>

			<</if>>
		<</if>>
		<<if !_disabled.includes($transformationParts.angel.wings)>>

		<</if>>
		<<if !_disabled.includes($transformationParts.fallenAngel.wings)>>

		<</if>>
		<<if !_disabled.includes($transformationParts.bird.wings)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.fallenAngel.halo)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.angel.halo)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.wolf.tail)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.cat.tail)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.wolf.ears)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.wolf.pits)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.wolf.pubes)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.wolf.cheeks)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.cat.ears)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.bunny.ears)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.demon.horns)>>

			/**/
		<</if>>

		<<if !_disabled.includes($transformationParts.cow.horns)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.cow.ears)>>

		<</if>>

		<<if !_disabled.includes($transformationParts.cow.tail)>>

		<</if>>

		<<if $hairposition is "front">>

		<<else>>

		<</if>>

	<<if $hairlengthstage is "thighs">>
		<<switch $hairtype>>
			<<case "default">>

			<<case "loose">>

			<<case "curl">>

			<<case "defined curl">>

			<<case "neat">>

			<<default>>
		<</switch>>
	<<elseif $hairlengthstage is "feet">>
		<<switch $hairtype>>
			<<case "default">>

			<<case "loose">>

			<<case "straight">>

			<<case "curl">>

			<<case "defined curl">>

			<<case "neat">>

			<<default>>
		<</switch>>
	<</if>>

		<<if $neverNudeMenus>> /* If player doesn't want to see nude character in menus, render the default breifs or bra + panties on their body */
			<<if $player.gender_appearance neq "m" or $player.perceived_breastsize gte 3>>

			<</if>>
			<<if $player.gender_appearance is "m">>

			<<else>>

			<</if>>
		<<else>>

			<<if $skinColor.tanImgEnabled is "t" and $skinColor.tanValues[0] isnot $skinColor.tanValues[1]>>

			<</if>>

			<<if $pbdisable is "f">>
				<<set _pbColour = ($makeup.pbcolour != 0 ? $makeup.pbcolour : $naturalhaircolour).replace(/ /g, '-')>>

				<<if $pblevel gt 1>>

				<</if>>
				<<if $pbstrip gte 1>>

				<</if>>

				<<if $player.ballsExist is true and $pblevelballs gt 1 and !$worn.genitals.name.startsWith("chastity")>>

				<</if>>

			<</if>>

			<<if _penisSize isnot undefined>>
				<<if $player.virginity.penile is true>>

				<<else>>

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

		<<faceimg 1>>
		<</if>> /* $sidebarRenderer is img */

<</widget>>


code:
:: Widgets Clothing Init [widget]

<<widget "clothing_data">>
<<set setup.clothes to {}>>
<<set setup.moddedClothes to {}>>
<<init_over_upper>>
<<init_over_lower>>
<<init_upper>>
<<init_lower>>
<<init_under_upper>>
<<init_under_lower>>
<<init_genitals>>
<<init_over_head>>
<<init_head>>
<<init_face>>
<<init_neck>>
<<init_hands>>
<<init_legs>>
<<init_feet>>
<<set setup.clothes_all_slots to ["over_upper", "over_lower", "upper", "lower", "under_upper", "under_lower","over_head", "head", "face", "neck", "hands", "legs", "feet", "genitals"]>>

<!-- Throw an error if any clothing item has an index which is not correct for its position in its array. -->
<<run Object.keys(setup.clothes).forEach(slot => setup.clothes[slot].forEach((item, i) => {if (item.index !== i) throw new Error("The index of "+item.name+" should be "+i+", not "+item.index)}))>>

<!-- Find all unique traits (types) clothes can have -->
<<set setup.clothingTraits = [...new Set(Object.keys(setup.clothes).flatMap(x => setup.clothes[x]).flatMap(x => x.type))]>>

<</widget>>

<<widget "clothing_arrays">>

<<set $clothes to {}>>
<<set $worn to {}>>
<<set $wardrobe to {}>>
<<wardrobesUpdate>>
<<set $store to {}>>
<<set $outfit to []>>
<<set $carried to {}>>

<<set $worn.over_upper to clone(setup.clothes.over_upper[0])>>
<<set $worn.over_lower to clone(setup.clothes.over_lower[0])>>
<<set $worn.upper to clone(setup.clothes.upper[0])>>
<<set $worn.lower to clone(setup.clothes.lower[0])>>
<<set $worn.under_upper to clone(setup.clothes.under_upper[0])>>
<<set $worn.under_lower to clone(setup.clothes.under_lower[0])>>
<<set $worn.genitals to clone(setup.clothes.genitals[0])>>
<<set $worn.over_head to clone(setup.clothes.over_head[0])>>
<<set $worn.head to clone(setup.clothes.head[0])>>
<<set $worn.face to clone(setup.clothes.face[0])>>
<<set $worn.neck to clone(setup.clothes.head[0])>>
<<set $worn.hands to clone(setup.clothes.hands[0])>>
<<set $worn.legs to clone(setup.clothes.legs[0])>>
<<set $worn.feet to clone(setup.clothes.feet[0])>>

<<set $wardrobe.over_upper to []>>
<<set $wardrobe.over_lower to []>>
<<set $wardrobe.upper to []>>
<<set $wardrobe.lower to []>>
<<set $wardrobe.under_upper to []>>
<<set $wardrobe.under_lower to []>>
<<set $wardrobe.over_head to []>>
<<set $wardrobe.head to []>>
<<set $wardrobe.face to []>>
<<set $wardrobe.neck to []>>
<<set $wardrobe.hands to []>>
<<set $wardrobe.legs to []>>
<<set $wardrobe.feet to []>>
<<set $wardrobe.space to 40>>

<<set $outfit to [{
	index: 0,
	name: "Pyjamas",
	over_upper: "naked",
	over_lower: "naked",
	upper: "pyjama shirt",
	lower: "pyjama bottoms",
	under_upper: "naked",
	under_lower: "naked",
	over_head: "naked",
	head: "naked",
	face: "naked",
	neck: "naked",
	hands: "naked",
	legs: "naked",
	feet: "naked",
	type: ["sleep"]
}]>>

<<set $carried.over_upper to clone(setup.clothes.over_upper[0])>>
<<set $carried.over_lower to clone(setup.clothes.over_lower[0])>>
<<set $carried.upper to clone(setup.clothes.upper[0])>>
<<set $carried.lower to clone(setup.clothes.lower[0])>>
<<set $carried.under_upper to clone(setup.clothes.under_upper[0])>>
<<set $carried.under_lower to clone(setup.clothes.under_lower[0])>>
<<set $carried.genitals to clone(setup.clothes.genitals[0])>>
<<set $carried.over_head to clone(setup.clothes.over_head[0])>>
<<set $carried.head to clone(setup.clothes.head[0])>>
<<set $carried.face to clone(setup.clothes.face[0])>>
<<set $carried.neck to clone(setup.clothes.neck[0])>>
<<set $carried.hands to clone(setup.clothes.hands[0])>>
<<set $carried.legs to clone(setup.clothes.legs[0])>>
<<set $carried.feet to clone(setup.clothes.feet[0])>>

<<set $store.over_upper to []>>
<<set $store.over_lower to []>>
<<set $store.upper to []>>
<<set $store.lower to []>>
<<set $store.under_upper to []>>
<<set $store.under_lower to []>>
<<set $store.over_head to []>>
<<set $store.head to []>>
<<set $store.face to []>>
<<set $store.neck to []>>
<<set $store.hands to []>>
<<set $store.legs to []>>
<<set $store.feet to []>>

<</widget>>

<<widget "clothinginit">>
	<<clothing_arrays>>
	<<set $upperoff to 0>>
	<<set $loweroff to 0>>
	<<set $underloweroff to 0>>
	<<set $underupperoff to 0>>
	<<set $upperwet to 0>>
	<<set $lowerwet to 0>>
	<<set $underlowerwet to 0>>
	<<set $underupperwet to 0>>
	<<set $upperwetstage to 0>>
	<<set $lowerwetstage to 0>>
	<<set $underupperwetstage to 0>>
	<<set $underlowerwetstage to 0>>
	<<set $waterwash to 0>>
	<<set $wear_over_upper to "none">>
	<<set $wear_over_lower to "none">>
	<<set $wear_upper to "none">>
	<<set $wear_lower to "none">>
	<<set $wear_under_upper to "none">>
	<<set $wear_under_lower to "none">>
	<<set $wear_over_head to "none">>
	<<set $wear_head to "none">>
	<<set $wear_face to "none">>
	<<set $wear_neck to "none">>
	<<set $wear_hands to "none">>
	<<set $wear_legs to "none">>
	<<set $wear_feet to "none">>
	<<set $wear_outfit to "none">>
<</widget>>

<<widget "givestartclothing">>

<<set $worn.over_upper to clone(setup.clothes.over_upper[0])>>
<<set $worn.over_lower to clone(setup.clothes.over_lower[0])>>
<<set $worn.upper to clone(setup.clothes.upper[0])>>
<<set $worn.lower to clone(setup.clothes.lower[0])>>
<<set $worn.under_upper to clone(setup.clothes.under_upper[0])>>
<<set $worn.under_lower to clone(setup.clothes.under_lower[0])>>
<<set $worn.over_head to clone(setup.clothes.over_head[0])>>
<<set $worn.head to clone(setup.clothes.head[0])>>
<<set $worn.face to clone(setup.clothes.face[0])>>
<<set $worn.neck to clone(setup.clothes.neck[0])>>
<<set $worn.hands to clone(setup.clothes.neck[0])>>
<<set $worn.legs to clone(setup.clothes.legs[0])>>
<<set $worn.feet to clone(setup.clothes.feet[0])>>

<<if ($player.gender is "f" and $background isnot "crossdresser") or
	($player.gender is "m" and $background is "crossdresser") or
	($player.gender is "h" and
		(
			(($player.gender_body is "m" or ($player.gender_body is "a" and $breastsize lte 3)) and $background is "crossdresser") or
			(($player.gender_body is "f" or ($player.gender_body is "a" and $breastsize gt 3)) and $background isnot "crossdresser")
		)
	)>>
	<<set $outfit.push(
		{index: $outfit.length,
		name: "Everyday",
		over_upper: "naked",
		over_lower: "naked",
		upper: "sundress",
		lower: "sundress skirt",
		under_upper: "naked",
		under_lower: "plain panties",
		over_head: "naked",
		head: "naked",
		face: "naked",
		neck: "naked",
		legs: "girl's gym socks",
		feet: "school shoes",
		type: ["normal"]
		},
		{index: $outfit.length,
		name: "School",
		over_upper: "naked",
		over_lower: "naked",
		upper: "school shirt",
		lower: "school skirt",
		under_upper: "naked",
		under_lower: "plain panties",
		over_head: "naked",
		head: "hairpin",
		face: "naked",
		neck: "naked",
		legs: "girl's gym socks",
		feet: "school shoes",
		type: ["school"]
		},
		{index: $outfit.length,
		name: "Swimwear",
		over_upper: "naked",
		over_lower: "naked",
		upper: "naked",
		lower: "naked",
		under_upper: "school swimsuit",
		under_lower: "school swimsuit bottom",
		over_head: "naked",
		head: "naked",
		face: "naked",
		neck: "naked",
		legs: "naked",
		feet: "naked",
		type: ["swim"]
		}
	)>>

	<<set $worn.upper to clone(setup.clothes.upper[1])>>
	<<set $worn.upper.colour to "white">>
	<<set $worn.lower to clone(setup.clothes.lower[1])>>
	<<set $worn.lower.colour to "white">>
	<<set $worn.under_lower to clone(setup.clothes.under_lower[1])>>
	<<set $worn.under_lower.colour to "pale white">>
	<<set $worn.legs to clone(setup.clothes.legs[3])>>
	<<set $worn.head = clone(setup.clothes.head[1])>>
	<<set $worn.feet = clone(setup.clothes.feet[1])>>

	<<if $breastsize lte 3>>
		<<set $wardrobe.under_upper.push(clone(setup.clothes.under_upper[12]))>>
		<<set $wardrobe.under_upper.last().colour to "pale white">>
	<<else>>
		<<set $worn.under_upper = clone(setup.clothes.under_upper[12])>>
		<<set $worn.under_upper.colour to "pale white">>
		<<set $outfit[1].under_upper = "plain bra">>
		<<set $outfit[2].under_upper = "plain bra">>
	<</if>>

	<<set $wardrobe.upper.push(clone(setup.clothes.upper[5]))>>
	<<set $wardrobe.upper.last().colour to "white">>
	<<set $wardrobe.lower.push(clone(setup.clothes.lower[7]))>>
	<<set $wardrobe.lower.last().colour to "black">>
	<<set $wardrobe.upper.push(clone(setup.clothes.upper[2]))>>
	<<set $wardrobe.upper.last().colour to "blue">>
	<<set $wardrobe.lower.push(clone(setup.clothes.lower[2]))>>
	<<set $wardrobe.lower.last().colour to "blue">>
	<<set $wardrobe.under_upper.push(clone(setup.clothes.under_upper[2]))>>
	<<set $wardrobe.under_upper.last().colour to "blue">>
	<<set $wardrobe.under_lower.push(clone(setup.clothes.under_lower[6]))>>
	<<set $wardrobe.under_lower.last().colour to "blue">>
<<else>>
	<<set $outfit.push(
		{index: $outfit.length,
		name: "Everyday",
		over_upper: "naked",
		over_lower: "naked",
		upper: "t-shirt",
		lower: "shorts",
		under_upper: "naked",
		under_lower: "briefs",
		over_head: "naked",
		head: "naked",
		face: "naked",
		neck: "naked",
		legs: "boy's gym socks",
		feet: "school shoes",
		type: ["normal"]
		},
		{index: $outfit.length,
		name: "School",
		over_upper: "naked",
		over_lower: "naked",
		upper: "school shirt",
		lower: "school shorts",
		under_upper: "naked",
		under_lower: "briefs",
		over_head: "naked",
		head: "naked",
		face: "naked",
		neck: "naked",
		legs: "boy's gym socks",
		feet: "school shoes",
		type: ["school"]
		},
		{index: $outfit.length,
		name: "Swimwear",
		over_upper: "naked",
		over_lower: "naked",
		upper: "naked",
		lower: "naked",
		under_upper: "naked",
		under_lower: "school swim shorts",
		over_head: "naked",
		head: "naked",
		face: "naked",
		neck: "naked",
		legs: "naked",
		feet: "naked",
		type: ["swim"]
		}
	)>>

	<<set $worn.upper to clone(setup.clothes.upper[4])>>
	<<set $worn.upper.colour to "tangerine">>
	<<set $worn.lower to clone(setup.clothes.lower[5])>>
	<<set $worn.lower.colour to "blue">>
	<<set $worn.under_lower to clone(setup.clothes.under_lower[4])>>
	<<set $worn.under_lower.colour to "black">>
	<<set $worn.legs to clone(setup.clothes.legs[2])>>
	<<set $worn.feet = clone(setup.clothes.feet[1])>>

	<<set $wardrobe.upper.push(clone(setup.clothes.upper[5]))>>
	<<set $wardrobe.upper.last().colour to "white">>
	<<set $wardrobe.lower.push(clone(setup.clothes.lower[6]))>>
	<<set $wardrobe.lower.last().colour to "black">>
	<<set $wardrobe.upper.push(clone(setup.clothes.upper[2]))>>
	<<set $wardrobe.upper.last().colour to "blue">>
	<<set $wardrobe.lower.push(clone(setup.clothes.lower[2]))>>
	<<set $wardrobe.lower.last().colour to "blue">>
	<<set $wardrobe.under_lower.push(clone(setup.clothes.under_lower[7]))>>
	<<set $wardrobe.under_lower.last().colour to "blue">>
	<<set $wardrobe.head.push(clone(setup.clothes.head[1]))>>
<</if>>
<</widget>>

repo_name: Area/degrees

license: mit


code:
:: School Library Shop

	<<schoolShop-main>>

:: School Library Shop Widgets [widget]

<<widget "schoolShop-main">>
	<<set $outside to 0>><<set $location to "school">><<effects>>
	<<set $shopName = "school">>
	<<if $tryOn.autoReset isnot false>><<tryOnReset>><</if>>
	<<if $school_shop_intro isnot 1>>
		<<set $school_shop_intro to 1>>
		Sydney nods, leading you to the other end of the counter. Shirts, trousers, and skirts hang from circular stands, while swimsuits stay compactly folded on shelves.

		"You can find just about anything that matches the dress code here," <<he>> says, gesturing to the wall behind <<him>>. "There's also a small changing room, right this way. N-no one will peek, don't worry." <<His>> face turns red.

		<<link [[Next|School Library Shop]]>><<endevent>><</link>>

	<<else>>
        Around the corner from the rental counter is a small area reserved for school-sanctioned clothing. Shirts, trousers, and skirts hang from circular stands, while swimsuits stay compactly folded on shelves.

        <<if $schoolShopAction is undefined>>
            <<set $schoolShopAction to []>>
        <</if>>
		<<NPCStatusCheck "Sydney">>
        <<if $schoolShopAction.includes("wear") or $schoolShopAction.includes("try") or $schoolShopAction.includes("under")>>
			<<if random(1,10) is 1>>
				You hear Sydney speaking outside. "Um, the changing room is currently occupied! Sorry."
			<<elseif !$sydneyDaily.peek and random(1,10) is 2 and (_sydneyStatus.includes("corrupt") or _sydneyStatus.includes("Lust"))>>
				<<set $sydneyDaily.peek to true>><<set $sydneySeen.pushUnique("changing room")>>
				You hear the curtain shift behind you. You quickly turn around and hear a gasp. Sydney's face disappears behind the curtain. <<stress 3>><<gstress>><<npcincr Sydney lust 1>><<glust>><<arousal 50>><<garousal>>
			<<else>>
           		Sydney patiently waits for you outside the changing room.
			<</if>>
        <<else>>
		    Sydney patiently waits for you.
        <</if>>

<<tryOnStats>>

		<<unset $shopListStartCount>>
		<<unset $clothes_choice>>
		<<set $shopPage = 0>>

		Warmth:
		<<warmthscale>>

			<<warmth_description>>

		<<if $debug is 1>>
			<<clothingcategoryicon "overoutfit">>
			<<link "View over outfits">><<replace "#clothingShop-div">><<OverOutfitShop>><</replace>><</link>>

		<</if>>
        /*
		*<<clothingcategoryicon "outfit">>
		*<<link "View outfits">><<replace "#clothingShop-div">><<OutfitShop>><</replace>><</link>>
		*

        */
		<<clothingcategoryicon "upper">>
		<<link "View tops">><<replace "#clothingShop-div">><<TopShop>><</replace>><</link>>

		<<clothingcategoryicon "lower">>
		<<link "View bottoms">><<replace "#clothingShop-div">><<BottomShop>><</replace>><</link>>

		<<clothingcategoryicon "underoutfit">>
		<<link "View under outfits">><<replace "#clothingShop-div">><<UnderOutfitShop>><</replace>><</link>>

		<<clothingcategoryicon "underupper">>
		<<link "View under tops">><<replace "#clothingShop-div">><<UnderTopShop>><</replace>><</link>>

		<<clothingcategoryicon "underlower">>
		<<link "View under bottoms">><<replace "#clothingShop-div">><<UnderBottomShop>><</replace>><</link>>

		<<clothingcategoryicon "head">>
		<<link "View Head Accessories">><<replace "#clothingShop-div">><<HeadShop>><</replace>><</link>>

		<<clothingcategoryicon "face">>
		<<link "View Face Accessories">><<replace "#clothingShop-div">><<FaceShop>><</replace>><</link>>

        /*
		*<<clothingcategoryicon "neck">>
		*<<link "View Neck Accessories">><<replace "#clothingShop-div">><<NeckShop>><</replace>><</link>>
		*

        */
		<<clothingcategoryicon "hand">>
		<<link "View Hand Accessories">><<replace "#clothingShop-div">><<HandsShop>><</replace>><</link>>

		<<clothingcategoryicon "legs">>
		<<link "View Legwear">><<replace "#clothingShop-div">><<LegsShop>><</replace>><</link>>

		<<clothingcategoryicon "feet">>
		<<link "View Shoes">><<replace "#clothingShop-div">><<FeetShop>><</replace>><</link>>

		<<run linkifyDivs('.button-back-to-shop')>>

		<<if $tryOn.value gt 0 and $tryOn.value lt $money>>
			<<sendItemsToDropdown>>
			<<link "Buy clothes and send to wardrobe">>
				<<buyTryOnClothes "wardrobe">>
				<<updatesidebarmoney>>
				<<updatesidebarimg>>
				<<updatesidebardescription>>
				<<updateallure>>
				<<updatewarmthscale>>
				<<updatewarmthdescription>>
				<<updateclothingshop>>
			<</link>>

		<<elseif $tryOn.value is 0>>
			<<link [[Leave|Library Rental Counter]]>><<shopClothingFilterReset>><<ShowUnderEquip "normal">><<endnpc>><<unset $clothes_choice>><<set $tryOn.autoReset to true>><<set $eventskip to 1>><<unset $tempDisable>><<endevent>><</link>>

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