code:
:: Widgets Clothing [widget]

/*The "...wear" widgets give the player character new clothing. They take the index of the item you want to provide as the first argument, and the colour of the item as an optional second argument. The third argument defines the secondary colour, optionally. Only the upper half is required in the case of outfits. Currently worn clothes are sent to wardrobe.*/

<<widget "upperwear">><<nobr>>
<<if $worn.upper.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<unset _strip_restrict>>
		<<set _temp to $args[0]>>
		<<if $worn.upper.name isnot "naked">>
			<<upperundress "wardrobe">>
		<</if>>
		<<set $worn.upper to clone($clothes.upper[_temp])>>
		<<if $args[1]>>
			<<set $worn.upper.colour to $args[1]>>
		<<elseif $clothes.upper[_temp].colour_options.length isnot 0>>
			<<set $worn.upper.colour to clone($worn.upper.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.upper[_temp].accessory is 1>>
			<<set $worn.upper.accessory_colour to $args[2]>>
		<<elseif $clothes.upper[_temp].accessory_colour_options.length isnot 0 and $worn.upper.accessory is 1>>
			<<set $worn.upper.accessory_colour to clone($worn.upper.accessory_colour_options.random())>>
		<</if>>
		<<if $worn.upper.one_piece is 1>>
			<<for _i to 0; _i lt $clothes.lower.length; _i++>>
				<<if $clothes.lower[_i].set is $worn.upper.set>>
				<<set _strip_restrict to 1>>
				<<lowerundress "wardrobe">>
				<<set $worn.lower to clone($clothes.lower[_i])>>
					<<if $args[1]>>
						<<set $worn.lower.colour to $args[1]>>
					<<elseif $clothes.lower[_i].colour_options.length isnot 0>>
						<<set $worn.lower.colour to clone($worn.upper.colour)>>
					<</if>>
					<<if $args[2] and $clothes.lower[_temp].accessory is 1>>
						<<set $worn.lower.accessory_colour to $args[2]>>
					<<elseif $clothes.lower[_temp].accessory_colour_options.length isnot 0 and $worn.lower.accessory is 1>>
						<<set $worn.lower.accessory_colour to clone($worn.upper.accessory_colour)>>
					<</if>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "lowerwear">><<nobr>>
<<if $worn.lower.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.lower.name isnot "naked">>
			<<lowerundress "wardrobe">>
		<</if>>
		<<set $worn.lower to clone($clothes.lower[_temp])>>
		<<if $args[1]>>
			<<set $worn.lower.colour to $args[1]>>
		<<elseif $clothes.lower[_temp].colour_options.length isnot 0>>
			<<set $worn.lower.colour to clone($worn.lower.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.lower[_temp].accessory is 1>>
			<<set $worn.lower.accessory_colour to $args[2]>>
		<<elseif $clothes.lower[_temp].accessory_colour_options.length isnot 0 and $worn.lower.accessory is 1>>
			<<set $worn.lower.accessory_colour to clone($worn.lower.accessory_colour_options.random())>>
		<</if>>
		<<if $worn.lower.one_piece is 1>>
			<<for _i to 0; _i lt $clothes.upper.length; _i++>>
				<<if $clothes.upper[_i].set is $worn.lower.set>>
					<<set _strip_restrict to 1>>
					<<upperundress "wardrobe">>
					<<set $worn.upper to clone($clothes.upper[_i])>>
					<<if $args[1]>>
						<<set $worn.upper.colour to $args[1]>>
					<<elseif $clothes.upper[_i].colour_options.length isnot 0>>
						<<set $worn.upper.colour to clone($worn.lower.colour)>>
					<</if>>
					<<if $args[2] and $clothes.upper[_temp].accessory is 1>>
						<<set $worn.upper.accessory_colour to $args[2]>>
					<<elseif $clothes.upper[_temp].accessory_colour_options.length isnot 0 and $worn.upper.accessory is 1>>
						<<set $worn.upper.accessory_colour to clone($worn.lower.accessory_colour)>>
					<</if>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underupperwear">><<nobr>>
<<if $worn.under_upper.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<unset _strip_restrict>>
		<<set _temp to $args[0]>>
		<<if $worn.under_upper.name isnot "naked">>
			<<underupperundress "wardrobe">>
		<</if>>
		<<set $worn.under_upper to clone($clothes.under_upper[_temp])>>
		<<if $args[1]>>
			<<set $worn.under_upper.colour to $args[1]>>
		<<elseif $clothes.under_upper[_temp].colour_options.length isnot 0>>
			<<set $worn.under_upper.colour to clone($worn.under_upper.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.under_upper[_temp].accessory is 1>>
			<<set $worn.under_upper.accessory_colour to $args[2]>>
		<<elseif $clothes.under_upper[_temp].accessory_colour_options.length isnot 0 and $worn.under_upper.accessory is 1>>
			<<set $worn.under_upper.accessory_colour to clone($worn.under_upper.accessory_colour_options.random())>>
		<</if>>
		<<if $worn.under_upper.one_piece is 1>>
			<<for _i to 0; _i lt $clothes.under_lower.length; _i++>>
				<<if $clothes.under_lower[_i].set is $worn.under_upper.set>>
					<<set _strip_restrict to 1>>
					<<underlowerundress "wardrobe">>
					<<set $worn.under_lower to clone($clothes.under_lower[_i])>>
					<<if $args[1]>>
						<<set $worn.under_lower.colour to $args[1]>>
					<<elseif $clothes.under_lower[_i].colour_options.length isnot 0>>
						<<set $worn.under_lower.colour to clone($worn.under_upper.colour)>>
					<</if>>
					<<if $args[2] and $clothes.under_lower[_temp].accessory is 1>>
						<<set $worn.under_lower.accessory_colour to $args[2]>>
					<<elseif $clothes.under_lower[_temp].accessory_colour_options.length isnot 0 and $worn.under_lower.accessory is 1>>
						<<set $worn.under_lower.accessory_colour to clone($worn.under_upper.accessory_colour)>>
					<</if>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underlowerwear">><<nobr>>
<<if $worn.under_lower.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.under_lower.name isnot "naked">>
			<<underlowerundress "wardrobe">>
		<</if>>
		<<set $worn.under_lower to clone($clothes.under_lower[_temp])>>
		<<if $args[1]>>
			<<set $worn.under_lower.colour to $args[1]>>
		<<elseif $clothes.under_lower[_temp].colour_options.length isnot 0>>
			<<set $worn.under_lower.colour to clone($worn.under_lower.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.under_lower[_temp].accessory is 1>>
			<<set $worn.under_lower.accessory_colour to $args[2]>>
		<<elseif $clothes.under_lower[_temp].accessory_colour_options.length isnot 0 and $worn.under_lower.accessory is 1>>
			<<set $worn.under_lower.accessory_colour to clone($worn.under_lower.accessory_colour_options.random())>>
		<</if>>
		<<if $worn.under_lower.one_piece is 1>>
			<<for _i to 0; _i lt $clothes.under_upper.length; _i++>>
				<<if $clothes.under_upper[_i].set is $worn.under_lower.set>>
					<<set _strip_restrict to 1>>
					<<underupperundress "wardrobe">>
					<<set $worn.under_upper to clone($clothes.under_upper[_i])>>
					<<if $args[1]>>
						<<set $worn.under_upper.colour to $args[1]>>
					<<elseif $clothes.under_upper[_i].colour_options.length isnot 0>>
						<<set $worn.under_upper.colour to clone($worn.under_lower.colour)>>
					<</if>>
					<<if $args[2] and $clothes.under_upper[_temp].accessory is 1>>
						<<set $worn.under_upper.accessory_colour to $args[2]>>
					<<elseif $clothes.under_upper[_temp].accessory_colour_options.length isnot 0 and $worn.under_upper.accessory is 1>>
						<<set $worn.under_upper.accessory_colour to clone($worn.under_lower.accessory_colour)>>
					<</if>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "headwear">><<nobr>>
<<if $worn.head.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.head.name isnot "naked">>
			<<headundress "wardrobe">>
		<</if>>
		<<set $worn.head to clone($clothes.head[_temp])>>
		<<if $args[1]>>
			<<set $worn.head.colour to $args[1]>>
		<<elseif $clothes.head[_temp].colour_options.length isnot 0>>
			<<set $worn.head.colour to clone($worn.head.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.head[_temp].accessory is 1>>
			<<set $worn.head.accessory_colour to $args[2]>>
		<<elseif $clothes.head[_temp].accessory_colour_options.length isnot 0 and $worn.head.accessory is 1>>
			<<set $worn.head.accessory_colour to clone($worn.head.accessory_colour_options.random())>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "facewear">><<nobr>>
<<if $worn.face.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.face.name isnot "naked">>
			<<faceundress "wardrobe">>
		<</if>>
		<<set $worn.face to clone($clothes.face[_temp])>>
		<<if $args[1]>>
			<<set $worn.face.colour to $args[1]>>
		<<elseif $clothes.face[_temp].colour_options.length isnot 0>>
			<<set $worn.face.colour to clone($worn.face.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.face[_temp].accessory is 1>>
			<<set $worn.face.accessory_colour to $args[2]>>
		<<elseif $clothes.face[_temp].accessory_colour_options.length isnot 0 and $worn.face.accessory is 1>>
			<<set $worn.face.accessory_colour to clone($worn.face.accessory_colour_options.random())>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "neckwear">><<nobr>>
<<if $worn.neck.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.neck.name isnot "naked">>
			<<neckundress "wardrobe">>
		<</if>>
		<<set $worn.neck to clone($clothes.neck[_temp])>>
		<<if $args[1]>>
			<<set $worn.neck.colour to $args[1]>>
		<<elseif $clothes.neck[_temp].colour_options.length isnot 0>>
			<<set $worn.neck.colour to clone($worn.neck.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.neck[_temp].accessory is 1>>
			<<set $worn.neck.accessory_colour to $args[2]>>
		<<elseif $clothes.neck[_temp].accessory_colour_options.length isnot 0 and $worn.neck.accessory is 1>>
			<<set $worn.neck.accessory_colour to clone($worn.neck.accessory_colour_options.random())>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "legswear">><<nobr>>
<<if $worn.legs.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.legs.name isnot "naked">>
			<<legsundress "wardrobe">>
		<</if>>
		<<set $worn.legs to clone($clothes.legs[_temp])>>
		<<if $args[1]>>
			<<set $worn.legs.colour to $args[1]>>
		<<elseif $clothes.legs[_temp].colour_options.length isnot 0>>
			<<set $worn.legs.colour to clone($worn.legs.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.legs[_temp].accessory is 1>>
			<<set $worn.legs.accessory_colour to $args[2]>>
		<<elseif $clothes.legs[_temp].accessory_colour_options.length isnot 0 and $worn.legs.accessory is 1>>
			<<set $worn.legs.accessory_colour to clone($worn.legs.accessory_colour_options.random())>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "feetwear">><<nobr>>
<<if $worn.feet.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<set _temp to $args[0]>>
		<<if $worn.feet.name isnot "naked">>
			<<feetundress "wardrobe">>
		<</if>>
		<<set $worn.feet to clone($clothes.feet[_temp])>>
		<<if $args[1]>>
			<<set $worn.feet.colour to $args[1]>>
		<<elseif $clothes.feet[_temp].colour_options.length isnot 0>>
			<<set $worn.feet.colour to clone($worn.feet.colour_options.random())>>
		<</if>>
		<<if $args[2] and $clothes.feet[_temp].accessory is 1>>
			<<set $worn.feet.accessory_colour to $args[2]>>
		<<elseif $clothes.feet[_temp].accessory_colour_options.length isnot 0 and $worn.feet.accessory is 1>>
			<<set $worn.feet.accessory_colour to clone($worn.feet.accessory_colour_options.random())>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

/*The "...send" widgets give the player character new clothing. They take the index of the item you want to provide as an argument, the location you want to send it to as a second argument, (such as "wardrobe",) and the colour of the item as an optional third argument. Fourth argument defines the secondary colour, if present. Only the upper half is required in the case of outfits. They differ from the "...wear" widgets in that they send clothes to your wardrobe, rather than put them on your character.*/

<<widget "uppersend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.upper.push(clone($clothes.upper[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.upper.last().colour to $args[2]>>
	<<elseif $clothes.upper[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.upper.last().colour to clone($wardrobe.upper.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.upper.last().accessory is 1>>
		<<set $wardrobe.upper.last().accessory_colour to $args[3]>>
	<<elseif $clothes.upper[_temp].accessory_colour_options.length isnot 0 and $wardrobe.upper.last().accessory is 1>>
		<<set $wardrobe.upper.last().accessory_colour to clone($wardrobe.upper.last().accessory_colour_options.random())>>
	<</if>>
	<<if $wardrobe.upper.last().one_piece is 1>>
		<<for _e to 0; _e lt $clothes.lower.length; _e++>>
			<<if $wardrobe.upper.last().set is $clothes.lower[_e].set>>
				<<set $wardrobe.lower.push(clone($clothes.lower[_e]))>>
				<<if $args[2]>>
					<<set $wardrobe.lower.last().colour to $args[2]>>
				<<elseif $clothes.lower[_e].colour_options.length isnot 0>>
					<<set $wardrobe.lower.last().colour to clone($wardrobe.upper.last().colour)>>
				<</if>>
				<<if $args[3] and $wardrobe.lower.last().accessory is 1>>
					<<set $wardrobe.lower.last().accessory_colour to $args[3]>>
				<<elseif $clothes.lower[_e].accessory_colour_options.length isnot 0 and $wardrobe.lower.last().accessory is 1>>
					<<set $wardrobe.lower.last().accessory_colour to clone($wardrobe.upper.last().accessory_colour)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "lowersend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.lower.push(clone($clothes.lower[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.lower.last().colour to $args[2]>>
	<<elseif $clothes.lower[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.lower.last().colour to clone($wardrobe.lower.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.lower.last().accessory is 1>>
		<<set $wardrobe.lower.last().accessory_colour to $args[3]>>
	<<elseif $clothes.lower[_temp].accessory_colour_options.length isnot 0 and $wardrobe.lower.last().accessory is 1>>
		<<set $wardrobe.lower.last().accessory_colour to clone($wardrobe.lower.last().accessory_colour_options.random())>>
	<</if>>
	<<if $wardrobe.lower.last().one_piece is 1>>
		<<for _e to 0; _e lt $clothes.upper.length; _e++>>
			<<if $wardrobe.lower.last().set is $clothes.upper[_e].set>>
			<<set $wardrobe.upper.push(clone($clothes.upper[_e]))>>
				<<if $args[2]>>
					<<set $wardrobe.upper.last().colour to $args[2]>>
				<<elseif $clothes.upper[_e].colour_options.length isnot 0>>
					<<set $wardrobe.upper.last().colour to clone($wardrobe.lower.last().colour)>>
				<</if>>
				<<if $args[3] and $wardrobe.upper.last().accessory is 1>>
					<<set $wardrobe.upper.last().accessory_colour to $args[3]>>
				<<elseif $clothes.upper[_e].accessory_colour_options.length isnot 0 and $wardrobe.upper.last().accessory is 1>>
					<<set $wardrobe.upper.last().accessory_colour to clone($wardrobe.lower.last().accessory_colour)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underuppersend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.under_upper.push(clone($clothes.under_upper[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.under_upper.last().colour to $args[2]>>
	<<elseif $clothes.under_upper[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.under_upper.last().colour to clone($wardrobe.under_upper.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.under_upper.last().accessory is 1>>
		<<set $wardrobe.under_upper.last().accessory_colour to $args[3]>>
	<<elseif $clothes.under_upper[_temp].accessory_colour_options.length isnot 0 and $wardrobe.under_upper.last().accessory is 1>>
		<<set $wardrobe.under_upper.last().accessory_colour to clone($wardrobe.under_upper.last().accessory_colour_options.random())>>
	<</if>>
	<<if $wardrobe.under_upper.last().one_piece is 1>>
		<<for _e to 0; _e lt $clothes.under_lower.length; _e++>>
			<<if $wardrobe.under_upper.last().set is $clothes.under_lower[_e].set>>
			<<set $wardrobe.under_lower.push(clone($clothes.under_lower[_e]))>>
				<<if $args[2]>>
					<<set $wardrobe.under_lower.last().colour to $args[2]>>
				<<elseif $clothes.under_lower[_e].colour_options.length isnot 0>>
					<<set $wardrobe.under_lower.last().colour to clone($wardrobe.under_upper.last().colour)>>
				<</if>>
				<<if $args[3] and $wardrobe.under_lower.last().accessory is 1>>
					<<set $wardrobe.under_lower.last().accessory_colour to $args[3]>>
				<<elseif $clothes.under_lower[_e].accessory_colour_options.length isnot 0 and $wardrobe.under_lower.last().accessory is 1>>
					<<set $wardrobe.under_lower.last().accessory_colour to clone($wardrobe.under_upper.last().accessory_colour)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underlowersend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.under_lower.push(clone($clothes.under_lower[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.under_lower.last().colour to $args[2]>>
	<<elseif $clothes.under_lower[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.under_lower.last().colour to clone($wardrobe.under_lower.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.under_lower.last().accessory is 1>>
		<<set $wardrobe.under_lower.last().accessory_colour to $args[3]>>
	<<elseif $clothes.under_lower[_temp].accessory_colour_options.length isnot 0 and $wardrobe.under_lower.last().accessory is 1>>
		<<set $wardrobe.under_lower.last().accessory_colour to clone($wardrobe.under_lower.last().accessory_colour_options.random())>>
	<</if>>
	<<if $wardrobe.under_lower.last().one_piece is 1>>
		<<for _e to 0; _e lt $clothes.under_upper.length; _e++>>
			<<if $wardrobe.under_lower.last().set is $clothes.under_upper[_e].set>>
			<<set $wardrobe.under_upper.push(clone($clothes.under_upper[_e]))>>
				<<if $args[2]>>
					<<set $wardrobe.under_upper.last().colour to $args[2]>>
				<<elseif $clothes.under_upper[_e].colour_options.length isnot 0>>
					<<set $wardrobe.under_upper.last().colour to clone($wardrobe.under_lower.last().colour_options)>>
				<</if>>
				<<if $args[3] and $wardrobe.under_upper.last().accessory is 1>>
					<<set $wardrobe.under_upper.last().accessory_colour to $args[3]>>
				<<elseif $clothes.under_upper[_e].accessory_colour_options.length isnot 0 and $wardrobe.under_upper.last().accessory is 1>>
					<<set $wardrobe.under_upper.last().accessory_colour to clone($wardrobe.under_lower.last().accessory_colour)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "headsend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.head.push(clone($clothes.head[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.head.last().colour to $args[2]>>
	<<elseif $clothes.head[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.head.last().colour to clone($wardrobe.head.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.head.last().accessory is 1>>
		<<set $wardrobe.head.last().accessory_colour to $args[3]>>
	<<elseif $clothes.head[_temp].accessory_colour_options.length isnot 0 and $wardrobe.head.last().accessory is 1>>
		<<set $wardrobe.head.last().accessory_colour to clone($wardrobe.head.last().accessory_colour_options.random())>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "facesend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.face.push(clone($clothes.face[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.face.last().colour to $args[2]>>
	<<elseif $clothes.face[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.face.last().colour to clone($wardrobe.face.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.face.last().accessory is 1>>
		<<set $wardrobe.face.last().accessory_colour to $args[3]>>
	<<elseif $clothes.face[_temp].accessory_colour_options.length isnot 0 and $wardrobe.face.last().accessory is 1>>
		<<set $wardrobe.face.last().accessory_colour to clone($wardrobe.face.last().accessory_colour_options.random())>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "necksend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.neck.push(clone($clothes.neck[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.neck.last().colour to $args[2]>>
	<<elseif $clothes.neck[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.neck.last().colour to clone($wardrobe.neck.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.neck.last().accessory is 1>>
		<<set $wardrobe.neck.last().accessory_colour to $args[3]>>
	<<elseif $clothes.neck[_temp].accessory_colour_options.length isnot 0 and $wardrobe.neck.last().accessory is 1>>
		<<set $wardrobe.neck.last().accessory_colour to clone($wardrobe.neck.last().accessory_colour_options.random())>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "legssend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.legs.push(clone($clothes.legs[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.legs.last().colour to $args[2]>>
	<<elseif $clothes.legs[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.legs.last().colour to clone($wardrobe.legs.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.legs.last().accessory is 1>>
		<<set $wardrobe.legs.last().accessory_colour to $args[3]>>
	<<elseif $clothes.legs[_temp].accessory_colour_options.length isnot 0 and $wardrobe.legs.last().accessory is 1>>
		<<set $wardrobe.legs.last().accessory_colour to clone($wardrobe.legs.last().accessory_colour_options.random())>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "feetsend">><<nobr>>
<<set _temp to $args[0]>>
<<if $args[1] is "wardrobe">>
	<<set $wardrobe.feet.push(clone($clothes.feet[_temp]))>>
	<<if $args[2]>>
		<<set $wardrobe.feet.last().colour to $args[2]>>
	<<elseif $clothes.feet[_temp].colour_options.length isnot 0>>
		<<set $wardrobe.feet.last().colour to clone($wardrobe.feet.last().colour_options.random())>>
	<</if>>
	<<if $args[3] and $wardrobe.feet.last().accessory is 1>>
		<<set $wardrobe.feet.last().accessory_colour to $args[3]>>
	<<elseif $clothes.feet[_temp].accessory_colour_options.length isnot 0 and $wardrobe.feet.last().accessory is 1>>
		<<set $wardrobe.feet.last().accessory_colour to clone($wardrobe.feet.last().accessory_colour_options.random())>>
	<</if>>
<</if>>
<</nobr>><</widget>>

/*The "...strip" widgets remove the player character's clothing. The clothing remains with the player character, ready to be put back on.*/

<<widget "strip">><<nobr>>

<<upperstrip>>
<<lowerstrip>>
<<underupperstrip>>
<<underlowerstrip>>
<<headstrip>>
<<facestrip>>
<<neckstrip>>
<<legsstrip>>
<<feetstrip>>

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

<<widget "clothesstrip">><<nobr>>

<<upperstrip>>
<<lowerstrip>>
<<underupperstrip>>
<<underlowerstrip>>

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

<<widget "upperstrip">><<nobr>>
<<if $worn.upper.cursed is 1>>
<<else>>
	<<if $worn.upper.name isnot "naked">>
		<<set $upperlast to clone($worn.upper.name)>>
		<<set $carried.upper to clone($worn.upper)>>
		<<if $worn.upper.set is $worn.lower.set>>
			<<set $lowerlast to clone($worn.lower.name)>>
			<<set $carried.lower to clone($worn.lower)>>
			<<set $worn.lower to clone($clothes.lower[0])>>
		<</if>>
		<<set $worn.upper to clone($clothes.upper[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "lowerstrip">><<nobr>>
<<if $worn.lower.cursed is 1>>
<<else>>
	<<if $worn.lower.name isnot "naked">>
		<<set $lowerlast to clone($worn.lower.name)>>
		<<set $carried.lower to clone($worn.lower)>>
		<<if $worn.upper.set is $worn.lower.set>>
			<<set $upperlast to clone($worn.upper.name)>>
			<<set $carried.upper to clone($worn.upper)>>
			<<set $worn.upper to clone($clothes.upper[0])>>
		<</if>>
		<<set $worn.lower to clone($clothes.lower[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underupperstrip">><<nobr>>
<<if $worn.under_upper.cursed is 1>>
<<else>>
	<<if $worn.under_upper.name isnot "naked">>
		<<set $underupperlast to clone($worn.under_upper.name)>>
		<<set $carried.under_upper to clone($worn.under_upper)>>
		<<if $worn.under_lower.set is $worn.under_upper.set>>
			<<set $lowerlast to clone($worn.under_lower.name)>>
			<<set $carried.under_lower to clone($worn.under_lower)>>
			<<set $worn.under_lower to clone($clothes.under_lower[0])>>
		<</if>>
		<<set $worn.under_upper to clone($clothes.under_upper[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "underlowerstrip">><<nobr>>
<<if $worn.under_lower.cursed is 1>>
<<else>>
	<<if $worn.under_lower.name isnot "naked">>
		<<set $underlowerlast to clone($worn.under_lower.name)>>
		<<set $carried.under_lower to clone($worn.under_lower)>>
		<<if $worn.under_lower.set is $worn.under_upper.set>>
			<<set $lowerlast to clone($worn.under_upper.name)>>
			<<set $carried.under_upper to clone($worn.under_upper)>>
			<<set $worn.under_upper to clone($clothes.under_upper[0])>>
		<</if>>
		<<set $worn.under_lower to clone($clothes.under_lower[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "headstrip">><<nobr>>
<<if $worn.head.cursed is 1>>
<<else>>
	<<if $worn.head.name isnot "naked">>
		<<set $headlast to clone($worn.head.name)>>
		<<set $carried.head to clone($worn.head)>>
		<<set $worn.head to clone($clothes.head[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "facestrip">><<nobr>>
<<if $worn.face.cursed is 1>>
<<else>>
	<<if $worn.face.name isnot "naked">>
		<<set $facelast to clone($worn.face.name)>>
		<<set $carried.face to clone($worn.face)>>
		<<set $worn.face to clone($clothes.face[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "neckstrip">><<nobr>>
<<if $worn.neck.cursed is 1>>
<<else>>
	<<if $worn.neck.name isnot "naked">>
		<<set $necklast to clone($worn.neck.name)>>
		<<set $carried.neck to clone($worn.neck)>>
		<<set $worn.neck to clone($clothes.neck[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "legsstrip">><<nobr>>
<<if $worn.legs.cursed is 1>>
<<else>>
	<<if $worn.legs.name isnot "naked">>
		<<set $legsdlast to clone($worn.legs.name)>>
		<<set $carried.legs to clone($worn.legs)>>
		<<set $worn.legs to clone($clothes.legs[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "feetstrip">><<nobr>>
<<if $worn.feet.cursed is 1>>
<<else>>
	<<if $worn.feet.name isnot "naked">>
		<<set $feetlast to clone($worn.feet.name)>>
		<<set $carried.feet to clone($worn.feet)>>
		<<set $worn.feet to clone($clothes.feet[0])>>
	<</if>>
<</if>>
<</nobr>><</widget>>

/*The "...ruined" widgets destroy the player character's current clothing, whether worn or carried.*/

<<widget "ruined">><<nobr>>
<<upperruined>>
<<lowerruined>>
<<underupperruined>>
<<underlowerruined>>
<<headruined>>
<<faceruined>>
<<neckruined>>
<<legsruined>>
<<feetruined>>
<</nobr>><</widget>>

<<widget "clothesruined">><<nobr>>
<<upperruined>>
<<lowerruined>>
<<underupperruined>>
<<underlowerruined>>
<</nobr>><</widget>>

<<widget "underruined">><<nobr>>
<<underupperruined>>
<<underlowerruined>>
<</nobr>><</widget>>

<<widget "upperruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.upper.cursed is 1 and !$worn.upper.type.includes("broken")>>
<<else>>
	<<set $upperwet to 0>><<set $upperwetstage to 0>>
	<<if $carried.upper.name isnot "naked" and $clothingrebuy is 1 and $carried.upper.one_piece isnot "broken" and ($carried.upper.shop.includes("clothing") or $carried.upper.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.upper.cost * 1.5)>>
			<<uppersend $carried.upper.index "wardrobe" $carried.upper.colour $carried.upper.accessory_colour>>
			<<set $money -= Math.trunc($carried.upper.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.upper.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.upper.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and $worn.upper.one_piece isnot "broken" and ($worn.upper.shop.includes("clothing") or $worn.upper.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.upper.cost * 1.5)>>
			<<uppersend $worn.upper.index "wardrobe" $worn.upper.colour $worn.upper.accessory_colour>>
			<<set $money -= Math.trunc($worn.upper.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.upper.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.upper.name)>>
		<</if>>
	<</if>>
	<<if $worn.upper.set is $worn.lower.set>>
		<<set $worn.lower.set to "lower">><<set $worn.lower.one_piece to "broken">>
	<</if>>
	<<if $carried.upper.set is $carried.lower.set>>
		<<set $carried.lower.set to "lower">><<set $carried.lower.one_piece to "broken">>
	<</if>>
	<<set $worn.upper to clone($clothes.upper[0])>>
	<<set $carried.upper to clone($clothes.upper[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "lowerruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.lower.cursed is 1 and !$worn.lower.type.includes("broken")>>
<<else>>
	<<set $lowerwet to 0>><<set $lowerwetstage to 0>>
	<<if $carried.lower.name isnot "naked" and $clothingrebuy is 1 and $carried.lower.one_piece isnot "broken" and ($carried.lower.shop.includes("clothing") or $carried.lower.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.lower.cost * 1.5)>>
			<<lowersend $carried.lower.index "wardrobe" $carried.lower.colour $carried.lower.accessory_colour>>
			<<set $money -= Math.trunc($carried.lower.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.lower.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.lower.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and $worn.lower.one_piece isnot "broken" and ($worn.lower.shop.includes("clothing") or $worn.lower.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.lower.cost * 1.5)>>
			<<lowersend $worn.lower.index "wardrobe" $worn.lower.colour $worn.lower.accessory_colour>>
			<<set $money -= Math.trunc($worn.lower.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.lower.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.lower.name)>>
		<</if>>
	<</if>>
	<<if $worn.upper.set is $worn.lower.set>>
		<<set $worn.upper.set to "upper">><<set $worn.upper.one_piece to "broken">>
	<</if>>
	<<if $carried.upper.set is $carried.lower.set>>
		<<set $carried.upper.set to "upper">><<set $carried.upper.one_piece to "broken">>
	<</if>>
	<<set $worn.lower to clone($clothes.lower[0])>>
	<<set $carried.lower to clone($clothes.lower[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "underupperruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.under_upper.cursed is 1 and !$worn.under_upper.type.includes("broken")>>
<<else>>
	<<set $underupperwet to 0>><<set $underupperwetstage to 0>>
	<<if $carried.under_upper.name isnot "naked" and $clothingrebuy is 1 and $carried.under_upper.one_piece isnot "broken" and ($carried.under_upper.shop.includes("clothing") or $carried.under_upper.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.under_upper.cost * 1.5)>>
			<<underuppersend $carried.under_upper.index "wardrobe" $carried.under_upper.colour $carried.under_upper.accessory_colour>>
			<<set $money -= Math.trunc($carried.under_upper.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.under_upper.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.under_upper.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and $worn.under_upper.one_piece isnot "broken" and ($worn.under_upper.shop.includes("clothing") or $worn.under_upper.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.under_upper.cost * 1.5)>>
			<<underuppersend $worn.under_upper.index "wardrobe" $worn.under_upper.colour $worn.under_upper.accessory_colour>>
			<<set $money -= Math.trunc($worn.under_upper.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.under_upper.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.under_upper.name)>>
		<</if>>
	<</if>>
	<<if $worn.under_upper.set is $worn.under_lower.set>>
		<<set $worn.under_lower.set to "under_lower">><<set $worn.under_lower.one_piece to "broken">>
	<</if>>
	<<if $carried.under_upper.set is $carried.under_lower.set>>
		<<set $carried.under_lower.set to "under_lower">><<set $carried.under_lower.one_piece to "broken">>
	<</if>>
	<<set $worn.under_upper to clone($clothes.under_upper[0])>>
	<<set $carried.under_upper to clone($clothes.under_upper[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "underlowerruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.under_lower.cursed is 1 and !$worn.under_lower.type.includes("broken")>>
<<else>>
	<<set $underlowerwet to 0>><<set $underlowerwetstage to 0>>
	<<if $carried.under_lower.name isnot "naked" and $clothingrebuy is 1 and $carried.under_lower.one_piece isnot "broken" and ($carried.under_lower.shop.includes("clothing") or $carried.under_lower.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.under_lower.cost * 1.5)>>
			<<underlowersend $carried.under_lower.index "wardrobe" $carried.under_lower.colour $carried.under_lower.accessory_colour>>
			<<set $money -= Math.trunc($carried.under_lower.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.under_lower.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.under_lower.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and $worn.under_lower.one_piece isnot "broken" and ($worn.under_lower.shop.includes("clothing") or $worn.under_lower.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.under_lower.cost * 1.5)>>
			<<underlowersend $worn.under_lower.index "wardrobe" $worn.under_lower.colour $worn.under_lower.accessory_colour>>
			<<set $money -= Math.trunc($worn.under_lower.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.under_lower.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.under_lower.name)>>
		<</if>>
	<</if>>
	<<if $worn.under_upper.set is $worn.under_lower.set>>
		<<set $worn.under_upper.set to "under_upper">><<set $worn.under_upper.one_piece to "broken">>
	<</if>>
	<<if $carried.under_upper.set is $carried.under_lower.set>>
		<<set $carried.under_upper.set to "under_upper">><<set $carried.under_upper.one_piece to "broken">>
	<</if>>
	<<set $worn.under_lower to clone($clothes.under_lower[0])>>
	<<set $carried.under_lower to clone($clothes.under_lower[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "headruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.head.cursed is 1 and !$worn.head.type.includes("broken")>>
<<else>>
	<<if $carried.head.name isnot "naked" and $clothingrebuy is 1 and ($carried.head.shop.includes("clothing") or $carried.head.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.head.cost * 1.5)>>
			<<headsend $carried.head.index "wardrobe" $carried.head.colour $carried.head.accessory_colour>>
			<<set $money -= Math.trunc($carried.head.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.head.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.head.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and ($worn.head.shop.includes("clothing") or $worn.head.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.head.cost * 1.5)>>
			<<headsend $worn.head.index "wardrobe" $worn.head.colour $worn.head.accessory_colour>>
			<<set $money -= Math.trunc($worn.head.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.head.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.head.name)>>
		<</if>>
	<</if>>
	<<set $worn.head to clone($clothes.head[0])>>
	<<set $carried.head to clone($clothes.head[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "faceruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.face.cursed is 1 and !$worn.face.type.includes("broken")>>
<<else>>
	<<if $carried.face.name isnot "naked" and $clothingrebuy is 1 and ($carried.face.shop.includes("clothing") or $carried.face.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.face.cost * 1.5)>>
			<<facesend $carried.face.index "wardrobe" $carried.face.colour $carried.face.accessory_colour>>
			<<set $money -= Math.trunc($carried.face.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.face.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.face.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and ($worn.face.shop.includes("clothing") or $worn.face.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.face.cost * 1.5)>>
			<<facesend $worn.face.index "wardrobe" $worn.face.colour $worn.face.accessory_colour>>
			<<set $money -= Math.trunc($worn.face.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.face.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.face.name)>>
		<</if>>
	<</if>>
	<<set $worn.face to clone($clothes.face[0])>>
	<<set $carried.face to clone($clothes.face[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "neckruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.neck.cursed is 1 and !$worn.neck.type.includes("broken")>>
<<else>>
	<<if $carried.neck.name isnot "naked" and $clothingrebuy is 1 and ($carried.neck.shop.includes("clothing") or $carried.neck.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.neck.cost * 1.5)>>
			<<necksend $carried.neck.index "wardrobe" $carried.neck.colour $carried.neck.accessory_colour>>
			<<set $money -= Math.trunc($carried.neck.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.neck.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.neck.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and ($worn.neck.shop.includes("clothing") or $worn.neck.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.neck.cost * 1.5)>>
			<<necksend $worn.neck.index "wardrobe" $worn.neck.colour $worn.neck.accessory_colour>>
			<<set $money -= Math.trunc($worn.neck.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.neck.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.neck.name)>>
		<</if>>
	<</if>>
	<<set $worn.neck to clone($clothes.neck[0])>>
	<<set $carried.neck to clone($clothes.neck[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "legsruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.legs.cursed is 1 and !$worn.legs.type.includes("broken")>>
<<else>>
	<<if $carried.legs.name isnot "naked" and $clothingrebuy is 1 and ($carried.legs.shop.includes("clothing") or $carried.legs.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.legs.cost * 1.5)>>
			<<legssend $carried.legs.index "wardrobe" $carried.legs.colour $carried.legs.accessory_colour>>
			<<set $money -= Math.trunc($carried.legs.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.legs.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.legs.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and ($worn.legs.shop.includes("clothing") or $worn.legs.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.legs.cost * 1.5)>>
			<<legssend $worn.legs.index "wardrobe" $worn.legs.colour $worn.legs.accessory_colour>>
			<<set $money -= Math.trunc($worn.legs.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.legs.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.legs.name)>>
		<</if>>
	<</if>>
	<<set $worn.legs to clone($clothes.legs[0])>>
	<<set $carried.legs to clone($clothes.legs[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "feetruined">><<nobr>><<set $eventskipoverrule to 1>>
<<if $worn.feet.cursed is 1 and !$worn.feet.type.includes("broken")>>
<<else>>
	<<if $carried.feet.name isnot "naked" and $clothingrebuy is 1 and ($carried.feet.shop.includes("clothing") or $carried.feet.shop.includes("forest"))>>
		<<if $money gte Math.trunc($carried.feet.cost * 1.5)>>
			<<feetsend $carried.feet.index "wardrobe" $carried.feet.colour $carried.feet.accessory_colour>>
			<<set $money -= Math.trunc($carried.feet.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($carried.feet.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($carried.feet.name)>>
		<</if>>
	<<elseif $clothingrebuy is 1 and ($worn.feet.shop.includes("clothing") or $worn.feet.shop.includes("forest"))>>
		<<if $money gte Math.trunc($worn.feet.cost * 1.5)>>
			<<feetsend $worn.feet.index "wardrobe" $worn.feet.colour $worn.feet.accessory_colour>>
			<<set $money -= Math.trunc($worn.feet.cost * 1.5)>>
			<<set $effectsmessage to 1>><<set $rebuy_success to clone($worn.feet.name)>>
		<<else>>
			<<set $effectsmessage to 1>><<set $rebuy_failure to clone($worn.feet.name)>>
		<</if>>
	<</if>>
	<<set $worn.feet to clone($clothes.feet[0])>>
	<<set $carried.feet to clone($clothes.feet[0])>>
<</if>>
<</nobr>><</widget>>

/*The "...on" widgets put on clothing removed with the "...strip" widgets.*/

<<widget "outfiton">><<nobr>>
<<upperon>>
<<loweron>>
<</nobr>><</widget>>

<<widget "clotheson">><<nobr>>
<<upperon>>
<<loweron>>
<<underupperon>>
<<underloweron>>
<<headon>>
<<faceon>>
<<neckon>>
<<legson>>
<<feeton>>
<<if $worn.upper.name is "naked" and $worn.lower.name is "naked" and $worn.under_lower.name is "naked">>
<<else>>
	You fix your clothing.
	<br><br>
<</if>>

<<exposure>>
<<if $exposed gte 1>>
	You are conscious of your <<nuditystop>>
	<br><br>
<</if>>

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

<<widget "upperon">><<nobr>>
<<if $carried.upper.name isnot "naked">>
	<<set $worn.upper to clone($carried.upper)>>
	<<set $carried.upper to clone($clothes.upper[0])>>
<</if>>
<<set $worn.upper.exposed to $worn.upper.exposed_base>>
<<set $worn.upper.state to $worn.upper.state_base>>
<<set $worn.upper.state_top to $worn.upper.state_top_base>>
<</nobr>><</widget>>

<<widget "loweron">><<nobr>>
<<if $carried.lower.name isnot "naked">>
	<<set $worn.lower to clone($carried.lower)>>
	<<set $carried.lower to clone($clothes.lower[0])>>
<</if>>
<<set $worn.lower.exposed to $worn.lower.exposed_base>>
<<set $worn.lower.vagina_exposed to $worn.lower.vagina_exposed_base>>
<<set $worn.lower.anus_exposed to $worn.lower.anus_exposed_base>>
<<set $worn.lower.state to $worn.lower.state_base>>
<<if $worn.lower.skirt is 1>>
	<<set $worn.lower.skirt_down to 1>>
<</if>>
<</nobr>><</widget>>

<<widget "underupperon">><<nobr>>
<<if $carried.under_upper.name isnot "naked">>
	<<set $worn.under_upper to clone($carried.under_upper)>>
	<<set $carried.under_upper to clone($clothes.under_upper[0])>>
<</if>>
<<set $worn.under_upper.exposed to $worn.under_upper.exposed_base>>
<<set $worn.under_upper.state to $worn.under_upper.state_base>>
<<set $worn.under_upper.state_stop to $worn.under_upper.state_top_base>>
<</nobr>><</widget>>

<<widget "underloweron">><<nobr>>
<<if $carried.under_lower.name isnot "naked">>
	<<set $worn.under_lower to clone($carried.under_lower)>>
	<<set $carried.under_lower to clone($clothes.under_lower[0])>>
<</if>>
<<set $worn.under_lower.state to $worn.under_lower.state_base>>
<<set $worn.under_lower.exposed to $worn.under_lower.exposed_base>>
<<set $worn.under_lower.vagina_exposed to $worn.under_lower.vagina_exposed_base>>
<<set $worn.under_lower.anus_exposed to $worn.under_lower.anus_exposed_base>>
<</nobr>><</widget>>

<<widget "headon">><<nobr>>
<<if $carried.head.name isnot "naked">>
	<<set $worn.head to clone($carried.head)>>
	<<set $carried.head to clone($clothes.head[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "faceon">><<nobr>>
<<if $carried.face.name isnot "naked">>
	<<set $worn.face to clone($carried.face)>>
	<<set $carried.face to clone($clothes.face[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "neckon">><<nobr>>
<<if $carried.neck.name isnot "naked">>
	<<set $worn.neck to clone($carried.neck)>>
	<<set $carried.neck to clone($clothes.neck[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "legson">><<nobr>>
<<if $carried.legs.name isnot "naked">>
	<<set $worn.legs to clone($carried.legs)>>
	<<set $carried.legs to clone($clothes.legs[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "feeton">><<nobr>>
<<if $carried.feet.name isnot "naked">>
	<<set $worn.feet to clone($carried.feet)>>
	<<set $carried.feet to clone($clothes.feet[0])>>
<</if>>
<</nobr>><</widget>>

<<widget "clothesontowel">><<nobr>>
<<upperon>>
<<loweron>>
<<underupperon>>
<<underloweron>>
<<headon>>
<<faceon>>
<<neckon>>
<<legson>>
<<feeton>>
<<if $worn.upper.name is "naked" and $worn.lower.name is "naked" and $worn.under_lower.name is "naked">>
<<else>>
	You fix your clothing.
	<br><br>
<</if>>

<<exposure>>
<<towelup>>
<<if $exposed gte 1>>
	You are conscious of your <<nuditystop>>
	<br><br>
<</if>>

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

/*The "...steal" widgets destroy clothing carried by the PC, and output text describing the event. If argument is "strip", then they'll also take clothes worn by the PC.*/

<<widget "steal">><<nobr>>
<<set _temp_steal to $args[0]>>
<<uppersteal _temp_steal>>
<<lowersteal _temp_steal>>
<<underuppersteal _temp_steal>>
<<underlowersteal _temp_steal>>
<<headsteal _temp_steal>>
<<facesteal _temp_steal>>
<<necksteal _temp_steal>>
<<legssteal _temp_steal>>
<<feetsteal _temp_steal>>
<</nobr>><</widget>>

<<widget "stealclothes">><<nobr>>
<<set _temp_steal to $args[0]>>
<<uppersteal _temp_steal>>
<<lowersteal _temp_steal>>
<<underuppersteal _temp_steal>>
<<underlowersteal _temp_steal>>
<</nobr>><</widget>>

<<widget "uppersteal">><<nobr>>
<<if $worn.upper.name isnot "naked" and $worn.upper.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.upper.name off your body.
		<br>
	<</if>>
	<<if $worn.upper.set is $worn.lower.set>>
		<<lowerruined>>
	<</if>>
	<<upperruined>>
<<elseif $carried.upper.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.upper.name as a souvenir.
		<br>
	<</if>>
	<<if $carried.upper.set is $carried.lower.set>>
		<<lowerruined>>
	<</if>>
	<<upperruined>>
<</if>>
<</nobr>><</widget>>

<<widget "lowersteal">><<nobr>>
<<if $worn.lower.name isnot "naked" and $worn.lower.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.lower.name off your body.
		<br>
	<</if>>
	<<if $worn.upper.set is $worn.lower.set>>
		<<upperruined>>
	<</if>>
	<<lowerruined>>
<<elseif $carried.lower.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.lower.name as a souvenir.
		<br>
	<</if>>
	<<if $carried.upper.set is $carried.lower.set>>
		<<upperruined>>
	<</if>>
	<<lowerruined>>
<</if>>
<</nobr>><</widget>>

<<widget "underuppersteal">><<nobr>>
<<if $worn.under_upper.name isnot "naked" and $worn.under_upper.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.under_upper.name off your body.
		<br>
	<</if>>
	<<if $worn.under_upper.set is $worn.under_lower.set>>
		<<underlowerruined>>
	<</if>>
	<<underupperruined>>
<<elseif $carried.under_upper.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.under_upper.name as a souvenir.
		<br>
	<</if>>
	<<if $carried.under_upper.set is $carried.under_lower.set>>
		<<underlowerruined>>
	<</if>>
	<<underupperruined>>
<</if>>
<</nobr>><</widget>>

<<widget "underlowersteal">><<nobr>>
<<if $worn.under_lower.name isnot "naked" and $worn.under_lower.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.under_lower.name off your body.
		<br>
	<</if>>
	<<if $worn.under_upper.set is $worn.under_lower.set>>
		<<underupperruined>>
	<</if>>
	<<underlowerruined>>
<<elseif $carried.under_lower.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.under_lower.name as a souvenir.
		<br>
	<</if>>
	<<if $carried.under_upper.set is $carried.under_lower.set>>
		<<underupperruined>>
	<</if>>
	<<underlowerruined>>
<</if>>
<</nobr>><</widget>>

<<widget "headsteal">><<nobr>>
<<if $worn.head.name isnot "naked" and $worn.head.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.head.name off your body.
		<br>
	<</if>>
	<<headruined>>
<<elseif $carried.head.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.head.name as a souvenir.
		<br>
	<</if>>
	<<headruined>>
<</if>>
<</nobr>><</widget>>

<<widget "facesteal">><<nobr>>
<<if $worn.face.name isnot "naked" and $worn.face.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.face.name off your body.
		<br>
	<</if>>
	<<faceruined>>
<<elseif $carried.face.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.face.name as a souvenir.
		<br>
	<</if>>
	<<faceruined>>
<</if>>
<</nobr>><</widget>>

<<widget "necksteal">><<nobr>>
<<if $worn.neck.name isnot "naked" and $worn.neck.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.neck.name off your body.
		<br>
	<</if>>
	<<neckruined>>
<<elseif $carried.neck.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.neck.name as a souvenir.
		<br>
	<</if>>
	<<neckruined>>
<</if>>
<</nobr>><</widget>>

<<widget "legssteal">><<nobr>>
<<if $worn.legs.name isnot "naked" and $worn.legs.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.legs.name off your body.
		<br>
	<</if>>
	<<legsruined>>
<<elseif $carried.legs.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.legs.name as a souvenir.
		<br>
	<</if>>
	<<legsruined>>
<</if>>
<</nobr>><</widget>>

<<widget "feetsteal">><<nobr>>
<<if $worn.feet.name isnot "naked" and $worn.feet.cursed isnot 1 and $args[0] is "strip">>
	<<if $stealtextskip isnot 1>>
		<<He>> tears your $worn.feet.name off your body.
		<br>
	<</if>>
	<<feetruined>>
<<elseif $carried.feet.name isnot "naked">>
	<<if $stealtextskip isnot 1>>
		<<He>> keeps your $carried.feet.name as a souvenir.
		<br>
	<</if>>
	<<feetruined>>
<</if>>
<</nobr>><</widget>>

/*The "...undress" widgets remove the player character's clothing. Where they end up depends on the argument supplied. "wardrobe" sends it to the bedroom wardrobe. Other arguments store the clothing elsewhere in the world. The "...storeon" widgets can retrieve those clothes.*/

<<widget "undress">><<nobr>>
<<set _undress_temp to $args[0]>>
<<upperundress _undress_temp>>
<<lowerundress _undress_temp>>
<<underupperundress _undress_temp>>
<<underlowerundress _undress_temp>>
<<headundress _undress_temp>>
<<faceundress _undress_temp>>
<<neckundress _undress_temp>>
<<legsundress _undress_temp>>
<<feetundress _undress_temp>>
<</nobr>><</widget>>

<<widget "undressclothes">><<nobr>>
<<set _undress_temp to $args[0]>>
<<upperundress _undress_temp>>
<<lowerundress _undress_temp>>
<<underupperundress _undress_temp>>
<<underlowerundress _undress_temp>>
<</nobr>><</widget>>

<<widget "upperundress">><<nobr>>
<<if $worn.upper.cursed is 1>>

<<else>>
	<<set $upperwet to 0>><<set $upperwetstage to 0>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.upper.name is "towel top" or $worn.upper.name is "large towel">>
			<<if $worn.upper.set is $worn.lower.set>>
				<<set $worn.lower to clone($clothes.lower[0])>>
			<</if>>
			<<set $worn.upper to clone($clothes.upper[0])>>
		<<elseif $worn.upper.name isnot "naked">>
			<<if $worn.upper.set is $worn.lower.set>>
				<<set $wardrobe.lower.push(clone($worn.lower))>>
				<<set $worn.lower to clone($clothes.lower[0])>>
			<</if>>
			<<set $wardrobe.upper.push(clone($worn.upper))>>
			<<set $worn.upper to clone($clothes.upper[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.upper.name isnot "naked">>
			<<if $worn.upper.set is $worn.lower.set>>
				<<for _u to 0; _u lt $store.lower.length; _u++>>
					<<if $args[0] is $store.lower[_u].location>>
						<<if $store.lower[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
							<<for _o to 0; _o lt $store.upper.length; _o++>>
								<<if $args[0] is $store.upper[_o].location>>
									<<if $store.upper[_o].name isnot "towel top" and $store.upper[_o].name isnot "large towel">>
										<<set $wardrobe.upper.push(clone($store.upper[_o]))>>
									<</if>>
									<<set $store.upper.deleteAt(_o)>>
								<</if>>
							<</for>>
						<</if>>
						<<if $store.lower[_u].name isnot "towel skirt" and $store.lower[_u].name isnot "large towel bottom">>
							<<set $wardrobe.lower.push(clone($store.lower[_u]))>>
						<</if>>
						<<set $store.lower.deleteAt(_u)>>
					<</if>>
				<</for>>
				<<set $store.lower.push(clone($worn.lower))>>
				<<set $store.lower.last().location to $args[0]>>
				<<set $worn.lower to clone($clothes.lower[0])>>
			<</if>>
			<<for _u to 0; _u lt $store.upper.length; _u++>>
				<<if $args[0] is $store.upper[_u].location>>
					<<if $store.upper[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
						<<for _o to 0; _o lt $store.lower.length; _o++>>
							<<if $args[0] is $store.lower[_o].location>>
								<<if $store.lower[_o].name isnot "towel skirt" and $store.lower[_o].name isnot "large towel bottom">>
									<<set $wardrobe.lower.push(clone($store.lower[_o]))>>
								<</if>>
								<<set $store.lower.deleteAt(_o)>>
							<</if>>
						<</for>>
					<</if>>
					<<if $store.upper[_u].name isnot "towel top" and $store.upper[_u].name isnot "large towel">>
						<<set $wardrobe.upper.push(clone($store.upper[_u]))>>
					<</if>>
					<<set $store.upper.deleteAt(_u)>>
				<</if>>
			<</for>>
			<<set $store.upper.push(clone($worn.upper))>>
			<<set $store.upper.last().location to $args[0]>>
			<<set $worn.upper to clone($clothes.upper[0])>>
		<</if>>
	<</if>>
<</if>>
<<unset _strip_restrict>>
<</nobr>><</widget>>

<<widget "lowerundress">><<nobr>>
<<if $worn.lower.cursed is 1>>
<<else>>
<<set $lowerwet to 0>><<set $lowerwetstage to 0>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.lower.name is "towel skirt" or $worn.lower.name is "large towel bottom">>
			<<if $worn.lower.set is $worn.upper.set>>
			<<set $worn.upper to clone($clothes.upper[0])>>
			<</if>>
		<<set $worn.lower to clone($clothes.lower[0])>>
		<<elseif $worn.lower.name isnot "naked">>
			<<if $worn.upper.set is $worn.lower.set and _strip_restrict isnot 1>>
			<<set $wardrobe.upper.push(clone($worn.upper))>>
			<<set $worn.upper to clone($clothes.upper[0])>>
			<</if>>
		<<set $wardrobe.lower.push(clone($worn.lower))>>
		<<set $worn.lower to clone($clothes.lower[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.lower.name isnot "naked">>
			<<if $worn.upper.set is $worn.lower.set>>
				<<for _u to 0; _u lt $store.upper.length; _u++>>
					<<if $args[0] is $store.upper[_u].location>>
						<<if $store.upper[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
							<<for _o to 0; _o lt $store.lower.length; _o++>>
								<<if $args[0] is $store.lower[_o].location>>
									<<if $store.lower[_o].name isnot "towel skirt" and $store.lower[_o].name isnot "large towel bottom">>
									<<set $wardrobe.lower.push(clone($store.lower[_o]))>>
									<</if>>
								<<set $store.lower.deleteAt(_o)>>
								<</if>>
							<</for>>
						<</if>>
						<<if $store.upper[_u].name isnot "towel top" and $store.upper[_u].name isnot "large towel">>
						<<set $wardrobe.upper.push(clone($store.upper[_u]))>>
						<</if>>
					<<set $store.upper.deleteAt(_u)>>
					<</if>>
				<</for>>
			<<set $store.upper.push(clone($worn.upper))>>
			<<set $store.upper.last().location to $args[0]>>
			<<set $worn.upper to clone($clothes.upper[0])>>
			<</if>>
			<<for _u to 0; _u lt $store.lower.length; _u++>>
				<<if $args[0] is $store.lower[_u].location>>
					<<if $store.lower[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
						<<for _o to 0; _o lt $store.upper.length; _o++>>
							<<if $args[0] is $store.upper[_o].location>>
								<<if $store.upper[_o].name isnot "towel top" and $store.upper[_o].name isnot "large towel">>
								<<set $wardrobe.upper.push(clone($store.upper[_o]))>>
								<</if>>
							<<set $store.upper.deleteAt(_o)>>
							<</if>>
						<</for>>
					<</if>>
					<<if $store.lower[_u].name isnot "towel skirt" and $store.lower[_u].name isnot "large towel bottom">>
					<<set $wardrobe.lower.push(clone($store.lower[_u]))>>
					<</if>>
				<<set $store.lower.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.lower.push(clone($worn.lower))>>
		<<set $store.lower.last().location to $args[0]>>
		<<set $worn.lower to clone($clothes.lower[0])>>
		<</if>>
	<</if>>
<</if>>
<<unset _strip_restrict>>
<</nobr>><</widget>>

<<widget "underupperundress">><<nobr>>
<<if $worn.under_upper.cursed is 1>>
<<else>>
<<set $underupperwet to 0>><<set $underupperwetstage to 0>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.under_upper.name isnot "naked">>
			<<if $worn.under_upper.set is $worn.under_lower.set>>
			<<set $wardrobe.under_lower.push(clone($worn.under_lower))>>
			<<set $worn.under_lower to clone($clothes.under_lower[0])>>
			<</if>>
		<<set $wardrobe.under_upper.push(clone($worn.under_upper))>>
		<<set $worn.under_upper to clone($clothes.under_upper[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.under_upper.name isnot "naked">>
			<<if $worn.under_upper.set is $worn.under_lower.set>>
				<<for _u to 0; _u lt $store.under_lower.length; _u++>>
					<<if $args[0] is $store.under_lower[_u].location>>
						<<if $store.under_lower[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
							<<for _o to 0; _o lt $store.under_upper.length; _o++>>
								<<if $args[0] is $store.under_upper[_o].location>>
								<<set $wardrobe.under_upper.push(clone($store.under_upper[_o]))>>
								<<set $store.under_upper.deleteAt(_o)>>
								<</if>>
							<</for>>
						<</if>>
					<<set $wardrobe.under_lower.push(clone($store.under_lower[_u]))>>
					<<set $store.under_upper.deleteAt(_u)>>
					<</if>>
				<</for>>
			<<set $store.under_lower.push(clone($worn.under_lower))>>
			<<set $store.under_lower.last().location to $args[0]>>
			<<set $worn.under_lower to clone($clothes.under_lower[0])>>
			<</if>>
			<<for _u to 0; _u lt $store.under_upper.length; _u++>>
				<<if $args[0] is $store.under_upper[_u].location>>
					<<if $store.under_upper[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
						<<for _o to 0; _o lt $store.under_lower.length; _o++>>
							<<if $args[0] is $store.under_lower[_o].location>>
							<<set $wardrobe.under_lower.push(clone($store.under_lower[_o]))>>
							<<set $store.under_lower.deleteAt(_o)>>
							<</if>>
						<</for>>
					<</if>>
				<<set $wardrobe.under_upper.push(clone($store.under_upper[_u]))>>
				<<set $store.under_upper.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.under_upper.push(clone($worn.under_upper))>>
		<<set $store.under_upper.last().location to $args[0]>>
		<<set $worn.under_upper to clone($clothes.under_upper[0])>>
		<</if>>
	<</if>>
<</if>>
<<unset _strip_restrict>>
<</nobr>><</widget>>

<<widget "underlowerundress">><<nobr>>
<<if $worn.under_lower.cursed is 1>>
<<else>>
<<set $underlowerwet to 0>><<set $underlowerwetstage to 0>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.under_lower.name isnot "naked">>
			<<if $worn.under_upper.set is $worn.under_lower.set and _strip_restrict isnot 1>>
			<<set $wardrobe.under_upper.push(clone($worn.under_upper))>>
			<<set $worn.under_upper to clone($clothes.under_upper[0])>>
			<</if>>
		<<set $wardrobe.under_lower.push(clone($worn.under_lower))>>
		<<set $worn.under_lower to clone($clothes.under_lower[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.under_lower.name isnot "naked">>
			<<if $worn.under_upper.set is $worn.under_lower.set>>
				<<for _u to 0; _u lt $store.under_upper.length; _u++>>
					<<if $args[0] is $store.under_upper[_u].location>>
						<<if $store.under_upper[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
							<<for _o to 0; _o lt $store.under_lower.length; _o++>>
								<<if $args[0] is $store.under_lower[_o].location>>
								<<set $wardrobe.under_lower.push(clone($store.under_lower[_o]))>>
								<<set $store.under_lower.deleteAt(_o)>>
								<</if>>
							<</for>>
						<</if>>
					<<set $wardrobe.under_upper.push(clone($store.under_upper[_u]))>>
					<<set $store.under_upper.deleteAt(_u)>>
					<</if>>
				<</for>>
			<<set $store.under_upper.push(clone($worn.under_upper))>>
			<<set $store.under_upper.last().location to $args[0]>>
			<<set $worn.under_upper to clone($clothes.under_upper[0])>>
			<</if>>
			<<for _u to 0; _u lt $store.under_lower.length; _u++>>
				<<if $args[0] is $store.under_lower[_u].location>>
					<<if $store.under_lower[_u].one_piece is 1>>/*Checks if replaced stored item is an outfit, and moves the other half to the wardrobe if it is*/
						<<for _o to 0; _o lt $store.under_upper.length; _o++>>
							<<if $args[0] is $store.under_upper[_o].location>>
							<<set $wardrobe.under_upper.push(clone($store.under_upper[_o]))>>
							<<set $store.under_upper.deleteAt(_o)>>
							<</if>>
						<</for>>
					<</if>>
				<<set $wardrobe.under_lower.push(clone($store.under_lower[_u]))>>
				<<set $store.under_lower.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.under_lower.push(clone($worn.under_lower))>>
		<<set $store.under_lower.last().location to $args[0]>>
		<<set $worn.under_lower to clone($clothes.under_lower[0])>>
		<</if>>
	<</if>>
<</if>>
<<unset _strip_restrict>>
<</nobr>><</widget>>

<<widget "headundress">><<nobr>>
<<if $worn.head.cursed is 1>>
<<else>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.head.name isnot "naked">>
		<<set $wardrobe.head.push(clone($worn.head))>>
		<<set $worn.head to clone($clothes.head[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.head.name isnot "naked">>
			<<for _u to 0; _u lt $store.head.length; _u++>>
				<<if $args[0] is $store.head[_u].location>>
				<<set $wardrobe.head.push(clone($store.head[_u]))>>
				<<set $store.head.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.head.push(clone($worn.head))>>
		<<set $store.head.last().location to $args[0]>>
		<<set $worn.head to clone($clothes.head[0])>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "faceundress">><<nobr>>
<<if $worn.face.cursed is 1>>
<<else>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.face.name isnot "naked">>
		<<set $wardrobe.face.push(clone($worn.face))>>
		<<set $worn.face to clone($clothes.face[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.face.name isnot "naked">>
			<<for _u to 0; _u lt $store.face.length; _u++>>
				<<if $args[0] is $store.face[_u].location>>
				<<set $wardrobe.face.push(clone($store.face[_u]))>>
				<<set $store.face.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.face.push(clone($worn.face))>>
		<<set $store.face.last().location to $args[0]>>
		<<set $worn.face to clone($clothes.face[0])>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "neckundress">><<nobr>>
<<if $worn.neck.cursed is 1>>
<<else>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.neck.name isnot "naked">>
		<<set $wardrobe.neck.push(clone($worn.neck))>>
		<<set $worn.neck to clone($clothes.neck[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.neck.name isnot "naked">>
			<<for _u to 0; _u lt $store.neck.length; _u++>>
				<<if $args[0] is $store.neck[_u].location>>
				<<set $wardrobe.neck.push(clone($store.neck[_u]))>>
				<<set $store.neck.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.neck.push(clone($worn.neck))>>
		<<set $store.neck.last().location to $args[0]>>
		<<set $worn.neck to clone($clothes.neck[0])>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "legsundress">><<nobr>>
<<if $worn.legs.cursed is 1>>
<<else>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.legs.name isnot "naked">>
		<<set $wardrobe.legs.push(clone($worn.legs))>>
		<<set $worn.legs to clone($clothes.legs[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.legs.name isnot "naked">>
			<<for _u to 0; _u lt $store.legs.length; _u++>>
				<<if $args[0] is $store.legs[_u].location>>
				<<set $wardrobe.legs.push(clone($store.legs[_u]))>>
				<<set $store.legs.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.legs.push(clone($worn.legs))>>
		<<set $store.legs.last().location to $args[0]>>
		<<set $worn.legs to clone($clothes.legs[0])>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "feetundress">><<nobr>>
<<if $worn.feet.cursed is 1>>
<<else>>
	<<if $args[0] is "wardrobe">>
		<<if $worn.feet.name isnot "naked">>
		<<set $wardrobe.feet.push(clone($worn.feet))>>
		<<set $worn.feet to clone($clothes.feet[0])>>
		<</if>>
	<<elseif $args[0]>>
		<<if $worn.feet.name isnot "naked">>
			<<for _u to 0; _u lt $store.feet.length; _u++>>
				<<if $args[0] is $store.feet[_u].location>>
				<<set $wardrobe.feet.push(clone($store.feet[_u]))>>
				<<set $store.feet.deleteAt(_u)>>
				<</if>>
			<</for>>
		<<set $store.feet.push(clone($worn.feet))>>
		<<set $store.feet.last().location to $args[0]>>
		<<set $worn.feet to clone($clothes.feet[0])>>
		<</if>>
	<</if>>
<</if>>
<</nobr>><</widget>>

/*The "storeon..." widgets retrieve the clothing stored with the "...undress" widgets, that weren't put in a wardrobe. Requires the same argument that was used to store the clothing in order to correctly identify. Optionally accepts a second argument. Inputting "delete" will destroy the stored item, rather than wear it. Inputting "check" will set _store_check to 1, for when you want to check whether or not an item exists in a given location.*/

<<widget "storeon">><<nobr>>
<<set _store_temp to $args[0]>>
<<if $args[1]>>
<<set _store_option to $args[1]>>
<<else>>
<<set _store_option to 0>>
<</if>>
<<storeonupper _store_temp _store_option>>
<<storeonlower _store_temp _store_option>>
<<storeonunderupper _store_temp _store_option>>
<<storeonunderlower _store_temp _store_option>>
<<storeonhead _store_temp _store_option>>
<<storeonface _store_temp _store_option>>
<<storeonneck _store_temp _store_option>>
<<storeonlegs _store_temp _store_option>>
<<storeonfeet _store_temp _store_option>>
<</nobr>><</widget>>

<<widget "storeonupper">><<nobr>>
<<if $worn.upper.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.upper.length; _u++>>
			<<if $args[0] is $store.upper[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.upper.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<upperundress "wardrobe">>
				<<set $worn.upper to clone($store.upper[_u])>>
				<<set $worn.upper.location to 0>>
				<<set $store.upper.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonlower">><<nobr>>
<<if $worn.lower.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.lower.length; _u++>>
			<<if $args[0] is $store.lower[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.lower.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<lowerundress "wardrobe">>
				<<set $worn.lower to clone($store.lower[_u])>>
				<<set $worn.lower.location to 0>>
				<<set $store.lower.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonunderupper">><<nobr>>
<<if $worn.under_upper.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.under_upper.length; _u++>>
			<<if $args[0] is $store.under_upper[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.under_upper.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<underupperundress "wardrobe">>
				<<set $worn.under_upper to clone($store.under_upper[_u])>>
				<<set $worn.under_upper.location to 0>>
				<<set $store.under_upper.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonunderlower">><<nobr>>
<<if $worn.under_lower.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.under_lower.length; _u++>>
			<<if $args[0] is $store.under_lower[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.under_lower.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<underlowerundress "wardrobe">>
				<<set $worn.under_lower to clone($store.under_lower[_u])>>
				<<set $worn.under_lower.location to 0>>
				<<set $store.under_lower.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonhead">><<nobr>>
<<if $worn.head.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.head.length; _u++>>
			<<if $args[0] is $store.head[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.head.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<headundress "wardrobe">>
				<<set $worn.head to clone($store.head[_u])>>
				<<set $worn.head.location to 0>>
				<<set $store.head.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonface">><<nobr>>
<<if $worn.face.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.face.length; _u++>>
			<<if $args[0] is $store.face[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.face.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<faceundress "wardrobe">>
				<<set $worn.face to clone($store.face[_u])>>
				<<set $worn.face.location to 0>>
				<<set $store.face.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonneck">><<nobr>>
<<if $worn.neck.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.neck.length; _u++>>
			<<if $args[0] is $store.neck[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.neck.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<neckundress "wardrobe">>
				<<set $worn.neck to clone($store.neck[_u])>>
				<<set $worn.neck.location to 0>>
				<<set $store.neck.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonlegs">><<nobr>>
<<if $worn.legs.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.legs.length; _u++>>
			<<if $args[0] is $store.legs[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.legs.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<legsundress "wardrobe">>
				<<set $worn.legs to clone($store.legs[_u])>>
				<<set $worn.legs.location to 0>>
				<<set $store.legs.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>

<<widget "storeonfeet">><<nobr>>
<<if $worn.feet.cursed is 1>>
<<else>>
	<<if $args[0]>>
		<<for _u to 0; _u lt $store.feet.length; _u++>>
			<<if $args[0] is $store.feet[_u].location>>
				<<if $args[1] is "delete">>
				<<set $store.feet.deleteAt(_u)>>
				<<elseif $args[1] is "check">>
				<<set _store_check to 1>>
				<<else>>
				<<feetundress "wardrobe">>
				<<set $worn.feet to clone($store.feet[_u])>>
				<<set $worn.feet.location to 0>>
				<<set $store.feet.deleteAt(_u)>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<</nobr>><</widget>>


code:
:: Widgets NPCs Init Fight [widget]
<!-- This is the basic model for a human -->
<!-- Usage: -->
<!-- <<basicWoman>> will generate only 1 npc adult to fight against -->
<!-- <<basicWoman 5>> will generate 5 npcs adults to fuck with hahahaha -->
<!-- <<basicWoman 10 t>> will generate 10 npcs teenagers to fight against -->
<<widget "basicWoman">><<nobr>> <!-- maninit IS MY @#@$! @liahhh -->

<<if $args[0]>>
    <<if $args[1]>>
        <<generateNPCDisjoin $args[0] $args[1]>>
    <<else>>
        <<generateNPCDisjoin $args[0]>>
    <</if>>
<<else>>
    <<generateNPCDisjoin 1>>
<</if>>

<<set $combat to 1>>

<<combatinitRemodel>>

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

<<widget "combatinitRemodel">><<nobr>>

<<if $consensual is 1>>
    <<set $controlstart to $control>>
<</if>>

<<if $genderknown.includes($npc)>>
    <<set $crossdressing to 0>>
<<else>>
	<<if $player.gender isnot $player.appearance>>
	    <<set $crossdressing to 1>>
	<<else>>
	    <<set $crossdressing to 0>>
	<</if>>
<</if>>

<<if $npcFightList[0].type is "beast">>
	<<if $npcFightList[0].penis is "none" and $penisexist is 1>>
	    <<set $position to "missionary">>
	<<else>>
		<<if random(1, 100) gte 20>>
		    <<set $position to "doggy">>
		<<else>>
		    <<set $position to "missionary">>
		<</if>>
	<</if>>
<<else>>
	<<if $npcFightList[0].penis is "none">>
		<<if random(1, 100) gte 80>>
		    <<set $position to "doggy">>
		<<else>>
		    <<set $position to "missionary">>
		<</if>>
	<<else>>
		<<if random(1, 100) gte 50>>
		    <<set $position to "doggy">>
		<<else>>
		    <<set $position to "missionary">>
		<</if>>
	<</if>>
<</if>>

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

repo_name: KinkyOne/degrees

license: mit


code:
:: Widgets Actions Anus [widget]
<<widget "actionsanustopenis">><<nobr>>

<<if $worn.under_lower.anal_shield isnot 1>>
<<if $NPCList[0].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

<<elseif $NPCList[1].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

<<elseif $NPCList[2].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

<<elseif $NPCList[3].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

<<elseif $NPCList[4].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

<<elseif $NPCList[5].penis is 0>>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anustopenis">>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis" checked>><<analdifficulty>> <<combatpromiscuous5>>
		<<else>>
| Straddle <<his>> penis <<radiobutton "$anusaction" "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
		<</if>>
	<</if>>

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

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

<<widget "actionsanuspenisfuck">><<nobr>>

<<if $worn.under_lower.anus_exposed is 1 and $worn.lower.anus_exposed is 1>>

<<if $NPCList[0].penis is "anusentrance" or $NPCList[0].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<<elseif $NPCList[1].penis is "anusentrance" or $NPCList[1].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<<elseif $NPCList[2].penis is "anusentrance" or $NPCList[2].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<<elseif $NPCList[3].penis is "anusentrance" or $NPCList[3].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<<elseif $NPCList[4].penis is "anusentrance" or $NPCList[4].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<<elseif $NPCList[5].penis is "anusentrance" or $NPCList[5].penis is "anusimminent">>
	<<if $consensual is 1 and $promiscuity lte 74 and $enemytype is "man" or $consensual is 1 and $deviancy lte 74 and $enemytype isnot "man">>
	<<else>>
		<<if $anusactiondefault is "anuspenisfuck">>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck" checked>> <<combatpromiscuous5>><<analvirginitywarning>>
		<<else>>
| Envelop <<his>> penis <<radiobutton "$anusaction" "anuspenisfuck">> <<combatpromiscuous5>><<analvirginitywarning>>
		<</if>>
	<</if>>

<</if>>

<</if>>

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

:: Widgets Effects Anus [widget]
<<widget "effectsanustopenis">><<nobr>>

<<if $anusaction is "anustopenis">><<set $anusaction to 0>><<submission 10>><<analskilluse>><<set $anusactiondefault to "anustopenis">><<combatpromiscuity5>>
	<<if (1000 - ($rng * 10) - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>

		<<if $NPCList[0].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[0].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person1>><<combatperson>> and press <<his1>> $NPCList[0].penisdesc with your <<bottomstop>>
			<<if $enemytype is "beast">><<set $beaststance to "top">><</if>>
		<<elseif $NPCList[1].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[1].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person2>><<combatperson>> and press <<his2>> $NPCList[1].penisdesc with your <<bottomstop>>
		<<elseif $NPCList[2].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[2].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person3>><<combatperson>> and press <<his3>> $NPCList[2].penisdesc with your <<bottomstop>>
		<<elseif $NPCList[3].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[3].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person4>><<combatperson>> and press <<his4>> $NPCList[3].penisdesc with your <<bottomstop>>
		<<elseif $NPCList[4].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[4].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person5>><<combatperson>> and press <<his5>> $NPCList[4].penisdesc with your <<bottomstop>>
		<<elseif $NPCList[5].penis is 0>>
		<<submission 2>><<set $anususe to "penis">><<set $NPCList[5].penis to "anusentrance">><<set $anusstate to "entrance">>You straddle the <<person6>><<combatperson>> and press <<his6>> $NPCList[5].penisdesc with your <<bottomstop>>
		<</if>>
	<<else>>
		<<if $NPCList[0].penis is 0>>
		You try to straddle the <<person1>><<combatperson>> but <<ohe>> pushes you off.
		<<elseif $NPCList[1].penis is 0>>
		You try to straddle the <<person2>><<combatperson>> but <<ohe>> pushes you off.
		<<elseif $NPCList[2].penis is 0>>
		You try to straddle the <<person3>><<combatperson>> but <<ohe>> pushes you off.
		<<elseif $NPCList[3].penis is 0>>
		You try to straddle the <<person4>><<combatperson>> but <<ohe>> pushes you off.
		<<elseif $NPCList[4].penis is 0>>
		You try to straddle the <<person5>><<combatperson>> but <<ohe>> pushes you off.
		<<elseif $NPCList[5].penis is 0>>
		You try to straddle the <<person6>><<combatperson>> but <<ohe>> pushes you off.
		<</if>>
	<</if>>
<</if>>

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

<<widget "effectsanuspenisfuck">><<nobr>>

<<if $anusaction is "anuspenisfuck">><<set $anusaction to 0>><<submission 20>><<analskilluse>><<set $anusactiondefault to "anuspenisfuck">><<combatpromiscuity5>>

	<<if $analvirginity is 0>>
		<<if $NPCList[0].penis is "anusentrance" or $NPCList[0].penis is "anusimminent">><<set $NPCList[0].penis to "anus">>
		You <<analtext>> push against the <<person1>><<combatpersons>> $NPCList[0].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[0].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[1].penis is "anusentrance" or $NPCList[1].penis is "anusimminent">><<set $NPCList[1].penis to "anus">>
		You <<analtext>> push against the <<person2>><<combatpersons>> $NPCList[1].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[1].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[2].penis is "anusentrance" or $NPCList[2].penis is "anusimminent">><<set $NPCList[2].penis to "anus">>
		You <<analtext>> push against the <<person3>><<combatpersons>> $NPCList[2].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[2].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[3].penis is "anusentrance" or $NPCList[3].penis is "anusimminent">><<set $NPCList[3].penis to "anus">>
		You <<analtext>> push against the <<person4>><<combatpersons>> $NPCList[3].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[3].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[4].penis is "anusentrance" or $NPCList[4].penis is "anusimminent">><<set $NPCList[4].penis to "anus">>
		You <<analtext>> push against the <<person5>><<combatpersons>> $NPCList[4].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[4].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[5].penis is "anusentrance" or $NPCList[5].penis is "anusimminent">><<set $NPCList[5].penis to "anus">>
		You <<analtext>> push against the <<person6>><<combatpersons>> $NPCList[5].penisdesc, taking it deep into your <<bottomstop>>
		<<switch $NPCList[5].penissize>>
			<<case 4>> You moan as your ass stretches to accommodate <<his>> cock.<<case 1>> It's so small you can barely feel it.
		<</switch>>
		<</if>>
	<<sex 30>><<analstat>><<raped>><<anusraped>><<set $anusstate to "penetrated">>

	<<elseif $analvirginity is 1>>
		<<if $NPCList[0].penis is "anusentrance" or $NPCList[0].penis is "anusimminent">><<set $NPCList[0].penis to "anus">>
		You <<analtext>> push against the <<person1>><<combatpersons>> $NPCList[0].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[0].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[1].penis is "anusentrance" or $NPCList[1].penis is "anusimminent">><<set $NPCList[1].penis to "anus">>
		You <<analtext>> push against the <<person2>><<combatpersons>> $NPCList[1].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[1].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[2].penis is "anusentrance" or $NPCList[2].penis is "anusimminent">><<set $NPCList[2].penis to "anus">>
		You <<analtext>> push against the <<person3>><<combatpersons>> $NPCList[2].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[2].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[3].penis is "anusentrance" or $NPCList[3].penis is "anusimminent">><<set $NPCList[3].penis to "anus">>
		You <<analtext>> push against the <<person4>><<combatpersons>> $NPCList[3].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[3].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[4].penis is "anusentrance" or $NPCList[4].penis is "anusimminent">><<set $NPCList[4].penis to "anus">>
		You <<analtext>> push against the <<person5>><<combatpersons>> $NPCList[4].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[4].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<<elseif $NPCList[5].penis is "anusentrance" or $NPCList[5].penis is "anusimminent">><<set $NPCList[5].penis to "anus">>
		You <<analtext>> push against the <<person6>><<combatpersons>> $NPCList[5].penisdesc, taking it deep into your virgin <<bottomstop>>
		<<switch $NPCList[5].penissize>>
			<<case 4>> You scream as your ass struggles to accommodate <<his>> cock.<<case 1>> While your <<bottom>> is technically no virgin, <<his>> cock is so small you can barely feel it.
		<</switch>>
		<</if>>
	<<sex 100>><<set $analvirginity to 0>><<bruise anus>><<analstat>><<violence 30>><<raped>><<anusraped>><<set $anusstate to "penetrated">>
	<</if>>

<</if>>

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


code:
:: Widgets Actions Feet [widget]
<<widget "feetgrab">><<nobr>>

	<<if $consensual is 1 and $promiscuity lte 34 and $enemytype is "man" or $consensual is 1 and $deviancy lte 34 and $enemytype isnot "man">>
	<<elseif $beaststance isnot "topface">>
		<<if $NPCList[0].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[1].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[2].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[3].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[4].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[5].penis is 0>>
			<<if $feetactiondefault is "grab">>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Grab <<his>> penis <<radiobutton "$feetaction" "grab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<</if>>

		<<if $NPCList[0].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[1].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[2].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[3].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
		<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[4].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>

		<<elseif $NPCList[5].vagina is 0>>
			<<if $feetactiondefault is "vaginagrab">>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab" checked>><<feetdifficulty>> <<combatpromiscuous3>>
			<<else>>
		| Press your feet against <<his>> pussy <<radiobutton "$feetaction" "vaginagrab">><<feetdifficulty>> <<combatpromiscuous3>>
			<</if>>
		<</if>>
	<</if>>

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