summaryrefslogtreecommitdiff
path: root/durt/nodes/(-4117,13,-5765).lua
blob: f1087c7aca8d14ad14cb453fa634624f804810aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--[[Departures North End]]--
local arrivals_indicator = POS(-4107, 20, -5793)
local departures_indicator = POS(-4107, 20, -5791)
local road_loco_storage = POS(-4152,13,-5840)

if event.schedule then
	if event.msg=="send_road_loco" then
		interrupt_pos(road_loco_storage,"departures")
		return
	end
	return
end
if not event.train then return end


if not atc_arrow then --clean up RC from directing RC's
	F.remove_rc_match("DLG_DIR_%S+_N")
	return
end
if F.has_rc("DLG_COLLECT_DEPARTURES") then --road loco has coupled, ready to depart
	F.indicator(departures_indicator, false)
	F.remove_rc("DLG_COLLECT_DEPARTURES")
	step_fc() -- move FC's up to prepare for Tyard classification
	atc_send("SM")
	return
end
-- --we'll deal with the yard shunter later
if F.has_rc("DLG_SHUNTER") then
	F.indicator(departures_indicator, true)
	split_off_locomotive("B0S0A0",1)
	schedule_in("0;20","send_road_loco")
	local cmd = {
		"DLG_HS_N"
	}
	F.add_rc(cmd)
-- 	if not F.indicator(arrivals_indicator) then --send shunter to its storage siding
-- 		F.add_rc({
-- 			"DLG_HS_N",
-- 			"DLG_SHUNTER_Storage"
-- 		})
-- 		return
-- 	end

-- 	--else send shunter to arrivals to continue classification
-- 	F.add_rc({
-- 		"DLG_HS_N",
-- 		"DLG_HS_N_AC",
-- 		"DLG_DIR_Arrivals_SHUNT_N"
-- 	})
-- 	return
end