# train
!2021/05/06


	!!============================================!!
	!!                                            !!
	!!               Train Stations               !!
	!!                                            !!
	!!============================================!!


		!!-----------------------!!
		!!                       !!
		!!       communal        !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'communal':
	*clr & cla
	$menu_loc = 'train'
	$menu_arg = 'communal'
	$location_type = 'public_outdoors'
	menu_off = 0
	gs 'stat'
	'<center><img <<$set_imgh>> src="images/locations/shared/train/oldplat.jpg" ></center>'
	'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.')

	act 'Return to the road': minut += 15 & nroad = 5 & gt 'road'

	if transportVars['trainpass_day'] > daystart:
		*nl
		func('transport_functions', 'display_trainpass_time')
		act 'Go to platforms': gt 'train', 'communal_trains'
	else
		act 'Buy a ticket': gt 'train', 'communal_tickets'
	end

elseif $ARGS[0] = 'communal_tickets':
	$menu_loc = 'train'
	$menu_arg = 'communal_tickets'
	menu_off = 0

	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':
	$menu_loc = 'train'
	$menu_arg = '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.')

	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'
	act 'Take a train to Pavlovsk (<<func(''transport_functions'', ''display_train_timecost'', ''communal'', ''pavlovsk'')>>)': gt 'train', 'communal_pavlovsk'
end


		!!-----------------------!!
		!!                       !!
		!!       gadukino        !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'gadukino':
	$loc = 'train'
	$loc_arg = 'gadukino'
	$menu_loc = 'train'
	$menu_arg = 'gadukino'
	$location_type = 'public_outdoors'
	display_bb = 0
	menu_off = 0
	
	*clr & cla
	gs 'stat'
	'<center><img <<$set_imgh>> src="images/locations/shared/train/gadplat.jpg" ></center>'
	'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.')

	act 'Walk to the road (0:15)': minut += 15 & nroad = 10 & gt 'road'

	if transportVars['trainpass_day'] > daystart:
		*nl
		func('transport_functions', 'display_trainpass_time')
		act 'Go to platforms': gt 'train', 'gadukino_trains'
	else
		act 'Buy a ticket': gt 'train', 'gadukino_tickets'
	end

elseif $ARGS[0] = 'gadukino_tickets':
	$menu_loc = 'train'
	$menu_arg = 'gadukino_tickets'
	menu_off = 0
	
	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':
	$menu_loc = 'train'
	$menu_arg = '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.')

	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'
	act 'Take a train to St. Petersburg city center (<<func(''transport_functions'', ''display_train_timecost'', ''gadukino'', ''center'')>>)': gt 'train', 'gadukino_center'
end




	!!============================================!!
	!!                                            !!
	!!              Train Transport               !!
	!!                                            !!
	!!============================================!!


		!!-----------------------!!
		!!                       !!
		!!        center         !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'center_ind':
	$loc = 'city_industrial_train'
	$loc_arg = 'inside'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if tranportVars['rand'] <= 9:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 23:
			gt 'train_events', 'private'
		elseif 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'center_communal':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'


	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'center_gadukino':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'center_pavlovsk':
	$loc = 'pav_train_hall'
	$loc_arg = ''
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 20:
			gt 'train_events', 'private'
		elseif transportVars['rand'] <= 45:
			gt 'train_events', 'Gopnik'
		elseif 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end
end


		!!-----------------------!!
		!!                       !!
		!!      industrial       !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'ind_center':
	$loc = 'city_train'
	$loc_arg = 'start'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 9:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 23:
			gt 'train_events', 'private'
		elseif 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.'

	act 'Get off the train at this station':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'ind_communal':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'ind_gadukino':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'ind_pavlovsk':
	$loc = 'pav_train_hall'
	$loc_arg = ''
	$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']
	gs 'stat'


	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 20:
			gt 'train_events', 'private'
		elseif transportVars['rand'] <= 45:
			gt 'train_events', 'Gopnik'
		elseif 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end
end


		!!-----------------------!!
		!!                       !!
		!!       communal        !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'communal_center':
	$loc = 'city_train'
	$loc_arg = 'start'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if transportVars['train_event_day'] ! daystart and rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'communal_ind':
	$loc = 'city_industrial_train'
	$loc_arg = 'inside'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'communal_gadukino':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'communal_pavlovsk':
	$loc = 'pav_train_hall'
	$loc_arg = ''
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 20:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train': gt $loc, $loc_arg
end


		!!-----------------------!!
		!!                       !!
		!!       gadukino        !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'gadukino_center':
	$loc = 'city_train'
	$loc_arg = 'start'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'gadukino_ind':
	$loc = 'city_industrial_train'
	$loc_arg = 'inside'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'gadukino_communal':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'gadukino_pavlovsk':
	$loc = 'pav_train_hall'
	$loc_arg = ''
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 20:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end
end


		!!-----------------------!!
		!!                       !!
		!!       pavlovsk        !!
		!!                       !!
		!!-----------------------!!

if $ARGS[0] = 'pavlovsk_center':
	$loc = 'city_train'
	$loc_arg = 'start'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 20:
			gt 'train_events', 'private'
		elseif transportVars['rand'] <= 45:
			gt 'train_events', 'Gopnik'
		elseif tranportVars['rand'] <= 55:
			gt 'train_events', 'weed'
		elseif 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'pavlovsk_ind':
	$loc = 'city_industrial_train'
	$loc_arg = 'inside'
	$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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 6:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if transportVars['rand'] <= 20:
			gt 'train_events', 'private'
		elseif transportVars['rand'] <= 45:
			gt 'train_events', 'Gopnik'
		elseif 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'pavlovsk_communal':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end

elseif $ARGS[0] = 'pavlovsk_gadukino':
	$loc = 'train'
	$loc_arg = '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']
	gs 'stat'

	transportVars['rand'] = rand(1, 100)
	if transportVars['rand'] <= 10:
		gt 'train_incidental', 'events'
	elseif transportVars['train_event_day'] ! daystart:
		if 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.'
	act 'Get off the train':
		if rand(1, 100) <= 5: gt 'train_incidental', 'end'
		gt $loc, $loc_arg
	end
end



--- train ---------------------------------

