# underwear_bodysuits

!!This is bodysuits file and that means underwear['type'] = 2
!!bodysuits use the panty term in variables, this is intentional
!!gs 'underwear_bodysuits', 'dispose'
!!to remove bodysuits and destroy them
!!gs 'underwear_bodysuits', 'remove'
!!To remove bodysuits and store them
!!gs 'underwear_bodysuits', 'wear'
!!To wear bodysuits

menu_off = 1

if $ARGS[0] = 'view_bodysuit_list':
	!! ARGS 0 - view_bodysuit_list
	!! ARGS 1 - action type (clean, dirty, store, bathroom)
	
	if $pursepantytype ! '' or $pursebratype ! '':
		'<center><b>You put the '+iif($pursepantytype ! '','bodysuits','')+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 $ARGS[1] ! 'bathroom':
		act 'Return': gt 'wardrobe', 'main'
	else
		act 'Return': gt $loc, $loc_arg
	end

	if $ARGS[1] = 'wardrobe':
		metka_bodysuits = 0
	end

	if $ARGS[1] = 'store':
		metka_bodysuits = 1
	end

	if $ARGS[1] = 'unwanted':
		metka_bodysuits = 2
	end

	gs 'underwear_bodysuits', 'filter_header'

	'<center><table border=1><TH><a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_list'', ''wardrobe''">Draw</a></TH><TH><a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_list'', ''store''">Storage</a></TH><TH><a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_list'', ''unwanted''">Unwanted</a></TH></table></center>'

	if $pantyworntype ! 'none':act 'Remove bodysuits':gs 'underwear_bodysuits', 'remove' & gt 'underwear_bodysuits', 'view_bodysuit_list', $ARGS[1]
	
	if $ARGS[1] = 'store':
		cloc = 1
	end

	!! Check for no bodysuits
	j = 0

	if ARRSIZE('moncheri_bodysuits') > 0:
		j += 1
		if clothingfilter['quality'] = 1:'<center><img src="images/locations/city/citycenter/mall/moncheri.png"></center>'
	end

	!!To filter just this set
	clo_i = 0
	:loopbodysuitquality_filter

	i = 1
	:loopmoncheribodysuits
		if moncheri_bodysuits_s[i] = metka_bodysuits and moncheri_bodysuits[i] = 1:
			gs 'underwear_attributes', 'moncheri_bodysuits', i
			gs 'underwear_bodysuits', 'bodysuit_filter'
			!!sort by filter
			if (clothingfilter['quality'] = 0 and BraQuality = clo_i) or clothingfilter['number'] = 0:
				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:
					*p '<a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''<<$ARGS[1]>>'', ''moncheri'', <<i>>"><img src="images/pc/items/moncheri/bodysuits/<<i>>.jpg" 	height="150" /></a>'
				end
			end
		end
	i += 1
	if i <= ARRSIZE('moncheri_bodysuits'):jump 'loopmoncheribodysuits'

	if ARRSIZE('lusso_bodysuits') > 0:
		j += 1
		if clothingfilter['quality'] = 1:'<center><img src="images/locations/city/citycenter/mall/Lusso.png"></center>'
	end

	i = 1
	:looplussobodysuits 
		if lusso_bodysuits_s[i] = metka_bodysuits and lusso_bodysuits[i] = 1:
			gs 'underwear_attributes', 'lusso_bodysuits', i
			gs 'underwear_bodysuits', 'bodysuit_filter'
			!!sort by filter
			if (clothingfilter['quality'] = 0 and BraQuality = clo_i) or clothingfilter['number'] = 0:
				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:
					*p '<a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''<<$ARGS[1]>>'', ''lusso'', <<i>>"><img src="images/pc/items/lusso/bodysuits/<<i>>.jpg" 	height="150" /></a>'
				end
			end
		end
	i += 1
	if i <= ARRSIZE('lusso_bodysuits'):jump 'looplussobodysuits'

	if ARRSIZE('salacious_bodysuits') > 0:
		j += 1
		if clothingfilter['quality'] = 1:'<center><img src="images/locations/pushkin/exhibitshop/shop_name.png"></center>'
	end

	i = 1
	:loopsalaciousbodysuits 
		if salacious_bodysuits_s[i] = metka_bodysuits and salacious_bodysuits[i] = 1:
			gs 'underwear_attributes', 'salacious_bodysuits', i
			gs 'underwear_bodysuits', 'bodysuit_filter'
			!!sort by filter
			if (clothingfilter['quality'] = 0 and BraQuality = clo_i) or clothingfilter['number'] = 0:
				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:
					*p '<a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''<<$ARGS[1]>>'', ''salacious'', <<i>>"><img src="images/pc/items/salacious/bodysuits/<<i>>.jpg" 	height="150" /></a>'
				end
			end
		end
	i += 1
	if i <= ARRSIZE('salacious_bodysuits'):jump 'loopsalaciousbodysuits'

	if ARRSIZE('scandalicious_bodysuits') > 0:
		j += 1
		if clothingfilter['quality'] = 1:'<center><img src="images/locations/city/citycenter/mall/scandalicious.png"></center>'
	end

	i = 1
	:loopscandaliciousbodysuits 
		if scandalicious_bodysuits_s[i] = metka_bodysuits and scandalicious_bodysuits[i] = 1:
			gs 'underwear_attributes', 'scandalicious_bodysuits', i
			gs 'underwear_bodysuits', 'bodysuit_filter'
			!!sort by filter
			if (clothingfilter['quality'] = 0 and BraQuality = clo_i) or clothingfilter['number'] = 0:
				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:
					*p '<a href="exec:gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''<<$ARGS[1]>>'', ''scandalicious'', <<i>>"><img src="images/pc/items/scandalicious/bodysuits/<<i>>.jpg" 	height="150" /></a>'
				end
			end
		end
	i += 1
	if i <= ARRSIZE('scandalicious_bodysuits'):jump 'loopscandaliciousbodysuits'

	clo_i += 1
	if clothingfilter['quality'] = 0 and clo_i <= 7:
		jump 'loopbodysuitquality_filter'
	end

	if j = 0:
		*nl
		*nl
		*nl
		*nl
		*nl
		'<center><b><font color = red>You do not own any bodysuits</font></b></center>'
	end
end

if $ARGS[0] = 'view_bodysuit_item':
	!! ARGS 0 - view_bodysuit_item
	!! ARGS 1 = action type (draw, shop)
	!! ARGS 2 - bodysuit type
	!! ARGS 3 - bodysuit index
	!! ARGS 4 - price for shop
	cla
	'<center><img src="<<FUNC(''$pcs_outfit_image'', $ARGS[2]+''_bodysuits'', ARGS[3])>>"></center>'
	gs 'underwear_attributes', $ARGS[2]+'_bodysuits', ARGS[3]
	gs 'underwear_descriptions', 'bodysuit'

	if $ARGS[1] = 'shop':
		if dyneval('RESULT = <<$ARGS[2]>>_bodysuits[<<ARGS[3]>>]') = 1:
			'You already own this item.'
			act 'Leave': gt $loc, $loc_arg
		else
			price = ARGS[4]
			'Price: <<ARGS[4]>> <b>₽</b>'
			act 'Leave': gt $loc, $loc_arg
			if money >= price:
				act 'Buy (cash)':
					money -= price
					dynamic $ARGS[2] + '_bodysuits[<<ARGS[3]>>] = 1'
					dynamic $ARGS[2] + '_bodysuits_s[<<ARGS[3]>>] = 0'
					gt $loc, $loc_arg
				end
			else
				'You do not have enough cash to buy this bodysuit.'
			end
			if karta + bankDebtLimit >= price:
				act 'Buy (card)':
					karta -= price
					dynamic $ARGS[2] + '_bodysuits[<<ARGS[3]>>] = 1'
					dynamic $ARGS[2] + '_bodysuits_s[<<ARGS[3]>>] = 0'
					gt $loc, $loc_arg
				end
			else
				'You do not have enough money in your bank to buy this bodysuit.'
			end
		end
	else
		if $ARGS[1] ! 'bathroom':
			if metka_bodysuits ! 1:$RESULT += 'Move this bodysuit to <a href="exec:gt ''underwear_bodysuits'', ''dest1'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Storage</a><BR>'
			if metka_bodysuits ! 0:$RESULT += 'Move this bodysuit to  <a href="exec:gt ''underwear_bodysuits'', ''dest0'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Wardrobe</a><BR>'
			if metka_bodysuits ! 2:$RESULT += 'Move this bodysuit to  <a href="exec:gt ''underwear_bodysuits'', ''dest2'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Unwanted</a>'
		end
		
		act 'Return':gt 'underwear_bodysuits', 'view_bodysuit_list', $ARGS[1]
		
		if $ARGS[1] = 'store':
			'This bodysuit is in storage.'
		elseif $ARGS[1] = 'unwanted':
			'This bodysuit is unwanted.'
		else
			if $bodysuitworntype = $ARGS[2] and bodysuitwornnumber = ARGS[3]:
				'You are wearing this bodysuit.'
			else
				if metka_bodysuits = 0:
					act 'Wear':
						if CloPanties = 1 and CloBra = 1:
							msg'Your outfit is already replacing your underwear'
						else
							if hypnoPanty > 0:
								cla
								*clr
								'You pick up the bodysuit and think about trying it on... but you don''t really like wearing bodysuits.'
								gs 'willpower', 'misc', 'resist', 'easy'
								will_cost += hypnoTime
								if will_cost <= pcs_willpwr:
									act 'Put it on anyways (<<will_cost>> Willpower)':
										gs 'willpower', 'pay', 'resist'
										gs 'stat'
										gs 'underwear_bodysuits', 'wear2', $ARGS[2], ARGS[3]
			
										if $ARGS[1] = 'wardrobe':
											gt 'wardrobe', 'main'
										else
											gt $loc, $loc_arg
										end
									end
								else
									act 'Put it 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 'Back':
									gt 'wardrobe', 'main'
								end
							else
								gs 'underwear_bodysuits', 'wear2', $ARGS[2], ARGS[3]

								if $ARGS[1] = 'wardrobe':
									gt 'wardrobe', 'main'
								else
									gt $loc, $loc_arg
								end
							end
						end
					end
				end
			end
		end
		if $ARGS[1] ! 'store':
			act 'Move to storage': gt 'underwear_bodysuits', 'dest1', $ARGS[1], $ARGS[2], ARGS[3]
		end
		if $ARGS[1] ! 'unwanted':
			act 'Move to unwanted': gt 'underwear_bodysuits', 'dest2', $ARGS[1], $ARGS[2], ARGS[3]
		end
		if $ARGS[1] ! 'wardrobe':
			act 'Move to wardrobe': gt 'underwear_bodysuits', 'dest0', $ARGS[1], $ARGS[2], ARGS[3]
		end
		act '<font color="red">Throw this bodysuit away</font>':
			dynamic '<<$ARGS[2]>>_bodysuits[<<ARGS[3]>>] = 0'
			gt 'wardrobe', 'main'
		end
	end
end

if $ARGS[0] = 'dest0':
	*clr
	dynamic '<<$ARGS[2]>>_bodysuits_s[<<ARGS[3]>>] = 0'
	gt 'underwear_bodysuits', 'view_bodysuit_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'dest1':
	*clr
	dynamic '<<$ARGS[2]>>_bodysuits_s[<<ARGS[3]>>] = 1'
	gt 'underwear_bodysuits', 'view_bodysuit_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'dest2':
	*clr
	dynamic '<<$ARGS[2]>>_bodysuits_s[<<ARGS[3]>>] = 2'
	gt 'underwear_bodysuits', 'view_bodysuit_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'sum':
	$t[0] = 'lusso'
	$t[1] = 'salacious'
	$t[2] = 'scandalicious'
	result = 0
	i = 0
	:loopsumbodysuits_i
	$temp = $t[i]
	j = 1
	:loopsumbodysuits_j
	$temp1 = '<<$temp>>_bodysuits[<<j>>]'
	$temp2 = '<<$temp>>_bodysuits_s[<<j>>]'
	dynamic 'if <<$temp1>> = 1 and <<$temp2>> = 0: result +=1'
	j += 1
	if j <= dyneval('result = arrsize(''<<$temp>>_bodysuits'')') : jump 'loopsumbodysuits_j'
	i += 1
	if i <= arrsize('$t'): jump 'loopsumbodysuits_i'
	if $ARGS[1] = 'dresser': if $pantyworntype ! 'none' and result > 0: result -= 1
	killvar('t')
	killvar('temp')
	killvar('temp1')
	killvar('temp2')
end

if $ARGS[0] = 'dispose':
	dynamic $pantyworntype + '_bodysuit[<<pantywornnumber>>] = 0'
	$lastwornbodysuittype = 'none'
	lastwornbodysuitnumber = 0
	$bodysuitworntype = 'none'
	bodysuitwornnumber = 0
	$pantyworntype = 'none'
	$braworntype = 'none'

	PBraQuality = 0
	PBraMaterial = 0
	PBraType = 0
	PBraFun = 0
	PPanThinness = 0
	PBraThinness = 0
	PPanCoverFront = 4
	PPanCoverBack = 4
	PBraCover = 4

	gs 'clothing', 'exposure_calc'

end

if $ARGS[0] = 'remove':
	$lastwornbodysuittype = $bodysuitworntype
	lastwornbodysuitnumber = bodysuitwornnumber
	$bodysuitworntype = 'none'
	bodysuitwornnumber = 0
	underwear['lastworntype'] = 2
	$pantyworntype = 'none'
	$braworntype = 'none'

	PBraQuality = 0
	PBraMaterial = 0
	PBraType = 0
	PBraFun = 0
	PPanThinness = 0
	PBraThinness = 0
	PPanCoverFront = 4
	PPanCoverBack = 4
	PBraCover = 4

	gs 'clothing', 'exposure_calc'

end

if $ARGS[0] = 'wear':
	if $ARGS[1] = '':
		if dyneval('RESULT = <<$lastwornbodysuittype>>_bodysuits_s[<<lastwornbodysuitnumber>>]') = 0 and $lastwornbodysuittype ! '':
			$bodysuitworntype = $lastwornbodysuittype
			bodysuitwornnumber = lastwornbodysuitnumber
			gs 'underwear_bodysuits', 'wear2', $lastwornpantytype, lastwornpantynumber
		else
			underwear['type'] = 0
			$bodysuitworntype = 'none'
			bodysuitwornnumber = 0
		end
	else
		if dyneval('RESULT = <<$ARGS[1]>>_bodysuits_s[<<ARGS[2]>>]') = 0:
			gs 'underwear_bodysuits', 'wear2', $ARGS[2], ARGS[3]
		else
			underwear['type'] = 0
			$bodysuitworntype = 'none'
			bodysuitwornnumber = 0
		end
	end
end

if $ARGS[0] = 'wear2':
	!! ARGS 0 - action
	!! ARGS 1 - bodysuits type name
	!! ARGS 2 - bodysuits index

!! removing bra and panties or bodysuit if worn
	if underwear['type'] = 0:
		gs 'panties', 'remove'
		gs 'bras', 'remove'
	else
		gs 'underwear_bodysuits', 'remove'
	end
	underwear['type'] = 2

	$bodysuitworntype = $ARGS[1]
	bodysuitwornnumber = ARGS[2]
	$pantyworntype = 'bodysuit'
	$braworntype = 'bodysuit'

	dynamic $ARGS[1] + '_bodysuits_w[<<ARGS[2]>>] = 1'

	gs 'underwear_attributes', $ARGS[1], ARGS[2]

	dynamic '<<$ARGS[1]>>_bodysuits_s[<<ARGS[2]>>] = 0'

	PBraQuality = BraQuality
	PBraMaterial = BraMaterial
	PBraType = BraType
	PBraFun = BraFun
	PPanThinness = PanThinness
	PBraThinness = BraThinness
	PPanCoverFront = PanCoverFront
	PPanCoverBack = PanCoverBack
	PBraCover = BraCover

	gs 'clothing', 'exposure_calc'

end

if $ARGS[0] = 'wear_last_worn':
	!!contingency
	if $lastwornbodysuittype = '': $lastwornbodysuittype = 'none'
	gs 'underwear_bodysuits', 'wear', $lastwornbodysuittype, lastwornbodysuitnumber
end

if $ARGS[0] = 'filter_header':
!!Exclude filters
	$Headerstring = '<TD>'
	if clothingfilter['sport'] = 0:
		$Headerstring += '<a href="exec:clothingfilter[''sport''] = 1 & clothingfilter[''sport_only''] = 0 & gt ''underwear_bodysuits'', ''view_bodysuit_list'', $ward_list_store"><img src="images/system/icons/clothing/sport.png"></a></TD>'
	else
		$Headerstring += '<a href="exec:clothingfilter[''sport''] = 0 & gt ''underwear_bodysuits'', ''view_bodysuit_list'',  $ward_list_store"><img src="images/system/icons/clothing/sport_off.png"></a></TD>'
	end

!!sort by filters
	$Headerstring += '<TD>'
	if clothingfilter['number'] = 0:
		clothingfilter['quality'] = 1 & clothingfilter['inhibition'] = 1
		$Headerstring += '<img src="images/system/icons/clothing/number.png"></TD>'
	else
		$Headerstring += '<a href="exec:clothingfilter[''number''] = 0 & clothingfilter[''quality''] = 1 & clothingfilter[''inhibition''] = 1 & gt ''underwear_bodysuits'', ''view_bodysuit_list'',  $ward_list_store"><img src="images/system/icons/clothing/number_off.png"></a></TD>'
	end
	
	$Headerstring += '<TD>'
	if clothingfilter['quality'] = 0:
		$Headerstring += '<img src="images/system/icons/clothing/quality.png"></TD>'
	else
		$Headerstring += '<a href="exec:clothingfilter[''quality''] = 0 & clothingfilter[''number''] = 1 & clothingfilter[''inhibition''] = 1 & gt ''underwear_bodysuits'', ''view_bodysuit_list'',  $ward_list_store"><img src="images/system/icons/clothing/quality_off.png"></a></TD>'
	end
	
!! Show only filers
	$Headerstring[1] = '<TD>'
	if clothingfilter['sport_only'] = 0:
		$Headerstring[1] += '<a href="exec:clothingfilter[''sport_only''] = 1 & clothingfilter[''sport''] = 0 & gt ''underwear_bodysuits'', ''view_bodysuit_list'',  $ward_list_store"><img src="images/system/icons/clothing/sport_off.png"></a></TD>'
	else
		$Headerstring[1] += '<a href="exec:clothingfilter[''sport_only''] = 0 & gt ''underwear_bodysuits'', ''view_bodysuit_list'',  $ward_list_store"><img src="images/system/icons/clothing/sport.png"></a></TD>'
	end



	$Headerstring[2] = '<TH>Include</TH><TH>Sort by</TH><TH></TH>'

	$Headerstring[3] = '<TH>Only show</TH>'

	'<center><table><<$Headerstring[2]>>'
	'<TR><border=1><<$Headerstring>>'

	'<TR><border=0><<$Headerstring[3]>>'
	'<TR><border=1><<$Headerstring[1]>></table></center>'
end

if $ARGS[0] = 'bodysuit_filter':
!!Exclude filters
	clothingfilter['inc'] = 1
	!!filters, if inc set to 0 they will not display
	if clothingfilter['sport'] = 1 and BraFun = 2:
		clothingfilter['inc'] = 0
	end

!!only filters
	clothingfilter['only'] = 0
	!!filters, if only set to 1 they will only display those set
	if clothingfilter['sport_only'] = 1 and BraFun = 2:
		clothingfilter['only'] = 1
	end
	if clothingfilter['only'] = clothingfilter['sport_only']:
		clothingfilter['only'] = 1
	else
		clothingfilter['only'] = 0
	end

end

if $ARGS[0] = 'shop_filter_header':
!! sort by filters
	$Headerstring = '<TD>'
	if clothingfilter['number'] = 0:
		clothingfilter['quality'] = 1
		$Headerstring += '<img src="images/system/icons/clothing/number.png"></TD>'
	else
		$Headerstring += '<a href="exec:clothingfilter[''number''] = 0 & clothingfilter[''quality''] = 1 & clothingfilter[''inhibition''] = 1 & gt $loc, $loc_arg"><img src="images/system/icons/clothing/number_off.png"></a></TD>'
	end
	
	$Headerstring += '<TD>'
	if clothingfilter['quality'] = 0:
		$Headerstring += '<img src="images/system/icons/clothing/quality.png"></TD>'
	else
		$Headerstring += '<a href="exec:clothingfilter[''quality''] = 0 & clothingfilter[''number''] = 1 & clothingfilter[''inhibition''] = 1 & gt $loc, $loc_arg"><img src="images/system/icons/clothing/quality_off.png"></a></TD>'
	end


	$Headerstring[2] = '<TH>Sort by</TH>'

	'<center><table><<$Headerstring[2]>>'
	'<TR><border=1><<$Headerstring>></table></center>'
end

if $ARGS[0] = 'shop_filter':

end


--- underwear_bodysuits ---------------------------------

