code:
:: Widgets Shop [widget]

/*First argument - bought or stolen
Second argument - worn or send
Third argument - item index*/

<<widget "uppershopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0]>><<ShowUnderEquip>><</if>>
<<if $args[0] is "buy">>
	You buy the $clothes.upper[_shop_temp].name.

<<elseif $args[0] is "steal">>
	You steal the $clothes.upper[_shop_temp].name.

<<elseif $args[0] is "try">>
	<<tryOnWear _shop_temp "upper">>
<<elseif $args[0] is "return">>
	<<clothingReset "upper">>
<<elseif $args[0] is "reset">>
	<<unset $colouraction>>
	<<unset $accessorycolouraction>>
	<<set $shopDefaults.colorSet to null>>
	<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
			<<upperwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
			<<upperwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
			<<upperwear _shop_temp $accessorycolouraction>>
		<<else>>
			<<upperwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "upper">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
			<<uppersend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
			<<uppersend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
			<<uppersend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
			<<uppersend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "outfitshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.upper[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.upper[$clothes_choice].name. <<if $clothes.upper[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.upper[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.upper[$clothes_choice].description Costs £<<print $clothes.upper[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.upper[$clothes_choice].colour_options.length isnot 0>>
		There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.upper[$clothes_choice].accessory_colour_options.length isnot 0>>
		Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.upper[$clothes_choice].cost)>>
	<<if $wardrobe.upper.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.upper.length / $wardrobe.space

	<<elseif $daystate is "night">>
		<<if $worn.upper.cursed is 1 or $worn.lower.cursed is 1>>
			You can't wear this item without first removing your <<if $worn.upper.cursed is 1>>$worn.upper.name<<else>>$worn.lower.name<</if>>.

		<<else>>
			<<link [[Steal and wear|$passage]]>><<uppershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<</if>>
		<<link [[Steal and send home|$passage]]>><<uppershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

	<<elseif $money gte $clothes.upper[$clothes_choice].cost>>
		<<if $worn.upper.cursed is 1 or $worn.lower.cursed is 1>>
			You can't wear this item without first removing your <<if $worn.upper.cursed is 1>>$worn.upper.name<<else>>$worn.lower.name<</if>>

		<<else>>
			<<link [[Buy and wear|$passage]]>><<clothingReset "upper">><<uppershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

		<</if>>
		<<link [[Buy and send home|$passage]]>><<clothingReset "upper">><<uppershopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>><<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
		<</link>>

	<<else>>
		You cannot afford this item.

	<</if>>
	<<if $worn.upper.cursed is 1 or $worn.lower.cursed is 1>>
	<<elseif $tryOn.tryingOn>>
		<<link [[Try On|$passage]]>><<uppershopbuy "try" null $clothes_choice>><</link>>

		<<if $tryOn.tryingOn.upper isnot null>>
			<<link [[Return|$passage]]>><<uppershopbuy "return" null $clothes_choice>><</link>>

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

<<if $location is "forest">>
<<outfitforestclothes>>
<<else>>
	<<for _i to 0; _i lt $clothes.upper.length; _i++>>
		<<if $clothes.upper[_i].shop.includes("clothing") and $clothes.upper[_i].one_piece is 1>>
			<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>.

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

<<widget "uppershop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.upper[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.upper[$clothes_choice].name. <<if $clothes.upper[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.upper[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.upper[$clothes_choice].description Costs £<<print $clothes.upper[$clothes_choice].cost / 100>>.

		<<shoptraits>>

	<<if $clothes.upper[$clothes_choice].colour_options.length isnot 0>>
		There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.upper[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.upper[$clothes_choice].cost)>>
		<<if $wardrobe.upper.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.upper.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.upper.cursed is 1>>
			You can't wear this item without first removing your $worn.upper.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<uppershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<uppershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.upper[$clothes_choice].cost>>
			<<if $worn.upper.cursed is 1>>
			You can't wear this item without first removing your $worn.upper.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "upper">><<uppershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "upper">><<uppershopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.upper.cursed is 1>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<uppershopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.upper isnot null>>
			<<link [[Return|$passage]]>><<uppershopbuy "return" null $clothes_choice>><</link>>

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

<<if $location is "forest">>
<<upperforestclothes>>
<<else>>
	<<for _i to 0; _i lt $clothes.upper.length; _i++>>
		<<if $clothes.upper[_i].shop.includes("clothing") and $clothes.upper[_i].one_piece isnot 1>>
		<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>.

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

<<widget "lowershopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0]>><<ShowUnderEquip>><</if>>
<<if $args[0] is "buy">>
You buy the $clothes.lower[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.lower[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "lower">>
<<elseif $args[0] is "return">>
<<clothingReset "lower">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<lowerwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<lowerwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<lowerwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<lowerwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "lower">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<lowersend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<lowersend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<lowersend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<lowersend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "lowershop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.lower[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.lower[$clothes_choice].name. <<if $clothes.lower[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.lower[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.lower[$clothes_choice].description Costs £<<print $clothes.lower[$clothes_choice].cost / 100>>.

		<<shoptraits>>

	<<if $clothes.lower[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.lower[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.lower[$clothes_choice].cost)>>
		<<if $wardrobe.lower.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.lower.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.lower.cursed is 1>>
			You can't wear this item without first removing your $worn.lower.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<lowershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<lowershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.lower[$clothes_choice].cost>>
			<<if $worn.lower.cursed is 1>>
			You can't wear this item without first removing your $worn.lower.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "lower">><<lowershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "lower">><<lowershopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.lower.cursed is 1>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<lowershopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.lower isnot null>>
			<<link [[Return|$passage]]>><<lowershopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.lower.length; _i++>>
	<<if $clothes.lower[_i].shop.includes("clothing") and $clothes.lower[_i].one_piece isnot 1>>
	<<print '<<link [[$clothes.lower[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.lower[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.lower[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.lower[_i].cost / 100>>.

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

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

<<widget "underuppershopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.under_upper[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.under_upper[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "under_upper">>
<<elseif $args[0] is "return">>
<<clothingReset "under_upper">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<underupperwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<underupperwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<underupperwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<underupperwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "under_upper">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<underuppersend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<underuppersend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<underuppersend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<underuppersend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "underoutfitshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.under_upper[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.under_upper[$clothes_choice].name. <<if $clothes.under_upper[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.under_upper[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.under_upper[$clothes_choice].description Costs £<<print $clothes.under_upper[$clothes_choice].cost / 100>>.

		<<shoptraits>>

	<<if $clothes.under_upper[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.under_upper[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.under_upper[$clothes_choice].cost)>>
		<<if $wardrobe.under_upper.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.under_upper.length / $wardrobe.space

		<<elseif $daystate is "night">>
			<<if $worn.under_upper.cursed is 1 or $worn.under_lower.cursed is 1>>
			You can't wear this item without first removing your <<if $worn.under_upper.cursed is 1>>$worn.under_upper.name<<else>>$worn.under_lower.name<</if>>.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<underuppershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<underuppershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.under_upper[$clothes_choice].cost>>
			<<if $worn.under_upper.cursed is 1 or $worn.under_lower.cursed is 1>>
			You can't wear this item without first removing your <<if $worn.under_upper.cursed is 1>>$worn.under_upper.name<<else>>$worn.under_lower.name<</if>>.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "under_upper">><<underuppershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "under_upper">><<underuppershopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.under_upper.cursed is 1 or $worn.under_lower.cursed is 1>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<underuppershopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.under_upper isnot null>>
			<<link [[Return|$passage]]>><<underuppershopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.under_upper.length; _i++>>
	<<if $clothes.under_upper[_i].shop.includes("clothing") and $clothes.under_upper[_i].one_piece is 1>>
	<<print '<<link [[$clothes.under_upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.under_upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.under_upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.under_upper[_i].cost / 100>>.

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

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

<<widget "underuppershop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.under_upper[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.under_upper[$clothes_choice].name. <<if $clothes.under_upper[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.under_upper[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.under_upper[$clothes_choice].description Costs £<<print $clothes.under_upper[$clothes_choice].cost / 100>>.

	<<shoptraits>>

	<<if $clothes.under_upper[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.under_upper[$clothes_choice].accessory_colour_options.length isnot 0>>

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.under_upper[$clothes_choice].cost)>>
		<<if $wardrobe.under_upper.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.under_upper.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.under_upper.cursed is 1>>
			You can't wear this item without first removing your $worn.under_upper.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<underuppershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<underuppershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.under_upper[$clothes_choice].cost>>
			<<if $worn.under_upper.cursed is 1>>
			You can't wear this item without first removing your $worn.under_upper.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "under_upper">><<underuppershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "under_upper">><<underuppershopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.under_upper.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<underuppershopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.under_upper isnot null>>
			<<link [[Return|$passage]]>><<underuppershopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.under_upper.length; _i++>>
	<<if $clothes.under_upper[_i].shop.includes("clothing") and $clothes.under_upper[_i].one_piece isnot 1>>
	<<print '<<link [[$clothes.under_upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.under_upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.under_upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.under_upper[_i].cost / 100>>.

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

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

<<widget "underlowershopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.under_lower[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.under_lower[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "under_lower">>
<<elseif $args[0] is "return">>
<<clothingReset "under_lower">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<underlowerwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<underlowerwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<underlowerwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<underlowerwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "under_lower">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<underlowersend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<underlowersend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<underlowersend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<underlowersend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "underlowershop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.under_lower[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.under_lower[$clothes_choice].name. <<if $clothes.under_lower[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.under_lower[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.under_lower[$clothes_choice].description Costs £<<print $clothes.under_lower[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.under_lower[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.under_lower[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.under_lower[$clothes_choice].cost)>>
		<<if $wardrobe.under_lower.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.under_lower.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.under_lower.cursed is 1>>
			You can't wear this item without first removing your $worn.under_lower.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<underlowershopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<underlowershopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.under_lower[$clothes_choice].cost>>
			<<if $worn.under_lower.cursed is 1>>
			You can't wear this item without first removing your $worn.under_lower.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "under_lower">><<underlowershopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<underlowershopbuy "buy" "send" $clothes_choice>><<clothingReset "under_lower">><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.under_lower.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<underlowershopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.under_lower isnot null>>
			<<link [[Return|$passage]]>><<underlowershopbuy "return" null $clothes_choice>><</link>>

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

<<if $location is "forest">>
<<underlowerforestclothes>>
<<else>>
	<<for _i to 0; _i lt $clothes.under_lower.length; _i++>>
		<<if $clothes.under_lower[_i].shop.includes("clothing") and $clothes.under_lower[_i].one_piece isnot 1>>
		<<print '<<link [[$clothes.under_lower[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.under_lower[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.under_lower[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.under_lower[_i].cost / 100>>.

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

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

<<widget "headshopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.head[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.head[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "head">>
<<elseif $args[0] is "return">>
<<clothingReset "head">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<headwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<headwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<headwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<headwear _shop_temp>>
		<</if>>
	<</if>>
<<updateOwned "head">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<headsend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<headsend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<headsend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<headsend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "headshop">><<nobr>>

<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.head[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.head[$clothes_choice].name. <<if $clothes.head[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.head[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.head[$clothes_choice].description Costs £<<print $clothes.head[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.head[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.head[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.head[$clothes_choice].cost)>>
		<<if $wardrobe.head.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.head.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.head.cursed is 1>>
			You can't wear this item without first removing your $worn.head.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<headshopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<headshopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.head[$clothes_choice].cost>>
			<<if $worn.head.cursed is 1>>
			You can't wear this item without first removing your $worn.head.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "head">><<headshopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "head">><<headshopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.head.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<headshopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.head isnot null>>
			<<link [[Return|$passage]]>><<headshopbuy "return" null $clothes_choice>><</link>>

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

<<if $location is "forest">>
<<headforestclothes>>
<<else>>
	<<for _i to 0; _i lt $clothes.head.length; _i++>>
		<<if $clothes.head[_i].shop.includes("clothing")>>
		<<print '<<link [[$clothes.head[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.head[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.head[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.head[_i].cost / 100>>.

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

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

<<widget "faceshopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.face[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.face[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "face">>
<<elseif $args[0] is "return">>
<<clothingReset "face">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<facewear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<facewear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<facewear _shop_temp $accessorycolouraction>>
		<<else>>
		<<facewear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "face">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<facesend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<facesend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<facesend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<facesend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "faceshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.face[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.face[$clothes_choice].name. <<if $clothes.face[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.face[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.face[$clothes_choice].description Costs £<<print $clothes.face[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.face[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.face[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.face[$clothes_choice].cost)>>
		<<if $wardrobe.face.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.face.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.face.cursed is 1>>
			You can't wear this item without first removing your $worn.face.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<faceshopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<faceshopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.face[$clothes_choice].cost>>
			<<if $worn.face.cursed is 1>>
			You can't wear this item without first removing your $worn.face.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "face">><<faceshopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "face">><<faceshopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.face.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<faceshopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.face isnot null>>
			<<link [[Return|$passage]]>><<faceshopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.face.length; _i++>>
	<<if $clothes.face[_i].shop.includes("clothing")>>
	<<print '<<link [[$clothes.face[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.face[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.face[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.face[_i].cost / 100>>.

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

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

<<widget "neckshopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.neck[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.neck[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "neck">>
<<elseif $args[0] is "return">>
<<clothingReset "neck">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<neckwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<neckwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<neckwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<neckwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "neck">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<necksend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<necksend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<necksend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<necksend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "neckshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.neck[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.neck[$clothes_choice].name. <<if $clothes.neck[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.neck[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.neck[$clothes_choice].description Costs £<<print $clothes.neck[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.neck[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.neck[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.neck[$clothes_choice].cost)>>
		<<if $wardrobe.neck.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.neck.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.neck.cursed is 1>>
			You can't wear this item without first removing your $worn.neck.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<neckshopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<neckshopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.neck[$clothes_choice].cost>>
			<<if $worn.neck.cursed is 1>>
			You can't wear this item without first removing your $worn.neck.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "neck">><<neckshopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "neck">><<neckshopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.neck.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<neckshopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.neck isnot null>>
			<<link [[Return|$passage]]>><<neckshopbuy "return" null $clothes_choice>><</link>>

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

<<if $location is "forest">>
<<neckforestclothes>>
<<else>>
	<<for _i to 0; _i lt $clothes.neck.length; _i++>>
		<<if $clothes.neck[_i].shop.includes("clothing")>>
		<<print '<<link [[$clothes.neck[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.neck[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.neck[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.neck[_i].cost / 100>>.

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

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

<<widget "legsshopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.legs[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.legs[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "legs">>
<<elseif $args[0] is "return">>
<<clothingReset "legs">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<legswear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<legswear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<legswear _shop_temp $accessorycolouraction>>
		<<else>>
		<<legswear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "legs">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<legssend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<legssend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<legssend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<legssend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "legsshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.legs[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.legs[$clothes_choice].name. <<if $clothes.legs[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.legs[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.legs[$clothes_choice].description Costs £<<print $clothes.legs[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.legs[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.legs[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.legs[$clothes_choice].cost)>>
		<<if $wardrobe.legs.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.legs.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.legs.cursed is 1>>
			You can't wear this item without first removing your $worn.legs.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<legsshopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<legsshopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.legs[$clothes_choice].cost>>
			<<if $worn.legs.cursed is 1>>
			You can't wear this item without first removing your $worn.legs.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "legs">><<legsshopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "legs">><<legsshopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.legs.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<legsshopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.legs isnot null>>
			<<link [[Return|$passage]]>><<legsshopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.legs.length; _i++>>
	<<if $clothes.legs[_i].shop.includes("clothing")>>
	<<print '<<link [[$clothes.legs[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.legs[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.legs[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.legs[_i].cost / 100>>.

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

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

<<widget "feetshopbuy">><<nobr>>
<<set _shop_temp to $args[2]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if $args[0] is "buy">>
You buy the $clothes.feet[_shop_temp].name.

<<elseif $args[0] is "steal">>
You steal the $clothes.feet[_shop_temp].name.

<<elseif $args[0] is "try">>
<<tryOnWear _shop_temp "feet">>
<<elseif $args[0] is "return">>
<<clothingReset "feet">>
<<elseif $args[0] is "reset">>
<<unset $colouraction>>
<<unset $accessorycolouraction>>
<<set $shopDefaults.colorSet to null>>
<<set $shopDefaults.secColorSet to null>>
<</if>>

<<if $args[1] is "wear">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<feetwear _shop_temp $colouraction $accessorycolouraction>>
		<<else>>
		<<feetwear _shop_temp $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<feetwear _shop_temp $accessorycolouraction>>
		<<else>>
		<<feetwear _shop_temp>>
		<</if>>
	<</if>>
	<<updateOwned "feet">>
<<elseif $args[1] is "send">>
	<<if $colouraction isnot undefined>>
		<<if $accessorycolouraction isnot undefined>>
		<<feetsend _shop_temp "wardrobe" $colouraction $accessorycolouraction>>
		<<else>>
		<<feetsend _shop_temp "wardrobe" $colouraction>>
		<</if>>
	<<else>>
		<<if $accessorycolouraction isnot undefined>>
		<<feetsend _shop_temp "wardrobe" $accessorycolouraction>>
		<<else>>
		<<feetsend _shop_temp "wardrobe">>
		<</if>>
	<</if>>
<</if>>

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

<<widget "feetshop">><<nobr>>
<<if $clothes_choice>>/*clothes_choice carries the index of the chosen item*/

<<set _temp_choice to clone($clothes.feet[$clothes_choice])>>/*Avoids using two variables as indices, as it didn't want to work.*/
<<if _temp_choice.plural is 1>><<integrity $clothes_choice_integrity "cap">><<else>>A <<integrity $clothes_choice_integrity>><</if>> and <<reveal $clothes_choice_reveal>> $clothes.feet[$clothes_choice].name. <<if $clothes.feet[$clothes_choice].gender is "m">>For boys.<<elseif $clothes.feet[$clothes_choice].gender is "f">>For girls.<</if>> $clothes.feet[$clothes_choice].description Costs £<<print $clothes.feet[$clothes_choice].cost / 100>>.

<<shoptraits>>

	<<if $clothes.feet[$clothes_choice].colour_options.length isnot 0>>
	There's a range of colours to choose from:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.colour_options.length; _e++>>
			<<if $shopDefaults.colorSet isnot $shopDefaults.color and _temp_choice.colour_options.includes($shopDefaults.color)>>
				<<set $colouraction to $shopDefaults.color>>
				<<set $shopDefaults.colorSet to $shopDefaults.color>>
			<</if>>
			<<if $colouraction is _temp_choice.colour_options[_e] or (_setChecked is false and _e is _temp_choice.colour_options.length - 1)>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.colour_options[_e] <<radiobutton "$colouraction" "' + _temp_choice.colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>

	<<if $clothes.feet[$clothes_choice].accessory_colour_options.length isnot 0>>
	Secondary colour:

		<<set _setChecked to false>>
		<<for _e to 0; _e lt _temp_choice.accessory_colour_options.length; _e++>>
			<<if $shopDefaults.secColorSet isnot $shopDefaults.secColor and _temp_choice.colour_options.includes($shopDefaults.secColor)>>
				<<set $accessorycolouraction to $shopDefaults.secColor>>
				<<set $shopDefaults.secColorSet to $shopDefaults.secColor>>
			<</if>>
			<<if $accessorycolouraction is _temp_choice.accessory_colour_options[_e] or (_setChecked is false and _e is _temp_choice.accessory_colour_options.length - 1)>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '" checked>> |'>>
				<<set _setChecked to true>>
			<<else>>
				<<print ' _temp_choice.accessory_colour_options[_e] <<radiobutton "$accessorycolouraction" "' + _temp_choice.accessory_colour_options[_e] + '">> |'>>
			<</if>>
		<</for>>

	<</if>>
	<<set _cost to clone($clothes.feet[$clothes_choice].cost)>>
		<<if $wardrobe.feet.length gte $wardrobe.space>>
		Your wardrobe is full. $wardrobe.feet.length / $wardrobe.space

		<<elseif $daystate is "night" and $location isnot "forest">>
			<<if $worn.feet.cursed is 1>>
			You can't wear this item without first removing your $worn.feet.name.

			<<else>>
			<<link [[Steal and wear|$passage]]>><<feetshopbuy "steal" "wear" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

			<</if>>
			<<link [[Steal and send home|$passage]]>><<feetshopbuy "steal" "send" $clothes_choice>><<crimeup _cost / 100>><<unset $clothes_choice>><</link>><<crime>>

		<<elseif $money gte $clothes.feet[$clothes_choice].cost>>
			<<if $worn.feet.cursed is 1>>
			You can't wear this item without first removing your $worn.feet.name.

			<<else>>

			<<link [[Buy and wear|$passage]]>><<clothingReset "feet">><<feetshopbuy "buy" "wear" $clothes_choice>><<set $money -= _cost>><<unset $clothes_choice>><</link>>

			<</if>>
			<<link [[Buy and send home|$passage]]>><<clothingReset "feet">><<feetshopbuy "buy" "send" $clothes_choice>><<set $money -= _cost>>
			<<if $shopDefaults.disableReturn is false>><<unset $clothes_choice>><</if>>
			<</link>>

		<<else>>
		You cannot afford this item.

		<</if>>
		<<if $worn.feet.cursed>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try On|$passage]]>><<feetshopbuy "try" null $clothes_choice>><</link>>

			<<if $tryOn.tryingOn.feet isnot null>>
			<<link [[Return|$passage]]>><<feetshopbuy "return" null $clothes_choice>><</link>>

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

<<for _i to 0; _i lt $clothes.feet.length; _i++>>
	<<if $clothes.feet[_i].shop.includes("clothing")>>
	<<print '<<link [[$clothes.feet[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.feet[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.feet[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.feet[_i].cost / 100>>.

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

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

<<widget "shoptraits">><<nobr>>
Traits:

<<if _temp_choice.type.includes("normal")>>
Normal - Suitable for everyday use.

<</if>>
<<if _temp_choice.type.includes("formal")>>
Formal - Suitable for important occasions, and for good etiquette among certain company.

<</if>>
<<if _temp_choice.type.includes("school")>>
School - Sanctioned uniform of the local school.

<</if>>
<<if _temp_choice.type.includes("glasses")>>
Glasses - Helps you focus, increasing the rate school skills are improved.

<</if>>
<<if _temp_choice.type.includes("cool")>>
Fashionable - Increases the rate status improves at school, but some teachers may dislike it.

<</if>>
<<if _temp_choice.type.includes("swim")>>
Swimwear - Fares well underwater.

<</if>>
<<if _temp_choice.type.includes("dance")>>
Dance - Flexible enough to withstand the rigours of the dance floor.

<</if>>
<<if _temp_choice.type.includes("costume")>>
Costume - People may look at this askance outside the right situations.

<</if>>
<<if _temp_choice.type.includes("serving")>>
Serving - Encourages tips when working as a bartender, waiter or waitress if visible.

<</if>>
<<if _temp_choice.type.includes("fetish")>>
Fetish - Intrinsically lewd.

<</if>>
<<if _temp_choice.type.includes("sleep")>>
Sleep - Soft and cosy.

<</if>>
<<if _temp_choice.type.includes("mask")>>
Mask - Conceals your identity, stopping fame from increasing. Won't fool the police or people who know you.

<</if>>
<<if _temp_choice.type.includes("holy")>>
Holy - Sacred to the local faith.

<</if>>
<<if _temp_choice.type.includes("dark")>>
Profane - Absorbs all light.

<</if>>

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

<<widget "outfitforestclothes">><<nobr>>

<<for _i to 0; _i lt $clothes.upper.length; _i++>>
	<<if $clothes.upper[_i].shop.includes("forest") and $clothes.upper[_i].one_piece is 1>>
		<<if $clothes.upper[_i].name is "witch dress">>
			<<if $days gte 47>>
			<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.upper[_i].name_cap | £<<print $clothes.upper[_i].cost / 100>> - Locked - In stock from the 21st of October.

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

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

<<widget "upperforestclothes">><<nobr>>

<<for _i to 0; _i lt $clothes.upper.length; _i++>>
	<<if $clothes.upper[_i].shop.includes("forest") and $clothes.upper[_i].one_piece isnot 1>>
		<<if $clothes.upper[_i].name is "serafuku">>
			<<if $headdrive is 1>>
			<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.upper[_i].name_cap | £<<print $clothes.upper[_i].cost / 100>> - Locked - Discover the headteacher's secret.

			<</if>>
		<<elseif $clothes.upper[_i].name is "slut shirt">>
			<<if $undergroundescape isnot undefined>>
			<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.upper[_i].name_cap | £<<print $clothes.upper[_i].cost / 100>> - Locked - Survive slavery in an underground brothel.

			<</if>>
		<<elseif $clothes.upper[_i].name is "vampire jacket">>
			<<if $days gte 47>>
			<<print '<<link [[$clothes.upper[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.upper[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.upper[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.upper[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.upper[_i].name_cap | £<<print $clothes.upper[_i].cost / 100>> - Locked - In stock from the 21st of October.

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

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

<<widget "underlowerforestclothes">><<nobr>>

<<for _i to 0; _i lt $clothes.under_lower.length; _i++>>
	<<if $clothes.under_lower[_i].shop.includes("forest") and $clothes.under_lower[_i].one_piece isnot 1>>
		<<if $clothes.under_lower[_i].name is "loincloth">>
			<<if $syndromeeden is 1 or $syndromewolves is 1>>
			<<print '<<link [[$clothes.under_lower[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.under_lower[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.under_lower[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.under_lower[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.under_lower[_i].name_cap | £<<print $clothes.under_lower[_i].cost / 100>> - Locked - Befriend a lonely hunter. Or join a pack of wolves.

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

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

<<widget "headforestclothes">><<nobr>>

<<for _i to 0; _i lt $clothes.head.length; _i++>>
	<<if $clothes.head[_i].shop.includes("forest")>>
		<<if $clothes.head[_i].name is "witch hat">>
			<<if $days gte 47>>
			<<print '<<link [[$clothes.head[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.head[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.head[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.head[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.head[_i].name_cap | £<<print $clothes.head[_i].cost / 100>> - Locked - In stock from the 21st of October.

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

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

<<widget "neckforestclothes">><<nobr>>

<<for _i to 0; _i lt $clothes.neck.length; _i++>>
	<<if $clothes.neck[_i].shop.includes("forest")>>
		<<if $clothes.neck[_i].name is "holy pendant">>
			<<if $soup_kitchen_known is 1>>
			<<print '<<link [[$clothes.neck[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.neck[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.neck[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.neck[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.neck[_i].name_cap | £<<print $clothes.neck[_i].cost / 100>> - Locked - Discover the soup kitchen.

			<</if>>
		<<elseif $clothes.neck[_i].name is "dark pendant">>
			<<if $loft_known is 1>>
			<<print '<<link [[$clothes.neck[_i].name_cap|$passage]]>><<set $clothes_choice to ' + _i + '>><<set $clothes_choice_reveal to clone($clothes.neck[' + _i + '].reveal)>><<set $clothes_choice_integrity to ($clothes.neck[' + _i + '].integrity_max)>><</link>>'>> | £<<print $clothes.neck[_i].cost / 100>>. Unlocked

			<<else>>
			$clothes.neck[_i].name_cap | £<<print $clothes.neck[_i].cost / 100>> - Locked - Discover Bailey's fear.

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

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

<<widget "shopDefaultOptions">><<nobr>>

<<set _colorOptions to ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "white", "yellow"]>>
<<set _secondaryColorOptions to ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "white", "yellow"]>>

Primary Colour:

<<for _i to 0; _i lt _colorOptions.length; _i++>>
	<<print '' + _colorOptions[_i] + ''>>
	<<print '<<radiobutton "$shopDefaults.color" "'+ _colorOptions[_i] +'" ' + ($shopDefaults.color is _colorOptions[_i] ? "checked" : "") + '>>'>>
	 |
<</for>>

Secondary Colour:

<<for _i to 0; _i lt _secondaryColorOptions.length; _i++>>
	<<print '' + _secondaryColorOptions[_i] + ''>>
	<<print '<<radiobutton "$shopDefaults.secColor" "'+ _secondaryColorOptions[_i] +'" ' + ($shopDefaults.secColor is _secondaryColorOptions[_i] ? "checked" : "") + '>>'>>
	 |
<</for>>

<<print '<<checkbox "$shopDefaults.disableReturn" false true '+($shopDefaults.disableReturn is true? "checked" : "")+'>>'>> Make it easier to send multiple of the same item home.

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

<<widget "shopDefaultOptionsToggle">><<nobr>>
<<toggleclass #shopDefault "hidden">>
<</nobr>><</widget>>


code:
:: Barb Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "barb">>
You are on Barb Street. Silver blocks of flats tower all around you. You can hear the sea. The police station is located here. There's also a dance studio.
<<if $daystate is "day">>
	<<if $weather is "rain">>
		The few braving the rain walk quickly.
	<<else>>
		Pedestrians fill the pavements, but the sound of traffic dominates.
	<</if>>
<<elseif $daystate is "dawn">>
	The street is already busy, even so early.
<<elseif $daystate is "dusk">>
	The sun has long since disappeared behind the towers, but the street remains busy.
<<elseif $daystate is "night">>
	Voices and occasional shouting emerge from nearby buildings despite the hour.
<</if>>
<<if $police_access_card is 1>>
	Your police access card can open a door at the side of the station.
	<<set $phase to 10>>
<<elseif $skulduggery gte 600 and (($daystate isnot "night" and $rng lte 25) or ($daystate is "night" and $rng lte 20))>>
	<<set $phase to 10>>

	With a thief's eye you see what others miss. You notice a couple of police dragging
	<<print either("a shackled","an unconscious","a struggling","a nubile","a naked","a heavily sedated","a gagged","a flirtatious")>> prisoner
	from a side door and taking them <<print either("down a secluded alley.","into the back of a police car.","down steps to a secluded underground cell.")>>
	The side door didn't close properly. It remains slightly open.

<<set $eventskip to 1>>
<</if>>
<<if $halloween is 1>>
Jack-o'-lanterns and other halloween decorations leer through windows.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
<</if>>
<<if $stress gte 10000>>
	<<passoutstreet>>
<<else>>
	<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (9900 - $allure) and $eventskip is 0>>
		<<eventsstreet>>
	<<else>>
		<<if $map.top is true>>
			<<map "barb">>

		<</if>>
		Places of Interest

		<<if $openinghours is 1>>
			<<link [[Dance Studio (0:01)|Dance Studio]]>><<pass 1>><</link>>

		<<elseif $closinghour is 1>>
			People are leaving the dance studio. It must be closing time.

		<<else>>
			<<link [[Dance Studio|Dance Studio Lock]]>><</link>>

		<</if>>
		<<if $exposed lte 0>>
			<<policeicon>><<link [[Police Station (0:02)|Police Station]]>><<pass 2>><</link>>

			<<if $dorenintro gte 1>>
				<<link [[Doren's Flat (0:02)|Doren Entrance]]>><<pass 2>><</link>>

			<</if>>
		<</if>>
		<<if $phase is 10>>
			<<policeicon>><<link [[Sneak into Police Station side door (0:05)|Police Back Office]]>><<pass 5>><<set $phase is 0>><</link>>

		<</if>>
		<<if $exposed gte 1 and $daystate isnot "night">>
		<<else>>
			<<add_link "Travel
">><<hideDisplay>>
			<<domus>>
			<<cliff>>
			<<connudatus>>
			<<if $exposed lte 0>>
				<<buswait>>
			<</if>>
			<<loiter>>
		<</if>>
		<<add_link "
Alternate Routes
">><<hideDisplay>>
		<<residential>>
		<<stormdrain>>

		<<displayLinks>>
		<<if $map.top isnot true>>

			<<map "barb">>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>

repo_name: fizzyboi/degrees

license: mit


code:
:: Cliff Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "cliff">>
You are on Cliff Street. Several civic buildings are located here, including the town hall. The Ocean Breeze cafe looks out over the sea. There's a path leading down to the beach.
<<if $daystate is "day">>
	<<if $weather is "rain">>
		Wind howls in from the sea.
	<<else>>
		A gentle breeze blows in from the sea.
	<</if>>
<<elseif $daystate is "dawn">>
	There's a lot of traffic. People are driving to work.
<<elseif $daystate is "dusk">>
	There's a lot of traffic. People are driving home from work.
<<elseif $daystate is "night">>
	The street is dark and quiet. Only the ocean can be heard.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
	<<if $exposed is 1 and $topless is 0>>
		This outfit might be fine on the nearby beach, but here it's too lewd!

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

<<if ndef $pillory_tenant>><<setup_pillory>><</if>>
<<if $pillory_tenant.exists is 1>> /* If someone is in pillory... */
	<<if $days gt $pillory_tenant.endday>>/* If sentence finished before today. */
		<<setup_pillory>>
	<<elseif ($days is $pillory_tenant.endday)>>
		<<if $hour gt $pillory_tenant.endhour>> /* If ended earlier today */
			<<setup_pillory>>
		<<elseif $hour is $pillory_tenant.endhour>> /* If ending now? */
			<<end_npc_pillory>>
		<<else>> /* Sentence ongoing. */
			<<npc_pillory>>
		<</if>>
	<<else>> /* Sentence ongoing to tomorrow. */
		<<npc_pillory>>
	<</if>>
<<elseif $rng %10 is 0>> /* Pillory empty gives 10% chance of new person */
	<<new_npc_pillory>>
<</if>>

<<if $arousal gte 10000>>
	<<orgasmstreet>>
<</if>>
<<if $stress gte 10000>>
	<<passoutstreet>>
<<else>>
<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (9900 - $allure) and $eventskip is 0>>
		<<eventsstreet>>
	<<else>>
		<<if $map.top is true>>
			<<map "cliff">>

		<</if>>
		Places of interest

		<<if $scienceproject is "ongoing" and $scienceprojectdays is 0 and $daystate is "day" and $exposed lte 0>>
			<<link [[Attend Science Fair|Science Fair]]>><</link>>

		<</if>>
		<<if $mathsproject is "ongoing" and $mathsprojectdays is 0 and $daystate is "day" and $exposed lte 0>>
			<<link [[Attend Maths Competition|Maths Competition]]>><</link>>

		<</if>>
		<<if $pillory_tenant.exists is 1 and $exposed lte 0>>
			<<link [[Watch Pillory (0:10)|Cliff Street Pillory]]>><<pass 10>><</link>>

		<</if>>
		<<link [[Beach (0:05)|Beach]]>><<pass 5>><</link>>

		<<if $openinghours is 1>>
			<<if $exposed lte 0>>
				<<link [[Cafe (0:01)|Ocean Breeze]]>><<pass 1>><</link>>

			<<else>>
			<</if>>
		<<elseif $closinghour is 1>>
			People are leaving the cafe. It must be closing time.

		<<else>>
			<<link [[Cafe|Ocean Breeze Lock]]>><</link>>

		<</if>>

		<<if $exposed gte 1 and $daystate isnot "night">>
		<<else>>
			<<add_link "Travel
">><<hideDisplay>>
			<<barb>>
			<<starfish>>
			<<connudatus>>
			<<high>>
			<<if $exposed lte 0>>
				<<buswait>>
			<</if>>
			<<loiter>>
		<</if>>
		<<add_link "
Alternate Routes
">><<hideDisplay>>
		<<commercial>>
		<<stormdrain>>
		<<displayLinks>>
		<<if $map.top isnot true>>

			<<map "cliff">>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>

:: Cliff Street Pillory [nobr]
<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "cliff">>
You join the crowd around the pillory on Cliff Street.
<<npc_pillory_detail>>
<<if $stress gte 4000>>
You are stressed. Things are getting on top of you.
You watch some people throw fruit at <<the_pillory_person_stop>> It looks like fun. You feel an urge to join in - <<he>> probably deserves it.

<</if>>
<<if $daystate is "night">>
	<<if $stress gte 3000>>
		<<if $pillory_tenant.fruitstock gte 1>>
			<<link [[Throw Fruit|Cliff Street Prisoner]]>><<pass 2>><<set $phase to 0>><<stress -6>><<set $pillory_tenant.fruitstock -= 1>><</link>><<lstress>>

		<<else>>
			There is no fruit left to throw right now.

		<</if>>
	<</if>>
	<<if $cat gte 6 and ($pillory_tenant.ass + $pillory_tenant.genital) gte 2>>
		<<link [[Groom prisoner|Cliff Street Prisoner]]>><<pass 5>><<set $phase to 1>><</link>>

	<</if>>
	<<if $pillory_tenant.lowerexposed gte 2 and ($stress gte 4000 or $trauma gte (($traumamax / 5) * 1))>>
		<<link [[Spank prisoner|Cliff Street Prisoner]]>><<pass 5>><<set $phase to 2>><</link>><<lstress>><<ltrauma>>

	<</if>>
<<else>>
	<<if $stress gte 4000>>
		<<if $pillory_tenant.fruitstock gte 1>>
			<<link [[Throw Fruit|Cliff Street Prisoner]]>><<pass 2>><<set $phase to 0>><<stress -6>><<set $pillory_tenant.fruitstock -= 1>><</link>><<lstress>>

		<<else>>
			There is no fruit left to throw right now.

		<</if>>
	<</if>>
<</if>>
<<endevent>>
<<link [[Leave|Cliff Street]]>><</link>>

:: Cliff Street Prisoner [nobr]
<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "cliff">>
<<get_pillory_npc>><<person1>>
<<if $phase is 0>>
	A box of rotten fruit lies nearby. You grab a piece and weigh it in your hand.

	You throw it at <<the_pillory_person>>
	<<if $rng gte 75>>
	<<set $pillory_tenant.fruit += 1>>
		hitting <<him>> full in the face. <<His>> expression is hilarious.
		<<if $physique gte ($physiquesize / 7) * 4>>You put a lot of strength behind it, it must have hurt.<</if>><<llstress>><<stress -12>>

		The crowd cheer and laugh.
	<<else>>
		but miss entirely.<<if $physique lte ($physiquesize / 7) * 3>> Some people nearby mock your feeble throw.<</if>>
	<</if>>
<<elseif $phase is 1>>
	You slurp up the cream from the <<the_pillory_persons>> ass and groin. The crowd watch, awed.
	<<set $famesex +=20>>
<<else>>
<<set $pillory_tenant.spank += 1>><<control 10>><<stress -12>><<trauma -12>>
	You viciously spank <<the_pillory_persons>> ass. It gives you a sense of control and well-being.
<</if>>
<<endevent>>

<<link [[Next|Cliff Street Pillory]]>><</link>>


code:
:: Connudatus Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "connudatus">>
You are on Connudatus Street. The numerous clubs, bars and restaurants make it the town's most lively locale by night. During the day the street is lined by hawkers selling various wares.
<<if $daystate is "day">>
	The street is crowded with shoppers.
<<elseif $daystate is "dawn">>
	Vendors are setting up their stalls.
<<elseif $daystate is "dusk">>
	Vendors are taking down their stalls. The restaurants are packed.
<<elseif $daystate is "night">>
	The nightlife is in full swing. Neon lights glow above.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
<</if>>
<<if $arousal gte 10000>>
	<<orgasmstreet>>
<</if>>
<<if $skulduggery gte 200 and $skulduggeryDintro isnot 1>>
	<<set $skulduggeryDintro to 1>>
	Your experience breaking the rules of society lets you look at the street in a new light. So many people with their valuables close at hand, and lightly guarded. You can now rob people on Connudatus Street.

<</if>>
<<if $stress gte 10000>>
	<<passoutstreet>>
<<else>>
	<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (9900 - $allure) and $eventskip is 0>>
		<<eventsstreet>>
	<<else>>
		<<if $map.top is true>>
			<<map "connudatus">>

		<</if>>
		Places of interest

		<<if $daystate isnot "dawn" and $daystate isnot "day" and $exposed lte 1>>
			<<stripclubicon>><<link [[Strip Club|Strip Club]]>><</link>>

		<</if>>
		<<if $daystate isnot "dusk" and $daystate isnot "night" and $hour isnot 6>>
			<<link [[Strip Club|Strip Club Lock]]>><</link>>

		<<elseif $hour is 6>>
			People are leaving the club. It must be closing time.

		<</if>>
		<<if $skulduggeryDintro is 1 and $exposed lte 0>>
			<<link [[Look for a mark (0:20)|Connudatus Street Thievery]]>><<pass 20>><<crimeup 1>><</link>><<crime>>

		<</if>>

		<<if $exposed gte 1 and $daystate isnot "night">>
		<<else>>
			<<add_link "Travel
">><<hideDisplay>>
			<<barb>>
			<<danube>>
			<<cliff>>
			<<wolf>>
			<<if $exposed lte 0>>
				<<buswait>>
			<</if>>
			<<loiter>>
		<</if>>
		<<add_link "
Alternate routes
">><<hideDisplay>>
		<<residential>>
		<<commercial>>
		<<stormdrain>>
		<<displayLinks>>
		<<if $map.top isnot true>>

			<<map "connudatus">>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>


code:
:: Danube Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "danube">>
You are on Danube Street. The houses here are spacious and stately.
<<if $daystate is "day">>
	<<if $weather is "rain">>
		The rain has driven people indoors.
	<<else>>
		You hear activity from the walled gardens.
	<</if>>
<<elseif $daystate is "dawn">>
	You see movement through the windows.
<<elseif $daystate is "dusk">>
	They cast creepy shadows in the dimming light.
<<elseif $daystate is "night">>
	Light from the windows does little to alleviate the darkness.
<</if>>
<<if $halloween is 1>>
Some homes host extravagant halloween displays.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
<</if>>
<<if $arousal gte 10000>>
	<<orgasmstreet>>
<</if>>
<<if $stress gte 10000>>
	<<passoutstreet>>
<<else>>
	<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (9900 - $allure) and $eventskip is 0>>
		<<eventsstreet>>
	<<else>>
		<<if $map.top is true>>
			<<map "danube">>

		<</if>>
		Places of interest

		<<foresticon>><<link [[Forest (0:10)|Forest]]>><<pass 10>><<set $forest to 0>><<set $eventskip to 1>><</link>>

		<<if $exhibitionismrun is "danube" and $exposed lte 1>>
			<<link [[Oak behind spa|Danube Oak]]>><</link>>

		<</if>>
		<<if $daystate is "night">>
			<<link [[Approach one of the houses (0:02)|Danube House Lock]]>><<pass 2>><</link>>

		<<elseif $exposed lte 0>>
			<<link [[Knock on one of the houses (0:02)|Danube House Knock]]>><<pass 2>><</link>>

		<</if>>

		<<if $exposed gte 1 and $daystate isnot "night">>
		<<else>>
			<<add_link "Travel
">><<hideDisplay>>
			<<domus>>
			<<wolf>>
			<<connudatus>>
			<<if $exposed lte 0>>
				<<buswait>>
			<</if>>
			<<loiter>>
		<</if>>
		<<add_link "
Alternate routes
">><<hideDisplay>>
		<<residential>>
		<<stormdrain>>
		<<displayLinks>>
		<<if $map.top isnot true>>

			<<map "danube">>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>

:: Danube Oak [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>>
You walk behind the spa, and find the oak the note mentioned. It stands at the edge of the forest. This is where you were told to strip. There's no one around.

<<if $exhibitionism gte 35>>
	<<link [[Strip|Danube Oak Strip]]>><<set $phase to 0>><</link>><<exhibitionist3>>

<<else>>
	<<link [[Strip|Danube Oak Strip]]>><<set $phase to 1>><<trauma 6>><<stress 6>><</link>><<gtrauma>><<gstress>>

<</if>>
<<link [[leave|Danube Street]]>><</link>>

:: Danube Oak Strip [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>>
<<upperstrip>><<lowerstrip>><<underlowerstrip>><<underupperstrip>>
<<if $phase is 0>>
	You <<nervously>> remove your clothing as the note said, until you're stood naked, here on the outskirts of town.<<exhibitionism3>>
<<else>>
	You take a deep breath and glance around. This is a lot of money. You <<nervously>> remove your clothing as the note said, until you're stood naked, here on the outskirts of town.
<</if>>

Something flashes in the oak's branches. A camera. <<covered>> You feel your face heat up, but notice something else above you. A small parachute floats down, carrying a little box. You catch it. There's a note inside.

It was nice working with you.

There's £100 behind the paper. You get dressed as fast as your shaking hands will allow. You don't think anyone saw you. Except the camera.

<<set $money += 10000>>
<<set $exhibitionismrun to "danubedone">>
<<set $exhibitionismrunon to 0>>
<<link [[leave|Danube Street]]>><<clotheson>><</link>>


code:
:: Domus Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "domus">>
You are on Domus Street. The orphanage is here. The street is dominated by small homes similar in appearance.
<<if $daystate is "day">>
	<<if $weather is "rain">>
		People walk quickly, driven by the rain.
	<<else>>
		People tend to their gardens and go about their business all along the street.
	<</if>>
<<elseif $daystate is "dawn">>
	It's quite busy. People are on their way to work.
<<elseif $daystate is "dusk">>
	People return to their homes, tired after a long day.
<<else>>
	The street is dark and silent.
<</if>>
<<if $halloween is 1>>
Jack-o'-lanterns, skeletons, and spiders decorate the houses.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
<</if>>
<<if $arousal gte 10000>>
	<<orgasmstreet>>
<</if>>
<<if $tutorial is 0 and $debug is 0>><<set $tutorial to 1>>
	<<generate1>><<person1>>As you leave the orphanage you bump into a <<person>> passing by. <<He>> staggers back and looks at you with anger, but <<his>> rage turns to lechery as <<he>> beholds you. "You're the cutest thing I've seen all week! Come 'ere."

	<<link [[Next|Tutorial]]>><<set $molestationstart to 1>><</link>>
<<else>>
	<<if $stress gte 10000>>
		<<passoutstreet>>
	<<else>>
		<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
		<<if $danger gte (9900 - $allure) and $eventskip is 0>>
			<<eventsstreet>>
		<<elseif $NPCName[$NPCNameList.indexOf("Whitney")].state isnot "dungeon" and $NPCName[$NPCNameList.indexOf("Whitney")].init is 1 and $halloween is 1 and $monthday is 31 and $hour gte 19 and $halloween_whitney_proposed isnot 1>><<set $halloween_whitney_proposed to 1>>
			<<halloweenwhitney>>
		<<else>>
			<<if $map.top is true>>
				<<map "domus">>

			<</if>>
			<<if $averydate is 1 and $hour is 20>>
				Avery waits for you by their car.

				<<link [[Date (1:20)|Avery Date]]>><</link>>

			<</if>>

			Places of interest

			<<link [[Go home (0:01)->Orphanage]]>><<pass 1>><</link>>

			<<if $daystate is "night">>
				<<link [[Approach one of the houses (0:02)|Domus House Lock]]>><<pass 2>><</link>>

			<<elseif $exposed lte 0>>
				<<link [[Knock on one of the houses (0:02)|Domus House Knock]]>><<pass 2>><</link>>

			<</if>>
			<<if $exposed gte 2 and $daystate isnot "night" and $exhibitionism gte 75>>
				<<link [[Beg for clothing (0:02)|Domus House Nude]]>><<pass 2>><</link>><<exhibitionist5>>

			<</if>>
			<<if $exposed gte 1 and $daystate isnot "night">>
			<<else>>
				<<add_link "Travel
">><<hideDisplay>>
				<<barb>>
				<<danube>>
				<<if $exposed lte 0>>
					<<buswait>>
				<</if>>

			<</if>>
			<<add_link "
Alternate Routes
">><<hideDisplay>>
			<<residential>>
			<<stormdrain>>
			<<loiter>>

			<<displayLinks>>
			<<if $map.top isnot true>>

				<<map "domus">>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>


code:
:: Elk Street [nobr]

<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "elk">>
You are on Elk Street. There are roads leading to several large industrial complexes.
<<if $daystate is "day">>
	<<if $weather is "rain">>
		The sound of water hitting metal is constant.
	<<else>>
		You hear the sound of machinery all around.
	<</if>>
<<elseif $daystate is "dawn">>
	You hear the sound of machinery all around.
<<elseif $daystate is "dusk">>
	You hear the sound of machinery all around.
<<elseif $daystate is "night">>
	You hear the sound of machinery even at this hour.
<</if>>
<<streeteffects>>

<<if $exposed gte 1>>
	<<exhibitionism "street">>
<</if>>
<<if $arousal gte 10000>>
	<<orgasmstreet>>
<</if>>
<<if $stress gte 10000>>
	<<passoutstreet>>
<<else>>
	<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (9900 - $allure) and $eventskip is 0>>
		<<eventsstreet>>
	<<else>>
		<<if $map.top is true>>
			<<map "elk">>

		<</if>>
		<<if $compoundstate isnot undefined>>
			Places of interest

		<</if>>
		<<if $compoundstate is 1>>
			The compound is prowled by guards. They'll be less agitated tomorrow.

		<<elseif $compoundstate is 0>>
			<<link [[Sneak into the compound|Elk Compound]]>><<crimeup 1>><</link>><<crime>>

		<<elseif $compoundcard is 1 and $exposed lte 0>>
			<<link [[Enter strange compound|Elk Compound Card]]>><</link>>

		<</if>>

		<<if $exposed gte 1 and $daystate isnot "night">>
		<<else>>
			<<add_link "Travel
">><<hideDisplay>>
			<<nightingale>>
			<<oxford>>
			<<harvest>>
			<<if $exposed lte 0>>
				<<buswait>>
			<</if>>
			<<loiter>>
		<</if>>
		<<add_link "
Alternate routes
">><<hideDisplay>>
		<<industrial>>
		<<stormdrain>>
		<<displayLinks>>
		<<if $map.top isnot true>>

			<<map "elk">>
		<</if>>
	<</if>>
<</if>>
<<set $eventskip to 0>>