# bras
!!2021/04/15
!!gs 'bras', 'dispose'
!!gs 'bras', 'remove'
!!gs 'bras', 'wear'

if $ARGS[0] = 'dispose':
	dynamic $braworntype + '_bras[<<lastwornbranumber>>] = 0'
	$lastwornbratype = 'none'
	lastwornbranumber = 0
	$braworntype = 'none'
	brawornnumber = 0
end

if $ARGS[0] = 'remove':
	$lastwornbratype = $braworntype
	lastwornbranumber = brawornnumber
	$braworntype = 'none'
	brawornnumber = 0
end

if $ARGS[0] = 'wear':
	bra_none = 0
	if $ARGS[1] = '':
		if dyneval('RESULT = <<$lastwornbratype>>_brasS[<<lastwornbranumber>>]') = 0 and $lastwornbratype ! '':
			$braworntype = $lastwornbratype
			brawornnumber = lastwornbranumber
		else
			$braworntype = 'none'
			brawornnumber = 0
		end
	else
		if dyneval('RESULT = <<$ARGS[1]>>_brasS[<<ARGS[2]>>]') = 0:
			$braworntype = $ARGS[1]
			brawornnumber = ARGS[2]
		else
			$braworntype = 'none'
			brawornnumber = 0
		end
	end
end


if $ARGS[0] = 'view_bra_list':
	!! ARGS 0 - view_bra_list
	!! ARGS 1 - action type (draw, store, unwanted)
	
	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 $ARGS[1] ! 'bathroom':
		act 'Return': gt 'wardrobe', 'main'
	else
		act 'Return': gt $loc, $loc_arg
	end

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

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

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

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

	if $braworntype ! 'none':act 'Remove bra':gs 'bras', 'remove' & gt 'bras', 'view_bra_list', $ARGS[1]
	
	if $ARGS[1] = 'store':
		cloc = 1
	end

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

	i = 1
	:loopcheapbras
	if cheap_brasS[i] = metka_bras and cheap_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''cheap'', <<i>>"><img src="images/pc/bras/basic/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('cheap_bras'):jump 'loopcheapbras'

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

	i = 1
	:loopboutiquebras 
	if boutique_brasS[i] = metka_bras and boutique_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''boutique'', <<i>>"><img src="images/pc/bras/boutique/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('boutique_bras'):jump 'loopboutiquebras'

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

	i = 1
	:loopexhibitionistbras 
	if exhibitionist_brasS[i] = metka_bras and exhibitionist_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''exhibitionist'', <<i>>"><img src="images/pc/bras/exhibitionist/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('exhibitionist_bras'):jump 'loopexhibitionistbras'

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

	i = 1
	:loopfashionistabras 
	if fashionista_brasS[i] = metka_bras and fashionista_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''fashionista'', <<i>>"><img src="images/pc/bras/fashionista/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('fashionista_bras'):jump 'loopfashionistabras'

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

	i = 1
	:loopkatsbras 
	if kats_brasS[i] = metka_bras and kats_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''kats'', <<i>>"><img src="images/pc/bras/kats/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('kats_bras'):jump 'loopkatsbras'

	'<center><img src="images/locations/city/redlight/erotomaniac/shop_name.png"></center>'

	i = 1
	:loopsexshopbras 
	if sexshop_brasS[i] = metka_bras and sexshop_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''sexshop'', <<i>>"><img src="images/pc/bras/sexshop/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('sexshop_bras'):jump 'loopsexshopbras'

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

	i = 1
	:loopsportbras 
	if sport_brasS[i] = metka_bras and sport_bras[i] = 1:*p '<a href="exec:gt ''bras'', ''view_bra_item'', ''<<$ARGS[1]>>'', ''sport'', <<i>>"><img src="images/pc/bras/sport/<<i>>.jpg" 	height="150" /></a>'
	i += 1
	if i <= ARRSIZE('sport_bras'):jump 'loopsportbras'
end

if $ARGS[0] = 'view_bra_item':
	!! ARGS 0 - view_bra_item
	!! ARGS 1 = action type (wardrobe, bathroom, shop)
	!! ARGS 2 - bra type
	!! ARGS 3 - bra index
	!! ARGS 4 - price for shop

	cla
	'<center><img src="<<FUNC(''$bra_image'',  $ARGS[2], ARGS[3])>>"></center>'
!!	gs 'bra_attributes', $ARGS[2], ARGS[3]
!!	$RESULT = FUNC('$short_description', $ARGS[2], CloStyle2)
!!	$RESULT += '<<ARGS[3]>>'
!!	'<<$RESULT>>'
	gs 'bras', 'descriptions', $ARGS[2]

	if $ARGS[1] = 'shop':
		if dyneval('RESULT = <<$ARGS[2]>>_bras[<<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] + '_bras[<<ARGS[3]>>] = 1'
					dynamic $ARGS[2] + '_brasS[<<ARGS[3]>>] = 0'
					gt $loc, $loc_arg
				end
			else
				'You do not have enough cash to buy this bra.'
			end
			if karta + bankDebtLimit >= price:
				act 'Buy (card)':
					karta -= price
					dynamic $ARGS[2] + '_bras[<<ARGS[3]>>] = 1'
					dynamic $ARGS[2] + '_brasS[<<ARGS[3]>>] = 0'
					gt $loc, $loc_arg
				end
			else
				'You do not have enough money in your bank to buy this bra.'
			end
		end
	else
		if $ARGS[1] ! 'bathroom':
			if metka_bras ! 1:$RESULT += 'Move these bras to <a href="exec:gt ''bras'', ''dest1'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Storage</a><BR>'
			if metka_bras ! 0:$RESULT += 'Move these bras to <a href="exec:gt ''bras'', ''dest0'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Wardrobe</a><BR>'
			if metka_bras ! 2:$RESULT += 'Move these bras to <a href="exec:gt ''bras'', ''dest2'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Unwanted</a>'
		end

		act 'Return':gt 'bras', 'view_bra_list', $ARGS[1]
		
		if $ARGS[1] = 'store':
			'This bra is in storage.'
		elseif $ARGS[1] = 'unwanted':
			'This bra is unwanted.'
		else
			if $braworntype = $ARGS[2] and brawornnumber = ARGS[3]:
				'You are wearing this bra.'
			else
				if metka_bras = 0:
					act 'Wear':
						if CloBra = 1:
							msg'You cannot wear a bra with this top'
						else
							if hypnoBra > 0:
								cla
								*clr
								'You pick up the bra and think about trying them on... but you don''t really like wearing bras.'
								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'
										gs 'stat'
										gs 'bras', 'wear', $ARGS[2], ARGS[3]
		
										if $ARGS[1] = 'wardrobe':
											gt 'wardrobe', 'main'
										else
											gt $loc, $loc_arg
										end
									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 'Back':
									gt 'wardrobe', 'main'
								end
							else
								gs 'bras', 'wear', $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 'bras', 'dest1', $ARGS[1], $ARGS[2], ARGS[3]
		end
		if $ARGS[1] ! 'unwanted':
			act 'Move to unwanted': gt 'bras', 'dest2', $ARGS[1], $ARGS[2], ARGS[3]
		end
		if $ARGS[1] ! 'wardrobe':
			act 'Move to wardrobe': gt 'bras', 'dest0', $ARGS[1], $ARGS[2], ARGS[3]
		end
	end
end

if $ARGS[0] = 'dest0':
	*clr
	dynamic '<<$ARGS[2]>>_brasS[<<ARGS[3]>>] = 0'
	gt 'bras', 'view_bra_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'dest1':
	*clr
	dynamic '<<$ARGS[2]>>_brasS[<<ARGS[3]>>] = 1'
	gt 'bras', 'view_bra_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'dest2':
	*clr
	dynamic '<<$ARGS[2]>>_brasS[<<ARGS[3]>>] = 2'
	gt 'bras', 'view_bra_item', $ARGS[1], $ARGS[2], ARGS[3]
end

if $ARGS[0] = 'descriptions':
	if $ARGS[1] = 'cheap':
		'Cheap bra with no redeeming features.'
	elseif $ARGS[1] = 'boutique':
		'This bra is so beautifully made that your posture and confidence is improved wearing it boosting your appearance even when fully clothed.'
	elseif $ARGS[1] = 'exhibitionist':
		'This bra is so revealing that it is more exciting than not wearing one and you''ll always feel horny wearing it.'
	elseif $ARGS[1] = 'fashionista':
		'This bra is well made improving your posture and confidence and slightly boosting your appearance even when fully clothed.'
	elseif $ARGS[1] = 'kats':
		'This bra feels reassuring and wear it gives your mood a lift.'
	elseif $ARGS[1] = 'sexshop':
		'Tacky and cheap this bra makes you look like a hooker, this could be a bonus if working as one.'
	elseif $ARGS[1] = 'sport':
		'This bra is designed for physical exercises to make them less tiring.'
	end
end

--- bras ---------------------------------

