:: city_market
<<set $here = 'city_market'>>
<<set $ARGS = $location_var[$here]>>
<!-- !2021/04/29-->
<<set $location_type = 'public_outdoors'>>
<<if $location_var[$here][0] == 'start' or $loc_arg == 'start'>>
	<<set $clothingfilter to null>>
	<<if getvar("$sound") == 0>>
		<<if $time.month >= 11 and $time.month <= 12 or $time.month >= 1 and $time.month <= 3>>
			<<if $time.hour >= 8 and $time.hour <= 23>>
			<</if>>
			<<if $time.hour >= 0 and $time.hour <= 7>>
			<</if>>
		<<else>>
			<<if $time.hour >= 8 and $time.hour <= 23>>
			<</if>>
			<<if $time.hour >= 0 and $time.hour <= 7>>
			<</if>>
		<</if>>
	<</if>>
	<!-- !if sound = 0:PLAY 'sound/street.mp3',30-->
	<<set $time.minutes = $time.minutes + 5>>
	<<set $mag = 1>>
	<<set $loc_arg = 'start'>>
	<<set $loc = 'city_market'>>
	<<set $menu_loc = 'city_market'>>
	<<set $menu_arg = 'start'>>
	<h2>Marketplace</h2>
	<<image "locations/city/residential/market/rinok.jpg">>
	<p></p>
	<!-- FAILED TO CONVERT
		'One of the stalls has a sign attached to it that reads "Cash paid for secondhand clothes". You can <a href="exec:cloc=2 & gt ''clothing'', ''view_clothing_list'', ''sell''">sell individual items</a> or <a href="exec:gs ''portnoi''">all of your unwanted clothes here</a>.'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """'One of the stalls has a sign attached to it that reads "Cash paid for secondhand clothes". You can <a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:cloc=2""">> <<set gt ''clothing'' , 'view_clothing_list' , ERROR: FAILED TO CONVERT LITERAL: """''sell''">sell individual items<""" / ERROR: FAILED TO CONVERT LITERAL: """a> or <a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''portnoi''">all of your unwanted clothes here<""" / ERROR: FAILED TO CONVERT LITERAL: """a>.'""">>

	-->
	<<warn "CONVERSION ERROR 58ee1630d3c73f38b411d567d21c56b2">>
	<<if $message != ''>>
		<center>'+$message+'</center>
		<<set $message to null>>
	<<else>>
		<p></p>
	<</if>>

	*P FUNC ('$stock_item', 10, 'Dishwashing detergent', 400, 'fairy', 'city_market')
	*P FUNC ('$stock_item', 10, 'Clothing detergent', 400, 'poroshok', 'city_market')
	*P FUNC ('$stock_item', 8, 'Plates', 450, 'cltarelka', 'city_market')
	*P FUNC ('$stock_item', 20, 'Cosmetics', 1000, 'kosmetica', 'city_market')
	*P FUNC ('$stock_item', 25, 'Razors (number of shaves)', 300, 'stanok', 'city_market')
	*P FUNC ('$stock_item', 10, 'Tampons', 160, 'tampon', 'city_market')
	*P FUNC ('$stock_item', 10, 'Sanitary napkins', 80, 'sanpad', 'city_market')
	<<stockItem `{id:'$inventory.get("umbrella")',amount:1,price:1000,label:'Umbrella'}`>><</link>>.
			<<arouse 'foreplay' 3 >>
		<</if>>
	<</if>>
	<<actCLA 'Leave'>>
		<<set $time.minutes += 5>>
		<<set $loc_arg = ''>>
		
		<<gt 'city_residential'>>
	<</actCLA>>
	<<if getvar("$workrin") == 1>>
		<<if $time.weekday == 2 or $time.weekday == 4 or $time.weekday == 6>>
			<<if $time.hour < 9>>
				Arthur is waiting to set up a stall for you.
				<<actCLA '<b>Set up stall</b>'>>
					 					<<set $time.hour = 9>>
					<<set $time.minutes = 0>>
					<<set $prodpayum = 1200>>
					Arthur unloads boxes from his truck and gives them to you. You start hanging the clothes inside around the stall.
					<p>Before leaving, Arthur gives you instructions. "Sell it all at whatever price you want, but at the end of your shift, I'll charge you 1000 <b>₽</b> for each item sold. You should be making me no less than arturplan <b>₽</b>."</p>
					<<act 'Start working'>>
						<<gt 'city_marketwork' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
		<</if>>
		<<actCLA 'Quit'>>
			<<set $work = 0>>
			<<set $workrin = 0>>
			You quit your job at the market and collect your papers.
			<<act 'Leave'>>
				<<gt 'city_market' 'start'>>
			<</act>>
		<</actCLA>>
	<</if>>
	<<if (getvar("$work") == 0 or getvar("$cheatWork") == 1) and getvar("$workrin") == 0>>
		$nl
		A messily written ad hangs from one of the stalls. "Need female market stall staff. Paychecks big."
		<<actCLA 'Approach the owner of the ad'>>
			 			<p>Hi, my name is Arthur. I own many stalls here and I need a saleswoman. Want the job?</p>
			Pay is a percentage of sales, paid at end of shift. Your shifts would be Tuesdays, Thursdays and Saturdays from 08:00 to 14:00.
			Government insist I have your papers, so it would be your main job.
			<<act 'Leave'>>
				<<gt 'city_market' 'start'>>
			<</act>>
			<<actCLA 'Take the job'>>
				<<set $work = 1>>
				<<set $workrin = 1>>
				<<set $arturplan = 5000>>
				You give your papers to Arthur and he shakes your hand, welcoming you aboard.
				<<act 'Leave'>>
					<<gt 'city_market' 'start'>>
				<</act>>
			<</actCLA>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Go to the book tray'>>
		<<set $time.minutes += 15>>
		<p>You wlak up to the stall and inspect what's on sale. You see a fantasy book, a science fiction book and various romance novels. They all cost 350 <b>₽</b> each.</p>
		<<if $finances.cash >= 350>>
			<<actCLA 'Buy the fantasy book'>>
				<<set $time.minutes += 15>>
				<<set $finances.cash -= 350>>
				<<set $f_book += 1>>
				<p>You buy the fantasy book for 350 <b>₽</b>.</p>
				<<act 'Leave'>>
					<<gt 'city_market' 'start'>>
				<</act>>
			<</actCLA>>
		<</if>>
		<<if $finances.cash >= 350>>
			<<actCLA 'Buy the science fiction book'>>
				<<set $time.minutes += 15>>
				<<set $finances.cash -= 350>>
				<<set $f_book += 1>>
				<p>You buy the science fiction book 350 <b>₽</b>.</p>
				<<act 'Leave'>>
					<<gt 'city_market' 'start'>>
				<</act>>
			<</actCLA>>
		<</if>>
		<<if $finances.cash >= 350>>
			<<actCLA 'Buy a romance novel'>>
				<<set $time.minutes += 15>>
				<<set $finances.cash -= 350>>
				<<set $w_book += 1>>
				<p>You buy a romance novel for 350 <b>₽</b>.</p>
				<<act 'Leave'>>
					<<gt 'city_market' 'start'>>
				<</act>>
			<</actCLA>>
		<</if>>
		<<act 'Leave'>>
			<<gt 'city_market' 'start'>>
		<</act>>
	<</actCLA>>
	<<actCLA 'View clothing'>>
		<<set $time.minutes += 5>>
		<<gt 'city_market' 'clo'>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'clo'>>
	<<set $loc_arg = 'clo'>>
	<<set $loc = 'city_market'>>
	
	<h2>Clothes.</h2>
	You inspect the cheap clothing the stall has to offer.
	<<gs 'clothing_QV' 'shop_filter_header'>>
	<<actCLA 'Return'>>
		<<set $time.minutes += 5>>
		<<gt 'city_market' 'start'>>
	<</actCLA>>
	<!-- !!To filter just this set-->
	<<set $clo_i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loopmarket_outfits_filter'>>
	<<set $i = 1>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loopmarket_outfits'>>
	<<if getvar("$market_outfits["+$i+"]") == 0>>
		<<gs 'clothing_attributes' 'market_outfits' $i>>
		<<gs 'clothing_QV' 'shop_filter'>>
		<!-- !!sort by filter-->
		<<if (getvar("$clothingfilter['quality']") == 0 and $CloQuality == $clo_i) or (getvar("$clothingfilter['inhibition']") == 0 and $CloInhibit == $clo_i) or getvar("$clothingfilter['number']") == 0>>
			<!-- FAILED TO CONVERT
				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:*p '<a href="exec: i = <<i>> & gt ''city_market'', ''marketclo''"><img <<$set_imgh>> src="images/pc/items/market/clothes/<<i>>.jpg" 	height="250" /></a>'
			-----
				<<if getvar("$clothingfilter['inc']") == 1 and getvar("$clothingfilter['only']") == 1>>
				<!-- FAILED TO CONVERT
	*p '<a href="exec: i = <<i>> & gt ''city_market'', ''marketclo''"><img <<$set_imgh>> src="images/pc/items/market/clothes/<<i>>.jpg" 	height="250" /></a>'
-----
	<<set  * ERROR: FAILED TO CONVERT LITERAL: """p '<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec: i = <<i>>""">> <<set gt ''city_market'' , ERROR: FAILED TO CONVERT LITERAL: """''marketclo''"><img $set_imgh src""" = "images / $pc / $items / $market / $clothes / ERROR: FAILED TO CONVERT LITERAL: """<<i>>.jpg" 	height="250"""" / ERROR: FAILED TO CONVERT LITERAL: """><""" / ERROR: FAILED TO CONVERT LITERAL: """a>'""">>

-->
<<warn "CONVERSION ERROR 9b5450df7dc464a7c2ea139b1649494d">>

			<</if>>

			-->
			<<warn "CONVERSION ERROR f3cb1935e134a915f4e1815bb0179a5e">>
		<</if>>
	<</if>>
	<<set $i += 1>>
	<<if getvar("$i") <= 40>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loopmarket_outfits'>>

	<</if>>
	<<set $clo_i += 1>>
	<<if getvar("$clothingfilter['quality']") == 0 and getvar("$clo_i") <= 7>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loopmarket_outfits_filter'>>
	<<elseif getvar("$clothingfilter['inhibition']") == 0 and getvar("$clo_i") <= 40>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loopmarket_outfits_filter'>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'marketclo'>>
	<<if getvar("$market_outfits["+$i+"]") != 0>>
		<<msg 'You already own these clothes.'>>
		<<gt 'city_market' 'clo'>>
	<</if>>
	<<gt 'clothing' 'view_clothing_item' 'market_outfits' $i 750 'shop'>>
<</if>>
<<if $location_var[$here][0] == 'tailor'>>
	<<set $loc = 'city_market'>>
	<<set $loc_arg = 'tailor'>>
	<<set $menu_loc = 'city_market'>>
	<<set $menu_arg = 'tailor'>>
	<<set $menu_off = 0>>
	<p>A sign reads, "Jacob Solomonovich Schneersohn, tailor, 8:00-16:00 Monday - Friday"</p>
	<<actCLA 'Speak to the tailor'>>
		 		An elderly Jewish man is sitting at a table. He pulls his glasses down a little and looks over the top of them as he points at you.
		<<if getvar("$portnoyQW") > 0>>
			<p>"So $pc.name_nick. Do you need any clothing adjusted?"</p>
			<<if $finances.cash >= 500>>
				<<actCLA 'Resize the clothes you`re wearing (500 <b>₽</b>)'>>
					<<if getvar("$CloStyle") == 5 or $wardrobe.clothingworntype == 'danilovich_outfits'>>
						<p>The tailor is looking irritatingly at you, "Why are you wasting my time with exercise clothing? That type of clothing does not need to be resized..."</p>
					<<elseif State.getVar('$'+$wardrobe.clothingworntype+'_b['+clothingwornnumber+']') == $pc.pcs_hips>>
						<p>The tailor is looking irritatingly at you, "Is this joke? Your clothes could not fit you better if they had been made for you. I have no time for such foolishness."</p>
					<<elseif State.getVar('$'+$wardrobe.clothingworntype+'_b['+clothingwornnumber+']') > $pc.pcs_hips + 4 or State.getVar('$'+$wardrobe.clothingworntype+'_b['+clothingwornnumber+']') < $pc.pcs_hips - 4>>
						<p>The tailor is looking irritatingly at you, "Why are you wasting my time? Your clothing does not need to be resized. It might not be perfect but it is still fine."</p>
					<<else>>
						<<set $time.minutes += 10>>
						<<set $finances.cash -= 500>>

						<<run State.setVar($wardrobe.clothingworntype+'_b['+clothingwornnumber+']',$pc.pcs_hips)>>
						<p>You are handed a t-shirt and shorts as you undress and give the clothes to the tailor for adjustment.</p>
						Jacob quickly measures your waist and hips, then only takes a few minutes to adjust your outfit.
						You are handed your clothes back and quickly get dressed. You're pleased with the job that the tailor has done.
					<</if>>
					<<act 'Continue'>>
						<<gt 'city_market' 'tailor'>>
					<</act>>
				<</actCLA>>
				<<act 'Take in different clothes'>>
					<<gt 'clothing' 'view_clothing_list' 'resize'>>
				<</act>>
				<<act 'Take in all the clothes'>>
					<<gt 'portnoi2'>>
				<</act>>
			<</if>>
		<<else>>
			<p>"Hello young lady. I am Jacob Solomonovich, but you can call me Yasha. And what is your name?"</p>
			<<actCLA 'Tell him your name'>>
				<<set $portnoyQW = 1>>
				<p>"$pc.name_nick"</p>
				<p>"$pc.name_nick....What a pretty name. Come, sit here on this chair. How can I help you?"</p>
				<<actCLA 'Ask him about your clothes'>>
					 					<<set $time.minutes += 15>>
					<p>"Can you tailor my clothes to fit me better?"</p>
					<p>"Of course I can! Otherwise, what kind of tailor would I be? Here, let me see what you're wearing."</p>
					He jumps up and nimbly removes the tape from his neck and begins to measure your chest, waist and hips.
					<p>"I can adjust any clothing that doesn't fit you for 500 <b>₽</b> per item."</p>
					<<act 'Continue'>>
						<<gt 'city_market' 'tailor'>>
					<</act>>
				<</actCLA>>
			<</actCLA>>
		<</if>>
		<<actCLA 'Leave'>>
			<<set $time.minutes += 10>> <<gt 'city_residential'>>
		<</actCLA>>
	<</actCLA>>
<</if>>
