code:
:: Wardrobe [nobr]
<<effects>>
You look in your wardrobe.

[[Close wardrobe|Bedroom]]

<<wardrobesystem "Wardrobe">>

:: Changing Room [nobr]
<<set $outside to 0>><<set $location to "beach">><<effects>>
You are in a small wooden changing room.

<<if $exposed lte 0>>
  [[Leave|Beach]]

<<else>>
  You can't go out like this!

<</if>>
<<wardrobesystem "Changing Room">>

:: Eden Wardrobe [nobr]
<<effects>>
You look through the cupboard containing your clothes. There's an old dressing screen for privacy.

<<if $exhibitionism lte 54>>
	<<if $exposed lte 0>>
	<<link [[Done|Eden Cabin]]>><<pass 1>><</link>>

	<<else>>
	You can't remain undressed like this!

	<</if>>
<<else>>
	<<if $exposed lte 1>>
	  [[Done|Eden Cabin]]

	<<else>>
	  You can't remain undressed like this!

	<</if>>
<</if>>
<<wardrobesystem "Eden Wardrobe">>

:: Strip Club Dressing Room [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>
You are in the strip club's dressing room. <<if $daystate isnot "day" and $daystate isnot "dawn">>There are a few mirrors, currently occupied by staff fixing their hair and makeup.<</if>>

<<if $exhibitionism lte 54>>
	<<if $exposed lte 0>>
	<<link [[Back to the club (0:01)|Strip Club]]>><<pass 1>><</link>>

	<<else>>
	You can't go out like this!

	<</if>>
<<elseif $exhibitionism gte 95>>
<<link [[Back to the club (0:01)|Strip Club]]>><<pass 1>><</link>>

<<else>>
	<<if $exposed lte 1>>
	<<link [[Back to the club (0:01)|Strip Club]]>><<pass 1>><</link>>

	<<else>>
	You can't go out like this!

	<</if>>
<</if>>
<<wardrobesystem "Strip Club Dressing Room">>

:: Brothel Dressing Room [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>
You are in the brothel's dressing room. There are a few mirrors, currently occupied by staff fixing their hair and makeup.

<<if $exhibitionism lte 54>>
	<<if $exposed lte 0>>
	<<link [[Back to the brothel (0:01)|Brothel]]>><<pass 1>><</link>>

	<<else>>
	You can't go out like this!

	<</if>>
<<elseif $exhibitionism gte 95>>
<<link [[Back to the brothel (0:01)|Brothel]]>><<pass 1>><</link>>

<<else>>
	<<if $exposed lte 1>>
	<<link [[Back to the brothel (0:01)|Brothel]]>><<pass 1>><</link>>

	<<else>>
	You can't go out like this!

	<</if>>
<</if>>
<<wardrobesystem "Brothel Dressing Room">>

:: Accessory Shop [nobr]
<<set $outside to 1>><<set $location to "forest">><<effects>>

You are in the accessory shop. The interior is dark and crowded by tall shelves, holding all manner of items. Most are useless knick-knacks, but some interest you.

''Head:''

Hairpin. Costs £10. Greatly accelerates hair growth.

<<if $money gte 1000>>
  <<link [[Buy hairpin|$passage]]>><<buyclothes "" "hairpin" "store">><</link>>
<<else>> You cannot afford it.
<</if>>

Beanie. Costs £70. Makes status rise faster.

<<if $headdrive isnot 1>>
  Locked. Discover the headteacher's secret.
<<elseif $money gte 7000>>
	<<link [[Buy beanie|$passage]]>><<buyclothes "" "beanie" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

''Face:''

Glasses. Costs £20. Makes studying easier, but other students might pick on you.

<<if $money gte 2000>>
	<<link [[Buy glasses|$passage]]>><<buyclothes "" "glasses" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

Cool Shades. Costs £150. Makes status rise faster.

<<if $cool gte 160>>
	Locked. Make your peers think you're cool.
<<elseif $money gte 15000>>
	<<link [[Buy cool shades|$passage]]>><<buyclothes "" "shades" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

''Socks/Legwear:''

Girl's gym socks. Costs £9. Just socks.

<<if $money gte 900>>
  <<link [[Buy girl's gym socks|$passage]]>><<buyclothes "pink" "gym socks" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

Boy's gym socks. Costs £9. Just socks.

<<if $money gte 900>>
  <<link [[Buy boy's gym socks|$passage]]>><<buyclothes "blue" "gym socks" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

Sheet stockings. Costs £22. Attractive and alluring.

<<if $moleststat lt 30>>
  Locked. Be molested thirty times.
<<elseif $money gte 2200>>
	<<link [[Buy sheer stockings|$passage]]>><<buyclothes "sheer" "stockings" "store">><</link>>
<<else>>
  You cannot afford it.
<</if>>

Fishnet stockings. Costs £22. Attractive and alluring.

<<if $prostitutionstat lt 10>>
	Locked. Whore yourself ten times.
<<elseif $money gte 2200>>
	<<link [[Buy fishnet stockings|$passage]]>><<buyclothes "fishnet" "stockings" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

''Shoes:''

Black shoes. Costs £30. Suitable for school.

<<if $money gte 3000>>
	<<link [[Buy black shoes|$passage]]>><<buyclothes "black" "shoes" "store">><</link>>
<<else>>
	You cannot afford it.
<</if>>

<<link [[Leave|Forest]]>><</link>>

:: Widgets Img [widget]
/* Generates "sprite" image on the top left of the screen. */
<<widget "img">><<nobr>>

/* Basic body parts. */

<<if $leftarm isnot "bound">>
  <<if $masturbationimages is 1>>
    <<switch $leftaction>>
    <<case "mpenisentrance">>

    <<case "mvaginaentrance" "mvagina" "mvaginatease">>

    <<case "manus" "manusentrance" "manusrub" "manustease" "manusprostate">>

    <<case "mpenisshaft" "mpenisglans">>

    <<case "mpenisglans">>

    <<case "mvaginaclit">>

    <</switch>>
  <<elseif $exhibitionism gte 95>>

  <<elseif $exhibitionism gte 55 and $exposed lte 1>>

  <<elseif $upperexposed gte 1 and $exposed gte 1>>

  <<else>>

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

<<if $rightarm isnot "bound">>
  <<if $masturbationimages is 1>>
    <<switch $rightaction>>
    <<case "mpenisentrance">>

    <<case "mvaginaentrance" "mvagina" "mvaginatease">>

    <<case "manus" "manusentrance" "manusrub" "manustease" "manusprostate">>

    <<case "mpenisshaft">>

    <<case "mpenisglans">>

    <<case "mvaginaclit">>

    <</switch>>
  <<elseif $exhibitionism gte 95>>

  <<elseif $exhibitionism gte 55 and $exposed lte 1>>

  <<elseif $lowerexposed gte 1 and $exposed gte 1>>

  <<else>>

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

/* Facial elements. */
<<if $pain gte 80>>

<<elseif $pain gte 60>>

<<elseif $pain gte 40>>

<<elseif $pain gte 20>>

<</if>>

<<if $arousal gte 8000>>

<<elseif $arousal gte 6000>>

<<elseif $arousal gte 4000>>

<<elseif $exposed gte 2>>

<<elseif $arousal gte 2000>>

<<elseif $exposed gte 1>>

<<elseif $arousal gte 100>>

<</if>>

<<if $pain gte 100>>

<</if>>

<<if $trauma gte $traumamax>>

<<elseif $orgasmdown gte 1>>

<<elseif $pain gte 80>>

<<elseif $pain gte 60>>

<<elseif $pain gte 40>>

<<elseif $pain gte 20>>

<<elseif $exposed is 2 and $exhibitionism lt 95>>

<<elseif $pain gte 1>>

<<elseif $exposed is 1 and $exhibitionism lt 55>>

<<elseif $combat is 1 and $consensual isnot 1>>

<<else>>

<</if>>

<<if $trauma gte $traumamax>>
  <<set _empty to 'empty.png">'>>
<<else>>
  <<set _empty to '.gif">'>>
<</if>>
<<print '>

<<if $pain gte 100>>

<</if>>

/* Fluid drip and animations. */
<<if $vaginasemen + $vaginagoo gte 5>>

<<elseif $vaginasemen + $vaginagoo gte 4>>

<<elseif $vaginasemen + $vaginagoo gte 3>>

<<elseif $vaginasemen + $vaginagoo gte 2>>

<<elseif $vaginasemen + $vaginagoo gte 1>>

<</if>>

<<if $anussemen + $anusgoo gte 5>>

<<elseif $anussemen + $anusgoo gte 4>>

<<elseif $anussemen + $anusgoo gte 3>>

<<elseif $anussemen + $anusgoo gte 2>>

<<elseif $anussemen + $anusgoo gte 1>>

<</if>>

<<if $mouthsemen + $mouthgoo gte 5>>

<<elseif $mouthsemen + $mouthgoo gte 4>>

<<elseif $mouthsemen + $mouthgoo gte 3>>

<<elseif $mouthsemen + $mouthgoo gte 2>>

<<elseif $mouthsemen + $mouthgoo gte 1>>

<</if>>

/* Transformaton elements. */
<<if $fallenangel gte 2>>

<</if>>

<<if $angel gte 4>>

<</if>>

<<if $angel gte 6>>

<</if>>

<<if $demon gte 2>>

<</if>>

<<if $demon gte 4>>

<</if>>

<<if $demon gte 6>>

<</if>>

<<if $wolfgirl gte 4>>
  <<print ''>>
  <<if $hirsutedisable is "f">>
    <<print ''>>
  <</if>>
<</if>>

<<if $wolfgirl gte 6>>
  <<print ''>>
<</if>>

/* Hair - including eyelashes and eyebrows. */
<<if $hairlength gte 900>>
  <<set _hairlength to "feet">>
<<elseif $hairlength gte 700>>
  <<set _hairlength to "thighs">>
<<elseif $hairlength gte 600>>
  <<set _hairlength to "navel">>
<<elseif $hairlength gte 400>>
  <<set _hairlength to "chest">>
<<elseif $hairlength gte 200>>
  <<set _hairlength to "shoulder">>
<<else>>
  <<set _hairlength to "short">>
<</if>>
<<switch _hairlength>>
<<case "feet" "thighs">>
  <<print ''>>
  <<print ''>>
<<case "navel" "chest" "shoulder" "short">>
  <<print ''>>
<</switch>>

<<print ''>>

<<if $trauma gte $traumamax>>
    <<print ''>>
<<elseif $pain gte 60>>
    <<print ''>>
<<elseif $pain gte 20>>
    <<print ''>>
<<else>>
    <<print ''>>
<</if>>

/* Addition of penis and parasites. */
<<if $penisexist is 1>>
	<<if $penilevirginity is 1>>

	<<else>>

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

<<if $chestparasite is 1>>

<</if>>

<<if $penisparasite is 1 and $exposed gte 2>>

<</if>>

<<if $clitparasite is 1 and $exposed gte 2>>

<</if>>

/* Calls seperate clothing functions. */
<<clothesimg>>
<<accessoryimg>>

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

:: Widgets Clothes Img [widget]
/* Handles calculation of integrity - [0] is clothes item, [1] is "Bottom" if item is a bottom or underbottom (helps handle two-part items). */
<<widget "calcintegrity">><<nobr>>
<<if $args[1] is "bottom">>
  <<set _integrity to $args[0].botintegrity>>
<<else>>
  <<set _integrity to $args[0].integrity>>
<</if>>
<<if _integrity lte ($args[0].integritymax / 10) *2>>
  <<set $temp to "4">>
<<elseif _integrity lte ($args[0].integritymax / 10) *5>>
  <<set $temp to "3">>
<<elseif _integrity lte ($args[0].integritymax / 10) *9>>
  <<set $temp to "2">>
<<else>>
  <<set $temp to "1">>
<</if>>

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

/* Handles images for clothes, shoes. */
<<widget "clothesimg">><<nobr>>
<<if $outertop is not 0 and $outertop.removed is false>>
  <<if $outertop.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $outertop>>
    <<print ''>>
  <</if>>
  <<if $outertop.sleeves is true>>
    <<if $rightarm is not "bound">>
      /*<<if $bottom.exposed gte 1 and $exposed gte 2 and $exhibitionism lt 95 or $bottom.exposed gte 1 and $exposed gte 1 and $exhibitionism lt 55>>*/
        <<print ''>>
      <<else>>
        <<print ''>>
      <</if>>
    <</if>>
    <<if $leftarm is not "bound">>
      <<if $outertop.exposed gte 1 and $exposed gte 2 and $exhibitionism lt 95 or $outertop.exposed gte 1 and $exposed gte 1 and $exhibitionism lt 55>>
      <<else>>
        <<print ''>>
      <</if>>
    <</if>>
  <</if>>
<</if>>

<<if $outerbottom is not 0 and $outerbottom.removed is false>>
  <<set $imgtemp to ".gif">>
  <<if $outerbottom.name is "school shorts">>
    <<set $imgtemp to ".png">>
  <</if>>
  <<if $outerbottom.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $outerbottom "outerbottom">>
    <<print ''>>
  <</if>>
<</if>>

<<if $top is not 0 and $top.removed is false>>
  <<if $top.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $top>>
    <<print ''>>
  <</if>>
  <<if $top.sleeves is true>>
    <<if $rightarm is not "bound">>
      <<if $bottom.exposed gte 1 and $exposed gte 2 and $exhibitionism lt 95 or $bottom.exposed gte 1 and $exposed gte 1 and $exhibitionism lt 55>>
        <<print ''>>
      <<else>>
        <<print ''>>
      <</if>>
    <</if>>
    <<if $leftarm is not "bound">>
      <<if $top.exposed gte 1 and $exposed gte 2 and $exhibitionism lt 95 or $top.exposed gte 1 and $exposed gte 1 and $exhibitionism lt 55>>
      <<else>>
        <<print ''>>
      <</if>>
    <</if>>
  <</if>>
<</if>>

<<if $bottom is not 0 and $bottom.removed is false>>
  <<set $imgtemp to ".gif">>
  <<if $bottom.name is "school shorts">>
    <<set $imgtemp to ".png">>
  <</if>>
  <<if $bottom.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $bottom "bottom">>
    <<print ''>>
  <</if>>
<</if>>

<<if $undertop is not 0 and $undertop.removed is false>>
  <<if $undertop.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $undertop>>
    <<print ''>>
  <</if>>
<</if>>

<<if $underbottom is not 0 and $underbottom.removed is false>>
  <<set $imgtemp to ".png">>
  <<if $underbottom.name is "bikini bottoms" or $underbottom.name is "plant skirt">>
    <<set $imgtemp to ".gif">>
  <</if>>
  <<if $underbottom.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $underbottom "bottom">>
    <<print ''>>
  <</if>>
<</if>>

<<if $legs is not 0 and $legs.removed is false>>
  <<if $legs.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $legs>>
    <<print ''>>
  <</if>>
<</if>>

<<if $feet is not 0 and $feet.removed is false>>
  <<if $feet.sameimage is true>>
    <<print ''>>
  <<else>>
    <<calcintegrity $feet>>
	<<print ''>>
  <</if>>
<</if>>

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

/* Handles images for all other accessories.  Note: Does not currently handle durability changes. */
<<widget "accessoryimg">><<nobr>>

<<if $underacc is not 0 and $underacc.removed is false>>
  <<print ''>>
<</if>>

<<if $neckacc is not 0 and $neckacc.removed is false>>
  <<print ''>>
<</if>>

<<if $headacc is not 0 and $headacc.removed is false>>
  <<set $imgtemp to ".png">>
  <<if $headacc.name is "hairpin">>
    <<set $imgtemp to ".gif">><</if>>
  <<print ''>>
<</if>>

<<if $faceacc is not 0 and $faceacc.removed is false>>
  <<set $imgtemp to ".png">>
  <<if $faceacc.name is "glasses">>
    <<set $imgtemp to ".gif">><</if>>
  <<print ''>>
<</if>>

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

:: Widgets Combat Clothes Img [widget]
<<widget "clothesidle">><<nobr>>

<<if $top>> <<set $top.state to "waist">> <</if>>
<<if $bottom>> <<set $bottom.state to "waist">> <</if>>
<<if $undertop>> <<set $undertop.state to "waist">> <</if>>
<<if $underbottom>> <<set $underbottom.state to "waist">> <</if>>

/* Tops */
<<if $top>>
  <<set _bound to "">> /* Only changes for shirt */
  <<if $top.id is $bottom.id and $bottom.skirt>> /* Intact dress? */
    <<set _toptype to "dress">>
    <<if $bottom.state is "waist">>
      <<if $bottom.skirtup>> <<set _state to "hips">>
      <<else>> <<set _state to "thighs">> <</if>>
    <</if>>
  <<else>> /* Other tops */
    <<set _toptype to "shirt">>
    <<if $leftarm is "bound" or $leftarm is "grappled">>
      <<set _bound to "bound">> <</if>>
  <</if>>
  <<if !_state>> <<set _state to $top.state>> <</if>>
  <<= ''>>
  <</if>><<unset _state>>

/* Bottoms */
<<if $bottom and _toptype isnot "dress">>
<<if $bottom.skirt>>
  <<set _bottype to "skirt">>
    <<if $bottom.state is "waist" and $bottom.skirtup>> <<set _state to "hips">> <</if>>
    <</if>>
  <<else>> <<set _bottype to "shorts">>
  <</if>>
  <<if !_state>> <<set _state to $bottom.state>> <</if>>
  <<= ''>>
<</if>><<unset _state>>

/* Underwear Tops */
<<if $undertop>>
  <<set _bound to "">>
  <<if $undertop.name is "bikini top">> <<set _toptype to "bikini top">>
  <<else>>
    <<set _toptype to "shirt">>
    <<if $leftarm is "bound" or $leftarm is "grappled">>
      <<set _bound to "bound">> <</if>>
  <</if>>
  <<if !_state>> <<set _state to $undertop.state>> <</if>>
  <<= ''>>
<</if>><<unset _state>>

/* Underwear Bottoms */
<<if $underbottom>>
  <<if $underbottom.name is "bikini bottoms">> <<set _bottype to "bikini bottoms">>
  <<else>> <<set _bottype to "panties">> <</if>>
  <<set _state to $underbottom.state>>
  <<= ''>>
<</if>><<unset _state>>

/* Accessories */
<<if $neckacc.name is "collar">>

<</if>>
<<if $underacc.name is "chastity belt">>

<</if>>

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

:: Widgets Text Related [widget]
/* Experimental description handling for clothing.  Used in clotheseffects, hope to use it in clothing caption as well. */
<<widget "an">><<nobr>>
<<set _an to AvsAn.query($args[0])>>
<<print _an.article + " " + $args[0]>>
<</nobr>><</widget>>

<<widget "describeclothes">><<nobr>>
<<compileclothesdescription $args[0]>>
<<print $tempstring>>
<</nobr>><</widget>>

<<widget "describeyourclothes">><<nobr>>
<<compileclothesdescription $args[0]>>
<<print "your " + $tempstring>>
<</nobr>><</widget>>

<<widget "describeaclothes">><<nobr>>
<<compileclothesdescription $args[0]>>
<<if _temp.plural>> <<set $tempstring to "pair of " + $tempstring>> <</if>>
<<an $tempstring>>
<</nobr>><</widget>>

<<widget "clothesare">><<nobr>>
<<if $args[0].plural>>$args[0].name are<<else>>$args[0].name is<</if>>
<</nobr>><</widget>>

<<widget "undiesstop">><<nobr>>
<<if $underbottom isnot 0>>
$underbottom.name.
<<else>>
<<genitalsstop>>
<</if>>
<</nobr>><</widget>>

<<widget "compileclothesdescription">><<nobr>>
<<set _temp to $args[0]>>
<<set _string to "">>
<<if _temp.onepiece and _temp.worn.length eq 1>>
  <<set _string += "half-destroyed ">>
<<elseif _temp.integrity and _temp.integrity lte (_temp.integritymax / 10) *2>>
    <<set _string += "tattered ">>
<<elseif _temp.botintegrity and _temp.botintegrity lte (_temp.integritymax / 10) *2>>
    <<set _string += "tattered ">>
<<elseif _temp.integrity and _temp.integrity lte (_temp.integritymax / 10) *5>>
    <<set _string += "torn ">>
<<elseif _temp.botintegrity and _temp.botintegrity lte (_temp.integritymax / 10) *5>>
    <<set _string += "torn ">>
<<elseif _temp.integrity and _temp.integrity lte (_temp.integritymax / 10) *9>>
    <<set _string += "frayed ">>
<<elseif _temp.botintegrity and _temp.botintegrity lte (_temp.integritymax / 10) *9>>
    <<set _string += "frayed ">>
<</if>>
<<set _string += _temp.colour + " " + _temp.name>>
<<capture _string>>
<<set $tempstring to _string>>
<</capture>>
<</nobr>><</widget>>

<<widget "halfbr">><<nobr>>

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

:: Widgets Clothing [widget]

/* Widget for purchasing clothes.  Usage: <<buyclothes "colour" "name" "action">>.  This does not validate anything - that should be done in the "createclothes" widget.*/
<<widget "buyclothes">><<nobr>>
<<set _colour to $args[0]>> <<set _name to $args[1]>> <<set _act to $args[2]>>
<<createclothes _colour _name>>
<<if $money gte $createdclothes.price>>
  <<set $money -= $createdclothes.price>>
  <<switch _act>>
  <<case "wear">>
    <<clothesmessage "boughtwear" $createdclothes>>
    <<set $clothesid += 1>><<set $createdclothes.id to $clothesid>>
    <<wearclothes $createdclothes>>
  <<case "store">>
    <<clothesmessage "boughtstore" $createdclothes>>
    <<set $clothesid += 1>><<set $createdclothes.id to $clothesid>>
    <<storeclothes $createdclothes>>
  <<case "none" "" "undefined">>
  <</switch>>
<<else>>
  <<set $clothesmessage.push({reason: "boughtfail", colour: _colour, name: _name })>>
<</if>>
<<set $createdclothes to 0>>
<</nobr>><</widget>>

/* Widget for giving clothes.  Usage: <<giveclothes "colour" "name" "action">>. */
<<widget "giveclothes">><<nobr>>
<<set _colour to $args[0]>> <<set _name to $args[1]>> <<set _act to $args[2]>>
/*<<set $debugtxt.push("giving " + _colour + " " + _name + " to " + _act)>>*/
<<createclothes _colour _name>>
<<switch _act>>
<<case "wear">>
  <<set $clothesid += 1>><<set $createdclothes.id to $clothesid>>
  <<wearclothes $createdclothes>>
<<case "store">>
  <<set $clothesid += 1>><<set $createdclothes.id to $clothesid>>
  <<storeclothes $createdclothes>>
<<case "none" "" "undefined">>
<</switch>>
<<set $createdclothes to 0>>
<</nobr>><</widget>>

/* Widget for wearing a clothes object - either from createclothes or transfer from wardrobe inventory. */
<<widget "wearclothes">><<nobr>>
<<set $wornclothes to $args[0]>>
/*<<set $debugtxt.push("wearing " + $wornclothes.name)>>*/
/* This section checks 'worn' variable to remove clothing currently there. */
<<for _n to 0; _n lt $wornclothes.worn.length; _n++>>
  <<removeclothes $wornclothes.worn[_n]>>
<</for>>
/* Check 'worn' variable again to add clothing to now-empty slots. */
<<for _n to 0; _n lt $wornclothes.worn.length; _n++>>
  <<switch $wornclothes.worn[_n]>>
  <<case "outertop">>
    <<set $outertop to $wornclothes>>
  <<case "outerbottom">>
    <<set $outerbottom to $wornclothes>>
  <<case "top">>
    <<set $top to $wornclothes>>
  <<case "bottom">>
    <<set $bottom to $wornclothes>>
  <<case "undertop">>
    <<set $undertop to $wornclothes>>
  <<case "underbottom">>
    <<set $underbottom to $wornclothes>>
  <<case "legs">>
    <<set $legs to $wornclothes>>
  <<case "feet">>
    <<set $feet to $wornclothes>>
  <<case "headacc">>
    <<set $headacc to $wornclothes>>
  <<case "faceacc">>
    <<set $faceacc to $wornclothes>>
  <<case "neckacc">>
    <<set $neckacc to $wornclothes>>
  <<case "underacc">>
    <<set $underacc to $wornclothes>>
  <</switch>>
<</for>>
<<set $wornclothes to 0>>
<</nobr>><</widget>>

/* Widget to remove clothes. */
<<widget "removeclothes">><<nobr>>
<<set _action to $args[1]>>
/* Identifies item from widget string and saves it to $removedclothes */
<<switch $args[0]>>
<<case "outertop">>
  <<if $outertop isnot 0>>
    <<set $removedclothes to $outertop>><</if>>
<<case "outerbottom">>
  <<if $outerbottom isnot 0>>
    <<set $removedclothes to $outerbottom>><</if>>
<<case "top">>
  <<if $top isnot 0>>
    <<set $removedclothes to $top>><</if>>
<<case "bottom">>
  <<if $bottom isnot 0>>
    <<set $removedclothes to $bottom>><</if>>
<<case "undertop">>
  <<if $undertop isnot 0>>
    <<set $removedclothes to $undertop>><</if>>
<<case "underbottom">>
  <<if $underbottom isnot 0>>
    <<set $removedclothes to $underbottom>><</if>>
<<case "legs">>
  <<if $legs isnot 0>>
    <<set $removedclothes to $legs>><</if>>
<<case "feet">>
  <<if $feet isnot 0>>
    <<set $removedclothes to $feet>><</if>>
<<case "headacc">>
  <<if $headacc isnot 0>>
    <<set $removedclothes to $headacc>><</if>>
<<case "faceacc">>
  <<if $faceacc isnot 0>>
    <<set $removedclothes to $faceacc>><</if>>
<<case "neckacc">>
  <<if $neckacc isnot 0>>
    <<set $removedclothes to $neckacc>><</if>>
<<case "underacc">>
  <<if $underacc isnot 0>>
    <<set $removedclothes to $underacc>><</if>>
<</switch>>
/* If item found, is it 'cursed'? */
<<if $removedclothes isnot 0>>
  <<if $removedclothes.cursed is true>>
    <<clothesmessage "cursed" $removedclothes>>
  <<else>>
    <<mergeremovedclothes>>
    <<fixclothes "removedclothes">>
	  <<if _action is "delete">>
      <<clothesmessage "discard" $removedclothes>>
	  <<elseif $removedclothes.type is "temp">>
      <<clothesmessage "temp" $removedclothes>>
	  <<else>>
      <<storeclothes $removedclothes>>
      <<if _action isnot "silent">>
        <<clothesmessage "remove" $removedclothes>>
      <</if>>
    <</if>>
  <</if>>
  <<set $removedclothes to 0>>
<</if>>
<</nobr>><</widget>>

/* Quickly remove all clothing - mostly for clothes change */
<<widget "removeallclothes">><<nobr>>
<<removeclothes outertop silent>>
<<removeclothes outerbottom silent>>
<<removeclothes top silent>>
<<removeclothes bottom silent>>
<<removeclothes undertop silent>>
<<removeclothes underbottom silent>>
<<removeclothes legs silent>>
<<removeclothes feet silent>>
<<removeclothes headacc silent>>
<<removeclothes faceacc silent>>
<<removeclothes neckacc silent>>
<<removeclothes underacc silent>>
<</nobr>><</widget>>

/* Grabs relevant data from multiple-part items then clears that slot. */
<<widget "mergeremovedclothes">><<nobr>>
<<for _m to 0; _m lt $removedclothes.worn.length; _m++>>
<<switch $removedclothes.worn[_m]>>
<<case "outertop">>
  <<set $removedclothes.integrity to $outertop.integrity>>
  <<set $outertop to 0>>
<<case "outerbottom">>
  <<set $removedclothes.botintegrity to $outerbottom.botintegrity>>
  <<set $outerbottom to 0>>
<<case "top">>
  <<set $removedclothes.integrity to $top.integrity>>
  <<set $top to 0>>
<<case "bottom">>
  <<set $removedclothes.botintegrity to $bottom.botintegrity>>
  <<set $bottom to 0>>
<<case "undertop">>
  <<set $removedclothes.integrity to $undertop.integrity>>
  <<set $undertop to 0>>
<<case "underbottom">>
  <<set $removedclothes.botintegrity to $underbottom.botintegrity>>
  <<set $underbottom to 0>>
<<case "legs">>
  <<set $legs to 0>>
<<case "feet">>
  <<set $feet to 0>>
<<case "headacc">>
  <<set $headacc to 0>>
<<case "faceacc">>
  <<set $faceacc to 0>>
<<case "neckacc">>
  <<set $neckacc to 0>>
<<case "underacc">>
  <<set $underacc to 0>>
<</switch>><</for>>
<</nobr>><</widget>>

/* Remove variables that don't make sense anymore. */
<<widget "fixclothes">><<nobr>>
<<set _loadfrom to $args[0]>><<set _saveto to $args[0]>>

<<switch _loadfrom>>
<<case "removedclothes">>
  <<set _clothing to $removedclothes>>
<<case "createdclothes">>
  <<set _clothing to $createdclothes>>
<<case "outertop">>
  <<set _clothing to $outertop>>
<<case "outerbottom">>
  <<set _clothing to $outerbottom>>
<<case "top">>
  <<set _clothing to $top>>
<<case "bottom">>
  <<set _clothing to $bottom>>
<<case "undertop">>
  <<set _clothing to $undertop>>
<<case "underbottom">>
  <<set _clothing to $underbottom>>
<<case "legs">>
  <<set _clothing to $legs>>
<<case "feet">>
  <<set _clothing to $feet>>
<<case "headacc">>
  <<set _clothing to $headacc>>
<<case "faceacc">>
  <<set _clothing to $faceacc>>
<<case "neckacc">>
  <<set _clothing to $neckacc>>
<<case "underacc">>
  <<set _clothing to $underacc>>
<</switch>>

<<set _clothing.wet to 0>>
<<set _clothing.removed to false>>
<<if _clothing.basestate>>
  <<set _clothing.state to _clothing.basestate>><</if>>
<<if _clothing.basetopstate>>
  <<set _clothing.topstate to _clothing.basetopstate>><</if>>
<<if _clothing.skirt>>
  <<set _clothing.skirtup to false>><</if>>
<<if _clothing.open>>
  <<set _clothing.opened to false>><</if>>

<<switch _saveto>>
<<case "removedclothes">>
  <<set $removedclothes to _clothing>>
<<case "createdclothes">>
  <<set $createdclothes to _clothing>>
<<case "outertop">>
  <<set $outertop to _clothing>>
<<case "outerbottom">>
  <<set $outerbottom to _clothing>>
<<case "top">>
  <<set $top to _clothing>>
<<case "bottom">>
  <<set $bottom to _clothing>>
<<case "undertop">>
  <<set $undertop to _clothing>>
<<case "underbottom">>
  <<set $underbottom to _clothing>>
<<case "legs">>
  <<set $legs to _clothing>>
<<case "feet">>
  <<set $feet to _clothing>>
<<case "headacc">>
  <<set $headacc to _clothing>>
<<case "faceacc">>
  <<set $faceacc to _clothing>>
<<case "neckacc">>
  <<set $neckacc to _clothing>>
<<case "underacc">>
  <<set $underacc to _clothing>>
<</switch>>

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

/* Intended to replace clotheson eventually */
<<widget "fixallclothes">><<nobr>>
<<fixclothes "outertop">>
<<fixclothes "outerbottom">>
<<fixclothes "top">>
<<fixclothes "bottom">>
<<fixclothes "undertop">>
<<fixclothes "underbottom">>
<<fixclothes "legs">>
<<fixclothes "feet">>
<<fixclothes "headacc">>
<<fixclothes "faceacc">>
<<fixclothes "neckacc">>
<<fixclothes "underacc">>
<</nobr>><</widget>>

/* Widget to destroy target clothing.  Usage:  <<destroyclothes (location)>> */
<<widget "destroyclothes">><<nobr>>
<<set _location to $args[0]>>
<<switch _location>>
<<case "outertop">>
  <<if $outertop.onepiece and $outertop.id eq $outerbottom.id>> <<set $outerbottom.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $outertop>>
  <<set $outertop to 0>>
<<case "outerbottom">>
  <<if $outerbottom.onepiece and $outertop.id eq $outerbottom.id>> <<set $outertop.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $outerbottom>>
  <<set $outerbottom to 0>>
<<case "top">>
  <<if $top.onepiece and $top.id eq $bottom.id>> <<set $bottom.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $top>>
  <<set $top to 0>>
<<case "bottom">>
  <<if $bottom.onepiece and $top.id eq $bottom.id>> <<set $top.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $bottom>>
  <<set $bottom to 0>>
<<case "undertop">>
  <<if $undertop.onepiece and $undertop.id eq $underbottom.id>> <<set $underbottom.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $undertop>>
  <<set $undertop to 0>>
<<case "underbottom">>
  <<if $underbottom.onepiece and $undertop.id eq $underbottom.id>> <<set $undertop.worn.delete(_location)>> <</if>>
  <<set _destroyedclothes to $underbottom>>
  <<set $underbottom to 0>>
<<case "legs">>
  <<set _destroyedclothes to $legs>>
  <<set $legs to 0>>
<<case "feet">>
  <<set _destroyedclothes to $feet>>
  <<set $feet to 0>>
<<case "headacc">>
  <<set _destroyedclothes to $headacc>>
  <<set $headacc to 0>>
<<case "faceacc">>
  <<set _destroyedclothes to $faceacc>>
  <<set $faceacc to 0>>
<<case "neckacc">>
  <<set _destroyedclothes to $neckacc>>
  <<set $neckacc to 0>>
<<case "underacc">>
  <<set _destroyedclothes to $underacc>>
  <<set $underacc to 0>>
<</switch>>
<</nobr>><</widget>>

/* Widget stores items into wardrobe based on category */
<<widget "storeclothes">><<nobr>>
<<set $wardrobe.push($args[0])>>

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

/* CouldDo: Could use the $createdclothes variable to store item info for alternate usages (i.e. try-on-scene). Once done could then use wearclothes/storeclothes. */
<<widget "createclothes">><<nobr>>
<<set _colour to $args[0]>><<set _name to $args[1]>>
/* Item creation */
<<switch _name>>
<<case "sundress">>
  <<set $createdclothes to {
    name:            "sundress",
    colour:          _colour,
    type:            "full",
    price:           1500,
    worn:            ["top", "bottom"],
    class:           "dress",
    integritymax:    100,
    integrity:       100,
    botintegrity:    100,
    topcover:        800,
    botcover:        800,
    exposed:         0,
    gender:          "f",
    onepiece:        true,
    soak:            true,
    open:            true,
    skirt:           true
  }>>
<<case "pyjama shirt">>
  <<set $createdclothes to {
    name:            "pyjama shirt",
    colour:          _colour,
    type:            "top",
    price:           1000,
    worn:            ["top"],
    class:           "shirt",
    integritymax:    100,
    integrity:       100,
    topcover:        900,
    exposed:         0,
    gender:          "n",
    soak:            true,
    sleep:           true,
    sleeves:         true
  }>>
<<case "pyjama bottoms">>
  <<set $createdclothes to {
    name:            "pyjama bottoms",
    colour:          _colour,
    type:            "bottom",
    price:           1000,
    worn:            ["bottom"],
    class:           "pants",
    integritymax:    100,
    botintegrity:    100,
    botcover:        900,
    exposed:         0,
    gender:          "n",
    plural:          true,
    soak:            true,
    sleep:           true
  }>>
<<case "towel top">>
  <<set $createdclothes to {
    name:            "towel",
    colour:          _colour,
    type:            "top",
    price:           0,
    worn:            ["top"],
    class:           "croptop",
    integritymax:    10,
    integrity:       10,
    topcover:        200,
    exposed:         0,
    gender:          "n",
    soak:            true,
    open:            true
  }>>
<<case "towel bottom">>
  <<set $createdclothes to {
    name:            "towel",
    colour:          _colour,
    type:            "bottom",
    price:           0,
    worn:            ["bottom"],
    class:           "skirt",
    integritymax:    10,
    botintegrity:    10,
    botcover:        200,
    exposed:         0,
    gender:          "n",
    soak:            true,
    skirt:           true
  }>>
<<case "bikini top">>
  <<set $createdclothes to {
    name:            "bikini top",
    colour:          _colour,
    type:            "top",
    price:           1000,
    worn:            ["undertop"],
    class:           "croptop",
    integritymax:    50,
    integrity:       20,
    topcover:        100,
    exposed:         1,
    gender:          "f",
    swim:            true,
    open:            true,
    sameimage:       true
  }>>
<<case "bikini bottoms">>
  <<set $createdclothes to {
    name:            "bikini bottoms",
    colour:          _colour,
    type:            "bottom",
    price:           3000,
    worn:            ["underbottom"],
    class:           "shorts",
    integritymax:    50,
    botintegrity:    20,
    botcover:        100,
    exposed:         1,
    gender:          "f",
    plural:          true,
    swim:            true,
    sameimage:       true
  }>>
<<case "waist apron">>
  <<set $createdclothes to {
    name:            "waist apron",
    colour:          _colour,
    type:            "accessory",
    price:           0,
    worn:            ["outerbottom"],
    class:           "accessory",
    integritymax:    10,
    botintegrity:    10,
    botcover:        200,
    exposed:         1,
    gender:          "n",
    soak:            true,
    skirt:           true
  }>>
<<case "t-shirt">>
  <<set $createdclothes to {
    name:            "t-shirt",
    colour:          _colour,
    type:            "top",
    price:           1000,
    worn:            ["top"],
    class:           "shirt",
    integritymax:    100,
    integrity:       100,
    topcover:        800,
    exposed:         0,
    gender:          "n",
    sleeves:         true,
    soak:            true
  }>>
<<case "tank top">>
  <<set $createdclothes to {
    name:            "tank top",
    colour:          _colour,
    type:            "top",
    price:           1000,
    worn:            ["top"],
    class:           "shirt",
    integritymax:    100,
    integrity:       100,
    topcover:        700,
    exposed:         0,
    gender:          "n",
    soak:            true
  }>>
<<case "shorts">>
  <<set $createdclothes to {
    name:            "shorts",
    colour:          _colour,
    type:            "bottom",
    price:           1000,
    worn:            ["bottom"],
    class:           "shorts",
    integritymax:    120,
    botintegrity:    120,
    botcover:        700,
    exposed:         0,
    gender:          "n",
    plural:          true,
    soak:            true
  }>>
<<case "school shirt">>
  <<set $createdclothes to {
    name:            "school shirt",
    colour:          _colour,
    type:            "top",
    price:           2500,
    worn:            ["top"],
    class:           "shirt",
    integritymax:    200,
    integrity:       200,
    topcover:        900,
    exposed:         0,
    gender:          "n",
    soak:            true,
    sleeves:         true,
    school:          true
  }>>
<<case "school shorts">>
  <<set $createdclothes to {
    name:            "school shorts",
    colour:          _colour,
    type:            "bottom",
    price:           2000,
    worn:            ["bottom"],
    class:           "shorts",
    integritymax:    160,
    botintegrity:    160,
    botcover:        800,
    exposed:         0,
    gender:          "m",
    plural:          true,
    soak:            true,
    school:          true
  }>>
<<case "school skirt">>
  <<set $createdclothes to {
    name:            "school skirt",
    colour:          _colour,
    type:            "bottom",
    price:           5000,
    worn:            ["bottom"],
    class:           "skirt",
    integritymax:    160,
    botintegrity:    160,
    botcover:        800,
    exposed:         0,
    gender:          "f",
    soak:            true,
    skirt:           true,
    school:          true
  }>>
<<case "school swimsuit">>
  <<set $createdclothes to {
    name:            "school swimsuit",
    colour:          _colour,
    type:            "full",
    price:           1500,
    worn:            ["undertop", "underbottom"],
    class:           "bodysuit",
    integritymax:    40,
    integrity:       40,
    botintegrity:    40,
    topcover:        400,
    botcover:        400,
    exposed:         1,
    gender:          "f",
    onepiece:        true,
    swim:            true,
    open:            true
  }>>
<<case "school swim shorts">>
  <<set $createdclothes to {
    name:            "school swim shorts",
    colour:          _colour,
    type:            "bottom",
    price:           1500,
    worn:            ["underbottom"],
    class:           "shorts",
    integritymax:    40,
    botintegrity:    40,
    botcover:        400,
    exposed:         1,
    gender:          "m",
    swim:            true
  }>>
<<case "plant top">>
  <<set $createdclothes to {
    name:            "plant top",
    colour:          "green",
    type:            "temp",
    price:           0,
    worn:            ["undertop"],
    class:           "accessory",
    integritymax:    10,
    integrity:       10,
    topcover:        100,
    exposed:         1,
    gender:          "n",
    swim:            true,
    open:            true,
    sameimage:       true
  }>>
<<case "plant skirt">>
  <<set $createdclothes to {
    name:            "plant skirt",
    colour:          "green",
    type:            "temp",
    price:           0,
    worn:            ["underbottom"],
    class:           "accessory",
    integritymax:    10,
    botintegrity:    10,
    botcover:        100,
    exposed:         1,
    gender:          "n",
    swim:            true,
    skirt:           true,
    sameimage:       true
  }>>
<<case "evening gown">>
  <<set $createdclothes to {
    name:            "evening gown",
    colour:          _colour,
    type:            "full",
    price:           12000,
    worn:            ["top", "bottom"],
    class:           "dress",
    integritymax:    200,
    integrity:       200,
    botintegrity:    200,
    topcover:        500,
    botcover:        800,
    exposed:         0,
    gender:          "n",
    onepiece:        true,
    swim:            true,
    open:            true,
    skirt:           true
  }>>
<<case "plain panties">>
  <<set $createdclothes to {
    name:            "plain panties",
    colour:          _colour,
    type:            "under",
    price:           200,
    worn:            ["underbottom"],
    class:           "shorts",
    integritymax:    100,
    botintegrity:    100,
    botcover:        800,
    exposed:         0,
    gender:          "f",
    plural:          true,
    soak:            true
  }>>
<<case "lace panties">>
  <<set $createdclothes to {
    name:            "lace panties",
    colour:          _colour,
    type:            "under",
    price:           600,
    worn:            ["underbottom"],
    class:           "shorts",
    integritymax:    60,
    botintegrity:    60,
    botcover:        600,
    exposed:         0,
    gender:          "f",
    plural:          true,
    soak:            true
  }>>
<<case "Y fronts">>
  <<set $createdclothes to {
    name:            "Y fronts",
    colour:          _colour,
    type:            "under",
    price:           200,
    worn:            ["underbottom"],
    class:           "shorts",
    integritymax:    100,
    botintegrity:    100,
    botcover:        800,
    exposed:         0,
    gender:          "m",
    plural:          true,
    soak:            true
  }>>
<<case "tights">>
  <<set $createdclothes to {
    name:            "tights",
    colour:          _colour,
    type:            "accessory",
    price:           1200,
    worn:            ["legs"],
    class:           "tights",
    integritymax:    120,
    integrity:       120,
    botcover:        200,
    exposed:         1,
    gender:          "f",
    plural:          true,
    soak:            true
  }>>
<<case "stockings">>
  <<set $createdclothes to {
    name:            "stockings",
    colour:          _colour,
    type:            "accessory",
    price:           2200,
    worn:            ["legs"],
    class:           "socks",
    integritymax:    "n",
    exposed:         0,
    gender:          "f",
    plural:          true,
    soak:            true,
    sameimage:       true
  }>>
<<case "gym socks">>
  <<set $createdclothes to {
    name:            "gym socks",
    colour:          _colour,
    type:            "accessory",
    price:           900,
    worn:            ["legs"],
    class:           "socks",
    integritymax:    "n",
    exposed:         0,
    gender:          "f",
    plural:          true,
    soak:            true,
    sameimage:       true
  }>>
<<case "shoes">>
  <<set $createdclothes to {
    name:            "shoes",
    colour:          "black",
    type:            "accessory",
    price:           3000,
    worn:            ["feet"],
    class:           "shoes",
    integritymax:    "n",
    exposed:         0,
    gender:          "n",
    plural:          true,
    soak:            true,
    sameimage:       true
  }>>
<<case "chastity belt">>
  <<set $createdclothes to {
    name:            "chastity belt",
    colour:          "restrictive",
    type:            "accessory",
    price:           8000,
    worn:            ["underacc"],
    class:           "accessory",
    integritymax:    2000,
    botintegrity:    2000,
    botcover:        100,
    exposed:         1,
    gender:          "n",
    cursed:          true,
    sameimage:       true
  }>>
<<case "hairpin">>
  <<set $createdclothes to {
    name:            "hairpin",
    colour:          "cute",
    type:            "accessory",
    price:           1000,
    worn:            ["headacc"],
    integritymax:    "n",
    sameimage:       true
  }>>
<<case "beanie">>
  <<set $createdclothes to {
    name:            "beanie",
    colour:          "stylish",
    type:            "accessory",
    price:           7000,
    worn:            ["headacc"],
    integritymax:    "n",
    sameimage:       true
  }>>
<<case "glasses">>
  <<set $createdclothes to {
    name:            "glasses",
    colour:          "thick",
    type:            "accessory",
    price:           2000,
    worn:            ["faceacc"],
    integritymax:    "n",
    plural:          true,
    sameimage:       true
  }>>
<<case "shades">>
  <<set $createdclothes to {
    name:            "shades",
    colour:          "cool",
    type:            "accessory",
    price:           15000,
    worn:            ["faceacc"],
    integritymax:    "n",
    plural:          true,
    sameimage:       true
  }>>
<<case "collar">>
  <<set $createdclothes to {
    name:            "collar",
    colour:          "dog",
    type:            "special",
    price:           0,
    worn:            ["neckacc"],
    integritymax:    "n",
    cursed:          true,
    sameimage:       true
  }>>
<</switch>>

<<switch _name>>
<<case "gym socks">>
  <<if _colour isnot "pink" and _colour isnot "blue">>
    Something went wrong!!  The colour for that item was invalid - please notify the developer.
  <</if>>
<<case "stockings">>
  <<if _colour isnot "sheer" and _colour isnot "fishnet">>
    Something went wrong!!  The colour for that item was invalid - please notify the developer.
  <</if>>
<<case "tights">>
  <<if _colour isnot "brown" and _colour isnot "sheer">>
    Something went wrong!!  The colour for that item was invalid - please notify the developer.
  <</if>>
<</switch>>
<<fixclothes "createdclothes">>
/* Add colour-based gender modifier */
<<if $createdclothes.gender is "n">>
  <<if $createdclothes.colour is "blue">>
    <<set $createdclothes.gender to "m">>
  <<elseif $createdclothes.colour is "pink">>
    <<set $createdclothes.gender to "f">>
  <</if>>
<</if>>

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

:: Widgets System Related [widget]
/* Destroys clothing as necessary during effects widget */
<<widget "integritycheck">><<nobr>>

<<if $outertop and $outertop.integrity lte 0>>
  Your <<clothesare $outertop>> ripped into scraps,
  <<if $top>>revealing your $top.name.
  <<elseif $undertop>>revealing your $undertop.name.
  <<else>>exposing your <<breastsstop>>
  <</if>>

<<destroyclothes outertop>><<clothesruinstat>>
<</if>>
<<if $top and $top.integrity lte 0>>
  Your <<clothesare $top>> ripped into scraps,
  <<if $undertop>>revealing your $undertop.name.
  <<else>>exposing your <<breastsstop>>
  <</if>>

<<destroyclothes top>><<clothesruinstat>>
<</if>>
<<if $undertop and $undertop.integrity lte 0>>
  Your <<clothesare $undertop>> ripped into scraps, exposing your <<breastsstop>>

<<destroyclothes undertop>><<clothesruinstat>>
<</if>>

<<if $outerbottom and $outerbottom.botintegrity lte 0>>
  Your <<clothesare $outerbottom>> ripped into scraps,
  <<if $bottom>> revealing your $bottom.name.
  <<else>> exposing your <<genitalsstop>>

<<destroyclothes outerbottom>><<clothesruinstat>>
  <</if>>
<</if>>
<<if $bottom and $bottom.botintegrity lte 0>>
  Your <<clothesare $bottom>> ripped into scraps, exposing your <<undiesstop>>

<<destroyclothes bottom>><<clothesruinstat>>
<</if>>
<<if $underbottom and $underbottom.botintegrity lte 0>>
  Your <<clothesare $underbottom>> ripped into scraps,
  <<if $underacc>> revealing your $underacc.name.
  <<else>> exposing your <<genitalsstop>>
  <</if>>

  <<destroyclothes underbottom>><<clothesruinstat>>
<</if>>
<<if $underacc and $underacc.botintegrity lte 0>>
  Your <<clothesare $underacc>> ripped into scraps, exposing your <<genitalsstop>>
  <<if $underacc.name is "chastity belt">>
    <<if $vaginalchastityparasite>>
      With the chastity belt gone, the $vaginalchastityparasite fall out of your vagina.
<<set $vaginalchastityparasite to 0>>
    <</if>>
    <<if $penilechastityparasite>>
      With the chastity belt gone, the $penilechastityparasite fall off of your penis.
<<set $penilechastityparasite to 0>>
    <</if>>
    <<if $analchastityparasite>>
      With the chastity belt gone, the $analchastityparasite fall out of your anus.
<<set $analchastityparasite to 0>>
    <</if>>
  <</if>>

<<destroyclothes underacc>><<clothesruinstat>>
<</if>>

<<if $legs and $legs.botintegrity lte 0>>
  Your <<clothesare $legs>> ripped into scraps,
  <<if $underacc isnot 0>> revealing your $underacc.name.
  <<else>> exposing your <<genitalsstop>>

  <<destroyclothes legs>><<clothesruinstat>>
  <</if>>
<</if>>

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

/* Sets clothing variables in StoryInit*/
<<widget "clothinginit">><<nobr>>
<<set $wardrobe to []>>
<<set $debugtxt to []>>

<<set $outertop to 0>>
<<set $outerbottom to 0>>
<<set $top to 0>>
<<set $bottom to 0>>
<<set $undertop to 0>>
<<set $underbottom to 0>>
<<set $legs to 0>>
<<set $feet to 0>>
<<set $headacc to 0>>
<<set $faceacc to 0>>
<<set $neckacc to 0>>
<<set $underacc to 0>>
<<set $createdclothes to 0>>
<<set $wornclothes to 0>>
<<set $removedclothes to 0>>
<<set $clothesmessage to []>>
<<set $clothesid to 0>>
<<set $tempcolour to "white">>
<<set $tempaction to "wear">>
<<set $temptype to "t-shirt">>
<</nobr>><</widget>>

/* Called during Story2, after character creation */
<<widget "givestartclothing">><<nobr>>

<<if $playergender is "f">>
<<giveclothes "pink" "plain panties" "wear">>
<<giveclothes "pink" "pyjama shirt" "store">>
<<giveclothes "pink" "pyjama bottoms" "store">>
<<giveclothes "white" "school shirt" "store">>
<<giveclothes "black" "school skirt" "store">>
<<giveclothes "blue" "school swimsuit" "store">>
<<giveclothes "pink" "gym socks" "store">>
<<giveclothes "black" "shoes" "store">>
<<giveclothes "white" "sundress" "wear">>
<<giveclothes "" "hairpin" "store">>
<<set $clothingset to {
  sleep:    [[1,"plain panties"],[2,"pyjama shirt"],[3,"pyjama bottoms"]],
  school:   [[1,"plain panties"],[4,"school shirt"],[5,"school skirt"],[7,"gym socks"],[8,"shoes"]],
  casual:   [[1,"plain panties"],[9,"sundress"]],
  beach:    [[6,"school swimsuit"]],
  pool:     [[6,"school swimsuit"]],
  last: 0, c1: 0, c2: 0, c3: 0, c4: 0
  }>>

<<elseif $playergender is "m">>
<<giveclothes "white" "Y fronts" "wear">>
<<giveclothes "blue" "pyjama shirt" "store">>
<<giveclothes "blue" "pyjama bottoms" "store">>
<<giveclothes "white" "school shirt" "store">>
<<giveclothes "black" "school shorts" "store">>
<<giveclothes "blue" "school swim shorts" "store">>
<<giveclothes "blue" "gym socks" "store">>
<<giveclothes "black" "shoes" "store">>
<<giveclothes "orange" "t-shirt" "wear">>
<<giveclothes "blue" "shorts" "wear">>
<<set $clothingset to {
  sleep:    [[1,"Y fronts"],[2,"pyjama shirt"],[3,"pyjama bottoms"]],
  school:   [[1,"Y fronts"],[4,"school shirt"],[5,"school shorts"],[7,"gym socks"],[8,"shoes"]],
  casual:   [[1,"Y fronts"],[9,"t-shirt"],[10,"shorts"]],
  beach:    [[6,"school swim shorts"]],
  pool:     [[6,"school swim shorts"]],
  last: 0, c1: 0, c2: 0, c3: 0, c4: 0
  }>>

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

/* This displays events related to clothing (wardrobe, shop) */
<<widget "clotheseffects">><<nobr>>
<<if $clothesmessage.length gt 0>>
<<for _e to 0; _e lt $clothesmessage.length; _e++>>
<<switch $clothesmessage[_e].reason>>
<<case "cursed">>
  <<if $clothesmessage[_e].name is "collar">>You try to remove the $clothesmessage[_e].colour $clothesmessage[_e].name, but find it hard to remove without help.  Maybe the police could assist you?
  <<elseif $clothesmessage[_e].name is "chastity belt">> You try to remove the $clothesmessage[_e].colour $clothesmessage[_e].name, but it is very secure.  The church may let you remove it for a fee... the only other option is to wait for it to break.  It still has <<= $underacc.botintegrity / $underacc.integritymax * 100>>% integrity remaining.
  <</if>>
<<case "remove">>
  <<if $passage.contains("Shop")>>
    You put the <<describeclothes $clothesmessage[_e]>> you were wearing away.
  <<else>>
    You place <<describeyourclothes $clothesmessage[_e]>> into the wardrobe.
  <</if>>
<<case "discard">>
  You remove <<describeyourclothes $clothesmessage[_e]>> and immediately discard it.
<<case "temp">>
  You as you remove <<describeyourclothes $clothesmessage[_e]>> it falls to pieces.
<<case "wear">>
  You wear <<describeaclothes $clothesmessage[_e]>> from your wardrobe.
<<case "delete">>
  You discard <<describeyourclothes $clothesmessage[_e]>> from your wardrobe.
<<case "deleteall">>
  <<if $clothesmessage[_e].list.length gt 0>>
    You sift through your wardrobe discarding clothing that is severely damaged including your $clothesmessage[_e].list.
  <<else>>
    There were no severely damaged items in your wardrobe.
  <</if>>
<<case "boughtwear">>
  You buy <<describeaclothes $clothesmessage[_e]>> and immediately wear it.
<<case "boughtstore">>
  You buy <<describeaclothes $clothesmessage[_e]>> and put it away for later.
<<case "boughtfail">>
  You can't afford the <<describeclothes $clothesmessage[_e]>>.
<<case "setwear">>
  $clothesmessage[_e].message
<<case "setreplace">>
  You cannot find <<describeyourclothes $clothesmessage[_e]>>! You wear <<an $clothesmessage[_e].new>> one instead.
<<case "setmissing">>
  You cannot find some of the items in this set, so put on what you have.
<</switch>><</for>><<set $clothesmessage to []>>
<</if>>
<</nobr>><</widget>>

/* This saves data into $clothesmessage for clotheseffects to display.  Usage: <<clothesmessage ["reason"] [clothes object]>> */
<<widget "clothesmessage">><<nobr>>
<<if $args[1]>><<set _item to $args[1]>>
<<else>><<set _item to {reason: unset}>><</if>>
<<set _item.reason to $args[0]>>
<<set $clothesmessage.push(_item)>>
<</nobr>><</widget>>

:: Widgets Wardrobe [widget]
/* Widget generates an interactive clothing menu.  Usage: <<wardrobesystem "Passage Name">> - this will refresh the page, using the passage name as reference. */
<<widget "wardrobesystem">><<nobr>>
''Sets:''
<<radiobutton "_setaction" "wearset" checked>> Wear |
<<radiobutton "_setaction" "saveset">> Save

<<halfbr>>
<<link "Sleep" `$args[0]`>>
  <<wardrobeaction _setaction sleep>><</link>> |
<<link "School" `$args[0]`>>
  <<wardrobeaction _setaction school>><</link>> |
<<link "Casual" `$args[0]`>>
  <<wardrobeaction _setaction casual>><</link>> |
<<link "Beach" `$args[0]`>>
  <<wardrobeaction _setaction beach>><</link>> |
<<link "Pool" `$args[0]`>>
  <<wardrobeaction _setaction pool>><</link>> |
<<link "Custom1" `$args[0]`>>
  <<wardrobeaction _setaction c1>><</link>> |
<<link "Custom2" `$args[0]`>>
  <<wardrobeaction _setaction c2>><</link>> |
<<link "Custom3" `$args[0]`>>
  <<wardrobeaction _setaction c3>><</link>> |
<<link "Custom4" `$args[0]`>>
  <<wardrobeaction _setaction c4>><</link>>
/* Table of worn clothing */
<<if $outertop isnot 0 or $outerbottom isnot 0 or $top isnot 0 or $bottom isnot 0 or $undertop isnot 0 or $underbottom isnot 0 or $legs isnot 0 or $feet isnot 0 or $headacc isnot 0 or $faceacc isnot 0 or $neckacc isnot 0 or $underacc isnot 0>>

 Clothes:

  <<if $outertop isnot 0>>
    <<displayclothingitem $args[0] $outertop outertop>> 	 <</if>>
  <<if $outerbottom isnot 0 and $outertop.id isnot $outerbottom.id>>
    <<displayclothingitem $args[0] $outerbottom outerbottom>> 	 <</if>>
  <<if $top isnot 0>>
    <<displayclothingitem $args[0] $top top>> 	 <</if>>
  <<if $bottom isnot 0 and $top.id isnot $bottom.id>>
    <<displayclothingitem $args[0] $bottom bottom>> 	 <</if>>
  <<if $undertop isnot 0>>
    <<displayclothingitem $args[0] $undertop undertop>> 	 <</if>>
  <<if $underbottom isnot 0 and $undertop.id isnot $underbottom.id>>
    <<displayclothingitem $args[0] $underbottom underbottom>> 	 <</if>>
  <<if $legs isnot 0>>
    <<displayclothingitem $args[0] $legs legs>> 	 <</if>>
  <<if $feet isnot 0>>
    <<displayclothingitem $args[0] $feet feet>> 	 <</if>>
  <<if $headacc isnot 0>>
    <<displayclothingitem $args[0] $headacc headacc>> 	 <</if>>
  <<if $faceacc isnot 0>>
    <<displayclothingitem $args[0] $faceacc faceacc>> 	 <</if>>
  <<if $neckacc isnot 0>>
    <<displayclothingitem $args[0] $neckacc neckacc>> 	 <</if>>
  <<if $underacc isnot 0>>
    <<displayclothingitem $args[0] $underacc underacc>> 	 <</if>>

<<else>> You are naked!
<</if>>
<<radiobutton "_tempaction" "wear" checked>> Wear/Remove  | <<radiobutton "_tempaction" "delete">> Delete  | <<link "•" `$args[0]`>><<deletedamagedclothes>><</link>> Clear Damaged

/* Table for wardrobe - making temp lists for categories */
<<set _full to []>><<set _top to []>><<set _bottom to []>>
<<set _under to []>><<set _accessory to []>>
<<for _l to 0; _l lt $wardrobe.length; _l++>>
  <<switch $wardrobe[_l].type>>
  <<case "full">> <<set _full.push(_l)>>
  <<case "top">> <<set _top.push(_l)>>
  <<case "bottom">> <<set _bottom.push(_l)>>
  <<case "under">> <<set _under.push(_l)>>
  <<case "accessory">> <<set _accessory.push(_l)>>
  <</switch>>
<</for>>
<<if $wardrobe.length gt 0>>
  <<wardrobetable $args[0] _full "Full-body:">>
  <<wardrobetable $args[0] _top "Upper-body:">>
  <<wardrobetable $args[0] _bottom "Lower-body:">>
  <<wardrobetable $args[0] _under "Underwear:">>
  <<wardrobetable $args[0] _accessory "Accessories:">>
<<else>> Your wardrobe is empty!
<</if>>

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

/* Sub-function of wardwobe widget to create tables */
<<widget "wardrobetable">><<nobr>>
<<set _list to $args[1]>>
<<if _list.length gt 0>>

 $args[2]

  <<for _t to 0; _t lt _list.length; _t++>>
    <<displayclothingitem $args[0] $wardrobe[_list[_t]] _list[_t]>>
  <</for>>

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

/* Sub-function of wardrobe to consistently display clothing */
<<widget "displayclothingitem">><<nobr>>
/* Create slot subtitle */
<<switch $args[1].worn[0]>>
<<case "outertop">>
  <<if $args[1].worn.length gt 1>> <<set _slot to "outer both">>
  <<else>> <<set _slot to "outer top">> <</if>>
<<case "outerbottom">> <<set _slot to "outer bottom">>
<<case "top">>
  <<if $args[1].worn.length gt 1>> <<set _slot to "both">>
  <<else>> <<set _slot to "top">> <</if>>
<<case "bottom">> <<set _slot to "bottom">>
<<case "undertop">> <<set _slot to "under">>
  <<if $args[1].worn.length gt 1>> <<set _slot to "under both">>
  <<else>> <<set _slot to "under top">> <</if>>
<<case "underbottom">> <<set _slot to "under bottom">>
<<case "legs">> <<set _slot to "legs">>
<<case "feet">> <<set _slot to "feet">>
<<case "headacc">> <<set _slot to "head">>
<<case "faceacc">> <<set _slot to "face">>
<<case "neckacc">> <<set _slot to "neck">>
<<case "underacc">> <<set _slot to "under">>
<</switch>>
/* Generate table cell */
<<link `$args[1].colour + "\n" + $args[1].name + '<a id="slot">' + _slot + "</a>"` $args[0]>><<wardrobeaction _tempaction $args[2]>><</link>>
<</nobr>><</widget>>

/* Sub-function of wardrobe widget to call actions based on radio buttons selections. */
<<widget "wardrobeaction">><<nobr>>
<<switch $args[0]>>
<<case "wear">>
  <<if $args[1] gte 0>>
  <<clothesmessage "wear" $wardrobe[$args[1]]>>
  <<wearclothes $wardrobe[$args[1]]>> <<set $wardrobe.deleteAt($args[1])>>
  <<else>><<removeclothes $args[1] _tempaction>><</if>>
<<case "delete">>
  <<clothesmessage "delete" $wardrobe[$args[1]]>>
  <<accessorylist remove $wardrobe[$args[1]]>>
  <<set $wardrobe.deleteAt($args[1])>>
<<case "wearset">>
  <<wearclothingset $args[1]>>
<<case "saveset">>
  <<saveclothingset $args[1]>>
<</switch>>
<</nobr>><</widget>>

/* Command to sift through wardrobe and remove damaged clothing */
<<widget "deletedamagedclothes">><<nobr>>
<<if $wardrobe.length gt 0>>
  <<set _list to []>>
  <<for _d to $wardrobe.length - 1; _d gt -1; _d-->>
  <<compileclothesdescription $wardrobe[_d]>>
  <<if $wardrobe[_d].onepiece and $wardrobe[_d].worn.length eq 1>>
      <<set _list.push($tempstring)>>
      <<set $wardrobe.deleteAt(_d)>>
    <<elseif $wardrobe[_d].integrity and $wardrobe[_d].integrity lte ($wardrobe[_d].integritymax / 10) *2>>
      <<set _list.push($tempstring)>>
      <<set $wardrobe.deleteAt(_d)>>
    <<elseif $wardrobe[_d].botintegrity and $wardrobe[_d].botintegrity lte ($wardrobe[_d].integritymax / 10) *2>>
      <<set _list.push($tempstring)>>
      <<set $wardrobe.deleteAt(_d)>>
    <</if>>
  <</for>>
  <<if _list.length gt 1>>
    <<set _temp to "and " + _list[(_list.length - 1)]>>
    <<set _list[(_list.length - 1)] to _temp>>
  <</if>>
<</if>>
<<set $clothesmessage.push({reason: "deleteall", list: _list })>>
<<set $debugtxt to _list>>
<</nobr>><</widget>>

/* Stows current clothes, wears specified set
   Usage: <<wearclothingset [nameofset]>>.
   Possible sets: sleep, school, casual, beach, pool, c1, c2, c3, c4 */
<<widget "wearclothingset">><<nobr>>
<<removeallclothes>>
<<switch $args[0]>>
<<case "sleep">>
  <<set _temparray to clone($clothingset.sleep)>>
  <<set _message to {message: "You put on your sleepwear."}>>
<<case "school">>
  <<set _temparray to clone($clothingset.school)>>
  <<set _message to {message: "You put on your school clothes."}>>
<<case "casual">>
  <<set _temparray to clone($clothingset.casual)>>
  <<set _message to {message: "You put on your casual clothes."}>>
<<case "beach">>
  <<set _temparray to clone($clothingset.beach)>>
  <<set _message to {message: "You put on your beach attire."}>>
<<case "pool">>
  <<set _temparray to clone($clothingset.pool)>>
  <<set _message to {message: "You put on your pool clothes."}>>
<<case "last">>
  <<set _temparray to clone($clothingset.last)>>
  <<set _message to {message: "You put on the clothes you had on before " + $args[1] + "."}>>
<<case "c1">>
  <<set _temparray to clone($clothingset.c1)>>
<<case "c2">>
  <<set _temparray to clone($clothingset.c2)>>
<<case "c3">>
  <<set _temparray to clone($clothingset.c3)>>
<<case "c4">>
  <<set _temparray to clone($clothingset.c4)>>
<</switch>>
<<if !_message>> <<set _message to {message: "You put on your custom set of clothing."}>> <</if>>
<<clothesmessage "setwear" _message>>
<<if _temparray>>
  /* Searches for matching ID, wears and deletes from array if found. */
  <<for _g to $wardrobe.length - 1; _g gt -1; _g-->>
    <<for _h to _temparray.length - 1; _h gt -1; _h-->>
      <<if $wardrobe[_g] and $wardrobe[_g].id is _temparray[_h][0]>>
        <<wearclothes $wardrobe[_g]>>
        <<set $wardrobe.deleteAt(_g)>>
        <<set _temparray.deleteAt(_h)>>
      <</if>>
    <</for>>
  <</for>>
  <<if _temparray.length gt 0>>
    <<for _g to $wardrobe.length - 1; _g gt -1; _g-->>
      <<for _h to _temparray.length - 1; _h gt -1; _h-->>
        <<if $wardrobe[_g] and $wardrobe[_g].name is _temparray[_h][1]>>
          <<clothesmessage "setreplace" {name: _temparray[_h][1], colour: _temparray[_h][2], new: $wardrobe[_g].colour }>>
          <<wearclothes $wardrobe[_g]>>
          <<set $wardrobe.deleteAt(_g)>>
          <<set _temparray.deleteAt(_h)>>
        <</if>>
      <</for>>
    <</for>>
    <<if _temparray.length gt 0>>
      <<clothesmessage "setmissing">>
      /* Add message stating what couldn't be replaced. */
    <</if>>
  <</if>>
<</if>>
<</nobr>><</widget>>

/* Grabs data from current inventory, saves it to specified set
   Usage: <<saveclothingset [nameofset]>>.
   Possible sets: sleep, school, casual, beach, pool, c1, c2, c3, c4 */
<<widget "saveclothingset">><<nobr>>
<<set _temparray to []>>
<<if $outertop>>
  <<set _temparray.push([$outertop.id, $outertop.name, $outertop.colour])>>
<</if>>
<<if $outerbottom>>
  <<if $outertop.id isnot $outerbottom.id>>
    <<set _temparray.push([$outerbottom.id, $outerbottom.name, $outerbottom.colour])>>
<</if>><</if>>
<<if $top>>
  <<set _temparray.push([$top.id, $top.name, $top.colour])>>
<</if>>
<<if $bottom>>
  <<if $top.id isnot $bottom.id>>
    <<set _temparray.push([$bottom.id, $bottom.name, $bottom.colour])>>
<</if>><</if>>
<<if $undertop>>
  <<set _temparray.push([$undertop.id, $undertop.name, $undertop.colour])>>
<</if>>
<<if $underbottom>>
  <<if $undertop.id isnot $underbottom.id>>
    <<set _temparray.push([$underbottom.id, $underbottom.name, $underbottom.colour])>>
<</if>><</if>>
<<if $legs>>
  <<set _temparray.push([$legs.id, $legs.name, $tempstring])>>
<</if>>
<<if $feet>>
  <<set _temparray.push([$feet.id, $feet.name, $feet.colour])>>
<</if>>
<<if $headacc>>
  <<set _temparray.push([$headacc.id, $headacc.name, $headacc.colour])>>
<</if>>
<<if $faceacc>>
  <<set _temparray.push([$faceacc.id, $faceacc.name, $faceacc.colour])>>
<</if>>
<<if $neckacc>>
  <<set _temparray.push([$neckacc.id, $neckacc.name, $neckacc.colour])>>
<</if>>
<<if $underacc>>
  <<set _temparray.push([$underacc.id, $underacc.name, $underacc.colour])>>
<</if>>
<<switch $args[0]>>
<<case "sleep">>
  <<set $clothingset.sleep to _temparray>>
<<case "school">>
  <<set $clothingset.school to _temparray>>
<<case "casual">>
  <<set $clothingset.casual to _temparray>>
<<case "beach">>
  <<set $clothingset.beach to _temparray>>
<<case "pool">>
  <<set $clothingset.pool to _temparray>>
<<case "last">>
  <<set $clothingset.last to _temparray>>
<<case "c1">>
  <<set $clothingset.c1 to _temparray>>
<<case "c2">>
  <<set $clothingset.c2 to _temparray>>
<<case "c3">>
  <<set $clothingset.c3 to _temparray>>
<<case "c4">>
  <<set $clothingset.c4 to _temparray>>
<</switch>>
<<if !_message>> <<set _message to {message: "You memorize this ensemble for future use."}>> <</if>>
<<clothesmessage "setsave" _message>>
<</nobr>><</widget>>

:: Widgets Clothing Caption [widget]
<<widget "clothingcaption">><<nobr>>

<<if $upperclothes is "naked">>
	<<if $lowerclothes is "naked">>
		<<if $underclothes is "naked">>
		You are completely naked!
		<</if>>
		<<if $underclothes isnot "naked">>
		You are wearing nothing but a <<if $undertype isnot "chastity">>pair of <</if>><<underintegrity>> $undercolour $underclothes.
		<</if>>
	<</if>>
	<<if $lowerclothes isnot "naked">>
		<<if $underclothes is "naked">>
		You are topless and wearing no underwear but your lower half is covered by <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes.
		<</if>>
		<<if $underclothes isnot "naked">>
		You are topless with <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes and <<underword>> <<underintegrity>> $undercolour $underclothes.
		<</if>>
	<</if>>
<<elseif $upperclothes isnot "naked">>
	<<if $lowerclothes is "naked">>
		<<if $underclothes is "naked">>
			<<if $upperonepiece is 1 and $lowerset isnot $upperset>>
			You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes that has been torn at the waist  leaving your bottom half completely exposed!
			<<else>>
		Your bottom half is completely exposed! You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes.
			<</if>>
		<</if>>
		<<if $underclothes isnot "naked">>
			<<if $upperonepiece is 1 and $lowerset isnot $upperset>>
			You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes that has been torn at the waist  leaving your <<underword>> <<underintegrity>> $undercolour $underclothes exposed.
			<<else>>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes and exposed <<underword>> <<underintegrity>> $undercolour $underclothes.
			<</if>>
		<</if>>
	<</if>>
	<<if $lowerclothes isnot "naked">>
		<<if $underclothes is "naked">>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes
		<<if $loweronepiece isnot 1>>and <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes
		<</if>>
		<<if $lowertype is "swim">>and<<else>>but<</if>> you are not wearing underwear.
		<</if>>
		<<if $underclothes isnot "naked">>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes
		<<if $loweronepiece isnot 1>>with <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes
		<</if>>and <<underword>> <<underintegrity>> $undercolour $underclothes.
		<</if>>
	<</if>>
<</if>>

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

<<widget "stripcaption">><<nobr>>

<<if $uppertype isnot "naked" and $upperwetstage gte 3 and $lowertype isnot "naked" and $lowerwetstage gte 3 and $undertype isnot "naked" and $undertype isnot "chastity" and $underwetstage gte 3>>
	<<if $upperset is $lowerset>>

Your $upperclothes, skirt and $underclothes are drenched, revealing your <<breasts>> and <<genitalsstop>>

	<<else>>

Your $upperclothes, $lowerclothes and $underclothes are drenched, revealing your <<breasts>> and <<genitalsstop>>

	<</if>>

<<elseif $uppertype isnot "naked" and $upperwetstage gte 3 and $lowerwetstage gte 3 and $lowertype isnot "naked">>
	<<if $upperset is $lowerset>>

Your $upperclothes and skirt are drenched, revealing your <<breasts>> and <<undiesstop>>

	<<else>>

Your $upperclothes and $lowerclothes are drenched, revealing your <<breasts>> and <<undiesstop>>

	<</if>>

<<elseif $uppertype isnot "naked" and $upperwetstage gte 3>>

Your $upperclothes <<upperplural>> drenched, revealing your <<breastsstop>>

<<elseif $lowertype isnot "naked" and $lowerwetstage gte 3 and $undertype isnot "naked" and $undertype isnot "chastity" and $underwetstage gte 3>>

Your $lowerclothes and $underclothes are drenched, revealing your <<genitalsstop>>

<<elseif $lowertype isnot "naked" and $lowerwetstage gte 3>>

Your $lowerclothes <<lowerplural>> drenched, revealing your <<undiesstop>>

<<elseif $undertype isnot "naked" and $undertype isnot "chastity" and $underwetstage gte 3>>

Your $underclothes <<underplural>> drenched, revealing your <<genitalsstop>>

<<elseif $uppertype isnot "naked" and $upperexposed is 2 and $lowertype isnot "naked" and $lowerexposed is 2 and $undertype isnot "naked" and $undertype isnot "chastity" and $understate isnot "waist">>
	<<if $upperset is $lowerset>>

Your $upperclothes, skirt and $underclothes have been pulled aside, revealing your <<breasts>> and <<genitalsstop>>

	<<else>>

Your $upperclothes, $lowerclothes and $underclothes have been pulled aside, revealing your <<breasts>> and <<genitalsstop>>

	<</if>>

<<elseif $uppertype isnot "naked" and $upperexposed is 2 and $lowerexposed is 2 and $lowertype isnot "naked">>
	<<if $upperset is $lowerset>>

Your $upperclothes and skirt have been pulled aside, revealing your <<breasts>> and <<undiesstop>>

	<<else>>

Your $upperclothes and $lowerclothes have been pulled aside, revealing your <<breasts>> and <<undiesstop>>

	<</if>>

<<elseif $uppertype isnot "naked" and $upperexposed is 2>>

Your $upperclothes <<upperhas>> been pulled aside, revealing your <<breastsstop>>

<<elseif $lowertype isnot "naked" and $lowerexposed is 2 and $undertype isnot "naked" and $undertype isnot "chastity" and $understate isnot "waist">>

Your $lowerclothes <<lowerhas>> been pulled aside and your $underclothes pulled down, revealing your <<genitalsstop>>

<<elseif $lowertype isnot "naked" and $lowerexposed is 2>>

Your $lowerclothes <<lowerhas>> been pulled aside, revealing your <<undiesstop>>

<<elseif $undertype isnot "naked" and $undertype isnot "chastity" and $understate isnot "waist">>

Your $underclothes <<underhas>> been pulled down to your $understate, revealing your <<genitalsstop>>

<</if>>

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