
// ----------------------------------- Stradom -----------------------------------

event rp_warning:event2 putvalues 1 none -797.663 1 -1305.339 Warning_signal 2 1 endevent

node -1 0 cell_poczatek memcell -798 1 -1304.8 none 0 0 none endmemcell

event change1_cell_poczatek updatevalues 0.0 cell_poczatek * * 1 endevent

node -1 0 cell_stradom memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_stradom updatevalues 0.0 cell_stradom * * 0 endevent

event change1_cell_stradom updatevalues 0.0 cell_stradom * * 1 endevent

event change2_cell_stradom updatevalues 0.0 cell_stradom * * 2 endevent

event zdarzenie_poczatkowe_onstart multiple 10.0 cell_poczatek
	change1_cell_poczatek
	herby_et41
	stradom
condition memcompare * * 0 endevent

event stradom multiple 0.0 none
	CzS_80-
	CzS_79-
	L61-p118.6_Zamykaj
	losuj_stradom
endevent

event losuj_stradom multiple 0.0 cell_stradom
	change1_cell_stradom
	losuj_stradom2
	wywoluj_stradom
condition memcompare * * 0 endevent

event losuj_stradom2 multiple 1.0 none
	change2_cell_stradom
condition propability 0.35 endevent

event wywoluj_stradom multiple 2.0 none
	stradom1
	stradom2
endevent

node -1 0 radio29 sound -19394.993 -9.156 5630.542 radio29.wav endsound
event radio29 sound 0 radio29 1 endevent
node -1 0 none eventlauncher 0 0 0 -1 none 1748 radio29 none end

event stradom1 multiple 35.0 cell_stradom
	CzS_P2_s10
condition memcompare * * 1 endevent

//Ra 2g1h: to może wygasnąć zanim się z peronu ruszy!
event stradom2 multiple 110.0 cell_stradom
	CzS_P2_sz1
condition memcompare * * 2 endevent

event stradom_wyjazd:event2 multiple 0.0 none
	L61-p120.4_zamykaj
endevent

// ----------------------------------- szlak Stradom - Gnaszyn -----------------------------------

node -1 0 cell_gnaszyn memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_gnaszyn updatevalues 0.0 cell_gnaszyn * * 0 endevent

event change1_cell_gnaszyn updatevalues 0.0 cell_gnaszyn * * 1 endevent

event change2_cell_gnaszyn updatevalues 0.0 cell_gnaszyn * * 2 endevent

event losuj_gnaszyn:event1 multiple 0.0 cell_gnaszyn
	change1_cell_gnaszyn
	losuj_gnaszyn2
	wywoluj_gnaszyn
condition memcompare * * 0 endevent

event losuj_gnaszyn2 multiple 1.0 none
	change2_cell_gnaszyn
condition propability 0.5 endevent

event wywoluj_gnaszyn multiple 2.0 none
	gnaszyn1
	gnaszyn2
endevent

event gnaszyn1 multiple 0.0 cell_gnaszyn
	Gn_A_s2
	Gn_O_s2
	Gn_K_s2
	L61-p122.8_zamykaj
condition memcompare * * 1 endevent

event gnaszyn2 multiple 50.0 cell_gnaszyn
	Gn_A_s2
	Gn_O_s2
	Gn_K_s2
	L61-p122.8_zamykaj
condition memcompare * * 2 endevent

// ----------------------------------- szlak Gnaszyn - Blachownia -----------------------------------

node -1 0 cell_blachownia memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_blachownia updatevalues 0.0 cell_blachownia * * 0 endevent

event change1_cell_blachownia updatevalues 0.0 cell_blachownia * * 1 endevent

event change2_cell_blachownia updatevalues 0.0 cell_blachownia * * 2 endevent

event change3_cell_blachownia updatevalues 0.0 cell_blachownia * * 3 endevent

event change4_cell_blachownia updatevalues 0.0 cell_blachownia * * 4 endevent

event losuj_blachownia:event2 multiple 0.0 cell_blachownia
	change1_cell_blachownia
	losuj_blachownia2
	losuj_blachownia3
	losuj_blachownia4
	wywoluj_blachownia
condition memcompare * * 0 endevent

event losuj_blachownia2 multiple 1.0 none
	change2_cell_blachownia
condition propability 0.5 endevent

event losuj_blachownia3 multiple 2.0 none
	change3_cell_blachownia
condition propability 0.333 endevent

event losuj_blachownia4 multiple 3.0 none
	change4_cell_blachownia
condition propability 0.25 endevent

event wywoluj_blachownia multiple 5.0 none
	blachownia1
	blachownia2
	blachownia3
	blachownia4
endevent

event blachownia1 multiple 0.0 cell_blachownia
	L61-p129.1_zamykaj
	L61-p127.8_zamykaj
	Bln_A_s2
	Bln_L_s2
condition memcompare * * 1 endevent

event blachownia2 multiple 60.0 cell_blachownia
	L61-p129.1_zamykaj
	L61-p127.8_zamykaj
	Bln_A_s2
	Bln_L_s2
condition memcompare * * 2 endevent

event blachownia3 multiple 0.0 cell_blachownia
	L61-p129.1_zamykaj
	L61-p127.8_zamykaj
	Bln_A_s13
condition memcompare * * 3 endevent

event blachownia3.1:event1 multiple 10.0 cell_blachownia
	Bln_L_s2
condition memcompare * * 3 endevent

event blachownia4 multiple 10.0 cell_blachownia
	L61-p129.1_zamykaj
	L61-p127.8_zamykaj
	Bln_A_s13
condition memcompare * * 4 endevent

node -1 0 cell1 memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell1 updatevalues 0.0 cell1 * * 0 endevent

event change1_cell1 updatevalues 0.0 cell1 * * 1 endevent

event blachownia4.1:event1 multiple 0.0 cell_blachownia
	blachownia4.2
condition memcompare * * 4 endevent

node -1 0 wyjazd_na_zastepczy_1 sound -10403.791 -9.156 3119.048 wyjazd_na_zastepczy_1.wav endsound
event wyjazd_na_zastepczy_1 sound 0.0 wyjazd_na_zastepczy_1 1 endevent

event blachownia4.2 multiple 30.0 cell1
	wyjazd_na_zastepczy_1
	change1_cell1
	blachownia4.3
condition memcompare * * 0 endevent

event blachownia4.3 multiple 50.0 none
	Bln_L_sz1
endevent

node -1 0 cell2 memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell2 updatevalues 0.0 cell2 * * 0 endevent

event change1_cell2 updatevalues 0.0 cell2 * * 1 endevent

node -1 0 blachownia sound -8468.223 -9.356 2378.522 blachownia.wav endsound
event blachownia sound 0.0 blachownia 1 endevent

event blachownia_cell:event1 multiple 0.0 cell2
	change1_cell2
	blachownia
condition memcompare * * 0 endevent

// ----------------------------------- szlak Blachownia - Herby -----------------------------------

node -1 0 cell_et41 memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_et41 updatevalues 0.0 cell_et41 * * 0 endevent

event change1_cell_et41 updatevalues 0.0 cell_et41 * * 1 endevent

event change2_cell_et41 updatevalues 0.0 cell_et41 * * 2 endevent

event herby_et41 multiple 0.0 cell_et41
	change1_cell_et41
	losuj_herby_et41.2
	wywoluj_herby_et41
condition memcompare * * 0 endevent

event losuj_herby_et41.2 multiple 1.0 none
	change2_cell_et41
condition propability 0.65 endevent

event wywoluj_herby_et41 multiple 2.0 none
	herby_et41.1
	herby_et41.2
endevent

event herby_et41.1 multiple 0.0 cell_et41
	HrS_7ad
	HrS_8bc
	HrS_D_s10
condition memcompare * * 1 endevent

event herby_et41.2 multiple 80.0 cell_et41
	HrS_7ad
	HrS_8bc
	HrS_D_s10
condition memcompare * * 2 endevent

event HrS_B:event1 multiple 20.0 none
	Bln_W_s5
endevent

// ----------------------------------- Herby -----------------------------------

node -1 0 cell_herby_en57 memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_herby_en57 updatevalues 0.0 cell_herby_en57 * * 0 endevent

event change1_cell_herby_en57 updatevalues 0.0 cell_herby_en57 * * 1 endevent

event change2_cell_herby_en57 updatevalues 0.0 cell_herby_en57 * * 2 endevent

event losuj_herby_en57:event2 multiple 0.0 cell_herby_en57
	change1_cell_herby_en57
	losuj_herby_en57.2
	herby_en57.1
condition memcompare * * 0 endevent

event losuj_herby_en57.2 multiple 1.0 none
	change2_cell_herby_en57
condition propability 0.75 endevent

event herby_en57.1 multiple 10.0 cell_herby_en57
	L61-p134.8_zamykaj
	HrS_W_s13
condition memcompare * * 1 endevent

event herby_en57.2:event1 multiple 0.0 cell_herby_en57
	L61-p134.8_zamykaj
	HrS_W_s13
condition memcompare * * 2 endevent

node -1 0 cell_herby memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_herby updatevalues 0.0 cell_herby * * 0 endevent

event change1_cell_herby updatevalues 0.0 cell_herby * * 1 endevent

event change2_cell_herby updatevalues 0.0 cell_herby * * 2 endevent

event change3_cell_herby updatevalues 0.0 cell_herby * * 3 endevent

event losuj_herby:event2 multiple 0.0 cell_herby
	change1_cell_herby
	losuj_herby2
	losuj_herby3
	wywoluj_herby
condition memcompare * * 0 endevent

event losuj_herby2 multiple 1.0 none
	change2_cell_herby
condition propability 0.5 endevent

event losuj_herby3 multiple 2.0 none
	change3_cell_herby
condition propability 0.333 endevent

event wywoluj_herby multiple 5.0 none
	herby1
	herby2
	herby3
endevent

node -1 0 radiotelefon_10 sound -5901.034 -9.156 1438.315 radiotelefon_10.wav endsound
event radiotelefon_10 sound 0.0 radiotelefon_10 1 endevent

event herby1 multiple 0.0 cell_herby
	L61-p134.8_zamykaj
	HrS_34ac
	HrS_36bd
	HrS_R_s2
	Hrs_3bd
	HrS_A_s2
	radiotelefon_10
condition memcompare * * 1 endevent

node -1 0 wjazd_podany sound -5901.034 -9.156 1438.315 wjazd_podany.wav endsound
event wjazd_podany sound 1.0 wjazd_podany 1 endevent

event herby2 multiple 0.0 cell_herby
	Hrs_3bd HrS_A_s5
	wjazd_podany
condition memcompare * * 2 endevent

event herby2.1:event1 multiple 0.0 cell_herby
	L61-p134.8_zamykaj
	HrS_34ac
	HrS_36bd
	HrS_R_sz1
	herby2.2
condition memcompare * * 2 endevent

node -1 0 wyjazd_na_zastepczy_1.1 sound -3693.577 -9.156 -1311.11 wyjazd_na_zastepczy_1.wav endsound
event wyjazd_na_zastepczy_1.1 sound 0.0 wyjazd_na_zastepczy_1.1 1 endevent

event herby2.2 multiple 0.0 cell1
	change1_cell1
	wyjazd_na_zastepczy_1.1
condition memcompare * * 0 endevent

event herby3 multiple 0.0 cell_herby
	Hrs_3bd HrS_A_s5
	wjazd_podany
condition memcompare * * 3 endevent

event herby3.1:event1 multiple 0.0 cell_herby
	L61-p134.8_zamykaj
	HrS_34ac
	HrS_36bd
	HrS_R_s2
condition memcompare * * 3 endevent

node -1 0 gadka1 sound -4572.338 -9.156 748.14 gadka1.wav endsound
event gadka1 sound 0.0 gadka1 1 endevent

event gadka1_cell:event2 multiple 0.0 cell2
	change0_cell2
	gadka1
condition memcompare * * 1 endevent

// ----------------------------------- szlak Herby - Lisów -----------------------------------

node -1 0 szumy sound -2535.632 -9.156 -462.785 szumy.wav endsound
event szumy sound 0.0 szumy 1 endevent

event szumy_cell:event2 multiple 0.0 cell2
	change1_cell2
	szumy
condition memcompare * * 0 endevent

node -1 0 cell_liswarta memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_liswarta updatevalues 0.0 cell_liswarta * * 0 endevent

event change1_cell_liswarta updatevalues 0.0 cell_liswarta * * 1 endevent

node -1 0 l61_tlk-1 sound -2219.118 -9.156 -616.807 l61_tlk-1.wav endsound
event l61_tlk-1 sound 0.0 l61_tlk-1 1 endevent

event liswarta1:event2 multiple 0.0 cell_liswarta
	change1_cell_liswarta
	l61_tlk-1
	L61-p138.6_zamykaj
	Lsw_6-
	Lsw_5-
	Lsw_B_s10
	Lsw_B_w24
condition memcompare * * 0 endevent

node -1 0 przelot sound -215.596 -9.156 -1596.264 przelot.wav endsound
event przelot sound 0.0 przelot 1 endevent

event przelot_cell multiple 0.0 cell2
	change0_cell2
	przelot
condition memcompare * * 1 endevent

node -1 0 cell_lisow memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_lisow updatevalues 0.0 cell_lisow * * 0 endevent

event change1_cell_lisow updatevalues 0.0 cell_lisow * * 1 endevent

event change2_cell_lisow updatevalues 0.0 cell_lisow * * 2 endevent

event change3_cell_lisow updatevalues 0.0 cell_lisow * * 3 endevent

event losuj_lisow:event2 multiple 0.0 cell_lisow
	change1_cell_lisow
	losuj_lisow2
	losuj_lisow3
	wywoluj_lisow
condition memcompare * * 0 endevent

event losuj_lisow2 multiple 1.0 none
	change2_cell_lisow
condition propability 0.2 endevent

event losuj_lisow3 multiple 2.0 none
	change3_cell_lisow
condition propability 0.15 endevent

event wywoluj_lisow multiple 3.0 none
	lisow1
	lisow2
	lisow3
endevent

event lisow1 multiple 0.0 cell_lisow
	L61-p141.5_zamykaj
	Lis_B_s2
	Lis_O_s2
	Lis_O_w24
condition memcompare * * 1 endevent

node -1 0 wjazd_podany1 sound 1119.627 -9.156 -2246.198 wjazd_podany1.wav endsound
event wjazd_podany1 sound 0.0 wjazd_podany1 1 endevent

event lisow2 multiple 0.0 cell_lisow
	L61-p141.5_zamykaj
	Lis_B_s5
	wjazd_podany1
condition memcompare * * 2 endevent

event lisow2.1 multiple 0.0 cell_lisow
	Lis_O_s2
	Lis_O_w24
condition memcompare * * 2 endevent

event lisow3 multiple 0.0 cell_lisow
	L61-p141.5_zamykaj
	Lis_B_s5
	wjazd_podany1
condition memcompare * * 3 endevent

node -1 0 wyjazd_na_sz sound 2807.12 -11.6 -2947.65 wyjazd_na_sz.wav endsound
event wyjazd_na_sz sound 0.0 wyjazd_na_sz 1 endevent

event lisow3.1 multiple 0.0 cell_lisow
	wyjazd_na_sz
	Lis_O_sz1
	Lis_O_w24
condition memcompare * * 3 endevent

event lisow23.1:event2 multiple 0.0 none
	lisow2.1
	lisow3.1
endevent

// ----------------------------------- szlak Lisów - Kochanowice -----------------------------------

node -1 0 cell_kochanowice memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_kochanowice updatevalues 0.0 cell_kochanowice * * 0 endevent

event change1_cell_kochanowice updatevalues 0.0 cell_kochanowice * * 1 endevent

event change2_cell_kochanowice updatevalues 0.0 cell_kochanowice * * 2 endevent

event losuj_kochanowice:event2 multiple 0.0 cell_kochanowice
	change1_cell_kochanowice
	losuj_kochanowice2
	kochanowice1
	kochanowice2
condition memcompare * * 0 endevent

event losuj_kochanowice2 multiple 1.0 none
	change2_cell_kochanowice
condition propability 0.3 endevent

event kochanowice1 multiple 3.0 cell_kochanowice
	L61-p145.3_zamykaj
	Kwc_26+
	Kwc_25+
	Kwc_M_s2
	Kwc_M_w24
	Kwc_B_s2
	lbc_start
condition memcompare * * 1 endevent

node -1 0 robie_dla_pana_wjazd1 sound 4546.677 -11.6 -3847.16 robie_dla_pana_wjazd1.wav endsound
event robie_dla_pana_wjazd1 sound 0.0 robie_dla_pana_wjazd1 1 endevent

event kochanowice2 multiple 4.0 cell_kochanowice
	robie_dla_pana_wjazd1
	L61-p145.3_zamykaj
	Kwc_B_s5
	change0_cell_kochanowice
condition memcompare * * 2 endevent

event Kwc_E:event1 multiple 0.0 cell_kochanowice
	Kwc_26+
	Kwc_25+
	Kwc_M_s2
	Kwc_M_w24
	lbc_start
condition memcompare * * 0 endevent

// ----------------------------------- szlak Kochanowice - Lubliniec -----------------------------------

//Ra 2g1h: teraz wjaz przez Jw_A i na prawy, bo na lewym nie ma semafora
event jw_wjazd_a multiple 40.0 none
	jaw_przejazd1_zamykaj
	lbc_przejazd1_zamykaj
	Jw_4+ Jw_5+ Jw_6- Jw_7-
	Jw_A_s10
endevent

node -1 0 l61_tlk-2 sound 7913.977 -11.6 -8720.34 l61_tlk-2.wav endsound
event l61_tlk-2 sound 0.0 l61_tlk-2 1 endevent

event l61_tlk-2_cell multiple 0.0 cell2
	change1_cell2
	l61_tlk-2
condition memcompare * * 0 endevent

//Ra 2g1h: wyjazd towarowego do Kochanowic - teraz na lewy
event lbc_start multiple 0.0 none
	Jw_E_s10
	Jw_E_w24
	jaw_przejazd1_zamykaj
	lbc_przejazd1_zamykaj
	Jw_4-
	Jw_5-
	//Kwc_21bc
	//Kwc_23-
	//Kwc_25+
	//Kwc_26+
	//Kwc_P_s13
endevent

// ----------------------------------- wjazd na Lubliniec -----------------------------------

node -1 0 cell_lbc memcell -798 1 -1304.8 none 0 0 none endmemcell

event change0_cell_lbc updatevalues 0.0 cell_lbc * * 0 endevent

event change1_cell_lbc updatevalues 0.0 cell_lbc * * 1 endevent

event change2_cell_lbc updatevalues 0.0 cell_lbc * * 2 endevent

event change3_cell_lbc updatevalues 0.0 cell_lbc * * 3 endevent

event change4_cell_lbc updatevalues 0.0 cell_lbc * * 4 endevent

//Ra 2g1h: teraz uruchamia towarowy jadąc lewym
event losuj_lbc:event1 multiple 0.0 cell_lbc
	change1_cell_lbc
	losuj_lbc2
	wywoluj_lbc
	jw_wjazd_a
condition memcompare * * 0 endevent

event losuj_lbc2 multiple 1.0 none
	change2_cell_lbc
condition propability 0.35 endevent

event wywoluj_lbc multiple 2.0 none
	lbc1
endevent

event lbc1 multiple 0.0 cell_lbc
	Lbc_14bd
	Lbc_12bd
	Lbc_5ac
	Lbc_3ac
	Lbc_C_s13
condition memcompare * * 1 endevent

node -1 0 l61_tlk-10 sound 9312.11 -11.6 -8697.229 l61_tlk-10.wav endsound
event l61_tlk-10 sound 0.0 l61_tlk-10 1 endevent

event lbc1.1:event1 multiple 0.0 cell_lbc
	change0_cell_lbc
	l61_tlk-10
condition memcompare * * 1 endevent

node -1 0 l61_tlk-3 sound 8156.806 -11.6 -9099.624 l61_tlk-3.wav endsound
event l61_tlk-3 sound 0.0 l61_tlk-3 1 endevent

event lbc2:event2 multiple 0.0 cell_lbc
	change3_cell_lbc
	l61_tlk-3
condition memcompare * * 2 endevent

node -1 0 l61_tlk-4 sound 8537.091 -11.6 -9140.038 l61_tlk-4.wav endsound
event l61_tlk-4 sound 0.0 l61_tlk-4 1 endevent //dyktowanie rozkazu Lbc_C

event lbc3:event2 multiple 25.0 cell_lbc
	change0_cell_lbc
	l61_tlk-4
	lbc4
condition memcompare * * 3 endevent

event lbc4 multiple 50.0 none
	Lbc_14bd
	Lbc_12bd
	Lbc_5ac
	Lbc_3ac
	Lbc_C_rozkaz
endevent

event Lbc_C_rozkaz updatevalues 0.0 Lbc_C_sem_mem SetVelocity 40 40 endevent //Ra 2f92: formalne zezwolenie na jazdę

//Ra 2g1k: zrobiłem wjazd na prawo od peronu (semafor N), więc manewrów nie będzie
// ----------------------------------- manewry Lubliniec -----------------------------------

event manewry_lbc1:event2 multiple 35.0 none
	przejazd1lbc_zamykaj
	Lbc_94-
	lbc_95-
	Lbc_Tm14_ms2
endevent

node -1 0 l61_tlk-5 sound 10299.545 -11.6 -7761.124 l61_tlk-5.wav endsound
event l61_tlk-5 sound 4.0 l61_tlk-5 1 endevent

event manewry_lbc2:event2 multiple 60.0 none
	przejazd1lbc_zamykaj
	Lbc_J5_ms2 //lbc_i
	Lbc_3ac
	Lbc_5ac
	lbc_103-
	lbc_106bc
	Lbc_Tm14_ms1
	l61_tlk-5
endevent

node -1 0 l61_tlk-6 sound 8805.394 -11.6 -9009.276 l61_tlk-6.wav endsound
event l61_tlk-6 sound 1.0 l61_tlk-6 1 endevent

event manewry_lbc4:event1 multiple 0.0 none
	Lbc_3ad
	Lbc_5bc
	change4_cell_lbc
	l61_tlk-6
endevent

node -1 0 l61_tlk-7 sound 9388.127 -11.6 -8639.866 l61_tlk-7.wav endsound
event l61_tlk-7 sound 0.0 l61_tlk-7 1 endevent

event manewry_lbc5:event1 multiple 0.0 cell_lbc
	l61_tlk-7
condition memcompare * * 4 endevent

node -1 0 l61_tlk-8 sound 9779.636 -11.6 -8259.573 l61_tlk-8.wav endsound
event l61_tlk-8 sound 0.0 l61_tlk-8 1 endevent

node -1 0 l61_tlk-9 sound 9779.636 -11.6 -8259.573 l61_tlk-9.wav endsound
event l61_tlk-9 sound 33.0 l61_tlk-9 1 endevent

event KeyCtrl02 multiple 2.0 cell_lbc
	l61_tlk-8
	l61_tlk-9
	wyjazd_KK
condition memcompare * * 4 endevent

event wyjazd_KK multiple 40.0 none
	Lbc_4bc
	Lbc_7ac
	Lbc_9ad
	Lbc_13+
	lbc_j3_s10
endevent

// ----------------------------------- Koniec -----------------------------------

//---------------------------------------------- Lubliniec - Pawonków ----------------------------------------------

event lbc_jedynka:event2 multiple 30.0 none
	przejazd1lbc_zamykaj
	LBC_przejazd33_zamykaj
	LBC_przejazd03ww_zamykaj
	Lbc_109bd
	Lbc_106bd
	Lbc_103-
	Lbc_M_s10
	//lbc1.2
endevent