# city_pharmacy

if $ARGS[0] = 'start':
	*clr & cla
	menu_off = 1
	minut += 5
	gs 'stat'
	
	people = rand(1,15) & !We define the size of the queue in the pharmacy
	if people <= 5:
		*pl '<center><b><font color="maroon">Pharmacy</font></b></center>'
		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/pharmacy/aptekabusy<<people>>.jpg"></center>'
		*nl
		'There is <<people>> ' + iif(people < 2 or people > 4, 'people' , 'man' ) + ' in line as you walk up to the counter to check out.'
		act 'Leave': minut += 5 & gt 'city_residential'
		act 'Wait in line' :
			minut += rand(1,4) * people
			people = 0
			gs 'stat'
			gt 'city_pharmacy', 'shop'
		end
	else
		gt 'city_pharmacy', 'shop'
	end
end

if $ARGS[0] = 'shop' or $ARGS[0] = '':
	*clr & cla
	$location_type = 'public_indoors'
	$loc = 'city_pharmacy'
	$loc_arg = 'shop'
	$menu_loc = 'city_pharmacy'
	$menu_arg = 'shop'
	menu_off = 0
	gs 'stat'
	*pl '<center><b><font color="maroon">Pharmacy</font></b></center>'
	if pharma_day ! daystart: pharma_day = daystart & pharma_picrand = rand(1,4)
	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/pharmacy/apteka_worker_'+pharma_picrand+'.jpg"></center>'
	*nl
	'A young woman in a white coat stands behind the counter. She smiles as you approach. "Hello, what can I help you with?"'

	act 'Buy something': gt 'city_pharmacy', 'cart'

if KandidNapr = 1 and money >= 1050:
	act'Buy Antifungal medication(1050₽)': gt 'city_pharmacy', 'buy_antifungal'
elseif KandidNapr = 1 and money < 1050:
	act'Buy Antifungal medication(<font color="red">1050₽</font>)': '<br><font color="red">You don''t have enough money to buy Antifungal medication.</font>'
end

	act 'Leave the pharmacy': minut += 5 & gt 'city_residential'
end

if $ARGS[0] = 'buy_antifungal':
	if Kandidoz >= 30:
		money -= 1050
		Kandidoz = 0
		*clr
		cla
		gs 'stat'
		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/pharmacy/apteka_worker_'+pharma_picrand+'.jpg"></center>'
		*nl
		'<center><font color="green">You bought 1 <b>Antifungal medication</b>.</font></center>'
		'You put the money on the counter before immediately opening the package and swallowing the tablet. A while later, you start feeling better.'
		act 'Return': gt 'city_pharmacy', 'shop'
	elseif Kandidoz < 30 and KandidozOnce > 0:
		msg '<center>You don''t need medication right now. Your yeast infection is currently in remission and taking vitamins will ensure that it stays that way.</center>'
		gt 'city_pharmacy', 'shop'
	else
		msg '<center>You don''t need any antifungal medication right now.</center>'
		*nl
		gt 'city_pharmacy', 'shop'
	end
end


if $ARGS[0] = 'cart':
	*clr & cla
	$loc_s = 'city_pharmacy'
	$args_s = 'cart'
		
	gs 'item_cart', 'shoppping_aisle', 'chemist'
	gs 'stat'
	gs 'themes', 'indoors'

	$backimage= 'images/locations/pavlovsk/pharmacy/apteka_worker_'+pharma_picrand+'.jpg'
	act 'Exit shopping cart':gt 'city_pharmacy', 'start'
end

--- city_pharmacy ---------------------------------

