Browse Source

New calls to set the right status of the property.

`give_access`, `block_access`, `rent_property`, `buy_property`, `sell_property`, `cancel_rent`

They tell clearly what they will do and what to use them for.
netuttki 1 year ago
parent
commit
cb3455e8bb

+ 3 - 3
locations/agentned.qsrc

@@ -343,8 +343,8 @@ if $ARGS[0] = 'rent_pushkin':
 			else
 				karta -= pmonthly_rent
 			end
-			gs 'homes_properties', 'set_ownership', 'old_town_apartment', 1
-			if func( 'homes_properties', 'get_accessible_count') = 1:
+			gs 'homes_properties', 'rent_property', 'old_town_apartment'
+			if func( 'homes_properties', 'get_accessible_count', 'home') = 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)")
@@ -385,7 +385,7 @@ if $ARGS[0] = 'buy_property':
 	gs 'homes_properties', 'get_property_attr', $ARGS[1]
 	minut += 30
 	karta -= property['price']
-	gs 'homes_properties', 'set_ownership', $ARGS[1], 2
+	gs 'homes_properties', 'buy_property', $ARGS[1]
 
 	$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]

+ 2 - 2
locations/gadhouse.qsrc

@@ -96,7 +96,7 @@ if $ARGS[0] = 'start':
 	display_bb = 1
 	frost = 0
 	
-	gs 'homes_properties', 'set_ownership', 'grandparents_house', 1
+	gs 'homes_properties', 'give_access', 'grandparents_house'
 
 	gs 'gadhouse', 'nudity_trouble_limit'
 
@@ -154,7 +154,7 @@ if $ARGS[0] = 'start':
 	elseif grandmaQW['nudity_trouble_limit'] = 50 and hour >= 6 and hour < 20:
 		*clr & cla
 
-		gs 'homes_properties', 'set_ownership', 'grandparents_house', 0
+		gs 'homes_properties', 'block_access', 'grandparents_house'
 
 		grandmaQW['help_amount'] = 0
 		grandmaQW['block'] = 1

+ 1 - 1
locations/intro_city_select.qsrc

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

+ 1 - 2
locations/intro_initialization_city.qsrc

@@ -79,9 +79,8 @@ 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':
-	gs 'homes_properties', 'set_ownership', 'city_apartment', 1
+	gs 'homes_properties', 'rent_property', 'city_apartment', 61
 	gs 'homes_properties', 'set_home', 'city_apartment'
-	gs 'homes_properties', 'set_rent_days', 'city_apartment', 61
 end
 
 vidage = age - 1

+ 2 - 2
locations/intro_sg_select.qsrc

@@ -75,7 +75,7 @@ if $ARGS[0] = 'start':
 	gs 'npcstatic6'
 
 	$pcs_dna = func('dna','generate',$npc_dna['A29'],$npc_dna['A35'])
-	gs 'homes_properties', 'set_ownership', 'parents_home', 1
+	gs 'homes_properties', 'give_access', 'parents_home'
 	gs 'homes_properties', 'set_home', 'parents_home'
 	killvar 'class_list_institution'
 	killvar 'class_list_name'
@@ -1663,7 +1663,7 @@ end
 if $ARGS[0] = 'sg_settings':
 	gm_school[6] = 1
 	sisboyday = -2
-	gs 'homes_properties', 'set_ownership', 'city_apartment', 0
+	gs 'homes_properties', 'block_access', 'city_apartment'
 	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
 
-	gs 'homes_properties', 'set_ownership', 'parents_home', 1
+	gs 'homes_properties', 'give_access', 'parents_home'
 	gs 'homes_properties', 'set_home', 'parents_home'
 
 	pcs_eyesize = 3

+ 1 - 1
locations/intro_uni.qsrc

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

+ 6 - 2
locations/korrPar.qsrc

@@ -152,7 +152,11 @@ if NatbelQW['QWstage'] >= 4 and week < 6 and (hour = 6 or hour = 7) and kanikuli
 end
 
 if func('homes_properties', 'is_current_home') = 0:
-	act 'Set this apartment as your main home':gs 'homes_properties', 'set_home' & gt 'korrPar'
+	act 'Set this apartment as your main home':
+		if func('homes_properties', 'can_live_here') = 0: gs 'homes_properties', 'give_access' 
+		gs 'homes_properties', 'set_home' 
+		gt 'korrPar'
+	end
 else
 	if $status['dog'] ! 'blocked' and menu_off = 0 and rex['owned'] = 1:
 		if rex['status'] = 0:
@@ -358,7 +362,7 @@ if hour >= 16 and hour <= 20 and locat['Fam_inGad'] = 0:
 				schoolPredupr = 3
 				npc_rel['A29'] = 0
 				SchoolBlock = 1
-				gs 'homes_properties', 'set_ownership', 'parents_home', 0
+				gs 'homes_properties', 'block_acces', 'parents_home'
 				schoolprogul = 0
 				gs 'grades', 'grade_award', 'school', 'math', -100
 				gs 'grades', 'grade_award', 'school', 'rus', -100

+ 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
-								gs 'homes_properties', 'set_ownership', 'meynold_household', 1
+								gs 'homes_properties', 'give_access', 'meynold_household'
 								'<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
-								gs 'homes_properties', 'set_ownership', 'meynold_household', 1
+								gs 'homes_properties', 'give_access', 'meynold_household'
 								'<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':
-	gs 'homes_properties', 'set_ownership', 'parents_home', 0
+	gs 'homes_properties', 'block_access', 'parents_home'
 	minut += 15
 	gs 'stat'
 	if $ARGS[1] = 'kolka':

+ 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.'
 	
-	gs 'homes_properties', 'set_ownership', 'maid_bedroom', 0
+	gs 'homes_properties', 'block_access', 'maid_bedroom'
 	
 	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':
-	gs 'homes_properties', 'set_ownership', 'maid_bedroom', 1
+	gs 'homes_properties', 'give_access', 'maid_bedroom', 1
 
 	nichWork = 2
 	nichWorkState = 0

+ 5 - 5
locations/pav_shared_apt.qsrc

@@ -267,7 +267,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
-				gs 'homes_properties', 'set_ownership', 'shared_apartment', 0
+				gs 'homes_properties', 'block_access', 'shared_apartment', 0
 			end
 		end
 	end
@@ -332,7 +332,7 @@ if $ARGS[0] = 'payCash':
 		money -= cash
 		rentPaid = 1
 		pavSharedAptEnabled = 1
-		gs 'homes_properties', 'set_ownership', 'shared_apartment', 4
+		gs 'homes_properties', 'give_access'
 	else
 		'You do not have enough cash to pay for the rest of your rent.'
 	end
@@ -444,9 +444,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 & 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'
+		act 'Say you will pay the rent the normal way':pavSharedAptEnabled = 1 & gs 'homes_properties', 'give_access' & pavIntroStep = 10 & gt 'pav_shared_apt', 'intro'
+		act 'Say you don''t mind doing the homekeeping stuff':pavSharedAptEnabled = 1 & gs 'homes_properties', 'give_access' & pavIntroStep = 20 & gt 'pav_shared_apt', 'intro'
+		act 'Say you don''t mind anything':pavSharedAptEnabled = 1 & gs 'homes_properties', 'give_access' & 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>'

+ 28 - 30
locations/saveupdater.qsrc

@@ -1301,55 +1301,53 @@ if ((100*version_major +version_minor)*100+version_revision)*100+version_patch <
 	
 	!! Transferring the owned, rented, accessible properties
 	! city apartment
-	if home_owned[1] > 0: gs 'homes_properties', 'set_ownership', 'city_apartment', home_owned[1]
+	if home_owned[1] = 1: 
+		gs 'homes_properties', 'rent_property', 'city_apartment', ArendHouseSL
+	elseif home_owned[1] = 2: 
+		gs 'homes_properties', 'buy_property', 'city_apartment'
+	elseif home_owned[1] = 3: 
+		gs 'homes_properties', 'tenants_move_in', 'city_apartment'
+		!! TODO: Set the tenant move out date
+	end
 	! parents home
-	if home_owned[2] = 1: gs 'homes_properties', 'set_ownership', 'parents_home', 1
+	if home_owned[2] = 1: gs 'homes_properties', 'give_access', 'parents_home'
 	! cottage in the village
-	if home_owned[3] = 2:  gs 'homes_properties', 'set_ownership', 'village_cottage', 2
+	if home_owned[3] = 2:  gs 'homes_properties', 'buy_property', 'village_cottage'
 	! Pushking old town apartment
-	if home_owned[4] > 1:  gs 'homes_properties', 'set_ownership', 'old_town_apartment', home_owned[4]
+	if home_owned[4] = 1: gs 'homes_properties', 'rent_property', 'old_town_apartment', ArendHouseSL4
 	! Matryona mansion
-	if home_owned[5] > 0: gs 'homes_properties', 'set_ownership', 'matryona_mansion', 2
+	if home_owned[5] > 0: gs 'homes_properties', 'buy_property', 'matryona_mansion'
 	if home_owned[5] > 1: gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 	if home_owned[5] > 2: gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
 	! Pavlovsk hotel room
-	if home_owned[6] = 1:  gs 'homes_properties', 'set_ownership', 'pavlovsk_hotel', 1
+	if home_owned[6] = 1:  gs 'homes_properties', 'give_access', 'pavlovsk_hotel'
 	! Live in maid bedroom
-	if home_owned[7] = 1:  gs 'homes_properties', 'set_ownership', 'maid_bedroom', 1
+	if home_owned[7] = 1:  gs 'homes_properties', 'give_access', 'maid_bedroom'
 	! Niko apartment
-	if home_owned[8] = 1:  gs 'homes_properties', 'set_ownership', 'niko_apartment', 1
+	if home_owned[8] = 1:  gs 'homes_properties', 'give_access', 'niko_apartment'
 	! Shulga apartment
-	if home_owned[9] = 1:  gs 'homes_properties', 'set_ownership', 'shulga_apartment', 1
+	if home_owned[9] = 1:  gs 'homes_properties', 'give_access', 'shulga_apartment'
 	! Lyceum dorm room
-	if home_owned[10] = 1:  gs 'homes_properties', 'set_ownership', 'lyceum_dorm', 1
+	if home_owned[10] = 1:  gs 'homes_properties', 'give_access', 'lyceum_dorm'
 	! University dorm room
-	if home_owned[11] = 1:  gs 'homes_properties', 'set_ownership', 'university_dorm', 1
+	if home_owned[11] = 1:  gs 'homes_properties', 'give_access', 'university_dorm'
 	! Hunters lodge
-	if home_owned[12] = 1:  gs 'homes_properties', 'set_ownership', 'hunters_lodge', 1
+	if home_owned[12] = 1:  gs 'homes_properties', 'give_access', 'hunters_lodge'
 	! Shared apartment in Pavlovsk
-	if home_owned[13] = 1:  gs 'homes_properties', 'set_ownership', 'shared_apartment', 1
+	if home_owned[13] = 1:  gs 'homes_properties', 'give_access', 'shared_apartment'
 	! Grandparents house
-	if home_owned[14] = 1:  gs 'homes_properties', 'set_ownership', 'grandparents_house', 1
+	if home_owned[14] = 1:  gs 'homes_properties', 'give_access', 'grandparents_house'
 	! City residential house
-	if home_owned[15] = 2:  gs 'homes_properties', 'set_ownership', 'city_house', 2
+	if home_owned[15] = 2:  gs 'homes_properties', 'buy_property', 'city_house'
 	! Meynold household
-	if home_owned[16] = 1:  gs 'homes_properties', 'set_ownership', 'meynold_household', 1
+	if home_owned[16] = 1:  gs 'homes_properties', 'give_access', 'meynold_household'
 
 	!! Setting the current home and fixing potential missing access issues
 	if curr_home > 0: gs 'homes_properties', 'set_home', '', curr_home
-	if home['current'] = 'parents_home' and owned_property['parents_home'] = 0: gs 'homes_properties', 'set_ownership', 'parents_home', 4
-
-	!! Setting rent values
-	if owned_property['city_apartment'] = 1: owned_property['city_apartment-days-left'] = ArendHouseSL
-	if owned_property['old_town_apartment'] = 1: owned_property['old_town_apartment-days-left'] = ArendHouseSL4
-
-	killvar 'home_owned'
-	killvar 'curr_home'
-	killvar 'ArendHouseSL'
-	killvar 'ArendHouseSL4'
-	killvar '$home_rent_txt'
-	killvar 'home_value'
-	killvar '$home_value_txt'
+	if home['current'] = 'parents_home' and accessible_property['parents_home'] = 0: gs 'homes_properties', 'give_access', 'parents_home'
+ 
+	killvar 'home_owned' & killvar 'curr_home' & killvar 'ArendHouseSL' & killvar 'ArendHouseSL4'
+	killvar '$home_rent_txt' & killvar 'home_value' & killvar '$home_value_txt'
 
 	!! Setting the internet
 	if internet > 0:
@@ -1396,7 +1394,7 @@ if ((100*version_major +version_minor)*100+version_revision)*100+version_patch <
 				gs 'internet_mobile', 'top_up_metered', 'metered_calls', balans
 			end
 		end	
-		killvar 'balans'		
+		killvar 'balans' & killvar 'temp_phone_rem' & killvar 'temp_phone_mult' & killvar 'new_balans'
 	end
 
 	!! Anuahka''s variables put in an array.

+ 1 - 1
locations/uni_admin.qsrc

@@ -101,7 +101,7 @@ if $ARGS[0] = 'enrollment':
 					$university['enrolled_in']= 'teaching_studies'
 					university['enrolled_in_semester'] = 1
 					
-					gs 'homes_properties', 'set_ownership', 'university_dorm', 1
+					gs 'homes_properties', 'give_access', 'university_dorm'
 
 					!!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