# wardrobe

if $ARGS[0] = 'start':
	if $wardrobeDefaultPagePref = '': $wardrobeDefaultPagePref = 'default1'
	killvar 'clothingfilter'
	'<center><font color="maroon">Please select an option</font></center>'
	*nl
	*nl
	*nl
	!! current outfit
	'<center><a href="exec:gt ''wardrobe'', ''main''"><img src="images/system/icons/clothing/clothes.png" height="150"></a></center>'
	*nl
	*nl
	*nl
	!! Clothing sets
	'<center><a href="exec:gt ''wardrobe'', $wloc"><img src="images/system/icons/clothing/default.png" height="150"></a></center>'
	*nl
	*nl
	*nl
	!! outfit list
	'<center><a href="exec:gt ''clothing'', ''view_clothing_list'', ''wardrobe''"><img src="images/system/icons/clothing/organize.png" height="150"></a></center>'

	if $pursepantytype ! '' or $pursebratype ! '':
		'<center><b>You put the '+iif($pursepantytype ! '','panties','')+iif($pursepantytype ! '' and $pursebratype ! '',' and ','')+iif($pursebratype ! '','bra','')+' from your purse back in the wardrobe.</b></center><br>'
		killvar '$pursepantytype' & killvar 'pursepantynumber'
		killvar '$pursebratype' & killvar 'pursebranumber'
	end

    if $wardrobeDefaultPagePref = 'currentOutfit':
		gt 'wardrobe', 'main'
    elseif $wardrobeDefaultPagePref = 'viewClothing':
		gt 'clothing', 'view_clothing_list', 'wardrobe'
    elseif $wardrobeDefaultPagePref ! '':
		gt 'wardrobe', $wardrobeDefaultPagePref
	end

    act 'Return': gt $loc, $loc_arg
	act 'Current outfit': gt 'wardrobe', 'main'
	act 'Saved outfit sets':
		if $wardrobeDefaultPagePref ! 'currentOutfit' and $wardrobeDefaultPagePref ! 'viewClothing':
			gt 'wardrobe', $wardrobeDefaultPagePref
		else
			gt 'wardrobe', $wloc
		end
	end
	act 'Open wardrobe': gt 'clothing', 'view_clothing_list'
end



if $ARGS[0] = 'main':
	PShoQuality = ShoQuality
	PShoHeels = ShoHeels
	PShoCut = ShoCut
	PShoStyle = ShoStyle
	menu_off = 1
	gs 'stat'
	if CloBra = 1: gs 'bras', 'remove'
	if CloPanties = 1: gs 'panties','remove'
	if $sports_clothing_name = '':$sports_clothing_name = 'default sports outfit'
	if $clothingworntype = 'misc_outfits' and clothingwornnumber = '1':
		gs 'clothing', 'swamp_clothes', 0
		gs 'clothing', 'strip'
	end
	if ward_img_hgt = 0:ward_img_hgt = 150
	'<center><table><TH><b>Your Clothes</b></TH><TH><a href="exec:gt ''wardrobe'', $wloc"><img src="images/system/icons/clothing/default.png" height="50"></a></TH><TH><a href="exec:gt ''clothing'', ''view_clothing_list'', ''wardrobe''"><img src="images/system/icons/clothing/organize.png" height="50"></a></TH></table></center>'

	if $wardrobeDefaultPagePref = 'currentOutfit':
	    $wardrobeSetDefault = '<a href="exec: killvar ''$wardrobeDefaultPagePref'' & gt ''wardrobe'', ''main''">Remove saved  default wardrobe page</a>'
	else
	    $wardrobeSetDefault = '<a href="exec: $wardrobeDefaultPagePref = ''currentOutfit'' & gt ''wardrobe'', ''main''">Set here as default wardrobe page</a>'
	end
	'<center><<$wardrobeSetDefault>></center>'
    killvar '$wardrobeSetDefault'


	if $pursepantytype ! '' or $pursebratype ! '':
		'<center>You put the '+iif($pursepantytype ! '','panties','')+iif($pursepantytype ! '' and $pursebratype ! '',' and ','')+iif($pursebratype ! '','bra','')+' from your purse back in the wardrobe.</center><br>'
		killvar '$pursepantytype' & killvar 'pursepantynumber'
		killvar '$pursebratype' & killvar 'pursebranumber'
	end
	'<center><font color="maroon">These are the clothes you are currently wearing - Click on an item to change it</font></center><center><table border=0 cellspacing=<<ward_img_hgt/25>> cellpadding=5>'
	if underwear['type'] = 0:
		*p '<TH>Bra worn</TH><TH>Outfit worn</TH><TH>Coat (only worn outside when cold)</TH>'
		*P '<TR><TD><center><a href="exec:gt ''wardrobe'', ''underwear_options'', ''bra''"><img Height = <<ward_img_hgt>> src="<<FUNC(''$body_image'',''bra'')>>"></a></center></TD><TD><center><a href="exec:gt ''clothing_QV'', ''list''"><img Height = <<ward_img_hgt * 2>> src="<<FUNC(''$body_image'',''clothes'')>>"></a></center></TD><TD><center>'
	else
		*p '<TH>Bodysuit worn</TH><TH>Outfit worn</TH><TH>Coat (only worn outside when cold)</TH>'
		*P '<TR><TD ROWSPAN=4><center><a href="exec:gt ''wardrobe'', ''underwear_options'', ''full''"><img Height = <<ward_img_hgt>>*2 src="<<FUNC(''$body_image'',''bodysuit'')>>"></a></center></TD><TD><center><a href="exec:gt ''clothing_QV'', ''list''"><img Height = <<ward_img_hgt * 2>> src="<<FUNC(''$body_image'',''clothes'')>>"></a></center></TD><TD><center>'
	end
		
	if $coatworntype = 'none':
		'<a href="exec:gt ''coats'', ''view_coat_list'', ''wardrobe''">Search the wardrobe</a>'
	else
		'<a href="exec:gt ''coats'', ''view_coat_list'', ''wardrobe''"><img Height = <<ward_img_hgt * 2>> src="<<FUNC(''$body_image'', ''coat'')>>"></a>'
	end
	if underwear['type'] = 0:
		'</center></TD><TR><TD><center>'
		if $braworntype ! 'none':
			'<a href="exec:gs ''bras'', ''remove'' & gt ''wardrobe'', ''main''">Remove</a>'
		else
			'Remove'
		end
		'</center></TD><TD><center>'
	else
		'</center></TD><TR><TD><center>'
	end
	if $clothingworntype ! 'nude':
		'<a href="exec:gs ''clothing'', ''strip'' & gt ''wardrobe'', ''main''">Remove</a>'
	else
		'Remove'
	end
	'</center></TD><TD><center>'
	if $coatworntype ! 'none':
		'<a href="exec:gs ''coats'', ''remove'' & gt ''wardrobe'', ''main''">Remove</a>'
	else
		'Remove'
	end
	'</center></TD>'

	if underwear['type'] = 0:
		*p '<TR><TH>Panties worn</TH><TH>Shoes (Only worn outside)</TH><TH>Purse worn</TH>'
		*P '<TR><TD><center><a href="exec:gt ''wardrobe'', ''underwear_options'', ''panties''"><img Height = <<ward_img_hgt>> src="<<FUNC(''$body_image'',''panties'')>>"></a></center></TD><TD><center><a href="exec:gt ''shoes'', ''view_shoe_list'', ''wardrobe''"><img Height = <<ward_img_hgt>> src="<<FUNC(''$body_image'', ''shoes'')>>"></a></center></TD><TD><center>'
	else
		*p '<TR><TH>Shoes (Only worn outside)</TH><TH>Purse worn</TH>'
		*P '<TR><TD><center><a href="exec:gt ''shoes'', ''view_shoe_list'', ''wardrobe''"><img Height = <<ward_img_hgt>> src="<<FUNC(''$body_image'', ''shoes'')>>"></a></center></TD><TD><center>'
	end
	if bag = 1:
		'<a href="exec:gt ''purses'', ''view_purse_list'',''wardrobe''"><img Height = <<ward_img_hgt>> src="<<FUNC(''$purse_image'', $currentpursetype, currentpursenumber)>>"></a>'
	else
		'<a href="exec:gt ''purses'', ''view_purse_list'',''wardrobe''">Search the wardrobe</a>'
	end
	
	if underwear['type'] = 0:
		'</center></TD><TR><TD><center>'
		if $pantyworntype ! 'none':
			'<a href="exec:gs ''panties'', ''remove'' & gt ''wardrobe'', ''main''">Remove</a>'
		else
			'Remove'
		end
		'</center></TD><TD><center>'
	else
		'</center></TD><TR><TD><center>'
		'<a href="exec:gs ''underwear_bodysuits'', ''remove'' & underwear[''type''] = 0 & gt ''wardrobe'', ''main''">Remove</a>'
		'</center></TD><TD><center>'
	end
	if $shoeworntype ! 'none':
		'<a href="exec:gs ''shoes'', ''strip'' & gt ''wardrobe'', ''main''">Remove</a>'
	else
		'Remove'
	end
	'</center></TD><TD><center>'
	if bag = 1:
		'<a href="exec:gs ''purses'', ''remove'' & gt ''wardrobe'', ''main''">Remove</a>'
	else
		'Remove'
	end
	'</center></TD><TR><TD><TD><center>'
	if ($clothingworntype ! 'nude' and ($coatworntype ! 'none' or bag > 0)) or ($coatworntype ! 'none' and bag > 0):
		'<a href="exec:gs ''wardrobe'', ''removeall'' & gt ''wardrobe'', ''main''">Remove all items</a>'
	else
		'Remove all items'
	end
	*nl
	'<center><font color="grey">Save/load outfits with "Managed saved clothing sets".</font></center>'
	'<TD></center></TD></table></center>'
	
	act 'Close wardrobe': gt $loc, $loc_arg

	act 'Strip all clothing':
		gs 'bras', 'remove'
		gs 'clothing', 'strip'
		gs 'panties', 'remove'
		gs 'shoes', 'strip'
		gt 'wardrobe', 'main'
	end

	act 'Set image size for this view':
		ward_img_hgt = input("Enter height in pixels you want for images on this page <br>(Default 150, min 50, max 500)")
		if ward_img_hgt < 50:
			ward_img_hgt = 50
		elseif ward_img_hgt > 500:
			ward_img_hgt = 500
		end
		gt 'wardrobe', 'main'
	end
end

if $ARGS[0] = 'underwear_options':
	'<center><font color="maroon">Please select an option</font></center>'
	*nl
	*nl
	*nl
	'<center><a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_list'', ''wardrobe''"><img src="images/system/icons/clothing/bodysuits.png" height="150"></a></center>'
	if $ARGS[1] = 'bra' or $ARGS[1] = 'full':
		*nl
		*nl
		*nl
		'<center><a href="exec:gt ''bras'', ''view_bra_list'', ''wardrobe''"><img src="images/system/icons/clothing/bras.png" height="150"></a></center>'
	end
	if $ARGS[1] = 'panties' or $ARGS[1] = 'full':
		*nl
		*nl
		*nl
		'<center><a href="exec:gt ''panties'', ''view_panty_list'', ''wardrobe''"><img src="images/system/icons/clothing/panties.png" height="150"></a></center>'
	end

	act 'Return': gt 'wardrobe', 'main'
end

if $ARGS[0] = 'removeall':
	gs 'bras', 'remove'
	gs 'clothing', 'strip'
	gs 'panties', 'remove'
	gs 'shoes', 'strip'
	gs 'purses', 'remove'
	gs 'coats', 'remove'
end

!!---------------------------Oufit stuff----------------------------------
$default_clothing_suma = {
	RESULT = defclothingnumber[ARGS[0]]+ defbranumber[ARGS[0]] + defpantynumber[ARGS[0]] + defshoenumber[ARGS[0]] + defpursenumber[ARGS[0]] + defcoatnumber[ARGS[0]]
	}

$default_clothing_line = {
	!! a single line in a clothing list (wardrobe, etc)
	!! ARGS 0 - action type (wardrobe, sell, resize, store, forsale)
	!! ARGS 1 - clothing type
	!! ARGS 2 - clothing index

	gs 'themes', 'clothing'
	gs 'clothing_attributes', $defclothingtype[default_entry], defclothingnumber[default_entry]

	$RESULT = '<TR bgcolor='+$temp_bcolor+'>'

	$RESULT +='<TD><b><<$def_clothing_name[default_entry]>></b></TD>'
	
	if defclothingnumber[default_entry] = 0:
		$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
	else
		$RESULT +='<TD><img width="100" src="<<FUNC(''$clothing_image'', $defclothingtype[default_entry], defclothingnumber[default_entry])>>"></TD>'
	end
	if defunderwear[default_entry] = 2:
		if defbodysuitnumber[default_entry] = 0:
			$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
		else
			$RESULT +='<TD><img width="100" src="<<FUNC(''$pcs_outfit_image'', $defbodysuittype[default_entry]+''_bodysuits'', defbodysuitnumber[default_entry])>>"></TD>'
		end
		$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
	else
		if defbranumber[default_entry] = 0:
			$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
		else
			$RESULT +='<TD><img width="100" src="<<FUNC(''$bra_image'',  $defbratype[default_entry], defbranumber[default_entry])>>"></TD>'
		end
		if defpantynumber[default_entry] = 0:
			$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
		else
			$RESULT +='<TD><img width="100" src="<<FUNC(''$panty_image'',  $defpantytype[default_entry], defpantynumber[default_entry])>>"></TD>'
		end
	end
	if defshoenumber[default_entry] = 0:
		$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
	else
		$RESULT +='<TD><img width="100" src="<<FUNC(''$shoe_image'', $defshoetype[default_entry], defshoenumber[default_entry])>>"></TD>'
	end
	if defcoatnumber[default_entry] = 0:
		$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
	else
		$RESULT +='<TD><img width="100" src="<<FUNC(''$coat_image'',  $defcoattype[default_entry], defcoatnumber[default_entry])>>"</TD>'
	end
	if defpursenumber[default_entry] = 0:
		$RESULT +='<TD><img width="100" src="images/pc/items/blank.jpg"></TD>'
	else
		$RESULT +='<TD><img width="100" src="<<FUNC(''$purse_image'',  $defpursetype[default_entry], defpursenumber[default_entry])>>"></TD>'
	end

	$RESULT +='<TD><a href="exec:gs ''wardrobe'', ''default_entry_wear'', <<default_entry>>"><img src="images/system/icons/clothing/wear.png"></a></TD>'
	$RESULT +='<TD><a href="exec:gs ''wardrobe'', ''default_entry_set'', <<default_entry>>"><img src="images/system/icons/clothing/overwrite.png"></a></TD>'
	$RESULT +='<TD><a href="exec:gs ''wardrobe'', ''default_entry_rename'', <<default_entry>>"><img src="images/system/icons/clothing/rename.png"></a></TD>'
	$RESULT +='<TD><a href="exec:gs ''wardrobe'', ''default_entry_delete'', <<default_entry>>"><img src="images/system/icons/clothing/delete_on.png"></a></TD>'
	if $defshoetype[default_entry] = 'danilovich' and $defclothingtype[default_entry] = 'danilovich_outfits':
		if default_sport_number ! default_entry:
			$RESULT += '<TD><a href="exec:gs ''wardrobe'', ''default_sport_set'', <<default_entry>>"><img src="images/system/icons/clothing/sport_off.png"></a></TD><TR>'
		else
			$RESULT += '<TD><img src="images/system/icons/clothing/sport.png"></TD><TR>'
		end
	elseif SchoolAtestat = 0 and CloStyle2 = 4:
		if default_school_number ! default_entry:
			$RESULT += '<TD><a href="exec:gs ''wardrobe'', ''default_school_set'', <<default_entry>>"><img src="images/system/icons/clothing/school_off.png"></a></TD><TR>'
		else
			$RESULT += '<TD><img src="images/system/icons/clothing/school.png"></TD><TR>'
		end
	else
		$RESULT += '<TD></TD><TR>'
	end
}


if $ARGS[0] = 'default_name_initialise':
	if $clothing_default_page[1] = '':$clothing_default_page[1] = 'Set 1'
	if $clothing_default_page[2] = '':$clothing_default_page[2] = 'Set 2'
	if $clothing_default_page[3] = '':$clothing_default_page[3] = 'Set 3'
	if $clothing_default_page[4] = '':$clothing_default_page[4] = 'Set 4'
	if $clothing_default_page[5] = '':$clothing_default_page[5] = 'Set 5'
	if $clothing_default_page[6] = '':$clothing_default_page[6] = 'Set 6'
	if $clothing_default_page[7] = '':$clothing_default_page[7] = 'Set 7'
	if $clothing_default_page[8] = '':$clothing_default_page[8] = 'Set 8'
	if $clothing_default_page[9] = '':$clothing_default_page[9] = 'Set 9'
	if $clothing_default_page[10] = '':$clothing_default_page[10] = 'Set 10'
end

if $ARGS[0] = 'default_template':
	killvar '$temp1'
	killvar 'temp2'
	clothing_default_page = ARGS[1]
	gs 'wardrobe', 'default_name_initialise'
	gs 'stat'

	'<center><table><tr><td><a href="exec:gt ''wardrobe'', ''main''"><img src="images/system/icons/clothing/clothes.png" height="50"></td><td><center><B>Current set: <<$default_entry[2]>></B><br><a href="exec: gs ''wardrobe'', ''default_set_name''">Rename set</a></center></td><td><a href="exec:gt ''clothing'', ''view_clothing_list'', ''wardrobe''"><img src="images/system/icons/clothing/organize.png" height="50"></td></tr><TR><TD></TD></table></center>'

	if $wardrobeDefaultPagePref = $wloc:
	    $wardrobeSetDefault = '<a href="exec: killvar ''$wardrobeDefaultPagePref'' & gt ''wardrobe'', ''<<$wloc>>''">Remove saved default wardrobe page</a>'
	else
	    $wardrobeSetDefault = '<a href="exec: $wardrobeDefaultPagePref = $wloc & gt ''wardrobe'', ''<<$wloc>>''">Set here as default wardrobe page</a>'
	end
	'<center><<$wardrobeSetDefault>></center>'
    killvar '$wardrobeSetDefault'

    '<center><table><TH>Name</TH><TH>Outfit</TH><TH>Bra/Bodysuit</TH><TH>Panties</TH><TH>Shoes</TH><TH>Coat</TH><TH>Purse</TH><TH></TH><TH></TH><TH></TH><TH></TH><TH></TH><TR>'

	temp = default_entry
	:loopdefault_entry_set
		if dyneval($default_clothing_suma,default_entry) ! 0: *p dyneval($default_clothing_line)
		default_entry += 1
	if default_entry <= default_entry[1]:jump 'loopdefault_entry_set'

	default_entry = temp
	:loopdefault_entry_empty
		if dyneval($default_clothing_suma,default_entry) = 0: *p dyneval($default_clothing_line)
		default_entry += 1
	if default_entry <= default_entry[1]:jump 'loopdefault_entry_empty'

	'</table></center>'
	killvar '$temp_bcolor'
end

if $ARGS[0] = 'default_set_name':
	*clr & cla
	$clothing_default_page[clothing_default_page] = input('Enter new name for this set')
	gt 'wardrobe', 'default<<clothing_default_page>>'
end

if $ARGS[0] = 'default_actions':
	act 'Return': gt $loc, $loc_arg
 
	act 'Select outfit to wear':
		cla
		act 'Return': gt 'wardrobe', $wardrobeDefaultPagePref
		gs 'wardrobe', 'default_actions_wear'
	end
	act 'Choose another page':
		cla
		act 'Return': gt 'wardrobe', $wardrobeDefaultPagePref
		gs 'wardrobe', 'default_actions_page'
	end
	act 'Rename this set': gs 'wardrobe', 'default_set_name'
end

if $ARGS[0] = 'default_actions_page':
	if ARGS[1] ! 1: act 'See <<$clothing_default_page[1]>> set': gt 'wardrobe', 'default1'
	if ARGS[1] ! 2: act 'See <<$clothing_default_page[2]>> set': gt 'wardrobe', 'default2'
	if ARGS[1] ! 3: act 'See <<$clothing_default_page[3]>> set': gt 'wardrobe', 'default3'
	if ARGS[1] ! 4: act 'See <<$clothing_default_page[4]>> set': gt 'wardrobe', 'default4'
	if ARGS[1] ! 5: act 'See <<$clothing_default_page[5]>> set': gt 'wardrobe', 'default5'
	if ARGS[1] ! 6: act 'See <<$clothing_default_page[6]>> set': gt 'wardrobe', 'default6'
	if ARGS[1] ! 7: act 'See <<$clothing_default_page[7]>> set': gt 'wardrobe', 'default7'
	if ARGS[1] ! 8: act 'See <<$clothing_default_page[8]>> set': gt 'wardrobe', 'default8'
	if ARGS[1] ! 9: act 'See <<$clothing_default_page[9]>> set': gt 'wardrobe', 'default9'
	if ARGS[1] ! 10: act 'See <<$clothing_default_page[10]>> set': gt 'wardrobe', 'default10'
end

if $ARGS[0] = 'default_actions_wear':
	default_entry -= 10
    i = default_entry
	:loop_default_actions_wear
        if dyneval($default_clothing_suma, i) ! 0:
	        $var_default_actions_wear = dyneval('$result = "act ''Wear <<$def_clothing_name[i]>>'': gs ''wardrobe'', ''default_entry_wear'', <<i>>"')
	        dynamic $var_default_actions_wear
		end
	    i += 1
    if i <= default_entry[1]: jump 'loop_default_actions_wear'
	killvar 'i'
	killvar '$var_default_actions_wear'
end

if $ARGS[0] = 'default1':
	$wloc = 'default1'
	default_entry = 1
	default_entry[1] = 10
	$default_entry[2] = $clothing_default_page[1]

    !! gs default_actions *before* gs default_template
	!! as default_template modifies variable default_entry.
	gs 'wardrobe', 'default_actions', 1
	gs 'wardrobe', 'default_template', 1
end

if $ARGS[0] = 'default2':
	$wloc = 'default2'
	default_entry = 11
	default_entry[1] = 20
	$default_entry[2] = $clothing_default_page[2]

	gs 'wardrobe', 'default_actions', 2
	gs 'wardrobe', 'default_template', 2
end

if $ARGS[0] = 'default3':
	$wloc = 'default3'
	default_entry = 21
	default_entry[1] = 30
	$default_entry[2] = $clothing_default_page[3]

	gs 'wardrobe', 'default_actions', 3
	gs 'wardrobe', 'default_template', 3
end

if $ARGS[0] = 'default4':
	$wloc = 'default4'
	default_entry = 31
	default_entry[1] = 40
	$default_entry[2] = $clothing_default_page[4]

	gs 'wardrobe', 'default_actions', 4
	gs 'wardrobe', 'default_template', 4
end

if $ARGS[0] = 'default5':
	$wloc = 'default5'
	default_entry = 41
	default_entry[1] = 50
	$default_entry[2] = $clothing_default_page[5]

	gs 'wardrobe', 'default_actions', 5
	gs 'wardrobe', 'default_template', 5
end

if $ARGS[0] = 'default6':
	$wloc = 'default6'
	default_entry = 51
	default_entry[1] = 60
	$default_entry[2] = $clothing_default_page[6]

	gs 'wardrobe', 'default_actions', 6
	gs 'wardrobe', 'default_template', 6
end

if $ARGS[0] = 'default7':
	$wloc = 'default7'
	default_entry = 61
	default_entry[1] = 70
	$default_entry[2] = $clothing_default_page[7]

	gs 'wardrobe', 'default_actions', 7
	gs 'wardrobe', 'default_template', 7
end

if $ARGS[0] = 'default8':
	$wloc = 'default8'
	default_entry = 71
	default_entry[1] = 80
	$default_entry[2] = $clothing_default_page[8]

	gs 'wardrobe', 'default_actions', 8
	gs 'wardrobe', 'default_template', 8
end

if $ARGS[0] = 'default9':
	$wloc = 'default9'
	default_entry = 81
	default_entry[1] = 90
	$default_entry[2] = $clothing_default_page[9]

	gs 'wardrobe', 'default_actions', 9
	gs 'wardrobe', 'default_template', 9
end

if $ARGS[0] = 'default10':
	$wloc = 'default10'
	default_entry = 91
	default_entry[1] = 100
	$default_entry[2] = $clothing_default_page[10]

	gs 'wardrobe', 'default_actions', 10
	gs 'wardrobe', 'default_template', 10
end

if $ARGS[0] = 'default_entry_wear':
	gs 'stat'
	default_entry = ARGS[1]

	$temp1 = $defclothingtype[default_entry]
	temp2 = defclothingnumber[default_entry]

	gs 'clothing_attributes', $temp1, temp2
	if ARRPOS('$CloLosTyp', $temp1) ! -1 and ARRPOS('CloLosNum', temp2) ! -1:
		msg '<center>You''ve lost part of this set, and are unable to wear all items.<br>Maybe you can find the missing clothes somewhere?</center>'
		gt 'wardrobe', $wloc
	else
		gs 'clothing', 'wear', $temp1, temp2
	end

	if defunderwear[default_entry] = 2:
		if hypnoPanty = 1 or hypnoBra = 1:
			!! removal of underwear from set if therapist has prohibited it
			$defbodysuittype[default_entry] = 'none' & defbodysuitnumber[default_entry] = 0
			defunderwear[default_entry] = 0
			msg '<center>You feel like something about this set has changed but you cannot workout what it is.</center>'
		elseif dyneval('RESULT = <<$defbodysuittype[default_entry]>>_bodysuits[<<defbodysuitnumber[default_entry]>>]') = 0:
			$defbodysuittype[default_entry] = 'none' & defbodysuitnumber[default_entry] = 0
		end
		if $defbodysuittype[default_entry] = 'none':
			if $bodysuitworntype ! 'none': gs 'underwear_bodysuits', 'remove'
		else
			gs 'underwear_bodysuits', 'wear2', $defbodysuittype[default_entry], defbodysuitnumber[default_entry]
		end
	end

	if defunderwear[default_entry] = 0:
		if dyneval('RESULT = <<$defpantytype[default_entry]>>_panties[<<defpantynumber[default_entry]>>]') = 0:
			$defpantytype[default_entry] = 'none' & defpantynumber[default_entry] = 0
		end
		if $defpantytype[default_entry] = 'none':
			if $pantyworntype ! 'none': gs 'panties', 'remove'
		else
			gs 'panties', 'wear', $defpantytype[default_entry], defpantynumber[default_entry]
		end
		if dyneval('RESULT = <<$defbratype[default_entry]>>_bras[<<defbranumber[default_entry]>>]') = 0:
			$defbratype[default_entry] = 'none' & defbranumber[default_entry] = 0
		end
		if $defbratype[default_entry] = 'none':
			if $braworntype ! 'none': gs 'bras', 'remove'
		else
			gs 'bras', 'wear', $defbratype[default_entry], defbranumber[default_entry]
		end
		if (hypnoPanty = 1 and $pantyworntype ! 'none') or (hypnoBra = 1 and $braworntype ! 'none'):
			!! removal of underwear from set if therapist has prohibited it
			if hypnoPanty = 1 and $pantyworntype ! 'none': $defpantytype[default_entry] = 'none' & defpantynumber[default_entry] = 0
			if hypnoBra = 1 and $braworntype ! 'none': $defbratype[default_entry] = 'none' & defbranumber[default_entry] = 0
			msg '<center>You feel like something about this set has changed but you cannot workout what it is.</center>'
		end
	end

	if dyneval('RESULT = <<$defshoetype[default_entry]>>_shoe[<<defshoenumber[default_entry]>>]') = 0:
		$defshoetype[default_entry] = 'none' & defshoenumber[default_entry] = 0
	else
		gs 'shoes', 'wear', $defshoetype[default_entry], defshoenumber[default_entry]
	end

	if dyneval('RESULT = <<$defpursetype[default_entry]>>_purses[<<defpursenumber[default_entry]>>]') = 0:
		$defpursetype[default_entry] = 'none' & defpursenumber[default_entry] = 0
	else
		$currentpursetype = $defpursetype[default_entry]
		currentpursenumber = defpursenumber[default_entry]
	end

	if $currentpursetype = '' or $currentpursetype = 'none':
		bag = 0
	else
		bag = 1
	end

	if dyneval('RESULT = <<$defcoattype[default_entry]>>_coats[<<defcoatnumber[default_entry]>>]') = 0:
		$defcoattype[default_entry] = 'none' & defcoatnumber[default_entry] = 0
	else
		gs 'coats', 'wear', $defcoattype[default_entry], defcoatnumber[default_entry]
	end

	!checks for suitable clothing if therapist is forcing revealing outfits
	if hypnoClothes = 1:
		temp3 = 0
		if $temp1 = 'salacious_outfits' or $temp1 = 'salacious_dress':
			temp3 = 1
		elseif CloThinness >= 6:
			temp3 = 1
		elseif $temp1 = 'danilovich_outfits' and CloThinness >= 5:
			temp3 = 1
		elseif ($temp1 = 'eroto_outfits' or $temp1 = 'eroto_dress' or $temp1 = 'eroto_strip') and CloThinness >= 3:
			temp3 = 1
		elseif CloStyle2 = 4:
			temp3 = 1
		end
	end

	!! default school girl uniform is always allowed to be worn if still in school
	if mid($start_type,1,2) = 'sg' and SchoolAtestat = 0 and SchoolBlock = 0 and $temp1 = 'gm_school' and temp2 = 6:
		cls
		'<center><video autoplay loop src="images/pc/activities/misc/dress_1.mp4"></video></center>'
		'Your put on your <<$def_clothing_name[default_entry]>> outfit without any problems.'
		act 'Return': gt 'wardrobe', $wloc
	!! do not own this clothing anymore
	elseif dyneval('RESULT = <<$temp1>>[<<temp2>>]') = 0 and temp2 ! 0:
		cls
		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/boy/niko/nikoev/school/strip/strip2.jpg"></center>'
		'As you go to pull your <<$def_clothing_name[default_entry]>> outfit out of your wardrobe you remember you don''t own that piece of clothing anymore. Maybe you should buy it again? Guess you will have to find something else to wear.'
		act 'Return': gt 'wardrobe', $wloc
	!! strength of clothing is less than or equal to 0
	elseif dyneval('RESULT = <<$temp1>>_h[<<temp2>>]') <= 0 and $temp1 ! 'nude':
		cls
		'<center><video autoplay loop src="images/characters/pavlovsk/school/girl/vicky/event/vika_game_strip16.mp4"></video></center>'
		'Your <<$def_clothing_name[default_entry]>> outfit has worn out and can''t be used anymore. Guess you will have to find something else to wear.'
		act 'Strip out of worn out clothing':
			cla
			gs 'clothing', 'strip'
			gs 'wardrobe', 'default_entry_delete'
			gs 'stat'
			act 'Return': gt 'wardrobe', $wloc
		end
	!!Therapist force exhibitionist clothing check
	elseif hypnoClothes > 0 and temp3 = 0:
		cla & *clr
		'<center><video autoplay loop src="images/locations/pavlovsk/trainstation/bimbo.strip6.mp4"/></center>'
		'You pick up the outfit and think about trying them on... but you don''t really like wearing these type of outfits'
		gs 'willpower', 'misc', 'resist', 'easy'
		will_cost += hypnoTime
		if will_cost <= pcs_willpwr:
			act 'Put them on anyways (<<will_cost>> Willpower)':
				gs 'willpower', 'pay', 'resist'
				gt 'wardrobe', $wloc
			end
		else
			act 'Put them on anyways (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
		end
		act 'Strip out of restrictive clothing':
			gs 'clothing', 'strip'
			gs 'stat'
			gt 'wardrobe', $wloc
		end
	!! clothing exhibition is greater than player exhibition
	elseif CloInhibit > pcs_inhib:
		cls
		'<center><video autoplay loop src="images/locations/pavlovsk/trainstation/bimbo.strip6.mp4"></video></center>'
		'You don''t feel daring enough to wear your <<$def_clothing_name[default_entry]>> outfit. Maybe you will be confident enough in the future? Guess you will have to find something else to wear.'
		act 'Strip out of revealing clothing':
			cla
			gs 'clothing', 'strip'
			gs 'stat'
			act 'Return': gt 'wardrobe', $wloc
		end
	!! not exercise clothing, and not loose fitting
	elseif $temp1 ! 'danilovich_outfits' and CloStyle ! 5:
		!! check for if the hipsize is too far from your hipsize
		dynamic 'RESULT = <<$temp1>>_b[<<temp2>>]'
		if RESULT < pcs_hips - 8 or RESULT > pcs_hips + 8:
			cls
			iif(RESULT < pcs_hips - 8,'<center><video autoplay loop src="images/locations/pavlovsk/clinic/therapist/dressup.mp4"></video></center>','<center><video autoplay loop src="images/locations/pavlovsk/clinic/therapist/stripping<<rand(1,4)>>.mp4"></video></center>')
			'As you put on your <<$def_clothing_name[default_entry]>> outfit you notice it doesn''t fit correctly anymore. It''s ' + iif(RESULT < pcs_hips - 8,'unbearably tight and uncomfortable to wear.','extremely loose and won''t stay in place no matter how hard you try.') + ' You must have ' + iif(RESULT < pcs_hips - 8,'gained','lost') + ' some weight since this was purchased or last tailored. You will have to get this clothing resized before you can wear it again.'
			act 'Strip out of ill-fitting clothing':
				cla
				gs 'clothing', 'strip'
				gs 'stat'
				act 'Return': gt 'wardrobe', $wloc
			end
		!! clothing ok to wear after passing hip check
		else
			cls
			'<center><video autoplay loop src="images/pc/activities/misc/dress_1.mp4"></video></center>'
			'Your put on your <<$def_clothing_name[default_entry]>> outfit without any problems.'
			act 'Return': gt 'wardrobe', $wloc
		end
	!! clothing ok to wear without needing hip check and passing all other checks
	else
		cls
		'<center><video autoplay loop src="images/pc/activities/misc/dress_1.mp4"></video></center>'
		'Your put on your <<$def_clothing_name[default_entry]>> outfit without any problems.'
		act 'Return': gt 'wardrobe', $wloc
	end
	killvar '$temp1'
	killvar 'temp2'
	killvar 'temp3'
end

if $ARGS[0] = 'default_entry_set':
	gs 'stat'
	i = ARGS[1]
	$defclothingtype[i] = $clothingworntype
	defclothingnumber[i] = clothingwornnumber
	defunderwear[i] = underwear['type']
	if underwear['type'] = 2:
		$defbodysuittype[i] = $bodysuitworntype
		defbodysuitnumber[i] = bodysuitwornnumber
	else
		$defbratype[i] = $braworntype
		defbranumber[i] = brawornnumber
		$defpantytype[i] = $pantyworntype
		defpantynumber[i] = pantywornnumber
	end
	$defshoetype[i] = $shoeworntype
	defshoenumber[i] = shoewornnumber
	if bag = 1:
		$defpursetype[i] = $currentpursetype
		defpursenumber[i] = currentpursenumber
	else
		$defpursetype[i] = 'none'
	end
	$defcoattype[i] = $coatworntype
	defcoatnumber[i] = coatwornnumber

	$def_clothing_temp = '<<$def_clothing_name[i]>>'
	$def_clothing_name[i] = input ('<center>Enter a name for this outfit set<br><font color="grey">Leaving blank will reuse current name.</font></center>')
	if $def_clothing_name[i] = '' and $def_clothing_temp = '':
		$def_clothing_name[i] = 'Custom <<i>>'
	elseif $def_clothing_name[i] = '':
		$def_clothing_name[i] = '<<$def_clothing_temp>>'
	end
	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_entry_rename':
	gs 'stat'
	i = ARGS[1]

	$def_clothing_temp = '<<$def_clothing_name[i]>>'
	$def_clothing_name[i] = input ('<center>Enter a name for this outfit set<br><font color="grey">Leaving blank will reuse current name.</font></center>')
	if $def_clothing_name[i] = '' and $def_clothing_temp = '':
		$def_clothing_name[i] = 'Custom <<i>>'
	elseif $def_clothing_name[i] = '':
		$def_clothing_name[i] = '<<$def_clothing_temp>>'
	end
	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_entry_up':
	gs 'stat'
	i = ARGS[1]

	if i = 0:
		j = ARRSIZE('defclothingnumber') - 1
	else
		j = i - 1
	end

	$tempclothingworntype = $defclothingtype[i]
	tempclothingwornnumber = defclothingnumber[i]
	if underwear['type'] = 2:
		$tempbodysuittype[i] = $defbodysuittype[i]
		tempbodysuitnumber[i] = defbodysuitnumber[i]
	else
		$tempbraworntype = $defbratype[i]
		tempbrawornnumber = defbranumber[i]
		$temppantyworntype = $defpantytype[i]
		temppantywornnumber = defpantynumber[i]
	end
	$tempshoeworntype = $defshoetype[i]
	tempshoewornnumber = defshoenumber[i]
	$tempcurrentpursetype = $defpursetype[i]
	tempcurrentpursenumber = defpursenumber[i]
	$tempcurrentcoattype = $defcoattype[i]
	tempcurrentcoatnumber = defcoatnumber[i]
	$def_clothing_temp = '<<$def_clothing_name[i]>>'

	$defclothingtype[i] = $defclothingtype[j]
	defclothingnumber[i] = defclothingnumber[j]
	if underwear['type'] = 2:
		$defbodysuittype[i] = $defbodysuittype[j]
		defbodysuitnumber[i] = defbodysuitnumber[j]
	else
		$defbratype[i] = $defbratype[j]
		defbranumber[i] = defbranumber[j]
		$defpantytype[i] = $defpantytype[j]
		defpantynumber[i] = defpantynumber[j]
	end
	$defbratype[i] = $defbratype[j]
	defbranumber[i] = defbranumber[j]
	$defpantytype[i] = $defpantytype[j]
	defpantynumber[i] = defpantynumber[j]
	$defshoetype[i] = $defshoetype[j]
	defshoenumber[i] = defshoenumber[j]
	$defpursetype[i] = $defpursetype[j]
	defpursenumber[i] = defpursenumber[j]
	$defcoattype[i] = $defcoattype[j]
	defcoatnumber[i] = defcoatnumber[j]
	$def_clothing_name[i] = '<<$def_clothing_name[j]>>'

	$defclothingtype[j] = $tempclothingworntype
	defclothingnumber[j] = tempclothingwornnumber
	if underwear['type'] = 2:
		$defbodysuittype[j] = $tempbodysuittype
		defbodysuitnumber[j] = tempbodysuitnumber
	else
		$defbratype[j] = $tempbraworntype
		defbranumber[j] = tempbrawornnumber
		$defpantytype[j] = $temppantyworntype
		defpantynumber[j] = temppantywornnumber
	end
	$defshoetype[j] = $tempshoeworntype
	defshoenumber[j] = tempshoewornnumber
	$defpursetype[j] = $tempcurrentpursetype
	defpursenumber[j] = tempcurrentpursenumber
	$defcoattype[j] = $tempcurrentcoattype
	defcoatnumber[j] = tempcurrentcoatnumber
	$def_clothing_name[j] = '<<$def_clothing_temp>>'

	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_entry_down':
	gs 'stat'
	i = ARGS[1]

	if i = ARRSIZE('defclothingnumber') - 1:
		j = 0
	else
		j = i + 1
	end

	$tempclothingworntype = $defclothingtype[i]
	tempclothingwornnumber = defclothingnumber[i]
	$tempbraworntype = $defbratype[i]
	tempbrawornnumber = defbranumber[i]
	$temppantyworntype = $defpantytype[i]
	temppantywornnumber = defpantynumber[i]
	$tempshoeworntype = $defshoetype[i]
	tempshoewornnumber = defshoenumber[i]
	$tempcurrentpursetype = $defpursetype[i]
	tempcurrentpursenumber = defpursenumber[i]
	$tempcurrentcoattype = $defcoattype[i]
	tempcurrentcoatnumber = defcoatnumber[i]
	$def_clothing_temp = '<<$def_clothing_name[i]>>'

	$defclothingtype[i] = $defclothingtype[j]
	defclothingnumber[i] = defclothingnumber[j]
	$defbratype[i] = $defbratype[j]
	defbranumber[i] = defbranumber[j]
	$defpantytype[i] = $defpantytype[j]
	defpantynumber[i] = defpantynumber[j]
	$defshoetype[i] = $defshoetype[j]
	defshoenumber[i] = defshoenumber[j]
	$defpursetype[i] = $defpursetype[j]
	defpursenumber[i] = defpursenumber[j]
	$defcoattype[i] = $defcoattype[j]
	defcoatnumber[i] = defcoatnumber[j]
	$def_clothing_name[i] = '<<$def_clothing_name[j]>>'

	$defclothingtype[j] = $tempclothingworntype
	defclothingnumber[j] = tempclothingwornnumber
	$defbratype[j] = $tempbraworntype
	defbranumber[j] = tempbrawornnumber
	$defpantytype[j] = $temppantyworntype
	defpantynumber[j] = temppantywornnumber
	$defshoetype[j] = $tempshoeworntype
	defshoenumber[j] = tempshoewornnumber
	$defpursetype[j] = $tempcurrentpursetype
	defpursenumber[j] = tempcurrentpursenumber
	$defcoattype[j] = $tempcurrentcoattype
	defcoatnumber[j] = tempcurrentcoatnumber
	$def_clothing_name[j] = '<<$def_clothing_temp>>'

	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_entry_delete':
	gs 'stat'
	i = ARGS[1]
	$defclothingtype[i] = ''
	defclothingnumber[i] = ''
	defunderwear[i] = ''
	$defbodysuittype[i] = ''
	defbodysuitnumber[i] = ''
	$defbratype[i] = ''
	defbranumber[i] = ''
	$defpantytype[i] = ''
	defpantynumber[i] = ''
	$defshoetype[i] = ''
	defshoenumber[i] = ''
	$defpursetype[i] = ''
	defpursenumber[i] = ''
	$defcoattype[i] = ''
	defcoatnumber[i] = ''
	$def_clothing_name[i] = ''
    if default_sport_number = i: 
		default_sport_number = 0
	end
    if default_school_number = i: 
		default_school_number = 0
	end
	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_sport_set':
	gs 'stat'
	default_sport_number = ARGS[1]
	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'default_school_set':
	gs 'stat'
	default_school_number = ARGS[1]
	gt 'wardrobe', $wloc
end

if $ARGS[0] = 'school_outfit':
	! if no outfit set in wardrobe they use the default
	if default_school_number = 0:	
		gs 'clothing', 'wear', 'gm_school', 6
		gs 'panties', 'wear', $lastwornpantytype['bed'], lastwornpantynumber['bed']
		gs 'bras', 'wear', $lastwornbratype['bed'], lastwornbranumber['bed']
		if $bed['shoetype'] ! 'none':
			gs 'shoes', 'wear', $bed['shoetype'], bed['shoenumber']
		end
	else
		gs  'wardrobe', 'default_entry_wear', default_school_number
	end
end

if $ARGS[0] = 'default_clothing_options':
	if default_sport_number = 0: 'You have no default sports clothing set, you can set this in your wardrobe.'
	if default_school_number = 0: 'You have no default school uniform set, you can set this in your wardrobe.'

	!!checks to see if either full outfit is currently being worn
	gs 'wardrobe', 'is_school'
	gs 'wardrobe', 'is_sport'
	if default_sport_number[2] = 5 or default_school_number[2] = 5:
		act 'Change into your regular clothes':
			gs 'wardrobe', 'back_to_regular_clothes'
			if func('prostitution_functions', 'is_default') ! 0: gs 'wardrobe', 'back_to_regular_clothes'
			gt $loc, $loc_arg
		end
	else
		if default_sport_number ! 0:
			!! check to see if sports outfit is worn out
			if dyneval('RESULT = <<$defclothingtype[default_sport_number]>>_h[<<defclothingnumber[default_sport_number]>>]') <= 0:
				act 'Put on your sports clothes': msg '<font color="red">Unavailable as outfit is worn out!</font>'
			!! check to see that player is not wearing default sports outfit
			elseif default_sport_number[2] ! 5:
				act 'Put on your sports clothes':
					if func('prostitution_functions', 'is_default') ! 0: gs 'wardrobe', 'back_to_regular_clothes'
					
					$lastwornclothingtype['sport'] = $clothingworntype
					lastwornclothingnumber['sport'] = clothingwornnumber
					lastwornunderwear['sport'] = 0
					if underwear['type'] = 2:
						lastwornunderwear['sport'] = 2
						$lastwornbodysuittype['sport'] = $bodysuitworntype
						lastwornbodysuitnumber['sport'] = bodysuitwornnumber
					else
						$lastwornpantytype['sport'] = $pantyworntype
						lastwornpantynumber['sport'] = pantywornnumber
						$lastwornbratype['sport'] = $braworntype
						lastwornbranumber['sport'] = brawornnumber
					end
					$lastwornshoetype['sport'] = $shoeworntype
					lastwornshoenumber['sport'] = shoewornnumber
					$lastwornpursetype['sport'] = $currentpursetype
					lastwornpursenumber['sport'] = currentpursenumber
					$lastworncoattype['sport'] = $coatworntype
					lastworncoatnumber['sport'] = coatwornnumber
					gs  'wardrobe', 'default_entry_wear', default_sport_number
					gt $loc, $loc_arg
				end
			end
		end

		if (default_school_number ! 0 and SchoolAtestat = 0):
			!! If using the default uniform as their default
			if $defclothingtype[default_school_number] = 'gm_school' and defclothingnumber[default_school_number] = 6:
				act 'Put on your school uniform': gs 'wardrobe', 'default_school_wear'
			!! check to see if schools outfit is worn out
			elseif dyneval('RESULT = <<$defclothingtype[default_school_number]>>_h[<<defclothingnumber[default_school_number]>>]') <= 0:
				act 'Put on your school uniform': msg '<font color="red">Unavailable as outfit is worn out!</font>'
			!! check to see that player is not wearing default schools outfit
			elseif default_school_number[2] ! 5:
				act 'Put on your school uniform': gs 'wardrobe', 'default_school_wear'
			end
		end
	end
end

if $ARGS[0] = 'default_school_wear':
	if func('prostitution_functions', 'is_default') ! 0: gs 'wardrobe', 'back_to_regular_clothes'
	
	$lastwornclothingtype['school'] = $clothingworntype
	lastwornclothingnumber['school'] = clothingwornnumber
	lastwornunderwear['school'] = 0
	if underwear['type'] = 2:
		lastwornunderwear['school'] = 2
		$lastwornbodysuittype['school'] = $bodysuitworntype
		lastwornbodysuitnumber['school'] = bodysuitwornnumber
	else
		$lastwornpantytype['school'] = $pantyworntype
		lastwornpantynumber['school'] = pantywornnumber
		$lastwornbratype['school'] = $braworntype
		lastwornbranumber['school'] = brawornnumber
	end
	$lastwornshoetype['school'] = $shoeworntype
	lastwornshoenumber['school'] = shoewornnumber
	$lastwornpursetype['school'] = $currentpursetype
	lastwornpursenumber['school'] = currentpursenumber
	$lastworncoattype['school'] = $coatworntype
	lastworncoatnumber['school'] = coatwornnumber
	gs  'wardrobe', 'default_entry_wear', default_school_number
	gt $loc, $loc_arg
end

if $ARGS[0] = 'is_sport':
	!! checks to see if player is wearing the default sports set using default_sport_number[2]
	default_sport_number[2] = 0
	if $clothingworntype = $defclothingtype[default_sport_number] and clothingwornnumber = defclothingnumber[default_sport_number]: default_sport_number[2] += 1
	if defunderwear[default_sport_number] = 2:
		if $bodysuitworntype = $defbodysuittype[default_sport_number] and bodysuitwornnumber = defbodysuitnumber[default_sport_number]: default_sport_number[2] += 1
	else
		if $pantyworntype = $defpantytype[default_sport_number] and pantywornnumber = defpantynumber[default_sport_number] and $braworntype = $defbratype[default_sport_number] and brawornnumber = defbranumber[default_sport_number]: default_sport_number[2] += 1
	end
	if $shoeworntype = $defshoetype[default_sport_number] and shoewornnumber = defshoenumber[default_sport_number]: default_sport_number[2] += 1
	if $currentpursetype = $defpursetype[default_sport_number] and currentpursenumber = defpursenumber[default_sport_number]: default_sport_number[2] += 1
	if $coatworntype = $defcoattype[default_sport_number] and coatwornnumber = defcoatnumber[default_sport_number]: default_sport_number[2] += 1
end



if $ARGS[0] = 'is_school':
	!! checks to see if player is wearing the default school set using default_school_number[2]
	default_school_number[2] = 0
	if $clothingworntype = $defclothingtype[default_school_number] and clothingwornnumber = defclothingnumber[default_school_number]: default_school_number[2] += 1
	if defunderwear[default_school_number] = 2:
		if $bodysuitworntype = $defbodysuittype[default_school_number] and bodysuitwornnumber = defbodysuitnumber[default_school_number]: default_school_number[2] += 1
	else
		if $pantyworntype = $defpantytype[default_school_number] and pantywornnumber = defpantynumber[default_school_number] and $braworntype = $defbratype[default_school_number] and brawornnumber = defbranumber[default_school_number]: default_school_number[2] += 1
	end
	if $shoeworntype = $defshoetype[default_school_number] and shoewornnumber = defshoenumber[default_school_number]: default_school_number[2] += 1
	if $currentpursetype = $defpursetype[default_school_number] and currentpursenumber = defpursenumber[default_school_number]: default_school_number[2] += 1
	if $coatworntype = $defcoattype[default_school_number] and coatwornnumber = defcoatnumber[default_school_number]: default_school_number[2] += 1
end

if $ARGS[0] = 'back_to_regular_clothes':

	!! wearing prostitute outfit
	if func('prostitution_functions', 'is_default') ! 0:
		if $lastwornclothingtype['prostitute'] = '':
			gs 'clothing', 'wear_last_worn'
			gs 'underwear', 'wear', 'wear_last_worn'
			gs 'shoes', 'wear', 'last_worn'
			gs 'purses', 'wear', 'last_worn'
			gs 'coats', 'wear', 'last_worn'
		else
			!!-- Clothing
			gs 'clothing', 'wear', $lastwornclothingtype['prostitute'], lastwornclothingnumber['prostitute']
			!!-- Underwear
			if lastwornunderwear['prostitute'] = 2:
				gs 'underwear_bodysuits', 'wear', $lastwornbodysuittype['prostitute'], lastwornbodysuitnumber['prostitute']
			else
				gs 'panties', 'wear', $lastwornpantytype['prostitute'], lastwornpantynumber['prostitute']
				gs 'bras',    'wear', $lastwornbratype['prostitute'],   lastwornbranumber['prostitute']
			end
			!!-- Shoes
			gs 'shoes',  'wear', $lastwornshoetype['prostitute'],  lastwornshoenumber['prostitute']
			gs 'purses', 'wear', $lastwornpursetype['prostitute'], lastwornpursenumber['prostitute']
			gs 'coats',  'wear', $lastworncoattype['prostitute'],  lastworncoatnumber['prostitute']
		end

		gs 'prostitution_functions', 'work_clothes'
		if prostitute['changed_for_work']: prostitute['changed_for_work'] = 0

	!! wearing sport outfit
	elseif default_sport_number[2] >= 5:
		if $lastwornclothingtype['sport'] = '':
			gs 'clothing', 'wear_last_worn'
			gs 'underwear', 'wear', 'wear_last_worn'
			gs 'shoes', 'wear', 'last_worn'
			gs 'purses', 'wear', 'last_worn'
			gs 'coats', 'wear', 'last_worn'
		else
			gs 'clothing', 'wear', $lastwornclothingtype['sport'], lastwornclothingnumber['sport']

			if lastwornunderwear['sport'] = 2:
				gs 'underwear_bodysuits', 'wear', $lastwornbodysuittype['sport'], lastwornbodysuitnumber['sport']
			else
				gs 'panties', 'wear', $lastwornpantytype['sport'], lastwornpantynumber['sport']
				gs 'bras',    'wear', $lastwornbratype['sport'],   lastwornbranumber['sport']
			end
			gs 'shoes',  'wear', $lastwornshoetype['sport'],  lastwornshoenumber['sport']
			gs 'purses', 'wear', $lastwornpursetype['sport'], lastwornpursenumber['sport']
			gs 'coats',  'wear', $lastworncoattype['sport'],  lastworncoatnumber['sport']
		end

		default_sport_number[2] = 0

	!! wearing school uniform
	elseif default_school_number[2] >= 5:
		if $lastwornclothingtype['school'] = '':
			gs 'clothing', 'wear_last_worn'
			gs 'underwear', 'wear', 'wear_last_worn'
			gs 'shoes', 'wear', 'last_worn'
			gs 'purses', 'wear', 'last_worn'
			gs 'coats', 'wear', 'last_worn'
		else
			gs 'clothing', 'wear', $lastwornclothingtype['school'], lastwornclothingnumber['school']

			if lastwornunderwear['school'] = 2:
				gs 'underwear_bodysuits', 'wear', $lastwornbodysuittype['school'], lastwornbodysuitnumber['school']
			else
				gs 'panties', 'wear', $lastwornpantytype['school'], lastwornpantynumber['school']
				gs 'bras',    'wear', $lastwornbratype['school'],   lastwornbranumber['school']
			end
			gs 'shoes',  'wear', $lastwornshoetype['school'],  lastwornshoenumber['school']
			gs 'purses', 'wear', $lastwornpursetype['school'], lastwornpursenumber['school']
			gs 'coats',  'wear', $lastworncoattype['school'],  lastworncoatnumber['school']
		end

		default_school_number[2] = 0
	end
end

--- wardrobe ---------------------------------

