# city_market
!2021/04/29
$location_type = 'public_outdoors'
if $ARGS[0] = 'start' or $loc_arg = 'start':
	killvar 'clothingfilter'
	CLOSE ALL
	if sound = 0:
		if month >=11 and month <= 12 or month >=1 and month <=3:
			if hour >= 8 and hour <= 23: PLAY 'sound/rynok.mp3',30 & PLAY 'sound/zima.mp3',30
			if hour >= 0 and hour <= 7: PLAY 'sound/street_night.mp3',30 & PLAY 'sound/zima.mp3',30
		else
			if hour >= 8 and hour <= 23: PLAY 'sound/rynok.mp3',30 & PLAY 'sound/street_leto.mp3',30
			if hour >= 0 and hour <= 7:PLAY 'sound/street_night.mp3',30
		end
	end
	!if sound = 0:PLAY 'sound/street.mp3',30

	cls
	gs 'stat'
	minut += 5
	$loc_arg = 'start'
	$loc = 'city_market'
	$menu_loc = 'city_market'
	$menu_arg = 'start'
	gs 'stat'
	gs 'themes', 'outdoors'
	'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>.'
	
	if analplugIN = 1 and $pantyworntype = 'none' and PCloSkirt > 2:
		nurand = rand(0, 100)

		if nurand >= 80:
			pcs_mood -= 5
			'You feel a hand gently pawing at <a href="exec:gt ''etoexhib'', ''pos15''">your ass</a>.'

			gs 'arousal', 'foreplay', 3
			gs 'stat'
		end
	end

	act 'Leave':
		cla
		minut += 5
		$loc_arg = ''
		gs 'arousal', 'end'
		gs 'stat'
		gt 'city_residential'
	end

	act 'Browse wares': gt 'city_market', 'wares'

	if workrin = 1:
		if week = 2 or week = 4 or week = 6:
			if hour < 9:
				'Arthur is waiting to set up a stall for you.'
				act '<b>Set up stall</b>':
					cla
					*clr
					hour = 9
					minut = 0
					prodpayum = 1200
					'Arthur unloads boxes from his truck and gives them to you. You start hanging the clothes inside around the stall.'
					'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>."'

					act 'Start working':gt 'city_marketwork', 'start'
				end
			end
		end
		act 'Quit':
			cla
			work = 0
			workrin = 0
			'You quit your job at the market and collect your papers.'

			act 'Leave':gt 'city_market', 'start'
		end
	end

	if (work = 0 or cheatWork = 1) and workrin = 0:
		nl
		'A messily written ad hangs from one of the stalls. "Need female market stall staff. Paychecks big."'

		act 'Approach the owner of the ad':
			cla
			*clr
			'Hi, my name is Arthur. I own many stalls here and I need a saleswoman. Want the job?'
			'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 'Take the job':
				cla
				work = 1
				workrin = 1
				arturplan = 5000
				'You give your papers to Arthur and he shakes your hand, welcoming you aboard.'

				act 'Leave':gt 'city_market', 'start'
			end
		end
	end

	act 'Go to the book tray':
		cls
		minut += 15
		gs'stat'

		'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.'

		if money >= 350:
			act 'Buy the fantasy book':
				cls
				minut += 15
				money -= 350
				f_book += 1
				gs'stat'

				'You buy the fantasy book for 350 <b>₽</b>.'

				act 'Leave':gt'city_market','start'
			end
		end

		if money >= 350:
			act 'Buy the science fiction book':
				cls
				minut += 15
				money -= 350
				f_book += 1
				gs'stat'

				'You buy the science fiction book 350 <b>₽</b>.'

				act 'Leave':gt'city_market','start'
			end
		end

		if money >= 350:
			act 'Buy a romance novel':
				cls
				minut += 15
				money -= 350
				w_book += 1
				gs'stat'

				'You buy a romance novel for 350 <b>₽</b>.'

				act 'Leave':gt'city_market','start'
			end
		end

		act 'Leave':gt'city_market','start'
	end

	act 'View clothing':
		cla
		minut += 5
		gt 'city_market', 'clo'
	end
end

if $ARGS[0] = 'clo':
	$loc_arg = 'clo'
	$loc = 'city_market'
	cls
	gs'stat'
	gs 'themes', 'indoors'
	'<center><b><font color="maroon">Clothes.</font></b></center>'
	'You inspect the cheap clothing the stall has to offer.'

	gs 'clothing_QV', 'shop_filter_header'
	gs 'clothing', 'totals', 'market_outfits'

	act 'Return':
		cla
		minut += 5
		gt 'city_market', 'start'
	end

	!!To filter just this set
	clo_i = 0
	:loopmarket_outfits_filter

	i = 1
	:loopmarket_outfits
		if market_outfits[i] = 0:
			gs 'clothing_attributes', 'market_outfits', i
			gs 'clothing_QV', 'shop_filter'

			!!sort by filter
			if (clothingfilter['quality'] = 0 and CloQuality = clo_i) or (clothingfilter['inhibition'] = 0 and CloInhibit = clo_i) or clothingfilter['number'] = 0:
				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>'
			end
		end
	i += 1
	if i <= total:jump 'loopmarket_outfits'

	clo_i += 1
	if clothingfilter['quality'] = 0 and clo_i <= 7:
		jump 'loopmarket_outfits_filter'
	elseif clothingfilter['inhibition'] = 0 and clo_i <= 50:
		jump 'loopmarket_outfits_filter'
	end
end

if $ARGS[0] = 'marketclo':
	cla

	if market_outfits[i] ! 0:
		msg 'You already own these clothes.'
		gt 'city_market', 'clo'
	end

	gt 'clothing', 'view_clothing_item', 'market_outfits',i, 750, 'shop'

end

if $ARGS[0] = 'wares':
	*clr & cla
	$loc_s = 'city_market'
	$args_s = 'wares'

	gs 'item_cart', 'shoppping_aisle', 'market'
	gs 'stat'
	gs 'themes', 'outdoors'

	$backimage= 'images/locations/city/residential/market/rinok.jpg'

	act 'Stop looking at the wares': gt 'city_market', 'start'
end

if $ARGS[0] = 'tailor':
	CLOSE ALL
	cls
	$loc = 'city_market'
	$loc_arg = 'tailor'
	$menu_loc = 'city_market'
	$menu_arg = 'tailor'
	menu_off = 0
	gs 'stat'
	'A sign reads, "Jacob Solomonovich Schneersohn, tailor, 8:00-16:00 Monday - Friday"'
	act 'Speak to the tailor':
		cla
		*clr
		'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 portnoyQW > 0:
			'"So <<$pcs_nickname>>. Do you need any clothing adjusted?"'

			if money >= 500:
				act 'Resize the clothes you''re wearing (500 <b>₽</b>)':
					*clr & cla
					if CloStyle = 5 or $clothingworntype = 'danilovich_outfits':
						'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..."'
					elseif dyneval('RESULT = <<$clothingworntype>>_b[<<clothingwornnumber>>]') = pcs_hips:
						'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."'
					elseif (dyneval('RESULT = <<$clothingworntype>>_b[<<clothingwornnumber>>]') > pcs_hips + 4) or (dyneval('RESULT = <<$clothingworntype>>_b[<<clothingwornnumber>>]') < pcs_hips - 4):
						'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."'
					else
						minut += 10
						money -= 500
						gs 'stat'
						dynamic '<<$clothingworntype>>_b[<<clothingwornnumber>>] = pcs_hips'
						'You are handed a t-shirt and shorts as you undress and give the clothes to the tailor for adjustment.'
						'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.'
					end

					act 'Continue': gt 'city_market', 'tailor'
				end

				act 'Take in different clothes': gt 'clothing', 'view_clothing_list', 'resize'
				act 'Take in all the clothes': gt 'tailor'
			end
		else
			'"Hello young lady. I am Jacob Solomonovich, but you can call me Yasha. And what is your name?"'

			act 'Tell him your name':
				cla
				portnoyQW = 1
				'"<<$pcs_nickname>>"'
				'"<<$pcs_nickname>>....What a pretty name. Come, sit here on this chair. How can I help you?"'

				act 'Ask him about your clothes':
					cla
					*clr
					minut += 15
					gs 'stat'
					'"Can you tailor my clothes to fit me better?"'
					'"Of course I can! Otherwise, what kind of tailor would I be? Here, let me see what you''re wearing."'
					'He jumps up and nimbly removes the tape from his neck and begins to measure your chest, waist and hips.'
					'"I can adjust any clothing that doesn''t fit you for 500 <b>₽</b> per item."'

					act 'Continue': gt 'city_market', 'tailor'
				end
			end
		end
		act 'Leave': minut += 10 & gt 'city_residential'
	end
end

--- city_market ---------------------------------

