Bladeren bron

Fixed the condition check.

netuttki 1 jaar geleden
bovenliggende
commit
eda611e3fb
1 gewijzigde bestanden met toevoegingen van 35 en 35 verwijderingen
  1. 35 35
      locations/obj_din.qsrc

+ 35 - 35
locations/obj_din.qsrc

@@ -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 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['niko_apartment'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''niko_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Niko''s apartment</a>'
-	if owned_property['shulga_apartment'] = 4: 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''shulga_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>'
+	if func('homes_properties', 'can_live_here', 'city_apartment'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''city_apartment'' & gs ''obj_din'', <<$home[''current'']>>">City residential apartment</a>'
+	if func('homes_properties', 'can_live_here', 'parents_home'): '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 func('homes_properties', 'can_live_here', 'village_cottage'): '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 func('homes_properties', 'can_live_here', 'old_town_apartment'): '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 func('homes_properties', 'can_live_here', 'matryona_mansion'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''matryona_mansion'' & gs ''obj_din'', <<$home[''current'']>>">Matryona mansion</a>'
+	if func('homes_properties', 'can_live_here', 'pavlovsk_hotel'): '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 func('homes_properties', 'can_live_here', 'maid_bedroom'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''maid_bedroom'' & gs ''obj_din'', <<$home[''current'']>>">Nicholas'' apartment</a>'
+	if func('homes_properties', 'can_live_here', 'niko_apartment'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''niko_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Niko''s apartment</a>'
+	if func('homes_properties', 'can_live_here', 'shulga_apartment'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''shulga_apartment'' & gs ''obj_din'', <<$home[''current'']>>">Uncle Sergey''s apartment</a>'
+	if func('homes_properties', 'can_live_here', 'lyceum_dorm'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''lyceum_dorm'' & gs ''obj_din'', <<$home[''current'']>>">Lyceum school</a>'
+	if func('homes_properties', 'can_live_here', 'university_dorm'): 'Set current home as <a href="exec:gs ''homes_properties'', ''set_home'', ''university_dorm'' & gs ''obj_din'', <<$home[''current'']>>">University halls</a>'
+	if func('homes_properties', 'can_live_here', 'hunters_lodge'): '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 func('homes_properties', 'can_live_here', 'shared_apartment'): '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 func('homes_properties', 'can_live_here', 'grandparents_house'): '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 func('homes_properties', 'can_live_here', 'city_house'): '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 func('homes_properties', 'can_live_here', 'meynold_household'): '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,39 +558,39 @@ if $ARGS[0] = 'stats':
 		if schoolprogul > 0: 'School absenteeism - <<schoolprogul>> days'
 	end
 	*nl
-	
-	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):
+	!! TODO: Has to fix, this is broken right now
+	if (accessible_property['city_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'city_apartment') > 0) or (accessible_property['old_town_apartment'] = 1 and func('homes_properties', 'get_rent_days', 'old_town_apartment') > 0):
 			*nl
-		if owned_property['city_apartment'] = 1 and owned_property['old_town_apartment'] =1:
+		if accessible_property['city_apartment'] = 1 and accessible_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:
+		elseif accessible_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:
+		elseif accessible_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 accessible_property['city_apartment'] = 1:
+			rentdue = func('homes_properties', 'get_rent_amount', '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 <<rentdue>> <b>₽</b>. '
 				if karta >= rentdue:
 					!From bank
-					*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.'
+					*p 'You can make an advance <a href="exec:karta -=rentdue & 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 -= 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.'
+					*p 'You can make an advance <a href="exec:money -= rentdue & gs ''homes_properties'', ''add_rent_days'', ''city_apartment'' & gs ''$menu_obnovit''">payment</a> from your on-hand cash.'
 					*nl
 				elseif stolmoney >= rentdue:
 					!From 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.'
+					*p 'You can make an advance <a href="exec:stolmoney -= rentdue & 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 >= rentdue:
 					!From cash and 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.'
+					*p 'You can make an advance <a href="exec:money -= (rentdue - stolmoney) & stolmoney = 0 & 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 >= rentdue:
 					!From bank and overdraw
-					*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.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue & 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.'
@@ -599,30 +599,30 @@ if $ARGS[0] = 'stats':
 			end
 			killvar 'rentdue'
 		end
-		if owned_property['old_town_apartment'] > 0:
-			rentdue = func('homes_properties', 'get_rent', 'old_town_apartment')
+		if accessible_property['old_town_apartment'] > 0:
+			rentdue = func('homes_properties', 'get_rent_amount', '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 <<rentdue>> <b>₽</b>. '
 				if karta >= rentdue:
 					!From bank
-					*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.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue &  gs ''homes_properties'', ''set_access'', ''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 >= rentdue:
 					!From 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.'
+					*p 'You can make an advance <a href="exec:money -= rentdue & gs ''homes_properties'', ''set_access'', ''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 >= rentdue:
 					!From 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.'
+					*p 'You can make an advance <a href="exec:stolmoney -= rentdue & gs ''homes_properties'', ''set_access'', ''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 >= rentdue:
 					!From cash and 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.'
+					*p 'You can make an advance <a href="exec:money -= (rentdue - stolmoney) & stolmoney = 0 & gs ''homes_properties'', ''set_access'', ''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 >= rentdue:
 					!From bank and overdraw
-					*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.'
+					*p 'You can make an advance <a href="exec:karta -= rentdue & gs ''homes_properties'', ''set_access'', ''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.'