# changingroom

$locclass = 'changingroom'
menu_off = 1

if $ARGS[0] = 'view_swim_list':

	if ARRSIZE('danilovich_swimsuit') = 0 and ARRSIZE('scandalicious_swimsuit') = 0 and ARRSIZE('scandalicious_bikinis') = 0 and ARRSIZE('allure_swimsuit') = 0 and ARRSIZE('allure_bikinis') = 0 and ARRSIZE('nerdvana_swimsuit') = 0 and ARRSIZE('nerdvana_bikinis') = 0:
		'<center>You do not own any swimwear.</center>'
	elseif $loc = 'fit' or $loc = 'bass' or $loc_arg = 'kathansaunasw1' or $loc_arg = 'kathansaunasw2' or temper >= 15:
		if PCloswimwear = 0 and $clothingworntype ! 'nude':
			$lastwornclothingtype['swim'] = $clothingworntype
			lastwornclothingnumber['swim'] = clothingwornnumber
			$lastwornpantytype['swim'] = $pantyworntype
			lastwornpantynumber['swim'] = pantywornnumber
			$lastwornbratype['swim'] = $braworntype
			lastwornbranumber['swim'] = brawornnumber
		end

		i = 1
		:loopdanilovich_swimsuit
			if danilovich_swimsuit[i] = 1 and danilovich_swimsuit_s[i] = 0 and ($clothingworntype ! 'danilovich_swimsuit' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''danilovich_swimsuit'', <<i>>"><img <<$set_imgh>> src="images/pc/items/danilovich/swimwear/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('danilovich_swimsuit'):jump 'loopdanilovich_swimsuit'

		*nl

		i = 1
		:loopscandalicious_swimsuit
			if scandalicious_swimsuit[i] = 1 and scandalicious_swimsuit_s[i] = 0 and ($clothingworntype ! 'scandalicious_swimsuit' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''scandalicious_swimsuit'', <<i>>"><img <<$set_imgh>> src="images/pc/items/scandalicious/swim/one/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('scandalicious_swimsuit'):jump 'loopscandalicious_swimsuit'

		*nl

		i = 1
		:loopscandalicious_bikinis
			if scandalicious_bikinis[i] = 1 and scandalicious_bikinis_s[i] = 0 and ($clothingworntype ! 'scandalicious_bikinis' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''scandalicious_bikinis'', <<i>>"><img <<$set_imgh>> src="images/pc/items/scandalicious/swim/two/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('scandalicious_bikinis'):jump 'loopscandalicious_bikinis'

		*nl

		i = 1
		:loopallure_swimsuit
			if allure_swimsuit[i] = 1 and allure_swimsuit_s[i] = 0 and ($clothingworntype ! 'allure_swimsuit' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''allure_swimsuit'', <<i>>"><img <<$set_imgh>> src="images/pc/items/allure/one/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('allure_swimsuit'):jump 'loopallure_swimsuit'

		*nl

		i = 1
		:loopallure_bikinis
			if allure_bikinis[i] = 1 and allure_bikinis_s[i] = 0 and ($clothingworntype ! 'allure_bikinis' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''allure_bikinis'', <<i>>"><img <<$set_imgh>> src="images/pc/items/allure/two/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('allure_bikinis'):jump 'loopallure_bikinis'

		*nl

		i = 1
		:loopnerdvana_swimsuit
			if nerdvana_swimsuit[i] = 1 and nerdvana_swimsuit_s[i] = 0 and ($clothingworntype ! 'nerdvana_swimsuit' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''nerdvana_swimsuit'', <<i>>"><img <<$set_imgh>> src="images/pc/items/nerdvana/swim/one/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('nerdvana_swimsuit'):jump 'loopnerdvana_swimsuit'

		*nl

		i = 1
		:loopnerdvana_bikinis
			if nerdvana_bikinis[i] = 1 and nerdvana_bikinis_s[i] = 0 and ($clothingworntype ! 'nerdvana_bikinis' or clothingwornnumber ! i):*p '<a href="exec:gt ''changingroom'', ''view_swim_item'', ''nerdvana_bikinis'', <<i>>"><img <<$set_imgh>> src="images/pc/items/nerdvana/swim/two/<<i>>.jpg" 	height="250" /></a>'
			i += 1
		if i <= ARRSIZE('nerdvana_bikinis'):jump 'loopnerdvana_bikinis'
		
		*nl

		if $clothingworntype = 'danilovich_swimsuit' or $clothingworntype = 'scandalicious_swimsuit' or $clothingworntype = 'scandalicious_bikinis' or $clothingworntype = 'allure_swimsuit' or $clothingworntype = 'allure_bikinis' or $clothingworntype = 'nerdvana_swimsuit' or $clothingworntype = 'nerdvana_bikinis': '<center>You are wearing swimwear.</center>'

	elseif temper < 15:
		'<center>It''s below 15C - far too cold to get changed into swimwear. You should wait until the weather warms up.</center>'
	end

	act 'Leave':gt $loc, $loc_arg
	
	if PCloswimwear = 1:
		act 'Put your regular clothes back on':
			gs 'clothing', 'wear', $lastwornclothingtype['swim'], lastwornclothingnumber['swim']
			gs 'panties', 'wear', $lastwornpantytype['swim'], lastwornpantynumber['swim']
			gs 'bras', 'wear', $lastwornbratype['swim'], lastwornbranumber['swim']
			gt $loc, $loc_arg
		end
	end
	act 'Choose an outfit': gt 'wardrobe', 'main'
end

if $ARGS[0] = 'view_swim_item':
	!! ARGS 0 - view_clothing_item
	!! ARGS 1 - clothing type
	!! ARGS 2 - clothing index

	cla
	'<center><img <<$set_imgh>> src="<<FUNC(''$clothing_image'',  $ARGS[1], ARGS[2])>>"></center>'
	'<<$ARGS[1]>> no.<<ARGS[2]>>'
	if $ARGS[1] = 'danilovich_swimsuit':
		FUNC('$attributes_danilovich_swim_one', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'scandalicious_swimsuit':
		FUNC('$attributes_scandalicious_swim_one', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'scandalicious_bikinis':
		FUNC('$attributes_scandalicious_swim_two', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'allure_swimsuit':
		FUNC('$attributes_allure_swim_one', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'allure_bikinis':
		FUNC('$attributes_allure_swim_two', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'nerdvana_swimsuit':
		FUNC('$attributes_nerdvana_swim_one', $ARGS[1], ARGS[2])
		$swimwear_description
	elseif $ARGS[1] = 'nerdvana_bikinis':
		FUNC('$attributes_nerdvana_swim_two', $ARGS[1], ARGS[2])
		$swimwear_description
	end

	$RESULT = '(strength '
	dynamic '$RESULT += <<$ARGS[1]>>_h[<<ARGS[2]>>]'
	$RESULT += ')'
	'<<$RESULT>>'

	act 'Return':gt 'changingroom', 'view_swim_list'
	
	!! if the clothing is worn out
	if dyneval('RESULT = <<$ARGS[1]>>_h[<<ARGS[2]>>]') <= 0:
		'This item is worn and is not suitable for further wear.'
		act 'Throw it away':
			dynamic '<<$ARGS[1]>>[<<ARGS[2]>>] = 0'
			gt 'changingroom', 'view_swim_list'
		end
	elseif CloInhibit > pcs_inhib:
		'You don''t feel daring enough to wear swimwear this revealing.'
	else
		if CloInhibit + 10 > pcs_inhib: 'You find this swimwear to be more revealing than you are completely comfortable with but that makes it quite exciting too.'
		act 'Wear':
			gs 'underwear', 'remove'
			gs 'clothing', 'wear', $ARGS[1], ARGS[2]
			gt $loc, $loc_arg
		end
	end
end


!! following function counts all available swimwear even if being worn currently.
!! you can add 'swim' or 'beach' if you want to count just one of them
!! use func('changingroom','count_swim_item') or func('changingroom','count_swim_item','swim') or func('changingroom','count_swim_item','beach')

if $ARGS[0] = 'count_swim_item':
	h = 0
	if $ARGS[1] = 'danilovich_swimsuit' or $ARGS[1] = '':
		i = 1
		:loopcount_danilovich_swimsuit
			if danilovich_swimsuit[i] = 1 and danilovich_swimsuit_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('danilovich_swimsuit'):jump 'loopcount_danilovich_swimsuit'
	end

	if $ARGS[1] = 'scandalicious_swimsuit' or $ARGS[1] = '':
		i = 1
		:loopcount_scandalicious_swimsuit
			if scandalicious_swimsuit[i] = 1 and scandalicious_swimsuit_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('scandalicious_swimsuit'):jump 'loopcount_scandalicious_swimsuit'
	end

	if $ARGS[1] = 'scandalicious_bikinis' or $ARGS[1] = '':
		i = 1
		:loopcount_scandalicious_bikinis
			if scandalicious_bikinis[i] = 1 and scandalicious_bikinis_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('scandalicious_bikinis'):jump 'loopcount_scandalicious_bikinis'
	end

	if $ARGS[1] = 'allure_swimsuit' or $ARGS[1] = '':
		i = 1
		:loopcount_allure_swimsuit
			if allure_swimsuit[i] = 1 and allure_swimsuit_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('allure_swimsuit'):jump 'loopcount_allure_swimsuit'
	end

	if $ARGS[1] = 'allure_bikinis' or $ARGS[1] = '':
		i = 1
		:loopcount_allure_bikinis
			if allure_bikinis[i] = 1 and allure_bikinis_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('allure_bikinis'):jump 'loopcount_allure_bikinis'
	end

	if $ARGS[1] = 'nerdvana_swimsuit' or $ARGS[1] = '':
		i = 1
		:loopcount_nerdvana_swimsuit
			if nerdvana_swimsuit[i] = 1 and nerdvana_swimsuit_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('nerdvana_swimsuit'):jump 'loopcount_nerdvana_swimsuit'
	end

	if $ARGS[1] = 'nerdvana_bikinis' or $ARGS[1] = '':
		i = 1
		:loopcount_nerdvana_bikinis
			if nerdvana_bikinis[i] = 1 and nerdvana_bikinis_s[i] = 0 :h += 1
			i += 1
		if i <= ARRSIZE('nerdvana_bikinis'):jump 'loopcount_nerdvana_bikinis'
	end
	result = h
	killvar 'i'
	killvar 'h'
end
--- changingroom ---------------------------------

