:: larek
<<set $here = 'larek'>>
<<set $ARGS = $location_var[$here]>>
<!-- !!2021/04/15-->
<<act 'Logout'>>
	<<gt 'dvor'>>
<</act>>
<<image "locations/pushkin/cafe/larek.jpg">>
<<if $location_var[$here][0] == 'start'>>
	 	<<set $time.minutes = $time.minutes + 1>>
	<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
	<<image "locations/pushkin/cafe/larek.jpg">>
	<<link "Select Products">><<sofood>><</link>>
	<<actCLA 'Leave the store'>>
		<<gt $loc>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'food'>>
	 	<<set $time.minutes = $time.minutes + 1>>
	<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
	<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
	<center><B><font color=maroon>Grocery department</font></B></center>
	<<image "locations/pushkin/cafe/larek.jpg">>
	<!-- FAILED TO CONVERT
		'<a href="exec: dynamic $buyfood ">One serving food - 50 RUB</a>
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """'<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec: dynamic $buyfood ">One serving food""" - ERROR: FAILED TO CONVERT LITERAL: """50 RUB<""" / ERROR: FAILED TO CONVERT LITERAL: """a>""">>

	-->
	<<warn "CONVERSION ERROR 71eb08b5ab4cd3cb82ffdf4e51ec841a">>
	<!-- FAILED TO CONVERT
		<a href="exec: dynamic $buyfood2 ">One serving of diet friendly food - 250 RUB</a>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec: dynamic $buyfood2 ">One serving of diet friendly food""" - ERROR: FAILED TO CONVERT LITERAL: """250 RUB<""" / ERROR: FAILED TO CONVERT LITERAL: """a>'""">>

	-->
	<<warn "CONVERSION ERROR 73b26c67e109c925687aa7bf2d872fed">>
	
	<<act 'Exit Department'>>
		<<gt 'larek' 'start'>>
	<</act>>
	<<if $finances.cash >= 300>>
		<<actCLA 'Buy tea biscuits (300 RUB)'>>
			<<set $finances.cash -= 300>>
			<<set $pranik += 10>>
			You bought a bag of biscuits that go well with tea. You figure there''s about ten servings inside.
			<<act 'Exit Department'>>
				<<gt 'larek' 'food'>>
			<</act>>
		<</actCLA>>
	<</if>>
	<<if $finances.cash >= 50 and $inventory.get("water") == 0 and $wardrobe.purse.isValidItem > 0>>
		<<actCLA 'Buy a bottle of water (50 RUB)'>>
			<<set $finances.cash -= 50>>
			<<run $inventory.set('water',1)>>
			You bought a bottle of water and put it in your purse.
			<<act 'Exit Department'>>
				<<gt 'larek' 'food'>>
			<</act>>
		<</actCLA>>
	<</if>>
	<<if $finances.cash >= 100 and $inventory.get("sandwich") == 0 and $wardrobe.purse.isValidItem > 0>>
		<<actCLA 'Buy a sandwich (100 RUB)'>>
			<<set $finances.cash -= 100>>
			<<run $inventory.set('sandwich',1)>>
			You bought a sandwich and put it in your purse.
			<<act 'Exit Department'>>
				<<gt 'larek' 'food'>>
			<</act>>
		<</actCLA>>
	<</if>>
	<<if $finances.cash >= 500 and $inventory.get("wine") == 0 and $wardrobe.purse.isValidItem > 0>>
		<<actCLA 'Buy a bottle of cheap wine (500 RUB)'>>
			<<set $finances.cash -= 500>>
			<<run $inventory.set('wine',1)>>
			You bought a bottle of wine and put it in your purse.
			<<act 'Exit Department'>>
				<<gt 'larek' 'food'>>
			<</act>>
		<</actCLA>>
	<</if>>
<</if>>
:: sofood_macro[widget]
<<widget 'sofood'>>
	<<if $time.hour >= 8 and $time.hour <= 20>>
		<<set $time.minutes += 3>>
		<<gt 'larek' 'food'>>
	<<else>>
		The grocery department is closed
	<</if>>
<</widget>>
:: buyfood_macro[widget]
<<widget 'buyfood'>>
	<<if $time.hour >= 8 and $time.hour <= 20>>
		<<if $finances.cash >= 50>>
				 			<<set $time.minutes = $time.minutes + 15>>
			<<image "locations/pushkin/cafe/larek.jpg">>
			<<set $portion = input ("How many servings would you like to buy?")>>
			<<if getvar("$portion") <= 0>>
			<<set $portion = 1>>

		<</if>>
			<<if $portion * 50 > $finances.cash>>
				You don't have enough money.
			<</if>>
			<<if $portion * 50 <= $finances.cash>>
				<<run $inventory.set('food',$inventory.get("food") + $portion)>>
				<<set $finances.cash = $finances.cash - $portion * 50>>
				You paid cash for the food.
			<</if>>
			<<act 'Move away from the counter'>>
			<<gt 'larek' 'food'>>
		<</act>>
		<<else>>
			You don't have enough money
		<</if>>
	<<else>>
		The grocery department is closed
	<</if>>
<</widget>>
:: buyfood2_macro[widget]
<<widget 'buyfood2'>>
	<<if $time.hour >= 8 and $time.hour <= 20>>
		<<if $finances.cash >= 250>>
				 			<<set $time.minutes = $time.minutes + 15>>
			<<set $portion = input ("How many servings would you like to buy?")>>
			<<if getvar("$portion") <= 0>>
			<<set $portion = 1>>

		<</if>>
			<<if $portion * 250 > $finances.cash>>
				You don't have enough money.
			<</if>>
			<<if $portion * 250 <= $finances.cash>>
				<<run $inventory.set('foodDiet',$inventory.get("foodDiet") + $portion)>>
				<<set $finances.cash = $finances.cash - $portion * 250>>
				<<image "locations/pushkin/cafe/larek.jpg">>
				You paid cash for the food.
			<</if>>
			<<act 'Move away from the counter'>>
			<<gt 'larek' 'food'>>
		<</act>>
		<<else>>
			You don't have enough money
		<</if>>
	<<else>>
		The grocery department is closed
	<</if>>
<</widget>>
