Ver Fonte

[changed] Moved the temporary variables to `temp_transportVars` and killvared them on site.

anjuna krokus há 3 semanas atrás
pai
commit
afcb6c0469

Diff do ficheiro suprimidas por serem muito extensas
+ 228 - 227
locations/bus.qsrc


+ 2 - 2
locations/bus_events.qsrc

@@ -4,8 +4,8 @@
 transportVars['bus_event_day'] = daystart
 
 if $ARGS[0] = 'events':
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 100:
+	temp_transportVars['rand'] = rand(0, 99)
+	if temp_transportVars['rand'] < 100:
 		gt 'bus_events', 'placeholder'
 	end
 end

+ 5 - 6
locations/city_industrial_train.qsrc

@@ -74,8 +74,8 @@ if $ARGS[0] = 'platform':
 	'When you arrive at the platform, you can''t help but notice it bustling with activity. Lots of passengers are coming and going, all carrying large bags. It feels like it is always busy here, no matter at what time of the day you are here.'
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'ind'
-	'The next train in the direction of the city center ' + iif(transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_center'']>> minutes.')
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of the city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Return to the station': minut += 5 & gt 'city_industrial_train', 'inside'
 	
@@ -106,8 +106,8 @@ if $ARGS[0] = 'ticket':
 	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/trainstation/ticketoffice.jpg"></center>'
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'ind'
-	'The next train in the direction of the city center ' + iif(transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_center'']>> minutes.')
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of the city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Leave the ticket office':minut += 1 & gt 'city_industrial_train', 'inside'
 	
@@ -170,7 +170,6 @@ if $ARGS[0] = 'toilet':
 	dynamic $publicpan
 end
 
-
+killvar 'temp_transportVars'
 
 --- city_industrial_train ---------------------------------
-

+ 4 - 3
locations/city_train.qsrc

@@ -37,7 +37,7 @@ if $ARGS[0] = 'tickets':
 
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'center'
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Leave the ticket office': minut += 1 & gt 'city_train', 'start'
 	
@@ -75,7 +75,7 @@ if $ARGS[0] = 'platform':
 	'When you arrive at the platform, you can''t help but notice it bustling with activity. Lots of passengers are coming and going, all carrying shopping bags. It feels like it is always busy here, no matter at what time of the day it is.'
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'center'
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 	
 	act 'Return to the station hall': gt 'city_train', 'start'
 
@@ -91,5 +91,6 @@ if $ARGS[0] = 'platform':
 	act 'Take a train to Pavlovsk (<<func(''transport_functions'', ''display_train_timecost'', ''center'', ''pavlovsk'')>>)': gt 'train', 'center_pavlovsk'
 end
 
---- city_train ---------------------------------
+killvar 'temp_transportVars'
 
+--- city_train ---------------------------------

+ 3 - 2
locations/graveyard.qsrc

@@ -11,7 +11,8 @@ gs 'stat'
 '<center><img <<$set_imgh>> src="images/locations/graveyard/graveyard.jpg"></center>'
 'A very peaceful place immersed in the silence of circumferential philosophical thoughts about the impermanence of life.'
 'At the far end of the cemetery you can see the dilapidated building, which used to be whether the crypt, or chapel.'
-act 'Exit the highway':minut += 15 & nroad = 3 & gt 'road'
+act 'Exit to the highway': minut += 15 & nroad = 3 & gt 'road'
+act 'Walk to the busstation': minut += 15 & gt 'bus', 'graveyard'
 
 act 'Go to the crypt':
 	cls
@@ -20,7 +21,7 @@ act 'Go to the crypt':
 	'<center><img <<$set_imgh>> src="images/locations/graveyard/graveyard2.jpg"></center>'
 	'Barred windows protect windows covered with dust all around the bushes.'
 
-	act 'Exit the highway':minut += 15 & gt $curloc
+	act 'Exit the highway': minut += 15 & nroad = 3 & gt 'road'
 end
 
 --- graveyard ---------------------------------

+ 4 - 3
locations/pav_train_hall.qsrc

@@ -156,7 +156,7 @@ if $ARGS[0] = 'platform':
 	'Because Pavlovsk is a place that attracts a fair amount of tourists, the station can be quite busy at times. The busiest times on the platforms are between 11:00 and 11:30, and between 18:00 and 18:30 when the long-distance trains are ready for boarding.'
 	*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.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
 	*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.'
 
@@ -190,7 +190,7 @@ if $ARGS[0] = 'ticket':
 
 	*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.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
 
 	act 'Leave the ticket office':minut += 1 & gt 'pav_train_hall'
 
@@ -353,5 +353,6 @@ if $ARGS[0] = 'male':
 	dynamic $basin
 end
 
---- pav_train_hall ---------------------------------
+killvar 'temp_transportVars'
 
+--- pav_train_hall ---------------------------------

+ 10 - 4
locations/saveupdater.qsrc

@@ -2525,10 +2525,6 @@ if temp_current_save_version < 00090200:
 
 
 	! Transport update
-	if arrsize('transportVars') < 70:
-		killvar 'transportVars'
-		gs 'transport_functions', 'init_all'
-	end
 	if Trainpass_day ! 0:	transportVars['trainpass_day'] = Trainpass_day	& killvar 'Trainpass_day'
 	killvar 'train_event'
 
@@ -2884,6 +2880,16 @@ if temp_current_save_version < 00090204:
 	end
 
 	if igor_krossdress > 0 and igor_eqwtday > 0 and igor_progulkaday = 0: igor_krossdress = 0
+
+	if arrsize('transportVars') > 4:
+		copyarr('temp_transportVars', 'transportVars')
+		killvar 'transportVars'
+		transportVars['trainpass_day']		= temp_transportVars['trainpass_day']
+		transportVars['buspass_day']		= temp_transportVars['buspass_day']
+		transportVars['train_event_day']	= temp_transportVars['train_event_day']
+		transportVars['bus_event_day']		= temp_transportVars['bus_event_day']
+		killvar 'temp_transportVars'
+	end
 end
 
 

+ 140 - 140
locations/train.qsrc

@@ -26,8 +26,8 @@ if $ARGS[0] = 'communal':
 	'An old railway platform, it looks like it was abandoned. The sign is no longer legible, but there''s a hand painted sign from the communal cottages not too far away.'
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'communal'
-	'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.')
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Return to the road': minut += 15 & nroad = 5 & gt 'road'
 
@@ -63,8 +63,8 @@ elseif $ARGS[0] = 'communal_trains':
 	menu_off = 0
 
 	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.')
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
 
 	act 'Leave the platform': gt 'train', 'communal'
 
@@ -105,8 +105,8 @@ if $ARGS[0] = 'gadukino':
 	'A fairly nondescript railway platform. The small village of Gadukino where your grandparents reside is not far from here.'
 	*nl
 	gs 'transport_functions', 'set_train_wait_time', 'gadukino'
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
-	'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.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
 
 	act 'Walk to the road (0:15)': minut += 15 & nroad = 10 & gt 'road'
 
@@ -142,8 +142,8 @@ elseif $ARGS[0] = 'gadukino_trains':
 	menu_off = 0
 
 	gs 'transport_functions', 'set_train_wait_time', 'gadukino'
-	'The next train in the direction of Pavlovsk ' + iif(transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<transportVars[''train_wait_pavlovsk'']>> minutes.')
-	'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.')
+	'The next train in the direction of Pavlovsk ' + iif(temp_transportVars['train_wait_pavlovsk'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_pavlovsk'']>> minutes.')
+	'The next train in the direction of St. Petersburg city center ' + iif(temp_transportVars['train_wait_center'] = 0, 'is leaving now!', 'leaves in <<temp_transportVars[''train_wait_center'']>> minutes.')
 
 	act 'Leave the platform': gt 'train', 'gadukino'
 
@@ -184,23 +184,23 @@ if $ARGS[0] = 'center_ind':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_center_ind'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'center', 'ind') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if tranportVars['rand'] <= 9:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 9:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 23:
+		if temp_transportVars['rand'] <= 23:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 31:
+		elseif temp_transportVars['rand'] <= 31:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/indusplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -212,22 +212,22 @@ elseif $ARGS[0] = 'center_communal':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_center_communal'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'center', 'communal') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 19:
+		if temp_transportVars['rand'] <= 19:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/oldplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
+	'After <<temp_transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -239,21 +239,21 @@ elseif $ARGS[0] = 'center_gadukino':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_center_gadukino'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'center', 'gadukino') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 19:
+		if temp_transportVars['rand'] <= 19:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/gadplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -265,25 +265,25 @@ elseif $ARGS[0] = 'center_pavlovsk':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_center_pavlovsk'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'center', 'pavlovsk') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 20:
+		if temp_transportVars['rand'] <= 20:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 45:
+		elseif temp_transportVars['rand'] <= 45:
 			gt 'train_events', 'Gopnik'
-		elseif transportVars['rand'] <= 51:
+		elseif temp_transportVars['rand'] <= 51:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/pavplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -303,24 +303,24 @@ if $ARGS[0] = 'ind_center':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_ind_center'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'ind', 'center') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 9:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 9:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 23:
+		if temp_transportVars['rand'] <= 23:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 31:
+		elseif temp_transportVars['rand'] <= 31:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/electri_' + rand(1,5) + '.jpg"></center>'
 	'You pay for the ticket and board the next train going to the city center.'
-	'After <<transportVars[''timecost'']>> minutes, you see the office blocks and shops at the heart of the city. The train stops at its final destination, the busy station in the city center.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you see the office blocks and shops at the heart of the city. The train stops at its final destination, the busy station in the city center.'
 
 	act 'Get off the train at this station':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
@@ -333,21 +333,21 @@ elseif $ARGS[0] = 'ind_communal':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_ind_communal'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'ind', 'communal') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 17:
+		if temp_transportVars['rand'] <= 17:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/oldplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
+	'After <<temp_transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -359,21 +359,21 @@ elseif $ARGS[0] = 'ind_gadukino':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_ind_gadukino'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'ind', 'gadukino') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 19:
+		if temp_transportVars['rand'] <= 19:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/gadplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -385,26 +385,26 @@ elseif $ARGS[0] = 'ind_pavlovsk':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_ind_pavlovsk'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'ind', 'pavlovsk') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 20:
+		if temp_transportVars['rand'] <= 20:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 45:
+		elseif temp_transportVars['rand'] <= 45:
 			gt 'train_events', 'Gopnik'
-		elseif transportVars['rand'] <= 51:
+		elseif temp_transportVars['rand'] <= 51:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/pavplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -424,21 +424,21 @@ if $ARGS[0] = 'communal_center':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_communal_center'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'communal', 'center') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 19:
+		if temp_transportVars['rand'] <= 19:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
 	act 'Get off the train':
 		if transportVars['train_event_day'] ! daystart and rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -450,21 +450,21 @@ elseif $ARGS[0] = 'communal_ind':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_communal_ind'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'communal', 'ind') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 16:
+		if temp_transportVars['rand'] <= 16:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/indusplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -476,21 +476,21 @@ elseif $ARGS[0] = 'communal_gadukino':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_communal_gadukino'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'communal', 'gadukino') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 16:
+		if temp_transportVars['rand'] <= 16:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/gadplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -502,21 +502,21 @@ elseif $ARGS[0] = 'communal_pavlovsk':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_communal_pavlovsk'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'communal', 'pavlovsk') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 20:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 20:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 28:
+		if temp_transportVars['rand'] <= 28:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/pavplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
 	act 'Get off the train': gt $loc, $loc_arg
 end
 
@@ -533,21 +533,21 @@ if $ARGS[0] = 'gadukino_center':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_gadukino_center'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'gadukino', 'center') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 24:
+		if temp_transportVars['rand'] <= 24:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -559,21 +559,21 @@ elseif $ARGS[0] = 'gadukino_ind':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_gadukino_ind'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'gadukino', 'ind') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 24:
+		if temp_transportVars['rand'] <= 24:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/indusplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -585,21 +585,21 @@ elseif $ARGS[0] = 'gadukino_communal':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_gadukino_communal'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'gadukino', 'communal') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 16:
+		if temp_transportVars['rand'] <= 16:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/oldplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, you arrive at an old railway platform near the communal village.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you arrive at an old railway platform near the communal village.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -611,21 +611,21 @@ elseif $ARGS[0] = 'gadukino_pavlovsk':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_gadukino_pavlovsk'] + transportVars['train_wait_pavlovsk']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'gadukino', 'pavlovsk') + temp_transportVars['train_wait_pavlovsk']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 20:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 20:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 28:
+		if temp_transportVars['rand'] <= 28:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/pavplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, you see the town of Pavlovsk approaching. Pavlovsk Castle is an impressive sight, even from a long distance. The train stops at its final destination, a platform in Pavlovsk station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -645,27 +645,27 @@ if $ARGS[0] = 'pavlovsk_center':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_pavlovsk_center'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 20:
+		if temp_transportVars['rand'] <= 20:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 45:
+		elseif temp_transportVars['rand'] <= 45:
 			gt 'train_events', 'Gopnik'
-		elseif tranportVars['rand'] <= 55:
+		elseif temp_transportVars['rand'] <= 55:
 			gt 'train_events', 'weed'
-		elseif transportVars['rand'] <= 61:
+		elseif temp_transportVars['rand'] <= 61:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -677,25 +677,25 @@ elseif $ARGS[0] = 'pavlovsk_ind':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_pavlovsk_ind'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'ind') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 6:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 6:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 20:
+		if temp_transportVars['rand'] <= 20:
 			gt 'train_events', 'private'
-		elseif transportVars['rand'] <= 45:
+		elseif temp_transportVars['rand'] <= 45:
 			gt 'train_events', 'Gopnik'
-		elseif transportVars['rand'] <= 51:
+		elseif temp_transportVars['rand'] <= 51:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/indusplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city industrial area station.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -707,21 +707,21 @@ elseif $ARGS[0] = 'pavlovsk_communal':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_pavlovsk_communal'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'communal') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 38:
+		if temp_transportVars['rand'] <= 38:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/oldplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
+	'After <<temp_transportVars[''timecost'']>> minutes you arrive at an old railway platform near the communal village.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
@@ -733,28 +733,28 @@ elseif $ARGS[0] = 'pavlovsk_gadukino':
 	$location_type = 'public_indoors'
 	menu_off = 1
 	gs 'transport_functions', 'set_train_wait_time'
-	transportVars['timecost'] = transportVars['train_time_pavlovsk_gadukino'] + transportVars['train_wait_center']
-	minut += transportVars['timecost']
+	temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'gadukino') + temp_transportVars['train_wait_center']
+	minut += temp_transportVars['timecost']
 	gs 'stat'
 
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 10:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 10:
 		gt 'train_incidental', 'events'
 	elseif transportVars['train_event_day'] ! daystart:
-		if transportVars['rand'] <= 19:
+		if temp_transportVars['rand'] <= 19:
 			gt 'train_events', 'events'
 		end
 	end
 
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/gadplat.jpg" ></center>'
-	'After <<transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
+	'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the small station near the village of Gadukino.'
 	act 'Get off the train':
 		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
 		gt $loc, $loc_arg
 	end
 end
 
-
+killvar 'temp_transportVars'
 
 --- train ---------------------------------
 

+ 14 - 16
locations/train_events.qsrc

@@ -3,14 +3,14 @@
 transportVars['train_event_day'] = daystart
 
 if $ARGS[0] = 'events':
-	transportVars['rand'] = rand(1, 100)
-	if transportVars['rand'] <= 15:
+	temp_transportVars['rand'] = rand(1, 100)
+	if temp_transportVars['rand'] <= 15:
 		gt 'train_events', 'oldman'
-	elseif transportVars['rand'] <= 42:
+	elseif temp_transportVars['rand'] <= 42:
 		gt 'train_events', 'fit'
-	elseif transportVars['rand'] <= 77:
+	elseif temp_transportVars['rand'] <= 77:
 		gt 'train_events', 'young'
-	elseif transportVars['rand'] <= 100:
+	elseif temp_transportVars['rand'] <= 100:
 		gt 'train_events', 'breastfeed'
 	else
 		gt $loc, $loc_arg
@@ -498,7 +498,6 @@ end
 !! This currently never triggers!!
 !!only triggered direct from Pav when going to the city center
 if $ARGS[0] = 'weed':
-	transportVars['train_event_day'] = daystart
 	menu_off = 1
 	$loc = 'city_train'
 	$loc_arg = 'start'
@@ -529,12 +528,12 @@ if $ARGS[0] = 'weed':
 
 			act 'Board the train to the city':
 				*clr & cla
-				transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
-				minut += transportVars['timecost']
+				temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
+				minut += temp_transportVars['timecost']
 				gs 'stat'
 
 				'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-				'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
+				'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
 				act 'Get off the train':
 					if rand(1, 100) <= 5: gt 'train_incidental', 'events'
 					gt 'city_train', 'start'
@@ -565,11 +564,11 @@ if $ARGS[0] = 'weed':
 				'It isn''t hard to guess what they were doing to kill time. A part of you wishes you had taken him up on the offer.'
 				act 'Board the train to the city':
 					*clr & cla
-					transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
-					minut += transportVars['timecost']
+					temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
+					minut += temp_transportVars['timecost']
 					gs 'stat'
 					'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-					'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
+					'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
 					act 'Get off the train':
 						if rand(1, 100) <= 5: gt 'train_incidental', 'events'
 						gt 'city_train', 'start'
@@ -619,13 +618,13 @@ if $ARGS[0] = 'weed':
 							gs 'stat'
 							act 'Board the train to the city':
 								*clr & cla
-								transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
-								minut += transportVars['timecost']
+								temp_transportVars['timecost'] = func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
+								minut += temp_transportVars['timecost']
 								gs 'stat'
 								'<center><img <<$set_imgh>> src="images/locations/shared/train/ride.jpg"></center>'
 								'Once on the train, you look around but you don''t see the young man. Perhaps he got on a different car? You go looking for him, passing through a few different sections, hoping to continue what you started and deal with your overwhelming horniness, but after checking the entire train without seeing a hint of him, you give up and find a seat.'
 								'<center><img <<$set_imgh>> src="images/locations/shared/train/cityplat.jpg" ></center>'
-								'After <<transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
+								'After <<temp_transportVars[''timecost'']>> minutes, the train stops at the St. Petersburg city center station. The large office blocks and shopping centers fill your view. This is the train''s final destination.'
 								act 'Get off the train':
 									if rand(1, 100) <= 5: gt 'train_incidental', 'events'
 									gt 'city_train', 'start'
@@ -643,7 +642,6 @@ end
 if $ARGS[0] = 'private':
 	*clr & cla
 	minut -= 35
-	transportVars['train_event_day'] = daystart
 	menu_off = 1
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/locations/shared/train/ride.jpg" ></center>'

+ 123 - 283
locations/transport_functions.qsrc

@@ -1,14 +1,5 @@
 # transport_functions
 
-if $ARGS[0] = 'init_all':
-	gs 'transport_functions', 'init_train_prices'
-	gs 'transport_functions', 'init_train_timecosts'
-	gs 'transport_functions', 'init_bus_prices'
-	gs 'transport_functions', 'init_bus_timecosts'
-end
-
-
-
 	!!=======================================!!
 	!!                                       !!
 	!!                Trains                 !!
@@ -77,7 +68,7 @@ end
 ! $ARGS[2] = destination loc_arg
 ! $ARGS[3] = destination name
 if $ARGS[0] = 'set_train_ticket':
-	temp_price = transportVars['train_price_<<$ARGS[1]>>_<<$ARGS[2]>>']
+	temp_price = func('transport_functions', 'get_train_price', $ARGS[1], $ARGS[2])
 	$temp_time = func('transport_functions', 'display_train_timecost', $ARGS[1], $ARGS[2])
 
 	if mid($temp_time, 1, 1) < 2:
@@ -104,86 +95,86 @@ end
 if $ARGS[0] = 'set_train_wait_time':
 	if $ARGS[1] = 'pavlovsk':
 		if hour = 0:
-			transportVars['train_wait_center']		= (67 - minut) mod 30
+			temp_transportVars['train_wait_center']		= (67 - minut) mod 30
 		elseif hour <= 3:
-			transportVars['train_wait_center']		= (67 - minut) mod 60
+			temp_transportVars['train_wait_center']		= (67 - minut) mod 60
 		elseif hour <= 21:
-			transportVars['train_wait_center']		= (67 - minut) mod 15
+			temp_transportVars['train_wait_center']		= (67 - minut) mod 15
 		else
-			transportVars['train_wait_center']		= (67 - minut) mod 30
+			temp_transportVars['train_wait_center']		= (67 - minut) mod 30
 		end	
 	elseif $ARGS[1] = 'gadukino':
 		if hour = 0:
-			transportVars['train_wait_center']		= (82 - minut) mod 30
-			transportVars['train_wait_pavlovsk']	= (87 - minut) mod 30
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 30
+			temp_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
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 60
+			temp_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
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 30
+			temp_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
+			temp_transportVars['train_wait_center']		= (82 - minut) mod 30
+			temp_transportVars['train_wait_pavlovsk']	= (87 - minut) mod 30
 		end
 	elseif $ARGS[1] = 'communal':
 		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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 30
+			temp_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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 60
+			temp_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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (92 - minut) mod 30
+			temp_transportVars['train_wait_pavlovsk']	= (77 - minut) mod 30
 		end
 	elseif $ARGS[1] = 'ind':
 		if hour = 0:
-			transportVars['train_wait_center']		= (102 - minut) mod 30
-			transportVars['train_wait_pavlovsk']	= (67 - minut) mod 30
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 30
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 30
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 60
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 60
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 15
+			temp_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
+			temp_transportVars['train_wait_center']		= (102 - minut) mod 30
+			temp_transportVars['train_wait_pavlovsk']	= (67 - minut) mod 30
 		end
 	elseif $ARGS[1] = 'center':
 		if hour = 0:
-			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
+			temp_transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
 		elseif hour <= 3:
-			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 60
+			temp_transportVars['train_wait_pavlovsk']	= (62 - minut) mod 60
 		elseif hour <= 21:
-			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 15
+			temp_transportVars['train_wait_pavlovsk']	= (62 - minut) mod 15
 		else
-			transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
+			temp_transportVars['train_wait_pavlovsk']	= (62 - minut) mod 30
 		end
 	end
 end
@@ -193,11 +184,11 @@ if $ARGS[0] = 'display_trainpass_time':
 end
 
 if $ARGS[0] = 'display_train_timecost':
-	temp_mins = transportVars['train_time_<<$ARGS[1]>>_<<$ARGS[2]>>']
+	temp_mins = func('transport_functions', 'get_train_timecost', $ARGS[1], $ARGS[2])
 	if $ARGS[1] = 'pavlovsk' or $ARGS[2] = 'center 'or ($ARGS[1] = 'gadukino' and $ARGS[2] ! 'pavlovsk') or ($ARGS[1] = 'communal' and $ARGS[2] = 'ind'):
-		temp_mins += transportVars['train_wait_center']
+		temp_mins += temp_transportVars['train_wait_center']
 	else
-		temp_mins += transportVars['train_wait_pavlovsk']
+		temp_mins += temp_transportVars['train_wait_pavlovsk']
 	end
 	temp_hours = temp_mins / 60
 	temp_mins = temp_mins mod 60
@@ -351,63 +342,6 @@ end
 
 
 
-
-if $ARGS[0] = 'init_train_prices':
-	transportVars['train_price_pavlovsk_gadukino']	= func('transport_functions', 'get_train_price', 'pavlovsk', 'gadukino')
-	transportVars['train_price_pavlovsk_communal']	= func('transport_functions', 'get_train_price', 'pavlovsk', 'communal')
-	transportVars['train_price_pavlovsk_ind']		= func('transport_functions', 'get_train_price', 'pavlovsk', 'ind')
-	transportVars['train_price_pavlovsk_center']	= func('transport_functions', 'get_train_price', 'pavlovsk', 'center')
-
-	transportVars['train_price_gadukino_pavlovsk']	= transportVars['train_price_pavlovsk_gadukino']
-	transportVars['train_price_gadukino_communal']	= func('transport_functions', 'get_train_price', 'gadukino', 'communal')
-	transportVars['train_price_gadukino_ind']		= func('transport_functions', 'get_train_price', 'gadukino', 'ind')
-	transportVars['train_price_gadukino_center']		= func('transport_functions', 'get_train_price', 'gadukino', 'center')
-
-	transportVars['train_price_communal_pavlovsk']	= transportVars['train_price_pavlovsk_communal']
-	transportVars['train_price_communal_gadukino']	= transportVars['train_price_gadukino_communal']
-	transportVars['train_price_communal_ind']		= func('transport_functions', 'get_train_price', 'communal', 'ind')
-	transportVars['train_price_communal_center']	= func('transport_functions', 'get_train_price', 'communal', 'center')
-
-	transportVars['train_price_ind_pavlovsk']		= transportVars['train_price_pavlovsk_ind']
-	transportVars['train_price_ind_gadukino']		= transportVars['train_price_gadukino_ind']
-	transportVars['train_price_ind_communal']		= transportVars['train_price_communal_ind']
-	transportVars['train_price_ind_center']			= func('transport_functions', 'get_train_price', 'ind', 'center')
-
-	transportVars['train_price_center_pavlovsk']	= transportVars['train_price_pavlovsk_center']
-	transportVars['train_price_center_gadukino']		= transportVars['train_price_gadukino_center']
-	transportVars['train_price_center_communal']	= transportVars['train_price_communal_center']
-	transportVars['train_price_center_ind']			= transportVars['train_price_ind_center']
-end
-
-if $ARGS[0] = 'init_train_timecosts':
-	transportVars['train_time_pavlovsk_gadukino']	= func('transport_functions', 'get_train_timecost', 'pavlovsk', 'gadukino')
-	transportVars['train_time_pavlovsk_communal']	= func('transport_functions', 'get_train_timecost', 'pavlovsk', 'communal')
-	transportVars['train_time_pavlovsk_ind']		= func('transport_functions', 'get_train_timecost', 'pavlovsk', 'ind')
-	transportVars['train_time_pavlovsk_center']		= func('transport_functions', 'get_train_timecost', 'pavlovsk', 'center')
-
-	transportVars['train_time_gadukino_pavlovsk']	= transportVars['train_time_pavlovsk_gadukino']
-	transportVars['train_time_gadukino_communal']	= func('transport_functions', 'get_train_timecost', 'gadukino', 'communal')
-	transportVars['train_time_gadukino_ind']			= func('transport_functions', 'get_train_timecost', 'gadukino', 'ind')
-	transportVars['train_time_gadukino_center']		= func('transport_functions', 'get_train_timecost', 'gadukino', 'center')
-
-	transportVars['train_time_communal_pavlovsk']	= transportVars['train_time_pavlovsk_communal']
-	transportVars['train_time_communal_gadukino']	= transportVars['train_time_gadukino_communal']
-	transportVars['train_time_communal_ind']		= func('transport_functions', 'get_train_timecost', 'communal', 'ind')
-	transportVars['train_time_communal_center']		= func('transport_functions', 'get_train_timecost', 'communal', 'center')
-
-	transportVars['train_time_ind_pavlovsk']		= transportVars['train_time_pavlovsk_ind']
-	transportVars['train_time_ind_gadukino']			= transportVars['train_time_gadukino_ind']
-	transportVars['train_time_ind_communal']		= transportVars['train_time_communal_ind']
-	transportVars['train_time_ind_center']			= func('transport_functions', 'get_train_timecost', 'ind', 'center')
-
-	transportVars['train_time_center_pavlovsk']		= transportVars['train_time_pavlovsk_center']
-	transportVars['train_time_center_gadukino']		= transportVars['train_time_gadukino_center']
-	transportVars['train_time_center_communal']		= transportVars['train_time_communal_center']
-	transportVars['train_time_center_ind']			= transportVars['train_time_ind_center']
-end
-
-
-
 if $ARGS[0] = 'get_train_price':
 	result = func('transport_functions', '_private_train_price', $ARGS[2]) - func('transport_functions', '_private_train_price', $ARGS[1])
 	if result < 0: result *= -1
@@ -553,133 +487,132 @@ end
 if $ARGS[0] = 'set_bus_wait_time':
 	if $ARGS[1] = 'community':
 		if hour <= 4:
-			transportVars['bus_wait_gadukino']	= (313 - minut - hour * 60)
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (73 - minut) mod 20
 		else
-			transportVars['bus_wait_gadukino']	= (433 - minut - (hour-22) * 60)
+			temp_transportVars['bus_wait_gadukino']	= (433 - minut - (hour-22) * 60)
 		end
 	elseif $ARGS[1] = 'pavstation':
 		if hour <= 4:
-			transportVars['bus_wait_gadukino']	= (315 - minut - hour * 60)
-			transportVars['bus_wait_pavlovsk']	= (361 - minut - hour * 60)
+			temp_transportVars['bus_wait_gadukino']	= (315 - minut - hour * 60)
+			temp_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)
+			temp_transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (75 - minut) mod 20
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
+			temp_transportVars['bus_wait_pavlovsk']	= (61 - minut) mod 20
 		else
-			transportVars['bus_wait_gadukino']	= (375 - minut)
-			transportVars['bus_wait_pavlovsk']	= (421 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (375 - minut)
+			temp_transportVars['bus_wait_pavlovsk']	= (421 - minut)
 		end
 	elseif $ARGS[1] = 'pushkin':
 		if hour <= 4:
-			transportVars['bus_wait_gadukino']	= (323 - minut - hour * 60)
-			transportVars['bus_wait_pavlovsk']	= (353 - minut - hour * 60)
+			temp_transportVars['bus_wait_gadukino']	= (323 - minut - hour * 60)
+			temp_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)
+			temp_transportVars['bus_wait_gadukino']	= (63 - minut) mod 20
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (63 - minut) mod 20
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (3 - minut)
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
+			temp_transportVars['bus_wait_pavlovsk']	= (73 - minut) mod 20
 		else
-			transportVars['bus_wait_gadukino']	= (383 - minut)
-			transportVars['bus_wait_pavlovsk']	= (413 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (383 - minut)
+			temp_transportVars['bus_wait_pavlovsk']	= (413 - minut)
 		end
 	elseif $ARGS[1] = 'construction':
 		if hour <= 4:
-			transportVars['bus_wait_gadukino']	= (338 - minut - hour * 60)
-			transportVars['bus_wait_pavlovsk']	= (338 - minut - hour * 60)
+			temp_transportVars['bus_wait_gadukino']	= (338 - minut - hour * 60)
+			temp_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)
+			temp_transportVars['bus_wait_gadukino']	= (38 - minut)
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (78 - minut) mod 20
+			temp_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)
+			temp_transportVars['bus_wait_gadukino']	= (18 - minut)
+			temp_transportVars['bus_wait_pavlovsk']	= (18 - minut)
 		else
-			transportVars['bus_wait_gadukino']	= (398 - minut)
-			transportVars['bus_wait_pavlovsk']	= (398 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (398 - minut)
+			temp_transportVars['bus_wait_pavlovsk']	= (398 - minut)
 		end
 	elseif $ARGS[1] = 'gadukino':
 		if hour <= 4:
-			transportVars['bus_wait_suburbs']	= (315 - minut - hour * 60)
-			transportVars['bus_wait_pavlovsk']	= (313 - minut - hour * 60)
+			temp_transportVars['bus_wait_suburbs']	= (315 - minut - hour * 60)
+			temp_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
+			temp_transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (55 - minut)
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (435 - minut - (hour-22) * 60)
+			temp_transportVars['bus_wait_pavlovsk']	= (433 - minut - (hour-22) * 60)
 
 		end
 	elseif $ARGS[1] = 'communal':
 		if hour <= 4:
-			transportVars['bus_wait_suburbs']	= (335 - minut - hour * 60)
-			transportVars['bus_wait_gadukino']	= (325 - minut - hour * 60)
+			temp_transportVars['bus_wait_suburbs']	= (335 - minut - hour * 60)
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (35 - minut)
+			temp_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
+			temp_transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			temp_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
+			temp_transportVars['bus_wait_suburbs']	= (75 - minut) mod 20
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (15 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (05 - minut)
 		elseif hour = 23 and minut <= 15:
-			transportVars['bus_wait_suburbs']	= (15 - minut)
-			transportVars['bus_wait_gadukino']	= (385 - minut)
+			temp_transportVars['bus_wait_suburbs']	= (15 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (385 - minut)
 		else
-			transportVars['bus_wait_suburbs']	= (395 - minut)
-			transportVars['bus_wait_gadukino']	= (385 - minut)
+			temp_transportVars['bus_wait_suburbs']	= (395 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (385 - minut)
 		end
 	elseif $ARGS[1] = 'graveyard':
 		if hour <= 4:
-			transportVars['bus_wait_suburbs']	= (345 - minut - hour * 60)
-			transportVars['bus_wait_gadukino']	= (315 - minut - hour * 60)
+			temp_transportVars['bus_wait_suburbs']	= (345 - minut - hour * 60)
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (45 - minut)
+			temp_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
+			temp_transportVars['bus_wait_suburbs']	= (45 - minut)
+			temp_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
+			temp_transportVars['bus_wait_suburbs']	= (65 - minut) mod 20
+			temp_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)
+			temp_transportVars['bus_wait_suburbs']	= (65 - minut) mod 20
+			temp_transportVars['bus_wait_gadukino']	= (435 - minut - (hour-22) * 60)
 		else
-			transportVars['bus_wait_suburbs']	= (405 - minut)
-			transportVars['bus_wait_gadukino']	= (375 - minut)
+			temp_transportVars['bus_wait_suburbs']	= (405 - minut)
+			temp_transportVars['bus_wait_gadukino']	= (375 - minut)
 		end
 	elseif $ARGS[1] = 'suburbs':
 		if hour <= 4:
-			transportVars['bus_wait_gadukino']	= (305 - minut - hour * 60)
+			temp_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
+			temp_transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
 		else
-			transportVars['bus_wait_gadukino']	= (425 - minut - (hour-22) * 60)
+			temp_transportVars['bus_wait_gadukino']	= (425 - minut - (hour-22) * 60)
 		end
-		transportVars['bus_wait_gadukino']	= (65 - minut) mod 20
 	end
 end
 
@@ -688,16 +621,7 @@ if $ARGS[0] = 'display_buspass_time':
 end
 
 if $ARGS[0] = 'display_bus_timecost':
-	temp_mins = transportVars['bus_time_<<$ARGS[1]>>_<<$ARGS[2]>>']
-	if $ARGS[1] = 'community' or ($ARGS[1] = 'pavstation' and $ARGS[2] ! 'community') or ($ARGS[1] = 'pushkin' and ($ARGS[2] = 'construction' or $ARGS[2] = 'gadukino')) or $ARGS[1] = 'construction' and $ARGS[2] = 'gadukino':
-		temp_mins += transportVars['bus_wait_gadukino']
-	elseif ($ARGS[1] = 'pavstation' and $ARGS[2] = 'community') or ($ARGS[1] = 'pushkin' and ($ARGS[2] = 'community' or $ARGS[2] = 'pavstation')) or ($ARGS[1] = 'construction' and $ARGS[2] ! 'gadukino') or ($ARGS[1] = 'gadukino' and ($ARGS[2] ! 'communal' and $ARGS[2] ! 'graveyard' and $ARGS[2] ! 'suburbs')):
-		temp_mins += transportVars['bus_wait_pavlovsk']
-	elseif $ARGS[1] = 'suburbs' or ($ARGS[1] = 'graveyard' and $ARGS[2] ! 'suburbs') or $ARGS[1] = 'communal' and $ARGS[2] = 'gadukino':
-		temp_mins += transportVars['bus_wait_gadukino']
-	else
-		temp_mins += transportVars['bus_wait_suburbs']
-	end
+	temp_mins = func('transport_functions', 'get_bus_timecost', $ARGS[1], $ARGS[2]) + func('transport_functions', 'get_bus_wait_time', $ARGS[1], $ARGS[2])
 
 	temp_hours = temp_mins / 60
 	temp_mins = temp_mins mod 60
@@ -921,90 +845,6 @@ if $ARGS[0] = 'display_bus_schedule':
 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')
-	transportVars['bus_price_community_construction']	= func('transport_functions', 'get_bus_price', 'community', 'construction')
-	transportVars['bus_price_community_gadukino']		= func('transport_functions', 'get_bus_price', 'community', 'gadukino')
-
-	transportVars['bus_price_pavstation_community']		= transportVars['bus_price_community_pavstation']
-	transportVars['bus_price_pavstation_pushkin']		= func('transport_functions', 'get_bus_price', 'pavstation', 'pushkin')
-	transportVars['bus_price_pavstation_construction']	= func('transport_functions', 'get_bus_price', 'pavstation', 'construction')
-	transportVars['bus_price_pavstation_gadukino']		= func('transport_functions', 'get_bus_price', 'pavstation', 'gadukino')
-
-	transportVars['bus_price_pushkin_community']		= transportVars['bus_price_community_pushkin']
-	transportVars['bus_price_pushkin_pavstation']		= transportVars['bus_price_pavstation_pushkin']
-	transportVars['bus_price_pushkin_construction']		= func('transport_functions', 'get_bus_price', 'pushkin', 'construction')
-	transportVars['bus_price_pushkin_gadukino']			= func('transport_functions', 'get_bus_price', 'pushkin', 'gadukino')
-
-	transportVars['bus_price_construction_community']	= transportVars['bus_price_community_construction']
-	transportVars['bus_price_construction_pavstation']	= transportVars['bus_price_pavstation_construction']
-	transportVars['bus_price_construction_pushkin']		= transportVars['bus_price_pushkin_construction']
-	transportVars['bus_price_construction_gadukino']	= func('transport_functions', 'get_bus_price', 'construction', 'gadukino')
-
-	transportVars['bus_price_gadukino_community']		= transportVars['bus_price_community_gadukino']
-	transportVars['bus_price_gadukino_pavstation']		= transportVars['bus_price_pavstation_gadukino']
-	transportVars['bus_price_gadukino_pushkin']			= transportVars['bus_price_pushkin_gadukino']
-	transportVars['bus_price_gadukino_construction']	= transportVars['bus_price_gadukino_construction']
-	transportVars['bus_price_gadukino_communal']		= func('transport_functions', 'get_bus_price', 'gadukino', 'communal')
-	transportVars['bus_price_gadukino_graveyard']		= func('transport_functions', 'get_bus_price', 'gadukino', 'graveyard')
-	transportVars['bus_price_gadukino_suburbs']			= func('transport_functions', 'get_bus_price', 'gadukino', 'suburbs')
-
-	transportVars['bus_price_communal_gadukino']		= transportVars['bus_price_gadukino_communal']
-	transportVars['bus_price_communal_graveyard']		= func('transport_functions', 'get_bus_price', 'communal', 'graveyard')
-	transportVars['bus_price_communal_suburbs']			= func('transport_functions', 'get_bus_price', 'communal', 'suburbs')
-
-	transportVars['bus_price_graveyard_gadukino']		= transportVars['bus_price_gadukino_communal']
-	transportVars['bus_price_graveyard_communal']		= transportVars['bus_price_communal_graveyard']
-	transportVars['bus_price_graveyard_suburbs']		= func('transport_functions', 'get_bus_price', 'communal', 'suburbs')
-
-	transportVars['bus_price_suburbs_gadukino']			= transportVars['bus_price_gadukino_communal']
-	transportVars['bus_price_suburbs_communal']			= transportVars['bus_price_communal_graveyard']
-	transportVars['bus_price_suburbs_graveyard']		= transportVars['bus_price_graveyard_suburbs']
-end
-
-if $ARGS[0] = 'init_bus_timecosts':
-	transportVars['bus_time_community_pavstation']		= func('transport_functions', 'get_bus_timecost', 'community', 'pavstation')
-	transportVars['bus_time_community_pushkin']			= func('transport_functions', 'get_bus_timecost', 'community', 'pushkin')
-	transportVars['bus_time_community_construction']	= func('transport_functions', 'get_bus_timecost', 'community', 'construction')
-	transportVars['bus_time_community_gadukino']		= func('transport_functions', 'get_bus_timecost', 'community', 'gadukino')
-
-	transportVars['bus_time_pavstation_community']		= transportVars['bus_time_community_pavstation']
-	transportVars['bus_time_pavstation_pushkin']		= func('transport_functions', 'get_bus_timecost', 'pavstation', 'pushkin')
-	transportVars['bus_time_pavstation_construction']	= func('transport_functions', 'get_bus_timecost', 'pavstation', 'construction')
-	transportVars['bus_time_pavstation_gadukino']		= func('transport_functions', 'get_bus_timecost', 'pavstation', 'gadukino')
-
-	transportVars['bus_time_pushkin_community']			= transportVars['bus_time_community_pushkin']
-	transportVars['bus_time_pushkin_pavstation']		= transportVars['bus_time_pavstation_pushkin']
-	transportVars['bus_time_pushkin_construction']		= func('transport_functions', 'get_bus_timecost', 'pushkin', 'construction')
-	transportVars['bus_time_pushkin_gadukino']			= func('transport_functions', 'get_bus_timecost', 'pushkin', 'gadukino')
-
-	transportVars['bus_time_construction_community']	= transportVars['bus_time_community_construction']
-	transportVars['bus_time_construction_pavstation']	= transportVars['bus_time_pavstation_construction']
-	transportVars['bus_time_construction_pushkin']		= transportVars['bus_time_pushkin_construction']
-	transportVars['bus_time_construction_gadukino']		= func('transport_functions', 'get_bus_timecost', 'construction', 'gadukino')
-
-	transportVars['bus_time_gadukino_community']		= transportVars['bus_time_community_gadukino']
-	transportVars['bus_time_gadukino_pavstation']		= transportVars['bus_time_pavstation_gadukino']
-	transportVars['bus_time_gadukino_pushkin']			= transportVars['bus_time_pushkin_gadukino']
-	transportVars['bus_time_gadukino_construction']		= transportVars['bus_time_gadukino_construction']
-	transportVars['bus_time_gadukino_communal']			= func('transport_functions', 'get_bus_timecost', 'gadukino', 'communal')
-	transportVars['bus_time_gadukino_graveyard']		= func('transport_functions', 'get_bus_timecost', 'gadukino', 'graveyard')
-	transportVars['bus_time_gadukino_suburbs']			= func('transport_functions', 'get_bus_timecost', 'gadukino', 'suburbs')
-
-	transportVars['bus_time_communal_gadukino']			= transportVars['bus_time_gadukino_communal']
-	transportVars['bus_time_communal_graveyard']		= func('transport_functions', 'get_bus_timecost', 'communal', 'graveyard')
-	transportVars['bus_time_communal_suburbs']			= func('transport_functions', 'get_bus_timecost', 'communal', 'suburbs')
-
-	transportVars['bus_time_graveyard_gadukino']		= transportVars['bus_time_gadukino_communal']
-	transportVars['bus_time_graveyard_communal']		= transportVars['bus_time_communal_graveyard']
-	transportVars['bus_time_graveyard_suburbs']			= func('transport_functions', 'get_bus_timecost', 'communal', 'suburbs')
-
-	transportVars['bus_time_suburbs_gadukino']			= transportVars['bus_time_gadukino_communal']
-	transportVars['bus_time_suburbs_communal']			= transportVars['bus_time_communal_graveyard']
-	transportVars['bus_time_suburbs_graveyard']			= transportVars['bus_time_graveyard_suburbs']
-end
-
 
 if $ARGS[0] = 'get_bus_price':
 	result = func('transport_functions', '_private_bus_price', $ARGS[2]) - func('transport_functions', '_private_bus_price', $ARGS[1])

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff