:: city_marketwork
<<set $here = 'city_marketwork'>>
<<set $ARGS = $location_var[$here]>>
<<set $location_type = 'event_outdoors'>>
<!-- ! Variables used-->
<!-- ! rinvesh = 	sold Items of clothing-->
<!-- ! rinmon =		Total cash taken-->
<!-- ! arturplan =	Amount Arthur expects min-->
<!-- ! arturnoo, arturyes = Times failed, reached sales-->
<!-- ! workrin 		working in the market-->
<!-- ! repa   ???????????-->
<!-- ! pokupatel = 	customer interested-->
<!-- ! prodpayum =	average price-->
<!-- ! pokpay =		amount customer is willing to pay-->
<!-- ! pcs_apprnc =	Attractiveness-->
<!-- ! rinslut 		Arthur only keeps quiet if you do what he says-->
<!-- ! palevorin =	0:Never had Sex w Arthur-->
<!-- ! 				1:Had Sex w Arthur-->
<!-- !				2:Declined GB-->
<!-- !				3:Declined GB talked Arthur-->
<!-- !				4:Agreed GB-->
<!-- !				5:Agreed GB talked Arthur-->
<!-- !tetaKataQW		?-->
<!-- !annaQW 		?-->
<!-- !NadiaQW 		?-->
<!-- !-->
<<if $location_var[$here][0] == 'start'>>
	<<set $loc_arg = 'start'>>
	<<set $loc = 'city_marketwork'>>
	<<set $menu_loc = 'city_marketwork'>>
	<<set $menu_arg = 'start'>>
	<<set $menu_off = 0>>
	<h2>Marketplace</h2>
	<<image "locations/city/residential/market/rinok.jpg">>
	You stand at your clothes stall waiting for customers.
	<p>You have sold rinvesh items and taken rinmon <b>₽</b> in cash.</p>
	The average price on the market is <<prodpayum>>.
	<<if $time.hour == 14>>
		Arthur comes up to you and you start to calculate how much you should give him.
		<<actCLA 'Give money to Arthur'>>
			 			<<set $rinart = $rinvesh * 1000>>
			<<set $rinmon -= $rinart>>
			<<set $finances.cash += $rinmon>>
			You give Arthur <<rinart>> per sold <<rinvesh>> items.
			<p>You have earned rinmon <b>₽</b> today.</p>
			<<set $rinmon = 0>>
			<<set $rinvesh = 0>>
			<<if $rinart < $arturplan>>
				<<set $arturnoo += 1>>
				<p>This is bad, $pc.name_nick. You haven't made enough money. You'll completely ruin me!</p>
			<<else>>
				<<set $arturyes += 1>>
				<p>Well done $pc.name_nick, good job today.</p>
			<</if>>
			<<if $arturnoo > $arturyes>>
				<<set $arturnoo = $arturnoo - $arturyes>> <<set $arturyes = 0>>

			<</if>>
			<<if $arturyes > $arturnoo>>
				<<set $arturyes = $arturyes - $arturnoo>> <<set $arturnoo = 0>>

			<</if>>
			<<if $arturnoo == $arturyes>>
				<<set $arturnoo = 0>> <<set $arturyes = 0>>

			<</if>>
			<<if getvar("$arturnoo") > 10>>
				<<set $arturnoo = 0>>
				<<set $work = 0>>
				<<set $workrin = 0>>
				<p>You're fucking useless! Here's your papers. I don't want to see you again!</p>
				<<act 'Leave'>>
					<<gt 'city_residential'>>
				<</act>>
				$exit
			<</if>>
			<<set $rinrand = rand(1, 400)>>
			<<if $rinrand < $pc.pcs_apprnc>>
				<<if getvar("$palevorin") <= 1 or getvar("$palevorin") == 3>>
					<<if getvar("$palevorin") == 0>>
						<p>"Hey $pc.name_nick, you and I have not met properly. Come into the warehouse. We can have a drink and a bite to eat while we get acquainted."</p>
					<<elseif getvar("$palevorin") == 1>>
						<p>"Hey $pc.name_nick, want to come to the warehouse again?"</p>
					<<else>>
						<p>"Hey $pc.name_nick. Come into the warehouse and have a drink with me." He walks right up to you and slaps you on the ass.</p>
					<</if>>
					<<actCLA 'Refuse'>>
						<p>You start making excuses and Arthur frowns. "Hey, don't insult me! Your stall is filthy, just look at all this dust and dirt! I should fine you, but if you're nice, I'll let you off.</p>
						<<act 'Go to the warehouse'>>
							<<gt 'city_marketsex' 'the_beginning'>>
						<</act>>
						<<actCLA 'No'>>
							<<set $arturplan += 1000>>
							<<if $finances.cash >= 1000>>
								<<set $finances.cash -= 1000>>
								<p>"Your stall is filthy! I'm fining you 1000 <b>₽</b>." You hand over the money and Arthur quickly snatches it.</p>
							<<else>>
								Go with him before it gets worse.
							<</if>>
							<<act 'Leave'>>
								<<gt 'city_residential'>>
							<</act>>
						<</actCLA>>
					<</actCLA>>
					<<act 'Go with him'>>
						<<gt 'city_marketsex' 'the_beginning'>>
					<</act>>
				<<elseif getvar("$palevorin") == 2>>
					Arthur walks into the stall behind you carrying some boxes. He places them down and walks up behind you, giving your ass a slap and squeeze. "I'm glad you turned Abdul and Hassan down. I like having you all to myself."
					<p>You turn your head to look at him and smile. "I like that too, but maybe you can lock the door first from now on?"</p>
					He laughs and nods. "Of course of course, anything for you my sweet. If you wish for the door to be locked, the door will be locked. Why don't we go and make sure it works first..."
					<<actCLA 'Go with Arthur'>>
						<<set $palevorin = 3>> <<gt 'city_marketsex' 'the_beginning'>>
					<</actCLA>>
				<<elseif getvar("$palevorin") == 4>>
					<p>Arthur walks into the stall behind you carrying some boxes. He places them down and walks up behind you, giving your ass a slap and squeeze with one hand while the other snakes around and roughly grabs your breast as he whispers in your ear. "So, you like cock? I didn't think you were a little slut but that's okay, I like dirty sluts."</p>
					He cuts you off before you can protest. "No it's good, I can use this. Now let''s go to the warehouse so I can fuck you."
					<<actCLA 'Go with him '>>
						<<set $palevorin = 5>> <<gt 'city_marketsex' 'sex'>>
					<</actCLA>>
					<<actCLA 'Refuse' undefined `{willpower:['sex','resist','hard']}`>>
							
							<p>You shake your head and pull out of his grasp. "I'm not a slut and I'm sure as hell not going with you!"</p>
							<p>You see the anger flare up in his eyes. "So you think you're too good for me whore? I gave you a job and treated you well. Then you fucked those two and now I'm not good enough?" He shakes his head. "Get your ass in the warehouse <i>now</i> or you're fired and I'll tell Abdul and Hassan they are free to tell everyone about how you greedily took their cocks like the little slut you are."</p>
							You're shocked at this level of anger and the ultimatum. You are unsure of what to do...
							<<actCLA 'Go to warehouse'>>
								<<set $palevorin = 5>> <<gt 'city_marketsex' 'sex'>>
							<</actCLA>>
							
							<<if $will_cost <= $pc.pcs_willpwr>>
								<<actCLA 'Get fired (will_cost Willpower)'>>
									<<gs 'pain' 5 'cheeks' 'slap'>>
									
									You shake your head. "No, I won''t go with you."
									<p>Before you notice him raising his hand, you feel the burning sensation on your cheek as he slaps you. "Then get out of here whore! You're fired and I don't want to see you back here!" He pushes you out from behind his stall, loud enough that many people are looking in your direction to what's going on.</p>
									You walk away in shame while rubbing your stinging cheek.
									<<if getvar("$rinslut") == 0>>
										<<set $rinslut = 1>>

									<</if>>
									<<act 'Leave'>>
										<<gt 'city_residential'>>
									<</act>>
								<</actCLA>>
							<<else>>
								<<actCLA `'Get fired ('+$will_cost+')'`>><font color=red><br/>You don`t have enough willpower to use this action.</font><</actCLA>>
							<</if>>
						<</actCLA>>
					
				<<elseif getvar("$palevorin") == 5>>
					<<set $sexgrouprand = rand(0,1)>>
					<<if getvar("$sexgrouprand") == 1>>
						<p>Arthur walks up and slaps your ass hard before grabbing you roughly by the arm. "Hey bitch, how would you like to make some extra money? My friends need company."</p>
						<<act 'Go with him'>>
							<<gt 'city_marketsex' 'group'>>
						<</act>>
					<<else>>
						Arthur walks up and slaps your ass hard before grabbing you roughly by the arm. "Get your fucking ass in the warehouse, bitch."
						<<act 'Go with him'>>
							<<gt 'city_marketsex' 'sex'>>
						<</act>>
					<</if>>
					<<actCLA 'Refuse' undefined `{willpower:['sex','resist','hard']}`>>
							<<gs 'willpower' 'pay' 'resist'>>
							<p>You start making excuses and Arthur frowns. "Don't insult me you little fucking slut! I was there. I know what a cock loving whore you are. Now get your fucking ass in the warehouse or the whole town will know about you!"</p>
							<<if getvar("$sexgrouprand") == 1>>
								<<act 'Go to warehouse'>>
									<<gt 'city_marketsex' 'group'>>
								<</act>>
							<<else>>
								<<act 'Go to warehouse'>>
									<<gt 'city_marketsex' 'sex'>>
								<</act>>
							<</if>>
							<<actCLA 'No' undefined `{willpower:['sex','resist','hard']}`>>
									<<set $arturnoo = 0>>
									<<set $work = 0>>
									<<set $workrin = 0>>
									
									<<if getvar("$rinslut") == 0>>
										<<set $rinslut = 1>>

									<</if>>
									<<if getvar("$repa") < 6>>
										<<set $repa = 6>>

									<</if>>
									<p>"Then fuck you, you little fucking whore! You're fired and by tomorrow the whole town will know what a cock loving whore you are!"</p>
									<<act 'Leave'>>
										<<gt 'city_residential'>>
									<</act>>
								<</actCLA>>
							
						<</actCLA>>
					
				<<else>>
					<<act 'Leave work'>>
						<<gt 'city_residential'>>
					<</act>>
				<</if>>
			<<else>>
				<<act 'Leave work'>>
					<<gt 'city_residential'>>
				<</act>>
			<</if>>
		<</actCLA>>
		$exit
	<<elseif $time.hour < 14>>
		<<actCLA 'Laze around (0:15)'>>
			<<set $time.minutes += 15>>
			<<gt 'city_marketwork' 'start'>>
		<</actCLA>>
		<<if $finances.cash >= 200>>
			<<actCLA 'Buy a snack (200 <b>₽</b>) (0:15)'>>
				<<set $tetaKataQW += 1>>
				<<set $finances.cash -= 200>>
				<<gs 'kit_din'>>
				<<gt 'beverage' 'snack'>>
			<</actCLA>>
		<</if>>
		<<set $rintakrand = rand(0, 5)>>
		<<set $talkrand = rand(0, 2)>>
		<<if $time.hour == 9>>
			<<if getvar("$rintakrand") == 0>>
				<<set $rintak = 'Hassan unloads clothes in front of Nadia`s stall.'>>
				<<actCLA 'Watch Hassan and Nadia'>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						"You will sell more today, and to the rich ladies. I need the money, Nadia."

					<</if>>
					<<if getvar("$talkrand") == 1>>
						Hassan opens trunks and puts clothes on the counter.

					<</if>>
					<<if getvar("$talkrand") >= 2>>
						Hassan drags trunks to his stall.

					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 1>>
				<<set $rintak = 'Abdul is talking loudly and giving clothes to Anna at the next stall over.'>>
				<<actCLA 'Watch Abdul and Anna'>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						<p>"We're fucked, you can't sell anything!" Abdul shouts at Anna. "No wonder! You give me this rotten shit to sell! Nobody wants it!" she retorts.</p>

					<</if>>
					<<if getvar("$talkrand") == 1>>
						Abdul slaps Anna''s ass, but she pretends that nothing happened.

					<</if>>
					<<if getvar("$talkrand") >= 2>>
						Abdul drags trunks to his stall.

					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 2>>
				<<set $rintak = 'Abdul and Hassan stand beside your stall speaking to each other in their native language.'>>
				<<actCLA 'Watch them'>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						They continue to talk, but you don't know the language and can't understand what they're saying.

					<</if>>
					<<if getvar("$talkrand") == 1>>
						They ignore you and discuss what sounds like clothes prices.

					<</if>>
					<<if getvar("$talkrand") >= 2>>
						Abdul looks at you. "Look at that girl. She looks like a good fuck." Hassan looks you over and nods in agreement.

					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 3>>
				<<set $rintak = 'Anna hangs clothes on her stall while shouting at Nadia.'>>
				<<actCLA 'Chat with the girls'>>
					<<set $annaQW += 1>>
					<<set $NadiaQW += 1>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						Anna tells you that her skirt needed altering and that there is a great tailor''s shop nearby.
					<<else>>
						Nadia tells you how some pervert molested her on the subway by rubbing his dick on her ass.
					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 4>>
				<<set $rintak = 'Arthur is talking about something with Abdul.'>>
				<<actCLA 'Watch them'>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						They continue to talk, but you don't know the language and can't understand what they're saying.

					<</if>>
					<<if getvar("$talkrand") == 1>>
						They ignore you and discuss what sounds like clothes prices.

					<</if>>
					<<if getvar("$talkrand") >= 2>>
						<p>Abdul looks at you. "Nice looking girl you got there. You fucking her?"</p>

					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") >= 5>>
				<<set $rintak = 'Arthur, Abdul and Hassan are talking loudly to each other in their native language.'>>
				<<actCLA 'View the Armenians'>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						They continue to talk, but you don't know the language and can't understand what they're saying.

					<</if>>
					<<if getvar("$talkrand") == 1>>
						They ignore you and discuss what sounds like clothes prices.

					<</if>>
					<<if getvar("$talkrand") >= 2>>
						<p>Abdul looks at you. "Pretty little girl you have there. Can I have her?"</p>

					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<$rintak>>
		<<elseif $time.hour == 10>>
			<<if getvar("$rintakrand") == 0>>
				<<set $rintak = 'Hassan sits on a chair dejectedly chewing food and talking with his mouth full to his saleswoman Nadia.'>>
				<<actCLA 'Watch'>>
					<<set $time.minutes += 15>>
					<p>"Nadia, why do you refuse? Come and have some wine."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 1>>
				<<set $rintak = 'Nadia sits in her stall doing crossword puzzles.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW += 1>>
					<<set $time.minutes += 15>>
					Nadia sits her crossword down and willingly gossips with you.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 2>>
				<<set $rintak = 'Customers are crowded around Nadia`s stall. She fusses around before them laying out her goods.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Nadia frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 3>>
				<<set $rintak = 'Anna is drinking coffee in her stall.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW += 1>>
					<<set $time.minutes += 15>>
					Anna is happy to chat with you about pretty much anything.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 4>>
				<<set $rintak = 'Anna is in her stall, trying to interest customers in her goods.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Anna frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") >= 5>>
				<<set $rintak = 'Anna is gossiping with Aunt Katya.'>>
				<<actCLA 'Chat with Anna and Aunt Katya'>>
					<<set $annaQW += 1>>
					<<set $tetaKataQW += 1>>
					<<set $time.minutes += 15>>
					Aunt Katya is talking about her pies and Anna complains that it's because of her pies that her ass is twice as big as it was.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<$rintak>>
		<<elseif $time.hour == 11>>
			<<if getvar("$rintakrand") == 0>>
				<<set $rintak = 'Nadia is approached by three Armenians who begin to molest her. She swears at them and tries to dodge their groping hands.'>>
				<<actCLA 'Look at Nadia and Armenians'>>
					<<set $time.minutes += 15>>
					The Armenians seem to be trying to persuade Nadia to have sex with them.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 1>>
				<<set $rintak = 'Nadia is eating cake in her stall.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW += 1>>
					<<set $time.minutes += 15>>
					Nadia finishes her cake and chats with you.
					<<if getvar("$clener") == 0>>
						<<set $clener = 1>>
						Nadia tells you about an office building not too far away that is looking for a cleaner.
					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 2>>
				<<set $rintak = 'Customers are crowded around Nadia`s stall. She fusses around before them laying out her goods.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Nadia frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 3>>
				<<set $rintak = 'Anna is reading a newspaper in her stall.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW += 1>>
					<<set $time.minutes += 15>>
					Anna is happy to chat with you about pretty much anything.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 4>>
				<<set $rintak = 'Anna is in her stall, trying to interest customers in her goods.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Anya frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") >= 5>>
				<<set $rintak = 'Nadia is approached by three Armenians who begin to molest her. She swears at them and tries to dodge their groping hands.'>>
				<<actCLA 'Look at Nadia and Armenians'>>
					<<set $time.minutes += 15>>
					The Armenians seem to be trying to persuade Nadia to have sex with them.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<$rintak>>
		<<elseif $time.hour == 12>>
			<<if getvar("$rintakrand") == 0>>
				<<set $rintak = 'Hassan has bought chebureki and is eating it while sitting behind Nadia in the stall.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW -= 1>>
					<<set $time.minutes += 15>>
					Nadia shies away from talking in front of Hassan.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 1>>
				<<set $rintak = 'Nadia is surrounded by customers.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Nadia frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 2>>
				<<set $rintak = 'Nadia is talking with Anna.'>>
				<<actCLA 'Chat with the girls'>>
					<<set $annaQW += 1>>
					<<set $NadiaQW += 1>>
					<<set $time.minutes += 15>>
					<<if getvar("$talkrand") == 0>>
						Anna tells you that her friend used to clean an office building not far from here and that they are looking for a new cleaner if you need to make some extra cash.
						<<if getvar("$clener") == 0>>
							<<set $clener = 1>>

						<</if>>
					<<elseif getvar("$talkrand") == 1>>
						Nadia tells you how some pervert molested her on the subway by rubbing his dick on her ass.
					<</if>>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 3>>
				<<set $rintak = 'Anna is selling clothing to customers.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW -= 1>>
					<<set $time.minutes += 15>>
					<p>Anna frowns at you. "Shoo, no distractions! I have customers."</p>
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") == 4>>
				<<set $rintak = 'Anna is drinking coffee while sitting at her stall.'>>
				<<actCLA 'Chat with Anna'>>
					<<set $annaQW += 1>>
					<<set $time.minutes += 15>>
					Anna happily chats with you about pretty much anything.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<<elseif getvar("$rintakrand") >= 5>>
				<<set $rintak = 'A bored looking Nadia is idly sitting in her stall looking for something to do.'>>
				<<actCLA 'Chat with Nadia'>>
					<<set $NadiaQW += 2>>
					<<set $time.minutes += 15>>
					Nadia is glad for the distraction and has fun chatting with you.
					<<act 'Go back to work'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<$rintak>>
		<<elseif $time.hour == 13>>
			<<if getvar("$rintakrand") == 0>>
				<<set $rintak = 'Hassan begins to slowly collect goods from Nadia.'>>
			<<elseif getvar("$rintakrand") == 1>>
				<<set $rintak = 'Anya sits and calculates her profit for the day.'>>
			<<elseif getvar("$rintakrand") == 2>>
				<<set $rintak = 'Nadia calculates her days profit.'>>
			<<elseif getvar("$rintakrand") == 3>>
				<<set $rintak = 'Abdul begins collecting goods from Anna.'>>
			<<elseif getvar("$rintakrand") == 4>>
				<<set $rintak = 'Arthur walks past your stall.'>>
			<<else>>
				<<set $rintak = 'Aunt Katya stops trading pies and leaves.'>>
			<</if>>
			<<$rintak>>
		<</if>>
		<<set $pokrand = rand(0, 1)>>
		<<if getvar("$pokrand") == 0>>
			<<set $pokup = 'You have no customers.'>>
			<<set $pokupatel = 0>>
			<p></p>
			Aunt Katya pushes her trolley through the market carrying cakes and coffee.
		<<else>>
			<<set $pokupatel = 1>>
			<<set $poktiprand = rand(0, 7)>>
			<<if getvar("$poktiprand") == 0>>
				<<set $pokup = 'A middle-aged man approaches your stall.'>> <<set $poktip = 'The man'>> <<set $pokti = 1>>

			<</if>>
			<<if getvar("$poktiprand") == 1>>
				<<set $pokup = 'A young man approaches your stall.'>> <<set $poktip = 'The guy'>> <<set $pokti = 2>>

			<</if>>
			<<if getvar("$poktiprand") == 2>>
				<<set $pokup = 'A teenage boy approaches your stall.'>> <<set $poktip = 'The boy'>> <<set $pokti = 3>>

			<</if>>
			<<if getvar("$poktiprand") == 3>>
				<<set $pokup = 'A woman approaches your stall.'>> <<set $poktip = 'The woman'>> <<set $pokti = 1>>

			<</if>>
			<<if getvar("$poktiprand") == 4>>
				<<set $pokup = 'A girl approaches your stall.'>> <<set $poktip = 'The girl'>> <<set $pokti = 2>>

			<</if>>
			<<if getvar("$poktiprand") == 5>>
				<<set $pokup = 'A teenage girl approaches your stall.'>> <<set $poktip = 'The teenager'>> <<set $pokti = 3>>

			<</if>>
			<<if getvar("$poktiprand") == 6>>
				<<set $pokup = 'An old man approaches your stall.'>> <<set $poktip = 'The old man'>> <<set $pokti = 0>>

			<</if>>
			<<if getvar("$poktiprand") == 7>>
				<<set $pokup = 'An old woman approaches your stall.'>> <<set $poktip = 'The old woman'>> <<set $pokti = 0>>

			<</if>>
		<</if>>
		<b><<$pokup>></b>
		<<if getvar("$pokupatel") == 1>>
			<<actCLA 'How can I help you?'>>
				<<set $time.minutes += 15>>
				<<set $pokvnirand = rand(0, 2)>>
				<<if getvar("$pokvnirand") == 0>>
					<p>$poktip examines your wares with little interest.</p>
				<<elseif getvar("$pokvnirand") == 1>>
					<p>$poktip looks through your wares with interest.</p>
				<<elseif getvar("$pokvnirand") == 2>>
					<p>$poktip picks up an item.</p>
				<</if>>
				<<actCLA 'Now this is very fashionable'>>
					<<set $tipred = 3>>
					<<gs 'city_marketwork' 'answerrin'>>
				<</actCLA>>
				<<actCLA 'This item is very high quality and reliable'>>
					<<set $tipred = 1>>
					<<gs 'city_marketwork' 'answerrin'>>
				<</actCLA>>
				<<actCLA 'You`ll find this very reasonable'>>
					<<set $tipred = 0>>
					<<gs 'city_marketwork' 'answerrin'>>
				<</actCLA>>
				<<actCLA 'That is so you'>>
					<<set $tipred = 2>>
					<<gs 'city_marketwork' 'answerrin'>>
				<</actCLA>>
			<</actCLA>>
		<</if>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'answerrin'>>
	<<if $tipred == $pokti>>
		<p></p>
		<<if getvar("$pokvnirand") == 0>>
			<<set $pokpay = rand(1000, 1200)>>
		<<elseif getvar("$pokvnirand") == 1>>
			<<set $pokpay = rand(1100, 1300)>>
		<<elseif getvar("$pokvnirand") == 2>>
			<<set $pokpay = rand(1300, 1500)>>
		<</if>>
		<p>$poktip asks you for a price.</p>
		<<gs 'city_marketwork' 'tellprice'>>
	<<else>>
		<p>$poktip puts the item back and leaves.</p>
		<<act 'Further'>>
			<<gt 'city_marketwork' 'start'>>
		<</act>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'tellprice'>>
	<<actCLA 'Name the price'>>
		<<set $prodpay = input ("Enter the selling price")>>
		<<if getvar("$prodpay") < 1000>>
			<<set $prodpay = $prodpayum>>

		<</if>>
		<<set $poknorand = rand(1, 100 + pcs_apprnc/4)>>
		<p>"prodpay <b>₽</b>." you tell them.</p>
		<<if $prodpay <= $pokpay>>
			<<if getvar("$poknorand") >= 10>>
				<<set $rinmon += $prodpay>>
				<<set $rinvesh += 1>>
				<p>The customer takes the item and pays prodpay <b>₽</b>.</p>
				<<act 'Sell it'>>
					<<gt 'city_marketwork' 'start'>>
				<</act>>
			<<else>>
				<p>The customer twirls the clothing in their hands. "prodpay <b>₽</b> is too expensive."</p>
				<<gs 'city_marketwork' 'haggling'>>
			<</if>>
		<<elseif $prodpay > $pokpay and $prodpay <= $pokpay + 100>>
			<<if getvar("$poknorand") >= 10>>
				<p>The customer twirls clothing in their hands. "prodpay <b>₽</b> is too expensive."</p>
				<<gs 'city_marketwork' 'haggling'>>
			<<else>>
				They put the item back and leaves
				<<act 'Return'>>
					<<gt 'city_marketwork' 'start'>>
				<</act>>
			<</if>>
		<<elseif $prodpay > $pokpay + 100>>
			The customer puts the item back and leaves.
			<<act 'Return'>>
				<<gt 'city_marketwork' 'start'>>
			<</act>>
		<</if>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'haggling'>>
	<<if getvar("$prodpay") >= 1100>>
		<<actCLA 'Reduce the price by 100 <b>₽</b>'>>
			<p>You have reduced the price by 100 <b>₽</b>.</p>
			<<set $poknorand = rand(1, 100 + pcs_apprnc/4)>>
			<<if getvar("$poknorand") >= 10>>
				<<set $rinmon += $prodpay - 100>>
				<<set $rinvesh += 1>>
				<p>The customer takes the item and pays prodpay - 100 <b>₽</b></p>
			<<else>>
				The customer puts the item back and leaves.
			<</if>>
			<<act 'Haggle'>>
				<<gt 'city_marketwork' 'start'>>
			<</act>>
		<</actCLA>>
	<<elseif getvar("$prodpay") >= 1050>>
		<<actCLA 'Reduce the price by 50 <b>₽</b>'>>
			<p>You have reduced the price by 50 <b>₽</b>.</p>
			<<set $poknorand = rand(1, 100 + pcs_apprnc/4)>>
			<<if getvar("$poknorand") >= 30>>
				<<set $rinmon += $prodpay - 50>>
				<<set $rinvesh += 1>>
				<p>The customer takes the item and pays prodpay - 50 <b>₽</b></p>
			<<else>>
				The customer puts the item back and leaves.
			<</if>>
			<<act 'Haggle'>>
				<<gt 'city_marketwork' 'start'>>
			<</act>>
		<</actCLA>>
	<</if>>
	<<act 'Take the item back'>>
		<<gt 'city_marketwork' 'start'>>
	<</act>>
<</if>>
