# pavSharedApt

$loc = 'pavSharedApt'

if $ARGS[0] = 'update':
	rentWeekly = 2000

	if rentLeft < 0:rentLeft = 0
		!how much of the unpaid weekly rent is left
	if orgB > 100:orgB = 100

	price_cook = 50
	price_clean = 50
	price_handjob = 50
	price_blowjob = 100
	price_vaginal = 150
	price_anal = 200
	price_special = 250

	! time calculations
	weekNum = (daystart - (daystart mod 7)) / 7

	! pcs setup
	$pcs_font = '990099'
		!pink

	! servitudeLvl = 0 - no service, pays rent
	! servitudeLvl = 1 - nonsexual service
	! servitudeLvl = 2 - sexual and nonsexual service

	! nerd guy
	! shy, polite, but latent kink (giving golden shower, etc.)
	! brown hair, hairy, pale skin
	! average dick, hairy balls
	! not paying attention to his own image and looks, wears glasses
	$nd_name = 'Oleg'
	$nd_font = '000099'
		!blue
	nd_leaves = 9
	nd_comes = 18
	nd_sleeps = 23
	nd_wakes = 8
	if nd_rel > 100: nd_rel = 100
	if nd_rel < 0: nd_rel = 0
	ndDick = 17
	nd_cumMax = 80
	nd_cumMin = 15
	if nd_cumVol > nd_cumMax:nd_cumVol = nd_cumMax
	if nd_cumVol < nd_cumMin:nd_cumVol = nd_cumMin
	nd_horny = (nd_cumVol * 10000 / nd_cumMax) / 100

	if nd_served = 1:nd_hadSex = 1
		!flag if there was already a sex between him and Sveta
		!sex flags: nd_bj ; nd_bjDeep ; nd_swall ; nd_vag ; nd_vagCumInside ; nd_vagCumInsideUnwanted ; nd_anal ; nd_analCumInside ; nd_analCumInsideUnwanted
		!unlocked sex: nd_doAnal ; nd_doPornpos
		!nd_cleaned = 1 - if was cleaned this day already

	! gopnik guy
	! rude, the younger the better, aggresive, hard
	! dark hair, dark skin
	! above average dick, somehow maintained hairs; event: he will take some enlarging pills testing his monster cock on Sveta
	$gp_name = 'Nestor'
	$gp_font = 'CC0000'
		!red
	gp_leaves = 11
	gp_comes = 19
	gp_sleeps = 23
	gp_wakes = 9
	if gp_rel > 100: gp_rel = 100
	if gp_rel < 0: gp_rel = 0
	gpDick = 22
	gp_cumMax = 100
	gp_cumMin = 30
	if gp_cumVol > gp_cumMax:gp_cumVol = gp_cumMax
	if gp_cumVol < gp_cumMin:gp_cumVol = gp_cumMin
	gp_horny = (gp_cumVol * 10000 / gp_cumMax) / 100
	if gp_served = 1:gp_hadSex = 1
		!flag if there was already a sex between him and Sveta
		!gp_bj ; gp_bjDeep ; gp_swall ; gp_vag ; gp_vagCumInside ; gp_vagCumInsideUnwanted ; gp_anal ; gp_analCumInside ; gp_analCumInsideUnwanted
		!unlocked sex: gp_doAnal ; gp_doPornpos ; gp_doVacuum

	! sportsman guy
	! blond hair, tanned
	! latent gay, muscular and athletic, secret fantasies of being used by femboy (or at least a girl with strapon)
	! bellow average dick, shaved
	$sp_name = 'Yakov'
	$sp_font = '009900'
		!green
	sp_leaves = 7
	sp_comes = 16
	sp_sleeps = 22
	sp_wakes = 5
	if sp_rel > 100: sp_rel = 100
	if sp_rel < 0: sp_rel = 0
	spDick = 14
	sp_cumMax = 60
	sp_cumMin = 10
	sp_horny = (sp_cumVol * 10000 / sp_cumMax) / 100
	if sp_cumVol > sp_cumMax:sp_cumVol = sp_cumMax
	if sp_cumVol < sp_cumMin:sp_cumVol = sp_cumMin
	if sp_served = 1:sp_hadSex = 1
		!flag if there was already a sex between him and Sveta
		!sp_bj ; sp_bjDeep ; sp_swall ; sp_vag ; sp_vagCumInside ; sp_vagCumInsideUnwanted ; sp_anal ; sp_analCumInside ; sp_analCumInsideUnwanted

	!mood setup
	if nd_mood = 1:$nd_mood = 'very good'
	if nd_mood = 2:$nd_mood = 'good'
	if nd_mood = 3:$nd_mood = 'normal'
	if nd_mood = 4:$nd_mood = 'bad'
	if nd_mood = 5:$nd_mood = 'very bad'

	if gp_mood = 1:$gp_mood = 'very good'
	if gp_mood = 2:$gp_mood = 'good'
	if gp_mood = 3:$gp_mood = 'normal'
	if gp_mood = 4:$gp_mood = 'bad'
	if gp_mood = 5:$gp_mood = 'very bad'

	if sp_mood = 1:$sp_mood = 'very good'
	if sp_mood = 2:$sp_mood = 'good'
	if sp_mood = 3:$sp_mood = 'normal'
	if sp_mood = 4:$sp_mood = 'bad'
	if sp_mood = 5:$sp_mood = 'very bad'

	if night_mode = 1:
		fcolor = rgb(255, 255, 255)
		bcolor = rgb(0, 0, 0)
		lcolor = rgb(106, 90, 205)
	else
		fcolor = rgb(0, 0, 0)
		bcolor = rgb(255, 255, 255)
		lcolor = rgb(106, 90, 205)
	end

	gs 'stat'

	if debg = 0:
		'<a href="exec:debg=1">DEBUG</a>'
	elseif debg = 1:
		'<a href="exec:debg=0">DEBUG</a>'
		$nd_name+' relation: '+nd_rel
		!$gp_name+' relation: '+gp_rel
		!$sp_name+' relation: '+sp_rel
		'rentLeft: '+rentLeft
		'weekNum: '+weekNum
		'rentWeekNum: '+rentWeekNum
		'servitudeLvl: '+servitudeLvl
		'servicePaid: '+servicePaid
		'cashPaid: '+cashPaid
		'step: '+step
		'subStep: '+subStep
		'gp_mood: '+gp_mood
		'gp_cumVol: '+gp_cumVol
		'gp_cumVag: '+gp_cumVag
		'gp_cumAnal: '+gp_cumAnal
		'gp_cumSwall: '+gp_cumSwall
		'nd_cumVol: '+nd_cumVol
		'nd_cumMax: '+nd_cumMax
		'nd_horny: '+nd_horny
		'gp_horny: '+gp_horny
		'sp_horny: '+sp_horny
		''
		nd_served = 0
		nd_mood = 2
		gp_served = 0
		gp_mood = 2
		sp_mood = 2
		sp_served = 0
	end
end

! apt house entry hallway
if $ARGS[0] = 'hallway':
	minut += 2
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/aptHallway.jpg"></left>'
	''
	'An old, common russian apartment house, lacking lots of years of repairs and maintenance.'
	'The entry doors are left unlocked and even if they werent, they look like fall apart any moment.'
	if pavSharedAptEnabled = 0:
		'Inside is a board with announcements for the tenants. One of them seems as an <a href="exec:gt ''pavSharedApt'', ''advert''">advert</a>.'
	else
		'Inside is a board with announcements for the tenants. Nothing new there.'
		act 'Go to door number 3': gt 'pavSharedApt', 'doorNo3'
	end
	if seenAd = 1:
		act 'Go to door number 3': gt 'pavSharedApt', 'doorNo3'
	end
	act 'Leave the building':gt 'pavResidential'
end

! accomodation advert
if $ARGS[0] = 'advert':
	minut += 2
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/board.jpg"></left>'
	''
	'Three young people offer a spare room in a shared apartment in this house.'
	'If you are interested, come see us in the apartment No 3.' 
	seenAd = 1
	act 'Continue':gt 'pavSharedApt', 'hallway'
end

! door No 3
if $ARGS[0] = 'doorNo3':
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/aptNo3Door.jpg"></left>'
	''
	'You stand before the entry door to apartment No 3.'
	if pavSharedAptEnabled = 1:
		act 'Go inside':gt 'pavSharedApt', 'start'
	else
		act 'Ring the bell':gt 'pavSharedApt', 'intro'
	end
	act 'Go back':gt 'pavSharedApt', 'hallway'	
end

! apt hall
if $ARGS[0] = 'start':
	$metka = 'start'
	$goBack = $metka
	$metkaM = 'start'
	$locM = 'pavSharedApt'
	gs 'pavSharedApt', 'update'
	if introDone = 0:gt 'pavSharedApt', 'intro'
	minut += 2

	! do this once a day
	if daystart >= tomorrow:
		tomorrow = daystart + 1

		nd_mood = rand (1, 5)
		nd_served = 0
		nd_cleaned = 0
		nd_cumVol += rand(15, 30)

		gp_mood = rand (1, 5)
		gp_served = 0
		gp_cleaned = 0
		gp_cumVol = rand(20, 40)

		sp_mood = rand (1, 5)
		sp_served = 0
		sp_cleaned = 0
		sp_cumVol += rand(5, 20)
	end
	
	! do this every time
	rentLeft = rentWeekly - servicePaid - cashPaid

	'<h3>Hallway</h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/hallway.jpg"></left>'
	'It is week number '+weekNum+'.'
	
	if weekNum < rentWeekNum:
		if rentLeft > 0:
			'You have left '+rentLeft+' RUB of rent to pay for the next week.'
			if servitudeLvl >= 1:
				'You may still pay it in <a href="exec:gt ''pavSharedApt'', ''payCash''">cash</a>, if you want.'
			else
				'Pay it in <a href="exec:gt ''pavSharedApt'', ''payCash''">cash</a>.'
			end
		else
			'You have already paid the whole rent for the next week.'
		end

	elseif weekNum >= rentWeekNum:
		if rentLeft = 0:
			!rent was forepaid, everything OK, proceed to next week
			rentLeft += 2000
			cashPaid = 0
			rentWeekNum = weekNum + 1
		elseif rentLeft > 0:
			!rent was not fully paid
			'You did not pay the whole rent for this week.'
			if money >= rentLeft:
				!not enough cash to pay it manually
				'You still can pay it in <a href="exec:gt ''pavSharedApt'', ''payCash''">cash</a>, otwerwise you''ll be kicked out!'
			else
				!in future add some way to serve your way out
				'You do not have enough money to pay the rest of the rent in cash, even if you wanted to. Guess you''ll have to find a new living place..'
				rentPaid = 0
				pavSharedAptEnabled = 0
			end
		end
	end

	if rentPaid = 1:
		'A large apartment currently serves as a shared living. There are four rooms, one rented by you and three occupied by <a href="exec: gt ''pavShared_nd'', ''ndDick''"><font color=#<<$nd_font>>><<$nd_name>></font></a>, <a href="exec: gt ''pavShared_gp'', ''gpDick''"><font color=#<<$gp_font>>><<$gp_name>></font></a>, <a href="exec: gt ''pavShared_sp'', ''spDick''"><font color=#<<$sp_font>>><<$sp_name>></font></a>.'
		'You stand in the hallway. ' 
		''
		'From the hallway several doors lead to <a href="exec:gt ''pavSharedApt'', ''ndRoom''"><<$nd_name>>''s</a>, <a href="exec:gt ''pavSharedApt'', ''gpRoom''"><<$gp_name>>''s</a> and <a href="exec:gt ''pavSharedApt'', ''spRoom''"><<$sp_name>>''s</a> rooms.'
		'The last doors lead to the <a href="exec:gt ''pavSharedApt'', ''pcsRoom''">room</a> you have rented.'
		''
		'There are several closets for your <a href="exec:gt ''shoes'', ''select''">shoes</a> and a large tall <a href="exec:gt ''mirror'', ''start''">mirror</a>.'
		if servitudeLvl >= 1:'A computer printed <a href="exec:gt ''pavSharedApt'', ''list''">list</a> hangs on the exit door.'
		act '<<$pcs_firstname>>''s room':gt 'pavSharedApt', 'pcsRoom'
		act 'Bathroom':gt 'pavSharedApt', 'bathroom'
		act 'Kitchen':gt 'pavSharedApt', 'kitchen'
	end
	
	if $clothingworntype = 'nude':
		''
		'<b>You cannot leave the apartment naked.</b>'
	else
		act 'Leave':gt 'pavResidential'
	end
end

if $ARGS[0] = 'payCash':
	minut += 2
	cash = rentLeft
	if money >= cash:
		'You have decided to pay the remainder of the weekly rent in cash. It makes '+cash+' RUB.'
		cashPaid += cash
		money -= cash
		rentPaid = 1
		pavSharedAptEnabled = 1
	else
		'You do not have enough money to pay it.'
	end
	act 'Proceed':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'payService':
	minut += 1
	'The amount '+price+' RUB was taken in account of your weekly rent.'
	servicePaid += price
	act 'Continue':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'rentSetup':
	minut += 2
	'You get a list of paper, saying the weekly rent fee is <<rentWeekly>> rubles.'
	rentPaid = 1
	introDone = 1
	rentWeekNum = (daystart - (daystart mod 7)) / 7 + 1
	act 'Continue':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'intro':
	gs 'pavSharedApt', 'update'
	if step > 0:	
		'<left><img border="5" bordercolor="<<$sp_font>>" height="150" src="images/locations/pavlovsk/resident/sharedapt/sp/sp.jpg"> <img height="150" src="images/locations/pavlovsk/resident/sharedapt/gp/gp.jpg"> <img height="150" src="images/locations/pavlovsk/resident/sharedapt/nd/nd.jpg"></left>'
		''
	end

	if step = 0:
		minut += 2
		step = 1
		'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/sp/sp.jpg"></left>'
		''
		'The door are opened by a young, nice looking athletic man.'
		'<font color=#<<$sp_font>>>"Hi sweetie! What do you need?"</font>'
		'<font color=#<<$pcs_font>>>"Hello, my name is <<$pcs_firstname>> <<$pcs_lastname>>. I''ve seen the advert that someone here have a spare room for rent?"</font>'
		'<font color=#<<$sp_font>>>"Yeah, that''s true. Come in, I''ll call the guys and we can talk about it. I''m <<$sp_name>> by the way."</font>'
		act 'Go in':gt 'pavSharedApt', 'intro'
	elseif step = 1:
		minut += 3
		step = 2
		'You go through the door in a hallway. By the amount of coats and shoes you guess there are about 3 or 4 people living here.'
		'The guy disappears in one of the doors and you can hear talking him to someone.'
		'They seem to be trying to talk quietly, but you can hear a sentence or two..:'
		''
		'"..a girl I tell you.." "..nice one, really, with nice round tits man.." "..better than another dick, idiot.." "..ok ok just be done with it.."'
		''
		'In a while three young guys appear in the hallway.'
		'<font color=#<<$sp_font>>>"So that''s her guys. <<$pcs_firstname>>, could you introduce yourself to guys?"</font>'
		'<font color=#<<$pcs_font>>>"Hello, my name is <<$pcs_firstname>> <<$pcs_lastname>>. I would like to rent the empty room in your apartment."</font>'
		'<font color=#<<$gp_font>>>"Well now that''s what I like! Finally this won''t be such a gay party!"</font>'
		'<font color=#<<$nd_font>>>"<<$pcs_firstname>> please excuse my friend <<$gp_name>>, he is such a rude to everyone. My name is <<$nd_name>>."</font>'
		'<font color=#<<$gp_font>>>"Yup, I''m <<$gp_name>>."</font>'
		'<font color=#<<$nd_font>>>"So you would like to live here with us?"</font>'
		'<font color=#<<$pcs_font>>>"Yes. I need a new place to stay."</font>'
		'<font color=#<<$gp_font>>>"How old are you girl?"</font>'
		'<font color=#<<$nd_font>>>"<<$gp_name>>! Not again this!"</font>'
		'<font color=#<<$pcs_font>>>"It''s OK. I have actually <<age>> years. Why do you ask?"</font>'
		'<font color=#<<$nd_font>>>"He''s just idiot, don''t listen to him."</font>'
		if age < 18:
			'(You can see <<$gp_name>> rub his crotch just a brief moment after you told him your age. What''s he up to?)'
		end
		act 'Continue':gt 'pavSharedApt', 'intro'
	elseif step = 2:
		minut += 3
		step = 3
		'<font color=#<<$pcs_font>>>"So what do you guys say, will you take me in?"</font>'
		'<font color=#<<$nd_font>>>"We may. But first, do you have the money to pay the rent?"</font>'
		'<font color=#<<$pcs_font>>>"Well, of course I don''t expect to let me live here for free. But I hope the rent is reasonable.."</font>'
		'<font color=#<<$nd_font>>>"It is indeed."</font>'
		'<font color=#<<$sp_font>>>"<<rentWeekly>> rubles. Per week."</font>'
		'<font color=#<<$pcs_font>>>"Uhm. That''s quite a lot. I''m not sure if I''ll be able to afford this.."</font>'
		'<font color=#<<$gp_font>>>"You can pay other ways if you''d like!"</font>'
		'<font color=#<<$nd_font>>>"<<$gp_name>>!"</font>'
		'<font color=#<<$pcs_font>>>"What do you mean by other ways?"</font>'
		'<font color=#<<$sp_font>>>"Well <<$pcs_firstname>>, since we are just guys here, and since we suck at these things, we could use someone as you, a girl I mean, to be something like our, let''s say, handmaiden. If you know what I mean."</font>'
		'<font color=#<<$pcs_font>>>"Like cooking and cleaning?"</font>'
		'<font color=#<<$sp_font>>>"Yes, exactly."</font>'
		'<font color=#<<$gp_font>>>"And more."</font>'
		'<font color=#<<$nd_font>>>"Oh my... I give up."</font>'
		act 'More what?':gt 'pavSharedApt', 'intro'
	elseif step = 3:
		minut += 3
		'<font color=#<<$gp_font>>>"More services."</font>'
		'<font color=#<<$pcs_font>>>"What kind of ''more services''?"</font>'
		'<font color=#<<$sp_font>>>"Girl to guys kind of services."</font>'
		'<font color=#<<$pcs_font>>>"You mean to be a whore for you? Instead of paying the rent???"</font>'
		'<font color=#<<$nd_font>>>"Please <<$pcs_firstname>>, don''t get mad. <<$gp_name>> is not just idiot, he is a rude idiot. We are definitely not asking you to be our whore or something like that."</font>'
		'<font color=#<<$nd_font>>>"As <<$sp_name>> told you, we could decrease your rent if you would do some homekeeping stuff we really suck at. But only if you want, of course."</font>'
		'<font color=#<<$sp_font>>>"So what do you say <<$pcs_firstname>>?"</font>'
		act 'Say you will pay the rent the normal way':pavSharedAptEnabled = 1 & step = 10 & gt 'pavSharedApt', 'intro'
		act 'Say you don''t mind doing the homekeeping stuff':pavSharedAptEnabled = 1 & step = 20 & gt 'pavSharedApt', 'intro'
		act 'Say you don''t mind anything':pavSharedAptEnabled = 1 & step = 30 & gt 'pavSharedApt', 'intro'
		act 'Say that you changed your mind about this':step = 40 & gt 'pavSharedApt', 'intro'
	elseif step = 10:
		minut += 2
		'<font color=#<<$sp_font>>>"Fine. So the rest of this week you have for free, but you need to prepay the next week. OK?"</font>'
		'<font color=#<<$pcs_font>>>"Yes, OK, I understand."</font>'
		'<font color=#<<$sp_font>>>"So the room is over there. There is all you need, a bed, a table with chair, all this stuff. Just move in when you want. See you later <<$pcs_firstname>>!"</font>'
		'<font color=#<<$nd_font>>>"Have a nice day <<$pcs_firstname>>."</font>'
		'<font color=#<<$gp_font>>>"See ya later girlie..."</font>'
		'<font color=#<<$pcs_font>>>"Later guys!"</font>'
		servitudeLvl = 0
		act 'Continue':step = 0 & gt 'pavSharedApt', 'rentSetup'
	elseif step = 20:
		minut += 2
		'<font color=#<<$sp_font>>>"Fine. So the rest of this week you have for free, but you need to prepay the next week. OK?"</font>'
		'<font color=#<<$pcs_font>>>"Yes, OK, I understand."</font>'
		'<font color=#<<$nd_font>>>"We will pepare a list of the charges for the homekeeping services you may want to do, so it''s clear how much will be deducted form your rent."</font>'
		'<font color=#<<$pcs_font>>>"Cool!"</font>'
		'<font color=#<<$sp_font>>>"So the room is over there. There is all you need, a bed, a table with chair, all this stuff. Just move in when you want. See you later <<$pcs_firstname>>!"</font>'
		'<font color=#<<$nd_font>>>"Have a nice day <<$pcs_firstname>>."</font>'
		'<font color=#<<$gp_font>>>"See ya later girlie..."</font>'
		'<font color=#<<$pcs_font>>>"Later guys!"</font>'
		servitudeLvl = 1
		act 'Continue':step = 0 & gt 'pavSharedApt', 'rentSetup'
	elseif step = 30:
		minut += 2
		'<font color=#<<$sp_font>>>"Fine. So the rest of this week you have for free, but you need to prepay the next week. OK?"</font>'
		'<font color=#<<$pcs_font>>>"Yes, OK, I understand."</font>'
		'<font color=#<<$nd_font>>>"We will pepare a list of the charges for the homekeeping services you may want to do, so it''s clear how much will be deducted form your rent."</font>'
		'<font color=#<<$gp_font>>>"The extra stuff services will be there too, girl."</font>'
		'<font color=#<<$pcs_font>>>"OK.."</font>'
		'<font color=#<<$sp_font>>>"So the room is over there. There is all you need, a bed, a table with chair, all this stuff. Just move in when you want. See you later <<$pcs_firstname>>!"</font>'
		'<font color=#<<$nd_font>>>"Have a nice day <<$pcs_firstname>>."</font>'
		'<font color=#<<$gp_font>>>"See ya later girlie..."</font>'
		'<font color=#<<$pcs_font>>>"Later guys!"</font>'
		servitudeLvl = 2
		act 'Continue':step = 0 & gt 'pavSharedApt', 'rentSetup'
	elseif step = 40:
		minut += 2
		'<font color=#<<$nd_font>>>"I told you idiot not to scare her away!"</font>'
		'<font color=#<<$gp_font>>>"Sorry man! We can still lock her to the radiator like I suggested in the first place.."</font>'
		'<font color=#<<$nd_font>>>"Just shut up already!"</font>'
		''
		'<font color=#<<$sp_font>>>"Sorry <<$pcs_firstname>>. We respect your decision. If you change your mind and room is still empty, let us know and we can talk again. Goodbye!"</font>'
		act 'Tell them goodbye and leave':step = 0 & gt 'pavResidential'
	end
end

! the pricelist
if $ARGS[0] = 'list':
	$metka = 'list'
	minut += 2
	$goBack = $metka
	'<h3><<$pcs_firstname>>''s pricelist</h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/list.jpg"></left>'
	''
	'The basic weekly rent is <<rentWeekly>> rubles.'
	'It is possible to pay it in cash, or offer services instead. The prices are folllowing:'
	''
	'---------------'
	''
	'Cooking a warm meal: '+price_cook
	'Cleaning the apartment: '+price_clean
	if servitudeLvl >= 2:
		''
		'Handjob: '+price_handjob
		'Blowjob: '+price_blowjob
		'Sex: '+price_vaginal
		'Anal sex: '+price_anal
		'Special treats: '+price_special
	end
	''
	'---------------'
	''
	'Not having paid the full weekly rent at the beginning of a new week will lead to termination of the accommodation services.'
	'Signed: <a href="exec: gt ''pavShared_nd'', ''ndDick''"><font color=#<<$nd_font>>><<$nd_name>></font></a>, <a href="exec: gt ''pavShared_gp'', ''gpDick''"><font color=#<<$gp_font>>><<$gp_name>></font></a>, <a href="exec: gt ''pavShared_sp'', ''spDick''"><font color=#<<$sp_font>>><<$sp_name>></font></a>, <<$pcs_firstname>>.'
	''
	'---------------'
	act 'Continue':gt 'pavSharedApt', 'start'
end

! paying with money
if $ARGS[0] = 'payRent':
	minut += 1
	'You decided to give the guys money, instead of serving them.'
	'You just spent <<paid_rent>> cash.'
	money -= paid_rent
	gs 'stat'
	act 'Continue': gs 'pavSharedApt', 'start'
end

if $ARGS[0] = 'bathroom':
	minut += 1
	$location_type = 'bathroom'
	$metka = 'bathroom'

	'<h3>Bathroom</h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/vanrpar.jpg"></left>'
	'Modest bathroom, containing all that young people need for their daily life.'

	gs 'din_van', 'private'
	act 'Leave':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'kitchen':
	minut += 2
	$metka = 'kitchen'
	gs 'kit_din'
	'<h3>Kitchen</h3>'
	'<left><img <<$set_imgh>> src="images/locations/oldtown/apartment/kuhr2x.jpg"></left>'
	'It is a modest kitchen but has all that is needed.'

	! dishes
	if cltarelka > 0:
		'Above the sink are <b><<cltarelka>></b> the clean plates'
	else
		'<b><font color = red>You have no clean dishes left.</font></b>'
	end
	if dirttarelka > 0:'The sink has <b><<dirttarelka>></b> pieces of dirty dishes. <a href="exec: dynamic $dirtarm">That can be washed and</a>.'
	if fairy > 0:
		'above the sink is a detergent to wash the dishes with, there is enough for <b><<fairy>></b> time.'
	else
		'<b><font color = red>you do not have any detergent to wash the dishes, You need to buy detergent.</font></b>'
	end

	! food
	if eda > 0:
		if cltarelka = 0 or edahot > 0:$edagot = ''
		if cltarelka > 0 and edahot = 0:
			$edagot = '<a href="exec:dynamic $edagotd">Cook meal (0:30) for yourself</a>'
			if eda >= 3:
				'<a href="exec: gt ''pavSharedApt'', ''cookForGuys''">Cook meal (1:30) for the guys</a>'
			end
			'In the refrigerator there''s enough (your own) food for <b><<eda>></b> servings. <<$edagot>>'
		end
	end
	if edahot > 0:'<a href="exec: dynamic $edahotd ">On the table is ready meal.</a>'

	if pranik > 0:
		if pranik = 1:
			'You only have a couple of cookies for a snack.'
		else
			'You have enough cookies for <b><<pranik>></b> more snacks.'
		end
		dynamic $pranik
	end

	dynamic $edaD
	dynamic $fatdel
	dynamic $driwater
	dynamic $lekarstvo
	dynamic $vitamin

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

if $ARGS[0] = 'cookForGuys':
	cla
	*clr
	minut += 90
	eda -= 3
	kuhdrova = 0
	!musor += 1
	cltarelka -= 1
	pcs_mood -= 10
	gs 'stat'
	'<center><img <<$set_imgh>> src="images/shared/home/kitchen/cook.jpg"></center>'
	'You prepare three meals.'
	price = price_cook

	act 'Leave the meal':gt 'pavSharedApt', 'payService'
end

if $ARGS[0] = 'cleanForGuys':
    cla
    *clr
    minut += 60
    suhbelo += dirtbelo
    poroshok -= 3
    dirtbelo = 0
    pcs_mood -= 10
	gs 'stat'
	'<center><img <<$set_imgh>> src="images/locations/city/residential/apartment/stir.jpg"></center>'
	
	price = price_clean 
	*nl
    'You collect piles piles of dirty clothes around the room, carry them into the bathroom, put them in a basin and then pour washing powder on them. You wash them until they are finally clean.'
    cumStainCh =  rand (0, 100)
    if servitudeLvl = 2 and cumStainCh <= 50:'<i>You notice bedsheets with what seems as dried out cum. Probably remainder of one of yours "servings". Maybe it is really better to swallow everytime, you wonder?</i>'

	act 'Hang them to dry out and leave':gt 'pavSharedApt', 'payService'
end

if $ARGS[0] = 'pcsRoom':
	minut += 2
	$metka = 'pcsRoom'
	$location_type = 'private'
	$locclass = 'bedr'
	gs 'pavSharedApt', 'update'

	'<h3><<$pcs_firstname>>''s bedroom</h3>'
	'<center><img <<$set_imgh>> src="images/locations/city/residential/apartment/bedr.jpg"></center>'
	'A tight, little room with a <a href="exec:gt ''bed'', ''start''">double bed</a> and an <a href="exec:gt ''budilnik'', ''start''">alarm clock</a>.' 
	'An old wooden <a href="exec:GT ''wardrobe''">wardrobe</a> (where you can <a href="exec:gt ''clothing'', ''view_clothing_list'', ''wardrobe''">organize your clothes</a>) stands near the door to the corridor, on top of it there''s a <a href="exec:gt ''clothing'', ''view_clothing_list'', ''store''">suitcase</a> you can store some clothes in. The windows are closed with faded, heavy curtains.'
	
	if budilnikOn = 0:
		'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 1 & GT ''pavSharedApt'',''pcsRoom''">off</a>.'
	else
		'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 0 & GT ''pavSharedApt'',''pcsRoom''">on</a>.'
	end

	if pornMagazine > 0:'Under your mattress you hide a porn magazine.'

	if komp = 1:'Your <a href="exec:gorodokKomp = 1 & GT ''Komp'',''start''">laptop</a> is on your desk.'

	if pcs_horny >= 50:
		act 'Masturbate':gt 'selfplay', 'start'
	end

	if tabletki > 0 and prezik + prezikcount + preziksabo > 0:
		'Your <a href="exec:gt ''stol'', ''bc''">birth control</a> is hidden in one of your desk drawers, as are your <a href="exec:gt ''stol'', ''bc''">condoms</a>.'
	elseif tabletki > 0:
		'Your <a href="exec:gt ''stol'', ''bc''">birth control</a> is hidden in one of your desk drawers.'
	elseif prezik + prezikcount + preziksabo > 0:
		'Your <a href="exec:gt ''stol'', ''bc''">condoms</a> are hidden in one of your desk drawers.'
	end

	if student > 0 and kursovik < 100:
		act 'Do coursework (1:00)':
			cla
			*clr
			minut += 60
			kursovik += rand(pcs_intel / 20, pcs_intel / 10)

			if kursovik > 100:kursovik = 100

			pcs_mood -= 10
			'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
			'You sit down at the desk and do your coursework, you''ve finished <<kursovik>> percent of it.'

			act 'Leave your desk':gt 'pavSharedApt', 'start'
		end
	end

	if tovarL > 0:'You currently have <<tovarL>> trinkets to sell at the station. The maximum you can carry with you is 30.'
	
	if vcard > 0:
		act 'Look at your deck of vintage porn cards':card_deck = 0 & gt 'card'
	end
	if card > 0:
		act 'Look at your deck of new porn cards':card_deck = 1 & gt 'card'
	end

	if dur > 0:'You have hidden <<dur>> doses of Pale Lady.'

	if dur > 0 and narkday ! daystart:
		act 'Use some Pale Lady (0:05)':
			cla
			*clr
			minut += 5
			narkday = daystart
			pcs_health = pcs_vital * 10 + pcs_stren * 5
			pcs_willpwr = pcs_intel * 5 + pcs_sprt * 5
			pcs_mood = 100
			pcs_horny = 100
			nark += 10
			dur -= 1
			'<center><img <<$set_imgh>> src="images/shared/drugs/dur.jpg"></center>'
			'You snort some Pale Lady, feeling dizzy for just a moment. After that you feel fantastic, and incredibly horny.'

			act 'Continue':gt 'pavSharedApt', 'start'
		end
	end

	gs 'exercise', 'start'

	if gobelen>0:'You have <<gobelen>> completed tapestries.'
	if pcs_sewng >= 40 and tkan > 0:'You have enough fabric for <<tkan>> lessons.'
	if pcs_sewng >= 40 and tkan <= 0:'You do not have any fabric.'
	if pcs_sewng >= 80:
		if newgobelen = 0 and tkan > 0:
			act'Start a new tapestry':
				cls
				tkan -= 1
				newgobelen = 1
				minut += 15
				gs'stat'
				'You spend 15 minutes at the embroidery frame, preparing the fabric and outlining the pattern for the tapestry.'
				act'Set the tapestry aside':gt 'pavSharedApt', 'start'
			end
		end
		if newgobelen>=1:
			'Your tapestry is <<newgobelen/10>> percent finished.'
			act'Work on the tapestry for an hour':
				cls
				minut+=60
				sewng_exp += rand(pcs_intel/10, pcs_intel/5)
				gobramax = (pcs_sewng - 70) * 6
				gobramin = (pcs_sewng - 70) * 2
				newgobelen += rand(gobramin,gobramax)
				gs'stat'
				if newgobelen < 1000:'You spent an hour working on your tapestry, which is now <<newgobelen/10>> percent finished.'
					if newgobelen >= 1000:
					newgobelen = 0
					gobelen += 1
					'Your work on the tapestry is done.'
				end
				act'Set the tapestry aside':gt 'pavSharedApt', 'start'
			end
		end
	end
	if pcs_sleep <= 80:
		if succubusQW = 2:
			act 'Undress and go to sleep':
				if $clothingworntype ! 'nude': gs 'clothing', 'strip'
				gt 'bed2', 'succhoice'
			end
		else
			act 'Undress and go to sleep':
				if disable_autosave = 0:
					if StoryLine = 0:
						savegame 'autosave.sav'
					else
						savegame 'autosave_alt.sav'
					end
				end
				if $clothingworntype ! 'nude': gs 'clothing', 'strip'
				if magf2bdo = 2:
					gt 'bed2', 'magbstchoice'
				else
					gt 'bed2', 'sleep'
				end
			end
		end
	end

	dynamic $wearpan
	dynamic $removepan
	gs 'events', 'read_porn'
	gs 'subkid'

	act 'Leave your room':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'ndRoom':
	minut += 2
	'<h3><font color=#<<$nd_font>>><<$nd_name>>''s room</font></h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/nd/room.jpg"></left>'
	'The room is surprisingly not as messy as one would expect, given that <<$nd_name>> is an IT guy.'
	'There is one large window with bed bellow it, but the whole room is dominated by a large table with several computers and monitors.'
	'Looking at it one would say that this must be a den of a hacker.'
	if hour >= nd_sleeps and hour < nd_wakes:
		'<<$nd_name>> is sleeping in his bed.'
	elseif hour >= nd_wakes and hour < nd_leaves:
		'<<$nd_name>> is already awake, getting ready to leave.'
		act 'Approach him': gt 'pavShared_nd', 'nd'
	elseif hour >= nd_leaves and hour < nd_comes:
		'<<$nd_name>> is not here.'
	elseif hour >= nd_comes and hour < nd_sleeps:
		'<<$nd_name>> is currently behind his desk, doing some clever IT stuff.'
		act 'Approach him': gt 'pavShared_nd', 'nd'
	end
	if servitudeLvl >= 1 and nd_cleaned = 0:act 'Clean the room':nd_cleaned = 1 & gt 'pavSharedApt', 'cleanForGuys'
	act 'Leave':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'gpRoom':
	minut += 2
	'<h3><font color=#<<$gp_font>>><<$gp_name>>''s room</font></h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/gp/room.jpg"></left>'
	'Messy room. Clothes everywhere.'

	if hour >= gp_wakes and hour < gp_leaves:
		'<<$gp_name>> is already awake, getting ready to leave.'
		act 'Approach him': gt 'pavShared_gp', 'gp'
	elseif hour >= gp_leaves and hour < gp_comes:
		'<<$gp_name>> is not here.'
	elseif hour >= gp_comes and hour < gp_sleeps:
		'<<$gp_name>> is currently on his bed, listing through some magazines.'
		act 'Approach him': gt 'pavShared_gp', 'gp'
	elseif hour >= gp_sleeps or hour < gp_wakes:
		'<<$gp_name>> is sleeping in his bed.'
	end
	if servitudeLvl >= 1 and gp_cleaned = 0:act 'Clean the room':gp_cleaned = 1 & gt 'pavSharedApt', 'cleanForGuys'
	act 'Leave':gt 'pavSharedApt', 'start'
end

if $ARGS[0] = 'spRoom':
	minut += 2
	'<h3><font color=#<<$sp_font>>><<$sp_name>>''s room</font></h3>'
	'<left><img <<$set_imgh>> src="images/locations/pavlovsk/resident/sharedapt/sp/room.jpg"></left>'
	'Tidy room full of sporting stuff like dresses, equipment and trophys. On the walls hang several posters of famous sport guys.'
	
	if hour >= sp_wakes and hour < sp_leaves:
		'<<$sp_name>> is already awake, packing his bags to leave.'
		act 'Approach him': gt 'pavShared_sp', 'sp'
	elseif hour >= sp_leaves and hour < sp_comes:
		'<<$sp_name>> is not here.'
	elseif hour >= sp_comes and hour < sp_sleeps:
		doesStuff = rand (0, 100)
		if doesStuff < 50:'<<$sp_name>> is currently on his bed, listing through sport magazines.'
		if doesStuff >= 50:'<<$sp_name>> is working out on the floor.'
		act 'Approach him': gt 'pavShared_sp', 'sp'
	elseif hour >= sp_sleeps or hour < sp_wakes:
		'<<$sp_name>> is sleeping in his bed.'
	end
	if servitudeLvl >= 1 and sp_cleaned = 0:act 'Clean the room':sp_cleaned = 1 & gt 'pavSharedApt', 'cleanForGuys'
	act 'Leave':gt 'pavSharedApt', 'start'
end

--- pavSharedApt ---------------------------------

