Răsfoiți Sursa

Moved everything to the new homes and property system.

Need some more polishing, and lots of testing, but it is working now properly - I hope.
This is big and testing will take a while.
Netuttki 1 an în urmă
părinte
comite
e77fd7cd50
74 a modificat fișierele cu 771 adăugiri și 666 ștergeri
  1. 1 1
      MakeQSP.bat
  2. 5 5
      locations/Cheatmenu_din.qsrc
  3. 4 4
      locations/FedorEv4.qsrc
  4. 24 24
      locations/Komp.qsrc
  5. 2 2
      locations/MartinTalk.qsrc
  6. 1 1
      locations/Peterroom.qsrc
  7. 144 220
      locations/agentned.qsrc
  8. 37 36
      locations/bank.qsrc
  9. 2 2
      locations/booty_call_after.qsrc
  10. 4 4
      locations/brother.qsrc
  11. 2 2
      locations/carF.qsrc
  12. 1 1
      locations/cikl.qsrc
  13. 2 2
      locations/city_island.qsrc
  14. 16 13
      locations/city_mansion_entrance.qsrc
  15. 1 1
      locations/city_park.qsrc
  16. 4 4
      locations/city_residential.qsrc
  17. 3 3
      locations/city_suburbs.qsrc
  18. 3 3
      locations/dachain.qsrc
  19. 1 0
      locations/dachamy.qsrc
  20. 1 1
      locations/dachi.qsrc
  21. 9 9
      locations/dina.qsrc
  22. 1 1
      locations/dvor.qsrc
  23. 1 1
      locations/food_menu.qsrc
  24. 2 2
      locations/gadbana.qsrc
  25. 8 3
      locations/gadhouse.qsrc
  26. 4 4
      locations/gkafe.qsrc
  27. 2 2
      locations/gschool_grounds.qsrc
  28. 1 1
      locations/gschool_lunch.qsrc
  29. 1 1
      locations/home_activity.qsrc
  30. 196 13
      locations/homes_properties.qsrc
  31. 1 1
      locations/hookup_after.qsrc
  32. 10 10
      locations/housing.qsrc
  33. 1 1
      locations/intro_city_select.qsrc
  34. 3 2
      locations/intro_initialization_city.qsrc
  35. 2 2
      locations/intro_sg_select.qsrc
  36. 1 1
      locations/intro_sg_tg.qsrc
  37. 2 1
      locations/intro_uni.qsrc
  38. 12 11
      locations/journal.qsrc
  39. 1 1
      locations/korrPar.qsrc
  40. 1 1
      locations/liames.qsrc
  41. 1 1
      locations/lug.qsrc
  42. 2 2
      locations/mey_home.qsrc
  43. 2 2
      locations/mey_vika_events.qsrc
  44. 1 1
      locations/mother.qsrc
  45. 63 109
      locations/music_actions.qsrc
  46. 4 4
      locations/music_buskingevents.qsrc
  47. 1 1
      locations/nichBedroomServant.qsrc
  48. 2 2
      locations/nichUtil.qsrc
  49. 55 52
      locations/obj_din.qsrc
  50. 1 1
      locations/parks.qsrc
  51. 2 2
      locations/pav_clinic.qsrc
  52. 1 1
      locations/pav_commercial.qsrc
  53. 5 5
      locations/pav_complex.qsrc
  54. 1 1
      locations/pav_disco_coolkids.qsrc
  55. 2 2
      locations/pav_lake.qsrc
  56. 1 1
      locations/pav_lake_nude.qsrc
  57. 2 2
      locations/pav_park.qsrc
  58. 8 8
      locations/pav_shared_apt.qsrc
  59. 1 1
      locations/pet_dog.qsrc
  60. 3 3
      locations/pod_ezd.qsrc
  61. 2 2
      locations/podezdM.qsrc
  62. 1 1
      locations/pornstudio.qsrc
  63. 1 1
      locations/prostitution_functions.qsrc
  64. 34 9
      locations/shop.qsrc
  65. 32 32
      locations/shopdacha.qsrc
  66. 1 1
      locations/shulgahall.qsrc
  67. 6 6
      locations/stat_display.qsrc
  68. 1 1
      locations/street_event.qsrc
  69. 2 2
      locations/telefon.qsrc
  70. 2 2
      locations/therapist.qsrc
  71. 3 1
      locations/uni_admin.qsrc
  72. 4 3
      locations/uni_dorm.qsrc
  73. 1 1
      locations/unused/pornstudio.qsrc
  74. 6 6
      locations/zoomagazine.qsrc

+ 1 - 1
MakeQSP.bat

@@ -9,7 +9,7 @@ set QSPGUI=tools\Player-video\qspgui.exe
 set QGEN=tools\QGen5\QGen.exe
 
 :: The file that will be generated or open
-set QSPFILE=glife.qsp
+set QSPFILE=glife-internet-home.qsp
 
 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 

+ 5 - 5
locations/Cheatmenu_din.qsrc

@@ -1547,8 +1547,8 @@ $cheatmenu['reputation'] = {
 			'Your sister has a good opinion of you.'
 		end
 		*nl
-		if home_owned[2] = 0:
-			'<a href="exec:home_owned[2] = 1 & dynamic $cheatmenu[''reputation'']">Restore</a> access to your parent''s apartment.'
+		if owned_property['parents_home'] = 0:
+			'<a href="exec: gs ''homes_properties'', ''set_ownership'', ''parents_home'', 2 & dynamic $cheatmenu[''reputation'']">Restore</a> access to your parent''s apartment.'
 		end
 		if momKnowsKolka = 1:
 			'Your mother knows Kolka is the father. <a href="momKnowsKolka = 0 & dynamic $cheatmenu[''reputation'']">Clear</a>.'
@@ -2713,9 +2713,9 @@ $cheatmenu['vartracker'] = {
 	'$locM: <<$locM>>'
 	'<font color = red>$CURLOC: <<$CURLOC>></font>'
 	'$location_type: <<$location_type>>'
-	'$home['current']: <<$home[''current'']>>'
-	'$home['town']: <<$home[''town'']>>'
-	'$home['name']: <<$home[''name'']>>'
+	'$home[''current'']: <<$home[''current'']>>'
+	'$home[''town'']: <<$home[''town'']>>'
+	'$home[''name'']: <<$home[''name'']>>'
 	'daystart: <<daystart>>'
 	'daystart_start: <<daystart_start>>'
 	'month: <<month>>'

+ 4 - 4
locations/FedorEv4.qsrc

@@ -1011,7 +1011,7 @@ if $ARGS[0] = 'Fedor Livingroom':
 		act 'Talk about what happened with Dimka':gt 'FedorEv4', 'Dimka Aftermath'
 	end
 
-	if home_owned[2] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
+	if owned_property['parents_home'] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
 
 	act 'Chat':gt 'FedorEv4', 'Fedor Livingroom Chat'	
 end
@@ -1064,7 +1064,7 @@ if $ARGS[0] = 'Fedor Kitchen':
 		act 'Talk about what happened with Dimka':gt 'FedorEv4', 'Dimka Aftermath'
 	end
 
-	if home_owned[2] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
+	if owned_property['parents_home'] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
 	
 	act 'Chat':gt 'FedorEv4', 'Fedor Kitchen Chat'	
 end
@@ -1102,7 +1102,7 @@ if $ARGS[0] = 'Fedor Bedroom':
 
 	act 'Walk away':gt 'FedorEv4', 'Bedroom'
 	
-	if home_owned[2] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
+	if owned_property['parents_home'] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
 
 	if FedorLove = 0 and strelaQW = -1:
 		act 'Find out what''s bothering him':gt 'FedorEv4', 'Love Talk Strela'
@@ -1163,7 +1163,7 @@ if $ARGS[0] = 'Fedor Bedroom 2':
 	if pcs_hairbsh = 0: 'Fedor notices your messy hair and pulls out his <a href="exec:gt ''FedorMisc'', ''Comb''">comb</a>.'
 	if $clothingworntype = 'nude': 'Fedor reaches over, then begins gently squeezing your breasts, "You have great tits, <<$pcs_firstname>>."'
 	
-	if home_owned[2] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
+	if owned_property['parents_home'] = 0 and FedorShelter = 0:act 'Ask about moving in':gt 'FedorEv4', 'Fedor Shelter'
 
 	act 'Maybe later':gt 'FedorEv4', 'Bedroom'
 	act 'Sure':gt 'FedorEv4', 'Fedor Bedroom Chat 2'

+ 24 - 24
locations/Komp.qsrc

@@ -87,7 +87,7 @@ if $ARGS[0] = 'browse':
 
 		'A blinking banner for a <a href="exec:gt ''komp'',''agent''">Kirsanova Real Estate Agency</a> keeps popping up in the corner.'
 
-		if home_owned[1] = 2 and husband = 0: act 'Rent your apartment out':gt 'komp', 'sale'
+		if owned_property['city_apartment'] = 2 and husband = 0: act 'Rent your apartment out':gt 'komp', 'sale'
 
 		if access['noporn'] = 0: act 'Watch porn': gt 'komp', 'porno'
 
@@ -129,9 +129,9 @@ if $ARGS[0] = 'sale':
 		gs 'stat'
 		'<center><img <<$set_imgh>> src="images/pc/items/accessories/computer/komp.jpg"></center>'
 		'You go to a popular website where people can post advertisements for free. You could post an advertisement here.'
-		if obkvsdam >= 1 and home_owned[1] = 2: 'You placed an advertisement to rent out your apartment. You should probably check every once in a while to see if anyone responded.'
+		if obkvsdam >= 1 and owned_property['city_apartment'] = 2: 'You placed an advertisement to rent out your apartment. You should probably check every once in a while to see if anyone responded.'
 
-		if obkvsdam = 0 and home_owned[1] = 2:
+		if obkvsdam = 0 and owned_property['city_apartment'] = 2:
 			act 'Rent out your city residential apartment':obkvsdam = 1 & gt 'komp', 'sale'
 		elseif obkvsdam > 0:
 			act 'Check if you got any replies':
@@ -150,7 +150,7 @@ if $ARGS[0] = 'sale':
 						sdamonth = month + 1
 						if sdamonth > 12:sdamonth = 1
 						if sdaday > monthsEnd[sdamonth]:sdaday = monthsEnd[sdamonth]
-						home_owned[1] = 3
+						gs 'homes_properties', 'set_ownership', 'city_apartment', 3
 						karta += predsumm
 						gt 'komp', 'start'
 					end
@@ -578,51 +578,51 @@ if $ARGS[0] = 'agent':
 	'<br>The website shows they have apartments available for rent or purchase in various areas, both in and out of the city. Renting or purchase requires you visit the agency in the city center to fill an application and collect the keys. Rent on all properties is deducted every month on the 25th.'
 	*nl
 	'<b>Property listing</b>:'
-	if ArendHouseSL > 0:
-		'You have <B><<ArendHouseSL>> days</B> remaining on the rental of your St. Petersburg apartment.'
+	if owned_property['city_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'city_apartment') > 0:
+		'You have <B><<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>> days</B> remaining on the rental of your St. Petersburg apartment.'
 		*nl
-	elseif home_owned[1] = 0 and ArendHouseSL = 0:
+	elseif owned_property['city_apartment'] = 0:
 		'There is an apartment in St. Petersburg residental area available, for rent or puchase.'
-		'Rent is: <<$home_rent_txt[1]>> ₽ per month. Current sale price is listed at: <<$home_value_txt[1]>> <b>₽</b>.'
+		'Rent is: <<func(''homes_properties'', ''get_rent'', ''city_apartment'')>> ₽ per month. Current sale price is listed at: <<func(''homes_properties'', ''get_price'', ''city_apartment'')>> <b>₽</b>.'
 		*nl
 	end
 
-	if home_owned[3] = 0:
+	if owned_property['village_cottage'] = 0:
 		'There is a holiday cottage with an adjacent allotment in the communal village for sale.'
-		'Current sale price is listed at: <<$home_value_txt[3]>> <b>₽</b>.'
+		'Current sale price is listed at: <<func(''homes_properties'', ''get_price'', ''village_cottage'')>> <b>₽</b>.'
 		*nl
 	end
 	
-	if home_owned[4] > 0 and ArendHouseSL4 > 0:
-		'You have <B><<ArendHouseSL4>> days</B> remaining on the rental of your Pushkin apartment.'
+	if owned_property['old_town_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'old_town_apartment') > 0:
+		'You have <B><<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>> days</B> remaining on the rental of your Pushkin apartment.'
 		*nl
-	elseif home_owned[4] = 0 and ArendHouseSL4 = 0:
+	elseif owned_property['old_town_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'old_town_apartment') = 0:
 		'There is an apartment in Pushkin area (Old Town) available to rent.'
-		'Rent is: <<$home_rent_txt[4]>> <b>₽</b> per month.'
+		'Rent is: <<func(''homes_properties'', ''get_rent'', ''old_town_apartment'')>> <b>₽</b> per month.'
 		*nl
 	end
 
-	if home_owned[5] = 0:
+	if owned_property['matryona_mansion'] = 0:
 		'There is a plot in the suburbs available for puchase, with planning permission for a mansion.'
-		'Current sale price is listed at: <<$home_value_txt[5]>> <b>₽</b>.'
+		'Current sale price is listed at: <<func(''homes_properties'', ''get_price'', ''matryona_mansion'')>> <b>₽</b>.'
 		*nl
 	end
 
-	if karta + bankDebtLimit >= home_rent[1] and home_owned[1] = 1:
+	if karta + bankDebtLimit >= func('homes_properties', 'get_rent', 'city_apartment') and owned_property['city_apartment'] = 1:
 		act 'Pay rent on St. Petersburg':
 			cla
-			karta -= home_rent[1]
-			ArendHouseSL += ArendHouseSL_due
-			'After a very simple procedure, you can now call an apartment in the city residential district home for another 30 days. You have <B><<ArendHouseSL>> days</B> remaining on the rental of your apartment.'
+			karta -= func('homes_properties', 'get_rent', 'city_apartment')
+			gs 'homes_properties', 'add_rent_days'
+			'After a very simple procedure, you can now call an apartment in the city residential district home for another 30 days. You have <B><<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>> days</B> remaining on the rental of your apartment.'
 			act 'Leave this website':gt 'komp','browse'
 		end
 	end
-	if karta + bankDebtLimit >= home_rent[4] and home_owned[4] > 0:
+	if karta + bankDebtLimit >= func('homes_properties', 'get_rent', 'old_town_apartment') and owned_property['old_town_apartment'] = 1:
 		act 'Pay rent on Pushkin':
 			cla
-			karta -= home_rent[4]
-			ArendHouseSL4 += ArendHouseSL_due
-			'After a very simple procedure, you can now call an apartment in Pushkin home for another 30 days. You have <B><<ArendHouseSL4>> days</B> remaining on the rental of your apartment.'
+			karta -= func('homes_properties', 'get_rent', 'old_town_apartment')
+			gs 'homes_properties', 'add_rent_days'
+			'After a very simple procedure, you can now call an apartment in Pushkin home for another 30 days. You have <B><<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>> days</B> remaining on the rental of your apartment.'
 			act 'Leave this website':gt 'komp','browse'
 		end
 	end

+ 2 - 2
locations/MartinTalk.qsrc

@@ -908,7 +908,7 @@ end
 
 if $ARGS[0] = 'MartinTalkApartment':
 	'<center><img <<$set_imgh>> src="images/locations/city/industrial/bar/martintalk.jpg"></center>'	
-	if home_owned[1] = 1:
+	if owned_property['city_apartment'] = 1:
 		'"Actually, I have a small apartment, on the other side of the park."'
 		*nl
 		'"Well, it''s good if you can afford it. Living on your own builds character."'
@@ -936,7 +936,7 @@ if $ARGS[0] = 'MartinTalkApartment':
 		*nl
 		$OpenInnerThought+'He wouldn''t be Martin if he didn''t tell me to "watch out" at least once a day,'+$CloseInnerThought+' you think and roll your eyes, but still smile and say "I always do" before he has to get back to work.'
 	
-	elseif mid($start_type,1,2) = 'sg' and home_owned[2] = 1:
+	elseif mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4:
 		'"I still live with my parents, in Pavlovsk," you admit.'
 		*nl
 		'"Oh, well, that can''t be easy at your age."'

+ 1 - 1
locations/Peterroom.qsrc

@@ -203,7 +203,7 @@ if $ARGS[0] = 'end':
             'You spend the journey talking about the sex you just had and you reach the city center a few minutes later. Peter leans over and gives your ass a firm squeeze as you climb out of the car. "Until next time <<$pcs_nickname>>." You smile at him and close the door before he drives off.' 			
 			gt 'city_center'
 		end
-		if home_owned[1] = 1 or home_owned[1] = 2:
+		if owned_property['city_house'] = 1 or owned_property['city_house'] = 2:
 			act 'To your apartment':
 				gs 'arousal', 'end'
 				'You nod and get into the car next to him, giving him directions to your apartment complex.'

+ 144 - 220
locations/agentned.qsrc

@@ -22,50 +22,73 @@ if $ARGS[0] = 'start':
 	'At the reception, you notice a large print banner:'
 	'"Please be aware that all sales transactions are made exclusively through your bank account. Rent payments are excluded from this policy."'
 
-	if home_owned[1] = 1 and ArendHouseSL > 0:
+	cityaptdays = func('homes_properties', 'get_rent_days', 'city_apartment')
+	oldtowndays = func('homes_properties', 'get_rent_days', 'old_town_apartment')
+	if owned_property['city_apartment'] = 1 and cityaptdays > 0:
 		*nl
-		'You have <B><<ArendHouseSL>> days</B> remaining on your St. Petersburg apartment lease. '+iif(money >= home_rent[1],'You can make a rent <a href="exec:money -= home_rent[1] & ArendHouseSL += ArendHouseSL_due & gt ''agentned'', ''start''">payment</a> in cash to extend it.','You can''t afford to pay your rent at the moment')+''
+		'You have <B><<cityaptdays>> days</B> remaining on your St. Petersburg apartment lease, and your monthly rent is <<$prop_rent[''city_apartment'']>> <b>₽</b>. '+iif(money >= prop_rent['city_apartment'],'You can make a rent <a href="exec:money -= prop_rent[''city_apartment''] & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gt ''agentned'', ''start''">payment</a> in cash to extend it.','You can''t afford to pay your rent at the moment')+''
 	end
-	if home_owned[4] > 0 and ArendHouseSL4 > 0:
+	if owned_property['old_town_apartment'] = 1 and oldtowndays > 0:
 		*nl
-		'You have <B><<ArendHouseSL4>> days</B> remaining on your Pushkin apartment lease. '+iif(money >= home_rent[4],'You can make a rent <a href="exec:money -= home_rent[4] & ArendHouseSL4 += ArendHouseSL_due & gt ''agentned'', ''start''">payment</a> in cash to extend it.','You can''t afford to your pay rent at the moment')+''
+		gs 'homes_properties', 'get_rent', 'old_town_apartment'
+		'You have <B><<oldtowndays>> days</B> remaining on your Pushkin apartment lease, and your monthly rent is <<$prop_rent[''old_town_apartment'']>> <b>₽</b>. '+iif(money >= prop_rent['old_town_apartment'],'You can make a rent <a href="exec:money -= prop_rent[''old_town_apartment''] & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gt ''agentned'', ''start''">payment</a> in cash to extend it.','You can''t afford to your pay rent at the moment')+''
 	end
+	killvar 'cityaptdays'
+	killvar 'oldtowndays'
 
-	if home_owned[1] = 2 or home_owned[3] > 0 or home_owned[5] = 1:
+	count = ARRSIZE('owned_property') 
+	if count > 0:
+		$text_to_print += ''
+		i = 1
+		:rent_loop
+			if owned_property[i] = 2 or owned_property[i] = 3:	
+				print = 1			
+				gs 'homes_properties', 'get_property_attr', $owned_property[i]
+				if owned_property[i] = 3:
+					$text_to_print += '<<$property[''agency_display'']>> which is currently occupied by your tenants. <br/>'
+				elseif owned_property[i] = 2:
+					'<<$property[''agency_display'']>> which is currently occupied by your tenants. <br/>'
+				end
+				killvar '$property'
+			end
+			i += 1
+		if i < count: jump 'rent_loop'
+	end
+	if print = 1:
 		*nl
-		'You own the following property:'
+		'<b>You own the following property</b>'
 		*nl
-		if home_owned[1] = 2: 'An apartment in St. Petersburg''s residential area'
-		if home_owned[1] = 3: 'An apartment in St. Petersburg''s residential area which is currently occupied by your tenants'
-		if home_owned[3] > 0: 'An cottage located in the cooperative village'
-		if home_owned[5] = 1: 'A plot of land in the St. Petersburg''s suburbs'
-		if home_owned[15] = 1: 'A house in the St. Petersburg''s residential area'
+		$text_to_print
 		*nl
 		'We are at your service if you decide to <a href="exec:gt ''agentned'',''sell''">sell</a>.'
 	end
+	killvar 'count'
+	killvar 'i'
+	killvar 'print'
+	killvar '$text_to_print'
 
 	act 'Leave': minut += 5 & gt 'city_center'
 
 	act 'View rentals': gt 'agentned', 'rent'
 	act 'View properties for sale': gt 'agentned', 'buy'
 
-	if home_owned[1] = 1:
+	if owned_property['city_apartment'] = 1:
 		act 'Cancel the lease of the city apartment':
 			cla & *nl
 			'Attention: You won''t be able to return to your apartment when you cancel the lease.'
 
 			act 'Return': gt'agentned', 'start'
-			act 'Cancel it': home_owned[1] = 0 & gt'agentned', 'start'
+			act 'Cancel it': owned_property['city_apartment'] = 0 & gt'agentned', 'start'
 		end
 	end
 
-	if home_owned[4] = 1:
+	if owned_property['old_town_apartment'] = 1:
 		act 'Cancel the lease of the apartment in Pushkin':
 			cla & *nl
 			'Attention: You won''t be able to return to your apartment when you cancel the lease.'
 
 			act 'Return': gt'agentned', 'start'
-			act 'Cancel it': home_owned[4] = 0 & gt'agentned', 'start'
+			act 'Cancel it': owned_property['old_town_apartment'] = 0 & gt'agentned', 'start'
 		end
 	end
 end
@@ -87,39 +110,45 @@ if $ARGS[0] = 'buy':
 	
 	act 'Return':gt'agentned', 'start'
 	
-	if home_owned[1] = 0 or home_owned[3] = 0 or home_owned[4] = 0 or home_owned[5] = 0:
-		if home_owned[1] = 0:
-			'There is an apartment in the city residential area available for <<$home_value_txt[1]>> <b>₽</b>.'
+	if property_owned['city_apartment'] = 0 or property_owned['village_cottage'] = 0 or owned_property['matryona_mansion'] = 0 or owned_property['city_house'] = 0:
+		if property_owned['city_apartment'] = 0:
+			'There is an apartment in the city residential area available for <<$prop_price[''city_apartment'']>> <b>₽</b>.'
 			*nl
-			if karta + bankDebtLimit >= home_value[1]:act 'Buy the city residential apartment': gt 'agentned', 'buy_cityres'
-		elseif home_owned[1] = 1:
-			'You could buy your current rental apartment for <<$home_value_txt[1]>> <b>₽</b>.'
+			if karta + bankDebtLimit >= $prop_price['city_apartment']: act 'Buy the city residential apartment': gt 'agentned', 'buy_property', 'city_apartment'
+		elseif property_owned['city_apartment'] = 1:
+			'You could buy your current rental apartment for <<$prop_price[''city_apartment'']>> <b>₽</b>.'
 			*nl
-			if karta + bankDebtLimit >= home_value[1]:act 'Buy the city residential apartment': gt 'agentned', 'buy_cityres'
+			if karta + bankDebtLimit >= prop_price['city_apartment']: act 'Buy the city residential apartment': gt 'agentned', 'buy_property', 'city_apartment'
 		end
 
-		if home_owned[3] = 0:
-			'There is a holiday cottage with an adjacent allotment in the village for <<$home_value_txt[3]>> <b>₽</b>.'
+		if property_owned['village_cottage'] = 0:
+			'There is a holiday cottage with an adjacent allotment in the village for <<$prop_price[''village_cottage'']>> <b>₽</b>.'
 			*nl
-			if karta + bankDebtLimit >= home_value[3]:act 'Buy the cottage in the village': gt 'agentned','buy_dacha'
+			if karta + bankDebtLimit >= prop_price['village_cottage']: act 'Buy the cottage in the village': gt 'agentned','buy_property', 'village_cottage'
 		end
 
-		if home_owned[5] = 0:
-			'There is a plot of land in the suburbs with planning permission for a mansion for <<$home_value_txt[5]>> <b>₽</b>.'
+		if onwed_property['matryona_mansion'] = 0:
+			'There is a plot of land in the suburbs with planning permission for a mansion for <<$prop_price[''matryona_mansion'']>> <b>₽</b>.'
 			*nl
-			if karta + bankDebtLimit >= home_value[5]:act 'Buy the land plot in the suburbs': gt 'agentned','buy_Mansion'
+			if karta + bankDebtLimit >= prop_price['matryona_mansion']: act 'Buy the land plot in the suburbs': gt 'agentned','buy_property', 'matryona_mansion'
 		end
 		
-		if home_owned[15] = 0:
-			'There is a small house on the edge of the city residential area for <<$home_value_txt[15]>> <b>₽</b>.'
+		if owned_property['city_house'] = 0:
+			'There is a small house on the edge of the city residential area for <<$prop_price[''city_house'']>> <b>₽</b>.'
 			*nl
-			if karta + bankDebtLimit >= home_value[15]:act 'Buy the house on the edge of the city residential area': gt 'agentned','buy_city_house_res'
+			if karta + bankDebtLimit >= prop_price['city_house']: act 'Buy the house on the edge of the city residential area': gt 'agentned','buy_property', 'city_house'
 		end
 	else
 		'We currently have no properties listed for sale.'
 	end
 end
 
+
+!! TODO: This needs a bit of thinking because Sveta can buy the sold property again, for the old price, but will get all the renovation
+!! bonuses because those variables are not cleared. 
+!! Two options:
+!!   1. Sold properties can''t be bought back
+!!   2. The sales value is increased based on what Sveta sold it for plus the rand() range
 if $ARGS[0] = 'sell':
 	*clr & cla
 	$loc = 'agentned'
@@ -135,128 +164,94 @@ if $ARGS[0] = 'sell':
 	
 	act 'Return':gt'agentned', 'start'
 	
-	if home_owned[1] = 2 and rembedr = 1 and remsitr = 1 and remkorr = 1 and remvanr = 1 and remkuhr = 1:
-		!Renovated city residential apartment
-		home_value1 = ((home_value[1] + 250000) + rand(-100000, 100000)) 
-		'We have found a buyer for your renovated apartment in the city residential area. They will offer <<home_value1>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<home_value1/100*95>>'
-		act 'Sell the renovated apartment':
-			*clr
-			menu_off = 1
-			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-			minut += 30
-			'You spend thirty minutes filling out the paperwork for the sale of your renovated apartment. You will suffer a loss of around 5% for fees and taxes. <<home_value1/100*95>> <b>₽</b> has been paid into your bank account.'
-			home_owned[1] = 0
-			ArendHouseSL = 0
-			if bankaccount = 1:
-				karta += home_value1/100*95
-			else
-				money += home_value1/100*95
-			end
-			delact 'Sell the renovated apartment'
-			gs 'stat'
+	if owned_property['city_apartment'] = 2:
+		if rembedr = 1 and remsitr = 1 and remkorr = 1 and remvanr = 1 and remkuhr = 1:
+			!Renovated city residential apartment
+			offer1 = ((prop_price['city_apartment'] + 250000) + rand(-100000, 100000)) 
+		else
+			offer1 = (prop_price['city_apartment'] + rand(-100000, 100000))
 		end
-	end
-	if home_owned[1] = 2:
-		!City residential apartment
-		home_value1 = (home_value[1] + rand(-100000, 100000))
-		'We have found a buyer for your apartment in the city residential area. They will offer <<home_value1>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<home_value1/100*95>>'
+		'We have found a buyer for your apartment in the city residential area. They will offer <<offer1>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<offer1/100*95>>'
 		act 'Sell the city apartment':
 			*clr
 			menu_off = 1
 			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
 			minut += 30
-			'You spend thirty minutes filling out the paperwork for the sale of your apartment. You will suffer a loss of around 5% for fees and taxes. <<home_value1/100*95>> <b>₽</b> has been paid into your bank account.'
-			home_owned[1] = 0
-			ArendHouseSL = 0
+			'You spend thirty minutes filling out the paperwork for the sale of your renovated apartment. You will suffer a loss of around 5% for fees and taxes. <<offer1/100*95>> <b>₽</b> has been paid into your bank account.'
+			gs 'homes_properties', 'set_home', 'city_apartment', 0
 			if bankaccount = 1:
-				karta += home_value1/100*95
+				karta += offer1/100*95
 			else
-				money += home_value1/100*95
+				money += offer1/100*95
 			end
 			delact 'Sell the city apartment'
 			gs 'stat'
 		end
 	end
-	if home_owned[3] = 1:
-		!Communal cottage
-		home_value3 = (home_value[3] + rand(-5000, 5000))
-		'We have found a buyer for your small communal cottage. They will offer <<home_value3>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<home_value3/100*95>>'
-		act 'Sell the holiday cottage':
-			*clr
-			menu_off = 1
-			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-			minut += 30
-			'You spend thirty minutes filling out the paperwork for the sale of your small cottage. You will suffer a loss of around 5% for fees and taxes. <<home_value3/100*95>> <b>₽</b> has been paid into your bank account.'
-			home_owned[3] = 0
-			if bankaccount = 1:
-				karta += home_value3/100*95
-			else
-				money += home_value3/100*95
-			end
-			delact 'Sell the holiday cottage'
-			gs 'stat'
+	
+	if property_owned['village_cottage'] = 2:
+		if func('homes_properties', 'property_renovated', 'village_cottage') = 1: 
+			!Renovated communal cottage
+			offer2 = ((prop_price['village_cottage'] + 200000) + rand(-10000, 10000))
+		else
+			!Communal cottage
+			offer2 = (prop_price['village_cottage'] + rand(-5000, 5000))
 		end
-	end
-	if home_owned[3] = 2:
-		!Renovated communal cottage
-		home_value3 = ((home_value[3] + 200000) + rand(-10000, 10000))
-		'We have found a buyer for your small renovated communal cottage. They will offer <<home_value3>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<home_value3/100*95>>'
-		act 'Sell the renovated cottage':
+		'We have found a buyer for your small communal cottage. They will offer <<offer2>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<offer2/100*95>>'
+		act 'Sell the cottage':
 			*clr
 			menu_off = 1
 			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
 			minut += 30
-			'You spend thirty minutes filling out the paperwork for the sale of your small cottage. You will suffer a loss of around 5% for fees and taxes. <<home_value3/100*95>> <b>₽</b> has been paid into your bank account.'
-			home_owned[3] = 0
+			'You spend thirty minutes filling out the paperwork for the sale of your small cottage. You will suffer a loss of around 5% for fees and taxes. <<offer2/100*95>> <b>₽</b> has been paid into your bank account.'
+			gs 'homes_properties', 'set_home', 'village_cottage', 0
 			if bankaccount = 1:
-				karta += home_value3/100*95
+				karta += offer/100*95
 			else
-				money += home_value3/100*95
+				money += offer/100*95
 			end
-			delact 'Sell the renovated cottage'
+			delact 'Sell the cottage'
 			gs 'stat'
 		end
 	end
-	if home_owned[5] = 1:
-		!Suburban land only - currently too many variables for selling upgraded mansion - might do later - 3xpurt.
-		home_value5 = (home_value[5] + rand(-50000, 50000))
-		'We have found a buyer for your vacant plot of land in the suburbs. They will offer <<home_value5>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<home_value5/100*95>>'
-		act 'Sell the vacant plot':
-			*clr
-			menu_off = 1
-			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-			minut += 30
-			'You spend thirty minutes filling out the paperwork for the vacant plot. You will suffer a loss of around 5% for fees and taxes. <<home_value5/100*95>> <b>₽</b> has been paid into your bank account.'
-			home_owned[5] = 0
-			if bankaccount = 1:
-				karta += home_value5/100*95
-			else
-				money += home_value5/100*95
+	
+	if owned_property['matryona_mansion'] = 2:
+		if func('homes_properties', 'property_construction_status', 'matryona_mansion') = 0:
+			!Suburban land only - currently too many variables for selling upgraded mansion - might do later - 3xpurt.
+			offer3 = (prop_price['matryona_mansion'] + rand(-50000, 50000))
+			'We have found a buyer for your vacant plot of land in the suburbs. They will offer <<offer3>> <b>₽</b>, minus 5% for fees and taxes, bringing the total to <<offer3/100*95>>'
+			act 'Sell the vacant plot':
+				*clr
+				menu_off = 1
+				'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
+				'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
+				minut += 30
+				'You spend thirty minutes filling out the paperwork for the vacant plot. You will suffer a loss of around 5% for fees and taxes. <<offer3/100*95>> <b>₽</b> has been paid into your bank account.'
+				gs 'homes_properties', 'set_home', 'matryona_mansion', 0
+				if bankaccount = 1:
+					karta += offer3/100*95
+				else
+					money += offer3/100*95
+				end
+				delact 'Sell the vacant plot'
+				gs 'stat'
 			end
-			delact 'Sell the vacant plot'
-			gs 'stat'
+		else 
+			!Suburban land only - currently too many variables for selling upgraded mansion - might do later - 3xpurt.
+			'Sorry, we are unable to find a buyer for your property at this time.'
 		end
 	end
-	if home_owned[5] = 2:
-		!Suburban land only - currently too many variables for selling upgraded mansion - might do later - 3xpurt.
-		'Sorry, we are unable to find a buyer for your property at this time.'
-	end
-	if home_owned[5] = 3:
-		!Suburban land only - currently too many variables for selling upgraded mansion - might do later - 3xpurt.
-		'Sorry, we are unable to find a buyer for your property at this time.'
-	end
-	if home_owned[1] = 0 and home_owned[3] = 0 and home_owned[4] = 0 and home_owned[5] = 0:
-		'You don''t currently own any property.'
-	end
-	if home_owned[15] = 1:
+	
+	if owned_property['city_house'] = 2:
 		!! - might do later - Alaratt.
 		'Sorry, we are unable to find a buyer for your house at this time.'
 	end
+
+	if property_owned['city_apartment'] = 0 and property_owned['village_cottage'] = 0 and owned_property['city_house'] = 0 and owned_property['matryona_mansion'] = 0:
+		'You don''t currently own any property.'
+	end
 end
 
 if $ARGS[0] = 'rent':
@@ -275,17 +270,17 @@ if $ARGS[0] = 'rent':
 	
 	act 'Return':gt'agentned', 'start'
 	
-	if home_owned[1] > 0 and home_owned[4] > 0:
+	if property_owned['city_apartment'] > 0 and property_owned['old_town_apartment'] > 0:
 		'We currently have no properties listed for rent.'
-	elseif home_owned[1] = 0 and home_owned[4] = 0:
+	elseif property_owned['city_apartment'] = 0 and property_owned['old_town_apartment'] = 0:
 		*nl
 		'There are two apartments available for rent. They are located in the city residential area and in Pushkin.'
 		act 'View the city apartment details': gt 'agentned', 'rent_cityres'
 		act 'View the Pushkin apartment details': gt 'agentned', 'rent_pushkin'
-	elseif home_owned[1] = 0:
+	elseif property_owned['city_apartment'] = 0:
 		'There is a property for rent in the city residential area'
 		act 'View the city apartment details': gt 'agentned', 'rent_cityres'
-	elseif home_owned[4] = 0:
+	elseif property_owned['old_town_apartment'] = 0:
 		'There is a property for rent in the old town of Pushkin'
 		act 'View the Pushkin apartment details': gt 'agentned', 'rent_pushkin'
 	end
@@ -294,32 +289,30 @@ end
 if $ARGS[0] = 'rent_cityres':
 	*clr & cla
 	menu_off = 1
-	gs 'housing', 'rent'
 	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo.jpg"></center>'
 	*nl
-	'"We have a flat available right now in the St. Petersburg residential area." The receptionist says as he starts pulling out the paperwork, "Rent is <<$home_rent_txt[1]>> ₽ and leases have to be renewed every 30 days. Payment will be automatically deducted from your account or you can come into the office to pay. When you sign for the lease you must make your first month''s rental payment upfront."'
+	'"We have a flat available right now in the St. Petersburg residential area." The receptionist says as he starts pulling out the paperwork, "Rent is <<$prop_rent[''city_apartment'']>> ₽ and leases have to be renewed every 30 days. Payment will be automatically deducted from your account or you can come into the office to pay. When you sign for the lease you must make your first month''s rental payment upfront."'
 	'<br>He pulls out a pen and slides the paperwork onto the counter. "Interested? You can move in right away," he calmly says.'
 
-	if money >= home_rent[1] or karta >= home_rent[1]:
+	if money >= prop_rent['city_apartment'] or karta >= prop_rent['city_apartment']:
 		act 'Agree and pay':
 			*clr & cla
 			cls
 			minut += 30
-			if money >= home_rent[1]: 
-				money -= home_rent[1]
+			if money >= prop_rent['city_apartment']: 
+				money -= prop_rent['city_apartment']
 			else
-				karta -= home_rent[1]
+				karta -= prop_rent['city_apartment']
 			end
-			home_owned[1] = 1
-			if ARRSIZE('home_owned') = 0:
+			gs 'homes_properties', 'set_ownership', 'city_apartment', 1
+			if func( 'homes_properties', 'get_accessible_count') = 1:
 				gs 'homes_properties', 'set_home', 'city_apartment'
 			else
 				$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
 				if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'city_apartment'
 				killvar '$set_homeyn'
 			end
-			ArendHouseSL += ArendHouseSL_due
 			gs'stat'
 			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
@@ -349,31 +342,29 @@ end
 if $ARGS[0] = 'rent_pushkin':
 	*clr & cla
 	menu_off = 1
-	gs 'housing', 'rent'
 	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo.jpg"></center>'
 	*nl
 	'"We have a small apartment available right now that is in Pushkin’s city center. It’s a little bit pricey, but it’s been recently renovated to be more modern. It looks quite nice, so you won’t find a place like that outside of Pushkin." The receptionist says as he starts pulling out the paperwork. "Rent is <<$home_rent_txt[4]>> ₽ and leases have to be renewed every 30 days, which can be taken automatically from your account or you can come in and pay directly. Last, but not least, you have to make your first payment up front at signing."'
 	'<br>He pulls out a pen and slides the paperwork onto the counter. "Interested? You can move in right away," he calmly says.'
 	
-	if money >= home_rent[4] or karta >= home_rent[4]:
+	if money >= property_owned['old_town_apartment'] or karta >= property_owned['old_town_apartment']:
 		act 'Agree and pay':
 			*clr & cla
 			minut += 30
-			if money >= home_rent[4]: 
-				money -= home_rent[4]
+			if money >= property_owned['old_town_apartment']: 
+				money -= property_owned['old_town_apartment']
 			else
-				karta -= home_rent[4]
+				karta -= property_owned['old_town_apartment']
 			end
-			home_owned[4] = 1
-			if ARRSIZE('home_owned') = 0:
+			gs 'homes_properties', 'set_ownership', 'old_town_apartment', 1
+			if func( 'homes_properties', 'get_accessible_count') = 1:
 				gs 'homes_properties', 'set_home', 'old_town_apartment'
 			else
 				$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
 				if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'old_town_apartment'
 				killvar '$set_homeyn'
 			end
-			ArendHouseSL4 += ArendHouseSL_due
 			gs'stat'
 			'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 			'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
@@ -401,98 +392,31 @@ if $ARGS[0] = 'rent_pushkin':
 	end
 end
 
-if $ARGS[0] = 'buy_cityres':
+if $ARGS[0] = 'buy_property':
 	*clr & cla
 	menu_off = 1
 	gs 'housing', 'sale'
+	gs 'homes_properties', 'get_property_attr', $ARGS[1]
 	minut += 30
-	karta -= home_value[1]
-	home_owned[1] = 2
-	if ARRSIZE('home_owned') = 0:
-		gs 'homes_properties', 'set_home', 'city_residential'
-	else
-		$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
-		if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'city_apartment'
-		killvar '$set_homeyn'
-	end
-	gs'stat'
-	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-	*nl
-	'You spend half an hour filling in the paperwork to buy the apartment in the residential area. <<$home_value_txt[1]>> <b>₽</b> has been removed from your bank account.'
+	karta -= $property['price']
+	gs 'homes_properties', 'set_ownership', $ARGS[1], 2
 
-	act 'Return':gt'agentned', 'start'
-end
-
-if $ARGS[0] = 'buy_dacha':
-	*clr & cla
-	menu_off = 1
-	gs 'housing', 'sale'
-	minut += 30
-	karta -= home_value[3]
-	home_owned[3] = 1
-	if ARRSIZE('home_owned') = 0:
-		gs 'homes_properties', 'set_home', 'village_cottage'
-	else
-		$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
-		if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'village_cottage'
-		killvar '$set_homeyn'
-	end
-	etoexhib = 0
-	gs'stat'
-	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-	*nl
-	'You spend half an hour filling in the paperwork for the purchase of a cottage with a garden in the co-op. It''s located 5 km away from St. Petersburg. <<$home_value_txt[3]>> <b>₽</b> has been removed from your bank account.'
-
-	act 'Return':gt'agentned', 'start'
-end
+	$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
+	if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', $ARGS[1]
+	
+	killvar '$set_homeyn'
 
-if $ARGS[0] = 'buy_Mansion':
-	*clr & cla
-	menu_off = 1
-	gs 'housing', 'sale'
-	minut += 30
-	karta -= home_value[5]
-	home_owned[5] = 1
-	if ARRSIZE('home_owned') = 0:
-		gs 'homes_properties', 'set_home', 'matryona_mansion'
-	else
-		$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
-		if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'matryona_mansion'
-		killvar '$set_homeyn'
-	end
+	!!TODO: this etoexhib will need some rethinking I get what it means by now, but some better name would be better.
+	if $ARGS[1] = 'village_cottage': etoexhib = 0
 	gs'stat'
 	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
 	*nl
-	'You spend half an hour filling in the paperwork for the purchase of a lot for building a mansion 1 km up the north road. <<$home_value_txt[5]>> <b>₽</b> has been removed from your bank account.'
+	'You spend half an hour filling in the paperwork to buy the <<$property[''name'']>>. <<$property[''price'']>> <b>₽</b> has been removed from your bank account.'
 
 	act 'Return':gt'agentned', 'start'
 end
 
-if $ARGS[0] = 'buy_city_house_res':
-	*clr & cla
-	menu_off = 1
-	gs 'housing', 'sale'
-	minut += 30
-	karta -= home_value[15]
-	home_owned[15] = 1
-	if ARRSIZE('home_owned') = 0:
-		gs 'homes_properties', 'set_home', 'city_house'
-	else
-		$set_homeyn = input("Would you like to set this as your new home? (yes/no)")
-		if $set_homeyn = 'yes': gs 'homes_properties', 'set_home', 'city_house'
-		killvar '$set_homeyn'
-	end
-	gs'stat'
-	'<center><b><font color = maroon>Real Estate Agency</font></b></center>'
-	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/realestate/agenstvo_paperwork.jpg"></center>'
-	*nl
-	'You spend half an hour filling in the paperwork for the purchase of a house on the edge of the city residential area. <<$home_value_txt[15]>> <b>₽</b> has been removed from your bank account.'
-
-	act 'Return':gt'agentned', 'start'
-end
 
 --- agentned ---------------------------------
 

+ 37 - 36
locations/bank.qsrc

@@ -499,7 +499,7 @@ if $ARGS[0] = 'cikl':
 		end
 
 		! Utilities for all apartments.
-		if (home_owned[1] = 1 or home_owned[1] = 2 or home_owned[4] > 0 or home_owned[5] = 2) and electroday = 0:
+		if (owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2 or owned_property['old_town_apartment'] > 0 or owned_property['matryona_mansion'] = 2 or owned_property['city_house']) and electroday = 0:
 			gs 'housing', 'util'
 			if bankAccount = 1 and karta >= elektro:
 				'<b><font color="green"><<elektro>> <b>₽</b> for utilities, has been automatically deducted from your bank account.</font></b>'
@@ -552,9 +552,10 @@ if $ARGS[0] = 'cikl':
 		if paydayHusb = 1:paydayHusb = 0
 		if workKafe['job'] = 1 and paydayKafe = 1:paydayKafe = 0
 		if workSec = 1 and paydaySec = 1:paydaySec = 0
-		if (home_owned[1] = 1 or home_owned[4] > 0) and haday = 1:haday = 0
-		if (home_owned[1] > 0 or home_owned[4] > 0 or home_owned[5] = 2) and electroday = 1:electroday = 0
-		if (home_owned[1] > 0 or home_owned[4] > 0 or home_owned[5] = 3) and kabel > 0 and kabelday = 1:kabelday = 0
+		!! No idea what haday is, it does not show up anywhere else beyond this one line
+		if (owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] > 0) and haday = 1:haday = 0
+		if (owned_property['city_apartment'] > 0 or owned_property['old_town_apartment'] > 0 or owned_property['matryona_mansion'] = 2 or owned_property['city_house']) and electroday = 1:electroday = 0
+		if (owned_property['city_apartment'] > 0 or owned_property['old_town_apartment'] > 0 or owned_property['matryona_mansion'] = 2 or owned_property['city_house']) and kabel > 0 and kabelday = 1:kabelday = 0
 		if scholarshipday = 1:scholarshipday = 0
 		if nopaytanwork = 1:nopaytanwork = 0
 		if nopaypoly = 1:nopaypoly = 0
@@ -562,8 +563,8 @@ if $ARGS[0] = 'cikl':
 		if paydaybistrosec = 1:paydaybistrosec = 0
 	end
 
-	if sdaday = day and sdamonth = month and home_owned[1] = 3:
-		home_owned[1] = 2
+	if sdaday = day and sdamonth = month and owned_property['city_apartment'] = 3:
+		gs 'homes_properties', 'set_ownership', 'city_apartment', 2
 		'<b><font color="red">Your tenants have moved out and your apartment is now vacant.</font></b>'
 		!msg 'Your tenants have moved out and your apartment is now vacant.'
 	end
@@ -572,56 +573,56 @@ if $ARGS[0] = 'cikl':
 	!! Rent
 	!!----------------------------------------
 
-	if home_owned[1] = 1 or home_owned[4] > 0:
-		gs 'housing', 'rent'
+	if owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] > 0:
 		! Rent for the city apartment
-		if home_owned[1] = 1:
-			if ArendHouseSL <= 2:
+		if owned_property['city_apartment'] = 1:
+			if func('homes_properties', 'get_rent_days', 'city_apartment') <= 2:
 				!From bank
-				if bankAccount = 1 and karta >= home_rent[1]:
-					'<b><font color="green">Your rent payment of <<home_rent[1]>> <b>₽</b> for your city apartment, has automatically been deducted from your bank account.</font></b>'
-					karta -= home_rent[1]
-					ArendHouseSL += ArendHouseSL_due
-				elseif bankAccount = 1 and karta + bankDebtLimit >= home_rent[1]:
-					'<b><font color="green">Your rent payment of <<home_rent[1]>> <b>₽</b> for your city apartment, has automatically been deducted from your bank account and overdraw facility. Please contact your bank regarding your overdraw repayment.</font></b>'
-					karta -= home_rent[1]
-					ArendHouseSL += ArendHouseSL_due
+				if bankAccount = 1 and karta >= prop_rent['city_apartment']:
+					'<b><font color="green">Your rent payment of <<prop_rent[''city_apartment'']>> <b>₽</b> for your city apartment, has automatically been deducted from your bank account.</font></b>'
+					karta -= prop_rent['city_apartment']
+					gs 'homes_properties', 'add_rent_days', 'city_apartment'
+				elseif bankAccount = 1 and karta + bankDebtLimit >= prop_rent['city_apartment']:
+					'<b><font color="green">Your rent payment of <<prop_rent[''city_apartment'']>> <b>₽</b> for your city apartment, has automatically been deducted from your bank account and overdraw facility. Please contact your bank regarding your overdraw repayment.</font></b>'
+					karta -= prop_rent['city_apartment']
+					gs 'homes_properties', 'add_rent_days', 'city_apartment'
 				elseif bankAccount = 0:
-					'<b><font color="red">You currently do not have a bank account setup for automatic rent deduction of <<home_rent[1]>> <b>₽</b> for your city apartment. To avoid eviction, please make manual payment as soon as possible.</font></b>'
+					'<b><font color="red">You currently do not have a bank account setup for automatic rent deduction of <<prop_rent[''city_apartment'']>> <b>₽</b> for your city apartment. To avoid eviction, please make manual payment as soon as possible.</font></b>'
 				else
 					nl
-					'<b><b><font color="red">Your card was declined during automatic rent deduction of <<home_rent[1]>> <b>₽</b> for your city apartment. To avoid eviction, please rectify as soon as possible.</font></b>'
+					'<b><b><font color="red">Your card was declined during automatic rent deduction of <<prop_rent[''city_apartment'']>> <b>₽</b> for your city apartment. To avoid eviction, please rectify as soon as possible.</font></b>'
 				end
 			end
 		end
 
+old_town_apartment
 		! Rent for the Pushkin apartment
-		if home_owned[4] > 0:
-			if ArendHouseSL4 <= 2:
+		if owned_property['old_town_apartment'] > 0:
+			if func('homes_properties', 'get_rent_days', 'old_town_apartment') <= 2:
 				!From bank
-				if bankAccount = 1 and karta >= home_rent[4]:
-					'<b><font color="green">Your rent payment of <<home_rent[4]>> <b>₽</b> for your Pushkin apartment, has automatically been deducted from your bank account.</font></b>'
-					karta -= home_rent[4]
-					ArendHouseSL4 += ArendHouseSL_due
-				elseif bankAccount = 1 and karta + bankDebtLimit >= home_rent[4]:
-					'<b><font color="green">Your rent payment of <<home_rent[4]>> <b>₽</b> for your Pushkin apartment, has automatically been deducted from your bank account and overdraw facility. Please contact your bank regarding your overdraw repayment.</font></b>'
-					karta -= home_rent[4]
-					ArendHouseSL4 += ArendHouseSL_due
+				if bankAccount = 1 and karta >= prop_rent['old_town_apartment']:
+					'<b><font color="green">Your rent payment of <<prop_rent[''old_town_apartment'']>> <b>₽</b> for your Pushkin apartment, has automatically been deducted from your bank account.</font></b>'
+					karta -= prop_rent['old_town_apartment']
+					gs 'homes_properties', 'add_rent_days', 'old_town_apartment'
+				elseif bankAccount = 1 and karta + bankDebtLimit >= prop_rent['old_town_apartment']:
+					'<b><font color="green">Your rent payment of <<prop_rent[''old_town_apartment'']>> <b>₽</b> for your Pushkin apartment, has automatically been deducted from your bank account and overdraw facility. Please contact your bank regarding your overdraw repayment.</font></b>'
+					karta -= prop_rent['old_town_apartment']
+					gs 'homes_properties', 'add_rent_days', 'old_town_apartment'
 				elseif bankAccount = 0:
-					'<b><font color="red">You currently do not have a bank account setup for automatic rent deduction of <<home_rent[4]>> <b>₽</b> for your Pushkin apartment. To avoid eviction, please make manual payment as soon as possible.</font></b>'
+					'<b><font color="red">You currently do not have a bank account setup for automatic rent deduction of <<prop_rent[''old_town_apartment'']>> <b>₽</b> for your Pushkin apartment. To avoid eviction, please make manual payment as soon as possible.</font></b>'
 				else
 					nl
-					'<b><b><font color="red">Your card was declined during automatic rent deduction of <<home_rent[4]>> <b>₽</b> for your Pushkin apartment. To avoid eviction, please rectify as soon as possible.</font></b>'
+					'<b><b><font color="red">Your card was declined during automatic rent deduction of <<prop_rent[''old_town_apartment'']>> <b>₽</b> for your Pushkin apartment. To avoid eviction, please rectify as soon as possible.</font></b>'
 				end
 			end
 		end
 	end
 
-	if home_owned[1] = 1 and ArendHouseSL <= 0: ArendHouseSL = 0 & home_owned[1] = 0
-	if home_owned[4] > 0 and ArendHouseSL4 <= 0: ArendHouseSL4 = 0 & home_owned[4] = 0
+	if owned_property['city_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'old_town_apartment') <= 0: gs 'homes_properties', 'set_ownership', 'city_apartment', 0
+	if owned_property['old_town_apartment'] > 0 and func('homes_properties', 'get_rent_days', 'old_town_apartment') <= 0: gs 'homes_properties', 'set_ownership', 'old_town_apartment', 0
 
-	if home_owned[1] = 1: ArendHouseSL -= 1
-	if home_owned[4] > 0: ArendHouseSL4 -= 1
+	if owned_property['city_apartment'] = 1: gs 'homes_properties', 'add_rent_days', 'city_apartment', -1
+	if owned_property['old_town_apartment'] > 0: gs 'homes_properties', 'add_rent_days', 'old_town_apartment', -1
 
 	!!------------------------------------------------------------------------------------------------------------
 

+ 2 - 2
locations/booty_call_after.qsrc

@@ -768,7 +768,7 @@ if $ARGS[0] = 'black_out':
 				gs'sleep', 'simple'
 			end
 
-			if mid($start_type,1,2) = 'sg' and home_owned[2] = 1: sveta_punishment['no_come_home'] = 1
+			if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4: sveta_punishment['no_come_home'] = 1
 			gt'booty_call_morning', 'morning'
 		end
 	end
@@ -2094,7 +2094,7 @@ if $ARGS[0] = 'sleep_function':
 		gs'sleep', 'simple'
 	end
 
-	if mid($start_type,1,2) = 'sg' and home_owned[2] = 1: sveta_punishment['no_come_home'] = 1
+	if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4: sveta_punishment['no_come_home'] = 1
 	gt'booty_call_morning', 'morning'
 end
 --- booty_call_after ---------------------------------

+ 4 - 4
locations/brother.qsrc

@@ -1640,7 +1640,7 @@ if $ARGS[0] = 'brotherknows6':
 		'He finally gathers his courage and says, "Yes, I love getting you pregnant. Every time we fuck, I have to fight the urge to just unload inside you, and every time I give in is the best moment of my life. Knowing that every rope I shoot into your wonderful pussy could knock you up turns me on more than anything else. Even before we had sex for the first time, I would fantasize about knocking you up every time I masturbated. I love knowing that I put that baby in you and that your body will tell everyone else. I want to impregnate you over and over, keeping you pregnant for as long as I can."'
 		'As he finishes, you stare in silence. You were hoping for a confession, but that was way beyond what you were expecting. Unable to bear the silence any longer, Kolka breaks the tension by gripping your ass and kissing you as passionately as he can. This snaps you back to reality and you return the kiss.'
 		'After several minutes, you pull back and lick your lips. Still sitting in Kolka''s lap, you say, "Every moment that we’re together is fantastic, and I love that this baby is yours, but I don''t know if I want any more children after this. So, when we have sex after this baby is born, please try to control yourself." He nods.'
-		if momKnowsKolka = 1 and home_owned[2] = 1:
+		if momKnowsKolka = 1 and owned_property['parents_home'] = 4:
 			cla
 			'Kolka chuckles, "Since <<$npc_nickname[''A29'']>> already knows I''ve gotten you pregnant before, we probably don''t need to keep this one secret, do we?"'
 			'"No, I don''t think we do. Even though she freaked she fuck out the first time, I''m actually looking forward to her reaction this time. She''s had plenty of time to come to terms with our…" You stop for a moment and grind into Kolka''s lap, "special relationship."'
@@ -1649,7 +1649,7 @@ if $ARGS[0] = 'brotherknows6':
 			'You kiss your brother one more time before getting up from his lap. Now that you''ve told him the news, it''s time to tell your mother. You really hope your right about her reaction…'
 
 			act 'Continue':minut += 10 & gt 'KatjaHomeTalk'
-		elseif momKnowsKolka = 1 and home_owned[2] = 0:
+		elseif momKnowsKolka = 1 and owned_property['parents_home'] = 0:
 			cla
 			'"Since <<$npc_nickname[''A29'']>> already knows I''ve gotten you pregnant before, we probably don''t need to keep this one secret, do we?"'
 			'You scowl, "I don''t give a fuck what <<$npc_nickname[''A29'']>> knows. She''s not speaking to me and I really don''t care to say anything to her!"'
@@ -1680,12 +1680,12 @@ if $ARGS[0] = 'brotherknows6':
 		'"Yeah, it''s yours. I can''t believe you got me pregnant again." You shake your head, "I don''t know why the hell I thought you''d be more careful after the first time."'
 		'"You thought I''d be more careful? It takes two, sweetheart." He chuckles, "And besides, I didn''t hear you complaining while we were fucking."'
 		'You snap at him, "You shut your goddamn mouth. You don''t have to walk around with a baby inside you. I do. So yeah, I have every right to be pissed and you’re just going to sit back and deal with it."'
-		if momKnowsKolka = 1 and home_owned[2] = 1:
+		if momKnowsKolka = 1 and owned_property['parents_home'] = 4:
 			cla
 			'"<<$npc_nickname[''A29'']>> already knows you got me pregnant before." You breath a deep sigh, "I am <i>not</i> looking forward to telling her about this."'
 
 			act 'Continue':minut += 10 & gt 'KatjaHomeTalk'
-		elseif momKnowsKolka = 1 and home_owned[2] = 0:
+		elseif momKnowsKolka = 1 and owned_property['parents_home'] = 0:
 			cla
 			'"God, I was already kicked out, thanks to you." You drop your head, "I should''ve known you''d only make my life worse"'
 

+ 2 - 2
locations/carF.qsrc

@@ -213,7 +213,7 @@ end
 
 if $ARGS[0] = 'other':
 	cla
-	if home_owned[5] > 0 and cardrive ! 18:
+	if owned_property['matryona_mansion'] > 0 and cardrive ! 18:
 		act 'Go to Matryona Mansion':
 			cla
 
@@ -353,7 +353,7 @@ end
 
 if $ARGS[0] = 'city':
 	cla
-	if home_owned[15] = 1 and cardrive ! 8: act 'Go home to St. Petersburg''s residential area':gs 'carF', 'nearby', 8
+	if owned_property['city_house'] = 2 and cardrive ! 8: act 'Go home to St. Petersburg''s residential area':gs 'carF', 'nearby', 8
 	if cardrive ! 3:act 'Go to St. Petersburg''s Industrial Region':gs 'carF', 'nearby', 3
 	if cardrive ! 1:act 'Go to St. Petersburg''s residential area':gs 'carF', 'nearby', 1
 	if cardrive ! 2:act 'Go to St. Petersburg city center':gs 'carF', 'nearby', 2

+ 1 - 1
locations/cikl.qsrc

@@ -920,7 +920,7 @@ if mid($start_type,1,2) = 'sg':
 		old_grupvalue[4] = grupvalue[4]
 		
 	elseif SchoolAtestat = -1:
-		if home_owned[2] = 0:
+		if owned_property['parents_home'] = 0:
 			$holyday = '<b>You missed your graduation. You could pick up your diploma at the school.</b>'
 		else
 			$holyday = '<b>You missed your graduation. Maybe your mother picked up your diploma.</b>'

+ 2 - 2
locations/city_island.qsrc

@@ -44,7 +44,7 @@ if streetevent_hour + 2 < hour:gt'street_event','city_island', 'main'
 
 gs 'street_event', 'city_island', 'extras'
 
-if home_owned[11] = 1:act '<b>GO HOME</b> (University dorm)':gt 'uni_dorm', 'start'
+if owned_property['university_dorm'] = 4 :act '<b>GO HOME</b> (University dorm)':gt 'uni_dorm', 'start'
 
 if car > 0 and cardrive = 25:'In the parking stands your <a href="exec:GS ''carF'', ''start''"><<$car>></a>.'
 
@@ -80,7 +80,7 @@ act 'Go to the University campus':
 	gt 'uni_grounds', 'main'
 end
 
-if home_owned[11] = 1 or university['student'] = 1 or hour >= 6:'The <a href="exec:gt ''uni_dorm'', ''start''">University dorms</a> offers small, but cheap, living space, for university students.'
+if owned_property['university_dorm'] = 4 or university['student'] = 1 or hour >= 6:'The <a href="exec:gt ''uni_dorm'', ''start''">University dorms</a> offers small, but cheap, living space, for university students.'
 
 if pcs_magik >= 1 and mainQW = 0 and mid($start_type,1,3) = 'uni':
 	*clr & cla

+ 16 - 13
locations/city_mansion_entrance.qsrc

@@ -10,15 +10,16 @@ if $ARGS[0] = '':
 	gs 'stat'
 	
 	*clr & cla
-	if home_owned[5] < 2:
+	constructionstatus = func('homes_properties', 'property_construction_status', 'matryona_mansion')
+	if constructionstatus = 0:
 		'<center><h4>Your Land</h4></center>'
 		'<center><img <<$set_imgh>> src="images/locations/city/suburb/mansion/o_empty_field.jpg"></center>'
 		'<center>An empty plot of land you own, suitable for building a large residence.</center>'
-	elseif home_owned[5] = 2:
+	elseif constructionstatus = 1:
 		'<center><h4>Your Mansion</h4></center>'
 		'<center><img <<$set_imgh>> src="images/locations/city/suburb/mansion/o_foundation.jpg"></center>'
 		'<center>The framework for your mansion stands here. It still needs more work.</center>'
-	elseif home_owned[5] = 3:
+	elseif constructionstatus = 2:
 		'<center><h4>Matryona Mansion</h4></center>'
 		'<center><img <<$set_imgh>> src="images/locations/city/suburb/mansion/matryona_mansion.jpg"></center>'
 		'<center>Your fully built mansion stands here. </center>'
@@ -50,13 +51,13 @@ if $ARGS[0] = '':
 		gt 'city_suburbs', 'start'
 	end
 
-	if home_owned[5] = 3: act 'Walk inside the mansion': minut += 4 & gt 'city_mansion_residence_1', 'yfoyer'
+	if owned_property['matryona_mansion'] = 2 and constructionstatus = 2  : act 'Walk inside the mansion': minut += 4 & gt 'city_mansion_residence_1', 'yfoyer'
 
-	if karta + bankDebtLimit >= 1500000 and home_owned[5] = 0:
+	if karta + bankDebtLimit >= 1500000 and owned_property['matryona_mansion'] = 0:
 		act 'Buy the land lot for a mansion (1,500,000 <b>₽</b>)':
 			cls
 			karta -= 1500000
-			home_owned[5] = 1
+			gs 'homes_properties', 'set_ownership', 'matryona_mansion', 2
 			minut += 5
 			menu_off = 1
 			gs 'stat'
@@ -66,11 +67,11 @@ if $ARGS[0] = '':
 		end
 	end
 
-	if karta + bankDebtLimit >= 500000 and home_owned[5] = 1:
+	if karta + bankDebtLimit >= 500000 and constructionstatus = 0:
 		act 'Pay for running utilities and the building foundation (500,000 <b>₽</b>)':
 			cls
 			karta -= 500000
-			home_owned[5] = 2
+			gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 			minut += 5
 			menu_off = 1
 			gs 'stat'
@@ -80,11 +81,11 @@ if $ARGS[0] = '':
 		end
 	end
 
-	if karta + bankDebtLimit >= 1500000 and home_owned[5] = 2:
+	if karta + bankDebtLimit >= 1500000 and constructionstatus = 1:
 		act 'Pay for the finishing touches on the mansion (1,500,000 <b>₽</b>)':
 			cls
 			karta -= 1500000
-			home_owned[5] = 3
+			gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 			minut += 5
 			menu_off = 1
 			gs 'stat'
@@ -94,7 +95,7 @@ if $ARGS[0] = '':
 		end
 	end
 
-	if karta + bankDebtLimit >= 500000 and home_owned[5] = 3 and ymanrem[3] = 0:
+	if karta + bankDebtLimit >= 500000 and constructionstatus = 2 and ymanrem[3] = 0:
 		act 'Pay for the construction of the rooms (500,000 <b>₽</b>)':
 			cls
 			karta -= 500000
@@ -108,7 +109,7 @@ if $ARGS[0] = '':
 		end
 	end
 
-	if home_owned[5] => 2:
+	if constructionstatus >= 1:
 		if karta + bankDebtLimit >= 800000 and banaMansion = 0:
 			act 'Pay for the construction of the sauna (800,000 <b>₽</b>)':
 				cls
@@ -137,7 +138,7 @@ if $ARGS[0] = '':
 			end
 		end
 	end
-	if home_owned[5] = 3:
+	if constructionstatus = 2:
 		if karta + bankDebtLimit >= 250000 and ymanrem[3] = 1:
 			act 'Pay for the renovations of the main hall (250,000 <b>₽</b>)':
 				cls
@@ -401,6 +402,8 @@ if $ARGS[0] = '':
 			end
 		end
 	end
+
+	killvar 'constructionstatus'
 end
 
 --- city_mansion_entrance ---------------------------------

+ 1 - 1
locations/city_park.qsrc

@@ -83,7 +83,7 @@ if $ARGS[0] = 'start':
 	end
 
 	if hour >= 20 or hour < 6 :
-		if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
+		if $home['current'] = '' and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
 			!nowhere to live in city
 			'It''s quite dark now, and you have nowhere to stay nearby. Maybe you should try to sleep on a bench?'
 		else

+ 4 - 4
locations/city_residential.qsrc

@@ -46,7 +46,7 @@ gs'street_event','city_residential', 'extras'
 
 if opusk > 0 or gnewQW = 5:
 	if rand(0,9) = 0:gt 'gopnew', 'start5'
-	if home_owned[1] > 0:'Something is written on the wall near the entrance to your building. It reads:<b>"<<$pcs_firstname>> <<$pcs_lastname>> from apartment 69 is a cheap slut!"</b>'
+	if owned_property['city_apartment'] > 0:'Something is written on the wall near the entrance to your building. It reads:<b>"<<$pcs_firstname>> <<$pcs_lastname>> from apartment 69 is a cheap slut!"</b>'
 end
 
 gs 'stat'
@@ -64,7 +64,7 @@ if car > 0 and cardrive = 1 or cardrive = 8:
 	end
 end
 
-if home_owned[15] = 1:
+if owned_property['city_house'] = 2:
 	'Your <a href="exec: minut += 10 & gs ''city_house_res_misc'', ''fronty''">house</a> is within walking distance.'
 	act '<b>Go to your house</b>':
 		minut += 10
@@ -72,7 +72,7 @@ if home_owned[15] = 1:
 	end
 end
 
-if home_owned[1] > 0:
+if owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2:
 	act '<b>Go to your apartment</b>':
 		gorand = rand(0, 100)
 
@@ -171,7 +171,7 @@ if Enable_tablemap = 0:
 	end
 end
 
-if home_owned[1] = 0:
+if owned_property['city_apartment'] = 0:
 	'You see several <a href="exec: minut += 1 & gt ''city_trashplace''">trash bins</a> in the courtyard of one of the apartment buildings.'
 else
 	'You see several <a href="exec: minut += 1 & gt ''city_trashplace''">trash bins</a> in the courtyard of your <a href="exec: gt ''city_apt_building'',''floor_1''">apartment building</a>.'

+ 3 - 3
locations/city_suburbs.qsrc

@@ -26,11 +26,11 @@ if $ARGS[0]='start':
 	if BDSMClub = 1 or BDSMmeet > 0:
 		act 'BDSM-club':gt'BDSM_Club','start'
 	end
-
-	if home_owned[5] = 0:
+	
+	if owned_property['matryona_mansion'] = 0:
 		'There is a vacant piece of land for sale where a large mansion could be constructed.'
 		act 'Visit the land for sale': minut += 10 & gt 'city_mansion_entrance'
-	elseif home_owned[5] < 3:
+	elseif owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') < 3:
 		'You mansion is partially built near here.'
 		act 'Visit your mansion': minut += 10 & gt 'city_mansion_entrance'
 	else

+ 3 - 3
locations/dachain.qsrc

@@ -15,7 +15,7 @@ if $args[0] = 'start':
 	*clr & cla
 	gs 'stat'
 	'<center><b><font color="maroon">Cottage</font></b></center>'
-	if home_owned[3] = 2:
+	if owned_property['village_cottage'] = 2 and owned_property['village_cottage-renovated'] = 1:
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dacharoom2.jpg"></center>'
 	else
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dacharoom1.jpg"></center>'
@@ -78,7 +78,7 @@ if $args[0] = 'dachakit':
 	gs 'kit_din'
 	gs 'stat'
 	'<center><b><font color="maroon">Cottage Kitchen</font></b></center>'
-	if home_owned[3] = 2:
+	if owned_property['village_cottage'] = 2 and owned_property['village_cottage-renovated'] = 1:
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dachakit2.jpg"></center>'
 	else
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dachakit1.jpg"></center>'
@@ -158,7 +158,7 @@ if $args[0] = 'dachabath':
 	*clr & cla
 	gs 'stat'
 	'<center><b><font color="maroon">Cottage Bathroom</font></b></center>'
-	if home_owned[3] = 2:
+	if owned_property['village_cottage'] = 2 and owned_property['village_cottage-renovated'] = 1:
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dachavan2.jpg"></center>'
 	else
 		'<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dachavan1.jpg"></center>'

+ 1 - 0
locations/dachamy.qsrc

@@ -18,6 +18,7 @@ gs 'stat'
 act 'Exit the alley':
 	minut += 15
 	gt 'dachi'
+end
 
 act 'Go into the house':gt 'dachain', 'start'
 

+ 1 - 1
locations/dachi.qsrc

@@ -24,7 +24,7 @@ end
 
 act 'Go to the highway':minut += 15 & nroad = 5 & gt 'road'
 
-if home_owned[3] > 0:
+if owned_property['village_cottage'] = 2:
 	'Enter <a href="exec:gt ''dachamy'', ''start''">your yard</a>.'
 	'Across the street from your cottage is another <a href="exec:gt ''etoexhib'', ''pos8''">cottage</a> almost identical to yours.'
 	if hour = meethour:

+ 9 - 9
locations/dina.qsrc

@@ -2,9 +2,9 @@
 
 $brodila = {
 	sexpartkno = 0
-	if home_owned[1] > 0:
+	if owned_property['city_apartment'] > 0:
 		gt'korr','start'
-	elseif home_owned[4] = 1:
+	elseif owned_property['old_town_apartment'] = 1:
 		gt'korr2x','start'
 	else
 		gt'city_residential', 'start'
@@ -12,9 +12,9 @@ $brodila = {
 }
 
 $brodilr = {
-	if mid($start_type,1,2) = 'sg' and home_owned[2] = 1:
+	if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4:
 		gt 'pav_residential'
-	elseif home_owned[4] = 1:
+	elseif owned_property['old_town_apartment'] = 1:
 		gt'liames'
 	else
 		gt'city_residential','start'
@@ -22,9 +22,9 @@ $brodilr = {
 }
 
 $brodilk = {
-	if home_owned[1] > 0:
+	if owned_property['city_apartment'] > 0:
 		gt'kuhr','start'
-	elseif home_owned[4] = 1:
+	elseif owned_property['old_town_apartment']= 1:
 		gt'kuhr2x','start'
 	else
 		gt'city_residential', 'start'
@@ -32,11 +32,11 @@ $brodilk = {
 }
 
 $brodils = {
-	if home_owned[1] > 0:
+	if owned_property['city_apartment'] > 0:
 		gt'sitr','start'
-	elseif home_owned[4] = 1:
+	elseif owned_property['old_town_apartment'] = 1:
 		gt'sitr2x','start'
-	elseif mid($start_type,1,2) = 'sg' and home_owned[2] = 1:
+	elseif mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4:
 		gt 'sitrPar'
 	else
 		gt'city_residential', 'start'

+ 1 - 1
locations/dvor.qsrc

@@ -29,7 +29,7 @@ if psi1day =1 and pavserpsiday ! daystart:
     act 'Enter the house':gt'koncepod1','krr2x'
 end
 
-!if home_owned[1] = 3: act '<b>Enter the house</b>':gt 'koncepod'
+!if owned_property['city_apartment'] = 3: act '<b>Enter the house</b>':gt 'koncepod'
 !end
 
 --- dvor ---------------------------------

+ 1 - 1
locations/food_menu.qsrc

@@ -71,7 +71,7 @@ elseif $loc = 'gkafe':
 	*nl
 	'<center><img <<$set_imgh>> src="images/shared/menus/borislav.jpg"</center><br>'
 	!'<center><img <<$set_imgh>> src="images/shared/drinks/cafedrinks.jpg"</center><br>'
-	if mid($start_type,1,2) = 'sg' and home_owned[2] = 1:
+	if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4:
 		$_eat['0,name'] = 'Vegetarian Piroshki'
 		$_eat['0,type'] = 'pirosh'
 		$_eat['0,price'] = 'Free'

+ 2 - 2
locations/gadbana.qsrc

@@ -118,12 +118,12 @@ if mira_guest = 0:
 	end
 	*nl
 
-	if shampoo > 0 or (locat['Fam_inGad'] = 1 and home_owned[2] = 1):
+	if shampoo > 0 or (locat['Fam_inGad'] = 1 and owned_property['parents_home'] = 4):
 		act 'Wash your body (0:25)':
 			*clr & cla
 			menu_off = 1
 			minut += 25
-			if locat['Fam_inGad'] = 1 and home_owned[2] = 1: noShampoo = 1
+			if locat['Fam_inGad'] = 1 and owned_property['parents_home'] = 4: noShampoo = 1
 			dynamic $showerdin
 			if frost > 0:frost = 0
 			!!gs 'clothing', 'strip', 'gadbana'

+ 8 - 3
locations/gadhouse.qsrc

@@ -97,7 +97,10 @@ if $ARGS[0] = 'start':
 	
 	display_bb = 1
 	frost = 0
-	home_owned[14] = 1
+	act 'Say you don''t mind anything':pavSharedAptEnabled = 1 & gs 'homes_properties', 'set_ownership', 'shared_apartment', 1 & pavIntroStep = 30 & gt 'pav_shared_apt', 'intro'
+
+	gs 'homes_properties', 'set_ownership', 'grandparents_house', 4
+
 	gs 'gadhouse', 'nudity_trouble_limit'
 
 	!! Grandma sends Sveta back to Pavlovsk for school to start
@@ -153,7 +156,9 @@ if $ARGS[0] = 'start':
 	!!Grandma kicks Sveta out for being a whore
 	elseif grandmaQW['nudity_trouble_limit'] = 50 and hour >= 6 and hour < 20:
 		*clr & cla
-		home_owned[14] = 0
+
+		gs 'homes_properties', 'set_ownership', 'grandparents_house', 0
+
 		grandmaQW['help_amount'] = 0
 		grandmaQW['block'] = 1
 		minut += 5
@@ -1595,7 +1600,7 @@ if $ARGS[0] = 'family_trip':
 
 		gs 'mother', 'check_workout'
 
-		if gadstay_day ! daystart and home_owned[2] = 1:
+		if gadstay_day ! daystart and owned_property['parents_home'] = 1:
 			if week = 7:
 				if hour = 20:
 					locat['Fam_month_inGad'] = month

+ 4 - 4
locations/gkafe.qsrc

@@ -76,15 +76,15 @@ if $ARGS[0] = '':
 
 			if mid($start_type,1,2) = 'sg':
 				if SchoolBlock = 0:
-					if home_owned[2] = 1: 
+					if owned_property['parents_home'] = 4: 
 						'Since your <<$npc_nickname[''A29'']>> works here, you can eat-in for free.'
-					elseif home_owned[2] = 0:
+					elseif owned_property['parents_home'] = 0:
 						'Since you left home, you can no longer eat here for free.'
 					end
 				else
-					if home_owned[2] = 1:
+					if owned_property['parents_home'] = 4:
 						'Since you got kicked out of school, you can no longer eat here for free. Your <<$npc_nickname[''A29'']>> wants you to earn a living.'
-					elseif home_owned[2] = 0:
+					elseif owned_property['parents_home'] = 0:
 						'Since you were expelled from school and left home, you can no longer eat here for free.'
 					end
 				end

+ 2 - 2
locations/gschool_grounds.qsrc

@@ -85,7 +85,7 @@ if $ARGS[0] = 'main':
 			kanikuli = 7
 			gs 'stat'
 
-			if home_owned[2] = 0:
+			if owned_property['parents_home'] = 0:
 				'Everyone from your year is assembled in the auditorium of the school. Your teachers are standing on a platform in front of several rows of chairs where you and your classmates are sitting. Some parents and siblings are sitting in the back rows. Nobody from your family showed up.'
 			else
 				'Everyone from your year is assembled in the auditorium of the school. Your teachers are standing on a platform in front of several rows of chairs where you and your classmates are sitting. Some parents and siblings are sitting in the back rows. You turn your head and see your mother and your brother sitting among them.'
@@ -95,7 +95,7 @@ if $ARGS[0] = 'main':
 
 			if class['school_grade_average'] >= 90:
 				'You go up to the podium. As the Principal shakes your hand she announces "As every year I''d like to honor our best student of the year. Miss <<$pcs_lastname>> here performed exceptionally well in her studies and I think that deserves some recognition." She starts applauding and the auditorium quickly joins in.'
-				if home_owned[2] = 1: 'As you return to your place you see your mother smiling brightly.'
+				if owned_property['parents_home'] = 4: 'As you return to your place you see your mother smiling brightly.'
 			elseif class['school_grade_average'] >= 70:
 				'You go up to the podium. The Principal shakes your hand and gives you your diploma. "Well done, Miss <<$pcs_lastname>>!" she says before you return to your place.'
 			else

+ 1 - 1
locations/gschool_lunch.qsrc

@@ -86,7 +86,7 @@ if $ARGS[0] = 'cafeteria':
 		act 'Continue': gt 'gschool_lunch', 'break'
 	end
 
-	if home_owned[2] = 1:
+	if owned_property['parents_home'] = 4:
 		act 'Eat bagged lunch':
 			cla
 			menu_off = 1

+ 1 - 1
locations/home_activity.qsrc

@@ -37,7 +37,7 @@ if $ARGS[0] = 'vomiting_images':
 		$home_activity['vomit_exit'] = 'vanrPar'
 	elseif at_home = 3:
 		!! location = 'My cottage in the cooperative farm'
-		if home_owned[3] = 2:
+		if property_owned['village_cottage-renovated'] = 1:
 			$home_activity['vomit_bedroom'] = '<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dacharoom2.jpg"></center>'
 			$home_activity['vomit_bathroom'] = '<center><img <<$set_imgh>> src="images/locations/suburban/cottage/dacharoom2.jpg"></center>'
 		else

+ 196 - 13
locations/homes_properties.qsrc

@@ -26,10 +26,10 @@
 }
 
 if ARRSIZE('rent') < 2:
-	propr_rent['city_apartment'] = 15000
-	$propr_rent['city_apartment'] = '15,000'
-	propr_rent['old_town_apartment'] = 10000
-	$propr_rent['old_town_apartment'] = '10,000'
+	prop_rent['city_apartment'] = 15000
+	$prop_rent['city_apartment'] = '15,000'
+	prop_rent['old_town_apartment'] = 10000
+	$prop_rent['old_town_apartment'] = '10,000'
 end
 
 if ARRSIZE('price')  < 4:
@@ -47,7 +47,8 @@ end
 if $ARGS[0] = 'get_property_attr':
 	if $ARGS[1] = 'city_apartment':
 		$property['name'] = 'City residential apartment'
-		$property['display'] = 'your city residential apartment'
+		$property['display'] = 'apartment in St. Petersburg''s residential area'
+		$property['agency_display'] = 'An apartment in St. Petersburg''s residential area'
 		$property['town'] = 'city'
 		$property['location'] = 'city_residential'
 		$property['entrance'] = 'korr'
@@ -68,8 +69,9 @@ if $ARGS[0] = 'get_property_attr':
 		$property['type'] = 'permanent_residence'
 		property['id'] = 2
 	elseif $ARGS[1] = 'village_cottage':
-		$property['name'] = 'My cottage in the cooperative farm'
-		$property['display'] = 'your cottage in the cooperative farm'
+		$property['name'] = 'My cottage in the cooperative village'
+		$property['display'] = 'cottage in the cooperative village'
+		$property['agency_display'] = 'A cottage located in the cooperative village'
 		$property['town'] = 'city'
 		$property['location'] = 'dachamy'
 		$property['entrance'] = 'dachamy'
@@ -80,7 +82,8 @@ if $ARGS[0] = 'get_property_attr':
 		property['internet_enabled'] = 1
 	elseif $ARGS[1] = 'old_town_apartment':
 		$property['name'] = 'Old town apartment'
-		$property['display'] = 'your old town apartment'
+		$property['display'] = 'old town apartment'
+		$property['angecy-display'] = 'An apartment in the old town of Puskin.'
 		$property['town'] = 'oldtown'
 		$property['location'] = 'liames'
 		$property['entrance'] = 'korr2x'
@@ -93,6 +96,7 @@ if $ARGS[0] = 'get_property_attr':
 	elseif $ARGS[1] = 'matryona_mansion':
 		$property['name'] = 'Matryona mansion'
 		$property['display'] = 'the Matryona mansion'
+		$property['agency_display'] = 'A plot of land in the St. Petersburg''s suburbs'
 		$property['town'] = 'city'
 		$property['location'] = 'city_mansion_entrance'
 		$property['entrance'] = 'city_mansion_residence_1'
@@ -101,6 +105,7 @@ if $ARGS[0] = 'get_property_attr':
 		property['price'] = prop_rent['matryona_mansion']
 		property['id'] = 5
 		property['internet_enabled'] = 1
+		property['contstruction_needed'] = 1
 	elseif $ARGS[1] = 'pavlovsk_hotel':
 		$property['name'] = 'My hotel room in Pavlovsk'
 		$property['display'] = 'your hotel room in Pavlovsk'
@@ -175,7 +180,8 @@ if $ARGS[0] = 'get_property_attr':
 		property['id'] = 14
 	elseif $ARGS[1] = 'city_house':
 		$property['name'] = 'City residential house'
-		$property['display'] = 'your city residential house'
+		$property['display'] = 'house in the St. Petersburg''s residential area'
+		$property['agency_display'] = 'A house in the St. Petersburg''s residential area'
 		$property['town'] = 'city'
 		$property['location'] = 'city_residential'
 		$property['entrance'] = 'city_house_res_misc'
@@ -209,28 +215,205 @@ if $ARGS[0] = 'set_home':
 	gs 'homes_properties', 'get_property_attr', $ARGS[1]
 	COPYARR 'home','property'
 	$home['current'] = $ARGS[1]
+	if $owned_property[$ARGS[1]+'-status'] = 0: gs 'homes_properties', 'set_ownership', $ARGS[1], 1
 	killvar '$property'
 	killvar 'property'
 end
 
 !! $ARGS[1]: the name of the property (the index name)
 !! ARGS[2]: ownership type
+!!			0: no acces -> 'no access'
 !!			1: rented	-> 'rented'
 !!			2: owned    -> 'owned'
 !!			3: owned and rented out -> 'tenants'
+!!			4: has acess -> 'has access' / homes that behave like rentals but no rent is tracked
+!!				parents home, university dorm, lyceum dorm and the shared apartment, the Shulga and Meynold household, etc. 
+!! ARGS[3]: construction status
+!!			0: land only 
+!!			1: foundation, frames built, utilities are connected
+!!			2: fully built
+!! ARGS[4]:renovation status
+!!			0: not renovated
+!!			1: fully renovated
 if $ARGS[0] = 'set_ownership':
+	gs 'homes_properties', 'get_property_attr', $ARGS[1]
+	owned_property[$ARGS[1]] = ARGS[2]
 	$owned_property[$ARGS[1]] = $ARGS[1]
-	owned_property[$ARGS[1]+'-status'] = ARGS[2]
+	if $property['contstruction_needed'] = 1:
+		owned_property[$ARGS[1]+'-construction-status'] = ARGS[3]
+	else
+		owned_property[$ARGS[1]+'-construction-status'] = 2
+	end
+	owned_property[$ARGS[1]+'-renovated'] = ARGS[4]
+	if ARGS[2] = 1:
+		owned_property[$ARGS[1]+'-days-left'] += func( 'homes_properties', 'rent_due')
+	elseif ARGS[2] = 0:
+		if $home['current'] = $ARGS[1]: killvar '$home'
+		owned_property[$ARGS[1]+'-days-left'] = 0
+	elseif ARGS[2] = 2 or ARGS[2] = 3:
+		owned_property[$ARGS[1]+'-days-left'] = 0
+	end
+	killvar 'property'
+end
+
+!! Use it as a func() returns the total count of properties that are homes and are owned (including wiht tenants)
+if $ARGS[0] = 'get_owned_homes':
+	i = 0
+	count = ARRSIZE('owned_property')
+	if count > 0: 
+		:countloop
+			gs 'homes_properties', 'get_property_attr', $owned_property[i]
+			if $property['type'] = 'permanent_residence' and (owned_property[i] = 2 or owned_property[i] = 3): counter += 1
+			i += 1
+			killvar 'property'
+		if i < count: jump 'countloop'
+	end
+	result = counter
+	killvar 'counter'
+	killvar 'count'
+	killvar 'i'
+end
+
+!! Use it as a func() returns the total count of rented properties that are homes
+if $ARGS[0] = 'get_rented_count':
+	i = 0
+	count = ARRSIZE('owned_property')
+	if count > 0: 
+		:countloop
+			gs 'homes_properties', 'get_property_attr', $owned_property[i]
+			if $property['type'] = 'permanent_residence' or $property['type'] = 'temporary_residence' and owned_property[i] = 1: counter += 1
+			i += 1
+			killvar 'property'
+		if i < count: jump 'countloop'
+	end
+	result = counter
+	killvar 'counter'
+	killvar 'count'
+	killvar 'i'
+end
+
+!! Use it as a func() returns the total count of properties that are homes and accessible
+if $ARGS[0] = 'get_accessible_count':
+	i = 0
+	count = ARRSIZE('owned_property')
+	if count > 0: 
+		:countloop
+			gs 'homes_properties', 'get_property_attr', $owned_property[i]
+			if $property['type'] = 'permanent_residence' or $property['type'] = 'temporary_residence' and owned_property[i] ! 0 and owned_property[i] ! 3: counter += 1
+			i += 1
+			killvar 'property'
+		if i < count: jump 'countloop'
+	end
+	result = counter
+	killvar 'counter'
+	killvar 'count'
+	killvar 'i'
+end
+
+
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+!! ARGS[2] - the number of days to add.
+!!           if the value is 0 then the code will add the number of days that is there in the month
+if $ARGS[0] = 'add_rent_days':
+	if ARGS[2] = 0:
+		owned_property[$ARGS[1]+'-days-left'] += func( 'homes_properties', 'rent_due')
+	else
+		owned_property[$ARGS[1]+'-days-left'] += ARGS[2]
+	end
+end
+
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+!! ARGS[2] - the number of days to set to.
+if $ARGS[0] = 'set_rent_days':
+	owned_property[$ARGS[1]+'-days-left'] = ARGS[2]
 end
 
+!! Call it as a func()
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+if $ARGS[0] = 'get_rent_days':
+	result = owned_property[$ARGS[1]+'-days-left']
+end
+
+!! Call it as a func()
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+if $ARGS[0] = 'property_construction_status':
+	result = owned_property[$ARGS[1]+'-construction-status']
+end
+
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+if $ARGS[0] = 'progress_construction_status':
+	if owned_property[$ARGS[1]+'-construction-status'] < 2: owned_property[$ARGS[1]+'-construction-status'] += 1
+end
+
+!! Call it as a func()
+!! ARGS[1] = the code name of the property, e.g. 'city_apartment' 
+if $ARGS[0] = 'property_renovated':
+	result = owned_property[$ARGS[1]+'-renovated']
+end
+
+
+!! Returns a simple string representation of the status
+!! ARGS[1]: the code name of the property, e.g. 'city_apartment' 
+if $ARGS[0] = 'property_status_to_text':
+	if ARGS[1] = 0: 
+		result = 'no access'
+	elseif ARGS[1] = 1: 
+		result = 'rented'
+	elseif ARGS[1] = 2: 
+		result = 'owned'
+	elseif ARGS[1] = 3: 
+		result = 'tenants'		
+	elseif ARGS[1] = 4:
+		result = 'has access'
+	else
+		result = 'invalid status'
+	end
+end
+
+!! Returns a string that can be displayed in a longer text.
+!! For example 'You have tenants living in your city apartment.'
+!! ARGS[1]: The ownership type
+if $ARGS[0] = 'property_status_to_display_text':
+	if ARGS[1] = 0: 
+		result = 'You have no access to '
+	elseif ARGS[1] = 1: 
+		result = 'Yo are renting '
+	elseif ARGS[1] = 2: 
+		result = 'You own '
+	elseif ARGS[1] = 3: 
+		result = 'You have tenants living in '		
+	else
+		result = 'invalid status'
+	end
+end
+
+!! Returns the monthly rent the property has - both as a number and as a string (result and $result)
+!! Call as a func()
+!! ARGS[1] - the code (not display) name of the property, e.g. city_apartment
 if $ARGS[0] = 'get_rent':
-	result = prop_rent[$ARGS[0]]
-	$result = prop_rent[$ARGS[0]]
+	result = prop_rent[$ARGS[1]]
 end
 
+!! Returns the price of the property - both as a number and as a string (result and $result)
+!! Call as a func() 
+!! ARGS[1] - the code (not display) name of the property, e.g. city_apartment
 if $ARGS[0] = 'get_price':
 	result = prop_price[$ARGS[0]]
-	$result = prop_price[$ARGS[0]]
+end
+
+!! Returns the rent due date for the given month. Call as a func()
+if $ARGS[0] = 'rent_due':
+	if month = 1 or month = 3 or month = 5 or month = 7 or month = 8 or month = 10 or month = 12:
+		result = 31
+	elseif month = 2:
+		if ((year mod 4 = 0) and (year mod 100 ! 0)) or (year mod 400 = 0):
+			result = 29
+		else
+			result = 28
+		end
+	else
+		result = 30
+	end
 end
 
 --- homes_properties ---------------------------------

+ 1 - 1
locations/hookup_after.qsrc

@@ -2181,7 +2181,7 @@ if $ARGS[0] = 'sleep':
 		gs 'sleep', 'simple'
 	end	
 	
-	if mid($start_type,1,2) = 'sg' and home_owned[2] = 1: sveta_punishment['no_come_home'] = 1
+	if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4: sveta_punishment['no_come_home'] = 1
 	gt 'hookup_morning', 'morning'
 end
 --- hookup_after ---------------------------------

+ 10 - 10
locations/housing.qsrc

@@ -75,19 +75,19 @@ end
 
 if $ARGS[0] = 'util':
 	killvar 'hcount_util'
-	if home_owned[1] = 1: hcount_util += 1
-	if home_owned[3] > 1: hcount_util += 1
-	if home_owned[4] > 0: hcount_util += 1
-	if home_owned[5] > 2: hcount_util += 1
-	if home_owned[15] = 1: hcount_util += 1
+	if owned_property['city_apartment'] = 1: hcount_util += 1
+	if owned_property['village_cottage'] > 1: hcount_util += 1
+	if owned_property['old_town_apartment'] > 0: hcount_util += 1
+	if owned_property['matryona_mansion'] > 2: hcount_util += 1
+	if owned_property['city_house'] = 1: hcount_util += 1
 end
 
 if $ARGS[0] = 'cable':
-	if home_owned[1] = 1: hcount_cable += 1
-	!if home_owned[3] > 1: hcount_cable += 1
-	if home_owned[4] > 0: hcount_cable += 1
-	if home_owned[5] > 2: hcount_cable += 1
-	if home_owned[15] = 1: hcount_cable += 1
+	if owned_property['city_apartment'] = 1: hcount_cable += 1
+	!if owned_property['village_cottage'] > 1: hcount_cable += 1
+	if owned_property['old_town_apartment'] > 0: hcount_cable += 1
+	if owned_property['matryona_mansion'] > 2: hcount_cable += 1
+	if owned_property['city_house'] = 1: hcount_cable += 1
 end
 
 --- housing ---------------------------------

+ 1 - 1
locations/intro_city_select.qsrc

@@ -1471,7 +1471,7 @@ end
 if $ARGS[0] = 'sg_settings':
 	gm_school[6] = 1
 	sisboyday = -2
-	home_owned[1] = 0
+	gs 'homes_properties', 'set_ownership', 'city_apartment', 0
 	cltarelka = 0
 	fairy = 0
 	eda = 0

+ 3 - 2
locations/intro_initialization_city.qsrc

@@ -79,8 +79,9 @@ if ((month * 100) + day) < pcs_dob mod 10000: age -= 1
 
 !! apartment access and two months of rent paid
 if mid($start_type,1,4) = 'city':
-	ArendHouseSL += 61
-	home_owned[1] = 1
+	gs 'homes_properties', 'set_ownership', 'city_apartment', 1
+	gs 'homes_properties', 'set_home', 'city_apartment', 1
+	gs 'homes_properties', 'set_rent_days', 'city_apartment', 61
 end
 
 vidage = age - 1

+ 2 - 2
locations/intro_sg_select.qsrc

@@ -76,7 +76,7 @@ if $ARGS[0] = 'start':
 
 	$pcs_dna = func('dna','generate',$npc_dna['A29'],$npc_dna['A35'])
 
-	home_owned[2] = 1
+	gs 'homes_properties', 'set_ownership', 'parents_home', 4
 	gs 'homes_properties', 'set_home', 'parents_home'
 
 	killvar 'class_list_institution'
@@ -1665,7 +1665,7 @@ end
 if $ARGS[0] = 'sg_settings':
 	gm_school[6] = 1
 	sisboyday = -2
-	home_owned[1] = 0
+	gs 'homes_properties', 'set_ownership', 'city_apartment', 0
 	cltarelka = 0
 	fairy = 0
 	eda = 0

+ 1 - 1
locations/intro_sg_tg.qsrc

@@ -179,7 +179,7 @@ if $ARGS[0] = 'settings':
 
 	npc_rel['A25'] -= 5
 
-	home_owned[2] = 1
+	gs 'homes_properties', 'set_ownership', 'parents_home', 4
 	gs 'homes_properties', 'set_home', 'parents_home'
 
 	pcs_eyesize = 3

+ 2 - 1
locations/intro_uni.qsrc

@@ -92,7 +92,8 @@ if $ARGS[0] = 'degree_choice':
 	university['prep_enrolled'] = 0
 	university['student'] = 1
 	university['enrolled_in_semester'] = 1
-	home_owned[11] = 1
+	
+	gs 'homes_properties', 'set_wnership', 'university_dorm', 4 
 	gs 'homes_properties', 'set_home', 'university_dorm'
 	*clr & cla
 	'<center><img <<$set_imgh>> src="images/system/1_openings/6_uni/degree_choice.jpg"></center>'

+ 12 - 11
locations/journal.qsrc

@@ -80,18 +80,19 @@ if $ARGS[0] = 'housingtab':
 
 	'<center><h2>Housing</h2></center>'
 	*nl
+	constructionstatus = func('homes_properties', 'property_construction_status', 'matryona_mansion')
 	if pavSharedAptEnabled = 1:'You share an apartment with three others in Pavlovsk. Your bills are paid by the other tenants in exchange for your house services'
-	if home_owned[1] = 1:'You rent a two room apartment in the city residential area. Your rent for the apartment is subtracted automatically in sum of <<home_rent[1]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL>></b> days'
-	if home_owned[1] = 2:'You own a two room apartment in the city residential area. Your utility bills are due on the 25th of each month.'
-	if home_owned[1] = 3:'You own a two room apartment in the city residential area. It''s currently occupied by your tenants.'
-	if home_owned[2] > 0:'You live with your parents and siblings in a two room apartment in Pavlovsk.'
-	if home_owned[3] > 0:'You own a small holiday cottage with an adjacent allotment in the communal village.'
-	if home_owned[4] > 0:'You rent a two room apartment in Pushkin. Your rent for the apartment is subtracted automatically in the sum of <<home_rent[4]>> <b>₽</b> us electric bill on the 25th of each month. You are currently paid up for <b><<ArendHouseSL4>></b> days'
-	if home_owned[5] = 1:'You own a vacant block in the city suburbs. Your utility bills are due on the 25th of each month.'
-	if home_owned[5] = 2:'You own a plot of land in the city suburbs upon which you are building a house. Your utility bills are due on the 25th of each month.'
-	if home_owned[5] = 3:'You own an impressive mansion in the city suburbs. Your utility bills are due on the 25th of each month.'
-	if home_owned[15] = 1:'You own a nice house on the edge of the city residential district. Your utility bills are due on the 25th of each month.'
-	if home_owned[16] = 1:'You live with Vicky, Katja and Tamara Meynold. You have your own room and get an allowance based on helping out around the house and/or studying with Tamara.'
+	if owned_property['city_apartment'] = 1:'You rent a two room apartment in the city residential area. Your rent for the apartment is subtracted automatically in sum of <<home_rent[1]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL>></b> days'
+	if owned_property['city_apartment'] = 2:'You own a two room apartment in the city residential area. Your utility bills are due on the 25th of each month.'
+	if owned_property['city_apartment'] = 3:'You own a two room apartment in the city residential area. It''s currently occupied by your tenants.'
+	if owned_property['parents_home'] = 4:'You live with your parents and siblings in a two room apartment in Pavlovsk.'
+	if owned_property['village_cottage']= 2 :'You own a small holiday cottage with an adjacent allotment in the communal village.'
+	if owned_property['old_town_apartment'] = 1:'You rent a two room apartment in Pushkin. Your rent for the apartment is subtracted automatically in the sum of <<home_rent[4]>> <b>₽</b> us electric bill on the 25th of each month. You are currently paid up for <b><<ArendHouseSL4>></b> days'
+	if owned_property['matryona_mansion'] = 2 and constructionstatus = 0:'You own a vacant block in the city suburbs. Your utility bills are due on the 25th of each month.'
+	if owned_property['matryona_mansion'] = 2 and constructionstatus = 1:'You own a plot of land in the city suburbs upon which you are building a house. Your utility bills are due on the 25th of each month.'
+	if owned_property['matryona_mansion'] = 2 and constructionstatus = 2:'You own an impressive mansion in the city suburbs. Your utility bills are due on the 25th of each month.'
+	if owned_property['city_house'] = 2:'You own a nice house on the edge of the city residential district. Your utility bills are due on the 25th of each month.'
+	if owned_property['meynold_household'] = 4:'You live with Vicky, Katja and Tamara Meynold. You have your own room and get an allowance based on helping out around the house and/or studying with Tamara.'
 	*nl
 	if car > 0:
 		'<center><h2>Car</h2></center>'

+ 1 - 1
locations/korrPar.qsrc

@@ -356,7 +356,7 @@ if hour >= 16 and hour <= 20 and locat['Fam_inGad'] = 0:
 				schoolPredupr = 3
 				npc_rel['A29'] = 0
 				SchoolBlock = 1
-				home_owned[2] = 0
+				gs 'homes_properties', 'set_ownership', 'parents_home', 0
 				schoolprogul = 0
 				gs 'grades', 'grade_award', 'school', 'math', -100
 				gs 'grades', 'grade_award', 'school', 'rus', -100

+ 1 - 1
locations/liames.qsrc

@@ -57,7 +57,7 @@ else
 	'The old theatre that houses a burlesque club is closed now. It is open every day 18:00 - 23:00'
 end
 
-if home_owned[4] = 1: act '<b>Go home</b>':gt'korr2x'
+if owned_property['old_town_apartment'] = 1: act '<b>Go home</b>':gt'korr2x'
 
 act 'Walk to the Town Center (0:05)':minut += 5 & gt 'liam'
 

+ 1 - 1
locations/lug.qsrc

@@ -32,7 +32,7 @@ if $ARGS[0] = 'start':
 	end
 
 
-	if pavserhom = 0 and psiha = 0 and home_owned[1] = 0:
+	if pavserhom = 0 and psiha = 0 and owned_property['city_apartment'] = 0:
 		temp = RAND(1,100)
 		if temp >= 90:
 			pcs_horny += 20

+ 2 - 2
locations/mey_home.qsrc

@@ -130,7 +130,7 @@ if $ARGS[0] = 'start':
 	act 'Vicky''s room': gt 'mey_home', '6'
 	act 'Tamara Meynold''s room': gt 'mey_home', '7'
 	act 'Garden': gt 'mey_home', '8'
-	if $home['current'] ! $home_name and home_owned[16] = 1:
+	if $home['current'] ! $home_name and owned_property['meynold_household'] = 4:
 		act 'Set this household as your main home':gs 'homes_properties', 'set_home', $home_name & gt 'mey_home', 'start'
 	end
 
@@ -234,7 +234,7 @@ if $ARGS[0] = '3':
 
 	!! Computer and internet use.
 	if komp = 1:
-		!! TODO: for now, if Sveta is at the Meynolds' she can't use their internet for porn and camshows. 
+		!! TODO: for now, if Sveta is at the Meynolds'' she can''t use their internet for porn and camshows. 
 		!! Need an agreement on the final options with everyone
 		gs 'internet_mobile', 'set_access', 'free', 'noporn', 'nocamshow'
 		'Your <a href="exec:gt ''Komp'',''start''">laptop</a> is on the desk.'

+ 2 - 2
locations/mey_vika_events.qsrc

@@ -1133,7 +1133,7 @@ if $ARGS[0] = 'learning0':
 							act 'Go into the hall':
 								*clr & cla
 								mey_vika['mey_vika_qw'] = 35
-								home_owned[16] = 1
+								gs 'homes_properties', 'set_ownership', 'meynold_household', 4
 								'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/girl/vicky/event/learning4.jpg"></center>'
 								'You sniff and unassumingly, still wiping your wet eyes, you follow aunt Tamara, mentally preparing for the worst.'
 								'As soon as you enter the room, Vicky stands up and hugs you. She makes you sit next to her.'
@@ -1163,7 +1163,7 @@ if $ARGS[0] = 'learning0':
 							act 'Cry from shame and resentment':
 								*clr & cla
 								mey_vika['mey_vika_qw'] = 35
-								home_owned[16] = 1
+								gs 'homes_properties', 'set_ownership', 'meynold_household', 4
 								'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/girl/vicky/event/learning4.jpg"></center>'
 								'As Tamara gets up you break out in tears again.'
 								'"B-But... They''ll be mad at me!..." You start sobbing again. "I can''t face them after this."'

+ 1 - 1
locations/mother.qsrc

@@ -1370,7 +1370,7 @@ if $ARGS[0] = 'pregreactstepdad':
 end
 
 if $ARGS[0] = 'kickedout':
-	home_owned[2] = 0
+	gs 'homes_properties', 'set_ownership', 'parents_home', 0
 	minut += 15
 	gs 'stat'
 	if $ARGS[1] = 'kolka':

+ 63 - 109
locations/music_actions.qsrc

@@ -2,7 +2,6 @@
 
 if $ARGS[0] = 'start': 
     if ml_not_alone = 0: gs 'music_actions', 'willpower_cost'
-    ml_time_left = ml_performance['max_perform_minutes']-ml_performance['performed_minutes']
 
     if $access['subscription'] = '':
         !! Create an access for online things
@@ -29,35 +28,12 @@ if $ARGS[0] = 'start':
         gs 'music_actions', 'put_down_pick_up'
         if hour > 8 and hour < 22 and alko < 5:
             gs 'music_actions', 'play_something'
-            if  ml_time_left >= 15: 
-                gs 'music_actions', 'practice_guitar'
-            else
-                'Your hands and your brain is too tired from playing to practice today.'
-            end
-            if ml_time_left >= 30: 
-                if pcs_perform > 35 and (instrmusic_lvl >15 or vokal_lvl > 15) and ml_activities['playsets'] = 1: gs 'music_actions', 'rehearse_sets'
-                !! TODO: Find some way to remove this type of check from the music_action location, and keep them in the 
-                !! original location. 
-                !! Maybe a gs that sets a 'can record/stream' flag. 
-                if ml_not_alone = 0:
-                    if internet > 0 and ml_online['account'] = 1 and ml_streaming['lastday'] ! daystart and ml_activities['streaming'] = 1: 
-                        gs 'music_actions', 'stream_music'
-                    elseif internet = 0 and ml_online['account'] = 1: 
-                        'You could stream your music, but you have no internet time left on your account.'
-                    end
-                    ml_activities['recordig'] = 1: gs 'music_actions', 'record_music'
-                else    
-                    'You are not alone in the room, which makes recording or streaming in peace impossible.'
-                end 
-            else
-                'Your hands and your brain is too tired from playing to stream or record anything today.'
+            gs 'music_actions', 'practice_guitar'
+            if pcs_perform > 35 and (instrmusic_lvl >15 or vokal_lvl > 15): gs 'music_actions', 'rehearse_sets'
+            if ml_not_alone = 0 :
+                if $access ! 'denied' and ml_online['account'] = 1 and ml_streaming['lastday'] ! daystart: gs 'music_actions', 'stream_music'
+                gs 'music_actions', 'record_music'
             end
-        elseif hour > 8 and hour < 22 and alko >= 5:
-            'You are too drunk to stream or record music without messing up or throwing up into your guitar.'
-        elseif hour < 8:
-            'It''s too early to do anything noisy like playing the guitar or singing.'
-        else
-            'It''s too late to do anything noisy like playing the guitar or singing.'
         end
     !! $location_type = ''public_outdoors'' means parks, streets. Some event types can be placed in these locations : playing music, recording music - e.g in front of
     !! the library, or at the church, etc. 
@@ -68,28 +44,22 @@ if $ARGS[0] = 'start':
         !!       the mood of Sveta.
         !!       Need to check for the weather, if it's raining, freezing, etc. nothing can be done outside (at least for now.)
         gs 'music_actions', 'play_something'
-        
-        if ml_time_left > 5: gs 'music_actions', 'practice_guitar'
-        if ml_time_left >= 30: 
-            if pcs_perform > 35 and (instrmusic_lvl >15 or vokal_lvl > 15) and ml_activities['setlist'] = 1: gs 'music_actions', 'rehearse_gig'
-            if ml_activities['busking'] = 1: gs 'music_actions', 'busking'
-            if internet > 0 and ml_online['account'] = 1 and ml_streaming['lastday'] ! daystart and ml_activities['streaming']: gs 'music_actions', 'stream_music'
-            !! if this is done outdoors, any editing, mixing must be dones at home. So 'Record and edit' is not available outdoors.
-            !! Although more accurate would be to check whether Sveta is at home or not, and if she is not home then that option won't be available.
-            if ml_activities['recording'] = 1: gs 'music_actions', 'record_music'
-        end        
-	end
+        gs 'music_actions', 'practice_guitar'
+        gs 'music_actions', 'rehearse_gig'
+        if $access ! 'denied' and ml_online['account'] = 1 and ml_streaming['lastday'] ! daystart: gs 'music_actions', 'stream_music'
 
-    if ml_activities['recording']: 
-        gs 'music_actions', 'set_up_account'
-        gs 'music_actions', 'upload_music'
-        gs 'music_actions', 'delete_music'
-    end
+        !! if this is done outdoors, any editing, mixing must be dones at home. So 'Record and edit' is not available outdoors.
+        !! Although more accurate would be to check whether Sveta is at home or not, and if she is not home then that option won't be available.
+        gs 'music_actions', 'record_music'
+	end
 
+    gs 'music_actions', 'set_up_account'
+    gs 'music_actions', 'upload_music'
+    gs 'music_actions', 'delete_music'
+    
     killvar 'ml_willcost'
     killvar 'ml_not_alone'
     killvar 'ml_no_music'
-    killvar 'ml_time_left'
 end
 
 if $ARGS[0] = 'put_down_pick_up':
@@ -113,7 +83,6 @@ if $ARGS[0] = 'play_something':
         if  ml_not_alone = 0 or ml_willcost = 0:
             !! TODO: This should be a new screen with some video or image or something
             act 'Play something on the guitar':
-                *clr & cla	
                 pcs_mood += 10
                 minut += 10
                 gs 'stat'
@@ -123,7 +92,6 @@ if $ARGS[0] = 'play_something':
             end
         elseif ml_willcost  <= pcs_willpwr:
             act 'Play something on the guitar (<<will_cost>> Willpower)':
-                *clr & cla	
                 inhib_exp += rand(1,2)
                 gs 'willpower', 'pay', 'self'
                 gs 'stat'
@@ -140,7 +108,6 @@ if $ARGS[0] = 'play_something':
     end
     if  ml_not_alone = 0 or ml_willcost = 0:
         act 'Sing something':
-            *clr & cla	
             pcs_mood += 10
             minut += 10
             gs 'stat'
@@ -150,7 +117,6 @@ if $ARGS[0] = 'play_something':
         end
     elseif ml_willcost  <= pcs_willpwr:
         act 'Sing something (<<will_cost>> Willpower)':
-            *clr & cla	
             inhib_exp += rand(1,2)
             gs 'willpower', 'pay', 'self'
             gs 'stat'
@@ -169,7 +135,7 @@ end
 
 !! NOTE: Having a guitar really matters here
 if $ARGS[0] = 'practice_guitar':
-    if ml_guitar['hasguitar'] = 1 and (ml_guitar['carried'] = 1 or $ml_guitar['location'] = $loc) and (ml_guitar['chordbook'] = 1 or ml_guitarlesson['lessoncount'] > 0):
+    if ml_guitar['hasguitar'] = 1 and (ml_guitar['carried'] = 1 or $ml_guitar['location'] = $loc) and (ml_guitar['chordbook'] = 1 or ml_guitarlesson['lessoncount'] > 0) and (ml_performance['performed_minutes'] < ml_performance['max_perform_minutes'] ):
         !! This is already checked at the beginning.
         if  ml_not_alone = 0 or ml_willcost = 0:
             act 'Practice guitar': gt 'music_bedroomPractice', 'guitar'
@@ -189,17 +155,19 @@ end
 !! TODO: How to differentiate between guitar based and vocal sets? It is possible to rehearse just the singing part of a set, but obviously has to 
 !! practice the guitar parts too.
 if $ARGS[0] = 'rehearse_sets':
-    if  ml_not_alone = 0 or ml_willcost = 0:
-        act 'Rehearse your sets (30 minutes)': gt 'music_bedroompractice', 'rehearse'
-    elseif ml_willcost <= pcs_willpwr:
-        act 'Rehearse your sets (30 minutes) (<<will_cost>> Willpower)':
-            inhib_exp += rand(1,2)
-            gs 'willpower', 'pay', 'self'
-            gs 'stat'
-            gt 'music_bedroompractice', 'rehearse'
+    if  ml_performance['performed_minutes'] < ml_performance['max_perform_minutes']:
+        if  ml_not_alone = 0 or ml_willcost = 0:
+            act 'Live stream (30 minutes)': gt 'music_bedroompractice', 'rehearse'
+        elseif ml_willcost <= pcs_willpwr:
+            act 'Rehearse your sets (30 minutes) (<<will_cost>> Willpower)':
+                inhib_exp += rand(1,2)
+                gs 'willpower', 'pay', 'self'
+                gs 'stat'
+                gt 'music_bedroompractice', 'rehearse'
+            end
+        else
+            act 'Rehearse your sets (30 minutes) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
         end
-    else
-        act 'Rehearse your sets (30 minutes) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
     end
 end
 
@@ -208,18 +176,23 @@ if $ARGS[0] = 'stream_music':
     !! Streaming music
     !! NOTE: The check for guitar is done in the 'liveStream', without a guitar Sveta will sing
     !! TODO: Some other checks to be added maybe, if she is not 
-    ml_streamtime =  min((ml_performance['max_perform_minutes']-ml_performance['performed_minutes']), 60)
-    if ml_willcost = 0:
-        act 'Live stream (<<ml_streamtime>> minutes)': gt 'music_onlinemusic', 'liveStream'
-    elseif ml_willcost  <= pcs_willpwr:
-        act 'Live stream (<<ml_streamtime>> minutes) (<<will_cost>> Willpower)':
-            inhib_exp += rand(1,3)
-            gs 'willpower', 'pay', 'self'
-            gs 'stat'
-            gt 'music_onlinemusic', 'liveStream'
+    if ml_performance['performed_minutes'] < ml_performance['max_perform_minutes'] and ml_performance['max_perform_minutes'] >= 15:
+        
+        max_stream_time = iif($access['type'] = 2, subscription[$access['subscription']], 60)
+        ml_streamtime =  min((ml_performance['max_perform_minutes']-ml_performance['performed_minutes']), max_stream_time)
+        
+        if ml_willcost = 0:
+            act 'Live stream (<<ml_streamtime>> minutes)': gt 'music_onlinemusic', 'liveStream'
+        elseif ml_willcost  <= pcs_willpwr:
+            act 'Live stream (<<ml_streamtime>> minutes) (<<will_cost>> Willpower)':
+                inhib_exp += rand(1,3)
+                gs 'willpower', 'pay', 'self'
+                gs 'stat'
+                gt 'music_onlinemusic', 'liveStream'
+            end
+        else
+            act 'Live stream (<<ml_streamtime>> minutes) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
         end
-    else
-        act 'Live stream (<<ml_streamtime>> minutes) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
     end
 end
 
@@ -231,49 +204,30 @@ end
 !! click a hundred times to do something. Boring.  
 if $ARGS[0] = 'record_music':
     !! Recording music
-    if ml_willcost = 0:
-        act 'Record a song with your phone': gt 'music_onlinemusic', 'recordSong'
-        if komp = 1 and webcamera = 1 and ml_studio['scarlet-3rd-gen'] = 1:
-            act 'Record and edit a song': gt 'music_onlinemusic', 'recordAndEditSong'
-        end
-    elseif ml_willcost  <= pcs_willpwr:
-        act 'Record a song with your phone (<<will_cost>> Willpower)':
-            inhib_exp += rand(1,2)
-            gs 'willpower', 'pay', 'self'
-            gs 'stat'
-            gt 'music_onlinemusic', 'recordSong'
-        end
-        if komp = 1 and webcamera = 1 and ml_studio['scarlet-3rd-gen'] = 1:
-            act 'Record and edit a song (<<will_cost>> Willpower)':
+    if ml_performance['performed_minutes'] < ml_performance['max_perform_minutes']:
+        if ml_willcost = 0:
+            act 'Record a song with your phone': gt 'music_onlinemusic', 'recordSong'
+            if komp = 1 and webcamera = 1 and ml_studio['scarlet-3rd-gen'] = 1:
+                act 'Record and edit a song': gt 'music_onlinemusic', 'recordAndEditSong'
+            end
+        elseif ml_willcost  <= pcs_willpwr:
+            act 'Record a song with your phone (<<will_cost>> Willpower)':
                 inhib_exp += rand(1,2)
                 gs 'willpower', 'pay', 'self'
                 gs 'stat'
-                gt 'music_onlinemusic', 'recordAndEditSong'
+                gt 'music_onlinemusic', 'recordSong'
             end
-        end
-    else
-        act 'Record a song (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-        act 'Record and edit a song (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-    end
-end
-
-
-if $ARGS[0] = 'busking':
-    if hour >= 8 and hour <= 20 and sunWeather = 1 and temper >= 15 and ml_guitar['carried'] = 1:
-        *nl
-        'With the weather being pleasant and sunny, there are groups of people moving around the streets. You could play some music, practice performing songs and maybe make some money too.'
-        ml_buskingtime =  min((ml_performance['max_perform_minutes']-ml_performance['performed_minutes']), 60)
-        if ml_willcost = 0:
-             act 'Start busking (<<ml_buskingtime>> minutes)': gs 'music_buskingevents', 'busking', 'city'
-        elseif ml_willcost <= pcs_willpwr:
-            act 'Start busking (<<ml_buskingtime>> minutes) (<<will_cost>> Willpower)':
-                inhib_exp += rand(1,3)
-                gs 'willpower', 'pay', 'self'
-                gs 'stat'
-                gs 'music_buskingevents', 'busking'
+            if komp = 1 and webcamera = 1 and ml_studio['scarlet-3rd-gen'] = 1:
+                act 'Record and edit a song (<<will_cost>> Willpower)':
+                    inhib_exp += rand(1,2)
+                    gs 'willpower', 'pay', 'self'
+                    gs 'stat'
+                    gt 'music_onlinemusic', 'recordAndEditSong'
+                end
             end
         else
-            act 'Start busking (<<ml_buskingtime>> minutes) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
+            act 'Record a song (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
+            act 'Record and edit a song (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
         end
     end
 end

+ 4 - 4
locations/music_buskingevents.qsrc

@@ -64,7 +64,7 @@ if $ARGS[0] = 'anushka':
 	menu_off = 1
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/pc/activities/music/guitarf'+ rand(1,2) +'.jpg"></center>'
-	if pcs_instrmusic > 80
+	if pcs_instrmusic > 80:
 		gs 'npc_relationship', 'modify', 'A144', 'love'
 		if npc_rel['A144'] > 50:
 			'As you stop playing and get ready to pack up you spot Anushka standing not far from you, watching you quietly.'
@@ -75,7 +75,7 @@ if $ARGS[0] = 'anushka':
 		else
 			'You start to drift loosing yourself in the music. You glance up looking at the people passing by, several leaving rubles in your case. You see some movement that attracts your attention and you see Anushka standing on the street watching you play. She seems to have a look of surprise as she bobs her head slightly to the music. You know she doesn''t really like you but maybe she at least respects your ability. When she sees you looking at her and disappears into the crowd.'
 		end
-	elseif pcs_instrmusic > 60
+	elseif pcs_instrmusic > 60:
 		gs 'npc_relationship', 'modify', 'A144', 'like'
 		if npc_rel['A144'] > 50:
 			'As you stop playing and get ready to pack up you spot Anushka standing not far from you, watching you quietly.'
@@ -86,7 +86,7 @@ if $ARGS[0] = 'anushka':
 		else
 			'You start to drift loosing yourself in the music. You glance up looking at the people passing by, some leaving rubles in your case. You see some movement that attracts your attention and you see Anushka standing on the street watching you play. She seems to have a look of mild surprise and respect? You know she doesn''t really like you but maybe she at least respects your ability. When she sees you looking at her and disappears into the crowd.'
 		end
-	elseif pcs_instrmusic > 40
+	elseif pcs_instrmusic > 40:
 		gs 'npc_relationship', 'modify', 'A144', 'like'
 		if npc_rel['A144'] > 50:
 			'As you stop playing and get ready to pack up you spot Anushka standing not far from you, watching you quietly.'
@@ -97,7 +97,7 @@ if $ARGS[0] = 'anushka':
 		else
 			'You start to drift loosing yourself in the music. You glance up looking at the people passing by, some leaving rubles in your case. You see some movement that attracts your attention and you see Anushka standing on the street watching you play. She seems to have a look of mild surprise and maybe even mild approval? You know she doesn''t really like you but maybe she at least respects your ability. When she sees you looking at her and disappears into the crowd.'
 		end
-	elseif pcs_instrmusic > 20
+	elseif pcs_instrmusic > 20:
 		if npc_rel['A144'] > 50:
 			'As you stop playing and get ready to pack up you spot Anushka standing not far from you, watching you quietly.'
 			'As she notices that you saw her, she smiles and walks over. "Not bad, not bad <<$pcs_nickname>> I''ve heard better, but have heard worse too. You should come over sometime and we can play together, I can teach you a few things if you like." The two of you talk for a few minutes about music, before she says she needs to get going. She walks away with a smile and a wave.'

+ 1 - 1
locations/nichBedroomServant.qsrc

@@ -30,7 +30,7 @@ if $ARGS[0] = '' or $ARGS[0] = 'start' or $ARGS[0] = 'return':
 	'Your bedroom is fairly large, considering you''re only an employee. There is a small <a href="exec:gt ''bed'', ''start''">double bed</a> and an <a href="exec:gt ''budilnik'', ''start''">alarm clock</a>.'
 	'Half a wall is taken up by an expensive-looking <a href="exec:gt ''wardrobe'', ''start''">wardrobe</a> (where you can choose outfits and organize your clothing). There''s a make-up table with a <a href="exec:gt ''mirror'', ''start''">mirror</a> next to it.'
 	if komp = 1:
-		!! TODO: Sveta can't do camshows from this place - unless Gala makes her at some point, but unlikely.
+		!! TODO: Sveta can''t do camshows from this place - unless Gala makes her at some point, but unlikely.
 		gs 'internet_mobile', 'set_access', 'free', 'nocamshow'
 		$komp = ' with your <a href="exec:gt ''Komp'', ''start''">laptop</a>.'
 	else

+ 2 - 2
locations/nichUtil.qsrc

@@ -323,7 +323,7 @@ elseif $ARGS[0] = 'fired':
 	'It takes you a few moments to process what just happened:'
 	'You have just been fired. And kind of lost your home, too.'
 	
-	home_owned[7] = 0
+	gs 'homes_properties', 'set_ownership', 'maid_bedroom', 0
 	
 	nichWork = 4
 	work = 0
@@ -335,7 +335,7 @@ end
 
 !! initializes variables when hired, might mess everything up if called at any other time
 if $ARGS[0] = 'hired':
-	home_owned[7] = 1
+	gs 'homes_properties', 'set_ownership', 'maid_bedroom', 4
 
 	nichWork = 2
 	nichWorkState = 0

+ 55 - 52
locations/obj_din.qsrc

@@ -229,7 +229,7 @@ if $ARGS[0] = 'description':
 	end
 	!!!
 
-	if ARRSIZE('home_owned') = 0:
+	if func('homes_properties', 'get_accessible_count') = 0:
 		'You have nowhere to live, if this is an error set your current home <a href="exec:gs ''obj_din'', <<$home[''current'']>>">here</a>.'
 	else
 		'Your current home is <a href="exec:gs ''obj_din'', <<$home[''current'']>>"><<$home[''name'']>></a>.'
@@ -355,22 +355,22 @@ if $ARGS[0] = 'curr_home':
 	*nl
 	act 'Return to main description': gt 'obj_din', 'description'	
 !!This is correct it just looks wrong
-	if home_owned[1] > 0: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''city_apartment'' & gs ''obj_din'', <<$home[''current'']>>">City residential apartment</a>'
-	if home_owned[2] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''parents_home'' & gs ''obj_din'', <<$home[''current'']>>">Parent''s home in Pavlovsk</a>'
-	if home_owned[3] > 0: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''village_cottage'' & gs ''obj_din'', <<$home[''current'']>>">My cottage in the cooperative farm</a>'
-	if home_owned[4] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''old_town_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Old town apartment</a>'
-	if home_owned[5] > 2: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''matryona_mansion'' & gs ''obj_din'', <<$home[''current'']>>">Matryona mansion</a>'
-	if home_owned[6] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''pavlovsk_hotel'' & gs ''obj_din'', <<$home[''current'']>>">My hotel room in Pavlovsk</a>'
-	if home_owned[7] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''maid_bedroom'' & gs ''obj_din'', <<$home[''current'']>>">Nicholas'' apartment</a>'
-	if home_owned[8] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''nikos_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Niko''s apartment</a>'
-	if home_owned[9] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''sergeys_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Uncle Sergey''s apartment</a>'
-	if home_owned[10] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''lyceum_dorm'' & gs ''obj_din'', <<$home[''current'']>>">Lyceum school</a>'
-	if home_owned[11] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''university_dorm'' & gs ''obj_din'', <<$home[''current'']>>">University halls</a>'
-	if home_owned[12] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''hunters_lodge'' & gs ''obj_din'', <<$home[''current'']>>">Hunter''s lodge in Gadukino</a>'
-	if home_owned[13] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''shared_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Shared apartment in Pavlovsk</a>'
-	if home_owned[14] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''grandparents_house'' & gs ''obj_din'', <<$home[''current'']>>">Grandparent''s house in Gadukino</a>'
-	if home_owned[15] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''city_house'' & gs ''obj_din'', <<$home[''current'']>>">My house in the City residential district</a>'
-	if home_owned[16] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''meynold_household'' & gs ''obj_din'', <<$home[''current'']>>">Meynold Houshold</a>'
+	if owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''city_apartment'' & gs ''obj_din'', <<$home[''current'']>>">City residential apartment</a>'
+	if owned_property['parents_home'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''parents_home'' & gs ''obj_din'', <<$home[''current'']>>">Parent''s home in Pavlovsk</a>'
+	if owned_property['village_cottage'] = 2: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''village_cottage'' & gs ''obj_din'', <<$home[''current'']>>">My cottage in the cooperative farm</a>'
+	if owned_property['old_town_apartment'] = 1: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''old_town_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Old town apartment</a>'
+	if owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''matryona_mansion'' & gs ''obj_din'', <<$home[''current'']>>">Matryona mansion</a>'
+	if owned_property['pavlovsk_hotel'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''pavlovsk_hotel'' & gs ''obj_din'', <<$home[''current'']>>">My hotel room in Pavlovsk</a>'
+	if owned_property['maid_bedroom'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''maid_bedroom'' & gs ''obj_din'', <<$home[''current'']>>">Nicholas'' apartment</a>'
+	if owned_property['nikos_apartment'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''nikos_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Niko''s apartment</a>'
+	if owned_property['sergeys_apartment'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''sergeys_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Uncle Sergey''s apartment</a>'
+	if owned_property['lyceum_dorm'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''lyceum_dorm'' & gs ''obj_din'', <<$home[''current'']>>">Lyceum school</a>'
+	if owned_property['university_dorm'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''university_dorm'' & gs ''obj_din'', <<$home[''current'']>>">University halls</a>'
+	if owned_property['hunters_lodge'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''hunters_lodge'' & gs ''obj_din'', <<$home[''current'']>>">Hunter''s lodge in Gadukino</a>'
+	if owned_property['shared_apartment'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''shared_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Shared apartment in Pavlovsk</a>'
+	if owned_property['grandparents_house'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''grandparents_house'' & gs ''obj_din'', <<$home[''current'']>>">Grandparent''s house in Gadukino</a>'
+	if owned_property['city_house'] = 2: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''city_house'' & gs ''obj_din'', <<$home[''current'']>>">My house in the City residential district</a>'
+	if owned_property['meynold_household'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''meynold_household'' & gs ''obj_din'', <<$home[''current'']>>">Meynold Houshold</a>'
 	
 !!Apostrophe colour correction - KS ''''
 	'</td></tr></table></center>'
@@ -558,68 +558,71 @@ if $ARGS[0] = 'stats':
 		if schoolprogul > 0: 'School absenteeism - <<schoolprogul>> days'
 	end
 	*nl
-
-	if (home_owned[1] = 1 and ArendHouseSL > 0) or (home_owned[4] > 0 and ArendHouseSL4 > 0):
+	
+	if (owned_property['city_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'city_apartment') > 0) or (owned_property['old_town_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'old_town_apartment') > 0):
 			*nl
-		if home_owned[1] = 1 and home_owned[4] > 0:
-			'You have rented an apartment in the city residential area, which is paid up for <b><<ArendHouseSL>></b> days, and you also have an apartment in Pushkin, which is paid up for <b><<ArendHouseSL4>></b> days. Utilities are due on the 25th of <<$month>>.'
-		elseif home_owned[1] = 1:
-			'You have rented an apartment in the city residential area, and you''re paid up for <<ArendHouseSL>> days. Utilities are due on the 25th of <<$month>>.'
-		elseif home_owned[4] > 0:
-			'You have rented an apartment in Pushkin, and you''re paid up for <<ArendHouseSL4>> days. Utilities are due on the 25th of <<$month>>.'
-		end
-		if home_owned[1] = 1:
-			if karta >= home_rent[1] or money >= home_rent[1] or money + stolmoney >= home_rent[1] or karta + bankDebtLimit >= home_rent[1]:
+		if owned_property['city_apartment'] = 1 and owned_property['old_town_apartment'] =1:
+			'You have rented an apartment in the city residential area, which is paid up for <b><<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>></b> days, and you also have an apartment in Pushkin, which is paid up for <b><<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>></b> days. Utilities are due on the 25th of <<$month>>.'
+		elseif owned_property['city_apartment'] = 1:
+			'You have rented an apartment in the city residential area, and you''re paid up for <<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>> days. Utilities are due on the 25th of <<$month>>.'
+		elseif owned_property['old_town_apartment'] > 0:
+			'You have rented an apartment in Pushkin, and you''re paid up for <<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>> days. Utilities are due on the 25th of <<$month>>.'
+		end
+		if owned_property['city_apartment'] = 1:
+			rentdue = func('homes_properties', 'get_rent', 'city_apartment')
+			if karta >= rentdue or money >= rentdue or money + stolmoney >= rentdue or karta + bankDebtLimit >= rentdue:
 				*nl
-				*p 'The monthly rent for your city apartment is <<home_rent[1]>> <b>₽</b>. '
-				if karta >= home_rent[1]:
+				*p 'The monthly rent for your city apartment is <<rentdue>> <b>₽</b>. '
+				if karta >= rentdue:
 					!From bank
-					*p 'You can make an advance <a href="exec:karta -= home_rent[1] & home_owned[1] = 1 & ArendHouseSL += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your bank account.'
-				elseif money >= home_rent[1]:
+					*p 'You can make an advance <a href="exec:karta -=rentdue & gs ''homes_properties'', ''set_ownership'', ''city_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from your bank account.'
+				elseif money >= rentdue:
 					!From cash
-					*p 'You can make an advance <a href="exec:money -= home_rent[1] & home_owned[1] = 1 & ArendHouseSL += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your on-hand cash.'
+					*p 'You can make an advance <a href="exec:money -= rentdue & gs ''homes_properties'', ''set_ownership'', ''city_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from your on-hand cash.'
 					*nl
-				elseif stolmoney >= home_rent[1]:
+				elseif stolmoney >= rentdue:
 					!From drawer
-					*p 'You can make an advance <a href="exec:stolmoney -= home_rent[1] & home_owned[1] = 1 & ArendHouseSL += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from the cash you have in your stash drawer.'
+					*p 'You can make an advance <a href="exec:stolmoney -= rentdue & gs ''homes_properties'', ''set_ownership'', ''city_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from the cash you have in your stash drawer.'
 					*nl
-				elseif money + stolmoney >= home_rent[1]:
+				elseif money + stolmoney >= rentdue:
 					!From cash and drawer
-					*p 'You can make an advance <a href="exec:money -= (home_rent[1] - stolmoney) & stolmoney = 0 & home_owned[1] = 1 & ArendHouseSL += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your on-hand cash and the cash in your stash drawer.'
+					*p 'You can make an advance <a href="exec:money -= (rentdue - stolmoney) & stolmoney = 0 & gs ''homes_properties'', ''set_ownership'', ''city_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from your on-hand cash and the cash in your stash drawer.'
 					*nl
-				elseif karta + bankDebtLimit >= home_rent[1]:
+				elseif karta + bankDebtLimit >= rentdue:
 					!From bank and overdraw
-					*p 'You can make an advance <a href="exec:karta -= home_rent[1] & home_owned[1] = 1 & ArendHouseSL += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your bank account and overdraw facility.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue & gs ''homes_properties'', ''set_ownership'', ''city_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from your bank account and overdraw facility.'
 					*nl
 				else
 					*p 'You can''t afford to make an advance payment right now, but you should try to have enough money in your account, so you don''t get evicted.'
 					*nl
 				end
 			end
+			killvar 'rentdue'
 		end
-		if home_owned[4] > 0:
-			if karta >= home_rent[4] or money >= home_rent[4] or money + stolmoney >= home_rent[4] or karta + bankDebtLimit >= home_rent[4]:
+		if owned_property['old_town_apartment'] > 0:
+			rentdue = func('homes_properties', 'get_rent', 'old_town_apartment')
+			if karta >= rentdue or money >= rentdue or money + stolmoney >= rentdue or karta + bankDebtLimit >= rentdue:
 				*nl
-				*p 'The monthly rent for your Pushkin apartment is <<home_rent[4]>> <b>₽</b>. '
-				if karta >= home_rent[4]:
+				*p 'The monthly rent for your Pushkin apartment is <<rentdue>> <b>₽</b>. '
+				if karta >= rentdue:
 					!From bank
-					*p 'You can make an advance <a href="exec:karta -= home_rent[4] & home_owned[1] = 1 & ArendHouseSL4 += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your bank account.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue &  gs ''homes_properties'', ''set_ownership'', ''old_town_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gs ''$menu_obnovit''">payment</a> from your bank account.'
 					*nl
-				elseif money >= home_rent[4]:
+				elseif money >= rentdue:
 					!From cash
-					*p 'You can make an advance <a href="exec:money -= home_rent[4] & home_owned[1] = 1 & ArendHouseSL4 += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your on-hand cash.'
+					*p 'You can make an advance <a href="exec:money -= rentdue & gs ''homes_properties'', ''set_ownership'', ''old_town_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gs ''$menu_obnovit''">payment</a> from your on-hand cash.'
 					*nl
-				elseif stolmoney >= home_rent[4]:
+				elseif stolmoney >= rentdue:
 					!From drawer
-					*p 'You can make an advance <a href="exec:stolmoney -= home_rent[4] & home_owned[1] = 1 & ArendHouseSL4 += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from the cash you have in your stash drawer.'
+					*p 'You can make an advance <a href="exec:stolmoney -= rentdue & gs ''homes_properties'', ''set_ownership'', ''old_town_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gs ''$menu_obnovit''">payment</a> from the cash you have in your stash drawer.'
 					*nl
-				elseif money + stolmoney >= home_rent[4]:
+				elseif money + stolmoney >= rentdue:
 					!From cash and drawer
-					*p 'You can make an advance <a href="exec:money -= (home_rent[4] - stolmoney) & stolmoney = 0 & home_owned[1] = 1 & ArendHouseSL4 += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your on-hand cash and the cash in your stash drawer.'
+					*p 'You can make an advance <a href="exec:money -= (rentdue - stolmoney) & stolmoney = 0 & gs ''homes_properties'', ''set_ownership'', ''old_town_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gs ''$menu_obnovit''">payment</a> from your on-hand cash and the cash in your stash drawer.'
 					*nl
-				elseif karta + bankDebtLimit >= home_rent[4]:
+				elseif karta + bankDebtLimit >= rentdue:
 					!From bank and overdraw
-					*p 'You can make an advance <a href="exec:karta -= home_rent[4] & home_owned[1] = 1 & ArendHouseSL4 += ArendHouseSL_due & gs ''$menu_obnovit''">payment</a> from your bank account and overdraw facility.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue & gs ''homes_properties'', ''set_ownership'', ''old_town_apartment'', 1 & gs ''homes_properties'', ''add_rent_days'', ''old_town_apartment'' & gs ''$menu_obnovit''">payment</a> from your bank account and overdraw facility.'
 					*nl
 				else
 					*p 'You can''t afford to make an advance payment right now, but you should try to have enough money in your account, so you don''t get evicted.'

+ 1 - 1
locations/parks.qsrc

@@ -37,7 +37,7 @@ if $ARGS[0] = 'start':
 	gs 'park_walkevents', 'run'
 
 	if hour >= 20 or hour < 6 :
-		if home_owned[4] = 0:
+		if owned_property['old_town_apartment'] = 0:
 			!nowhere to live in town
 			'It''s quite dark now, and you have no where to stay nearby. Maybe you should try to sleep on a bench?'
 		else

+ 2 - 2
locations/pav_clinic.qsrc

@@ -119,7 +119,7 @@ if $ARGS[0] = '':
 				if Gspravka < 10 and ginrand = 0:
 					'When you clean the floor of the gynaecologist''s examination room, he leaves the room to let you do your work in peace. You''re alone now.'
 
-					if pcs_vag > 0 and motherKnowSpravka = 0 and home_owned[2] = 1:
+					if pcs_vag > 0 and motherKnowSpravka = 0 and owned_property['parents_home'] = 4:
 						act 'Forge a referral to give to your mother':
 							*clr & cla
 							Gspravka = 30
@@ -696,7 +696,7 @@ if $ARGS[0] = '':
 				end
 			end
 		end
-		if mid($start_type,1,2) = 'sg' and SchoolAtestat = 0 and Gspravka < 3 and motherKnowSpravka = 0 and home_owned[2] = 1: act 'Go to the gynaecologist for a referral': gt 'pav_clinic', 'referral'
+		if mid($start_type,1,2) = 'sg' and SchoolAtestat = 0 and Gspravka < 3 and motherKnowSpravka = 0 and owned_property['parents_home'] = 4: act 'Go to the gynaecologist for a referral': gt 'pav_clinic', 'referral'
 	else
 		'The clinic is closed. It''s open every day between 06:00 and 21:00.'
 	end

+ 1 - 1
locations/pav_commercial.qsrc

@@ -61,7 +61,7 @@ gs'street_event','pav_commercial', 'extras'
 if ((month = 9 and day > 16) or month >= 10) and (AlbinaQW['StarletsShutDown'] = 0 or AlbinaQW['Chernov'] = 0): 'You can see election posters on the walls all over town. They say: "Vote for Boris Barlovsky!" Wait a minute... isn''t that Albina''s father?'
 if AlbinaQW['StarletsJoined'] > 0 and AlbinaQW['StarletsShutDown'] = 0 and npc_pregtalk['A23'] = 0 and AlbinaQW['Chernov'] = 0 and ((month = 11 and day > 18) or month = 12) and hour >= 14:gt 'albina_election_events', 'start'
 
-if mid($start_type,1,2) = 'sg' and hour < 4 and motherWorry = 0 and SchoolAtestat = 0 and age < 18 and home_owned[2] = 1:
+if mid($start_type,1,2) = 'sg' and hour < 4 and motherWorry = 0 and SchoolAtestat = 0 and age < 18 and owned_property['parents_home'] = 4:
 	motherWorry = 1
 end
 

+ 5 - 5
locations/pav_complex.qsrc

@@ -54,7 +54,7 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if mid($start_type,1,2) = 'sg' and hour < 5 and motherWorry = 0 and SchoolAtestat = 0 and age < 18 and home_owned[2] = 1 and locat['Fam_inGad'] = 0: motherWorry = 1
+	if mid($start_type,1,2) = 'sg' and hour < 5 and motherWorry = 0 and SchoolAtestat = 0 and age < 18 and owned_property['parents_home'] = 4 and locat['Fam_inGad'] = 0: motherWorry = 1
 
 	if ((minut + 60*(hour+daystart*24) - pavcomplexevent_time) > 60) or ((daystart+1)*1440 < pavcomplexevent_time):
 		if hour >= 8 and hour <= 20 and rand (0,2) = 0: 
@@ -78,7 +78,7 @@ if $ARGS[0] = 'start':
 		act 'Join Rex in his car':gt 'rex_events','avto2'
 	end
 
-	'Located in the old part of Pavlovsk, these Soviet era apartment blocks are the Five Eight Estate. Your family''s apartment is on the second floor of the nearest building'+iif(home_owned[2] = 1, '.', ', but you are no longer welcome there.')
+	'Located in the old part of Pavlovsk, these Soviet era apartment blocks are the Five Eight Estate. Your family''s apartment is on the second floor of the nearest building'+iif(owned_property['parents_home'] = 4, '.', ', but you are no longer welcome there.')
 	*nl
 	'Opposite you is a meager courtyard, which has changed over the years to now include a kid''s playground, a basketball court and a small grassy area that''s mostly used to play football.'
 	'A few benches and tables surround it, and there''s a handful of small utility sheds tucked away in the corner for tenants to use if they''re willing to pay for the extra space.'
@@ -137,7 +137,7 @@ if $ARGS[0] = 'start':
 	
 !!	if mid($start_type,1,2) = 'sg': '<br>Nearby, in another block of apartments, there''s an <a href="exec:minut += 3 & gt ''pavComplexOld'',''etaj_1''">old apartment building</a> that looks quite rundown and possibly abandoned.'
 	
-	if home_owned[2] = 1: act '<b>Go Home</b> (Parents'' Apartment)': minut += 4 & pavhome_enter = 1 & gt 'korrPar'
+	if owned_property['parents_home'] = 4: act '<b>Go Home</b> (Parents'' Apartment)': minut += 4 & pavhome_enter = 1 & gt 'korrPar'
 	if pavSharedAptEnabled = 1: act '<b>Go Home</b> (Shared Apartment)': minut += 5 & gt 'pav_shared_apt', 'start'
 	act 'Walk to the Residential area (0:02)':minut += 2 & gt 'pav_residential'
 	act 'Walk to the Commercial area (0:05)':minut += 5 & gt 'pav_commercial'
@@ -145,9 +145,9 @@ if $ARGS[0] = 'start':
 	act 'Walk to the Market (0:15)':minut += 15 & gt 'pav_market'
 	act 'Walk to the train station (0:15)':minut += 15 & gt 'pav_train_hall'
 	act 'Walk to Pushkin (0:30)':minut += 30 & nroad = 19 & gt 'liam'
-	if mid($start_type,1,2) = 'sg' and home_owned[2] = 1: 
+	if mid($start_type,1,2) = 'sg' and owned_property['parents_home'] = 4: 
 		act 'Go to your apartment building':minut += 1 & gt 'pod_ezd', 'etaj_1'
-	elseif mid($start_type,1,2) = 'sg' and (home_owned[2] = 0 or pavSharedAptEnabled = 1):
+	elseif mid($start_type,1,2) = 'sg' and (owned_property['parents_home'] = 0 or pavSharedAptEnabled = 1):
 		act 'Go to your parent''s apartment building':minut += 1 & gt 'pod_ezd', 'etaj_1'
 	end
 !!	if mid($start_type,1,2) = 'sg': act 'Go to the old apartment building':minut += 1 & gt 'pavComplexOld', 'etaj_1'

+ 1 - 1
locations/pav_disco_coolkids.qsrc

@@ -1377,7 +1377,7 @@ if $ARGS[0] = 'katja_walkhome':
 	katjaQW['drunk_help'] = 1
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/disco/school_kids/walkhome_katja.jpg"></center>'
-	if home_owned[2] = 1:
+	if owned_property['parents_home'] = 4:
 		'Katja takes you by the arm and helps you get home.'
 		act 'Go home': gt 'korrPar'
 	else

+ 2 - 2
locations/pav_lake.qsrc

@@ -135,14 +135,14 @@ if month >= 5 and month <= 9:
 			menu_off = 1
 			minut+=5
 			nudelake = rand(1,20)
-			if nudelake <= 3 and home_owned[2] = 1:
+			if nudelake <= 3 and owned_property['parents_home'] = 4:
 				minut += 5
 				pcs_mood -= 5
 				inhib_exp += rand(1,3)
 				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/lake/event/noclothes.jpg"></center>'
 				'You return to the place where put your clothes to get dressed... except you can''t find them. You desperately search the beach for a while, a few passers-by giving you amused stares. Despite your efforts, you can''t find them. You panic and, without thinking, start running home naked.'
 				act 'Run home naked': gt 'pav_lake', 'nude_home'
-			elseif nudelake = 4 and home_owned[2] = 1:
+			elseif nudelake = 4 and owned_property['parents_home'] = 4:
 				minut += 5
 				pcs_mood -= 5
 				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/lake/event/nakedcar.jpg"></center>'

+ 1 - 1
locations/pav_lake_nude.qsrc

@@ -106,7 +106,7 @@ if month >= 5 and month <= 9:
 			gs 'panties', 'wear', $lastwornpantytype['swim'], lastwornpantynumber['swim']
 			gs 'bras', 'wear', $lastwornbratype['swim'], lastwornbranumber['swim']
 			nudelake = rand(1,10)
-			if nudelake <= 2 and home_owned[2] = 1:
+			if nudelake <= 2 and owned_property['parents_home'] = 4:
 				minut += 5
 				pcs_mood -= 5
 				gs 'stat'

+ 2 - 2
locations/pav_park.qsrc

@@ -252,11 +252,11 @@ if $ARGS[0] = 'start':
 	if joint > 0 and jointhigh = 0: act 'Smoke a joint': gs 'drugs', 'joint' & gt $loc, $loc_arg
 
 	if (hour >= 20 or hour < 6) and (pcs_sleep <= 30 or cheatNoSleep ! 0):
-		if home_owned[2] = 0 and workPTU <= 2 and HotelRoom < 1:
+		if owned_property['parents_home'] = 0 and workPTU <= 2 and HotelRoom < 1:
 			!nowhere to live in town
 			'It''s quite dark now, and you have no where to stay nearby. Maybe you should try to sleep on a bench?'
 			if mid($start_type,1,2) = 'sg': 'Or try your luck and go to Uncle Shulgin''s Apartment?'
-		elseif home_owned[2] = 1 and (hour >= 22 or hour < 6):
+		elseif owned_property['parents_home'] = 4 and (hour >= 22 or hour < 6):
 			'It''s quite dark outside, and you feel tired. Maybe you should head home.'
 		else
 			'It''s quite dark now, and you feel tired. Maybe you should try sleeping on a bench?'

+ 8 - 8
locations/pav_shared_apt.qsrc

@@ -268,7 +268,7 @@ if $ARGS[0] = 'start':
 				'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
-				home_owned[13] = 0
+				gs 'homes_properties', 'set_ownership', 'shared_apartment', 0
 			end
 		end
 	end
@@ -309,7 +309,7 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if home_owned[2] = 0 and kid > 0:
+	if owned_property['parents_home'] = 0 and kid > 0:
 		*clr & cla
 		pavIntroStep = 0
 		introDone = 0
@@ -333,7 +333,7 @@ if $ARGS[0] = 'payCash':
 		money -= cash
 		rentPaid = 1
 		pavSharedAptEnabled = 1
-		home_owned[13] = 1
+		gs 'homes_properties', 'set_ownership', 'shared_apartment', 4
 	else
 		'You do not have enough cash to pay for the rest of your rent.'
 	end
@@ -445,9 +445,9 @@ if $ARGS[0] = 'intro':
 		'<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 that you changed your mind about this':pavIntroStep = 40 & gt 'pav_shared_apt', 'intro'
-		act 'Say you will pay the rent the normal way':pavSharedAptEnabled = 1 & home_owned[13] = 1 & pavIntroStep = 10 & gt 'pav_shared_apt', 'intro'
-		act 'Say you don''t mind doing the homekeeping stuff':pavSharedAptEnabled = 1 & home_owned[13] = 1 & pavIntroStep = 20 & gt 'pav_shared_apt', 'intro'
-		act 'Say you don''t mind anything':pavSharedAptEnabled = 1 & home_owned[13] = 1 & pavIntroStep = 30 & gt 'pav_shared_apt', 'intro'
+		act 'Say you will pay the rent the normal way':pavSharedAptEnabled = 1 & gs 'homes_properties', 'set_ownership', 'shared_apartment', 1 & pavIntroStep = 10 & gt 'pav_shared_apt', 'intro'
+		act 'Say you don''t mind doing the homekeeping stuff':pavSharedAptEnabled = 1 & gs 'homes_properties', 'set_ownership', 'shared_apartment', 1 & pavIntroStep = 20 & gt 'pav_shared_apt', 'intro'
+		act 'Say you don''t mind anything':pavSharedAptEnabled = 1 & gs 'homes_properties', 'set_ownership', 'shared_apartment', 1 & pavIntroStep = 30 & gt 'pav_shared_apt', 'intro'
 	elseif pavIntroStep = 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>'
@@ -503,7 +503,7 @@ if $ARGS[0] = 'intro':
 		'<font color=#<<$nd_font>>>"I''m sorry <<$pcs_firstname>>, but we don''t want children or pets in the apartment!"</font>'
 		'<font color=#<<$gp_font>>>"If you get rid of the kid, come back and see us."</font>'
 		'<font color=#<<$sp_font>>>"Don''t mind him. There''s simply not enough room for 4 people, plus kids or pets. I hope you understand"</font>'
-		if home_owned[2] = 1:
+		if owned_property['parents_home'] = 4:
 			act 'Suggest a compromise':
 				cla
 				pavIntroStep = 2
@@ -736,7 +736,7 @@ if $ARGS[0] = 'pcsRoom':
 	*nl
 
 	if komp = 1:
-		!! Sveta can't do camshows unless she is blowing the guys for rent.
+		!! Sveta can''t do camshows unless she is blowing the guys for rent.
 		gs 'internet_mobile', 'set_access', 'free', 'nocamshow'
 		if servitudeLvl = 2: access['nocamshow'] = 0
 		'Your <a href="exec:gorodokKomp = 1 & gt ''Komp'',''start''">laptop</a> is sitting on small table.'

+ 1 - 1
locations/pet_dog.qsrc

@@ -55,7 +55,7 @@ end
 !!--- Activities: Actions ---
 
 if $ARGS[0] = 'activities_normal':
-	if rex['count_feed'] > 0 and hour > (rex['timer_feed'] + 3) and ($home['current'] = 'parents_home' or objects['dog_food'] > 0)):
+	if rex['count_feed'] > 0 and hour > (rex['timer_feed'] + 3) and ($home['current'] = 'parents_home' or objects['dog_food'] > 0):
 		act 'Feed him (0:03)': gt 'pet_dog', 'feed'
 	elseif rex['count_feed'] > 0 and hour > (rex['timer_feed'] + 3) and $home['current'] ! 'parents_home' and objects['dog_food'] <= 0:
 		'<br>You don''t have dog food to feed him.'

+ 3 - 3
locations/pod_ezd.qsrc

@@ -48,7 +48,7 @@ if $ARGS[0] = 'etaj_1' or $ARGS[0] = '':
 	'There''s a <a href="exec: gt ''pod_ezd'', ''occupants''">list</a> of the people who live here on the wall.'
 	'Someone put up some <a href="exec:gt ''pod_ezd'',''pod_objava''">advertisements</a> on the wall, near the entrance.'
 	act 'Leave the building':
-		if hour < 4 and motherWorry = 0 and age < 18 and home_owned[2] = 1:
+		if hour < 4 and motherWorry = 0 and age < 18 and owned_property['parents_home'] = 4:
 			'<font color=red>Are you sure? Your mother will worry if you go out at this time.</font>'
 			cla
 			act 'No, stay inside': gt 'pod_ezd','etaj_1'
@@ -96,9 +96,9 @@ if $ARGS[0] = 'etaj_2':
 	act 'Go down to the first floor': minut += 1 & gt 'pod_ezd','etaj_1'
 	act 'Go up to the third floor': minut += 1 & gt 'pod_ezd','etaj_3'
 
-	if home_owned[2] = 1:
+	if owned_property['parents_home'] = 4:
 		act '<b>Apartment 7: Your parents</b>': pavhome_enter = 1 & gt 'korrPar'
-	elseif home_owned[2] = 0:
+	elseif owned_property['parents_home'] = 0:
 		act '<b>Apartment 7: Your parents</b>': msg 'Your knock is unanswered, and you no longer have a key.<br>It''s obvious you are no longer welcome here.'
 	end
 

+ 2 - 2
locations/podezdM.qsrc

@@ -111,7 +111,7 @@ end
 if $ARGS[0] = 'kiosk2':
 	cla
 	*clr
-	if home_owned[1] > 0:
+	if owned_property['city_house'] > 0:
 		'<<$loverdesc[lover_number]>> drinks his beer and wraps his arm around you. "<<$pcs_nickname>> why don''t we go back to your place?"'
 		act 'Invite him in':gt 'sexm', 'start'
 		act 'Turn him down':gt 'podezdM', 'Walk'
@@ -143,7 +143,7 @@ if $ARGS[0] = 'Walk':
 	else
 		act 'Break away (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 	end	
-	if home_owned[1] > 0:
+	if owned_property['city_house'] > 0:
 		act 'Kiss':
 			cla
 			'You return his kiss and rub the crotch of his pants. "Why don''t we head over to my place?." you ask him.'

+ 1 - 1
locations/pornstudio.qsrc

@@ -773,7 +773,7 @@ if $ARGS[0] = 'first':
 	'<center><img <<$set_imgh>> src="images/locations/city/redlight/studio_porn/casting/casting0.jpg"></center>'
 	'You sit down on the sofa and greet the manager. "I see it''s your first time with us. So, you want to be a porn star?'
 
-	if pcs_inhib < 40 and (money <= 500 and karta <= 500 and home_owned[2] = 0) or (narkoman = 1 or SLomka > 0):
+	if pcs_inhib < 40 and (money <= 500 and karta <= 500 and func('homes_properties', 'get_accessible_count') = 0) or (narkoman = 1 or SLomka > 0):
 		'While you don''t feel confident enough showing off your body, you''re desperate for money, and are willing to do anything to earn it.'
 		act 'Continue': gt 'pornstudio', 'yes'
 	elseif pcs_inhib < 40:

+ 1 - 1
locations/prostitution_functions.qsrc

@@ -18,7 +18,7 @@
 !! prostitute['changed_for_work']: 1 - It measn that Sveta changed into her prostitute outfit on site from some regular
 !!                                     clothes. This enables the 'Change into regular clothes' action in the changing
 !!									   location. 
-!!								   0 - Sveta didn't change which means she can't change into regular clothing. 
+!!								   0 - Sveta didn''t change which means she can''t change into regular clothing. 
 
 !!---------- Initial set up, enabling locations, etc. -------------------------------------------------------------------
 !!-----------------------------------------------------------------------------------------------------------------------

+ 34 - 9
locations/shop.qsrc

@@ -548,12 +548,12 @@ if $shoplocation = 'tech':
 		''
 	end
 	*pl '<center><table align="center" width=80%>'
-	*p func ('$single_stock_item', 1, 'Small TV', 15000, 'TV', $curloc, '', iif(home_owned[1] > 0 or home_owned[3] > 0 or home_owned[4] = 1 or home_owned[5] > 2, 0, 1), 'You need your own home')
-	*p func ('$single_stock_item', 2, 'Large Plasma TV', 30000, 'TV', $curloc, '', iif(home_owned[1] > 0 or home_owned[3] > 0 or home_owned[4] = 1 or home_owned[5] > 2, 0, 1), 'You need your own home')
+	*p func ('$single_stock_item', 1, 'Small TV', 15000, 'TV', $curloc, '', iif(owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2 or owned_property['village_cottage'] = 2 or owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] = 2 = 1 or owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2, 0, 1), 'You need your own home')
+	*p func ('$single_stock_item', 2, 'Large Plasma TV', 30000, 'TV', $curloc, '', iif(owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2 or owned_property['village_cottage'] = 2 or owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] = 2 = 1 or owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2, 0, 1), 'You need your own home')
 	*p func ('$single_stock_item', 1, 'Computer', 40000, 'komp', $curloc)
 	*p func ('$single_stock_item', 1, 'Computer game Dead Sunset', 800, 'GameCD2', $curloc, '', iif(komp > 0, 0, 1), 'You need a computer')
-	*p func ('$single_stock_item', 1, 'Dishwasher', 28000, 'posudomashina', $curloc, '', iif(home_owned[1] > 0 or home_owned[3] > 0 or home_owned[4] = 1 or home_owned[5] > 2, 0, 1), 'You need your own home')
-	*p func ('$single_stock_item', 1, 'Washing machine', 30000, 'stiralka', $curloc, '', iif(home_owned[1] > 0 or home_owned[3] > 0 or home_owned[4] = 1 or home_owned[5] > 2, 0, 1), 'You need your own home')
+	*p func ('$single_stock_item', 1, 'Dishwasher', 28000, 'posudomashina', $curloc, '', iif(owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2 or owned_property['village_cottage'] = 2 or owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] = 2 = 1 or owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2, 0, 1), 'You need your own home')
+	*p func ('$single_stock_item', 1, 'Washing machine', 30000, 'stiralka', $curloc, '', iif(owned_property['city_apartment'] = 1 or owned_property['city_apartment'] = 2 or owned_property['village_cottage'] = 2 or owned_property['city_apartment'] = 1 or owned_property['old_town_apartment'] = 2 = 1 or owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2, 0, 1), 'You need your own home')
 	*p func ('$single_stock_item', 1, 'Camera', 20000, 'zenit', $curloc)
 	*p func ('$single_stock_item', 1, 'Mini camera disguised as a cigarette pack', 100000, 'minifoto', $curloc)
 	*p func ('$single_stock_item', 1, 'Webcam', 2000, 'webcamera', $curloc, '', iif((npc_rel['A11']>=30 and webcamera = 0) or (camwhore = 1 and webcamera = 0), 0, 1), 'You have no use for this')
@@ -609,22 +609,47 @@ if $shoplocation = 'megafon':
 		'<tr><td> </td></tr>'
 	elseif subscription[$home['current']] = 1:
 		'<tr><td> </td></tr>'
-		'<tr><td align="center">You have an active internet subscription at <<$home[''display'']>> that will renew next month on day <<subscription_date[$home[''current'']]>> for <<price>> <b>₽</b></td></tr>'
+		'<tr><td align="center">You have an active internet subscription at <<$home[''display'']>> that will renew next month on day <<subscription[$home[''current'']+''-date'']>> for <<price>> <b>₽</b></td></tr>'
 		'<tr><td> </td></tr>'
 	else
-		if money >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$home[''current'']>>'' & minut += 30 & money -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> Automatically renews every month - Pay with cash</a></td></tr>'
-		if karta >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$home[''current'']>>'' & minut += 30 & karta -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> Automatically renews every month - Pay with cash</a></td></tr>'
+		if money >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$home[''current'']>>'', <<price>>, 0'' & minut += 30 & money -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> Automatically renews every month - Pay with cash</a></td></tr>'
+		if karta >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$home[''current'']>>'', <<price>>, 0'' & minut += 30 & karta -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> Automatically renews every month - Pay with cash</a></td></tr>'
 		if money < price and karta < price: '<tr><td align="left">Monthly mobile internet subscription for <<price>> <b>₽</b> Automatically renews every month</td></tr>'
 		if money < price and karta < price: '<tr><td align="left">Monthly internet subscription for <<price>> <b>₽</b> Automatically renews every month</td></tr>'
-		'<tr><td> </td></tr>'
 	end
 	'<tr><td> </td></tr>'
+	count = ARRSIZE('owned_property') 
+	if count > 0:
+		'<tr><td align="center"><b>Internet Subscription for your other properties</b></td></tr>'
+		i = 1
+		:propertyloop
+			if owned_property[i] ! 0:				
+				gs 'homes_properties', 'get_property_attr', $owned_property[i]
+				if property['internet_enabled'] = 1:
+					if owned_property[i] = 3:
+						'<tr><td align="center">You have rented out <<$property[''display'']>> and you don''t have to buy internet for your tenants.</td></tr>'
+					elseif subscription[$owned_property[i]] = 0:
+						if money >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$owned_property[i]>>'', <<price>>, 0 & minut += 30 & money -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> for <<$property[''display'']>>. Automatically renews every month - Pay with cash</a></td></tr>'
+						if karta >= price: '<tr><td align="left"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$owned_property[i]>>'', <<price>>, 0 & minut += 30 & karta -= <<price>> & gt ''shop'' ">Monthly internet subscription for <<price>> <b>₽</b> for <<$property[''display'']>>. Automatically renews every month - Pay with cash</a></td></tr>'
+						if money < price and karta < price: '<tr><td align="left">Monthly mobile internet subscription for <<price>> <b>₽</b> for <<$owned_property[i]>>. Automatically renews every month</td></tr>'
+						if money < price and karta < price: '<tr><td align="left">Monthly internet subscription for <<price>> <b>₽</b> for <<$property[''display'']>>. Automatically renews every month</td></tr>'	
+					elseif subscription[$owned_property[i]] > 0:
+						'<tr><td align="center">You have an active internet subscription at <<$property[''display'']>> that will renew next month on day <<subscription[$owned_property[i]+''-date'']>> for <<price>> <b>₽</b></td></tr>'
+					end
+				end
+				killvar '$property'
+			end
+			i += 1
+		if i < count: jump 'propertyloop'
+	end
+	'<tr><td> </td></tr>'
+	'<tr><td> </td></tr>'
 	'<tr><td align="center"><b>Mobile Internet Subscription</b></td></tr>'
 	'<tr><td> </td></tr>'
 	price = 1200
 	if subscription['mobile'] = 1:
 		'<tr><td> </td></tr>'
-		'<tr><td align="center">You have an active mobile internet subscription that will renew next month on day <<subscription_date[''mobile'']>> for <<price>><b>₽</b></td></tr>'
+		'<tr><td align="center">You have an active mobile internet subscription that will renew next month on day <<subscription[''mobile-date'']>> for <<price>><b>₽</b></td></tr>'
 		'<tr><td> </td></tr>'
 	else 
 		if subscription['metered_mobile'] > 0:

+ 32 - 32
locations/shopdacha.qsrc

@@ -13,7 +13,7 @@ act 'Leave': minut += 3 & gt 'torgcentr'
 if hour < 8 or hour > 20:
 	'Shop closed.'
 else
-	if karta + bankDebtLimit >= 50000 and (home_owned[1] = 2 or home_owned[1] = 3):
+	if karta + bankDebtLimit >= 50000 and (owned_property['city_house'] = 2 or owned_property['city_house'] = 3):
 		if rembedr = 0:
 			act 'Renovate city apartment bedroom (50,000 <b>₽</b>)':
 				cla
@@ -89,11 +89,11 @@ else
 			end
 		end
 	end
-	if karta + bankDebtLimit >= 200000 and home_owned[3] = 1:
+	if karta + bankDebtLimit >= 200000 and property_owned['village_cottage-renovated'] = 1:
 		act 'Upgrade your cottage (200,000 <b>₽</b>)':
 			cls
 			karta -= 200000
-			home_owned[3] = 2
+			property_owned['village_cottage-renovated'] = 1
 			minut += 15
 			gs 'stat'
 			'You upgrade you dacha in the cooperative.'
@@ -101,11 +101,11 @@ else
 		end
 	end
 
-	if karta + bankDebtLimit >= 500000 and home_owned[5] = 1:
+	if karta + bankDebtLimit >= 500000 and owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 0:
 		act 'Connect water, electricity (500,000 <b>₽</b>)':
 			cls
 			karta -= 500000
-			home_owned[5] = 2
+			gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 			minut += 5
 			gs 'stat'
 			'You pay for a connection of services to the site.'
@@ -114,11 +114,11 @@ else
 		end
 	end
 
-	if karta + bankDebtLimit >= 1500000 and home_owned[5] = 2:
+	if karta + bankDebtLimit >= 1500000 and owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 1:
 		act 'Build mansion''s shell for (1,500,000 <b>₽</b>)':
 			cls
 			karta -= 1500000
-			home_owned[5] = 3
+			gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 			minut += 5
 			gs 'stat'
 			'You pay for the construction of the mansion''s shell.'
@@ -127,7 +127,7 @@ else
 		end
 	end
 
-	if karta + bankDebtLimit >= 500000 and home_owned[5] = 3 and ymanrem[3] = 0:
+	if karta + bankDebtLimit >= 500000 and owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2 and ymanrem[3] = 0:
 		act 'Build internal walls (500, 000 <b>₽</b>)':
 			cls
 			karta -= 500000
@@ -140,8 +140,8 @@ else
 		end
 	end
 
-	if home_owned[5] >= 2:
-		if karta + bankDebtLimit >= 800000 and home_owned[5] >= 2 and banaMansion = 0:
+	if owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') >= 1:
+		if karta + bankDebtLimit >= 800000 and banaMansion = 0:
 			act 'Install electrics and plumbing (800,000 <b>₽</b>)':
 				cls
 				karta -= 800000
@@ -154,7 +154,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 500000 and home_owned[5] >= 2 and bassMansion = 0:
+		if karta + bankDebtLimit >= 500000 and bassMansion = 0:
 			act 'Build a pool (500,000 <b>₽</b>)':
 				cls
 				karta -= 500000
@@ -167,8 +167,8 @@ else
 			end
 		end
 	end
-	if home_owned[5] = 3:
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[3] = 1:
+	if owned_property['matryona_mansion'] = 2 and func('homes_properties', 'property_construction_status', 'matryona_mansion') = 2:
+		if karta + bankDebtLimit >= 250000 and ymanrem[3] = 1:
 			act 'Build hallways (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -179,7 +179,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 150000 and home_owned[5] = 3 and ymanrem[3] = 2:
+		elseif karta + bankDebtLimit >= 150000 and ymanrem[3] = 2:
 			act 'Buy lounge furniture (150,000 <b>₽</b>)':
 				cls
 				karta -= 150000
@@ -192,7 +192,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[4] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[4] = 0:
 			act 'Build main bedroom (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -203,7 +203,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 300000 and home_owned[5] = 3 and ymanrem[4] = 1:
+		elseif karta + bankDebtLimit >= 300000 and ymanrem[4] = 1:
 			act 'Buy bedroom furniture (300,000 <b>₽</b>)':
 				cls
 				karta -= 300000
@@ -216,7 +216,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[5] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[5] = 0:
 			act 'Pay for bathroom (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -227,7 +227,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[5] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[5] = 1:
 			act 'Pay for bathroom fixtures and fittings (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -240,7 +240,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[6] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[6] = 0:
 			act 'Pay for kitchen installation (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -251,7 +251,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 350000 and home_owned[5] = 3 and ymanrem[6] = 1:
+		elseif karta + bankDebtLimit >= 350000 and ymanrem[6] = 1:
 			act 'Pay for kitchen units (350,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -264,7 +264,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[7] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[7] = 0:
 			act 'Pay for the living room (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -275,7 +275,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[7] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[7] = 1:
 			act 'Buy furniture for the living room (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -288,7 +288,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[8] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[8] = 0:
 				act 'Pay for your lounge (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -299,7 +299,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[8] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[8] = 1:
 			act 'Purchase furniture for the lounge (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -312,7 +312,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[9] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[9] = 0:
 			act 'Build a children''s room (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -323,7 +323,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[9] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[9] = 1:
 			act 'Buy furniture for the nursery (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -336,7 +336,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[10] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[10] = 0:
 			act 'Pay for a library (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -347,7 +347,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[10] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[10] = 1:
 			act 'Purchase furniture for your library (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -360,7 +360,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[11] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[11] = 0:
 			act 'Buy a gym (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -371,7 +371,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[11] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[11] = 1:
 			act 'Buy gym equipment (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -384,7 +384,7 @@ else
 			end
 		end
 
-		if karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[12] = 0:
+		if karta + bankDebtLimit >= 250000 and ymanrem[12] = 0:
 			act 'Buy an office (250,000 <b>₽</b>)':
 				cls
 				karta -= 250000
@@ -395,7 +395,7 @@ else
 
 				act 'Return': gt 'shopdacha'
 			end
-		elseif karta + bankDebtLimit >= 250000 and home_owned[5] = 3 and ymanrem[12] = 1:
+		elseif karta + bankDebtLimit >= 250000 and ymanrem[12] = 1:
 			act 'Purchase furniture for the office (250,000)':
 				cls
 				karta -= 250000

+ 1 - 1
locations/shulgahall.qsrc

@@ -29,7 +29,7 @@ if $ARGS[0] = '':
 	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/shulginhome/korr.jpg"></center>'
 	*nl
 	'The hallway of Uncle Sergey''s one bedroom apartment is similar to every other apartment in the complex. There are several doors leading to the various rooms. The bedroom is Uncle Sergey''s. There''s also the kitchen, bathroom, and finally the livingroom, which Vasily uses for a bedroom.'
-	if home_owned[2] = 0:
+	if owned_property['parents_home'] = 0:
 	!!if $home['current'] = $home_name
 		'There are several <a href="exec:gt ''wardrobe'', ''start''">closets</a> in the hall, which Sergey said you can use to store your clothes while you''re staying here</a>, and a large tall <a href="exec:gt ''mirror'', ''start''">mirror</a> on one of the doors.'
 		if $home['current'] = $home_name and prostitute['active']: gs 'prostitution_functions', 'prostitute_outfit_at_home'

+ 6 - 6
locations/stat_display.qsrc

@@ -1903,12 +1903,12 @@ if mid($start_type,1,2) = 'sg' and nerd_night_game = 1 and nerd_night_game_day =
 
 !!--------------- mid($start_type,1,2) = 'sg' Events (End) ------------------------
 
-if home_owned[1] = 1 and home_owned[4] > 0:
-	$stat_msg += '<BR>You have rented an apartment in the city residential area, which is paid up for <b><<ArendHouseSL>></b> days, and you also have an apartment in Pushkin, which is paid up for <b><<ArendHouseSL4>></b> days. Utilities are due on the 25th of <<$month>>.'
-elseif home_owned[1] = 1:
-	$stat_msg += '<BR>You have rented an apartment in the city residential area, and you''re paid up for <<ArendHouseSL>> days. Utilities are due on the 25th of <<$month>>.'
-elseif home_owned[4] > 0:
-	$stat_msg += '<BR>You have rented an apartment in Pushkin, and you''re paid up for <<ArendHouseSL4>> days. Utilities are due on the 25th of <<$month>>.'
+if owned_property['city_house'] = 1 and owned_property['old_town_apartment'] > 0:
+	$stat_msg += '<BR>You have rented an apartment in the city residential area, which is paid up for <b><<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>></b> days, and you also have an apartment in Pushkin, which is paid up for <b><<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>></b> days. Utilities are due on the 25th of <<$month>>.'
+elseif owned_property['city_house'] = 1:
+	$stat_msg += '<BR>You have rented an apartment in the city residential area, and you''re paid up for <<func(''homes_properties'', ''get_rent_days'', ''city_apartment'')>> days. Utilities are due on the 25th of <<$month>>.'
+elseif owned_property['old_town_apartment'] > 0:
+	$stat_msg += '<BR>You have rented an apartment in Pushkin, and you''re paid up for <<func(''homes_properties'', ''get_rent_days'', ''old_town_apartment'')>> days. Utilities are due on the 25th of <<$month>>.'
 end
 
 if $nichStatMsg ! '': $stat_msg += '<br><b><<$nichStatMsg>></b>'

+ 1 - 1
locations/street_event.qsrc

@@ -56,7 +56,7 @@ elseif $ARGS[0] = 'city_industrial':
 	streetev_hijack = 0
 	streetev_bf = 30
 	streetev_mistmeet = 5
-	if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
+	if owned_property['city_apartment'] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
 		streetev_home = 0
 		$streetev_home = 'by the train station'
 	end

+ 2 - 2
locations/telefon.qsrc

@@ -1215,8 +1215,8 @@ if $ARGS[0] = 'Phone_notebook':
 	<<year>>-<<$month>>-<<day>>, <<$week[week]>><br><br>'
 	rent1 = -1
 	rent4 = -1
-	if home_owned[1] > 0 and ArendHouseSL > 0:rent1 = ArendHouseSL
-	if home_owned[4] > 0 and ArendHouseSL4 > 0:rent4 = ArendHouseSL4
+	if owned_property['city_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'city_apartment') > 0: rent1 = func('homes_properties', 'get_rent_days', 'city_apartment')
+	if owned_property['old_town_apartment'] > 0 and func('homes_properties', 'get_rent_days', 'old_town_apartment') > 0: rent4 = func('homes_properties', 'get_rent_days', 'old_town_apartment')
 	d1 = day
 	w1 = week
 	m1 = month

+ 2 - 2
locations/therapist.qsrc

@@ -1823,7 +1823,7 @@ if $ARGS[0] = 'hypnoPerv':
 		elseif $home['current'] = 'pavlovsk_hotel':
 			'"I live in my hotel room in Pavlovsk, <i>Master</i>."'
 			'"Couldn''t be easier then. No need to do anything. Put your clothes on and come with me."'
-		elseif $home['current'] = 'maid_bedroom']:
+		elseif $home['current'] = 'maid_bedroom':
 			'"I live in Nicholas'' apartment, <i>Master</i>."'
 			'"Nicolas? Hmm." <i>Master</i> leaves the room for a moment, then returns and hands you a sheet of paper and a pen.'
 			'"Pick up the pen and write what I say."'
@@ -1837,7 +1837,7 @@ if $ARGS[0] = 'hypnoPerv':
 			'You pick up the pen, then wait for him to speak.'
 			'"Niko, thank you for letting me stay at your place. I''ve found employment in the city and my own apartment! I''ll come visit when I can. Sincerly yours, <<$pcs_firstname>> <<$pcs_lastname>>"'
 			'He takes the paper from you and looks it over... "Good. I will send this to your Niko''s home. Now dress and come with me."'
-		elseif $home['current'] = [home['sergeys_apartment']:
+		elseif $home['current'] = 'sergeys_apartment':
 			'"I live in Uncle Sergey''s apartment, <i>Master</i>."'
 			'"Uncle Sergey? Hmm." <i>Master</i> leaves the room for a moment, then returns and hands you a sheet of paper and a pen.'
 			'"Pick up the pen and write what I say."'

+ 3 - 1
locations/uni_admin.qsrc

@@ -100,7 +100,9 @@ if $ARGS[0] = 'enrollment':
 					university['student'] = 1
 					$university['enrolled_in']= 'teaching_studies'
 					university['enrolled_in_semester'] = 1
-					home_owned[11] = 1
+					
+					gs 'homes_properties', 'set_ownership', 'university_dorm', 4
+
 					!!This creates the classes for the first semester of the teaching program to be used by the grade system, and gives the player a starting grade value (which is a failing grade, the player have to study if they want to pass)
 					gs 'grades', 'createclass', 'uni_teaching_studies_semester_1', 'general education 101', 3, 2, 'no', 'no', 1, 12
 					gs 'grades', 'createclass', 'uni_teaching_studies_semester_1', 'teaching methods 101', 3, 2, 'no', 'no', 1, 12

+ 4 - 3
locations/uni_dorm.qsrc

@@ -4,7 +4,7 @@
 if $ARGS[0] = 'start':
 	*clr & cla
 	minut += 5
-	$home_name = 'univresity_dorm'
+	$home_name = 'university_dorm'
 	$menu_loc = 'uni_dorm'
 	$menu_arg = 'start'
 	menu_off = 0
@@ -13,7 +13,8 @@ if $ARGS[0] = 'start':
 	'<center><b><font color="maroon">Dormitory</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/dorm/dorm.jpg"></center>'
 	'You walk up to the dorm building and go inside. It is pretty clean and in good shape. An older woman, with a very unpleasant and judgmental look on her face sits in a room just off the main hallway. It has a partially glass wall and a window, splitting it from the main room. She looks up at you as you enter, her look telling you she is already judging you as her face frowns into a look of disapproval.'
-	if home_owned[11] = 1 or university['student'] = 1:
+	if owned_property['university_dorm'] = 1 or university['student'] = 1:
+	univ
 		act 'Show her your student ID':
 			*clr & cla
 			minut += 1
@@ -304,7 +305,7 @@ if $ARGS[0] = 'tenth_floor':
 		gt 'vann', 'start'
 	end
 
-	if home_owned[11] = 1:
+	if owned_property['university_dorm'] = 4:
 		if courtletter_date <= daystart and courtletter_date ! 0:
 			gt 'sentence', 'letter'
 		end

+ 1 - 1
locations/unused/pornstudio.qsrc

@@ -770,7 +770,7 @@ if $ARGS[0] = 'first':
 	'<center><img <<$set_imgh>> src="images/locations/city/redlight/studio_porn/casting/casting0.jpg"></center>'
 	'You sit down on the sofa and greet the manager. "I see it''s your first time with us. So, you want to be a porn star?'
 
-	if pcs_inhib < 40 and (money <= 500 and karta <= 500 and home_owned[2] = 0) or (narkoman = 1 or SLomka > 0):
+	if pcs_inhib < 40 and (money <= 500 and karta <= 500 and owned_property['parents_home'] = 0) or (narkoman = 1 or SLomka > 0):
 		'While you don''t feel confident enough showing off your body, you''re desperate for money, and are willing to do anything to earn it.'
 		act 'Continue': gt 'pornstudio', 'yes'
 	elseif pcs_inhib < 40:

+ 6 - 6
locations/zoomagazine.qsrc

@@ -110,7 +110,7 @@ if $ARGS[0] = 'start':
 		act 'Buy a rabbit (2000 <b>₽</b>)':
 			cla & *clr
 			menu_off = 1
-			if home_owned[1] > 0:
+			if owned_property['city_apartment'] > 0:
 				minut += 10
 				krolik += 1
 				money -= 2000
@@ -125,11 +125,11 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if money >= 3000 and rex['owned'] = 0 and home_owned[2] = 0 :
+	if money >= 3000 and rex['owned'] = 0 and owned_property['parents_home'] = 0 :
 		act 'Buy a dog (3000 <b>₽</b>)':
 			cla & *clr
 			menu_off = 1
-			if home_owned[1] > 0 or home_owned[2] > 0 or home_owned[4] > 0 or home_owned[5] > 0:
+			if ARRSIZE('home') > 0:
 				minut += 10
 				rex['owned'] = 1
 				money -= 3000
@@ -144,11 +144,11 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if money >= 3000 and ParrotQW['Owned1'] = 0 and home_owned[2] = 0 :
+	if money >= 3000 and ParrotQW['Owned1'] = 0 and owned_property['parents_home'] = 0 :
 		act 'Buy a parrot (3000 <b>₽</b>)':
 			cla & *clr
 			menu_off = 1
-			if home_owned[1] > 0:
+			if owned_property['city_apartment'] > 0:
 				minut += 10
 				ParrotQW['Owned1'] = 1
 				money -= 3000
@@ -163,7 +163,7 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if money >= 3000 and ParrotQW['Owned2'] = 0 and home_owned[2] = 1 :
+	if money >= 3000 and ParrotQW['Owned2'] = 0 and owned_property['parents_home'] = 4 :
 		act 'Buy a parrot for your parent''s apartment (3000 <b>₽</b>)':
 			cla & *clr
 			menu_off = 1