code:
:: Widgets Shop [widget]

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

<<widget "shopbuy">>
<<set _shop_temp to $args[3]>>
<<set $clothes_choice_previous to $clothes_choice>>

<<if _shop_temp isnot undefined and ($randomLock isnot true or $args[1] is "try")>>
	<<clothingShopColorSet $args[0]>>
<</if>>

<<if $args[0] is "upper" or $args[0] is "lower">>
	<<ShowUnderEquip "normal">>
<</if>>
<<if $args[0] is "over_upper" or $args[0] is "over_lower" or $args[0] is "over_head">>
	<<ShowUnderEquip "over">>
<</if>>
<<if $args[1] is "buy">>
	You buy the <<print setup.clothes[$args[0]][_shop_temp].name>>.

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

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

<<if $args[2] is "wear">>
	<<generalWear $args[0] _shop_temp $colouraction2 $accessorycolouraction2>>
	<<updateOwned $args[0]>>
<<elseif $args[2] is "send">>
	<<set _loop to $args[4]>>
	<<if _loop is undefined>>
		<<set _loop to 1>>
	<</if>>
	<<for _s to 0; _s lt _loop; _s++>>
		<<generalSend "wardrobe" $args[0] _shop_temp $colouraction2 $accessorycolouraction2>>
		<<clothingShopColorSet $args[0]>>
	<</for>>
<</if>>

<</widget>>

<<widget "clothingShopColorSet">>
<<if $colouraction is "random">>
	<<set _colouractionChoices to clone(setup.clothes[$args[0]][_shop_temp].colour_options)>>
	<<run _colouractionChoices.delete("custom")>>
	<<set $colouraction2 to _colouractionChoices.pluck()>>
<<else>>
	<<set $colouraction2 to clone($colouraction)>>
<</if>>
<<if $accessorycolouraction is "random">>
	<<set _accessorycolouractionChoices to clone(setup.clothes[$args[0]][_shop_temp].accessory_colour_options)>>
	<<run _accessorycolouractionChoices.delete("custom")>>
	<<set $accessorycolouraction2 to _accessorycolouractionChoices.pluck()>>
<<else>>
	<<set $accessorycolouraction2 to clone($accessorycolouraction)>>
<</if>>
<</widget>>

<<widget "clothingShop">>
<<if $args[0]>>
	<<set $clothingShopSlot to $args[0]>>
<</if>>
<input type="button" value="DEFAULT OPTIONS" onclick="Wikifier.wikifyEval('<<shopDefaultOptionsToggle>>');">
<input type="button" value="FILTERS" onclick="Wikifier.wikifyEval('<<shopClothingFilterToggle>>');">

	<<shopDefaultOptions>>

	<<shopClothingFilterSettings>>

<<for _label, _value range $shopClothingFilter.reveal>>
	<<if _value is false>>
		<<set _revealFilter to true>>
		<<break>>
	<</if>>
<</for>>
<<if $shopClothingFilter.gender isnot "none" or $shopClothingFilter.traits.length isnot 0 or _revealFilter>>

	The filter is currently active! <<link [[Reset it|$passage]]>><<shopClothingFilterReset>><</link>>

<</if>>
<<if $clothes_choice and setup.clothes[$clothingShopSlot][$clothes_choice] is undefined>>
	<<unset $clothes_choice>>
<<elseif $clothes_choice>>
	<<set _temp_choice to clone(setup.clothes[$clothingShopSlot][$clothes_choice])>>
	<<if _temp_choice.plural is 1>>
		<<integrity $clothes_choice_integrity "cap">>
	<<else>>
		A <<integrity $clothes_choice_integrity>>
	<</if>>
	and <<reveal $clothes_choice_reveal>> <<print _temp_choice.name>>.
	<<if _temp_choice.gender is "m">>
		For boys.
	<<elseif _temp_choice.gender is "f">>
		For girls.
	<</if>>
	<<print _temp_choice.description>> Costs <<printmoney `getClothingCost(_temp_choice,$clothingShopSlot)`>>.

	<<warmth _temp_choice.warmth>>

	<<shoptraits>>
	<<set _slimeSlots to ["over_upper","over_lower","upper","lower","under_upper","under_lower"]>>
	<<if !_slimeSlots.includes($clothingShopSlot) or $willpower gte 800 or _temp_choice.reveal gte 500 or _temp_choice.type.includesAny("school", "event") or $corruption_slime lt 80>>
		<<if _temp_choice.colour_options.length gt 1>>
			<<run _temp_choice.colour_options.pushUnique("random")>>
			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 _temp_choice.accessory_colour_options.length isnot 0>>
			<<run _temp_choice.accessory_colour_options.pushUnique("random")>>
			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>>
		<<if _temp_choice.colour_options.length gt 1 or _temp_choice.accessory_colour_options.length gt 1>>
			<input type="button" value="Custom Colours" onclick="Wikifier.wikifyEval('<<shopCustomColorsToggle>>');">

			<<shopCustomColors>>
		<</if>>
		<<if $images is 1>>
			<input type="button" value="Image" onclick="Wikifier.wikifyEval('<<shopFullImageToggle>>');">

<<shopFullImage $clothingShopSlot $clothes_choice>>

		<</if>>
		<<set _cost to clone(getClothingCost(_temp_choice,$clothingShopSlot))>>
		<<unset _cursedPrevent>>
		<<set _outfitPrimaryShop to _temp_choice.outfitPrimary>>
		<<set _preventSlots to []>>
		<<set _wardrobeSlots to [$clothingShopSlot]>>
		<<if $worn[$clothingShopSlot].cursed is 1>>
			<<set _cursedPrevent to true>>
			<<run _preventSlots.push($clothingShopSlot)>>
		<</if>>
		<<if _outfitPrimaryShop isnot undefined>>
			<<for _labelShop, _valueShop range _outfitPrimaryShop>>
				<<run _wardrobeSlots.push(_labelShop)>>
				<<if $worn[_labelShop].cursed is 1>>
					<<set _cursedPrevent to true>>
					<<run _preventSlots.push(_labelShop)>>
				<</if>>
			<</for>>
		<</if>>
	<<warmth_description>>

		<<shopBuyItemStatus _wardrobeSlots>>
		<<if _spaceLeft lt 1>>
			Your wardrobe is full.

		<<elseif $daystate is "night">>
			<<if $clothingShop.stolenClothes lte 20>>
				<<if $worn[$clothingShopSlot].cursed is 1>>
					You can't wear this item without first removing your
					<<for _i to 0; _i lt _preventSlots.length; _i++>>
						<<print $worn[_preventSlots[_i]].name>><<if _preventSlots.length gt 2 and _i lt _preventSlots.length - 2>>,
						<<elseif _preventSlots.length gte 2 and _i is _preventSlots.length - 2>>
							and
						<</if>>
					<</for>>
					.

				<<else>>
					<<link [[Steal and wear|$passage]]>>
						<<shopbuy $clothingShopSlot "steal" "wear" $clothes_choice>><<crimeup `_cost / 100`>><<unset $clothes_choice>>
						<<set $clothingShop.stolenClothes++>>
						<<set $clothingShop.totalStolenClothes++>>
					<</link>><<crime>>

				<</if>>
				<<link [[Steal and take home|$passage]]>>
					<<shopbuy $clothingShopSlot "steal" "send" $clothes_choice>><<crimeup `_cost / 100`>>
					<<set $clothingShop.stolenClothes++>>
					<<set $clothingShop.totalStolenClothes++>>
					<<if $shopDefaults.disableReturn is false>>
						<<unset $clothes_choice>>
					<</if>>
				<</link>><<crime>>

			<<else>>
				You can't carry any more clothes with you. You should take them to your wardrobe.

			<</if>>
		<<elseif $money gte _cost>>
			<<if _cursedPrevent is true>>
				You can't wear this item without first removing your
				<<for _i to 0; _i lt _preventSlots.length; _i++>>
					<<print $worn[_preventSlots[_i]].name>><<if _preventSlots.length gt 2 and _i lt _preventSlots.length - 2>>,
					<<elseif _preventSlots.length gte 2 and _i is _preventSlots.length - 2>>
						and
					<</if>>
				<</for>>
				.

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

			<</if>>
			<<link [[Buy and send home|$passage]]>>
				<<clothingReset $clothingShopSlot>>
				<<shopbuy $clothingShopSlot "buy" "send" $clothes_choice 1>>
				<<set $money -= _cost>>
				<<if $shopDefaults.disableReturn is false>>
					<<unset $clothes_choice>>
				<</if>>
			<</link>>
			<<if $money gte _cost * 5 and _spaceLeft gte 5>>
				| <<link [[X 5|$passage]]>>
					<<clothingReset $clothingShopSlot>>
					<<shopbuy $clothingShopSlot "buy" "send" $clothes_choice 5>>
					<<set $money -= _cost * 5>>
					<<if $shopDefaults.disableReturn is false>>
						<<unset $clothes_choice>>
					<</if>>
				<</link>>
			<</if>>

		<<else>>
			You cannot afford this item.

		<</if>>
		<<if _cursedPrevent is true>>
		<<elseif $tryOn.tryingOn>>
			<<link [[Try on|$passage]]>><<shopbuy $clothingShopSlot "try" null $clothes_choice>><<set $randomLock to true>><</link>>

			<<if $tryOn.tryingOn[[$clothingShopSlot]] isnot null>>
			<<link [[Return|$passage]]>><<shopbuy $clothingShopSlot "return" null $clothes_choice>><<unset $randomLock>><</link>>

			<</if>>
		<</if>>
	<<else>>
		The slime in your ear refuses to allow you to try on or buy the _temp_choice.name.

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

<<switch $location>>
	<<case "shopping_centre">><<set _shopLocation to "clothing">>
	<<case "forest_shop">><<set _shopLocation to "forest">>
	<<default>><<set _shopLocation to $location>>
<</switch>>
<<if _shopLocation>>
	<<if $shopListStartCount is undefined>>
		<<set $shopListStartCount to 0>>
	<</if>>
	<<if $shopListMax is undefined>>
		<<set $shopListMax to 15>>
	<</if>>
	<<set _listCount to 0>><<set _trueListCount to 0>>
	<<for _i to 0; _i lt setup.clothes[$clothingShopSlot].length; _i++>>
		<<set _item to clone(setup.clothes[$clothingShopSlot][_i])>>
		<<set _itemData = setup.clothes[$clothingShopSlot][clothesIndex($clothingShopSlot,_item)]>>
		<<if !_item.shop.includes(_shopLocation) or _item.outfitSecondary isnot undefined>>
			<<continue>>
		<</if>>
		<<if (_item.outfitPrimary is undefined and $args[1] is "outfits")
		or (_item.outfitPrimary isnot undefined and $args[1] is "non-outfits")>>
			<<continue>>
		<</if>>

		<<if $shopClothingFilter.gender isnot "none">>
			<<if _item.gender isnot $shopClothingFilter.gender>>
				<<continue>>
			<</if>>
		<</if>>

		<<if $shopClothingFilter.traits.length gt 0>>
			<<set _skip to true>>
		<</if>>
		<<for _trait range $shopClothingFilter.traits>>
			<<if _item.type.includes(_trait) is true>>
				<<set _skip to false>>
				<<break>>
			<</if>>
		<</for>>
		<<if _skip>>
			<<continue>>
		<</if>>

		<<if between(_item.reveal, 900, 1000) and $shopClothingFilter.reveal.lewd isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 700, 899) and $shopClothingFilter.reveal.risqué isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 500, 699) and $shopClothingFilter.reveal.seductive isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 300, 499) and $shopClothingFilter.reveal.comfy isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 200, 299) and $shopClothingFilter.reveal.tasteful isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 100, 199) and $shopClothingFilter.reveal.smart isnot true>>
			<<continue>>
		<<elseif between(_item.reveal, 0, 99) and $shopClothingFilter.reveal.unassuming isnot true>>
			<<continue>>
		<</if>>

		<<run _trueListCount++>>
		<<if _listCount is $shopListMax + $shopListStartCount>>
			<<continue>>
		<</if>>
		<<run _listCount++>>
		<<if _listCount - $shopListStartCount <= 0>>
			<<continue>>
		<</if>>
		<<clothingicon _item $clothingShopSlot>>
		<<if $specialClothes[_item.name.replace(/ /g,"")] is "locked">>
			_itemData.name_cap
		<<else>>
			<<capture _item _itemData _i>>
				<<link [[_itemData.name_cap|$passage]]>>
					<<set $clothes_choice to _i>>
					<<set $clothes_choice_reveal to clone(_item.reveal)>>
					<<set $clothes_choice_integrity to (_itemData.integrity_max)>>
				<</link>>
			<</capture>>
		<</if>>
		| <<printmoney `getClothingCost(_item,$clothingShopSlot)` true>> |
		<<if _item.gender is "m">>
			♂
		<<elseif _item.gender is "f">>
			♀
		<</if>>
		<<if $specialClothes[_item.name.replace(/ /g,"")] isnot undefined>>
			<<if $specialClothes[_item.name.replace(/ /g,"")] is "locked">>
				Locked
			<<elseif $specialClothes[_item.name.replace(/ /g,"")] is "unlocked">>
				Unlocked
			<</if>>
			<<specialClothesHint>>
			- <<print _specialClothesHint[_item.name.replace(/ /g,"")]>>
		<</if>>

	<</for>>

	<<if _trueListCount is 0>>
		//No items found//

	<<elseif $shopListStartCount gte $shopListMax or _listCount is $shopListMax + $shopListStartCount>>
		<<if $shopListStartCount gte $shopListMax>>
			<<link [["Previous Page"|$passage]]>>
				<<run $shopListStartCount -= $shopListMax>>
			<</link>>
			<<set _extrabr to true>>
		<<else>>
			Previous Page
		<</if>>
		| Page
		<<print ($shopListStartCount / $shopListMax) + 1>>
		of
		<<print Math.floor(_trueListCount / $shopListMax) + 1>> |
		<<if _listCount is $shopListMax + $shopListStartCount>>

			<<link [["Next Page"|$passage]]>>
				<<run $shopListStartCount += $shopListMax>>
			<</link>>
			<<set _extrabr to true>>
		<<else>>
			Next Page
		<</if>>
	<</if>>
	<<if _extrabr>>

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

<<widget "shopTraitDescription">>

<<unset $noTraitDescription>>
<<switch $args[0]>>
	<<case "normal">>
		Normal - Suitable for everyday use.
	<<case "formal">>
		Formal - Suitable for important occasions, and for good etiquette among certain company.
	<<case "school">>
		School - Sanctioned uniform of the local school.
	<<case "glasses">>
		Glasses - Helps you focus, increasing the rate school skills are improved.
	<<case "cool">>
		Fashionable - Increases the rate status improves with your schoolmates, but some teachers may dislike it.
	<<case "swim">>
		Swimwear - Fares well underwater.
	<<case "diving">>
		Diving - Helps keep you warm in cold water.
	<<case "dance">>
		Dance - Flexible enough to withstand the rigours of the dance floor.
	<<case "costume">>
		Costume - People may look at this askance outside the right situations.
	<<case "serving">>
		Serving - Encourages tips when working as a bartender, waiter or waitress if visible.
	<<case "fetish">>
		Fetish - Intrinsically lewd.
	<<case "sleep">>
		Sleep - Soft and cosy. May improve sleep quality.
	<<case "mask">>
		Mask - Conceals your identity, stopping fame from increasing. Won't fool the police or people who know you.
	<<case "holy">>
		Holy - Sacred to the local faith. Increases purity gains and losses.
	<<case "dark">>
		Profane - Considered obscene by the local faith. Increases awareness gains and losses.
	<<case "binding">>
		Binding - Keeps your arms firmly secure and helpless.
	<<case "stealthy">>
		Stealthy - Makes your crimes harder to trace.
	<<case "sticky_fingers">>
		Sticky fingers - More likely to get your way, and keep that which isn't yours.
	<<case "rainproof">>
		Rainproof - Protects you from the rain.
	<<case "tanLines">>
		Tan Lines - Protects your skin from the sun leaving tan lines.
	<<case "bimbo">>
		Special - Something seems special about this set of clothing.
	<<case "heels">>
		High Heeled - Causes fatigue and tripping if you lack skilled feet. Improves kicking power.
	<<case "rugged">>
		Rugged - Helps you keep your footing in tough environments.
	<<case "chest_bind">>
		Chest Binding - Fits tight around your chest, concealing your breasts.
	<<case "eerie">>
		Eerie - <<if $transformdisable is "f">>Protects a specific transformation. Transformations progress and decay at midnight.<<else>>There's something peculiar about this object.<</if>>
	<<case "shade">>
		Shade - Blocks the sun and prevents ambient tanning.
	<<case "asylum">>
		Asylum - Clothes from the local asylum.
	<<case "prison">>
		Prison - Clothes from the local prison.
	<<case "sticky">>
		Sticky - Stuck to your skin.
	<<default>>
		<<set $noTraitDescription = 1>>
<</switch>>
<</widget>>

<<widget "shoptraits">>
Traits:

<<for _trait range setup.clothingTraits>>
	<<if _temp_choice.type.includes(_trait)>>

			<<shopTraitDescription _trait>>
			<<if $noTraitDescription isnot 1>>
				<<clothingtrait _trait 1>>

			<</if>>

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

<</widget>>

<<widget "shopDefaultOptions">>

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

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.

<<print '<<checkbox "$shopDefaults.invertCustomColorsHidden" false true '+($shopDefaults.invertCustomColorsHidden is true? "checked" : "")+'>>'>> Show custom colours by default.

<<if $images is 1>>
<<print '<<checkbox "$shopDefaults.invertImagesHidden" false true '+($shopDefaults.invertImagesHidden is true? "checked" : "")+'>>'>> Show clothes images by default.

<</if>>

	<<if $shopListMax is undefined>>
		<<set $shopListMax to 15>>
	<</if>>
	Number of shop items to display at once:
	<<listbox "$shopListMax" autoselect>>
		<<option 10>>
		<<option 15>>
		<<option 20>>
		<<option 25>>
	<</listbox>>

<</widget>>

<<widget "shopDefaultOptionsToggle">>
<<toggleclass #shopDefault "hidden">>
<<addclass #shopClothingFilter "hidden">>
<</widget>>

<<widget "shopClothingFilterToggle">>
<<toggleclass #shopClothingFilter "hidden">>
<<addclass #shopDefault "hidden">>
<</widget>>

<<widget "shopClothingFilterSettings">>
<<if $shopClothingFilter is undefined>>
	<<set $shopClothingFilter to {
		gender: "none",
		traits: [],
		reveal:{
			lewd: true,
			risqué: true,
			seductive: true,
			comfy: true,
			tasteful: true,
			smart: true,
			unassuming: true
		},
		revealColour:{
			lewd: "red",
			risqué: "pink",
			seductive: "purple",
			comfy: "blue",
			tasteful: "lblue",
			smart: "teal",
			unassuming: "green"
		}
	}>>
	<<unset $shopClothingFilterTraits>>
	<<unset $shopClothingFilterGender>>
	<<unset $clothingTraitTypes>>
<</if>>

Gender:
<<listbox "$shopClothingFilter.gender" autoselect>>
	<<option "All" "none">>
	<<option "Male" "m">>
	<<option "Female" "f">>
	<<option "Unisex" "n">>
<</listbox>>

How revealing clothing items should be:

<<for _label, _value range $shopClothingFilter.reveal>>
	<<print '<<checkbox "$shopClothingFilter.reveal.'+_label+'" false true '+(_value ? "checked" : "")+'>>'>> <<print _label[0].toUpperCase() + _label.substring(1)>>

<</for>>

Traits (Hides any item without any of the selected traits, does not filter when none are selected):

<<shopClothingFilterLoadTraits>>
<<for _index, _trait range _clothingTraitTypes>>

		<<if $shopClothingFilter.traits.indexOf(_trait) is -1>>
			<input type="checkbox" @id="_trait" @value="_trait" onclick="window.shopClothingFilterToggleTrait(this.value)"><<shopTraitDescription _trait>>
		<<else>>
			<input type="checkbox" @id="_trait" @value="_trait" onclick="window.shopClothingFilterToggleTrait(this.value)" checked><<shopTraitDescription _trait>>
		<</if>>

<</for>>
<<link [[Select all traits|$passage]]>>
	<<for _index, _trait range _clothingTraitTypes>>
		<<run $shopClothingFilter.traits.pushUnique(_trait)>>
	<</for>>
<</link>>

<<link [[Reset filters|$passage]]>>
	<<shopClothingFilterReset>>
<</link>>

[[Apply|$passage]]

<</widget>>

<<widget "shopClothingFilterReset">>
<<if $shopClothingFilter is undefined>>
	<<set $shopClothingFilter = {}>>
<</if>>
<<set $shopClothingFilter.gender = { female: true, neutral: true, male: true }>>
<<set $shopClothingFilter.reveal = { from: 0, to: 9999 }>>
<<set $shopClothingFilter.warmth = { from: 0, to: 200 }>>
<<set $shopClothingFilter.traits = []>>
<<set $shopClothingFilter.active = false>>
<</widget>>

<<widget "shopClothingFilterLoadTraits">>
<<set _clothingTraitTypes to [
  "cool",
  "costume",
  "dance",
  "dark",
  "diving",
  "eerie",
  "fetish",
  "formal",
  "glasses",
  "heels",
  "holy",
  "mask",
  "normal",
  "rainproof",
  "rugged",
  "school",
  "serving",
  "sleep",
  "stealthy",
  "swim",
  "tanLines"
]>>

<<set _clothingTraitTypes to _clothingTraitTypes.sort(shopClothingFilterSortOnDescription)>>
<</widget>>

<<widget "shopCustomColorsToggle">>
<<toggleclass #shopCustomColorsDisplay "hidden">>
<<toggleclass #customColorBars "hidden">>
<<toggleclass #ColorsPresets "hidden">>
<</widget>>

<<widget "shopCustomColors">>

<<shopCustomColorsDisplay>>

<<shopCustomColorsBars>>

<<shopCustomColorsPresets>>

<</widget>>

<<widget "shopCustomColorsDisplay">>
__Custom Colours__

	Primary - Colour: $customColors.color.primary | Saturation: $customColors.saturation.primary | Brightness: $customColors.brightness.primary | Contrast: $customColors.contrast.primary | Sepia: $customColors.sepia.primary

	Secondary - Colour: $customColors.color.secondary | Saturation: $customColors.saturation.secondary | Brightness: $customColors.brightness.secondary | Contrast: $customColors.contrast.secondary | Sepia: $customColors.sepia.secondary

<<print '<<radiobutton "$customColors.currentType" "primary" ' + ($customColors.currentType is "primary" ? "checked" : "") + '>>'>> Primary |
<<print '<<radiobutton "$customColors.currentType" "secondary" ' + ($customColors.currentType is "secondary" ? "checked" : "") + '>>'>> Secondary
| <<link "Refresh">>
	<<replace #customColorBars>><<shopCustomColorsBars>><</replace>>
<</link>>

<<link "Reset selected to default">>
	<<set $customColors.color[$customColors.currentType] to 0>>
	<<set $customColors.saturation[$customColors.currentType] to 1>>
	<<set $customColors.brightness[$customColors.currentType] to 1>>
	<<set $customColors.contrast[$customColors.currentType] to 1>>
	<<set $customColors.sepia[$customColors.currentType] to 0>>
	<<replace #customColorBars>><<shopCustomColorsBars>><</replace>>
	<<replace #shopCustomColorsDisplay>><<shopCustomColorsDisplay>><</replace>>
<</link>>
<</widget>>

<<widget "shopCustomColorsBars">>

Colour:

	<input type="range" min="0" max="360" step="1" @value="$customColors.color[$customColors.currentType]" oninput="wikifier('shopCustomColorsSet','color', this.value)">

Saturation:

	<input type="range" min="0" max="2" step="0.05" @value="$customColors.saturation[$customColors.currentType]" oninput="wikifier('shopCustomColorsSet','saturation', this.value)">

Brightness:

	<input type="range" min="0.5" max="4" step="0.05" @value="$customColors.brightness[$customColors.currentType]" oninput="wikifier('shopCustomColorsSet','brightness', this.value)">

Contrast:

	<input type="range" min="0" max="2" step="0.05" @value="$customColors.contrast[$customColors.currentType]" oninput="wikifier('shopCustomColorsSet','contrast', this.value)">

Sepia:

	<input type="range" min="0" max="1" step="0.05" @value="$customColors.sepia[$customColors.currentType]" oninput="wikifier('shopCustomColorsSet','sepia', this.value)">

<</widget>>

<<widget "shopCustomColorsSet">>
<<if $args[0] and $args[1]>>
	<<switch $args[0]>>
		<<case "color">><<set $customColors.color[$customColors.currentType] to $args[1]>>
		<<case "saturation">><<set $customColors.saturation[$customColors.currentType] to $args[1]>>
		<<case "brightness">><<set $customColors.brightness[$customColors.currentType] to $args[1]>>
		<<case "contrast">><<set $customColors.contrast[$customColors.currentType] to $args[1]>>
		<<case "sepia">><<set $customColors.sepia[$customColors.currentType] to $args[1]>>
	<</switch>>
	<<replace #shopCustomColorsDisplay>><<shopCustomColorsDisplay>><</replace>>
<</if>>
<</widget>>

<<widget "shopCustomColorsPresets">>

<<print '<<radiobutton "$customColors.action" "set" ' + ($customColors.action is "set" ? "checked" : "") + '>>'>> Set |
<<print '<<radiobutton "$customColors.action" "delete" ' + ($customColors.action is "delete" ? "checked" : "") + '>>'>> Delete
<<set _keys to Object.keys($customColors.presets)>>

<<for _i to 0; _i lt _keys.length;_i++>>
	<a @onclick="`wikifier('shopCustomColorsPresetsLoad',`+_i+`)`">_keys[_i] |
<</for>>

Name: <input id="colorName" type="text" value="Custom" maxlength="30" onfocus="V.tempDisable = true;">

<<link [["Save Set"|$passage]]>>
	<>
	<<set $customColors.presets[_colorName] to {
		color: $customColors.color,
		saturation: $customColors.saturation,
		brightness: $customColors.brightness,
		contrast: $customColors.contrast,
		sepia: $customColors.sepia
	}>>
	<<unset $tempDisable>>
<</link>>

<</widget>>

<<widget "shopCustomColorsPresetsLoad">>
<<set _presets to Object.keys($customColors.presets)>>
<<set _preset to _presets[$args[0]]>>
<<if $customColors.action is "set">>
	<<set $customColors.color.primary to $customColors.presets[_preset].color.primary>>
	<<set $customColors.color.secondary to $customColors.presets[_preset].color.secondary>>
	<<set $customColors.saturation.primary to $customColors.presets[_preset].saturation.primary>>
	<<set $customColors.saturation.secondary to $customColors.presets[_preset].saturation.secondary>>
	<<set $customColors.brightness.primary to $customColors.presets[_preset].brightness.primary>>
	<<set $customColors.brightness.secondary to $customColors.presets[_preset].brightness.secondary>>
	<<if $customColors.presets[_preset].contrast isnot undefined>>
		<<set $customColors.contrast.primary to $customColors.presets[_preset].contrast.primary>>
		<<set $customColors.contrast.secondary to $customColors.presets[_preset].contrast.secondary>>
	<</if>>
	<<if $customColors.presets[_preset].sepia isnot undefined>>
		<<set $customColors.sepia.primary to $customColors.presets[_preset].sepia.primary>>
		<<set $customColors.sepia.secondary to $customColors.presets[_preset].sepia.secondary>>
	<</if>>
	<<replace #shopCustomColorsDisplay>><<shopCustomColorsDisplay>><</replace>>
	<<replace #customColorBars>><<shopCustomColorsBars>><</replace>>
<<elseif $customColors.action is "delete">>
	<<set _newPresets to {}>>
	<<for _i to 0; _i lt _presets.length;_i++>>
		<<if _presets[_i] isnot _preset>>
			<<set _newPresets[_presets[_i]] to clone($customColors.presets[_presets[_i]])>>
		<</if>>
	<</for>>
	<<set $customColors.presets to clone(_newPresets)>>
	<<replace #ColorsPresets>><<shopCustomColorsPresets>><</replace>>
<</if>>
<</widget>>

/*Args: slots used in an array*/
<<widget "shopBuyItemStatus">>
<<if $args[0]>>
	<<if $wardrobes.shopReturn is "wardrobe" or $wardrobes[$wardrobes.shopReturn] is undefined>>
		<<set _returnWardrobe to $wardrobe>>
	<<else>>
		<<set _returnWardrobe to $wardrobes[$wardrobes.shopReturn]>>
	<</if>>
	<<set _undamagedCount to 0>>
	<<set _damagedCount to 0>>
	<<set _space to _returnWardrobe.space>>
	<<set _spaceLeft to clone(_space)>>
	<<for _i to 0; _i lt $args[0].length; _i++>>
		<<if _i is 0>>
			<<for _j to 0; _j lt _returnWardrobe[$args[0][0]].length; _j++>>
				<<if _returnWardrobe[$args[0][0]][_j].name is _temp_choice.name>>
					<<set _undamagedCount++>>
					<<if _returnWardrobe[$args[0][0]][_j].outfitPrimary isnot undefined>>
						<<for _valueShop range _returnWardrobe[$args[0][0]][_j].outfitPrimary>>
							<<if _valueShop is "broken">>
								<<set _damagedCount++>>
								<<set _undamagedCount-->>
								<<break>>
							<</if>>
						<</for>>
					<<else>>
						<<set _damagedCount to -1>>
					<</if>>
				<</if>>
			<</for>>
		<</if>>
		<<if _space - _returnWardrobe[$args[0][_i]].length lt _spaceLeft>>
			<<set _spaceLeft to _space - _returnWardrobe[$args[0][_i]].length>>
		<</if>>
		Wardrobe <<print ($args[0][_i]).replace("_"," ")>> slots used: <<print _returnWardrobe[$args[0][_i]].length>> / _space.

	<</for>>
	<<if _undamagedCount gt 0>>
		You own _undamagedCount of this item<<if _damagedCount gte 0>> unbroken<</if>>.

	<</if>>
	<<if _damagedCount gt 0>>
		You own _damagedCount of this item that have been broken in some way.

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

/*Args: slot, itemName, outfit*/
<<widget "shopFullImage">>
<<if $args[0] and $args[1] isnot undefined>>
	<<set _shopFullImageVar to [$args[0], $args[1]]>>
	<a value="Refresh" onclick="Wikifier.wikifyEval('<<replace #shopFullImage>><<shopFullImage $clothingShopSlot $clothes_choice>><</replace>>');">Refresh

			<<set _customPrimary to customColour($customColors.color.primary, $customColors.saturation.primary, $customColors.brightness.primary, $customColors.contrast.primary, $customColors.sepia.primary)>>
			<<set _customSecondary to customColour($customColors.color.secondary, $customColors.saturation.secondary, $customColors.brightness.secondary, $customColors.contrast.secondary, $customColors.sepia.secondary)>>
			<<shopFullImageSlot $args[0] $args[1]>>

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

<<widget "shopFullImageSlot">>
<<if $args[0] and $args[1]>>
	<<set $_slot to $args[0]>>
	<<set $_item to $args[1]>>
	<<if setup.clothes[$_slot][$_item].mainImage isnot 0>>
		<<shopFullImagePart $_slot $_item "full" $colouraction _customPrimary>>
	<</if>>
	<<if setup.clothes[$_slot][$_item].breast_img is 1>>
		<<switch $player.perceived_breastsize>>
			<<case 12>>
				<<set _breastSize to 6>>
			<<case 8 9 10 11>>
				<<set _breastSize to 5>>
			<<case 6 7>>
				<<set _breastSize to 4>>
			<<case 4 5>>
				<<set _breastSize to 3>>
			<<case 3>>
				<<set _breastSize to 2>>
			<<case 0 1 2>>
				<<set _breastSize to 1>>
		<</switch>>
		<<shopFullImagePart $_slot $_item `(_breastSize - 1)` $colouraction _customPrimary>>
	<</if>>
	<<if setup.clothes[$_slot][$_item].sleeve_img is 1>>
		<<shopFullImagePart $_slot $_item "right" $colouraction _customPrimary>>
		<<shopFullImagePart $_slot $_item "left" $colouraction _customPrimary>>
	<</if>>
	<<if setup.clothes[$_slot][$_item].leftImage is 1>>
		<<shopFullImagePart $_slot $_item "left" $colouraction _customPrimary>>
	<</if>>
	<<if setup.clothes[$_slot][$_item].rightImage is 1>>
		<<shopFullImagePart $_slot $_item "right" $colouraction _customPrimary>>
	<</if>>
	<<if setup.clothes[$_slot][$_item].accessory is 1>>
		<<shopFullImagePart $_slot $_item "acc" $accessorycolouraction _customSecondary>>
	<</if>>
	<<set $_outfitPrimary to setup.clothes[$_slot][$_item].outfitPrimary>>
	<<if $_outfitPrimary isnot undefined>>
		<<for $_label, $_value range $_outfitPrimary>>
			<<for $_i to 0; $_i < setup.clothes[$_label].length; $_i++>>
				<<if setup.clothes[$_label][$_i].name is $_value>>
					<<shopFullImageSlot $_label $_i>>
					<<break>>
				<</if>>
			<</for>>
		<</for>>
	<</if>>
<</if>>
<</widget>>

/*$args[0] - slot, $args[1] - itemNo, $args[2] - file, $args[3] - colour, $args[4] - custom colour*/
<<widget "shopFullImagePart">>

<</widget>>

<<widget "shopFullImageToggle">>
<<toggleclass #shopFullImage "hidden">>
<</widget>>

<<widget "specialClothesSetup">>
<<if $specialClothes is undefined>>
	<<set $specialClothes to {
		"witchdress":"locked",
		"christmasdress":"locked",
		"serafuku":"locked",
		"vampirejacket":"locked",
		"slutshirt":"locked",
		"christmasshirt":"locked",
		"bellydancer'stop":"locked",
		"christmastrousers":"locked",
		"bellydancer'sbottoms":"locked",
		"loincloth":"locked",
		"witchhat":"locked",
		"christmashat":"locked",
		"chefhat":"locked",
		"fedora":"locked",
		"holypendant":"locked",
		"darkpendant":"locked",
		"stonependant":"locked",
		"christmaslegwarmers":"locked",
		"witchshoes":"locked",
		"mummyfacewrap":"locked",
		"mummytop":"locked",
		"mummyskirt":"locked",
		"catsuit":"locked",
		"holystole":"locked",
		"minisnowman":"locked"
	}>>
<</if>>
<<if $specialClothes.cowbell is undefined>>
	<<set $specialClothes.cowbell to "locked">>
<</if>>
<<if $specialClothes.featheredhairclip is undefined>>
	<<set $specialClothes.featheredhairclip to "locked">>
<</if>>
<<if $specialClothes.catsuit is undefined>>
	<<set $specialClothes.catsuit to "locked">>
<</if>>
<<if $specialClothes.holystole is undefined>>
	<<set $specialClothes.holystole to "locked">>
<</if>>
<<if $specialClothes.minisnowman is undefined>>
	<<set $specialClothes.minisnowman to "locked">>
<</if>>
<<if $specialClothes.cowbra is undefined>>
	<<set $specialClothes.cowbra to "locked">>
	<<set $specialClothes.cowpanties to "locked">>
	<<set $specialClothes.cowsocks to "locked">>
	<<set $specialClothes.cowsleeves to "locked">>
<</if>>
<</widget>>

<<widget "specialClothesUpdate">>
<<if $headdrive is 1>>
	<<set $specialClothes["serafuku"] to "unlocked">>
<</if>>
<<if $undergroundescape isnot undefined>>
	<<set $specialClothes["slutshirt"] to "unlocked">>
<</if>>
<<if $days gte 47>>
	<<set $specialClothes["witchdress"] to "unlocked">>
	<<set $specialClothes["vampirejacket"] to "unlocked">>
	<<set $specialClothes["witchhat"] to "unlocked">>
	<<set $specialClothes["witchshoes"] to "unlocked">>
	<<set $specialClothes["mummyfacewrap"] to "unlocked">>
	<<set $specialClothes["mummytop"] to "unlocked">>
	<<set $specialClothes["mummyskirt"] to "unlocked">>
<</if>>
<<if $days gte 102>>
	<<set $specialClothes["christmasdress"] to "unlocked">>
	<<set $specialClothes["christmasshirt"] to "unlocked">>
	<<set $specialClothes["christmastrousers"] to "unlocked">>
	<<set $specialClothes["christmashat"] to "unlocked">>
	<<set $specialClothes["christmaslegwarmers"] to "unlocked">>
	<<set $specialClothes["minisnowman"] to "unlocked">>
<</if>>
<<if $brothelshowdata.intro>>
	<<set $specialClothes["bellydancer'stop"] to "unlocked">>
	<<set $specialClothes["bellydancer'sbottoms"] to "unlocked">>
<</if>>
<<if $syndromeeden is 1 or $syndromewolves is 1>>
	<<set $specialClothes["loincloth"] to "unlocked">>
<</if>>
<<if $chef_state gte 9>>
	<<set $specialClothes["chefhat"] to "unlocked">>
<</if>>
<<if $fedora_unlock is 1>>
	<<set $specialClothes["fedora"] to "unlocked">>
<</if>>
<<if $soup_kitchen_known is 1>>
	<<set $specialClothes["holypendant"] to "unlocked">>
<</if>>
<<if $loft_known is 1>>
	<<set $specialClothes["darkpendant"] to "unlocked">>
<</if>>
<<if $stone_pendant_found is 1>>
	<<set $specialClothes["stonependant"] to "unlocked">>
<</if>>
<<if $livestock_intro isnot undefined>>
	<<set $specialClothes["cowbell"] to "unlocked">>
	<<set $specialClothes["cowbra"] to "unlocked">>
	<<set $specialClothes["cowpanties"] to "unlocked">>
	<<set $specialClothes["cowsocks"] to "unlocked">>
	<<set $specialClothes["cowsleeves"] to "unlocked">>
<</if>>
<<if $syndromebird is 1>>
	<<set $specialClothes["featheredhairclip"] to "unlocked">>
<</if>>
<<if $catsuit_found is true>>
	<<set $specialClothes["catsuit"] to "unlocked">>
<</if>>
<<if $grace gte 100>>
	<<set $specialClothes["holystole"] to "unlocked">>
<</if>>
<<set _count to 0>>
<<for $_label, $_value range $specialClothes>>
	<<if $_value is "unlocked">>
		<<set _count++>>
	<</if>>
<</for>>
<<if _count is Object.keys($specialClothes).length>>
	<<earnFeat "Curious Attire">>
<</if>>
/*Fix for previous save issue when starting without the specialClothing boost, should not be adjusted unless a similar issue occurs*/
<<if $featsBoosts is undefined>>
<<elseif $featsBoosts.upgrades.specialClothing is 40>>
	<<set $specialClothes["serafuku"] to "unlocked">>
	<<set $specialClothes["slutshirt"] to "unlocked">>
	<<set $specialClothes["witchdress"] to "unlocked">>
	<<set $specialClothes["vampirejacket"] to "unlocked">>
	<<set $specialClothes["witchhat"] to "unlocked">>
	<<set $specialClothes["witchshoes"] to "unlocked">>
	<<set $specialClothes["mummyfacewrap"] to "unlocked">>
	<<set $specialClothes["mummytop"] to "unlocked">>
	<<set $specialClothes["mummyskirt"] to "unlocked">>
	<<set $specialClothes["christmasdress"] to "unlocked">>
	<<set $specialClothes["christmasshirt"] to "unlocked">>
	<<set $specialClothes["christmastrousers"] to "unlocked">>
	<<set $specialClothes["christmashat"] to "unlocked">>
	<<set $specialClothes["christmaslegwarmers"] to "unlocked">>
	<<set $specialClothes["bellydancer'stop"] to "unlocked">>
	<<set $specialClothes["bellydancer'sbottoms"] to "unlocked">>
	<<set $specialClothes["loincloth"] to "unlocked">>
	<<set $specialClothes["chefhat"] to "unlocked">>
	<<set $specialClothes["fedora"] to "unlocked">>
	<<set $specialClothes["holypendant"] to "unlocked">>
	<<set $specialClothes["darkpendant"] to "unlocked">>
	<<set $specialClothes["stonependant"] to "unlocked">>
	<<set $specialClothes["cowbell"] to "unlocked">>
	<<set $specialClothes["cowbra"] to "unlocked">>
	<<set $specialClothes["cowpanties"] to "unlocked">>
	<<set $specialClothes["cowsocks"] to "unlocked">>
	<<set $specialClothes["cowsleeves"] to "unlocked">>
	<<set $specialClothes["featheredhairclip"] to "unlocked">>
	<<set $specialClothes["catsuit"] to "unlocked">>
	<<set $specialClothes["holystole"] to "unlocked">>
	<<set $specialClothes["minisnowman"] to "unlocked">>
<</if>>

<</widget>>

<<widget "specialClothesHint">>
<<if _specialClothesHint is undefined>>
	<<set _specialClothesHint to {
		"witchdress":"In stock from the 21st of October.",
		"christmasdress":"In stock from the 15th of December.",
		"serafuku":"Discover the headteacher's secret.",
		"vampirejacket":"In stock from the 21st of October.",
		"slutshirt":"Survive slavery in an underground brothel.",
		"christmasshirt":"In stock from the 15th of December.",
		"bellydancer'stop":"Be offered the star role in a show at the brothel.",
		"christmastrousers":"In stock from the 15th of December.",
		"bellydancer'sbottoms":"Be offered the star role in a show at the brothel.",
		"loincloth":"Befriend a lonely hunter, or join a pack of wolves.",
		"witchhat":"In stock from the 21st of October.",
		"christmashat":"In stock from the 15th of December.",
		"chefhat":"Become famous for your cream buns.",
		"fedora":"Eavesdrop as a bartender and learn about a criminal undertaking.",
		"holypendant":"Discover the soup kitchen.",
		"darkpendant":"Discover Bailey's fear.",
		"stonependant":"Find beneath a loose stone at the temple.",
		"cowbell":"Become livestock.",
		"cowbra":"Become livestock.",
		"cowpanties":"Become livestock.",
		"cowsocks":"Become livestock.",
		"cowsleeves":"Become livestock.",
		"christmaslegwarmers":"In stock from the 15th of December.",
		"witchshoes":"In stock from the 21st of October.",
		"mummyfacewrap":"In stock from the 21st of October.",
		"mummytop":"In stock from the 21st of October.",
		"mummyskirt":"In stock from the 21st of October.",
		"featheredhairclip":"Romance an avian.",
		"catsuit":"Pillage a shipment.",
		"holystole":"Requires sufficient devotion.",
		"minisnowman":"In stock from the 15th of December."
	}>>
<</if>>
<</widget>>

<<widget "updatesidebarimg">>
	<<if $images is 1>>
		<<if $passage is "Start">>
			<<startingPlayerImageUpdate>>
		<<else>>
			<<replace "#sidebar-img-container">><><</replace>>
		<</if>>
	<</if>>
<</widget>>


code:
:: Spa
<<set $outside to 0>><<set $location to "spa">><<effects>>

<<if !$spa_event>>
	<<spa_event_select>>
<</if>>

You are in the spa on Danube Street. Large windows open onto a natural spring, and a corridor to the side leads to other facilities.
A sign reads: "Tanning beds available.
<<if $season is "summer">>
	£10
<<elseif $season is "winter">>
	£60
<<else>>
	£25
<</if>>
per session. Price may change with the season."

<<if $openinghours is 1>>
	<<if $spa_event is "party">>
		The spring is packed with bodies, and loud music plays. Someone's hired the venue for a party.
	<<else>>
		Patrons relax in and around the many pools.
	<</if>>
<<else>>
	You can hear running water, but the establishment is otherwise quiet.
<</if>>

<<if $stress gte $stressmax>>

	<<passoutshop>>
<<else>>
	<<if $arousal gte $arousalmax>>
		<<orgasmLocation "spa">>
	<</if>>
	<<if $hour is $closinghour>>
		It's closing time. The receptionist is herding everyone outside.<<if $exposed gte 1>>Panic swells within you as you realise how exposed you'll be should you be found in this state of dress.<</if>>

	<<elseif $openinghours is 0>>
		You are alone in the darkness.

	<<elseif $exposed gte 1>>
		<<if $uncomfortable.nude is false>>
		You hide in a cupboard. The thought of being caught is thrilling, but you decide it would be wiser to stay put.
		<<else>>
		You hide in a cupboard to protect your dignity.
		<</if>>

	<</if>>
	<<if $openinghours is 1 and $exposed lt 1>>
		<<generate1>><<person1>>
		<<if $spa_job gte 1>>
			<<link [[Work as a masseur (0:50)|Spa Work Start]]>><<endevent>><<set $money += 1000>><</link>>

		<<else>>
			The receptionist, a <<person>>, looks up from <<his>> desk, and curls <<his>> nose. "Make it quick," <<he>> says. "Our clientele don't mix with riff-raff off the street."

			<<link [[Ask for work|Spa Work Ask]]>><</link>>

		<</if>>
		<<if $season is "spring" or $season is "autumn">>
			<<if $money gte 2500>>
				<<link [[Tanning salon (£25 1:00)|Spa Tan]]>><<set $money -= 2500>><</link>><<lstress>><<gggtanned>>

			<</if>>
		<<elseif $season is "winter">>
			<<if $money gte 6000>>
				<<link [[Tanning salon (£60 1:00)|Spa Tan]]>><<set $money -= 6000>><</link>><<lstress>><<gggtanned>>

			<</if>>
		<<else>>
			<<if $money gte 1000>>
				<<link [[Tanning salon (£10 1:00)|Spa Tan]]>><<set $money -= 1000>><</link>><<lstress>><<gggtanned>>

			<</if>>
		<</if>>
	<</if>>
	<<if $openinghours is 0 and $hour isnot $closinghour and $spatheft isnot 1>>
		<<link [[Examine the cash register|Spa Register]]>><</link>>

	<</if>>

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

:: Spa Tan
<<effects>>

The <<person1>><<person>> sniffs, but takes your money without complaint.
<<endevent>>

You enter a small room dominated by a tanning bed. There's a large window, but it's already covered by a curtain.

<<if $worn.under_lower.name isnot "naked">>
	<<link [[Strip to your underwear|Spa Tan Underwear]]>><<stress -6>><<pass 60>><</link>>

<</if>>
<<link [[Strip naked|Spa Tan Naked]]>><<stress -6>><<pass 60>><</link>><<exhibitionist1>>

<<if $exhibitionism gte 75>>
	<<link [[Strip naked, and open the curtains|Spa Tan Curtains]]>><<stress -6>><<pass 60>><</link>><<exhibitionist5>>

<</if>>

:: Spa Tan Underwear
<<effects>>

<<upperstrip>>
<<lowerstrip>>
<<tanned 120 "tanLines">>

You leave your clothes in a neat pile, and climb onto the tanning bed, closing it after you.

Surrounded by a blue glow, you close your eyes and relax as the warmth seeps into your skin.

<<if $rng gte 91>>
	<<spa_tan_events>>
<<elseif $rng gte 81>>
	Your session ends before you know it, and the lights fade. You dozed off.<<ltiredness>><<tiredness -6>>

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<<else>>
	You relax until the session ends, and the lights fade.

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<</if>>

:: Spa Tan Naked
<<effects>>

<<clothesstrip>>
<<tanned 120>>
You strip naked, and leave your clothes in a neat pile.
<<exhibitionism1>>

Suitably unburdened, you climb onto the tanning bed, and close it after you.

Surrounded by a blue glow, you close your eyes and relax as the warmth seeps into your skin.

<<if $rng gte 91>>
	<<spa_tan_events>>
<<elseif $rng gte 81>>
	Your session ends before you know it, and the lights fade. You dozed off.<<ltiredness>><<tiredness -6>>

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<<else>>
	You relax until the session ends, and the lights fade.

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<</if>>

:: Spa Tan Curtains
<<effects>>

<<generate1>><<person1>>
<<clothesstrip>>
<<tanned 120>>
<<if $spa_event is "party">>
	You pull open the curtains, revealing the party outside. The partiers are too busy dancing and drinking to pay you any attention. For now.

	<<flaunting>> you remove your clothes in plain view of anyone who cares to look. You hear an excited shout. A <<person>> in swimwear points at you, and you're soon the centre of attention. You climb onto the tanning bed, closing it after you.
<<else>>
	You pull open the curtains, revealing a couple of dozen patrons lounging in the pools outside. A <<person>> glances over, but that's all the attention you get. For now.

	<<flaunting>> you remove your clothes in plain view of anyone who cares to look. You feel eyes on you as you climb onto the tanning bed, closing it after you.
<</if>>
<<exhibitionism5>>

Surrounded by a blue glow, you feel your heart pump as the warmth seeps into your skin.

<<endevent>>
<<if $rng gte 81>>
	<<spa_tan_events>>
<<elseif $rng gte 71>>
	Your session ends before you know it, and the lights fade. You dozed off.<<ltiredness>><<tiredness -6>>

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<<else>>
	You relax until the session ends, and the lights fade.

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<</if>>

:: Spa Lock

<<set $outside to 0>><<effects>><<set $lock to 200>>
<<openinghours>>
<<if $skulduggery gte $lock>>
	The lock looks easy to pick.

	<<link [[Pick it (0:10)|Spa]]>><<pass 10>><<crimeup 1>><</link>><<crime>>

<<else>>
	The lock looks beyond your ability to pick.<<skulduggeryrequired>>

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

:: Spa Work Ask
<<effects>>

The <<person>> scoffs. "Let me make this clear," <<he>> says, pushing <<his>> spectacles up <<his>> nose.
<<if $beauty gte ($beautymax / 7) * 6>>
	<<spa_job_init>>
	"Our clientele expect-"

	<<He>> cuts off as <<he>> regards you, surprised by your beauty. "Well," <<he>> continues. "Exceptions can be made for particularly... talented individuals. We might have a place for you."

	<<He>> clears <<his>> throat. "Just do as the clients tell you. It's 50 minutes per session, but allow an hour. Pay is £10 per hour. Plus tips. You can work when you like. Any questions?"

	<<link [[Ask for advice|Spa Work Advice]]>><</link>>

	<<link [[No|Spa Work No]]>><</link>>

<<else>>
	"Our clientele expect a certain," <<he>> pauses. "Standard. You don't meet them. Good day."

	<<He>> might feel differently were you particularly beautiful.

	<<link [[Say you have skilled hands|Spa Work Hands]]>><</link>>

	<<link [[Leave|Danube Street]]>><<endevent>><</link>>

<</if>>

:: Spa Work Advice
<<effects>>

<<if $submissive gte 1150>>
	"C-can you give advice about how to be a masseur?" you ask.
<<elseif $submissive lte 850>>
	"Do I get any training?" you ask. "You haven't asked about my experience."
<<else>>
	"Do you have any tips for me?" you ask.
<</if>>

The <<person>> laughs. "No. As I said, just do as the client asks. You can start when you like." <<He>> turns back to <<his>> desk.

<<link [[Next|Spa]]>><<endevent>><</link>>

:: Spa Work No
<<effects>>

You shake your head. "Good," the <<person>> says. "You can start when you like." <<He>> turns back to <<his>> desk.

<<link [[Next|Spa]]>><<endevent>><</link>>

:: Spa Work Hands
<<effects>>

"Skilled hands?" the <<person>> asks. "We'll see." <<He>> reaches over the desk, grasps your hands in <<his>> own, and leans forward to observe them.

<<if $handskill gte 400>>
	<<spa_job_init>>
	<<He>> frowns. "Unexpected. Maybe there is a place for you." <<He>> pulls away.

	<<He>> clears <<his>> throat. "Just do as the clients tell you. It's 50 minutes per session, but allow an hour. Pay is £10 per hour. Plus tips. You can work when you like. Any questions?"

	<<link [[Ask for advice|Spa Work Advice]]>><</link>>

	<<link [[No|Spa Work No]]>><</link>>

<<else>>
	<<He>> releases <<his>> grasp with a disdainful sneer. "You're not suitable. Good day." <<He>> turns back to <<his>> desk.

	C Hand Skill or higher required.

	<<link [[Next|Spa]]>><<endevent>><</link>>

<</if>>

:: Spa Tan Chase
<<effects>>

<<generate1>><<person1>>
You tear around the corner, and see the culprit, a <<person>>, up ahead. You rush after <<him>>,

<<if $athleticsSuccess>>
	and manage to catch up. You dive and throw your arms around <<his>> waist, dragging <<him>> to the ground.

	It would seem <<he>> finds the situation awfully funny.

	<<if $leftarm isnot "bound" or $rightarm isnot "bound">>
		<<link [[Slap|Spa Tan Slap]]>><<def 1>><<trauma -6>><</link>><<ltrauma>>

	<</if>>
	<<link [[Turn the other cheek|Spa Tan Turn]]>><</link>>

<<else>>
	but <<he>> has too great a lead. <<He>> pushes through a pair of doors leading outside, and keeps going, hauling <<himself>> over the exterior wall.

	You come to a stop beside the doors. The pools are around a corner, so you don't think anyone would see you. The spa is raised above the surrounding terrain however, and following would be a one-way trip. This wall faces the forest.

	<<link [[Follow|Spa Tan Follow]]>><</link>>

	<<link [[Ask someone for help instead|Spa Tan Help]]>><<endevent>><</link>>

	<<set $skulduggerydifficulty to 500>>
	<<link [[Search for towels instead|Spa Tan Sneak]]>><<endevent>><</link>><<skulduggerydifficulty>>

<</if>>

:: Spa Tan Follow
<<effects>>

<<covered>> You glance left and right. You don't see anyone. You dart outside, and haul yourself over the wall. You land on grass, surrounded by trees.

You hear the snap of twigs straight ahead, and you follow. The trees grow dense. You can't run, but neither can your quarry.

You hear a scream. It came from up ahead.

<<if $awarelevel gte 2>>
	You emerge in a clearing, and find the <<person>> dangling limp in the air. A green tendril curls around <<his>> leg. A monstrous plant, oozing thick slime and standing almost as tall as the surrounding trees holds <<him>>. Other tentacles rise from the undergrowth. Your clothes lie discarded on the ground.
	<<if $awareness lt 400>>
		<<gawareness>><<awareness 1>>
	<</if>>
	<<gstress>><<stress 6>>

	<<link [[Grab your clothes and run|Spa Tan Grab]]>><</link>><<athleticsdifficulty 1 400>>

	<<link [[Leave your clothes and run|Spa Tan Leave]]>><</link>>

	<<link [[Rescue the thief|Spa Tan Rescue]]>><</link>><<athleticsdifficulty 300 1500>>

<<else>>
	You emerge in a clearing, and find the <<person>> lying on the dirt. <<Hes>> unconscious. Maybe <<he>> tripped.

	<<link [[Rob|Spa Tan Rob]]>><</link>><<crime>>

	<<link [[Just take your clothes|Spa Tan Clothes]]>><</link>>

<</if>>

:: Spa Tan Grab
<<effects>>
<<athleticsdifficulty 1 400 true>>
<<if $athleticsSuccess>>
	You retrieve your clothes, and escape between the trees before the monster reacts to you.

	<<clotheson>>
	You run until you reach the spa. The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

	<<endevent>>

	<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

<<else>>
	You try to retrieve your clothes, but trip when a hidden tentacle rises from the grass. It curls around your leg before you can recover, and hoists you into the air.<<gtrauma>><<gstress>><<gpain>><<trauma 6>><<stress 6>><<pain 4>>

	The monster carries you and the <<person>> closer. A maw tears through its side. It means to eat you.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

	<<link [[Next|Spa Tan Monks]]>><</link>>

<</if>>

:: Spa Tan Leave
<<effects>>

<<set $stealtextskip to 1>>
<<stealclothes>>

You turn and run. You keep running, until you arrive at the spa.

The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

<<endevent>>

<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

:: Spa Tan Rescue
<<effects>>

<<athleticsdifficulty 1 1500 true>>
<<if $athleticsSuccess>>
	You run toward the <<person>>, and jump. You grasp <<his>> limp arm just before the monster pulls it out of reach. The monster pulls you and the thief closer, and higher, until you're right above.

	You use your legs and one arm for purchase as you try to prise the <<person>> free. The tentacle's grip is firm, but not unyielding. You hear a rip. A maw tears open below. The monster means to eat you.

	<<link [[Next|Spa Tan Monks Success]]>><</link>>

<<else>>
	You run toward the <<person>>, and jump. The monster pulls the limp body out of reach. Your fingers brush <<his>> hand, and then you fall.<<gtrauma>><<gstress>><<gpain>><<trauma 6>><<stress 6>><<pain 4>>

	Another tentacle lay in wait beneath the grass. It curls around your ankle before you can recover, and hoists you into the air.

	The monster carries you and the <<person>> closer. A maw tears through its side. It means to eat you.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

	<<link [[Next|Spa Tan Monks]]>><</link>>

<</if>>

:: Spa Tan Monks
<<effects>>

<<generate2>><<generate3>><<generate4>><<generate5>><<generate6>>
You hear a sharp crack. Then another. Thin, black tendrils emerge from the trees, wrapping around the monster's tentacles. Figures emerge from the forest. They're dressed as <<monks_and_nuns>>, and each holds a whip in hand, now tensed against the creature's limbs.

You and the <<person>> are pulled closer to the ground by the newcomers' heaving. A <<person2>><<monk>> rushes forward, and strikes the tentacle with a staff. It releases your ankle, and you tumble to the ground.<<lstress>><<stress -6>>

With a frightening speed, the monster squirms away, disappearing between the trees. The <<monks_and_nuns>> give chase, aside from one, who kneels beside you.

<<person2>>
<<if $temple_rank is "monk" or $temple_rank is "priest">>
	"You should know better than to take on a beast like that alone," <<he>> says. <<He>> glances at the <<person1>><<person>>. "I'll see to <<him>>. Get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<<elseif $temple_rank is "initiate">>
	"You're a bit green to be witnessing this," <<he>> says. "Best not mention it to anyone." <<He>> glances at the <<person1>><<person>>. "I'll see to <<him>>. Get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<<else>>
	"It would be best if you kept what you saw here to yourself," <<he>> says. <<He>> glances at the <<person1>><<person>>. "I'll see to <<him>>. Get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<</if>>

<<clotheson>>

You return to the spa. The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

<<endevent>>

<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

:: Spa Tan Monks Success
<<effects>>

<<generate2>><<generate3>><<generate4>><<generate5>><<generate6>>
You hear a sharp crack. Then another. Thin, black tendrils emerge from the trees, wrapping around the monster's tentacles. Figures emerge from the forest. They're dressed as <<monks_and_nuns>>, and each holds a whip in hand, now tensed against the creature's limbs.

The tentacle holding the <<person>> loosens, and you're able to pry <<him>> free. A <<person2>><<monk>> rushes forward and catches <<person1>><<him>> while you make a deft landing on the grass.<<gcontrol>><<control 10>><<lstress>><<stress -6>>

Another <<person2>><<monk>> rushes by, a staff in both hands, and strikes the main body of the monster. It squirms away with a frightening speed, disappearing between the trees. The <<monks_and_nuns>> give chase, aside from the <<monk>> holding the <<person1>><<person>>.

<<if $temple_rank is "monk" or $temple_rank is "priest">>
	"That was daring of you," the <<person2>><<monk>> says. "But you shouldn't try to take on a beast like this alone. I'll see to the civilian. You get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<<elseif $temple_rank is "initiate">>
	"You're not ready for this," the <<person2>><<monk>> says. "But you handled yourself well. You might be ready soon. Still, best not mention it to anyone." <<He>> lays the <<person1>><<person>> on the grass. "I'll see to this one. You get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<<else>>
	"You weren't meant to see this," the <<person2>><<monk>> says. "But you handled yourself well. Have you considered joining the temple? We could use someone like you. Either way, keep what you saw here to yourself." <<He>> lays the <<person2>><<person>> on the grass. "I'll see to this one. Get dressed, and return to town." You'd forgotten how exposed you are. <<covered>>

<</if>>

<<clotheson>>

You return to the spa. The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

<<endevent>>

<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

:: Spa Tan Rob
<<effects>>

<<clotheson>>

You get dressed, then rifle through the <<persons>> pockets.

<<if $rng gte 99>>
	They're empty, but <<his>> watch looks valuable, if you could find a buyer.<<crimeup 1000>><<set $blackmoney += 1000>>
<<elseif $rng gte 81>>
	You find <<moneyGain 100 true true>> in cash.
<<elseif $rng gte 61>>
	You find <<moneyGain 50 true true>> in cash.
<<elseif $rng gte 41>>
	You find <<moneyGain 20 true true>> in cash.
<<elseif $rng gte 21>>
	You find <<moneyGain 10 true true>> in cash.
<<else>>
	You find <<moneyGain 5 true true>> in cash.
<</if>>

You return to the spa. The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

<<endevent>>

<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

:: Spa Tan Clothes
<<effects>>

<<clotheson>>
You get dressed, and return to the spa. The wall is too high to climb from this side. You walk around the perimeter. The trees thin, and you emerge on Danube Street.

<<endevent>>

<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

:: Spa Tan Slap
<<effects>>

You wipe away the <<persons>> smirk with a firm slap, then return to your room, covering your <<bottom>> with a hand.

<<clotheson>>
<<endevent>>

<<link [[Next|Spa]]>><</link>>

:: Spa Tan Turn
<<effects>>

You leave the <<person>> to <<his>> mirth, and return to your room, covering your <<bottom>> with a hand.

<<clotheson>>
<<endevent>>

<<link [[Next|Spa]]>><</link>>

:: Spa Tan Help
<<effects>>

<<set $stealtextskip to 1>>
<<stealclothes>>

<<covered>> You crouch and peek around the corner. There's no one around. <<tearful>> you creep down the hall. You hear voices up ahead.
<<generate1>><<generate2>><<person1>>
Two members of staff, a <<person>> and a <<person2>><<person>>, chat in a staff room.

<<if $submissive gte 1150>>
	"E-excuse me," you say, interrupting their conversation. "Someone took my clothes. Could you help?"
<<elseif $submissive lte 850>>
	"Hey," you say, interrupting their conversation. "A thief ran off with my clothes. Could you give me a hand?"
<<else>>
	"Hello," you say, interrupting their conversation. "Someone stole my clothes. Could you give me a hand?"
<</if>>

<<if $rng gte 51>>
	The pair pause for a moment, then laugh. "Hold tight," the <<person>> says. <<He>> doesn't even pretend <<hes>> not ogling as <<he>> passes by, returning a moment later with some towels. "All we got, sorry. We don't have a staff uniform or anything."

	You slip back to the tanning room, and tie a towel around your body.

	<<towelup>>

	<<link [[Next|Spa]]>><<endevent>><</link>>

<<else>>
	The pair pause for a moment, then share a look. "Sure thing," the <<person>> says. "I'll just get you something." <<He>> looks away as <<he>> approaches, but as <<he>> passes,  wraps a hand around your mouth.

	<<link [[Next|Spa Tan Rape]]>><<set $molestationstart to 1>><</link>>

<</if>>

:: Spa Tan Rape

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>>

	<<enable_rescue>><<set $leftarm to "grappled">><<set $rightarm to "grappled">><<hand_gag 0 left>><<set $NPCList[0].righthand to "arms">>
<</if>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Spa Tan Rape Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Spa Tan Rape Finish]]>><</link>><<nexttext>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<link [[Next|Spa Tan Rape Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Spa Tan Rape]]>><</link>><<nexttext>>
<</if>>

:: Spa Tan Rape Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	You're shoved to the ground. A moment later a towel lands on top of you. The staff room door clicks shut.

	<<tearful>> you tie the towel around your body.

	<<clothesontowel>>
	<<endcombat>>
	<<link [[Next|Spa]]>><</link>>

<<elseif $enemyhealth lte 0>>
	The <<person1>><<person>> staggers backwards, loses <<his>> footing, and smashes through a glass table. The noise attracts attention. <<generate3>>A <<person3>><<person>> arrives on the scene, <<his>> eyes flicking over the <<person1>><<personsimple>> lying on the floor, then over your <<nudity>>.

	<<person3>><<He>> seems lost for words.

	<<link [[Say you were attacked|Spa Tan Rape Attacked]]>><<stress 6>><<trauma -6>><</link>><<gstress>><<ltrauma>>

	<<link [[Say the staff were helping you get a towel, but tripped|Spa Tan Rape Tripped]]>><><</link>>

<<else>>
	<<set $rescued += 1>>
	Your cry attracts attention. <<generate3>>A <<person3>><<person>> arrives on the scene, <<his>> eyes flicking over the <<group>>, then over your <<nudity>>.

	<<person3>><<He>> seems lost for words.

	<<link [[Say you were attacked|Spa Tan Rape Attacked]]>><<stress 6>><<trauma -6>><</link>><<gstress>><<ltrauma>>

	<<link [[Say the staff were helping you get a towel, but tripped|Spa Tan Rape Tripped]]>><><</link>>

<</if>>

:: Spa Tan Rape Attacked
<<effects>>

You tell the <<person3>><<person>> what happened. Turns out <<hes>> the pair's superior. They deny any wrongdoing, but the <<person>> doesn't believe it. This is not, apparently, the first incident.

You walk away with a new set of clothes, a refund, and a fearful request that you don't tell anyone what happened here.

<<if $worn.upper.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<upperwear 4>>
	<<else>>
		<<upperwear 1>>
	<</if>>
<</if>>
<<if $worn.lower.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<lowerwear 5>>
	<<else>>

	<</if>>
<</if>>
<<if $worn.under_upper.name is "naked">>
	<<if $player.gender_appearance is "m">>

	<<else>>
		<<underupperwear 12>>
	<</if>>
<</if>>
<<if $worn.under_lower.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<underlowerwear 4>>
	<<else>>
		<<underlowerwear 1>>
	<</if>>
<</if>>

<<if $season is "summer">>
	<<set $money += 1000>>
<<elseif $season is "winter">>
	<<set $money += 6000>>
<<else>>
	<<set $money += 2500>>
<</if>>

<<endcombat>>

<<link [[Next|Spa]]>><</link>>

:: Spa Tan Rape Tripped
<<effects>>

The <<person3>><<person>> seems relieved, though not entirely convinced. <<He>> apologises for your lost clothing, and give you some spares.

<<if $worn.upper.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<upperwear 4>>
	<<else>>
		<<upperwear 1>>
	<</if>>
<</if>>
<<if $worn.lower.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<lowerwear 5>>
	<<else>>

	<</if>>
<</if>>
<<if $worn.under_upper.name is "naked">>
	<<if $player.gender_appearance is "m">>

	<<else>>
		<<underupperwear 12>>
	<</if>>
<</if>>
<<if $worn.under_lower.name is "naked">>
	<<if $player.gender_appearance is "m">>
		<<underlowerwear 4>>
	<<else>>
		<<underlowerwear 1>>
	<</if>>
<</if>>

<<endcombat>>

<<link [[Next|Spa]]>><</link>>

:: Spa Tan Sneak
<<effects>>

<<set $stealtextskip to 1>>
<<stealclothes>>

You crouch and peek around the door. There's no one around. You sneak through the building. The other rooms are occupied, but one of the doors is ajar. You enter. You see a shape lying in the tanning bed. There's a towel on a rack beside it.

<<skulduggerycheck>>
<<if $skulduggerysuccess is 1>>

	You lift the towel from the rack, and sneak away without being noticed.

	<<if $skulduggery lte ($skulduggerydifficulty + 100)>>
		<<skulduggeryskilluse>>
	<<else>>
		That was too easy. You didn't learn anything.

	<</if>>

	<<link [[Next|Spa]]>><<towelup>><</link>>

<<else>>
	<<generate1>><<person1>>As you lift the towel, a hand emerges from the bed and grasps your mouth. "Trying to steal from me?" the <<person>> says as <<he>> climbs naked from the bed. "I'll teach you a lesson."

	<<He>> bends you over <<his>> knees.

	<<if $skulduggery lte ($skulduggerydifficulty + 100)>>
		<<skulduggeryskilluse>>
	<<else>>
		That was too easy. You didn't learn anything.

	<</if>>

	<<link [[Next|Spa Tan Spank]]>><<set $molestationstart to 1>><</link>>

<</if>>

:: Spa Tan Spank

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>>

	<<enable_rescue>>
	<<npcspankgag>>
	<<npcexpose>>
<</if>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Spa Tan Spank Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Spa Tan Spank Finish]]>><</link>><<nexttext>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<link [[Next|Spa Tan Spank Finish]]>><</link>><<nexttext>>
<<elseif $pain gte 100 and $willpowerpain is 0>>
	<<link [[Next|Spa Tan Spank Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Spa Tan Spank]]>><</link>><<nexttext>>
<</if>>

:: Spa Tan Spank Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	The <<person>> lies back on the bed, exhausted. You snatch the towel. <<tearful>> you run.

	<<clothesontowel>>
	<<endcombat>>
	<<link [[Next|Spa]]>><</link>>

<<elseif $enemyhealth lte 0>>
	You shove the <<person>> back on <<his>> bed. You snatch the towel. <<tearful>> you run.

	<<clothesontowel>>
	<<endcombat>>
	<<link [[Next|Spa]]>><</link>>

<<elseif $pain gte 100 and $willpowerpain is 0>>
	"Let that be a lesson to you," the <<person>> says, giving your <<bottom>> a final smack before grasping your arm and pushing you to the door.

	<<He>> keeps going, marching your exposed body down the hall. You're too hurt to resist.

	<<He>> shoves you through another door, this one leading outside. There's no one around, but the pools are just around the corner. <<He>> doesn't take you that way however. Instead, <<he>> grasps your thighs, and hauls you up and over the exterior wall.

	You land on grass, surrounded by trees. You look up. The wall is too high to climb from this side. "Good luck getting home," the <<person1>><<person>> laughs.<<gpain>><<pain 4>>

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Forest]]>><<set $forest to 0>><<set $eventskip to 1>><</link>>

<<else>>
	<<set $rescued += 1>>
	Your cry attracts attention. <<generate2>>A <<person2>><<person>> arrives on the scene, <<his>> eyes taking in the <<person1>><<person>>, and your pained expression.

	<<person2>><<He>> seems lost for words. The <<person1>><<person>> releases you, and tries to stammer an explanation. <<He>> doesn't stop you covering with the towel, or leaving the room.

	<<clothesontowel>>
	<<endcombat>>

	<<link [[Next|Spa]]>><</link>>

<</if>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Spa [widget]
<<widget "spa_actions">>

How do you want to behave?

<<link [[Cute|Spa Work Cute]]>><<set $spa.behaviour to "cute">><</link>>

<<link [[Sophisticated|Spa Work Sophisticated]]>><<set $spa.behaviour to "sophisticated">><</link>>

<<link [[Alluring|Spa Work Alluring]]>><<set $spa.behaviour to "alluring">><</link>><<promiscuous1>>

<</widget>>

<<widget "spa_work">>

<<spa_init>>
<<generate1>><<person1>>
A <<person>> enters,
<<if $pronoun is "m">>
	wearing a towel around <<his>> waist.
<<else>>
	wearing a towel around <<his>> body.
<</if>>
<<set $rng to random(1, 5)>>
<<switch $rng>>
<<case 1>>
	<<set $spa.personality to "hesitant">>
	"Hello," <<he>> says. "I've not done this before. Do I just lie down?"

<<case 2>>
	<<set $spa.personality to "tired">>
	<<He>> pulls off <<his>> towel and lies down with barely a glance in your direction.
	<<if $awareness lte 100>>
		<<awareness 1>><<gawareness>>
	<</if>>
	<<if $purity gte 990>>
		<<gstress>><<stress 6>>
	<</if>>

<<case 3>>
	<<set $spa.personality to "rude">>
	<<He>> eyes you up.
	<<if $beauty gte 8000>>
		"Nice," <<he>> says, before lying on the table.
	<<else>>
		"Was expecting better," <<he>> says, before lying on the table. "You better be good."<<gstress>><<stress 6>>
	<</if>>

<<case 4>>
	<<set $spa.personality to "lewd">>
	"You're a treat," <<he>> says, leering at your body. "How about I lose the towel." <<He>> lets it drop to the floor, and puts <<his>> hands on <<his>> hips. "Like what you see?"
	<<if $awareness lte 100>>
		<<awareness 1>><<gawareness>>
	<</if>>
	<<if $purity gte 990>>
		<<gstress>><<stress 6>>
	<</if>>

	<<He>> laughs, and lies on the table.

<<case 5>>
	<<set $spa.personality to "polite">>
	<<He>> nods at you, and lies on the table.

<</switch>>
<<spa_actions>>
<</widget>>

<<widget "spa_init">>
<<set $spa to {}>>
<<set $spa.behaviour to "cute">>
<</widget>>

<<widget "spa_end">>
<<unset $spa>>
<<set $masseur_stat += 1>>
<<famesocial 1>>
<<towelup>>
<<endevent>>
<<effects>>
<<if $openinghours is 1>>
	<<link [[Next customer (0:50)|Spa Work]]>><</link>>

	<<link [[Leave|Danube Street]]>><<set $eventskip to 1>><</link>>

<<else>>
	The spa empties as the establishment closes for the night.

	<<link [[Next|Danube Street]]>><<set $eventskip to 1>><</link>>

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

<<widget "body_tip">>/*First arg: body part used. Second arg: $tipmod, or "add", relies on $tipmod being set previously if a string is used.*/
	<<if typeof $args[1] is "number">>
		<<set $tipmod to $args[1]>>
	<</if>>
	<<print '<<set $tipmod += (Math.trunc($' + $args[0] + 'skill / 100) / 10)>>'>>
	<<tipset>>
<</widget>>

<<widget "spa_breasts_strip">>
"Not sure why I asked," the <<person>> scoffs. <<He>> lunges for you,
<<dancedifficulty 1 1100 true>>
<<if $danceSuccess>>
	but you duck and twirl out of the way.

	<<link [[Slap|Spa Rude Slap]]>><<def 1>><<trauma -6>><<famescrap 1>><</link>><<ltrauma>>

	<<link [[Remain polite|Spa Rude Polite]]>><</link>>

<<else>>
	and grasps your $worn.upper.name.
	<<if $worn.upper.open is 1 or $worn.upper.set isnot $worn.lower.set or $worn.upper.integrity lte 20>>

		<<if $worn.under_upper.type.includes("naked")>>
			<<fameexhibitionism 1>>
			<<if $worn.upper.open is 1>>
				<<He>> tugs it down,
			<<elseif $worn.upper.integrity gt 20>>
				<<He>> pulls it up,
			<<else>>
				<<He>> tears it off your body,
				<<set $worn.upper.integrity -= 20>>
				<<integritycheck>><<exposure>>
			<</if>>
			revealing your <<breasts>>.<<ggtrauma>><<gstress>><<stress 6>><<trauma 12>>

			"Nice," <<he>> says, releasing you after having a good look. <<covered>> <<He>> turns and leaves the room.

			<<spa_end>>
		<<else>>
			<<if $worn.upper.open is 1>>
				<<He>> tugs it down,
			<<elseif $worn.upper.integrity gt 20>>
				<<He>> pulls it up,
			<<else>>
				<<He>> tears it off your body,
				<<set $worn.upper.integrity -= 20>>
				<<integritycheck>><<exposure>>
			<</if>>
			revealing your <<undertop>>.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

			<<link [[Next|Spa Rude Under Top]]>><</link>>

		<</if>>
	<<else>>
		<<He>> tries to tear it from your body, but only damages the fabric before you manage to twist away.
		<<set $worn.upper.integrity -= 20>>

		<<He>> looks set to try again, but another member of staff bangs on the door. "Everything okay in there?"

		"Yes," the <<person>> responds. "I'm just leaving." <<He>> shoots you a last look before exiting the room.

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

<<widget "spa_genitals_strip">>
"Not sure why I asked," the <<person>> scoffs. <<He>> lunges for you,
<<dancedifficulty 1 1100 true>>
<<if $danceSuccess>>
	but you duck and twirl out of the way.

	<<link [[Slap|Spa Rude Slap]]>><<def 1>><<trauma -6>><<famescrap 1>><</link>><<ltrauma>>

	<<link [[Remain polite|Spa Rude Polite]]>><</link>>

<<else>>
	and grasps your $worn.lower.name.
	<<if $worn.lower.outfitSecondary is undefined>>
		<<set _broken to true>>
	<<elseif $worn.lower.outfitSecondary[1] is "broken">>
		<<set _broken to true>>
	<</if>>
	<<if $worn.lower.open is 1 or _broken or $worn.lower.integrity lte 20>>

		<<if $worn.under_lower.type.includes("naked")>>
			<<fameexhibitionism 1>>
			<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
				<<He>> flips it up,
			<<elseif $worn.lower.integrity gt 20>>
				<<He>> tugs it down,
			<<else>>
				<<He>> tears it off your body,
				<<set $worn.lower.integrity -= 20>>
				<<integritycheck>>
			<</if>>
			revealing your <<genitals>>.<<ggtrauma>><<gstress>><<stress 6>><<trauma 12>>

			<<spa_genitals_reaction>>
			<<covered>> <<He>> turns and leaves the room.

			<<spa_end>>
		<<else>>
			<<if setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
				<<He>> flips it up,
			<<elseif $worn.lower.integrity gt 20>>
				<<He>> tugs it down,
			<<else>>
				<<He>> tears it off your body,
				<<set $worn.lower.integrity -= 20>>
				<<integritycheck>>
			<</if>>
			revealing your <<undies>>.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

			<<link [[Next|Spa Rude Under]]>><</link>>

		<</if>>
	<<else>>
		<<He>> tries to tear it from your body, but only damages the fabric before you manage to twist away.
		<<set $worn.lower.integrity -= 20>>

		<<He>> looks set to try again, but another member of staff bangs on the door. "Everything okay in there?"

		"Yes," the <<person>> responds. "I'm just leaving." <<He>> shoots you a last look before exiting the room.

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

<<widget "spa_genitals_reaction">>
<<if $player.gender_appearance is "m">>
	<<if $player.penisExist>>
		<<if $penissize gte 3>>
			"Damn <<girl>>," <<he>> says. "Why are you so bashful with a monster like that?" <<He>> releases you after having a good look.
		<<elseif $penissize lte 1>>
			"No wonder you're so bashful," <<he>> laughs, releasing you after having a good look.
		<<else>>
			"Nice," <<he>> says, releasing you after having a good look.
		<</if>>
	<<else>>
		<<He>> stares for a moment, dumbfounded.
		<<if random(1, 2) is 2>>
			"I'm more impressed than angry," <<he>> says, releasing you.
		<<else>>
			"That's a surprise," <<he>> says, releasing you.
		<</if>>
	<</if>>
<<else>>
	<<if $player.vaginaExist>>
		"Nice," <<he>> says, releasing you after having a good look.
	<<else>>
		<<He>> stares for a moment, dumbfounded.
		<<if random(1, 2) is 2>>
			"I'm more impressed than angry," <<he>> says, releasing you.
		<<else>>
			"That's a surprise," <<he>> says, releasing you.
		<</if>>
	<</if>>
<</if>>
<</widget>>

<<widget "spa_hand_failed">>

<<if $NPCList[0].penis isnot "none">>
	<<handejacstat>><<ejacstat>><<set $player.bodyliquid.leftarm.semen += 1>><<set $player.bodyliquid.rightarm.semen += 1>>
	<<His>> <<print $NPCList[0].penisdesc>> erupts over your hands while <<his>> body spasms and jerks.
<<else>>
	<<His>> body spasms and jerks.
<</if>>

<<He>> lies on the table for a few moments, gasping and resting an arm over <<his>> eyes. "Thanks," <<he>> manages. "Well earned."<<tipreceive>><<pass 50>>

<<He>> ties <<his>> towel around <<his>> waist, and walks from the room.

<<spa_end>>
<</widget>>

<<widget "spa_rape_failed">>
<<if $NPCList[0].penis isnot "none">>
	<<if $player.vaginaExist or $analdisable is "f">>
		<<He>> grasps your <<bottom>>, and tries to force <<his>> cock inside you.
	<<else>>
		<<He>> grasps your <<bottom>>
	<</if>>
<<else>>
	<<if $player.penisExist>>
		<<He>> grasps your <<bottom>>, and tries to force your <<penis>> inside <<him>>.
	<<else>>
		<<He>> grasps your <<bottom>>.
	<</if>>
<</if>>
<</widget>>

<<widget "spa_rob_options">>

You move your hands back up the <<persons>> back. <<He>> occasionally moans, but is otherwise quiet. Then <<he>> starts to snore.

<<if $skulduggery gte 100>>
	<<if $rng gte 51>>
		<<set $phase to 0>>
		You spy a gold <<if $pronoun is "f">>necklace<<else>>chain<</if>> around <<his>> neck.
	<<elseif $rng gte 2>>
		<<set $phase to 1>>
		You spy a gold ring on one of <<his>> fingers.
	<<else>>
		<<set $phase to 2>>
		You spy a nice watch around <<his>> wrist. It looks very valuable
	<</if>>

	<</if>>

<<link [[Keep working|Spa Tired Keep]]>><<handskill 5>><</link>><<ghandskill>>

<<link [[Take a break|Spa Tired Break]]>><<stress -6>><<tiredness -6>><</link>><<ltiredness>><<lstress>>

<<if $skulduggery gte 100>>
	<<set $skulduggerydifficulty to 500>>
	<<link [[Rob|Spa Tired Steal]]>><</link>><<skulduggerydifficulty>><<crime>>
<</if>>

<</widget>>

<<widget "spa_job_init">>
<<set $spa_job to 1>>
<<spa_event_select>>
<</widget>>

<<widget "spa_event_select">>
<<set _spa_event to random(1, 5)>>
<<if _spa_event is 5>>
	<<set $spa_event to "party">>
<<else>>
	<<set $spa_event to "normal">>
<</if>>
<</widget>>

<<widget "spa_tan_events">>
<<rngWraith 1>>
<<if _wraithEvent and $wraith and $wraith.state is "haunt">>
	The lights abruptly shut off, plunging you into total darkness. You try to force the bed open, but it remains fixed in place.

	You begin to feel deathly cold. You try to scream, but no noise comes out. You hear <<if $wraith.seen gte 3>>familiar <</if>>laughter in the distance. <<stress 12>><<trauma 4>><<ggstress>><<gtrauma>>

	The lights flicker back on, filling you with warmth and relief. You try to relax until the session ends, and the lights fade again.

	<<link [[Next|Spa]]>><<clotheson>><</link>>

<<else>>
	You hear the door open. You turn your head, and see a pair of legs rush in. They crouch a moment, then turn and leave the room.

	You push open the tanning bed. Your clothes are gone!<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

	<<link [[Chase the culprit|Spa Tan Chase]]>><</link>><<athleticsdifficulty 1 1400>>

	<<link [[Ask for help|Spa Tan Help]]>><</link>>

	<<set $skulduggerydifficulty to 500>>
	<<link [[Look for towels|Spa Tan Sneak]]>><</link>><<skulduggerydifficulty>>

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