:: pav_train_market[public outdoors]
	<h2>Market</h2>
	<<if $time.isWinter>>
		<<image "locations/pavlovsk/market/grinokw.jpg">>
	<<else>>
		<<image "locations/pavlovsk/market/grinok.jpg">>
	<</if>>
	<p>This small open-air market is located near the train station.</p>

	/*
	<!-- FAILED TO CONVERT
		'A sign on one of the stalls says, "Cash paid for secondhand clothes"; you can sell <a href="exec:gs ''portnoi''">all your unwanted clothes here</a>.'
	-----
		<<set 'A sign on one of the stalls says , ERROR: FAILED TO CONVERT LITERAL: """"Cash paid for secondhand clothes"; you can sell <a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''portnoi''">all your unwanted clothes here<""" / ERROR: FAILED TO CONVERT LITERAL: """a>.'""">>

	-->
	<<warn "CONVERSION ERROR bf79aac839a4dd3cb479ada99141853e">>
	<<if getvar("$arturQW") == 1 and ($time.weekday == 6 or $time.weekday == 7) and $time.hour < 12>>
		<<actCLA 'Wait for Arthur to arrive'>>
	<<set $time.hour = 12>> <<gt 'pav_train_market' 'start'>>
<</actCLA>>

	<</if>> */
	<<if $time.hour >= 8 and $time.hour <= 18>>
		<p>The market stalls are buzzing with shoppers. Everyone seems to be in a good mood, and you can hear back-and-forth bargaining as you pass by.</p>
		/*<<if $pc.fame('pav_slut') >= 100 and rand(0,9) == 0>>
			<<set $menu_off = 1>>
			<p>An Armenian man comes up to you and, in broken Russian, says, "You girl who like men, no? Come meet real men, have good time."</p>
			<<actCLA 'Reject him'>>
				You pretend not to understand what he is saying, smiling and shaking your head as you move away from him.
				<<act 'Return'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
			<</actCLA>>
			<<act 'Go with him'>>
				<<gt 'gevent' '3'>>
			<</act>>
			$exit
		<</if>>*/
		<<actCLA 'Go back to the market entrance'>>
			<<set $time.minutes += 3>> <<gt 'pav_market'>>
		<</actCLA>>
		<<act 'Wander through the market'>>
			<<gt 'pav_market_events'>>
		<</act>>
		<<if $location.get('pav_train_market_books','unlocked')>>
			<<ConnectedLocation 'Books Stand' 'pav_train_market_books' '' 'locations/pavlovsk/market/book.jpg' 5>>
		<</if>>

		<<if getvar("$pavmarket_porn") == 1>>
			<<actCLA 'Go to the porn stall'>>
				<<setn $time.minutes += 5>> <<gt 'pav_train_market' 4>>
			<</actCLA>>
		<</if>>
		/*<<if getvar("$arturKnow") == 1 and getvar("$arturQW") == 0>>
			<<act 'Look for Arthur'>>
				<<gt 'arturRinok' 'start'>>
			<</act>>
		<<elseif getvar("$arturQW") == 1 and ($time.weekday == 6 or $time.weekday == 7)>>
			<<if $time.hour == 12 or $time.hour == 13>>
				<<act 'Look for Arthur'>>
					<<gt 'arturRinok' 'work_1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$arturQW") == 2>>
			<<if $time.hour == 16 and $time.minutes <= 30>>
				<<act 'Look for Arthur'>>
					<<gt 'arturRinok' 'work_2'>>
				<</act>>
			<<elseif $time.hour < 16>>
				<<actCLA 'Wait for Arthur to arrive'>>
					<<set $time.hour = 16>> <<set $time.minutes = 0>> <<gt 'pav_train_market' 'start'>>
				<</actCLA>>
			<</if>>
		<</if>>
		<<if getvar("$gobelen") > 0 and getvar("$gobQW") == 0>>
			<<actCLA 'Sell ​​tapestry'>>
				<<set $menu_off = 1>>
				<<set $gobQW = 1>>
				<<set $time.minutes += 15>>
				<p>You stand quietly by the entrance to the market, waiting for customers and displaying your tapestries. Shortly buyers start to gather, but a large, muscular man approaches you and says, "It is illegal to trade in the market without a trader's license, but I may be interested in buying your tapestries, 1000<b>₽</b> apiece. So come and see me at my stall."</p>
				Not wanting to get into trouble, you pack your stuff away. The man was already gone, but you saw which direction he went, and he should be easy to find.
				<<act 'Leave'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
			<</actCLA>>
		<<elseif getvar("$gobelen") > 0 and getvar("$gobQW") >= 1>>
			<<actCLA 'Sell ​​tapestry'>>
				<<set $menu_off = 1>>
				<<set $time.minutes += 15>>
				<p>You go to the man who offered to buy your tapestries for 1000<b>₽</b>. You find him by his stall, smiling.</p>
				<<if getvar("$gobQW") == 2>>
					Roman welcomes you. He is interested and businesslike as he asks what you have for sale.
				<<elseif getvar("$gobQW") == 1>>
					<<set $gobQW = 2>>
					<<set $time.minutes += 5>>
					<p>The man greets you and introduces himself as Roman. You tell him that your name is $pc.name_nick. After a brief chat, Roman says he wants to see what you have for sale.</p>
				<</if>>
				<<act 'Leave'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
				<<actCLA 'Show your tapestry'>>
					<<set $gobelen -= 1>>
					<<set $finances.cash += 1000>>
					You show your tapestry to Roman, and he gives you five hundred. You take the money and give him the tapestry.
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
				<</actCLA>>
				<<if getvar("$gobelen") > 1>>
					<<actCLA 'Sell all of your tapestries'>>
						<p>You show Roman your tapestries, and he gives you gobelen * 1000 <b>₽</b> for them. You take the money and give him the tapestries.</p>
						<<set $finances.cash += $gobelen * 1000>>
						<<set $gobelen = 0>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
					<</actCLA>>
				<</if>>
			<</actCLA>>
		<</if>>
		<<if getvar("$ShowerIvan") == 5 and getvar("$porndeal") == 0 and rand(1,10) <= 4 and getvar("$ricewine") != 1 and $lookwine != $time.daystart>>
			<<set $time.minutes += 20>>
			<<set $menu_off = 1>>
			<<set $lookwine = $time.daystart>>
			<<image "locations/pavlovsk/market/chinese_stall01.jpg">>
			You were looking through the market when you found a stall selling Chinese foods. There are several bottles on a shelf behind the old woman minding the stall.
			<<actCLA 'Ask about wang-goo'>>
				<<image "locations/pavlovsk/market/chinese_stall01.jpg">>
				You asked the old woman if she has any rice wine to sell. She smiles at you and points to a basket filled with rice.
				<p>"Onry 2 <b>₽</b>, hundred glam." she said in badly accented Russian, "You buy?"</p>
				"No," you reply, "I need rice wine, rice wine."
				<p>She looks at you in confusion for a moment, then suddenly brightens, "Ah!" she exclaims, "Come, come!"</p>
				The old woman hurries to the other side of the stall as you follow her to where several smoked piglets are hung in a row.
				"Here," the old woman crowed, handing you one of the pigs, "Nice swine, vely nice swine."
				<p>"No, not nice swine," you sigh in despair, "Rice! Wine."</p>
				<p>"Yes, yes," the woman counters, "Nice swine, only 5 <b>₽</b>."</p>
				Just as you are about to give up, a young Chinese boy about your brother''s age arrives.
				Just as you are about to give up, a young Chinese boy about your brother''s age arrives.
				<p>"My grandmother asks why you don't like the piglets?" he translates as the old woman stops.</p>
				<p>"I don't want a pig," you reply in relief as his Russian is quite good, "I am looking for rice wine, wang-goo."</p>
				<p>"Ah, huangjiu!" he exclaims as he turns to his grandmother and starts speaking in Chinese.</p>
				The old woman glares at you, hangs back the smoked pig and shuffles over to the shelf with the bottles. She finally picks up one of them and brings it over to you.
				<p>"Why you not say wanted rice wine." she asked in aggrieved tones, "500<b>₽</b>."</p>
				<<if $finances.cash >= 500>>
					<<actCLA 'Buy the wine'>>
						<<set $finances.cash -= 500>>
						<<set $ricewine = 1>>
						You hand the woman the money, and she gives you the wine.
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
					<</actCLA>>
				<<else>>
					You are shocked by the high price and realize you cannot afford the wine. You apologize and turn away.
					<<act 'Leave the market'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
					<<actCLA 'Continue browsing the market'>>
						<<set $time.minutes += 15>>
						<<image "locations/pavlovsk/market/market_boy01.jpg">>
						You continue to wander through the market for another 15 minutes when the boy from the Chinese stall comes up to you.
						<p>"Hey, you really want that rice wine?" he asks after checking to ensure no one is watching.</p>
						"Yes," you answer him, "But it's too expensive. I can't afford it."
						"How about we make a deal." he says, "Go to the porn dealer and buy me a porn magazine and I'll get you the wine."
						<<if getvar("$pornmarkonce") == 0>>
							<<set $pornmarkonce = 1>> 

						<</if>>
						<<actCLA 'Refuse'>>
							You decline his offer as he upsettingly walks away.
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
						<</actCLA>>
						<<actCLA 'Agree'>>
							<<set $porndeal = 1>> <<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
			<</actCLA>>
		<<elseif getvar("$ShowerIvan") == 5 and getvar("$ricewine") != 1 and $lookwine != $time.daystart>>
			<<set $menu_off = 1>>
			<<set $lookwine = $time.daystart>>
			<<if $time.isWinter>>
				<<image "locations/pavlovsk/market/grinokw.jpg">>
			<<else>>
				<<image "locations/pavlovsk/market/grinok.jpg">>
			<</if>>
			You look around the market, but the Chinese vendors don't seem to be here today.
			<<act 'Leave'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
		<</if>>
		<<if getvar("$porndeal") == 1 and getvar("$ricewine") != 1 and $porndealday != $time.daystart>>
			<<set $menu_off = 1>>
			<<set $porndealday = $time.daystart>>
			<<set $lookboy = 0>>
			<<image "locations/pavlovsk/market/market_boy01.jpg">>
			The boy from the Chinese stall comes up to you as you enter the market.
			<p>"Do you have it?" he asks eagerly.</p>
			<<if getvar("$haveporn") == 1>>
				<<set $porndeal = 2>> 
				<<set $ricewine = 1>>
				<p>"Do you have the wine?" you counter.</p>
				He pulls the bottle out of his backpack, and you trade items.
				<<act 'Leave'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
			<<else>>
				You tell him you haven''t had time to pick up the magazine yet, but you were working on it.
				<<act 'Leave'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
			<</if>>
		<<elseif getvar("$porndeal") == 1 and getvar("$ricewine") != 1 and $porndealday == $time.daystart and getvar("$lookboy") == 0>>
			<<set $menu_off = 1>>
			<<set $lookboy = 1>>
			<<image "locations/pavlovsk/market/chinese_stall01.jpg">>
			You look around the market for the boy from the Chinese stall, but you can't find him. So you decide to look for him another day.
			<<act 'Leave'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
		<</if>>*/
		<<set _shopDevisions to [
			{label:'View clothing',type:'clothes',subtype:'outfit', baseprice: 750},
		]>>
		<<shop `{vendor:'market',baseprice:300}` _shopDevisions>>
	<<else>>
		The market stalls are empty. The market is only open between 08:00 and 19:00.
		<<actCLA 'Leave the market'>>
			<<set $time.minutes += 3>> <<gt 'pav_market'>>
		<</actCLA>>
	<</if>>

:: pav_market_event_wander_actions[include]
	<<act 'Stop wandering'>>
		<<gt 'pav_train_market'>>
	<</act>>
	<<if $time.hour >= 8 and $time.hour <= 18>>
		<<act 'Wander around the market'>>
			<<gt 'pav_market_events'>>
		<</act>>
	<</if>>

:: pav_market_events[events]
	<h2>Market</h2>
	
	
	<<either 3>>
		<<set $time.minutes += 5>>
		<<image "locations/pavlovsk/market/brodit#.jpg" 1 16>>
		You wander around the market, taking in the sounds and colours, but nothing catches your eye.
		<<gs 'pav_market_event_wander_actions'>>
	<<or 2>>
		<<either>>
			<<image "locations/pavlovsk/market/poproshaika1.jpg">>
			You are strolling through the market when a beggar asks you for some change.
			<<actCLA 'Don`t give money'>>
				<<image "locations/pavlovsk/market/poproshaika2.jpg">>
				You ignore the beggar and pretend not to hear him.
				<<gs 'pav_market_event_wander_actions'>>
			<</actCLA>>
			<<actCLA 'Give some money'>>
				<<set $finances.cash -= rand(3,20)>>
				<<set $pc.mood += 5>>
				<<image "locations/pavlovsk/market/podaet.jpg">>
				You give the beggar a few rubles, which he kindly thanks you for.
				<<gs 'pav_market_event_wander_actions'>>
			<</actCLA>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/dedgitara.jpg">>
			You see an old man playing the guitar. He's trying to avert as much attention as he can to himself.
			<<gs 'pav_market_event_wander_actions'>>
		<<or>>
			<<run $location.set('pav_train_market_books','unlocked',true)>>
			<<if $time.isWinter>>
				<<image "locations/pavlovsk/market/bookw.jpg">>
			<<else>>
				<<image "locations/pavlovsk/market/book.jpg">>
			<</if>>
			<p>You find a stall selling various books.</p>
			<<act 'Take a closer look'>>
				<<gt 'pav_train_market_books'>>
			<</act>>
			<<gs 'pav_market_event_wander_actions'>>
			/*<<if $finances.cash >= 350>>
				<<actCLA 'Buy a fantasy book (350<b>₽</b>)'>>
					<<set $time.minutes += 15>>
					<<set $finances.cash -= 350>>
					<<set $f_book += 1>>
					<<image "pc/items/accessories/books/fantasy#.jpg" 1 9>>
					<p>You bought a fantasy book for 350<b>₽</b>.</p>
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<if $finances.cash >= 350>>
				<<actCLA 'Buy a science fiction book (350<b>₽</b>)'>>
					<<set $time.minutes += 15>>
					<<set $finances.cash -= 350>>
					<<set $f_book += 1>>
					<<image "pc/items/accessories/books/scifi#.jpg" 1 6>>
					<p>You bought a science ficiton book for 350<b>₽</b>.</p>
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>
			<<if $finances.cash >= 350>>
				<<actCLA 'Buy a romance novel (350<b>₽</b>)'>>
					<<set $time.minutes += 15>>
					<<set $finances.cash -= 350>>
					<<set $w_book += 1>>
					<<image "pc/items/accessories/books/romance#.jpg" 1 20>>
					<p>You bought a romance novel for 350 <b>₽</b>.</p>
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
				<</actCLA>>
			<</if>>*/
		/*<<or 0>>
			<<set $pavmarket_porn = 1>>
			<<image "locations/pavlovsk/market/pornmag.jpg">>
			<p>You find a small stall with many shelves, a large variety of porn magazines, and a pack of brand-new porn playing cards. In addition, you can see several sex toys just behind the counter. The salesman watches over his stall with shifty eyes.</p>
			<<act 'Stop wandering'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
			<<if $time.hour >= 8 and $time.hour <= 18>>
				<<act 'Wander around the market'>>
					<<gt 'pav_train_market' 'events'>>
				<</act>>
			<</if>>
			<<if $finances.cash >= 699 and getvar("$card") < 2>>
				<<actCLA 'Buy cards (699 <b>₽</b>)'>>
					<<set $time.minutes += 5>>
					<<set $finances.cash -= 699>>
					<<set $card = 2>>
					<<set $TimesBuyPorno += 1>>
					<<image "locations/pavlovsk/market/pornmag.jpg">>
					You try not to look into the eyes of the porn dealer as you count the money. You quickly grab the cards and shove them in your purse.
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
					<<actCLA 'Buy something else'>>
						<<gt 'pav_train_market' 4>>
					<</actCLA>>
				<</actCLA>>
			<</if>>
			<<if getvar("$porndeal") == 1>>
				<<if $finances.cash >= 400>>
					<<actCLA 'Buy a porn magazine for the Chinese boy (400<b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $finances.cash -= 400>>
						<<set $haveporn = 1>>
						<<image "locations/pavlovsk/market/pornmag.jpg">>
						You try your best not to look into the eyes of the porn dealer as you count the money. You take the magazine and quickly hide it.
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
			<<else>>
				<<actCLA 'Browse the porn magazines'>>
					<<arouse 'erotic' 5 >>
					
					<<image "locations/pavlovsk/market/pornmag.jpg">>
					<<act 'Leave'>>
						<<gt 'pav_train_market' 'start'>>
					<</act>>
					<<actCLA 'Look for something else'>>
						<<gt 'pav_train_market' 4>>
					<</actCLA>>
					<<if getvar("$TimesBuyPorno") == 0>>
						<p>You look over the magazine covers, covered in images of half-naked girls on them. Many of them appear to be near your own age. The porn dealer notices your interest and looks at you expectantly.</p>
						<<actCLA 'Look through a magazine'>>
							<<image "locations/pavlovsk/market/pornmag.jpg">>
							<p>You pick up one of the magazines and flip through the pages. Inside the magazines, you see men with sizeable erect penis engaging in sexual acts with either half-naked or fully naked women. Most of them look close to your own age. You feel yourself getting aroused looking at the images.</p>
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
							<<actCLA 'Look for something else'>>
								<<gt 'pav_train_market' 4>>
							<</actCLA>>
							<<actCLA 'Ask for the price'>>
								<<set $time.minutes += 5>>
								<<image "locations/pavlovsk/market/pornmag.jpg">>
								<p>Blushing profusely down to your roots, you approach the porn dealer and stammeringly ask him the price of the magazines. The porn dealer smiles at you and says, "All magazines are <b>400₽</b> each."</p>
								<<act 'Leave'>>
									<<gt 'pav_train_market' 'start'>>
								<</act>>
								<<actCLA 'Look for something else'>>
									<<gt 'pav_train_market' 4>>
								<</actCLA>>
								<<if $finances.cash >= 400>>
									<<actCLA 'Buy magazine (400 <b>₽</b>)'>>
										<<set $time.minutes += 5>>
										<<set $finances.cash -= 400>>
										<<set $pornMagazine = 40>>
										<<set $TimesBuyPorno += 1>>
										<<image "locations/pavlovsk/market/pornmag.jpg">>
										You try not to look into the porn dealer''s eyes as you hand him the money. You take the magazine and quickly hide it under your shirt.
										<<act 'Leave'>>
											<<gt 'pav_train_market' 'start'>>
										<</act>>
										<<actCLA 'Buy something else'>>
											<<gt 'pav_train_market' 4>>
										<</actCLA>>
									<</actCLA>>
								<</if>>
							<</actCLA>>
						<</actCLA>>
					<<elseif getvar("$TimesBuyPorno") > 0 and getvar("$TimesBuyPorno") < 5>>
						<p>The porn dealer notices you coming over and asks, "Looking to buy a magazine? They're only 400 <b>₽</b> each."</p>
						<<actCLA 'Look through a magazine'>>
							<<image "locations/pavlovsk/market/pornmag.jpg">>
							<p>You pick up one of the magazines and flip through the pages. Inside the magazines, you see men with sizeable erect penis engaging in sexual acts with either half-naked or fully naked women. Most of them look close to your own age. You feel yourself getting aroused looking at the images.</p>
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
							<<actCLA 'Look for something else'>>
								<<gt 'pav_train_market' 4>>
							<</actCLA>>
							<<if $finances.cash >= 400>>
								<<actCLA 'Buy magazine (400 <b>₽</b>)'>>
									<<set $time.minutes += 5>>
									<<set $finances.cash -= 400>>
									<<set $pornMagazine = 40>>
									<<set $TimesBuyPorno += 1>>
									<<image "locations/pavlovsk/market/pornmag.jpg">>
									You try not to look into the porn dealer''s eyes as you hand him the money. You take the magazine and quickly hide it under your shirt.
									<<act 'Leave'>>
										<<gt 'pav_train_market' 'start'>>
									<</act>>
									<<actCLA 'Buy something else'>>
										<<gt 'pav_train_market' 4>>
									<</actCLA>>
								<</actCLA>>
							<</if>>
						<</actCLA>>
					<<elseif getvar("$TimesBuyPorno") >= 5>>
						<p>The porn dealer sees you approaching the stall, "Ah, my best customer! Welcome back!"</p>
						<<actCLA 'Look through a magazine'>>
							<<image "locations/pavlovsk/market/pornmag.jpg">>
							<p>You pick up one of the magazines and flip through the pages. Inside the magazines, you see men with sizeable erect penis engaging in sexual acts with either half-naked or fully naked women. Most of them look close to your own age. You feel yourself getting aroused looking at the images.</p>
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
							<<actCLA 'Look for something else'>>
								<<gt 'pav_train_market' 4>>
							<</actCLA>>
							<<if $finances.cash >= 400>>
								<<actCLA 'Buy magazine (400 <b>₽</b>)'>>
									<<set $time.minutes += 5>>
									<<set $finances.cash -= 400>>
									<<set $pornMagazine = 40>>
									<<set $TimesBuyPorno += 1>>
									<<image "locations/pavlovsk/market/pornmag.jpg">>
									You try not to look into the porn dealer''s eyes as you hand him the money. You take the magazine and quickly hide it under your shirt.
									<<act 'Leave'>>
										<<gt 'pav_train_market' 'start'>>
									<</act>>
									<<actCLA 'Buy something else'>>
										<<gt 'pav_train_market' 4>>
									<</actCLA>>
								<</actCLA>>
							<</if>>
						<</actCLA>>
					<</if>>
				<</actCLA>>
			<</if>>
			<<actCLA 'Ask to see the sex toys'>>
				<<image "locations/pavlovsk/market/sextoys.jpg">>
				<p>He lets you step behind the counter to get a better look. As you do, he says. "Take a look and let me know what you would like." You see several 15cm dildos. Each with a tag, "Only 700<b>₽</b> each." You also see a small selection of vibrators in various colours, mostly pink. "Only 700<b>₽</b> each." To one side, you see many butt plugs, rubber and metal. "Only 700<b>₽</b> each." Near the bottom are several strap-on harnesses without a dildo. "Only 500<b>₽</b> each."</p>
				<<act 'Leave'>>
					<<gt 'pav_train_market' 'start'>>
				<</act>>
				<<actCLA 'Look for something else'>>
					<<gt 'pav_train_market' 4>>
				<</actCLA>>
				<<if $finances.cash >= 700 and getvar("$middildo") == 0>>
					<<actCLA 'Buy a 15cm dildo (700 <b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $middildo = 1>>
						<<set $finances.cash -= 700>>
						<<set $pc.horny += 10>>
						<<set $TimesBuyPorno += 1>>
						<<image "pc/items/sextoys/15cm.jpg">>
						<<if $pc.pcs_inhib < 35>>
							You buy a dildo and hastily hide it while your face blushes with embarrassment.
						<<else>>
							You buy a dildo and calmly hide it.
						<</if>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
				<<if $finances.cash >= 1000 and getvar("$suction_dildo") == 0>>
					<<actCLA 'Buy a 15cm suction dildo (1000 <b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $suction_dildo += 1>>
						<<set $finances.cash -= 1000>>
						<<set $pc.horny += 10>>
						<<set $TimesBuyPorno += 1>>
						<<image "pc/items/sextoys/15cm.jpg">>
						<<if $pc.pcs_inhib < 35>>
							You buy the dildo and hastily hide it while your face blushes with embarrassment.
						<<else>>
							You buy the dildo and calmly hide it.
						<</if>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<<elseif $finances.cash >= 1000 and getvar("$suction_dildo") > 0>>
					<<actCLA 'Buy another 15cm suction dildo (1000<b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $suction_dildo += 1>>
						<<set $finances.cash -= 1000>>
						<<set $pc.horny += 10>>
						<<set $TimesBuyPorno += 1>>
						<<image "pc/items/sextoys/15cm.jpg">>
						<<if $pc.pcs_inhib < 35>>
							You buy the dildo and hastily hide it while your face blushes with embarrassment.
						<<else>>
							You buy the dildo and calmly hide it.
						<</if>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
				<<if $finances.cash >= 700 and getvar("$vibrator") == 0>>
					<<actCLA 'Buy vibrator (700<b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $vibrator = 1>>
						<<set $finances.cash -= 700>>
						<<set $pc.horny += 10>>
						<<set $TimesBuyPorno += 1>>
						<<if $pc.horny >= 50 and $pc.fame('pav_slut') < 150>>
							You buy a vibrator and hastily hide it while your face blushes with embarrassment.
						<<else>>
							You buy a vibrator and calmly hide it.
						<</if>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
				<<if $finances.cash >= 700 and getvar("$analplug") == 0>>
					<<actCLA 'Buy butt plug (700<b>₽</b>)'>>
						<<set $time.minutes += 5>>
						<<set $finances.cash -= 700>>
						<<set $analplug = 1>>
						<!-- !!this needs to be changed from analplug bought to smallbp for the smallone-->
						<<set $pc.horny += 10>>
						<<set $TimesBuyPorno += 1>>
						<<image "pc/items/sextoys/bp_small.jpg">>
						<<if $pc.horny >= 50 and $pc.fame('pav_slut') < 150>>
							You buy a butt plug and hastily hide it while your face blushes with embarrassment.
						<<else>>
							You buy a butt plug and calmly hide it.
						<</if>>
						<<act 'Leave'>>
							<<gt 'pav_train_market' 'start'>>
						<</act>>
						<<actCLA 'Buy something else'>>
							<<gt 'pav_train_market' 4>>
						<</actCLA>>
					<</actCLA>>
				<</if>>
				<<if getvar("$middildo") > 0>>
					<<if $finances.cash >= 500 and getvar("$strapon") == 0>>
						<<actCLA 'Buy strap-on harness (500<b>₽</b>)'>>
							<<set $time.minutes += 5>>
							<<set $strapon = 1>>
							<<set $strapnumber = 2>>
							<<set $finances.cash -= 500>>
							<<set $pc.horny += 10>>
							<<set $TimesBuyPorno += 1>>
							<<image "pc/items/sextoys/harness.jpg">>
							<<if $pc.horny >= 50 and $pc.fame('pav_slut') < 150>>
								<p>You buy a strap-on harness and hastily hide it while your face blushes with embarrassment.</p>
							<<else>>
								<p>You buy a strap-on harness and calmly hide it.</p>
							<</if>>
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
							<<actCLA 'Buy something else'>>
								<<gt 'pav_train_market' 4>>
							<</actCLA>>
						<</actCLA>>
					<</if>>
				<<else>>
					<<if $finances.cash >= 1200 and getvar("$strapon") == 0 and getvar("$middildo") == 0>>
						<<actCLA 'Buy strap-on harness with a 15cm dildo (1200<b>₽</b>)'>>
							<<set $time.minutes += 5>>
							<<set $strapon = 1>>
							<<set $middildo = 1>>
							<<set $strapnumber = 2>>
							<<set $finances.cash -= 1200>>
							<<set $pc.horny += 10>>
							<<set $TimesBuyPorno += 1>>
							<<image "pc/items/sextoys/harness.jpg">>
							<<if $pc.horny >= 50 and $pc.fame('pav_slut') < 150>>
								<p>You buy a strap-on harness and hastily hide it while your face blushes with embarrassment.</p>
							<<else>>
								<p>You buy a strap-on harness and calmly hide it.</p>
							<</if>>
							<<act 'Leave'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
							<<actCLA 'Buy something else'>>
								<<gt 'pav_train_market' 4>>
							<</actCLA>>
						<</actCLA>>
					<</if>>
				<</if>>
			<</actCLA>>*/
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/nenavizublyadcigan.jpg">>
			You meet a Gypsy woman. She offers to tell your fortune.
			<<act 'Decline'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
			<<actCLA 'Accept'>>
				<<set $time.minutes += 5>>
				<<image "locations/pavlovsk/market/gadaet#.jpg" 1 2>>
				You agree, and Gypsy takes your hand before she predicts you will have great happiness and lots of money. Afterwards, she promptly walks away.
				<<either>>
					<<actCLA 'Something`s wrong'>>
						<<set $finances.cash = 0>>
						<<set $pc.mood -= 50>>
						<<image "locations/pavlovsk/market/pusto.jpg">>
						<p>With a sneaking suspicion, you start looking through your stuff. Unfortunately, your wallet is nowhere to be found!</p>
						<<actCLA 'Find the Gypsy'>>
							<<image "locations/pavlovsk/market/okliknut.jpg">>
							You search the area hoping to find the thief, but she has already disappeared into the crowd.
							<<act 'Back'>>
								<<gt 'pav_train_market' 'start'>>
							<</act>>
						<</actCLA>>
					<</actCLA>>
				<<or 2>>
					<<set $pc.mood += 5>>
					<<gs 'pav_market_event_wander_actions'>>
				<</either>>
			<</actCLA>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/kosmetic.jpg">>
			<<set $tovpay = 800>>
			<p>You see some cosmetics on sale for <<money 800>>. That's a real bargain.</p>
			<<gs 'pav_market_event_wander_actions'>>
			<<shopItemList>>
				<<stockItem `{id:'cosmetics',amount:50,price:800,label:'Cosmetics'}`>>
			<</shopItemList>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/vitaminki.jpg">>
			<p>You see some vitamins on sale for <<money 105>>. That's a real bargain.</p>
			<<gs 'pav_market_event_wander_actions'>>
			<<shopItemList>>
				<<stockItem `{id:'vitamin',amount:30,price:105}`>>
			<</shopItemList>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/condoms.jpg">>
			<<set $tovpay = 80>>
			<p>You see a booth selling condoms for <<money 80>>. They look a little old, but the man selling them assures you that they still work perfectly.</p>
			<<gs 'pav_market_event_wander_actions'>>
			<<shopItemList>>
				<<stockItem `{id:'condom',amount:5,price:80}`>>
			<</shopItemList>>
			/*<<if $finances.cash >= $tovpay>>
				<<actCLA 'Buy condoms (80<b>₽</b>)'>>
					<<set $time.minutes += 15>>
					<<run $inventory.inc('condom',5)>>
					<<set $i = 5>>
					<<warn 'JUMP MARKER ENCOUNTERED: :cndmlp'>>
					<<if rand(0,49) - 6 * (8 - $tovpay / 10) <= 0>>
						<<setn $badprezik += 1>>

					<</if>>
					<<if getvar("$i") > 0>>
						<<setn $i -= 1>> 

					<</if>>
					<<set $i to null>>
					<<set $finances.cash -= $tovpay>>
					<<gt 'pav_train_market' 'start'>>
				<</actCLA>>
			<</if>>*/
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/balzam.jpg">>
			<p>There is lip balm on sale for <<money 100>>.</p>
			<<gs 'pav_market_event_wander_actions'>>
			<<shopItemList>>
				<<stockItem `{id:'lipbalm',amount:30,price:100,label:'Lip balm'}`>>
			<</shopItemList>>
		/*<<or 0>>
			<<set $menu_off = 1>>
			<<set $time.minutes += 5>>
			<<image "characters/pavlovsk/resident/arthur/artur.jpg">>
			<<if getvar("$arturKnow") == 0>>
				<p>Someone suddenly calls out, "Hey, pretty girl, do you want a fresh, juicy tangerine?"</p>
				<<act 'Look'>>
					<<gt 'arturRinok' 'start'>>
				<</act>>
			<<else>>
				<p>Someone suddenly calls out, "Hey, $pc.name_nick, do you want a fresh, juicy tangerine?"</p>
				<<act 'Go and see Arthur'>>
					<<gt 'arturRinok' 'start'>>
				<</act>>
			<</if>>*/
		/*<<or 0>>
			<<set $menu_off = 1>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/cheburek.jpg">>
			Walking through the market, you come across an old woman selling pies.
			<<act 'Stop wandering'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
			<<if $time.hour >= 8 and $time.hour <= 18>>
				<<act 'Wander around the market'>>
					<<gt 'pav_train_market' 'events'>>
				<</act>>
			<</if>>
			<<if $pc.pcs_energy <= 80>>
				<<actCLA 'Buy a pie for 20 <b>₽</b>'>>
					<<set $pc.fat += 3>>
					<<set $pc.frost = 0>>
					<<set $pc.pcs_health += 5>>
					<<set $pc.mood += 5>>
					<<set $pc.pcs_hydra -= 5>>
					<<set $pc.pcs_energy += 5>>
					<<set $finances.cash -= 20>>
					<<set $time.minutes += 10>>
					<<image "locations/pavlovsk/market/eat.jpg">>
					The pie is still warm as the woman hands it over to you. Then, barely able to keep yourself away from it, you find a place to sit and enjoy the pie.
					<<act 'Continue walking through the market'>>
						<<gt 'pav_train_market' 'events'>>
					<</act>>
				<</actCLA>>
			<<else>>
				* p ' , But you are not hungry right now.'
			<</if>>*/
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/dropwallet.webp">>
			You see a wallet fall out of a woman's purse.
			<<actCLA 'Tell her'>>
				<<set $pc.mood += 5>>
				<<set $time.minutes += 2>>
				<<image "locations/pavlovsk/market/vernutwallet.jpg">>
				You call the woman and hold out her wallet. She looks at you and, realising, gratefully takes her wallet back and walks away.
				<<gs 'pav_market_event_wander_actions'>>
			<</actCLA>>
			<<actCLA 'Look through the purse'>>
				<<set $time.minutes += 5>>
				<<set _moneyLost = rand(40,200)>>
				<<image "locations/pavlovsk/market/zaglanut.jpg">>
				<p>You open the wallet and you see that there's <<money _moneyLost>></p>
				<<actCLA 'Take the money and throw away the wallet' undefined `{willpower:['misc','self','easy']}`>>
					<<image "locations/pavlovsk/market/zaglanut.jpg">>
					<<set $finances.cash += _moneyLost>>
					Her loss is your gain. While not feeling to proud of yourself, you keep the money for yourself.
					<<gs 'pav_market_event_wander_actions'>>
				<</actCLA>>
				
				<<actCLA 'Catch up with the woman and return her purse'>>
					<<set $pc.mood += 5>>
					<<image "locations/pavlovsk/market/proverka.jpg">>
					You catch up with the woman, and telling her she dropped something, you hand her the purse.
					<<either>>
						The woman checks that her money is still there, and seeing everything in place, she thanks you and walks away.
					<<or 2>>
						<<set _moneyGot = Math.ceil(_moneyLost * rand(10,30) / 100)>>
						She thanks you and hands you <<money _moneyGot>> to reward you for your honesty.
						<<set $finances.cash += _moneyGot>>
					<</either>>
					<<gs 'pav_market_event_wander_actions'>>
				<</actCLA>>
			<</actCLA>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/rebenok.jpg">>
			You see a young mother and her crying baby.
			<<gs 'pav_market_event_wander_actions'>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/rezba.jpg">>
			You find a stall with beautiful things carved out of wood and metal.
			<<gs 'pav_market_event_wander_actions'>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/gruzchik.jpg">>
			Looking around, you almost collide with a man pulling a small cart.
			<<gs 'pav_market_event_wander_actions'>>
		<<or>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/meatlavka.jpg">>
			You wander past the meat seller and see a butcher working with an axe.
			<<gs 'pav_market_event_wander_actions'>>
		/*<<or 0>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/dirka.jpg">>
			As you walk past a stall, you notice a small hole torn in the canvas.
			<<gs 'pav_market_event_wander_actions'>>
			<<actCLA 'Look through the hole' undefined `{willpower:['voyeur','self','easy']}`>>
				<<arouse 'voyeur' 2 >>
				
				<<image "locations/pavlovsk/market/pereodev#.jpg" 1 15>>
				<<gs 'pav_market_event_wander_actions'>>
			<</actCLA>>*/
		/*<<or 0>>
			<<set $time.minutes += 5>>
			<<image "locations/pavlovsk/market/birthcontrolpills.jpg">>
			<<set $tovpay = 1500>>
			<p>You see a booth selling birth control pills for tovpay <b>₽</b>.</p>
			<<act 'Stop wandering'>>
				<<gt 'pav_train_market' 'start'>>
			<</act>>
			<<if $time.hour >= 8 and $time.hour <= 18>>
				<<act 'Wander around the market'>>
					<<gt 'pav_train_market' 'events'>>
				<</act>>
			<</if>>
			<<if $finances.cash >= $tovpay and getvar("$therapistFuckedPussyStage") < 2>>
				<<actCLA 'Buy birth control pills (1500 <b>₽</b>)'>>
					<<set $time.minutes += 15>>
					<<set $tabletki += 1>>
					<<set $temp = rand(0,3)>>
					<<if getvar("$temp") == 0>>
						<<set $tabletkiold += 1>> 
					<<elseif getvar("$temp") == 1>>
						<<set $tabletkifert += 1>> 
					<<elseif getvar("$temp") == 2>>
						<<set $tabletkirej += 1>> 
					<<else>>
						<!-- !Pills were tampered with-->
						<<if rand(0,1) == 1>>
							<<set $tabletkifake += 1>> 
						<<else>>
							<<set $tabletkisug += 1>> 
						<</if>>
					<</if>>
					<<set $finances.cash -= $tovpay>>
					<<gt 'pav_train_market' 'start'>>
				<</actCLA>>
			<</if>>*/
		<</either>>
<</either>>

:: pav_train_market_books[private outdoors]
	<<run $location.set('pav_train_market_books','unlocked',true)>>
	
	<<ConnectedLocation 'Leave' 'pav_train_market' '' 'locations/pavlovsk/market/grinok.jpg' 5>>
	<<gs 'pav_market_event_wander_actions'>>

	<h2>Books</h2>
	
	<<if $time.isWinter>>
		<<image "locations/pavlovsk/market/bookw.jpg">>
	<<else>>
		<<image "locations/pavlovsk/market/book.jpg">>
	<</if>>
	<p>You find a stall selling various books. There are fantasy, science fiction and romance novels, all of which cost only 350<b>₽</b> each.</p>

	<<set _lastBookGeneration = $location.get('pav_train_market_books','generatedDay',-1)>>
	<<if _lastBookGeneration < $time.daystart>>
		<<run $inventory.empty('pav_train_market_books')>>
		<<run $location.set('pav_train_market_books','generatedDay',$time.daystart)>>
		<<for _i=0;_i<3;_i+=1>>
			<<set _genre = ['love','scifi','fantasy','biography'].random()>>
			<<set _book = setup.generateBook(_genre)>>
			<<run $inventory.set(_book.id,1,'pav_train_market_books',_book)>>
		<</for>>
	<</if>>

	<<set _availableBooks = $inventory.itemsInContainerByMetadata({type:'book'},'pav_train_market_books',false)>>

	<<if jQuery.isEmptyObject(_availableBooks)>>
		<p>
			You already own a copy of every book that is available. Maybe there are new books available at another day.
		</p>
	<<else>>
		<p>You could buy the following books:</p>
		<div class="bookList">
		<<for _bookId, _bookData range _availableBooks>>
			<<set _pagesRemaining = _bookData.pages - _bookData.pagesRead>>
			<<set _actLabel = 'Buy '+_bookData.title>>
			<<act _actLabel undefined `{capture:['_bookId'],cost:{cash:350}}`>>
				<<run $inventory.moveToContainer(_bookId,'pav_train_market_books','default')>>
				<<addtime 3>>
				<<refresh>>
			<</act>>
			<<gs 'bookImage' _bookData>>
		<</for>>
		</div>
	<</if>>
