# panties

!!gs 'panties', 'dispose'
!!gs 'panties', 'remove'
!!gs 'panties', 'wear'
!!gs 'panties', 'linen'
!!gs 'panties', 'fresh'

if $ARGS[0] = 'dispose':
	if $pantyworntype = 'cheap':
		clrbelo -= 1
	else
		dynamic $pantyworntype + '_panties[<<lastwornpantynumber>>] = 0'
	end
	$lastwornpantytype = 'none'
	lastwornpantynumber = 0
	$pantyworntype = 'none'
	pantywornnumber = 0
end

if $ARGS[0] = 'remove':
	$lastwornpantytype = $pantyworntype
	lastwornpantynumber = pantywornnumber
	$pantyworntype = 'none'
	pantywornnumber = 0
end

if $ARGS[0] = 'wear':
	$pantyworntype = $lastwornpantytype
	pantywornnumber = lastwornpantynumber
end

if $ARGS[0] = 'linen':
	if $pantyworntype = 'cheap':
		dirtbelo += 1
	else
		dynamic $pantyworntype + '_pantiesC[<<lastwornpantynumber>>] = 1'
	end
	$lastwornpantytype = 'none'
	lastwornpantynumber = 0
	$pantyworntype = 'none'
	pantywornnumber = 0
end

if $ARGS[0] = 'fresh':
	if $ARGS[1] = '':
		$pantyworntype = 'cheap'
		pantywornnumber = rand(1,37)
		clrbelo -= 1
	else
		$pantyworntype = $ARGS[1]
		pantywornnumber = ARGS[2]
	end
end

if $ARGS[0] = 'view_panty_list':
	!! ARGS 0 - view_panty_list
	!! ARGS 1 - action type (clean, dirty, store)
	if $args[1] = 'clean':
		metka_panties = 0
	elseif $args[1] = 'dirty':
		metka_panties = 1
	else
		metka_panties = 2
	end

	act 'Leave':gt $loc, $metka

	'<center><table border=1><TH><a href="exec:gt ''panties'', ''view_panty_list'', ''clean''">Clean</a></TH><TH><a href="exec:gt ''panties'', ''view_panty_list'', ''dirty''">Dirty</a></TH><TH><a href="exec:gt ''panties'', ''view_panty_list'', ''store''">Storage</a></TH></center>'

	if $pantyworntype ! 'none':act 'Remove panties':gs 'panties', 'linen' & gt 'panties', 'view_panty_list', $ARGS[1]
	
	if $ARGS[1] = 'store':
		cloc = 1
	end

	'<center><img src="images/locations/city/citycenter/mall/moncheri.png"></center>'

	i = 1
	:loopboutiquepanties 
	if boutique_pantiesC[i] = metka_panties and boutique_panties[i] = 1:*p '<a href="exec:gt ''panties'', ''view_panty_item'', <<metka_panties>>, ''boutique'', <<i>>"><img src="images/pc/panties/boutique/<<i>>.jpg" 	height="300" /></a>'
	i += 1
	if i <= ARRSIZE('boutique_panties'):jump 'loopboutiquepanties'

	'<center><img src="images/locations/oldtown/exhibitshop/shop_name.png"></center>'

	i = 1
	:loopexhibitionistpanties 
	if exhibitionist_pantiesC[i] = metka_panties and exhibitionist_panties[i] = 1:*p '<a href="exec:gt ''panties'', ''view_panty_item'', <<metka_panties>>, ''exhibitionist'', <<i>>"><img src="images/pc/panties/exhibitionist/<<i>>.jpg" 	height="300" /></a>'
	i += 1
	if i <= ARRSIZE('exhibitionist_panties'):jump 'loopexhibitionistpanties'

	'<center><img src="images/locations/city/citycenter/mall/fashionistat.png"></center>'

	i = 1
	:loopfashionistapanties 
	if fashionista_pantiesC[i] = metka_panties and fashionista_panties[i] = 1:*p '<a href="exec:gt ''panties'', ''view_panty_item'', <<metka_panties>>, ''fashionista'', <<i>>"><img src="images/pc/panties/fashionista/<<i>>.jpg" 	height="300" /></a>'
	i += 1
	if i <= ARRSIZE('fashionista_panties'):jump 'loopfashionistapanties'

	'<center><img src="images/locations/city/citycenter/mall/pussycat.png"></center>'

	i = 1
	:loopkatspanties 
	if kats_pantiesC[i] = metka_panties and kats_panties[i] = 1:*p '<a href="exec:gt ''panties'', ''view_panty_item'', <<metka_panties>>, ''kats'', <<i>>"><img src="images/pc/panties/kats/<<i>>.jpg" 	height="300" /></a>'
	i += 1
	if i <= ARRSIZE('kats_panties'):jump 'loopkatspanties'

	'<center><img src="images/locations/city/citycenter/sexshop/shop_name.png"></center>'

	i = 1
	:loopsexshoppanties 
	if sexshop_pantiesC[i] = metka_panties and sexshop_panties[i] = 1:*p '<a href="exec:gt ''panties'', ''view_panty_item'', <<metka_panties>>, ''sexshop'', <<i>>"><img src="images/pc/panties/sexshop/<<i>>.jpg" 	height="300" /></a>'
	i += 1
	if i <= ARRSIZE('sexshop_panties'):jump 'loopsexshoppanties'
end

if $ARGS[0] = 'view_panty_item':
	!! ARGS 0 - view_panty_item
	!! ARGS 1 = action type (clean, dirty, store, shop)
	!! ARGS 2 - panty type
	!! ARGS 3 - panty index
	!! ARGS 4 - price for shop
	if $ARGS[1] = '':
		if metka_panties = 0:
			$ARGS[1] = 'clean'
		elseif metka_panties = 1:
			$ARGS[1] = 'dirty'
		elseif metka_panties = 2:
			$ARGS[1] = 'store'
		else
			$ARGS[1] = 'shop'
		end
	end

	cla
	'<center><img src="<<FUNC(''$panty_image'',  $ARGS[2], ARGS[3])>>"></center>'
!!	gs 'panty_attributes', $ARGS[2], ARGS[3]
!!	$RESULT = FUNC('$short_description', $ARGS[2], CloStyle2)
!!	$RESULT += '<<ARGS[3]>>'
!!	'<<$RESULT>>'
!!	gs 'panty_descriptions'
!!	'<<$description>>'

!!	if PanExhibit + 10 > pcs_exhibition: 'You find these panties more revealing than you are completely comfortable with but that makes it quite exciting too.'

	if $ARGS[1] = 'shop':
		if dyneval('RESULT = <<$ARGS[2]>>_panties[<<ARGS[3]>>]') = 1:
			'You already own this item.'
			act 'Leave': gt $loc, $metka
		else
			price = ARGS[4]
			'Price: <<ARGS[4]>> <b>₽</b>'
			act 'Leave': gt $loc, $metka
			if PanExhibit > pcs_exhibition:
				'You don''t feel confident enough to wear panties this revealing and can''t bring yourself to buy them.'
			elseif money >= price:
				act 'Buy':
					money -= price
					dynamic $ARGS[2] + '_panties[<<ARGS[3]>>] = 1'
					dynamic $ARGS[2] + '_pantiesC[<<ARGS[3]>>] = 0'
					gt $loc, $metka
				end
			else
				'You cannot afford these panties.'
			end
		end
	elseif $ARGS[1] = 'clean':
		act 'Return':gt 'panties', 'view_panty_list', $ARGS[1]
		
		if $pantyworntype = $ARGS[2] and pantywornnumber = ARGS[3]:
			'You are wearing these panties.'
		else
			if PanExhibit > pcs_exhibition:
				'You don''t feel confident enough to wear these panties.'
			else
				act 'Wear':
					gs 'panties', 'fresh', $ARGS[2], ARGS[3]

					gt 'panties', 'view_panty_list', $ARGS[1]
				end
			end
			
			act 'Store them':
				dynamic $ARGS[2] + '_pantiesC[<<ARGS[3]>>] = 2'
				
				gt 'panties', 'view_panty_list', $ARGS[1]
			end
		end
	elseif $ARGS[1] = 'dirty':
!! Included for possible future events involving the selling of used underwear
		'These panties are dirty and waiting to be washed.'
		act 'Return':gt 'panties', 'view_panty_list', $ARGS[1]
	elseif $ARGS[1] = 'store':
		act 'Return':gt 'panties', 'view_panty_list', $ARGS[1]

		act 'Move back to wardrobe':
			dynamic $ARGS[2] + '_pantiesC[<<ARGS[3]>>] = 0'
			gt 'panties', 'view_panty_list', $ARGS[1]
		end
	end
end


--- panties ---------------------------------

