Browse Source

Merge remote-tracking branch 'Anjuna/master'

Kevin_Smarts 4 months ago
parent
commit
20166816e9

+ 239 - 71
locations/bus.qsrc

@@ -22,19 +22,23 @@ if $ARGS[0] = 'community':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The community center bus station'
+	'The community center bus stop'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'community'
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
 
 	act 'Walk to the community center (0:01)': minut += 1 & gt 'pav_commcenter'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'community_busses'
+	if transportVars['bus_wait_gadukino'] <= 60:
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'community_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'community_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'community_tickets'
+		'It''s too late to take the bus. The next one arrives in <<transportVars[''bus_wait_gadukino'']/60>> hours'
 	end
 
 elseif $ARGS[0] = 'community_tickets':
@@ -44,7 +48,13 @@ elseif $ARGS[0] = 'community_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'community'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'community', 'pv'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		act 'Stop looking at the schedule': gt 'bus', 'community_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'community', 'pg'
 
 elseif $ARGS[0] = 'community_busses':
 	$menu_loc = 'bus'
@@ -56,6 +66,12 @@ elseif $ARGS[0] = 'community_busses':
 
 	act 'Leave the platform': gt 'bus', 'community'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		act 'Stop looking at the schedule': gt 'bus', 'community_busses.'
+	end
+
 	act 'Take a bus to the Pavlovsk train station (<<func(''transport_functions'', ''display_bus_timecost'', ''community'', ''pavstation'')>>)':	gt 'bus', 'community_pavstation'
 	act 'Take a bus to the old town district of Pushkin (<<func(''transport_functions'', ''display_bus_timecost'', ''community'', ''pushkin'')>>)':	gt 'bus', 'community_pushkin'
 	act 'Take a bus to the construction site (<<func(''transport_functions'', ''display_bus_timecost'', ''community'', ''construction'')>>)':		gt 'bus', 'community_construction'
@@ -78,20 +94,25 @@ if $ARGS[0] = 'pavstation':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'Bus station near the Pavlovsk train station'
+	'The Pavlovsk train station bus stop'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'pavstation'
-	'The next bus in the direction of the Pavlovsk community center ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
 
 	act 'Walk to the train station (0:02)': minut += 2 & gt 'pav_train_hall'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'pavstation_busses'
+	if transportVars['bus_wait_pavlovsk'] <= 60 or transportVars['bus_wait_gadukino'] <= 60:
+		'The next bus in the direction of the Pavlovsk community center ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'pavstation_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'pavstation_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'pavstation_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_pavlovsk'']/60, transportVars[''bus_wait_gadukino'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'pavstation_tickets':
@@ -101,7 +122,16 @@ elseif $ARGS[0] = 'pavstation_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'pavstation'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'pavstation', 'pv'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		act 'Stop looking at the schedule': gt 'bus', 'pavstation_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'pavstation', 'pg'
 
 elseif $ARGS[0] = 'pavstation_busses':
 	$menu_loc = 'bus'
@@ -114,6 +144,15 @@ elseif $ARGS[0] = 'pavstation_busses':
 
 	act 'Leave the platform': gt 'bus', 'pavstation'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		act 'Stop looking at the schedule': gt 'bus', 'pavstation_busses'
+	end
+
 	act 'Take a bus to the Pavlovsk community center (<<func(''transport_functions'', ''display_bus_timecost'', ''pavstation'', ''community'')>>)':		gt 'bus', 'pavstation_community'
 	act 'Take a bus to the old town district of Pushkin (<<func(''transport_functions'', ''display_bus_timecost'', ''pavstation'', ''pushkin'')>>)':	gt 'bus', 'pavstation_pushkin'
 	act 'Take a bus to the construction site (<<func(''transport_functions'', ''display_bus_timecost'', ''pavstation'', ''construction'')>>)':			gt 'bus', 'pavstation_construction'
@@ -136,20 +175,24 @@ if $ARGS[0] = 'pushkin':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The bus station in old town center of Pushkin'
+	'The bus stop in the old town center of Pushkin'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'pushkin'
-	'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
 
-	act 'Walk to pushkin (0:05)': minut += 5 & !gt '???'
-
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'pushkin_busses'
+	act 'Walk to pushkin (0:05)': minut += 5 & gt 'pushkin'
+
+	if transportVars['bus_wait_pavlovsk'] <= 60 or transportVars['bus_wait_gadukino'] <= 60:
+		'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'pushkin_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'pushkin_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'pushkin_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_pavlovsk'']/60, transportVars[''bus_wait_gadukino'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'pushkin_tickets':
@@ -159,7 +202,16 @@ elseif $ARGS[0] = 'pushkin_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'pushkin'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'pushkin', 'pv'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		act 'Stop looking at the schedule': gt 'bus', 'pushkin_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'pushkin', 'pg'
 
 elseif $ARGS[0] = 'pushkin_busses':
 	$menu_loc = 'bus'
@@ -172,6 +224,15 @@ elseif $ARGS[0] = 'pushkin_busses':
 
 	act 'Leave the platform': gt 'bus', 'pushkin'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		act 'Stop looking at the schedule': gt 'bus', 'pushkin_busses'
+	end
+
 	act 'Take a bus to the Pavlovsk community center (<<func(''transport_functions'', ''display_bus_timecost'', ''pushkin'', ''community'')>>)':	gt 'bus', 'pushkin_community'
 	act 'Take a bus to the Pavlovsk train station (<<func(''transport_functions'', ''display_bus_timecost'', ''pushkin'', ''pavstation'')>>)':		gt 'bus', 'pushkin_pavstation'
 	act 'Take a bus to the construction site (<<func(''transport_functions'', ''display_bus_timecost'', ''pushkin'', ''construction'')>>)':			gt 'bus', 'pushkin_construction'
@@ -194,20 +255,24 @@ if $ARGS[0] = 'construction':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The construction site bus station'
+	'The temporary bus stop near the construction site'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'construction'
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
-	'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
 
 	act 'Walk to the construction site (0:05)': minut += 5 & nroad = 16 & gt 'road'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'construction_busses'
+	if transportVars['bus_wait_pavlovsk'] <= 60 or transportVars['bus_wait_gadukino'] <= 60:
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'construction_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'construction_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'construction_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_pavlovsk'']/60, transportVars[''bus_wait_gadukino'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'construction_tickets':
@@ -217,7 +282,16 @@ elseif $ARGS[0] = 'construction_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'construction'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'construction', 'vp'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		act 'Stop looking at the schedule': gt 'bus', 'construction_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'construction', 'gp'
 
 elseif $ARGS[0] = 'construction_busses':
 	$menu_loc = 'bus'
@@ -230,6 +304,15 @@ elseif $ARGS[0] = 'construction_busses':
 
 	act 'Leave the platform': gt 'bus', 'construction'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'pg'
+		act 'Stop looking at the schedule': gt 'bus', 'construction_busses'
+	end
+
 	act 'Take a bus to the village of Gadukino (<<func(''transport_functions'', ''display_bus_timecost'', ''construction'', ''gadukino'')>>)':			gt 'bus', 'construction_gadukino'
 	act 'Take a bus to the old town district of Pushkin (<<func(''transport_functions'', ''display_bus_timecost'', ''construction'', ''pushkin'')>>)':	gt 'bus', 'construction_pushkin'
 	act 'Take a bus to the Pavlovsk train station (<<func(''transport_functions'', ''display_bus_timecost'', ''construction'', ''pavstation'')>>)':		gt 'bus', 'construction_pavstation'
@@ -252,20 +335,24 @@ if $ARGS[0] = 'gadukino':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The bus station at the forest road of the village of Gadukino'
+	'The bus stop at the forest road of the village of Gadukino'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'gadukino'
-	'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
-	'The next bus in the direction of the suburbs of St. Petersburg ' + iif(transportVars['bus_wait_suburbs'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_suburbs'']>> minutes.')
 
 	act 'Walk to Gadukino (0:01)': minut += 1 & gt 'gadroad'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'gadukino_busses'
+	if transportVars['bus_wait_pavlovsk'] <= 60 or transportVars['bus_wait_suburbs'] <= 60:
+		'The next bus in the direction of Pavlovsk ' + iif(transportVars['bus_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_pavlovsk'']>> minutes.')
+		'The next bus in the direction of the suburbs of St. Petersburg ' + iif(transportVars['bus_wait_suburbs'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_suburbs'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'gadukino_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'gadukino_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'gadukino_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_pavlovsk'']/60, transportVars[''bus_wait_suburbs'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'gadukino_tickets':
@@ -275,8 +362,17 @@ elseif $ARGS[0] = 'gadukino_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'gadukino'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'gadukino', 'vp'
-	gs 'transport_functions', 'buy_bus_ticket', 'gadukino', 'vs'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		act 'Stop looking at the schedule': gt 'bus', 'gadukino_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'gadukino', 'gp'
+	gs 'transport_functions', 'buy_bus_ticket', 'gadukino', 'gs'
 
 elseif $ARGS[0] = 'gadukino_busses':
 	$menu_loc = 'bus'
@@ -289,6 +385,15 @@ elseif $ARGS[0] = 'gadukino_busses':
 
 	act 'Leave the platform': gt 'bus', 'gadukino'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gp'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		act 'Stop looking at the schedule': gt 'bus', 'gadukino_busses'
+	end
+
 	act 'Take a bus to the construction site (<<func(''transport_functions'', ''display_bus_timecost'', ''gadukino'', ''construction'')>>)':			gt 'bus', 'gadukino_construction'
 	act 'Take a bus to the old town district of Pushkin (<<func(''transport_functions'', ''display_bus_timecost'', ''gadukino'', ''pushkin'')>>)':		gt 'bus', 'gadukino_pushkin'
 	act 'Take a bus to the Pavlovsk train station (<<func(''transport_functions'', ''display_bus_timecost'', ''gadukino'', ''pavstation'')>>)':			gt 'bus', 'gadukino_pavstation'
@@ -315,7 +420,7 @@ if $ARGS[0] = 'communal':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The communal village bus station'
+	'The bus stop in the communal village'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'communal'
 	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
@@ -323,12 +428,19 @@ if $ARGS[0] = 'communal':
 
 	act 'Walk to the communal village (0:03)': minut += 3 & gt 'dachi'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'communal_busses'
+	if transportVars['bus_wait_gadukino'] <= 60 or transportVars['bus_wait_suburbs'] <= 60:
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		'The next bus in the direction of the suburbs of St. Petersburg ' + iif(transportVars['bus_wait_suburbs'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_suburbs'']>> minutes.')
+
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'communal_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'communal_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'communal_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_gadukino'']/60, transportVars[''bus_wait_suburbs'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'communal_tickets':
@@ -338,7 +450,16 @@ elseif $ARGS[0] = 'communal_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'communal'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'communal', 'vs'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		act 'Stop looking at the schedule': gt 'bus', 'communal_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'communal', 'gs'
 
 elseif $ARGS[0] = 'communal_busses':
 	$menu_loc = 'bus'
@@ -351,6 +472,15 @@ elseif $ARGS[0] = 'communal_busses':
 
 	act 'Leave the platform': gt 'bus', 'communal'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		act 'Stop looking at the schedule': gt 'bus', 'communal_busses'
+	end
+
 	act 'Take a bus to the village of Gadukino (<<func(''transport_functions'', ''display_bus_timecost'', ''communal'', ''gadukino'')>>)':					gt 'bus', 'communal_gadukino'
 	act 'Take a bus the cemetery outside of St. Petersburg (<<func(''transport_functions'', ''display_bus_timecost'', ''communal'', ''graveyard'')>>)':	gt 'bus', 'communal_graveyard'
 	act 'Take a bus to the the suburbs of St. Petersburg (<<func(''transport_functions'', ''display_bus_timecost'', ''communal'', ''suburbs'')>>)':			gt 'bus', 'communal_suburbs'
@@ -372,20 +502,24 @@ if $ARGS[0] = 'graveyard':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The cemetery bus station'
+	'The cemetery bus stop'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'graveyard'
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
-	'The next bus in the direction of the suburbs of St. Petersburg ' + iif(transportVars['bus_wait_suburbs'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_suburbs'']>> minutes.')
 
 	act 'Walk to the graveyard (0:01)': minut += 1 & nroad = 3 & gt 'road'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'graveyard_busses'
+	if transportVars['bus_wait_gadukino'] <= 60 or transportVars['bus_wait_suburbs'] <= 60:
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		'The next bus in the direction of the suburbs of St. Petersburg ' + iif(transportVars['bus_wait_suburbs'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_suburbs'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'graveyard_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'graveyard_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'graveyard_tickets'
+		'It''s too late to take the bus. The next one arrives in <<min(transportVars[''bus_wait_gadukino'']/60, transportVars[''bus_wait_suburbs'']/60)>> hours.'
 	end
 
 elseif $ARGS[0] = 'graveyard_tickets':
@@ -395,7 +529,16 @@ elseif $ARGS[0] = 'graveyard_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'graveyard'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'graveyard', 'sv'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		act 'Stop looking at the schedule': gt 'bus', 'graveyard_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'graveyard', 'sg'
 
 elseif $ARGS[0] = 'graveyard_busses':
 	$menu_loc = 'bus'
@@ -408,6 +551,15 @@ elseif $ARGS[0] = 'graveyard_busses':
 
 	act 'Leave the platform': gt 'bus', 'communal'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_bus_schedule', 'gs'
+		act 'Stop looking at the schedule': gt 'bus', 'graveyard_busses'
+	end
+
 	act 'Take a bus to the suburbs of St. Petersburg (<<func(''transport_functions'', ''display_bus_timecost'', ''graveyard'', ''suburbs'')>>)':	gt 'bus', 'graveyard_suburbs'
 	act 'Take a bus to the communal village (<<func(''transport_functions'', ''display_bus_timecost'', ''graveyard'', ''communal'')>>)':			gt 'bus', 'graveyard_communal'
 	act 'Take a bus the village of Gadukino (<<func(''transport_functions'', ''display_bus_timecost'', ''graveyard'', ''gadukino'')>>)':			gt 'bus', 'graveyard_gadukino'
@@ -429,19 +581,23 @@ if $ARGS[0] = 'suburbs':
 	gs 'stat'
 
 	'<center><img <<$set_imgh>> src="images/locations/system/image_needed.jpg" ></center>'
-	'The bus station near the suburbs of St. Petersburg'
+	'The bus stop near the suburbs of St. Petersburg'
 	*nl
 	gs 'transport_functions', 'set_bus_wait_time', 'suburbs'
-	'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
 
 	act 'Walk to the suburbs (0:05)': minut += 5 & gt 'city_suburbs', 'start'
 
-	if transportVars['buspass_day'] > daystart:
-		*nl
-		func('transport_functions', 'display_buspass_time')
-		act 'Go to platforms': gt 'bus', 'suburbs_busses'
+	if transportVars['bus_wait_gadukino'] <= 60:
+		'The next bus in the direction of Gadukino ' + iif(transportVars['bus_wait_gadukino'] = 0, 'is leaving now!', 'leaves in <<transportVars[''bus_wait_gadukino'']>> minutes.')
+		if transportVars['buspass_day'] > daystart:
+			*nl
+			func('transport_functions', 'display_buspass_time')
+			act 'Go to platforms': gt 'bus', 'suburbs_busses'
+		else
+			act 'Buy a ticket': gt 'bus', 'suburbs_tickets'
+		end
 	else
-		act 'Buy a ticket': gt 'bus', 'suburbs_tickets'
+		'It''s too late to take the bus. The next one arrives in <<transportVars[''bus_wait_gadukino'']/60>> hours'
 	end
 
 elseif $ARGS[0] = 'suburbs_tickets':
@@ -451,7 +607,13 @@ elseif $ARGS[0] = 'suburbs_tickets':
 	
 	act 'Leave the ticket office': gt 'bus', 'suburbs'
 
-	gs 'transport_functions', 'buy_bus_ticket', 'suburbs', 'sv'
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		act 'Stop looking at the schedule': gt 'bus', 'suburbs_tickets'
+	end
+
+	gs 'transport_functions', 'buy_bus_ticket', 'suburbs', 'sg'
 
 elseif $ARGS[0] = 'suburbs_busses':
 	$menu_loc = 'bus'
@@ -464,6 +626,12 @@ elseif $ARGS[0] = 'suburbs_busses':
 
 	act 'Leave the platform': gt 'bus', 'suburbs'
 
+	act 'Look at the bus schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_bus_schedule', 'sg'
+		act 'Stop looking at the schedule': gt 'bus', 'suburbs_busses'
+	end
+
 	act 'Take a bus the cemetery outside of St. Petersburg (<<func(''transport_functions'', ''display_bus_timecost'', ''suburbs'', ''graveyard'')>>)':	gt 'bus', 'suburbs_graveyard'
 	act 'Take a bus to the communal village (<<func(''transport_functions'', ''display_bus_timecost'', ''suburbs'', ''communal'')>>)':					gt 'bus', 'suburbs_communal'
 	act 'Take a bus the village of Gadukino (<<func(''transport_functions'', ''display_bus_timecost'', ''suburbs'', ''gadukino'')>>)':					gt 'bus', 'suburbs_gadukino'

+ 50 - 28
locations/city_industrial_train.qsrc

@@ -79,6 +79,15 @@ if $ARGS[0] = 'platform':
 
 	act 'Return to the station': minut += 5 & gt 'city_industrial_train', 'inside'
 	
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'city_industrial_train', 'inside'
+	end
+
 	if transportVars['trainpass_day'] > daystart:
 		act 'Take a train to the city center (<<func(''transport_functions'', ''display_train_timecost'', ''ind'', ''center'')>>)': gt 'train', 'ind_center'
 		act 'Take a train to the old platform by the communal village (<<func(''transport_functions'', ''display_train_timecost'', ''ind'', ''communal'')>>)': gt 'train', 'ind_communal'
@@ -87,34 +96,6 @@ if $ARGS[0] = 'platform':
 	end
 end
 
-if $ARGS[0] = 'toilet':
-	$locM_arg = 'toilet'
-	$locM = 'city_industrial_train'
-	$loc_arg = 'toilet'
-	$loc = 'city_industrial_train'
-	$menu_loc = 'city_industrial_train'
-	$menu_arg = 'inside'
-	menu_off = 0
-	$location_type = 'bathroom'
-	$locclass = 'restroom'	
-	*clr & cla
-	gs'stat'
-
-	gs 'themes', 'indoors'
-
-	'<center><img <<$set_imgh>> src="images/locations/shared/bathroom/publictoilet.jpg"></center>'
-
-	act 'Return to the station': minut += 1 & gt 'city_industrial_train', 'inside'
-
-	act 'Look in the mirror': gt 'mirror', 'start'
-	if pcs_hairbsh < 1: act 'Brush your hair': gt 'mirror', 'brush'
-
-	dynamic $tampon
-	dynamic $quickwash
-	dynamic $basin
-	dynamic $publicpan
-end
-
 if $ARGS[0] = 'ticket':
 	$menu_loc = 'city_industrial_train'
 	$menu_arg = 'ticket'
@@ -130,6 +111,15 @@ if $ARGS[0] = 'ticket':
 
 	act 'Leave the ticket office':minut += 1 & gt 'city_industrial_train', 'inside'
 	
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'city_industrial_train', 'ticket'
+	end
+
 	if money >= 50:
 		act 'Buy a ticket':
 			cla
@@ -150,5 +140,37 @@ if $ARGS[0] = 'buy_ticket':
 	gs 'transport_functions', 'buy_train_ticket', 'ind'
 end
 
+
+
+if $ARGS[0] = 'toilet':
+	$locM_arg = 'toilet'
+	$locM = 'city_industrial_train'
+	$loc_arg = 'toilet'
+	$loc = 'city_industrial_train'
+	$menu_loc = 'city_industrial_train'
+	$menu_arg = 'inside'
+	menu_off = 0
+	$location_type = 'bathroom'
+	$locclass = 'restroom'	
+	*clr & cla
+	gs'stat'
+
+	gs 'themes', 'indoors'
+
+	'<center><img <<$set_imgh>> src="images/locations/shared/bathroom/publictoilet.jpg"></center>'
+
+	act 'Return to the station': minut += 1 & gt 'city_industrial_train', 'inside'
+
+	act 'Look in the mirror': gt 'mirror', 'start'
+	if pcs_hairbsh < 1: act 'Brush your hair': gt 'mirror', 'brush'
+
+	dynamic $tampon
+	dynamic $quickwash
+	dynamic $basin
+	dynamic $publicpan
+end
+
+
+
 --- city_industrial_train ---------------------------------
 

+ 13 - 1
locations/city_train.qsrc

@@ -41,6 +41,12 @@ if $ARGS[0] = 'tickets':
 
 	act 'Leave the ticket office': minut += 1 & gt 'city_train', 'start'
 	
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		act 'Stop looking at the schedule': gt 'city_train', 'tickets'
+	end
+
 	act 'Buy a ticket':
 		cla
 		gs 'city_train', 'buy_ticket'
@@ -72,7 +78,13 @@ if $ARGS[0] = 'platform':
 	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
 	
 	act 'Return to the station hall': gt 'city_train', 'start'
-	
+
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		act 'Stop looking at the schedule': gt 'city_train', 'platform'
+	end
+
 	act 'Take a train to the city industrial area (<<func(''transport_functions'', ''display_train_timecost'', ''center'', ''ind'')>>)': gt 'train', 'center_ind'
 	act 'Take a train to the old platform by the communal village (<<func(''transport_functions'', ''display_train_timecost'', ''center'', ''communal'')>>)': gt 'train', 'center_communal'
 	act 'Take a train to the village of Gadukino (<<func(''transport_functions'', ''display_train_timecost'', ''center'', ''gadukino'')>>)': gt 'train', 'center_gadukino'

+ 52 - 39
locations/pav_train_hall.qsrc

@@ -160,7 +160,12 @@ if $ARGS[0] = 'platform':
 	*nl
 	if week >= 6 and hour >= 9 and hour <= 10:'You notice <a href="exec:gt ''gschool_socialchg1'', ''tBella''">Bella</a> standing at the train station platform, looking at the time table.'
 
-	act 'Enter the station building': gt'pav_train_hall'
+	act 'Enter the station building': gt 'pav_train_hall'
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'pav_train_hall', 'platform'
+	end
 
 	if transportVars['trainpass_day'] > daystart:
 		act 'Take the train to the village of Gadukino (<<func(''transport_functions'', ''display_train_timecost'', ''pavlovsk'', ''gadukino'', ''center'')>>)':	gt 'train', 'pavlovsk_gadukino'
@@ -170,6 +175,52 @@ if $ARGS[0] = 'platform':
 	end
 end
 
+
+
+if $ARGS[0] = 'ticket':
+	$menu_loc = 'pav_train_hall'
+	$menu_arg = 'ticket'
+	menu_off = 0
+	*clr & cla
+	gs 'stat'
+	'<center><h2>Ticket office</h2></center>'
+	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/trainstation/ticketoffice.jpg"></center>'
+
+	*nl
+	gs 'transport_functions', 'set_train_wait_time', 'pavlovsk'
+	'The next train in the direction of St. Petersburg city center ' + iif(transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_center'']>> minutes.')
+
+	act 'Leave the ticket office':minut += 1 & gt 'pav_train_hall'
+
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'pav_train_hall', 'ticket'
+	end
+
+	if money >= 50:
+		act 'Buy a ticket':
+			cla
+			gs 'pav_train_hall', 'buy_ticket'
+		end
+	end
+
+	gs 'transport_functions', 'buy_train_pass'
+end
+
+if $ARGS[0] = 'buy_ticket':
+	$menu_loc = 'pav_train_hall'
+	$menu_arg = 'buy_ticket'
+	menu_off = 0
+
+	act 'Leave the ticket office':minut += 1 & gt 'pav_train_hall'
+
+	gs 'transport_functions', 'buy_train_ticket', 'pavlovsk', 'pc'
+end
+
+
+
+
 if $ARGS[0] = 'work':
 	menu_off = 1
 	*clr & cla
@@ -225,44 +276,6 @@ if $ARGS[0] = 'work':
 	act 'Return': gt 'pav_train_hall'
 end
 
-if $ARGS[0] = 'ticket':
-	$menu_loc = 'pav_train_hall'
-	$menu_arg = 'ticket'
-	menu_off = 0
-	*clr & cla
-	gs 'stat'
-	'<center><h2>Ticket office</h2></center>'
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/trainstation/ticketoffice.jpg"></center>'
-
-	*nl
-	gs 'transport_functions', 'set_train_wait_time', 'pavlovsk'
-	'The next train in the direction of St. Petersburg city center ' + iif(transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_center'']>> minutes.')
-
-	act 'Leave the ticket office':minut += 1 & gt 'pav_train_hall'
-
-
-	if money >= 50:
-		act 'Buy a ticket':
-			cla
-			gs 'pav_train_hall', 'buy_ticket'
-		end
-	end
-
-	gs 'transport_functions', 'buy_train_pass'
-end
-
-if $ARGS[0] = 'buy_ticket':
-	$menu_loc = 'pav_train_hall'
-	$menu_arg = 'buy_ticket'
-	menu_off = 0
-
-	act 'Leave the ticket office':minut += 1 & gt 'pav_train_hall'
-
-	gs 'transport_functions', 'buy_train_ticket', 'pavlovsk', 'pc'
-end
-
-
-
 if $ARGS[0] = 'toilet':
 	$menu_loc = 'pav_train_hall'
 	$menu_arg = 'toilet'

+ 37 - 1
locations/train.qsrc

@@ -46,6 +46,15 @@ elseif $ARGS[0] = 'communal_tickets':
 
 	act 'Leave the ticket office': gt 'train', 'communal'
 
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'train', 'communal_tickets'
+	end
+
 	gs 'transport_functions', 'buy_train_ticket', 'communal'
 
 elseif $ARGS[0] = 'communal_trains':
@@ -58,7 +67,16 @@ elseif $ARGS[0] = 'communal_trains':
 	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Leave the platform': gt 'train', 'communal'
-	
+
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		act 'Stop looking at the schedule': gt 'train', 'communal_trains'
+	end
+
 	act 'Take a train to St. Petersburg city center (<<func(''transport_functions'', ''display_train_timecost'', ''communal'', ''center'')>>)': gt 'train', 'communal_center'
 	act 'Take a train to St. Petersburg city industrial area (<<func(''transport_functions'', ''display_train_timecost'', ''communal'', ''ind'')>>)': gt 'train', 'communal_ind'
 	act 'Take a train to the village of Gadukino (<<func(''transport_functions'', ''display_train_timecost'', ''communal'', ''gadukino'')>>)': gt 'train', 'communal_gadukino'
@@ -107,6 +125,15 @@ elseif $ARGS[0] = 'gadukino_tickets':
 	
 	act 'Leave the ticket office': gt 'train', 'gadukino'
 
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule'
+		act 'Stop looking at the schedule': gt 'train', 'gadukino_tickets'
+	end
+
 	gs 'transport_functions', 'buy_train_ticket', 'gadukino', 'pc'
 
 elseif $ARGS[0] = 'gadukino_trains':
@@ -120,6 +147,15 @@ elseif $ARGS[0] = 'gadukino_trains':
 
 	act 'Leave the platform': gt 'train', 'gadukino'
 
+	act 'Look at the train schedule':
+		*clr & cla
+		gs 'transport_functions', 'display_train_schedule', 'pc'
+		*nl
+		*nl
+		gs 'transport_functions', 'display_train_schedule'
+		act 'Stop looking at the schedule': gt 'train', 'gadukino_tickets'
+	end
+
 	act 'Take a train to Pavlovsk (<<func(''transport_functions'', ''display_train_timecost'', ''gadukino'', ''pavlovsk'')>>)': gt 'train', 'gadukino_pavlovsk'
 	act 'Take a train to the communal village (<<func(''transport_functions'', ''display_train_timecost'', ''gadukino'', ''communal'')>>)': gt 'train', 'gadukino_communal'
 	act 'Take a train to St. Petersburg city industrial area (<<func(''transport_functions'', ''display_train_timecost'', ''gadukino'', ''ind'')>>)': gt 'train', 'gadukino_ind'

+ 573 - 48
locations/transport_functions.qsrc

@@ -80,48 +80,111 @@ if $ARGS[0] = 'set_train_ticket':
 	temp_price = transportVars['train_price_<<$ARGS[1]>>_<<$ARGS[2]>>']
 	$temp_time = func('transport_functions', 'display_train_timecost', $ARGS[1], $ARGS[2])
 
-	if money < ARGS[1]:
-		dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<temp_price>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[3]>>'' '
-	else
-		dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<<$temp_time>> - <<temp_price>> <b>₽</b>)'':
-				money -= <<temp_price>>
-				menu_off = 1
-				gt ''train'', ''<<$ARGS[1]>>_<<$ARGS[2]>>''
-			end'
+	if mid($temp_time, 1, 1) < 2:
+		if money < ARGS[1]:
+			dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<temp_price>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[3]>>'' '
+		else
+			dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<<$temp_time>> - <<temp_price>> <b>₽</b>)'':
+					money -= <<temp_price>>
+					menu_off = 1
+					gt ''train'', ''<<$ARGS[1]>>_<<$ARGS[2]>>''
+				end'
+		end
 	end
 	killvar 'temp_price'
+	killvar 'temp_time'
 end
 
 
 !	Time Table:
-!		Bus departs every 20 minutes
+!		Train departs every 15 minutes (between 4:00 and 22:00), 30 minutes (between 22:00 and 01:00) and 60 minute (betweeen 01:00 and 04:00)
 !		pavlovsk (07)	->	gadukino (22)	->	communal (32)	->	ind (42)		->	center
 !		center (02)		->	ind (07)		->	communal (17)	->	gadukino (27)	->	pavlovsk
 
 if $ARGS[0] = 'set_train_wait_time':
-	if hour = 0:
-		time_mod = 30
-	elseif hour <= 3:
-		time_mod = 60
-	elseif hour <= 21:
-		time_mod = 15
-	else
-		time_mod = 30
-	end
-
 	if $ARGS[1] = 'pavlovsk':
-		transportVars['train_wait_center']		= (67 - minut) mod time_mod
+		if hour = 0:
+			transportVars['train_wait_center']		= (67 - minut) mod 30
+		elseif hour <= 3:
+			transportVars['train_wait_center']		= (67 - minut) mod 60
+		elseif hour <= 21:
+			transportVars['train_wait_center']		= (67 - minut) mod 15
+		else
+			transportVars['train_wait_center']		= (67 - minut) mod 30
+		end	
 	elseif $ARGS[1] = 'gadukino':
-		transportVars['train_wait_center']		= (86 - minut) mod time_mod
-		transportVars['train_wait_pavlovsk']	= (87 - minut) mod time_mod
+		if hour = 0:
+			transportVars['train_wait_center']		= (82 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 30
+		elseif hour <= 3 or hour = 4 and minut <= 22:
+			transportVars['train_wait_center']		= (82 - minut) mod 60
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 60
+		elseif hour = 4 and minut <= 27:
+			transportVars['train_wait_center']		= (82 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 60
+		elseif hour <= 21 or hour = 22 and minut <= 7:
+			transportVars['train_wait_center']		= (82 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 15
+		elseif hour = 22 and minut <= 12:
+			transportVars['train_wait_center']		= (82 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 15
+		else
+			transportVars['train_wait_center']		= (82 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 30
+		end
 	elseif $ARGS[1] = 'communal':
-		transportVars['train_wait_center']		= (92 - minut) mod time_mod
-		transportVars['train_wait_pavlovsk']	= (77 - minut) mod time_mod
+		if hour = 0 or hour = 1 and minut <= 2:
+			transportVars['train_wait_center']		= (92 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 30
+		elseif hour <= 3 or hour = 4 and minut <= 17:
+			transportVars['train_wait_center']		= (92 - minut) mod 60
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 60
+		elseif hour = 4 and minut <= 32:
+			transportVars['train_wait_center']		= (92 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 60
+		elseif hour <= 21 or hour = 22 and minut <= 2:
+			transportVars['train_wait_center']		= (92 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 15
+		elseif hour = 22 and minut <= 17:
+			transportVars['train_wait_center']		= (92 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 30
+		else
+			transportVars['train_wait_center']		= (92 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (77 - minut) mod 30
+		end
 	elseif $ARGS[1] = 'ind':
-		transportVars['train_wait_center']		= (102 - minut) mod time_mod
-		transportVars['train_wait_pavlovsk']	= (67 - minut) mod time_mod
+		if hour = 0:
+			transportVars['train_wait_center']		= (102 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 30
+		elseif hour = 1 and minut <= 12:
+			transportVars['train_wait_center']		= (102 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 60
+		elseif hour <= 3:
+			transportVars['train_wait_center']		= (102 - minut) mod 60
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 60
+		elseif hour = 4 and minut <= 42:
+			transportVars['train_wait_center']		= (102 - minut) mod 60
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 15
+		elseif hour <= 21:
+			transportVars['train_wait_center']		= (102 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 15
+		elseif hour = 22 and minut <= 27:
+			transportVars['train_wait_center']		= (102 - minut) mod 15
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 30
+		else
+			transportVars['train_wait_center']		= (102 - minut) mod 30
+			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 30
+		end
 	elseif $ARGS[1] = 'center':
-		transportVars['train_wait_pavlovsk']	= (62 - minut) mod time_mod
+		if hour = 0:
+			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
+		elseif hour <= 3:
+			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 60
+		elseif hour <= 21:
+			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 15
+		else
+			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
+		end
 	end
 end
 
@@ -143,6 +206,151 @@ if $ARGS[0] = 'display_train_timecost':
 	killvar 'temp_hours'
 end
 
+if $ARGS[0] = 'display_train_schedule':
+	if $ARGS[1] = 'pc':
+		$train_schedule += '<center><h2>Pavlovsk - St. Petersburg</h2></center>'
+		$train_schedule += '<br><center><table style="text-align:center">'
+		$train_schedule += '<tr><th></th><th></th><th>Communal</th><th>St. Petersburg</th><th>St. Petersburg</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th></th><th>Communal</th><th>St. Petersburg</th><th>St. Petersburg</th></tr>'
+		$train_schedule += '<tr><th style="border-right:2px solid black">Pavlovsk</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Industrial</th><th>Center</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Pavlovsk</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Center</th></tr>'
+		$train_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
+
+		th[0] = 0
+		:train_schedule_loop1
+			$th[1] = mid(100 + th[0], 2, 2)
+			$th[2] = mid(100 + th[0] + 1, 2, 2)
+
+			th[3] = th[0] + 12
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$train_schedule += '<tr>'
+			$train_schedule += '<td><<$th[1]>>:07</td><td><<$th[1]>>:22</td><td><<$th[1]>>:32</td><td><<$th[1]>>:42</td><td><<$th[1]>>:47</td>'
+			$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			$train_schedule += '<td><<$th[4]>>:07</td><td><<$th[4]>>:22</td><td><<$th[4]>>:32</td><td><<$th[4]>>:42</td><td><<$th[4]>>:47</td>'
+			$train_schedule += '</tr>'
+
+			if th[0] >= 4 or th[3] <= 21:
+				$train_schedule += '<tr>'
+				if th[0] >= 4:
+					$train_schedule += '<td><<$th[1]>>:22</td><td><<$th[1]>>:37</td><td><<$th[1]>>:47</td><td><<$th[1]>>:57</td><td><<$th[2]>>:02</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+				if th[3] <= 21:
+					$train_schedule += '<td><<$th[4]>>:22</td><td><<$th[4]>>:37</td><td><<$th[4]>>:47</td><td><<$th[4]>>:57</td><td><<$th[5]>>:02</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '</tr>'
+			end
+
+			$train_schedule += '<tr>'
+			if th[0] = 0 or th[0] >= 4:
+				$train_schedule += '<td><<$th[1]>>:37</td><td><<$th[1]>>:52</td><td><<$th[2]>>:02</td><td><<$th[2]>>:12</td><td><<$th[2]>>:17</td>'
+			else
+				$train_schedule += '<td colspan=5></td>'
+			end
+			$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			$train_schedule += '<td><<$th[4]>>:22</td><td><<$th[4]>>:37</td><td><<$th[4]>>:47</td><td><<$th[4]>>:57</td><td><<$th[5]>>:02</td></tr>'
+
+			if th[0] >= 4 or th[3] <= 21:
+				$train_schedule += '<tr>'
+				if th[0] >= 4:
+					$train_schedule += '<td><<$th[1]>>:52</td><td><<$th[2]>>:07</td><td><<$th[2]>>:17</td><td><<$th[2]>>:27</td><td><<$th[2]>>:32</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+				if th[3] <= 21:
+					$train_schedule += '<td><<$th[4]>>:52</td><td><<$th[5]>>:07</td><td><<$th[5]>>:17</td><td><<$th[5]>>:27</td><td><<$th[5]>>:32</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '</tr>'
+			end
+
+			$train_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 12: jump 'train_schedule_loop1'
+	else
+		$train_schedule += '<center><h2>St. Petersburg - Pavlovsk</h2></center>'
+		$train_schedule += '<br><center><table style="text-align:center">'
+		$train_schedule += '<tr><th>St. Petersburg</th><th>St. Petersburg</th><th>Communal</th><th></th><th></th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>St. Petersburg</th><th>St. Petersburg</th><th>Communal</th><th></th><th></th></tr>'
+		$train_schedule += '<tr><th style="border-right:2px solid black">Center</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Gadukino</th><th>Pavlovsk</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Center</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Pavlovsk</th></tr>'
+		$train_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
+
+		th[0] = 0
+		:train_schedule_loop2
+			$th[1] = mid(100 + th[0], 2, 2)
+			$th[2] = mid(100 + th[0] + 1, 2, 2)
+
+			th[3] = th[0] + 12
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$train_schedule += '<tr>'
+			$train_schedule += '<td><<$th[1]>>:02</td><td><<$th[1]>>:07</td><td><<$th[1]>>:17</td><td><<$th[1]>>:27</td><td><<$th[1]>>:42</td>'
+			$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			$train_schedule += '<td><<$th[4]>>:02</td><td><<$th[4]>>:07</td><td><<$th[4]>>:17</td><td><<$th[4]>>:27</td><td><<$th[4]>>:42</td>'
+			$train_schedule += '</tr>'
+
+			if th[0] >= 4 or th[3] <= 21:
+				$train_schedule += '<tr>'
+				if th[0] >= 4:
+					$train_schedule += '<td><<$th[1]>>:17</td><td><<$th[1]>>:22</td><td><<$th[1]>>:32</td><td><<$th[1]>>:42</td><td><<$th[1]>>:57</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+				if th[3] <= 21:
+					$train_schedule += '<td><<$th[4]>>:17</td><td><<$th[4]>>:22</td><td><<$th[4]>>:32</td><td><<$th[4]>>:42</td><td><<$th[4]>>:57</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '</tr>'
+			end
+
+			$train_schedule += '<tr>'
+			if th[0] = 0 or th[0] >= 4:
+				$train_schedule += '<td><<$th[1]>>:32</td><td><<$th[1]>>:37</td><td><<$th[1]>>:47</td><td><<$th[1]>>:57</td><td><<$th[2]>>:12</td>'
+			else
+				$train_schedule += '<td colspan=5></td>'
+			end
+			$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			$train_schedule += '<td><<$th[4]>>:32</td><td><<$th[4]>>:37</td><td><<$th[4]>>:47</td><td><<$th[4]>>:57</td><td><<$th[5]>>:12</td></tr>'
+
+			if th[0] >= 4 or th[3] <= 21:
+				$train_schedule += '<tr>'
+				if th[0] >= 4:
+					$train_schedule += '<td><<$th[1]>>:47</td><td><<$th[1]>>:52</td><td><<$th[2]>>:02</td><td><<$th[2]>>:12</td><td><<$th[2]>>:27</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+				if th[3] <= 21:
+					$train_schedule += '<td><<$th[4]>>:47</td><td><<$th[4]>>:52</td><td><<$th[5]>>:02</td><td><<$th[5]>>:12</td><td><<$th[5]>>:27</td>'
+				else
+					$train_schedule += '<td colspan=5></td>'
+				end
+				$train_schedule += '</tr>'
+			end
+			$train_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 12: jump 'train_schedule_loop2'
+	end
+	$train_schedule += '</table></center>'
+
+	'<<$train_schedule>>'
+
+	killvar 'train_schedule'
+	killvar 'th'
+end
+
+
+
 
 if $ARGS[0] = 'init_train_prices':
 	transportVars['train_price_pavlovsk_gadukino']	= func('transport_functions', 'get_train_price', 'pavlovsk', 'gadukino')
@@ -290,19 +498,19 @@ end
 
 
 if $ARGS[0] = 'buy_bus_ticket':
-	if $ARGS[2] = 'pv':
+	if $ARGS[2] = 'pg':
 		if $ARGS[1] ! 'community':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'community',	'the Pavlovsk community center'
 		if $ARGS[1] ! 'pavstation':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'pavstation',	'the Pavlovsk train station'
 		if $ARGS[1] ! 'pushkin':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'pushkin',		'the old town of Pushkin'
 		if $ARGS[1] ! 'construction':	gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'construction',	'the construction site'
 		if $ARGS[1] ! 'gadukino':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'gadukino',		'the village of Gadukino'
-	elseif $ARGS[2] = 'vp':
+	elseif $ARGS[2] = 'gp':
 		if $ARGS[1] ! 'gadukino':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'gadukino',		'the village of Gadukino'
 		if $ARGS[1] ! 'construction':	gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'construction',	'the construction site'
 		if $ARGS[1] ! 'pushkin':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'pushkin',		'the old town of Pushkin'
 		if $ARGS[1] ! 'pavstation':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'pavstation',	'the Pavlovsk train station'
 		if $ARGS[1] ! 'community':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'community',	'the Pavlovsk community center'
-	elseif $ARGS[2] = 'vs':
+	elseif $ARGS[2] = 'gs':
 		if $ARGS[1] ! 'gadukino':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'gadukino',		'the village of Gadukino'
 		if $ARGS[1] ! 'communal':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'communal',		'the communal village'
 		if $ARGS[1] ! 'graveyard':		gs 'transport_functions', 'set_bus_ticket', $ARGS[1],	'graveyard',	'the graveyard'
@@ -344,33 +552,135 @@ end
 
 if $ARGS[0] = 'set_bus_wait_time':
 	if $ARGS[1] = 'community':
-		transportVars['bus_wait_gadukino']	= (73 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_gadukino']	= (313 - minut - hour * 60)
+		elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 53:
+			transportVars['bus_wait_gadukino']	= (73 - minut) mod 20
+		else
+			transportVars['bus_wait_gadukino']	= (433 - minut - (hour-22) * 60)
+		end
 	elseif $ARGS[1] = 'pavstation':
-		transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
-		transportVars['bus_wait_pavlovsk']	= (61 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_gadukino']	= (315 - minut - hour * 60)
+			transportVars['bus_wait_pavlovsk']	= (361 - minut - hour * 60)
+		elseif hour = 5:
+			transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (61 - minut)
+		elseif hour >= 6 and hour <= 22 or hour = 22 and minut <= 55:
+			transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (61 - minut) mod 20
+		elseif hour = 22 or hour = 23 and minut <= 41:
+			transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
+			transportVars['bus_wait_pavlovsk']	= (61 - minut) mod 20
+		else
+			transportVars['bus_wait_gadukino']	= (375 - minut)
+			transportVars['bus_wait_pavlovsk']	= (421 - minut)
+		end
 	elseif $ARGS[1] = 'pushkin':
-		transportVars['bus_wait_gadukino']	= (63 - minut) mod 20
-		transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_gadukino']	= (323 - minut - hour * 60)
+			transportVars['bus_wait_pavlovsk']	= (353 - minut - hour * 60)
+		elseif hour = 5 and minut <= 53:
+			transportVars['bus_wait_gadukino']	= (63 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (53 - minut)
+		elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 55:
+			transportVars['bus_wait_gadukino']	= (63 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
+		elseif hour = 22 or hour = 23 and minut <= 3:
+			transportVars['bus_wait_gadukino']	= (3 - minut)
+			transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
+		elseif hour = 22 or hour = 23 and minut <= 33:
+			transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
+			transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
+		else
+			transportVars['bus_wait_gadukino']	= (383 - minut)
+			transportVars['bus_wait_pavlovsk']	= (413 - minut)
+		end
 	elseif $ARGS[1] = 'construction':
-		transportVars['bus_wait_gadukino']	= (78 - minut) mod 20
-		transportVars['bus_wait_pavlovsk']	= (78 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_gadukino']	= (338 - minut - hour * 60)
+			transportVars['bus_wait_pavlovsk']	= (338 - minut - hour * 60)
+		elseif hour = 5 and minut <= 38:
+			transportVars['bus_wait_gadukino']	= (38 - minut)
+			transportVars['bus_wait_pavlovsk']	= (38 - minut)
+		elseif hour >= 5 and hour <= 22:
+			transportVars['bus_wait_gadukino']	= (78 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (78 - minut) mod 20
+		elseif hour <= 23 and minut <= 18:
+			transportVars['bus_wait_gadukino']	= (18 - minut)
+			transportVars['bus_wait_pavlovsk']	= (18 - minut)
+		else
+			transportVars['bus_wait_gadukino']	= (398 - minut)
+			transportVars['bus_wait_pavlovsk']	= (398 - minut)
+		end
 	elseif $ARGS[1] = 'gadukino':
-		transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
-		transportVars['bus_wait_pavlovsk']	= (65 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_suburbs']	= (315 - minut - hour * 60)
+			transportVars['bus_wait_pavlovsk']	= (313 - minut - hour * 60)
+		elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 53:
+			transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
+		elseif hour = 22 and minut <= 55:
+			transportVars['bus_wait_suburbs']	= (55 - minut)
+			transportVars['bus_wait_pavlovsk']	= (433 - minut - (hour-22) * 60)
+		else
+			transportVars['bus_wait_suburbs']	= (435 - minut - (hour-22) * 60)
+			transportVars['bus_wait_pavlovsk']	= (433 - minut - (hour-22) * 60)
+
+		end
 	elseif $ARGS[1] = 'communal':
-		transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
-		transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_suburbs']	= (335 - minut - hour * 60)
+			transportVars['bus_wait_gadukino']	= (325 - minut - hour * 60)
+		elseif hour = 5 and minut <= 25:
+			transportVars['bus_wait_suburbs']	= (35 - minut)
+			transportVars['bus_wait_gadukino']	= (25 - minut)
+		elseif hour = 5 and minut <= 35:
+			transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
+		elseif hour >= 5 and hour <= 22:
+			transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
+		elseif hour = 23 and minut <= 05:
+			transportVars['bus_wait_suburbs']	= (15 - minut)
+			transportVars['bus_wait_gadukino']	= (05 - minut)
+		elseif hour = 23 and minut <= 15:
+			transportVars['bus_wait_suburbs']	= (15 - minut)
+			transportVars['bus_wait_gadukino']	= (385 - minut)
+		else
+			transportVars['bus_wait_suburbs']	= (395 - minut)
+			transportVars['bus_wait_gadukino']	= (385 - minut)
+		end
 	elseif $ARGS[1] = 'graveyard':
-		transportVars['bus_wait_suburbs']	= (65 - minut) mod 20
-		transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+		if hour <= 4:
+			transportVars['bus_wait_suburbs']	= (345 - minut - hour * 60)
+			transportVars['bus_wait_gadukino']	= (315 - minut - hour * 60)
+		elseif hour = 5 and minut <= 15:
+			transportVars['bus_wait_suburbs']	= (45 - minut)
+			transportVars['bus_wait_gadukino']	= (15 - minut)
+		elseif hour = 5 and minut <= 45:
+			transportVars['bus_wait_suburbs']	= (45 - minut)
+			transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+		elseif hour >= 5 and hour <= 21 or hour = 22 and minut <= 55:
+			transportVars['bus_wait_suburbs']	= (65 - minut) mod 20
+			transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+		elseif hour = 22 or hour = 23 and minut <= 25:
+			transportVars['bus_wait_suburbs']	= (65 - minut) mod 20
+			transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
+		else
+			transportVars['bus_wait_suburbs']	= (405 - minut)
+			transportVars['bus_wait_gadukino']	= (375 - minut)
+		end
 	elseif $ARGS[1] = 'suburbs':
+		if hour <= 4:
+			transportVars['bus_wait_gadukino']	= (305 - minut - hour * 60)
+		elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 45:
+			transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
+		else
+			transportVars['bus_wait_gadukino']	= (425 - minut - (hour-22) * 60)
+		end
 		transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
 	end
-	if hour = 4:
-		transportVars['bus_wait_pavlovsk']	+= (60 - minut)
-		transportVars['bus_wait_gadukino']	+= (60 - minut)
-		transportVars['bus_wait_suburbs']	+= (60 - minut)
-	end
 end
 
 if $ARGS[0] = 'display_buspass_time':
@@ -396,6 +706,221 @@ if $ARGS[0] = 'display_bus_timecost':
 	killvar 'temp_hours'
 end
 
+if $ARGS[0] = 'display_bus_schedule':
+	$bus_schedule = '<center><h4>Bus schedule</h4></center>'
+
+	if $ARGS[1] = 'pg':
+		$bus_schedule += '<center><h2>Pavlovsk - Gadukino</h2></center>'
+		$bus_schedule += '<br><center><table style="text-align:center">'
+		$bus_schedule += '<tr><th>Pavlovsk</th><th>Pavlovsk</th><th></th><th></th><th>Construction</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>Pavlovsk</th><th>Pavlovsk</th><th></th><th>Construction</th><th></th></tr>'
+		$bus_schedule += '<tr><th style="border-right:2px solid black">Community Center</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Site</th><th>Gadukino</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Community Center</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Gadukino</th></tr>'
+		$bus_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
+
+
+		th[0] = 4
+		:bus_schedule_loop1
+			$th[1] = mid(100 + th[0], 2, 2)
+			$th[2] = mid(100 + th[0] + 1, 2, 2)
+
+			th[3] = th[0] + 10
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:13</td><td><<$th[1]>>:15</td><td><<$th[1]>>:23</td><td><<$th[1]>>:38</td><td><<$th[2]>>:03</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:13</td><td><<$th[4]>>:15</td><td><<$th[4]>>:23</td><td><<$th[4]>>:38</td><td><<$th[5]>>:03</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:33</td><td><<$th[1]>>:35</td><td><<$th[1]>>:43</td><td><<$th[1]>>:58</td><td><<$th[2]>>:23</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:33</td><td><<$th[4]>>:35</td><td><<$th[4]>>:43</td><td><<$th[4]>>:58</td><td><<$th[5]>>:23</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:53</td><td><<$th[1]>>:55</td><td><<$th[2]>>:03</td><td><<$th[2]>>:18</td><td><<$th[2]>>:43</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:53</td><td><<$th[4]>>:55</td><td><<$th[5]>>:03</td><td><<$th[5]>>:18</td><td><<$th[5]>>:43</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 14: jump 'bus_schedule_loop1'
+	elseif $ARGS[1] = 'gp':
+		$bus_schedule += '<center><h2>Gadukino - Pavlovsk</h2></center>'
+		$bus_schedule += '<br><center><table style="text-align:center">'
+		$bus_schedule += '<tr><th></th><th>Construction</th><th></th><th>Pavlovsk</th><th>Pavlovsk</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th>Construction</th><th></th><th>Pavlovsk</th><th>Pavlovsk</th></tr>'
+		$bus_schedule += '<tr><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Train Station</th><th>Community center</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Community center</th></tr>'
+		$bus_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
+
+		th[0] = 4
+		:bus_schedule_loop2
+			$th[1] = mid(100 + th[0], 2, 2)
+			$th[2] = mid(100 + th[0] + 1, 2, 2)
+
+			th[3] = th[0] + 10
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:13</td><td><<$th[1]>>:38</td><td><<$th[1]>>:53</td><td><<$th[2]>>:01</td><td><<$th[2]>>:03</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:13</td><td><<$th[4]>>:38</td><td><<$th[4]>>:53</td><td><<$th[5]>>:01</td><td><<$th[5]>>:03</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<tr><td><<$th[1]>>:33</td><td><<$th[1]>>:58</td><td><<$th[2]>>:13</td><td><<$th[2]>>:21</td><td><<$th[2]>>:23</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:33</td><td><<$th[4]>>:58</td><td><<$th[5]>>:13</td><td><<$th[5]>>:21</td><td><<$th[5]>>:23</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:53</td><td><<$th[2]>>:18</td><td><<$th[2]>>:33</td><td><<$th[2]>>:41</td><td><<$th[2]>>:43</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:53</td><td><<$th[5]>>:18</td><td><<$th[5]>>:33</td><td><<$th[5]>>:41</td><td><<$th[5]>>:43</td>'
+			else
+				$bus_schedule += '<td colspan=5></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 14: jump 'bus_schedule_loop2'
+	elseif $ARGS[1] = 'gs':
+		$bus_schedule += '<center><h2>Gadukino - Suburbs</h2></center>'
+		$bus_schedule += '<br><center><table style="text-align:center">'
+		$bus_schedule += '<tr><th></th><th>Communal</th><th></th><th>St. Petersburg</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th>Communal</th><th></th><th>St. Petersburg</th></tr>'
+		$bus_schedule += '<tr><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Cemetary</th><th>Suburbs</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Cemetary</th><th>Suburbs</th></tr>'
+		$bus_schedule += '<tr><td colspan=9 style="border-bottom:2px solid black"></td></tr>'
+
+		th[0] = 4
+		:bus_schedule_loop3
+			$th[1] = mid(100 + th[0], 2, 2)
+			$th[2] = mid(100 + th[0] + 1, 2, 2)
+
+			th[3] = th[0] + 10
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:15</td><td><<$th[1]>>:35</td><td><<$th[1]>>:45</td><td><<$th[1]>>:55</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:15</td><td><<$th[4]>>:35</td><td><<$th[4]>>:45</td><td><<$th[4]>>:55</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:35</td><td><<$th[1]>>:55</td><td><<$th[2]>>:05</td><td><<$th[2]>>:15</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:35</td><td><<$th[4]>>:55</td><td><<$th[5]>>:05</td><td><<$th[5]>>:15</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[4]>>:55</td><td><<$th[5]>>:15</td><td><<$th[5]>>:25</td><td><<$th[5]>>:35</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:55</td><td><<$th[5]>>:15</td><td><<$th[5]>>:25</td><td><<$th[5]>>:35</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr><td colspan=9 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 14: jump 'bus_schedule_loop3'
+	else
+		$bus_schedule += '<center><h2>Suburbs - Gadukino</h2></center>'
+		$bus_schedule += '<br><center><table style="text-align:center">'
+		$bus_schedule += '<tr><th>St. Petersburg</th><th></th><th>Communal</th><th></th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>St. Petersburg</th><th></th><th>Communal</th><th></th></tr>'
+		$bus_schedule += '<tr><th style="border-right:2px solid black">Suburbs</th><th style="border-right:2px solid black">Cemetary</th><th style="border-right:2px solid black">Village</th><th>Gadukino</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Suburbs</th><th style="border-right:2px solid black">Cemetary</th><th style="border-right:2px solid black">Village</th><th>Gadukino</th></tr>'
+		$bus_schedule += '<tr><td colspan=9 style="border-bottom:2px solid black"></td></tr>'
+
+
+		th[0] = 4
+		:bus_schedule_loop4
+			$th[1] = mid(100 + th, 2, 2)
+			$th[2] = mid(100 + th + 1, 2, 2)
+
+			th[3] = th[0] + 10
+			$th[4] = mid(100 + th[3], 2, 2)
+			$th[5] = mid(100 + th[3] + 1, 2, 2)
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:05</td><td><<$th[1]>>:15</td><td><<$th[1]>>:25</td><td><<$th[1]>>:45</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:05</td><td><<$th[4]>>:15</td><td><<$th[4]>>:25</td><td><<$th[4]>>:45</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:25</td><td><<$th[1]>>:35</td><td><<$th[1]>>:45</td><td><<$th[2]>>:05</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:25</td><td><<$th[4]>>:35</td><td><<$th[4]>>:45</td><td><<$th[5]>>:05</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr>'
+			$bus_schedule += '<td><<$th[1]>>:45</td><td><<$th[1]>>:55</td><td><<$th[2]>>:05</td><td><<$th[2]>>:25</td>'
+			$bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
+			if th[3] <= 22:
+				$bus_schedule += '<td><<$th[4]>>:45</td><td><<$th[4]>>:55</td><td><<$th[5]>>:05</td><td><<$th[5]>>:25</td>'
+			else
+				$bus_schedule += '<td colspan=4></td>'
+			end
+			$bus_schedule += '</tr>'
+
+			$bus_schedule += '<tr><td colspan=9 style="border-bottom:1px solid black"></td></tr>'
+
+			th[0] += 1
+		if th[0] < 14: jump 'bus_schedule_loop4'
+	end
+	$bus_schedule += '</table></center>'
+
+	'<<$bus_schedule>>'
+
+	killvar 'bus_schedule'
+	killvar 'th'
+end
+
+
 if $ARGS[0] = 'init_bus_prices':
 	transportVars['bus_price_community_pavstation']		= func('transport_functions', 'get_bus_price', 'community', 'pavstation')
 	transportVars['bus_price_community_pushkin']		= func('transport_functions', 'get_bus_price', 'community', 'pushkin')