1
0
Prechádzať zdrojové kódy

[changed] (1) made it possible to enter the car directly from inside the car dealership and repair shop if the car is parked there, (2) added functions to the car dealership and repair shop that return their open hours, (3) used those functions to block the player from driving to those locations when they are closed, (4) replaced the other places currently guarded by those open hours with calls to this function, (5) added logic to move the car out of the dealership or repair shop if the car is not wrecked and the player comes by while they are closed (non-wrecked cars are moved to not block the player from accessing their car; wrecked cars are not moved to avoid forcing the player to pay a towing fee a second time to move the car back inside), (6) added lines of text saying the car is locked inside if the car is in the repair shop or dealership and they are closed

Spackled Lanturn 3 rokov pred
rodič
commit
2e300dc045

+ 6 - 0
locations/autoservisF.qsrc

@@ -13,6 +13,8 @@ if $ARGS[0] = 'start':
 	'<center><b>Car Service Center</b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/industrial/carservicesta/autoservis1.jpg"></center>'
 
+	if car > 0 and cardrive = 7:'Your <a href="exec:gs ''carF'', ''start''"><<$car>></a> is parked just inside.'
+
 	if cardrive = 7:
 		menu_off = 1
 		if wrek = 0:
@@ -89,5 +91,9 @@ if $ARGS[0] = 'start':
 	act 'Leave': minut += 5 & gt 'city_industrial'
 end
 
+if $ARGS[0] = 'is_open':
+	RESULT = hour >= 9 and hour <= 20 and week < 7
+end
+
 --- autoservisF ---------------------------------
 

+ 7 - 1
locations/autotraidF.qsrc

@@ -15,9 +15,11 @@ if $ARGS[0] = 'start':
 	'- We only sell to people with valid driver''s licenses.'
 	'- New State law: No sale if you already own a car.'
 
+	if car > 0 and cardrive = 9:'Your <a href="exec:gs ''carF'', ''start''"><<$car>></a> is parked just inside.'
+
 	act 'Leave': minut += 5 & gt 'city_industrial'
 	
-	if hour <= 17:
+	if func('autotraidF', 'is_open'):
 		if car > 0:act 'Ask about selling your car':gt 'autotraidF', 'manager1'
 
 		act 'Look at the new cars for sale': gt 'autosalonF', 'start'
@@ -25,6 +27,10 @@ if $ARGS[0] = 'start':
 	end
 end
 
+if $ARGS[0] = 'is_open':
+	RESULT = hour >= 9 and hour < 18 and week > 1
+end
+
 if $ARGS[0] = 'manager1':
 	$loc_arg = $ARGS[0]
 	$loc = 'autotraidF'

+ 2 - 2
locations/carF.qsrc

@@ -314,8 +314,8 @@ if $ARGS[0] = 'city':
 	if cardrive ! 4:act 'Go to the city lake':gs 'carF', 'nearby', 4
 	if cardrive ! 5:act 'Go to the city park':gs 'carF', 'nearby', 5
 	if cardrive ! 6:act 'Go to the gas station':gs 'carF', 'nearby', 6
-	if cardrive ! 7:act 'Go to the auto repair shop':gs 'carF', 'nearby', 7
-	if cardrive ! 9:act 'Go to the car dealership':gs 'carF', 'nearby', 9
+	if cardrive ! 7 and func('autoservisF', 'is_open'):act 'Go to the auto repair shop':gs 'carF', 'nearby', 7
+	if cardrive ! 9 and func('autotraidF', 'is_open'):act 'Go to the car dealership':gs 'carF', 'nearby', 9
 	if cardrive ! 25:act 'Go to the island':gs 'carF', 'nearby', 25
 	if cardrive ! 27:act 'Go to the red light district':gs 'carF', 'nearby', 27
 end

+ 22 - 6
locations/city_industrial.qsrc

@@ -48,7 +48,15 @@ if $ARGS[0] = '':
 
 	gs 'taxi'
 
-	if car > 0 and (cardrive = 3 or (cardrive >= 6 and cardrive <= 9) or cardrive = 27):'In the parking stands your <a href="exec:' + iif(cardrive = 3, '', 'minut += 5 & ') + 'gs ''carF'', ''start''"><<$car>></a>.'
+	if car > 0:
+		if wrek = 0 and ((cardrive = 7 and func('autoservisF', 'is_open') = 0) or (cardrive = 9 and func('autotraidF', 'is_open') = 0)):
+			'It looks like the ' + iif(cardrive = 7, 'repair shop', 'car dealership') + ' moved your car outside before they closed.'
+			cardrive = 3
+		end
+		if cardrive = 3 or cardrive = 6 or (cardrive = 7 and func('autoservisF', 'is_open')) or (cardrive = 9 and func('autotraidF', 'is_open')) or cardrive = 27:
+			'In the parking stands your <a href="exec:' + iif(cardrive = 3, '', 'minut += 5 & ') + 'gs ''carF'', ''start''"><<$car>></a>.'
+		end
+	end
 
 	'The town''s <a href="exec:minut += 60 & gt ''city_park'', ''start''">central park</a> is a one hour walk from here.'
 
@@ -75,15 +83,15 @@ if $ARGS[0] = '':
 	else
 		'The metro station is within a 5 minute walk from here. The metro system is closed between midnight and 05:00.'
 	end
-	if hour >= 9 and hour < 18 and week > 1:
+	if func('autotraidF', 'is_open'):
 		'A <a href="exec: minut += 5 & gt ''autotraidF'', ''start''">car dealership</a> is nearby.'
 	else
-		'A car dealership is nearby'+iif(week = 1, ', but it''s closed on Mondays.', '. It''s currently closed and will open between 09:00 and 18:00.')
+		'A car dealership is nearby' + iif(week = 1, ', but it''s closed on Mondays.', '. It''s currently closed and will open between 09:00 and 18:00.') + iif(car > 0 and cardrive = 9, ' Your <<$car>> is currently locked inside.', '')
 	end
-	if hour >= 9 and hour <= 20 and week < 7:
+	if func('autoservisF', 'is_open'):
 		'Next to the car dealership is a <a href="exec: minut += 5 & gt ''autoservisF'', ''start''">repair shop</a>.'
 	else
-		'Next to the car dealership is a repair shop.'+ iif(week = 7, 'It''s closed on Sundays.', 'It will be open between 09:00 and 20:00.')
+		'Next to the car dealership is a repair shop.' + iif(week = 7, 'It''s closed on Sundays.', 'It will be open between 09:00 and 20:00.') + iif(car > 0 and cardrive = 7, ' Your <<$car>> is currently locked inside.', '')
 	end
 	if hour >= 9 and hour < 17 and week < 6:
 		'The <a href="exec: minut += 5 & gt ''dk'', ''start''">community centre</a> is currently open.'
@@ -166,7 +174,15 @@ if $ARGS[0] = 'redlight':
 	
 	gs 'taxi'
 
-	if car > 0 and (cardrive = 3 or (cardrive >= 6 and cardrive <= 9) or cardrive = 27):'In the parking stands your <a href="exec:' + iif(cardrive = 27, '', 'minut += 5 & ') + 'gs ''carF'', ''start''"><<$car>></a>.'
+	if car > 0:
+		if wrek = 0 and ((cardrive = 7 and func('autoservisF', 'is_open') = 0) or (cardrive = 9 and func('autotraidF', 'is_open') = 0)):
+			'It looks like the ' + iif(cardrive = 7, 'repair shop', 'car dealership') + ' moved your car outside before they closed.'
+			cardrive = 3
+		end
+		if cardrive = 3 or cardrive = 6 or (cardrive = 7 and func('autoservisF', 'is_open')) or (cardrive = 9 and func('autotraidF', 'is_open')) or cardrive = 27:
+			'In the parking stands your <a href="exec:' + iif(cardrive = 27, '', 'minut += 5 & ') + 'gs ''carF'', ''start''"><<$car>></a>.'
+		end
+	end
 
 	if hour >= 20 or hour <= 4:
 		*nl