// xussr /// header grf { grfid: "AKA\08"; name: string(STR_GRF_NAME); desc: string(STR_GRF_DESC); url: string(STR_GRF_URL); version: 1281; min_compatible_version: 496; param 0 { enable_our_own_tracks { name: string(STR_PARAM_NAME_ENABLE_OUR_OWN_TRACKS); desc: string(STR_PARAM_DESC_ENABLE_OUR_OWN_TRACKS); type: bool; bit: 4; def_value: 1; } enable_icons { name: string(STR_PARAM_NAME_ENABLE_ICONS); desc: string(STR_PARAM_DESC_ENABLE_ICONS); type: bool; bit: 6; def_value: 1; } enable_long_names { name: string(STR_PARAM_NAME_ENABLE_LONG_NAMES); desc: string(STR_PARAM_DESC_ENABLE_LONG_NAMES); type: bool; bit: 7; def_value: 1; } enable_override_cargo { name: string(STR_PARAM_NAME_ENABLE_OVERRIDE_CARGO); desc: string(STR_PARAM_DESC_ENABLE_OVERRIDE_CARGO); type: bool; bit: 3; def_value: 1; } enable_standard_engine { name: string(STR_PARAM_NAME_ENABLE_STANDARD_ENGINE); desc: string(STR_PARAM_DESC_ENABLE_STANDARD_ENGINE); type: bool; bit: 0; def_value: 0; } enable_standard_car { name: string(STR_PARAM_NAME_ENABLE_STANDARD_CAR); desc: string(STR_PARAM_DESC_ENABLE_STANDARD_CAR); type: bool; bit: 1; def_value: 0; } enable_debug_car { name: string(STR_PARAM_NAME_ENABLE_DEBUG_CAR); desc: string(STR_PARAM_DESC_ENABLE_DEBUG_CAR); type: bool; bit: 2; def_value: 0; } enable_debug_cost { name: string(STR_PARAM_NAME_ENABLE_DEBUG_COST); desc: string(STR_PARAM_DESC_ENABLE_DEBUG_COST); type: bool; bit: 5; def_value: 0; } } param 1 { speed_penalty_percent { type: int; name: string(STR_PARAM_NAME_SPEED_PENALTY_PERCENT); desc: string(STR_PARAM_DESC_SPEED_PENALTY_PERCENT); min_value: 10; max_value: 50; def_value: 15; } } /* param 2 { start_year_for_cost { type: int; name: string(STR_PARAM_NAME_START_YEAR); desc: string(STR_PARAM_DESC_START_YEAR); min_value: 0; max_value: 2050; def_value: 0; } } param 3 { inflation_for_cost { type: int; name: string(STR_PARAM_NAME_INFLATION); desc: string(STR_PARAM_DESC_INFLATION); min_value: 0; max_value: 4; def_value: 2; } } */ } /// check // version check // only for OpenTTD >= r23744 // (возможно совместное использование транспорта GRF7 и GRF8 без исключения) if (ttd_platform != PLATFORM_OPENTTD || openttd_version < version_openttd(1, 2, 0, 23744)) { error(ERROR, REQUIRES_OPENTTD, string(STR_MIN_OPENTTD_VERSION)); } // Check for engine pool if (!dynamic_engines) { error(ERROR, USED_WITH, string(STR_USE_ENGINE_POOL)); } // cargotable // Список меток грузов, включая стандартные, тойлэнд, ECS, FIRS // по алфавиту cargotable { AORE, BATT, BDMT, BEER, BRCK, BUBL, CERA, CERE, CLAY, CMNT, COAL, COLA, COPR, CORE, CTCD, DIAM, DYES, ENSP, FERT, FICR, FISH, FMSP, FOOD, FRUT, FRVG, FZDR, GEAR, GLAS, GOLD, GOOD, GRAI, GRVL, IORE, LIME, LVST, MAIL, MAIZ, MILK, MNSP, OIL_, OLSD, PAPR, PASS, PETR, PLST, PLAS, POTA, RCYC, RFPR, RUBR, SAND, SCMT, SGBT, SGCN, STEL, SUGR, SULP, SWET, TOFF, TOUR, TOYS, VALU, VEHI, WATR, WDPR, WHEA, WOOD, WOOL } /// railtypetable // Список меток типов рельсов /* railtypetable { // автономная RLA1: [BAEN, SAEN, RAIL], RLA2: [BBEN, SBEN, RAIL], RLA3: [BCEN, SCEN, RAIL], // переменного тока ERA1: [BAEA, SAEA, ELRL], ERA2: [BBEA, SBEA, ELRL], ERA3: [BCEA, SCEA, ELRL], // постоянного тока ERD1: [BAED, SAED, ELRL], ERD2: [BBED, SBED, ELRL], ERD3: [BCED, SCED, ELRL], // двусистемная ER2S: [BBEE, SBEE, ELRL], RAIL, ELRL, BAEN, SAEN, BBEN, SBEN, BCEN, SCEN, BAEA, SAEA, BBEA, SBEA, BCEA, SCEA, BAED, SAED, BBED, SBED, BCED, SCED, BBEE, SBEE } */ /* railtypetable { // автономная RLA1: [BAEN, SAEN, RAIL], // переменного тока ERA1: [BAEA, BAEE, SAEA, SAEE, ELRL], // постоянного тока ERD1: [BAED, BAEE, SAED, DAEE, ELRL], // двусистемная ER2S: [BAEE, SAEE, ELRL] } */ railtypetable { RAIL, ELRL, // автономная RLA1, RLA2, RLA3, // переменного тока ERA1, ERA2, ERA3, // постоянного тока ERD1, ERD2, ERD3, // двусистемная ER2S } /// railsprite // Шаблоны template catenary_wire_template(x, y) { [x, y, 32, 26, -29, -11] [x+48, y, 32, 26, -1, -12] [x+96, y, 32, 11, -1, -12] [x+144, y, 1, 26, 1, -13] [x+160, y, 32, 34, -29, -11] [x+208, y, 32, 19, -1, -4] [x+256, y, 32, 19, -29, -4] [x+302, y, 32, 34, -1, -12] [x, y+43, 32, 26, -29, -11] [x+48, y+43, 32, 26, -1, -12] [x+96, y+43, 32, 11, -1, -12] [x+144, y+43, 1, 25, 1, -13] [x+160, y+43, 32, 34, -29, -11] [x+208, y+43, 32, 19, -1, -4] [x+256, y+43, 32, 19, -29, -4] [x+302, y+43, 32, 34, -1, -12] [x, y+86, 32, 26, -29, -11] [x+48, y+86, 32, 26, -1, -12] [x+96, y+86, 32, 11, -1, -12] [x+144, y+86, 1, 26, 1, -13] [x+160, y+86, 32, 34, -29, -11] [x+208, y+86, 32, 19, -1, -4] [x+256, y+86, 32, 19, -29, -4] [x+302, y+86, 32, 34, -1, -12] [x, y+129, 16, 18, -29, -3] [x+32, y+129, 16, 18, -1, -12] [x+64, y+129, 16, 18, -13, -11] [x+96, y+129, 16, 18, 15, -4] } template pylons_template(x, y) { [x, y, 12, 28, -9, -25] [x+32, y, 12, 30, 0, -28] [x+64, y, 12, 30, -1, -25] [x+96, y, 12, 30, -9, -27] [x+115, y, 6, 28, -2, -26] [x+131, y, 6, 30, -2, -27] [x+147, y, 14, 28, -3, -26] [x+179, y, 14, 28, -10, -26] } spriteset(erac_catenary_wire, "src/railtype/erac-catenary-wire-pylons.png") { catenary_wire_template(5, 27) } spriteset(erac_catenary_pylons, "src/railtype/erac-catenary-wire-pylons.png") { pylons_template(5, 191) } spriteset(erdc_catenary_wire, "src/railtype/erdc-catenary-wire-pylons.png") { catenary_wire_template(5, 27) } spriteset(erdc_catenary_pylons, "src/railtype/erdc-catenary-wire-pylons.png") { pylons_template(5, 191) } spriteset(erds_catenary_wire, "src/railtype/erds-catenary-wire-pylons.png") { catenary_wire_template(5, 230) } spriteset(erds_catenary_pylons, "src/railtype/erds-catenary-wire-pylons.png") { pylons_template(5, 394) } // Шаблоны рельсов template rail_gui_template(x, y) { // иконки [ x, y, 20, 20, 0, 0] [ x+32, y, 20, 20, 0, 0] [ x+64, y, 20, 20, 0, 0] [ x+96, y, 20, 20, 0, 0] [x+128, y, 20, 20, 0, 0] [x+334, y, 20, 20, 0, 0] [x+382, y, 20, 20, 0, 0] [x+430, y, 20, 20, 0, 0] // курсоры [ x, y+42, 38, 30, -4, -14] [ x+48, y+42, 72, 44, -16, -8] [x+128, y+42, 44, 34, -21, -2] [x+180, y+42, 72, 44, -16, -35] [x+260, y+42, 56, 36, 0, 0] [x+324, y+42, 32, 32, 0, 0] [x+372, y+42, 32, 32, 0, 0] [x+420, y+42, 32, 32, 0, 0] } template rail_track_overlay_template(x, y) { [ x, y, 64, 31, -31, 0] [ x+80, y, 64, 31, -31, 0] [x+160, y, 64, 16, -31, 0] [x+240, y, 64, 16, -31, 15] [x+320, y, 32, 31, 1, 0] [x+368, y, 32, 31, -31, 0] [x+416, y, 64, 39, -31, -8] [x+496, y, 64, 23, -31, 0] [x+576, y, 64, 23, -31, 0] [x+656, y, 64, 39, -31, -8] } template rail_underlay_template(x, y) { [ x, y, 64, 31, -31, 0] [ x+80, y, 64, 31, -31, 0] [x+160, y, 64, 16, -31, 0] [x+240, y, 64, 16, -31, 15] [x+320, y, 32, 31, 1, 0] [x+368, y, 32, 31, -31, 0] [x+416, y, 64, 39, -31, -8] [x+496, y, 64, 23, -31, 0] [x+576, y, 64, 23, -31, 0] [x+656, y, 64, 39, -31, -8] [x+736, y, 64, 31, -31, 0] [x+160, y+164, 64, 31, -31, 0] [x+240, y+164, 64, 31, -31, 0] [x+320, y+164, 64, 31, -31, 0] [x+400, y+164, 64, 31, -31, 0] [x+480, y+164, 64, 31, -31, 0] } template rail_tunnels_template(x, y) { [ x, y, 64, 31, -31, 1] [ x+80, y, 64, 31, -31, 1] [x+160, y, 64, 31, -31, 1] [x+240, y, 64, 31, -31, 1] } template rail_bridge_surfaces_template(x, y) { [ x, y, 64, 32, -31, 0] [ x+80, y, 64, 32, -31, 0] [x+416, y, 64, 39, -31, -8] [x+496, y, 64, 23, -31, 0] [x+576, y, 64, 23, -31, 0] [x+656, y, 64, 39, -31, -8] } template rail_depot_template(x, y) { [ x+40, y+61, 24, 25, 9, -2] [ x, y, 64, 53, -9, -37] [ x+80, y+61, 24, 25, -31, -2] [ x+80, y, 64, 53, -53, -37] [x+240, y, 64, 53, -53, -37] [x+160, y, 64, 53, -9, -37] } template rail_depot_snow_template(x, y) { [ x+40, y+61, 24, 25, 9, -2] [ x, y, 64, 53, -9, -37] [ x+80, y+61, 24, 25, -31, -2] [ x+80, y, 64, 53, -53, -37] [x+240, y, 64, 53, -53, -37] [x+160, y, 64, 53, -9, -37] } spriteset(rail_gui, "src/railtype/rail1.png") { rail_gui_template(2, 22) } spriteset(rail_track_overlay, "src/railtype/rail1.png") { rail_track_overlay_template(2, 131) } spriteset(rail_underlay, "src/railtype/rail1.png") { rail_underlay_template(2, 185) } spriteset(rail_tunnels, "src/railtype/rail1.png") { rail_tunnels_template(2, 291) } spriteset(rail_bridge_surfaces, "src/railtype/rail1.png") { rail_bridge_surfaces_template(2, 239) } spriteset(rail2_gui, "src/railtype/rail2.png") { rail_gui_template(2, 22) } spriteset(rail2_track_overlay, "src/railtype/rail2.png") { rail_track_overlay_template(2, 131) } spriteset(rail2_underlay, "src/railtype/rail2.png") { rail_underlay_template(2, 185) } spriteset(rail2_tunnels, "src/railtype/rail2.png") { rail_tunnels_template(2, 291) } spriteset(rail2_bridge_surfaces, "src/railtype/rail2.png") { rail_bridge_surfaces_template(2, 239) } spriteset(rail3_gui, "src/railtype/rail3.png") { rail_gui_template(2, 22) } spriteset(rail3_track_overlay, "src/railtype/rail3.png") { rail_track_overlay_template(2, 131) } spriteset(rail3_underlay, "src/railtype/rail3.png") { rail_underlay_template(2, 185) } spriteset(rail3_tunnels, "src/railtype/rail3.png") { rail_tunnels_template(2, 291) } spriteset(rail3_bridge_surfaces, "src/railtype/rail3.png") { rail_bridge_surfaces_template(2, 239) } spriteset(raila_track_overlay, "src/railtype/rails-all-in-snow.png") { rail_track_overlay_template(2, 131) } spriteset(raila_underlay, "src/railtype/rails-all-in-snow.png") { rail_underlay_template(2, 185) } spriteset(raila_tunnels, "src/railtype/rails-all-in-snow.png") { rail_tunnels_template(2, 291) } spriteset(raila_bridge_surfaces, "src/railtype/rails-all-in-snow.png") { rail_bridge_surfaces_template(2, 239) } // Депо spriteset(rail_depot, "src/railtype/depot.png") { rail_depot_template(2, 24) } spriteset(rail_depot_snow, "src/railtype/depot.png") { rail_depot_snow_template(2, 117) } // Шаблоны для переездов template level_crossings_railway_template(x, y, filename) { [ x, y, 64, 31, -31, 0, filename] [ x+80, y, 64, 31, -31, 0, filename] } // A open level crossing with warning lights and signs template level_crossings_1_template(x, y, filename) { [ x, y, 7, 13, 0, 0, filename] [ x+50, y, 7, 13, -3, -9, filename] [x+100, y, 7, 13, -6, -10, filename] [x+150, y, 7, 13, 0, 0, filename] [x+200, y, 7, 13, -1, -9, filename] [x+250, y, 7, 13, 0, 0, filename] [x+300, y, 7, 13, 0, 0, filename] [x+350, y, 7, 13, -2, -11, filename] } // A half barrier level crossing template level_crossings_2_open_template(x, y, filename) { [ x, y, 7, 20, 0, 0, filename] [ x+48, y, 9, 20, -9, -13, filename] [x+100, y, 9, 20, -8, -18, filename] [x+150, y, 7, 20, 0, 0, filename] [x+198, y, 9, 20, 1, -14, filename] [x+250, y, 7, 20, 0, 0, filename] [x+300, y, 7, 20, 0, 0, filename] [x+350, y, 9, 20, 2, -19, filename] } template level_crossings_2_closed_template(x, y, filename) { [ x, y, 7, 20, 0, 0, filename] [ x+48, y, 22, 25, -9, -13, filename] [ x+87, y, 22, 25, -21, -18, filename] [x+150, y, 7, 20, 0, 0, filename] [x+198, y, 22, 20, 1, -14, filename] [x+250, y, 7, 20, 0, 0, filename] [x+300, y, 7, 20, 0, 0, filename] [x+337, y, 22, 20, -11, -19, filename] } spriteset(rail_1_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_1_template(10, 133, "src/railtype/crossing1.png") } spriteset(rail_1_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_1_template(10, 170, "src/railtype/crossing1.png") } spriteset(rail_1_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_1_template(10, 207, "src/railtype/crossing1.png") } spriteset(rail_2_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_2_open_template(10, 133, "src/railtype/crossing2.png") } spriteset(rail_2_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_2_closed_template(10, 170, "src/railtype/crossing2.png") } spriteset(rail_2_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail1.png") level_crossings_2_closed_template(10, 217, "src/railtype/crossing2.png") } spriteset(rail2_1_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_1_template(10, 133, "src/railtype/crossing1.png") } spriteset(rail2_1_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_1_template(10, 170, "src/railtype/crossing1.png") } spriteset(rail2_1_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_1_template(10, 207, "src/railtype/crossing1.png") } spriteset(rail2_2_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_2_open_template(10, 133, "src/railtype/crossing2.png") } spriteset(rail2_2_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_2_closed_template(10, 170, "src/railtype/crossing2.png") } spriteset(rail2_2_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail2.png") level_crossings_2_closed_template(10, 217, "src/railtype/crossing2.png") } spriteset(rail3_1_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_1_template(10, 133, "src/railtype/crossing1.png") } spriteset(rail3_1_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_1_template(10, 170, "src/railtype/crossing1.png") } spriteset(rail3_1_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_1_template(10, 207, "src/railtype/crossing1.png") } spriteset(rail3_2_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_2_open_template(10, 133, "src/railtype/crossing2.png") } spriteset(rail3_2_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_2_closed_template(10, 170, "src/railtype/crossing2.png") } spriteset(rail3_2_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rail3.png") level_crossings_2_closed_template(10, 217, "src/railtype/crossing2.png") } spriteset(raila_1_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_1_template(10, 133, "src/railtype/crossing1.png") } spriteset(raila_1_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_1_template(10, 170, "src/railtype/crossing1.png") } spriteset(raila_1_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_1_template(10, 207, "src/railtype/crossing1.png") } spriteset(raila_2_level_crossings_open) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_2_open_template(10, 133, "src/railtype/crossing2.png") } spriteset(raila_2_level_crossings_closed) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_2_closed_template(10, 170, "src/railtype/crossing2.png") } spriteset(raila_2_level_crossings_closed_big) { level_crossings_railway_template(2, 349, "src/railtype/rails-all-in-snow.png") level_crossings_2_closed_template(10, 217, "src/railtype/crossing2.png") } // забор template fences_none_template(x, y) { [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] [ x, y, 1, 1, 0, 0] } template fences_template(x, y) { [ x, y, 34, 22, -31+2, -5+1] [ x+48, y, 34, 22, 0-1, -5] [ x+96, y, 4, 35, 0, -18] [ x+112, y, 66, 8, -31, -5] [ x+192, y, 34, 14, -31+2, -5+1] [ x+240, y, 34, 14, 0-1, -5] [ x+288, y, 34, 30, -31+2, -13+1] [ x+336, y, 34, 30, 0-1, -13] } spriteset(fences, "src/railtype/fence.png") { fences_template(1, 1) } spriteset(fences_none, "src/railtype/fence.png") { fences_none_template(1, 1) } /// railaction // Переезды // Учитываем level_crossing_status, town_zone, terrain_type switch (FEAT_RAILTYPES, SELF, get_rail_level_crossings, (terrain_type == TILETYPE_SNOW) + (town_zone == TOWNZONE_EDGE) * 2 + (level_crossing_status == LEVEL_CROSSING_CLOSED) * 4) { 0: rail_2_level_crossings_open; // нет снега, город, открыто 1: raila_2_level_crossings_open; // снег, город, открыто 2: rail_1_level_crossings_open; // нет снега, за городом, открыто 3: raila_1_level_crossings_open; // снег, за городом, открыто 4: rail_2_level_crossings_closed_big; // нет снега, город, закрыто 5: raila_2_level_crossings_closed_big; // снег, город, закрыто 6: rail_1_level_crossings_closed_big; // нет снега, за городом, закрыто raila_1_level_crossings_closed_big; // снег, за городом, закрыто } switch (FEAT_RAILTYPES, SELF, get_rail2_level_crossings, (terrain_type == TILETYPE_SNOW) + (town_zone == TOWNZONE_EDGE) * 2 + (level_crossing_status == LEVEL_CROSSING_CLOSED) * 4) { 0: rail2_2_level_crossings_open; // нет снега, город, открыто 1: raila_2_level_crossings_open; // снег, город, открыто 2: rail2_1_level_crossings_open; // нет снега, за городом, открыто 3: raila_1_level_crossings_open; // снег, за городом, открыто 4: rail2_2_level_crossings_closed_big; // нет снега, город, закрыто 5: raila_2_level_crossings_closed_big; // снег, город, закрыто 6: rail2_1_level_crossings_closed_big; // нет снега, за городом, закрыто raila_1_level_crossings_closed_big; // снег, за городом, закрыто } switch (FEAT_RAILTYPES, SELF, get_rail3_level_crossings, (terrain_type == TILETYPE_SNOW) + (town_zone == TOWNZONE_EDGE) * 2 + (level_crossing_status == LEVEL_CROSSING_CLOSED) * 4) { 0: rail3_2_level_crossings_open; // нет снега, город, открыто 1: raila_2_level_crossings_open; // снег, город, открыто 2: rail3_1_level_crossings_open; // нет снега, за городом, открыто 3: raila_1_level_crossings_open; // снег, за городом, открыто 4: rail3_2_level_crossings_closed_big; // нет снега, город, закрыто 5: raila_2_level_crossings_closed_big; // снег, город, закрыто 6: rail3_1_level_crossings_closed_big; // нет снега, за городом, закрыто raila_1_level_crossings_closed_big; // снег, за городом, закрыто } switch (FEAT_RAILTYPES, SELF, get_rail_track_overlay, terrain_type) { TILETYPE_SNOW: raila_track_overlay; rail_track_overlay; } switch (FEAT_RAILTYPES, SELF, get_rail2_track_overlay, terrain_type) { TILETYPE_SNOW: raila_track_overlay; rail2_track_overlay; } switch (FEAT_RAILTYPES, SELF, get_rail3_track_overlay, terrain_type) { TILETYPE_SNOW: raila_track_overlay; rail3_track_overlay; } switch (FEAT_RAILTYPES, SELF, get_rail_underlay, terrain_type) { TILETYPE_SNOW: raila_underlay; rail_underlay; } switch (FEAT_RAILTYPES, SELF, get_rail2_underlay, terrain_type) { TILETYPE_SNOW: raila_underlay; rail2_underlay; } switch (FEAT_RAILTYPES, SELF, get_rail3_underlay, terrain_type) { TILETYPE_SNOW: raila_underlay; rail3_underlay; } switch (FEAT_RAILTYPES, SELF, get_rail_tunnels, terrain_type) { TILETYPE_SNOW: raila_tunnels; rail_tunnels; } switch (FEAT_RAILTYPES, SELF, get_rail2_tunnels, terrain_type) { TILETYPE_SNOW: raila_tunnels; rail2_tunnels; } switch (FEAT_RAILTYPES, SELF, get_rail3_tunnels, terrain_type) { TILETYPE_SNOW: raila_tunnels; rail3_tunnels; } switch (FEAT_RAILTYPES, SELF, get_rail_bridge_surfaces, terrain_type) { TILETYPE_SNOW: raila_bridge_surfaces; rail_bridge_surfaces; } switch (FEAT_RAILTYPES, SELF, get_rail2_bridge_surfaces, terrain_type) { TILETYPE_SNOW: raila_bridge_surfaces; rail2_bridge_surfaces; } switch (FEAT_RAILTYPES, SELF, get_rail3_bridge_surfaces, terrain_type) { TILETYPE_SNOW: raila_bridge_surfaces; rail3_bridge_surfaces; } // Депо switch (FEAT_RAILTYPES, SELF, rail_depots, terrain_type ) { TILETYPE_SNOW: rail_depot_snow; rail_depot; } /// railtracks if (enable_our_own_tracks) { /// Пути эпохи индустриализации, пути промпредприятий /// с испокон веков (в XLS с 1880?) // Автономная железная дорога item (FEAT_RAILTYPES, rla1) { property { label: "RLA1"; introduction_date: date(0, 1, 1); name: string(STR_RAIL_NAME); toolbar_caption: string(STR_RAIL_TOOLBAR); menu_text: string(STR_RAIL_MENU); build_window_caption: string(STR_RAIL_BUILD_CAPTION); autoreplace_text: string(STR_RAIL_AUTOREPLACE); new_engine_text: string(STR_RAIL_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 64; speed_limit: 62.5 mph; // 100 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 8; sort_order: 0x08; alternative_railtype_list: ["RAIL"]; } graphics { gui: rail_gui; track_overlay: get_rail_track_overlay; underlay: get_rail_underlay; tunnels: get_rail_tunnels; bridge_surfaces: get_rail_bridge_surfaces; level_crossings: get_rail_level_crossings; fences: fences_none; depots: rail_depots; } } // электрифицированная железная дорога переменного тока // electrified railway AC (alternate current) item (FEAT_RAILTYPES, era1) { property { label: "ERA1"; introduction_date: date(1954, 1, 1); name: string(STR_ERAC_NAME); toolbar_caption: string(STR_ERAC_TOOLBAR); menu_text: string(STR_ERAC_MENU); build_window_caption: string(STR_ERAC_BUILD_CAPTION); autoreplace_text: string(STR_ERAC_AUTOREPLACE); new_engine_text: string(STR_ERAC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERA1", "ERA2", "ERA3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 256; speed_limit: 62.5 mph; // 100 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 149; sort_order: 0x18; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail_gui; track_overlay: get_rail_track_overlay; underlay: get_rail_underlay; tunnels: get_rail_tunnels; bridge_surfaces: get_rail_bridge_surfaces; level_crossings: get_rail_level_crossings; fences: fences_none; depots: rail_depots; catenary_wire: erac_catenary_wire; catenary_pylons: erac_catenary_pylons; } } // электрифицированная железная дорога постоянного тока // electrified railway DC (direct current) item (FEAT_RAILTYPES, erd1) { property { label: "ERD1"; introduction_date: date(1932, 1, 1); name: string(STR_ERDC_NAME); toolbar_caption: string(STR_ERDC_TOOLBAR); menu_text: string(STR_ERDC_MENU); build_window_caption: string(STR_ERDC_BUILD_CAPTION); autoreplace_text: string(STR_ERDC_AUTOREPLACE); new_engine_text: string(STR_ERDC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERD1", "ERD2", "ERD3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 512; speed_limit: 62.5 mph; // 100 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 117; sort_order: 0x1C; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail_gui; track_overlay: get_rail_track_overlay; underlay: get_rail_underlay; tunnels: get_rail_tunnels; bridge_surfaces: get_rail_bridge_surfaces; level_crossings: get_rail_level_crossings; fences: fences_none; depots: rail_depots; catenary_wire: erdc_catenary_wire; catenary_pylons: erdc_catenary_pylons; } } /// Магистральная линия (в XLS с 1920?) // Автономная железная дорога item (FEAT_RAILTYPES, rla2) { property { label: "RLA2"; introduction_date: date(1920, 1, 1); name: string(STR_RLA2_NAME); toolbar_caption: string(STR_RLA2_TOOLBAR); menu_text: string(STR_RLA2_MENU); build_window_caption: string(STR_RAIL_BUILD_CAPTION); autoreplace_text: string(STR_RAIL_AUTOREPLACE); new_engine_text: string(STR_RAIL_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 256; speed_limit: 87.5 mph; //140 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 10; sort_order: 0x09; alternative_railtype_list: ["RAIL"]; } graphics { gui: rail2_gui; track_overlay: get_rail2_track_overlay; underlay: get_rail2_underlay; tunnels: get_rail2_tunnels; bridge_surfaces: get_rail2_bridge_surfaces; level_crossings: get_rail2_level_crossings; fences: fences_none; depots: rail_depots; } } // электрифицированная железная дорога переменного тока item (FEAT_RAILTYPES, era2) { property { label: "ERA2"; introduction_date: date(1954, 1, 1); name: string(STR_ERA2_NAME); toolbar_caption: string(STR_ERA2_TOOLBAR); menu_text: string(STR_ERA2_MENU); build_window_caption: string(STR_ERAC_BUILD_CAPTION); autoreplace_text: string(STR_ERAC_AUTOREPLACE); new_engine_text: string(STR_ERAC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERA1", "ERA2", "ERA3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 1024; speed_limit: 87.5 mph; //140 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 151; sort_order: 0x19; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail2_gui; track_overlay: get_rail2_track_overlay; underlay: get_rail2_underlay; tunnels: get_rail2_tunnels; bridge_surfaces: get_rail2_bridge_surfaces; level_crossings: get_rail2_level_crossings; fences: fences_none; depots: rail_depots; catenary_wire: erac_catenary_wire; catenary_pylons: erac_catenary_pylons; } } // электрифицированная железная дорога постоянного тока item (FEAT_RAILTYPES, erd2) { property { label: "ERD2"; introduction_date: date(1932, 1, 1); name: string(STR_ERD2_NAME); toolbar_caption: string(STR_ERD2_TOOLBAR); menu_text: string(STR_ERD2_MENU); build_window_caption: string(STR_ERDC_BUILD_CAPTION); autoreplace_text: string(STR_ERDC_AUTOREPLACE); new_engine_text: string(STR_ERDC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERD1", "ERD2", "ERD3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 2048; speed_limit: 87.5 mph; //140 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 119; sort_order: 0x1D; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail2_gui; track_overlay: get_rail2_track_overlay; underlay: get_rail2_underlay; tunnels: get_rail2_tunnels; bridge_surfaces: get_rail2_bridge_surfaces; level_crossings: get_rail2_level_crossings; fences: fences_none; depots: rail_depots; catenary_wire: erdc_catenary_wire; catenary_pylons: erdc_catenary_pylons; } } // Двусистемная ж/д (double-system) item (FEAT_RAILTYPES, er2s) { property { label: "ER2S"; introduction_date: date(1954, 1, 1); name: string(STR_ERDS_NAME); toolbar_caption: string(STR_ERDS_TOOLBAR); menu_text: string(STR_ERDS_MENU); build_window_caption: string(STR_ERDS_BUILD_CAPTION); autoreplace_text: string(STR_ERDS_AUTOREPLACE); new_engine_text: string(STR_ERDS_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); construction_cost: 4096; speed_limit: 75 mph; //120 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 23; sort_order: 0x20; } graphics { gui: rail2_gui; track_overlay: get_rail2_track_overlay; underlay: get_rail2_underlay; tunnels: get_rail2_tunnels; bridge_surfaces: get_rail2_bridge_surfaces; level_crossings: get_rail2_level_crossings; fences: fences_none; depots: rail_depots; catenary_wire: erds_catenary_wire; catenary_pylons: erds_catenary_pylons; } } /// Высокоскоростная пассажирская магистраль (в XLS с 1960?) // Автономная железная дорога item (FEAT_RAILTYPES, rla3) { property { label: "RLA3"; introduction_date: date(1960, 1, 1); name: string(STR_RLA3_NAME); toolbar_caption: string(STR_RLA3_TOOLBAR); menu_text: string(STR_RLA3_MENU); build_window_caption: string(STR_RAIL_BUILD_CAPTION); autoreplace_text: string(STR_RAIL_AUTOREPLACE); new_engine_text: string(STR_RAIL_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 1024; speed_limit: 0 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 12; sort_order: 0x0A; alternative_railtype_list: ["RAIL"]; } graphics { gui: rail3_gui; track_overlay: get_rail3_track_overlay; underlay: get_rail3_underlay; tunnels: get_rail3_tunnels; bridge_surfaces: get_rail3_bridge_surfaces; level_crossings: get_rail3_level_crossings; fences: fences; depots: rail_depots; } } // электрифицированная железная дорога переменного тока item (FEAT_RAILTYPES, era3) { property { label: "ERA3"; introduction_date: date(1960, 1, 1); name: string(STR_ERA3_NAME); toolbar_caption: string(STR_ERA3_TOOLBAR); menu_text: string(STR_ERA3_MENU); build_window_caption: string(STR_ERAC_BUILD_CAPTION); autoreplace_text: string(STR_ERAC_AUTOREPLACE); new_engine_text: string(STR_ERAC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERA1", "ERA2", "ERA3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 4096; speed_limit: 0 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 153; sort_order: 0x1A; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail3_gui; track_overlay: get_rail3_track_overlay; underlay: get_rail3_underlay; tunnels: get_rail3_tunnels; bridge_surfaces: get_rail3_bridge_surfaces; level_crossings: get_rail3_level_crossings; fences: fences; depots: rail_depots; catenary_wire: erac_catenary_wire; catenary_pylons: erac_catenary_pylons; } } // электрифицированная железная дорога постоянного тока item (FEAT_RAILTYPES, erd3) { property { label: "ERD3"; introduction_date: date(1960, 1, 1); name: string(STR_ERD3_NAME); toolbar_caption: string(STR_ERD3_TOOLBAR); menu_text: string(STR_ERD3_MENU); build_window_caption: string(STR_ERDC_BUILD_CAPTION); autoreplace_text: string(STR_ERDC_AUTOREPLACE); new_engine_text: string(STR_ERDC_NEW_ENGINE); compatible_railtype_list: ["RAIL", "ELRL", "RLA1", "RLA2", "RLA3", "ERA1", "ERA2", "ERA3", "ERD1", "ERD2", "ERD3", "ER2S"]; powered_railtype_list: ["ELRL", "ERD1", "ERD2", "ERD3", "ER2S"]; railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY); curve_speed_multiplier: 1; station_graphics: RAILTYPE_STATION_NORMAL; construction_cost: 8192; speed_limit: 0 km/h; acceleration_model: ACC_MODEL_RAIL; map_colour: 121; sort_order: 0x1E; alternative_railtype_list: ["ELRL"]; } graphics { gui: rail3_gui; track_overlay: get_rail3_track_overlay; underlay: get_rail3_underlay; tunnels: get_rail3_tunnels; bridge_surfaces: get_rail3_bridge_surfaces; level_crossings: get_rail3_level_crossings; fences: fences; depots: rail_depots; catenary_wire: erdc_catenary_wire; catenary_pylons: erdc_catenary_pylons; } } } /// definition // Используем полноразмерные поезда в депо train_width_32_px = 1; // Вертикаль поезда в депо traininfo_y_offset = 3; // Период, в который поезд считается новым (гарантийным) и не допускает депошного творчества new_train_age = 5; // Истечение срока retire_early_default = -8; delta_age = 1; // RE // модель // вычитаем 2 года из года ввода ТС, для прицепных и немоторных вагонов // вычитаем 2 года из года ввода ТС, для головных вагонов и локомотивов // максимальная скорость // рисуем [не] на карте? // рисуем в депо // Не построен // Построен // ТС по [-]смещению в цепочке [не] скрыто? // Для получения характеристик предыдущего ПС в цепочке // для записи смещения в регистр (работа с переменной 0x61) // Для краткой записи списка климатов ПС // Для выбора правильного набора спрайтов в случае флага TRAIN_FLAG_FLIP // или CB_RESULT_REVERSED_VEHICLE // Порог скорости электровозов // x км/ч * 0.2778 == value // 50 км/ч --> 13 (13.89) // 62 км/ч --> 17 (17.2236) //threshold of speed // обобщение свойств для категорий ПС // сокращение для отключения визуальных эффектов тяги и тяги вагонов // визуальные эффекты для электротяги // визуальные эффекты для дизельной тяги // визуальные эффекты для паровой тяги // поправка для функции мощности (power cb) // задаваемое в свойстве отличается от возвращаемого функцией // Получаем оштрафованную величину скорости, 15% // Флаг штрафа поезда по скорости // обычные рельсы в зависимости от настроек // рельсы для постоянного и переменного тока в зависимости от настроек // для двусистемных // Штрафуем ли по скорости // Вычисляем ТУ по формуле (табличное_значение/масса/9.8) // ТУ для cb tractive_effort_coefficient /// graphics definition // Определение спрайта меню покупки // 1-осекционный электровоз с 2 пантографами // 2-хсекционный электровоз с 2 пантографами // 2-хсекционный электровоз с 1 пантографом // 2-хсекционный электровоз без пантографа // Для всех ЭМВПС если голова неверная, то тяги нет по определению - проверка неверной головы не предполагается // МВПС 2 головных без отдельного реверса (промежуточные головные) // МВПС 2 головных с отдельным реверсом (промежуточные головные) // МВПС 3 головных без отдельного реверса // МВПС 4 головных без отдельного реверса (Промежуточные головы) // МВПС 2 мотоных без отдельного реверса (двусистемные МВПС) (погрузка не производится) // МВПС 2 мотоных с отдельным реверсом (двусистемные МВПС) (погрузка не производится) // МВПС 3 мотоных без отдельного реверса // МВПС 3 мотоных с отдельным реверсом // МВПС 4 мотоных без отдельного реверса (двусистемные МВПС) // МВПС 4 мотоных с отдельным реверсом (двусистемные МВПС) // МВПС 1 немоторных без отдельного реверса (погрузка не производится) // МВПС 2 немоторных с отдельным реверсом // Вагоны пассажирские. 2 вида (погрузка/в пути) и отдельный вид последнего вагона // Полувагоны, платформы. // шаблон пустого вагона // шаблон груза, 2 ливреи, 3 вида загруженности // 25-49%, 50-74%, полный // шаблон груза, 2 ливреи, 3 вида загруженности // 25-49%, 50-74%, полный // шаблон груза, 3 вида загруженности // шаблон груза, 3 вида загруженности. Модифицированный // шаблон груза, 2 вида загруженности // шаблон груза, 2 вида загруженности 2 // шаблон груза, 1 вид загруженности // шаблон пустого крытого вагона // шаблон: движение/100%, 30%, 60%, 90% // шаблон вагона рефсекции. Рефсекция обращается только целиком, bitmask(TRIGGER_VEHICLE_SERVICE) не является частью шаблона // шаблон цистерны /// code definition // Выбор ориентации кабины секции для СМЕ (схема без альтернатив в СМЕ) // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой) // Выбор ориентации кабины секции для СМЕ (схема без альтернатив и средней секцией) // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой и средней секцией) // Выбор ориентации кабины секции для СМЕ (схема без альтернатив и 2-я средними секциями) // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой и 2-я средними секциями) // Определение пенальти на скорость (схема без СМЕ) // Определение пенальти на скорость (схема без альтернатив в СМЕ) // Определение пенальти на скорость (схема c 1 альтернативой в СМЕ) // Определение пенальти на скорость (схема c 2 альтернативами в СМЕ) // Определение пенальти на скорость (схема c 3 альтернативами в СМЕ) // Определение пенальти на скорость (схема c 4 альтернативами в СМЕ) // Определение пенальти на скорость (схема c 5 альтернативами в СМЕ) // Определение пенальти на скорость (схема c 6 альтернативами в СМЕ) // Определение скорости без вариантов // Определение скорости с изменением в заданный год // Определение скорости с изменением по году постройки // Определение скорости с изменением по году постройки и в заданном году // Определение скорости с изменением в 2 заданных года // Определение скорости со снижением для старых // Определение скорости со снижением для старых и изменением скорости по году постройки // Определение скорости со снижением для старых и с предсерийной моделью // определение расхода топлива // расход определяется граничным на разгоне, торможении, подъёме, спуске. // в оставшемся случае расходуется часть, пропорциональная доли массы от общей доли в массе // (общая масса на долю мощности в общей мощности) // return (rc_max * (((LOAD_TEMP(6) + 500) * power / LOAD_TEMP(5)) / weight)); } // передеать так, что если в гору скорость свыше 90%, то значит мощи хватает и считать обычным образом. // не выпускать новые тройники без средней секции // не выпускать новые двойки с средней секцией // Если рисуем на карте и следующий в цепочке вагон скрыт, то отдаём пустышку // пляски с 0x9C и 0x9A для паровозов, чтобы клёса крутились в зависимости от положения, а не от времени. // Регистр 5 и 6 занимаем под ЭМВПС // long vehicle template // short vehicle template // special vehicle template // /// code definition - mu // Шаблон расчёта конфигурации ЭМВПС // Шаблон расчёта ориентации ЭМВПС // шаблон ориентации // /// template // покупка template new_purchase_template(x, y) { [x, y, 100, 18, -40, -11] } template new_purchase_template_noico(x, y) { [x+18, y, 82, 18, -40, -11] } // невидимка template dummy_template(x, y) { [x, y, 1, 1, 0, 0] } // Шаблон 3 (size 3) ** // обычный template s3_template(x, y, shift) { [x, y, 7, 30, -2, -30-2*shift] [x+16, y, 11, 27, -4+2*shift, -22-shift] [x+32, y, 12, 20, 4+4*shift, -16] //dy-1 [x+64, y, 11, 27, 5+2*shift, -18+shift] [x+80, y, 7, 30, -2, -22+2*shift] [x+96, y, 11, 27, -14-2*shift, -17+shift] [x+112, y, 12, 20, -16-4*shift, -16] //dy-1 [x+144, y, 11, 27, -5-2*shift, -23-shift] } template s3_r_template(x, y, shift) { [x+80, y, 7, 30, -2, -30-2*shift] [x+96, y, 11, 27, -4+2*shift, -22-shift] [x+112, y, 12, 20, 4+4*shift, -16] //dy-1 [x+144, y, 11, 27, 5+2*shift, -18+shift] [x, y, 7, 30, -2, -22+2*shift] [x+16, y, 11, 27, -14-2*shift, -17+shift] [x+32, y, 12, 20, -16-4*shift, -16] //dy-1 [x+64, y, 11, 27, -5-2*shift, -23-shift] } // покупка (вид 7) template s3_purchase_template(x, y, shift) { [x+112, y, 12, 20, -16+shift, -16] } // Шаблон 4 (size 4) ** // обычный template s4_template(x, y, shift) { [x, y, 7, 32, -2, -30-2*shift] [x+16, y, 13, 28, -6+2*shift, -22-shift] [x+48, y, 16, 20, 0+4*shift, -16] //dy-1 [x+80, y, 13, 28, 3+2*shift, -19+shift] [x+112, y, 7, 32, -2, -24+2*shift] [x+128, y, 13, 28, -14-2*shift, -18+shift] [x+160, y, 16, 20, -16-4*shift, -16] //dy-1 [x+192, y, 13, 28, -5-2*shift, -23-shift] } template s4_r_template(x, y, shift) { [x+112, y, 7, 32, -2, -30-2*shift] [x+128, y, 13, 28, -6+2*shift, -22-shift] [x+160, y, 16, 20, 0+4*shift, -16] //dy-1 [x+192, y, 13, 28, 3+2*shift, -19+shift] [x, y, 7, 32, -2, -24+2*shift] [x+16, y, 13, 28, -14-2*shift, -18+shift] [x+48, y, 16, 20, -16-4*shift, -16] //dy-1 [x+80, y, 13, 28, -5-2*shift, -23-shift] } // покупка (вид 7) template s4_purchase_template(x, y, shift) { [x+160, y, 16, 20, -16+shift, -16] } // Шаблон 5 (size 5) ** // обычный template s5_template(x, y, shift) { [x, y, 7, 34, -2, -30-2*shift] [x+16, y, 15, 29, -8+2*shift, -22-shift] [x+48, y, 20, 20, -4+4*shift, -16] //dy-1 14-->15 [x+80, y, 15, 29, 1+2*shift, -20+shift] [x+112, y, 7, 34, -2, -24+2*shift] [x+128, y, 15, 29, -14-2*shift, -19+shift] [x+160, y, 20, 20, -16-4*shift, -16] //dy-1 14-->15 [x+192, y, 15, 29, -5-2*shift, -23-shift] } template s5_r_template(x, y, shift) { [x+112, y, 7, 34, -2, -30-2*shift] [x+128, y, 15, 29, -8+2*shift, -22-shift] [x+160, y, 20, 20, -4+4*shift, -16] //dy-1 14-->15 [x+192, y, 15, 29, 1+2*shift, -20+shift] [x, y, 7, 34, -2, -24+2*shift] [x+16, y, 15, 29, -14-2*shift, -19+shift] [x+48, y, 20, 20, -16-4*shift, -16] //dy-1 14-->15 [x+80, y, 15, 29, -5-2*shift, -23-shift] } // покупка (вид 7) template s5_purchase_template(x, y, shift) { [x+160, y, 20, 20, -16+shift, -16] } // Шаблон 6 (size 6) ** // обычный template s6_template(x, y, shift) { [x, y, 7, 38, -2, -32-2*shift] [x+16, y, 17, 30, -10+2*shift, -22-shift] [x+48, y, 24, 20, -8+4*shift, -16] //dy-1 14-->15 [x+80, y, 17, 30, -1+2*shift, -21+shift] [x+112, y, 7, 38, -2, -28+2*shift] [x+128, y, 17, 30, -14-2*shift, -20+shift] [x+160, y, 24, 20, -16-4*shift, -16] //dy-1 14-->15 [x+192, y, 17, 30, -5-2*shift, -23-shift] } template s6_r_template(x, y, shift) { [x+112, y, 7, 38, -2, -32-2*shift] [x+128, y, 17, 30, -10+2*shift, -22-shift] [x+160, y, 24, 20, -8+4*shift, -16] //dy-1 14-->15 [x+192, y, 17, 30, -1+2*shift, -21+shift] [x, y, 7, 38, -2, -28+2*shift] [x+16, y, 17, 30, -14-2*shift, -20+shift] [x+48, y, 24, 20, -16-4*shift, -16] //dy-1 14-->15 [x+80, y, 17, 30, -5-2*shift, -23-shift] } // покупка (вид 7) template s6_purchase_template(x, y, shift) { [x+160, y, 24, 20, -16+shift, -16] } // Шаблон 7 (size 7) ** // обычный template s7_template(x, y, shift) { [x, y, 7, 39, -2, -31-2*shift] [x+16, y, 19, 31, -12+2*shift, -22-shift] [x+48, y, 28, 20, -12+4*shift, -16] //dy-1 14-->15 [x+96, y, 19, 31, -3+2*shift, -22+shift] [x+128, y, 7, 39, -2, -29+2*shift] [x+144, y, 19, 31, -14-2*shift, -21+shift] [x+176, y, 28, 20, -16-4*shift, -16] //dy-1 14-->15 [x+224, y, 19, 31, -5-2*shift, -23-shift] } template s7_r_template(x, y, shift) { [x+128, y, 7, 39, -2, -31-2*shift] [x+144, y, 19, 31, -12+2*shift, -22-shift] [x+176, y, 28, 20, -12+4*shift, -16] //dy-1 14-->15 [x+224, y, 19, 31, -3+2*shift, -22+shift] [x, y, 7, 39, -2, -29+2*shift] [x+16, y, 19, 31, -14-2*shift, -21+shift] [x+48, y, 28, 20, -16-4*shift, -16] //dy-1 14-->15 [x+96, y, 19, 31, -5-2*shift, -23-shift] } // покупка (вид 7) template s7_purchase_template(x, y, shift) { [x+176, y, 28, 20, -16+shift, -16] } // Шаблон 8 (size 8) ** // обычный template s8_template(x, y, shift) { [x, y, 12, 31, -5, -18] [x+32, y, 22, 23, -14, -13] [x+64, y, 32, 17, -16, -13] [x+112, y, 22, 23, -6, -14] [x+144, y, 12, 31, -5, -18] [x+176, y, 22, 23, -14, -13] [x+208, y, 32, 17, -16, -13] [x+256, y, 22, 23, -6, -14] } template s8_r_template(x, y, shift) { [x+144, y, 12, 31, -5, -18] [x+176, y, 22, 23, -14, -13] [x+208, y, 32, 17, -16, -13] [x+256, y, 22, 23, -6, -14] [x, y, 12, 31, -5, -18] [x+32, y, 22, 23, -14, -13] [x+64, y, 32, 17, -16, -13] [x+112, y, 22, 23, -6, -14] } // покупка (вид 7) template s8_purchase_template(x, y, shift) { [x+208, y, 32, 17, -16+shift, -13] } // Шаблон 9 (size 9) ** // обычный template s9_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } // специальный template s9vl11_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 43, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+239, y, 43, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } // покупка (вид 7) template s9_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } template s9_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+2] [x+240, y, 42, 43, -14-2, -33+1] [x+288, y, 64, 17, -16-4, -13 ] [x+368, y, 42, 42, -6-2, -14-1] [x, y, 12, 62, -5 , -18-2] [x+32, y, 42, 42, -34+2, -13-1] [x+80, y, 64, 17, -48+4, -13 ] [x+160, y, 42, 43, -26+2, -34+1] } // Шаблон 10 (size 10) ** // обычный template s10_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s10_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+4] [x+240, y, 42, 43, -14-4, -33+2] [x+288, y, 64, 17, -16-8, -13 ] [x+368, y, 42, 42, -6-4, -14-2] [x, y, 12, 62, -5 , -18-4] [x+32, y, 42, 42, -34+4, -13-2] [x+80, y, 64, 17, -48+8, -13 ] [x+160, y, 42, 43, -26+4, -34+2] } // покупка (вид 7) template s10_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // Шаблон 11 (size 11) ** // обычный template s11_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s11_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+6] [x+240, y, 42, 43, -14 -6, -33+3] [x+288, y, 64, 17, -16-12, -13 ] [x+368, y, 42, 42, -6 -6, -14-3] [x, y, 12, 62, -5 , -18-6] [x+32, y, 42, 42, -34 +6, -13-3] [x+80, y, 64, 17, -48+12, -13 ] [x+160, y, 42, 43, -26 +6, -34+3] } // покупка (вид 7) template s11_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // для ЧС2т template s11ch_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 43, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+239, y, 43, 43, -16, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } // Шаблон 12 (size 12) ** // обычный template s12_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s12_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+8] [x+240, y, 42, 43, -14 -8, -33+4] [x+288, y, 64, 17, -16-16, -13 ] [x+368, y, 42, 42, -6 -8, -14-4] [x, y, 12, 62, -5 , -18-8] [x+32, y, 42, 42, -34 +8, -13-4] [x+80, y, 64, 17, -48+16, -13 ] [x+160, y, 42, 43, -26 +8, -34+4] } // версия для UI в депо (только вид 7) template s12ui1_template(x, y, shift) { [x, y, 64, 17, -16-4*shift, -13] } // покупка (вид 7) template s12_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // для ЧС4т template s12ch_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 43, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+239, y, 43, 43, -16, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } // Шаблон 13 (size 13) ** // обычный template s13_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s13_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+10] [x+240, y, 42, 43, -14-10, -33 +5] [x+288, y, 64, 17, -16-20, -13 ] [x+368, y, 42, 42, -6-10, -14 -5] [x, y, 12, 62, -5 , -18-10] [x+32, y, 42, 42, -34+10, -13 -5] [x+80, y, 64, 17, -48+20, -13 ] [x+160, y, 42, 43, -26+10, -34 +5] } // покупка (вид 7) template s13_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // версия для UI в депо (только вид 7) template s13ui1_template(x, y, shift) { [x, y, 64, 17, -16-4*shift, -13] } // Шаблон 14 (size 14) ** // обычный template s14_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s14_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+12] [x+240, y, 42, 43, -14-12, -33 +6] [x+288, y, 64, 17, -16-24, -13 ] [x+368, y, 42, 42, -6-12, -14 -6] [x, y, 12, 62, -5 , -18-12] [x+32, y, 42, 42, -34+12, -13 -6] [x+80, y, 64, 17, -48+24, -13 ] [x+160, y, 42, 43, -26+12, -34 +6] } // покупка (вид 7) template s14_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // Шаблон 15 (size 15) ** // обычный template s15_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s15_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+14] [x+240, y, 42, 43, -14-14, -33 +7] [x+288, y, 64, 17, -16-28, -13 ] [x+368, y, 42, 42, -6-14, -14 -7] [x, y, 12, 62, -5 , -18-14] [x+32, y, 42, 42, -34+14, -13 -7] [x+80, y, 64, 17, -48+28, -13 ] [x+160, y, 42, 43, -26+14, -34 +7] } // покупка (вид 7) template s15_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // версия для UI в депо (только вид 7) template s15ui1_template(x, y, shift) { [x, y, 64, 17, -16-4*shift, -13] } // Шаблон 16 (size 16) ** // обычный template s16_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 64, 17, -48, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 64, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s16_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+16] [x+240, y, 42, 43, -14-16, -33 +8] [x+288, y, 64, 17, -16-32, -13 ] [x+368, y, 42, 42, -6-16, -14 -8] [x, y, 12, 62, -5 , -18-16] [x+32, y, 42, 42, -34+16, -13 -8] [x+80, y, 64, 17, -48+32, -13 ] [x+160, y, 42, 43, -26+16, -34 +8] } // покупка (вид 7) template s16_purchase_template(x, y, shift) { [x+288, y, 64, 17, -16+shift, -13] } // Шаблон 17 (size 17) ** // обычный template s17_template(x, y, shift) { [x, y, 12, 62, -5, -18] [x+32, y, 42, 42, -34, -13] [x+80, y, 68, 17, -52, -13] [x+160, y, 42, 43, -26, -34] [x+208, y, 12, 62, -5, -49] [x+240, y, 42, 43, -14, -33] [x+288, y, 68, 17, -16, -13] [x+368, y, 42, 42, -6, -14] } template s17_r_template(x, y, shift) { [x+208, y, 12, 62, -5 , -49+18] [x+240, y, 42, 43, -14-18, -33 +9] [x+288, y, 68, 17, -16-36, -13 ] [x+368, y, 42, 42, -6-18, -14 -9] [x, y, 12, 62, -5 , -18-18] [x+32, y, 42, 42, -34+18, -13 -9] [x+80, y, 68, 17, -52+36, -13 ] [x+160, y, 42, 43, -26+18, -34 +9] } // покупка (вид 7) template s17_purchase_template(x, y, shift) { [x+288, y, 68, 17, -16+shift, -13] } /// action // --- ограничение скорости по окончанию установленного срока службы --- // ограничиваем скорость через 20 лет работы 120 --> 110 switch (FEAT_TRAINS, SELF, speed_after20_120to110, age_in_days >= (20*365+5)) { 1: return 110; return 120; } // ограничиваем скорость через 20 лет работы 120 --> 100 switch (FEAT_TRAINS, SELF, speed_after20_120to100, age_in_days >= (20*365+5)) { 1: return 100; return 120; } // ограничиваем скорость через 25 лет работы 120 --> 110 switch (FEAT_TRAINS, SELF, speed_after25_120to110, age_in_days >= (25*365+5)) { 1: return 110; return 120; } // ограничиваем скорость через 25 лет работы 120 --> 100 switch (FEAT_TRAINS, SELF, speed_after25_120to100, age_in_days >= (25*365+5)) { 1: return 100; return 120; } // ограничиваем скорость через 30 лет работы 130 --> 110 switch (FEAT_TRAINS, SELF, speed_after30_130to110, age_in_days >= (30*365+8)) { 1: return 110; return 130; } // ограничиваем скорость через 30 лет работы 130 --> 100 switch (FEAT_TRAINS, SELF, speed_after30_130to100, age_in_days >= (30*365+8)) { 1: return 100; return 130; } // невидимый вагон размером 1 switch (FEAT_TRAINS, SELF, articulated_part_dummy1, extra_callback_info1) { 1: return dummy1; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 2 switch (FEAT_TRAINS, SELF, articulated_part_dummy2, extra_callback_info1) { 1: return dummy2; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 3 switch (FEAT_TRAINS, SELF, articulated_part_dummy3, extra_callback_info1) { 1: return dummy3; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 4 switch (FEAT_TRAINS, SELF, articulated_part_dummy4, extra_callback_info1) { 1: return dummy4; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 5 switch (FEAT_TRAINS, SELF, articulated_part_dummy5, extra_callback_info1) { 1: return dummy5; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 6 switch (FEAT_TRAINS, SELF, articulated_part_dummy6, extra_callback_info1) { 1: return dummy6; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 7 switch (FEAT_TRAINS, SELF, articulated_part_dummy7, extra_callback_info1) { 1: return dummy7; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // невидимый вагон размером 8 switch (FEAT_TRAINS, SELF, articulated_part_dummy8, extra_callback_info1) { 1: return dummy8; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // тендер switch (FEAT_TRAINS, SELF, articulated_part_tender, extra_callback_info1) { 1: return unitb; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // модельки /// dummy // Спрайт из одного прозрачного пикселя spriteset (dummy_sprites, "src/dummy/empty.png") { dummy_template(0, 0) } // Шаблон для dummy, задаём разный length // Определение dummy item (FEAT_TRAINS, dummy1) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 1; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy2) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 2; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy3) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 3; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy4) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 4; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy5) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 5; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy6) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 6; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy7) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 7; } graphics { default: dummy_sprites; } } item (FEAT_TRAINS, dummy8) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 8; } graphics { default: dummy_sprites; } } /// unit // Шаблон для индивидуализации элементов многоэлементных локомотивов: // тендеров паровозов, вагонов в составе секций emu/dmu, // там, где можно использовать livery_override. // Буква в имени определяет положение элемента по порядку от локомотива (a). /// Определение элементов // Первая позиция: паровозы, emu, dmu item (FEAT_TRAINS, unitb) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 8; } graphics { default: dummy_sprites; } } // Вторая позиция: emu, dmu item (FEAT_TRAINS, unitc) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 8; } graphics { default: dummy_sprites; } } // Третья позиция: emu, dmu item (FEAT_TRAINS, unitd) { property { climates_available: NO_CLIMATE; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); track_type: enable_our_own_tracks ? RLA1 : RAIL; length: 8; } graphics { default: dummy_sprites; } } /// align spriteset (align_3_purchase_sprites, "src/align/s3.png") { s3_purchase_template(0, 0, 10) } spriteset (align_3_sprites, "src/align/s3.png") { s3_template(0, 0, 0) } spriteset (align_3_flipped_sprites, "src/align/s3.png") { s3_template(0, 0, -5) } spriteset (align_4_purchase_sprites, "src/align/s4.png") { s4_purchase_template(0, 0, 8) } spriteset (align_4_sprites, "src/align/s4.png") { s4_template(0, 0, 0) } spriteset (align_4_flipped_sprites, "src/align/s4.png") { s4_template(0, 0, -4) } spriteset (align_5_purchase_sprites, "src/align/s5.png") { s5_purchase_template(0, 0, 6) } spriteset (align_5_sprites, "src/align/s5.png") { s5_template(0, 0, 0) } spriteset (align_5_flipped_sprites, "src/align/s5.png") { s5_template(0, 0, -3) } spriteset (align_6_purchase_sprites, "src/align/s6.png") { s6_purchase_template(0, 0, 4) } spriteset (align_6_sprites, "src/align/s6.png") { s6_template(0, 0, 0) } spriteset (align_6_flipped_sprites, "src/align/s6.png") { s6_template(0, 0, -2) } spriteset (align_7_purchase_sprites, "src/align/s7.png") { s7_purchase_template(0, 0, 2) } spriteset (align_7_sprites, "src/align/s7.png") { s7_template(0, 0, 0) } spriteset (align_7_flipped_sprites, "src/align/s7.png") { s7_template(0, 0, -1) } spriteset (align_8_purchase_sprites, "src/align/s8.png") { s8_purchase_template(0, 0, 0) } spriteset (align_8_sprites, "src/align/s8.png") { s8_template(0, 0, 0) } // no flip spriteset, use the same spriteset (align_8_flipped_sprites, "src/align/s8.png") { s8_template(0, 0, 0) } spriteset (align_9_purchase_sprites, "src/align/s9.png") { s9_purchase_template(0, 0, -2) } spriteset (align_9_sprites, "src/align/s9.png") { s9_template(0, 0, 0) } spriteset (align_9_flipped_sprites, "src/align/s9.png") { s9_template(0, 0, 1) } spriteset (align_10_purchase_sprites, "src/align/s10.png") { s10_purchase_template(0, 0, -4) } spriteset (align_10_sprites, "src/align/s10.png") { s10_template(0, 0, 0) } spriteset (align_10_flipped_sprites, "src/align/s10.png") { s10_template(0, 0, 2) } spriteset (align_11_purchase_sprites, "src/align/s11.png") { s11_purchase_template(0, 0, -6) } spriteset (align_11_sprites, "src/align/s11.png") { s11_template(0, 0, 0) } spriteset (align_11_flipped_sprites, "src/align/s11.png") { s11_template(0, 0, 3) } spriteset (align_12_purchase_sprites, "src/align/s12.png") { s12_purchase_template(0, 0, -8) } spriteset (align_12_sprites, "src/align/s12.png") { s12_template(0, 0, 0) } spriteset (align_12_flipped_sprites, "src/align/s12.png") { s12_template(0, 0, 4) } spriteset (align_13_purchase_sprites, "src/align/s13.png") { s13_purchase_template(0, 0, -10) } spriteset (align_13_sprites, "src/align/s13.png") { s13_template(0, 0, 0) } spriteset (align_13_flipped_sprites, "src/align/s13.png") { s13_template(0, 0, 5) } spriteset (align_14_purchase_sprites, "src/align/s14.png") { s14_purchase_template(0, 0, -12) } spriteset (align_14_sprites, "src/align/s14.png") { s14_template(0, 0, 0) } spriteset (align_14_flipped_sprites, "src/align/s14.png") { s14_template(0, 0, 6) } spriteset (align_15_purchase_sprites, "src/align/s15.png") { s15_purchase_template(0, 0, -14) } spriteset (align_15_sprites, "src/align/s15.png") { s15_template(0, 0, 0) } spriteset (align_15_flipped_sprites, "src/align/s15.png") { s15_template(0, 0, 7) } spriteset (align_16_purchase_sprites, "src/align/s16.png") { s16_purchase_template(0, 0, -16) } spriteset (align_16_sprites, "src/align/s16.png") { s16_template(0, 0, 0) } spriteset (align_16_flipped_sprites, "src/align/s16.png") { s16_template(0, 0, 8) } spriteset (align_17_purchase_sprites, "src/align/s17.png") { s17_purchase_template(0, 0, -18) } spriteset (align_17_sprites, "src/align/s17.png") { s17_template(0, 0, 0) } spriteset (align_17_flipped_sprites, "src/align/s17.png") { s17_template(0, 0, 9) } // Одинаковые свойства для всех размеров // Для размера 3-8 switch (FEAT_TRAINS, SELF, align3_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_3_flipped_sprites; align_3_sprites; } item (FEAT_TRAINS, align3) { property { name: string(STR_ALIGN3_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 3; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align3_sprites; purchase: align_3_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } switch (FEAT_TRAINS, SELF, align4_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_4_flipped_sprites; align_4_sprites; } item (FEAT_TRAINS, align4) { property { name: string(STR_ALIGN4_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 4; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align4_sprites; purchase: align_4_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } switch (FEAT_TRAINS, SELF, align5_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_5_flipped_sprites; align_5_sprites; } item (FEAT_TRAINS, align5) { property { name: string(STR_ALIGN5_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 5; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align5_sprites; purchase: align_5_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } switch (FEAT_TRAINS, SELF, align6_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_6_flipped_sprites; align_6_sprites; } item (FEAT_TRAINS, align6) { property { name: string(STR_ALIGN6_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 6; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align6_sprites; purchase: align_6_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } switch (FEAT_TRAINS, SELF, align7_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_7_flipped_sprites; align_7_sprites; } item (FEAT_TRAINS, align7) { property { name: string(STR_ALIGN7_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 7; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align7_sprites; purchase: align_7_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } switch (FEAT_TRAINS, SELF, align8_sprites, (var[0xC8, 0, 0xFF] != 0xFD)) { 1: align_8_flipped_sprites; align_8_sprites; } item (FEAT_TRAINS, align8) { property { name: string(STR_ALIGN8_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP); length: 8; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align8_sprites; purchase: align_8_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); } } // Для размера 9-16 switch (FEAT_TRAINS, SELF, align9_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_9_sprites; } item (FEAT_TRAINS, align9) { property { name: string(STR_ALIGN9_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 1; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align9_sprites; purchase: align_9_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align10_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_10_sprites; } item (FEAT_TRAINS, align10) { property { name: string(STR_ALIGN10_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 2; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align10_sprites; purchase: align_10_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align11_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_11_sprites; } item (FEAT_TRAINS, align11) { property { name: string(STR_ALIGN11_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 3; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align11_sprites; purchase: align_11_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align12_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_12_sprites; } item (FEAT_TRAINS, align12) { property { name: string(STR_ALIGN12_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 4; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align12_sprites; purchase: align_12_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align13_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_13_sprites; } item (FEAT_TRAINS, align13) { property { name: string(STR_ALIGN13_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 5; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align13_sprites; purchase: align_13_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align14_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_14_sprites; } item (FEAT_TRAINS, align14) { property { name: string(STR_ALIGN14_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 6; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align14_sprites; purchase: align_14_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align15_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_15_sprites; } item (FEAT_TRAINS, align15) { property { name: string(STR_ALIGN15_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 7; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align15_sprites; purchase: align_15_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } switch (FEAT_TRAINS, SELF, align16_sprites, ((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) { 1: dummy_sprites; align_16_sprites; } item (FEAT_TRAINS, align16) { property { name: string(STR_ALIGN16_NAME); misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); length: 8; climates_available: enable_debug_car ? bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND) : NO_CLIMATE; introduction_date: date(0, 1, 1); vehicle_life: 255; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT); model_life: VEHICLE_NEVER_EXPIRES; loading_speed: 10; cost_factor: 1; running_cost_factor: 1; speed: 1 km/h; track_type: enable_our_own_tracks ? RLA1 : RAIL; power: 500 hpM; running_cost_base: RUNNING_COST_DIESEL; cargo_capacity: 10; weight: 25 ton; engine_class: ENGINE_CLASS_DIESEL; tractive_effort_coefficient: 0.11; visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); } graphics { default: align16_sprites; purchase: align_16_purchase_sprites; additional_text: return string(STR_ALIGN_PURCHASE_HINT); articulated_part: articulated_part_tender; } } // ПС // #include "src/emu/sn.pnml" // er1 // Спрайты // 2 окраски, только головной с 1972 имеет замену на // др. 2 окраски spriteset (er1_h_purchase_graphics_ico, "src/emu/er1.png") { [0, 0, 100, 18, -40, -13] } spriteset (er1_h_purchase_graphics_noico, "src/emu/er1.png") { [0 +18, 0, 82, 18, -40, -13] } switch (FEAT_TRAINS, SELF, er1_h_purchase_sprites, enable_icons) { 1: er1_h_purchase_graphics_ico; er1_h_purchase_graphics_noico;} spriteset (er1_m_purchase_graphics_ico, "src/emu/er1.png") { [120, 0, 100, 18, -40, -13] } spriteset (er1_m_purchase_graphics_noico, "src/emu/er1.png") { [120 +18, 0, 82, 18, -40, -13] } switch (FEAT_TRAINS, SELF, er1_m_purchase_sprites, enable_icons) { 1: er1_m_purchase_graphics_ico; er1_m_purchase_graphics_noico;} spriteset (er1_c_purchase_graphics_ico, "src/emu/er1.png") { [240, 0, 100, 18, -40, -13] } spriteset (er1_c_purchase_graphics_noico, "src/emu/er1.png") { [240 +18, 0, 82, 18, -40, -13] } switch (FEAT_TRAINS, SELF, er1_c_purchase_sprites, enable_icons) { 1: er1_c_purchase_graphics_ico; er1_c_purchase_graphics_noico;} spriteset (er1_v1_h_notpowered_sprites_left, "src/emu/er1.png") { s12_template(32, 40, 0) } spriteset (er1_v1_h_loading_sprites, "src/emu/er1.png") { s12_template(32, 40 +134, 0) } spriteset (er1_v1_h_traveling_sprites, "src/emu/er1.png") { s12_template(32, 40 +268, 0) } spritegroup er1_v1_h_normal_sprites { loading: er1_v1_h_loading_sprites; loaded: er1_v1_h_traveling_sprites; } spriteset (er1_v1_h_notpowered_sprites_right, "src/emu/er1.png") { s12_r_template(32 +32, 40 +67, 0) } spriteset (er1_v1_h_r_loading_sprites, "src/emu/er1.png") { s12_r_template(32 +32, 40 +201, 0) } spriteset (er1_v1_h_r_traveling_sprites, "src/emu/er1.png") { s12_r_template(32 +32, 40 +335, 0) } spritegroup er1_v1_h_r_normal_sprites { loading: er1_v1_h_r_loading_sprites; loaded: er1_v1_h_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v1_h_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1_h_normal_sprites; er1_v1_h_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v1_h_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1_h_r_normal_sprites; er1_v1_h_notpowered_sprites_right; } spriteset (er1_v1_m_notpowered_sprites_left, "src/emu/er1.png") { s12_template(32 +447, 40, 0) } spriteset (er1_v1_m_loading_sprites, "src/emu/er1.png") { s12_template(32 +447, 40 +134, 0) } spriteset (er1_v1_m_traveling_sprites, "src/emu/er1.png") { s12_template(32 +447, 40 +268, 0) } spritegroup er1_v1_m_normal_sprites { loading: er1_v1_m_loading_sprites; loaded: er1_v1_m_traveling_sprites; } spriteset (er1_v1_m_notpowered_sprites_right, "src/emu/er1.png") { s12_r_template(32 +447, 40, 0) } spriteset (er1_v1_m_r_loading_sprites, "src/emu/er1.png") { s12_r_template(32 +447, 40 +134, 0) } spriteset (er1_v1_m_r_traveling_sprites, "src/emu/er1.png") { s12_r_template(32 +447, 40 +268, 0) } spritegroup er1_v1_m_r_normal_sprites { loading: er1_v1_m_r_loading_sprites; loaded: er1_v1_m_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v1_m_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1_m_normal_sprites; er1_v1_m_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v1_m_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1_m_r_normal_sprites; er1_v1_m_notpowered_sprites_right; } spriteset (er1_v1_c_notpowered_sprites_left, "src/emu/er1.png") { s12_template(32 +894, 40, 0) } spriteset (er1_v1_c_loading_sprites, "src/emu/er1.png") { s12_template(32 +894, 40 +134, 0) } spritegroup er1_v1_c_sprites_left { loading: er1_v1_c_loading_sprites; loaded: er1_v1_c_notpowered_sprites_left; } spriteset (er1_v1_c_notpowered_sprites_right, "src/emu/er1.png") { s12_r_template(32 +894, 40, 0) } spriteset (er1_v1_c_r_loading_sprites, "src/emu/er1.png") { s12_r_template(32 +894, 40 +134, 0) } spritegroup er1_v1_c_sprites_right { loading: er1_v1_c_r_loading_sprites; loaded: er1_v1_c_notpowered_sprites_right; } spriteset (er1_v1u_h_notpowered_sprites_left, "src/emu/er1.png") { s12_template(32, 442, 0) } spriteset (er1_v1u_h_loading_sprites, "src/emu/er1.png") { s12_template(32, 442 +134, 0) } spriteset (er1_v1u_h_traveling_sprites, "src/emu/er1.png") { s12_template(32, 442 +268, 0) } spritegroup er1_v1u_h_normal_sprites { loading: er1_v1u_h_loading_sprites; loaded: er1_v1u_h_traveling_sprites; } spriteset (er1_v1u_h_notpowered_sprites_right, "src/emu/er1.png") { s12_r_template(32 +32, 442 +67, 0) } spriteset (er1_v1u_h_r_loading_sprites, "src/emu/er1.png") { s12_r_template(32 +32, 442 +201, 0) } spriteset (er1_v1u_h_r_traveling_sprites, "src/emu/er1.png") { s12_r_template(32 +32, 442 +335, 0) } spritegroup er1_v1u_h_r_normal_sprites { loading: er1_v1u_h_r_loading_sprites; loaded: er1_v1u_h_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v1u_h_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1u_h_normal_sprites; er1_v1u_h_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v1u_h_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v1u_h_r_normal_sprites; er1_v1u_h_notpowered_sprites_right; } spriteset (er1_v2_h_notpowered_sprites_left, "src/emu/er1-gr.png") { s12_template(32, 40, 0) } spriteset (er1_v2_h_loading_sprites, "src/emu/er1-gr.png") { s12_template(32, 40 +134, 0) } spriteset (er1_v2_h_traveling_sprites, "src/emu/er1-gr.png") { s12_template(32, 40 +268, 0) } spritegroup er1_v2_h_normal_sprites { loading: er1_v2_h_loading_sprites; loaded: er1_v2_h_traveling_sprites; } spriteset (er1_v2_h_notpowered_sprites_right, "src/emu/er1-gr.png") { s12_r_template(32 +32, 40 +67, 0) } spriteset (er1_v2_h_r_loading_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +32, 40 +201, 0) } spriteset (er1_v2_h_r_traveling_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +32, 40 +335, 0) } spritegroup er1_v2_h_r_normal_sprites { loading: er1_v2_h_r_loading_sprites; loaded: er1_v2_h_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v2_h_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2_h_normal_sprites; er1_v2_h_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v2_h_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2_h_r_normal_sprites; er1_v2_h_notpowered_sprites_right; } spriteset (er1_v2_m_notpowered_sprites_left, "src/emu/er1-gr.png") { s12_template(32 +447, 40, 0) } spriteset (er1_v2_m_loading_sprites, "src/emu/er1-gr.png") { s12_template(32 +447, 40 +134, 0) } spriteset (er1_v2_m_traveling_sprites, "src/emu/er1-gr.png") { s12_template(32 +447, 40 +268, 0) } spritegroup er1_v2_m_normal_sprites { loading: er1_v2_m_loading_sprites; loaded: er1_v2_m_traveling_sprites; } spriteset (er1_v2_m_notpowered_sprites_right, "src/emu/er1-gr.png") { s12_r_template(32 +447, 40, 0) } spriteset (er1_v2_m_r_loading_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +447, 40 +134, 0) } spriteset (er1_v2_m_r_traveling_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +447, 40 +268, 0) } spritegroup er1_v2_m_r_normal_sprites { loading: er1_v2_m_r_loading_sprites; loaded: er1_v2_m_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v2_m_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2_m_normal_sprites; er1_v2_m_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v2_m_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2_m_r_normal_sprites; er1_v2_m_notpowered_sprites_right; } spriteset (er1_v2_c_notpowered_sprites_left, "src/emu/er1-gr.png") { s12_template(32 +894, 40, 0) } spriteset (er1_v2_c_loading_sprites, "src/emu/er1-gr.png") { s12_template(32 +894, 40 +134, 0) } spritegroup er1_v2_c_sprites_left { loading: er1_v2_c_loading_sprites; loaded: er1_v2_c_notpowered_sprites_left; } spriteset (er1_v2_c_notpowered_sprites_right, "src/emu/er1-gr.png") { s12_r_template(32 +894, 40, 0) } spriteset (er1_v2_c_r_loading_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +894, 40 +134, 0) } spritegroup er1_v2_c_sprites_right { loading: er1_v2_c_r_loading_sprites; loaded: er1_v2_c_notpowered_sprites_right; } spriteset (er1_v2u_h_notpowered_sprites_left, "src/emu/er1-gr.png") { s12_template(32, 442, 0) } spriteset (er1_v2u_h_loading_sprites, "src/emu/er1-gr.png") { s12_template(32, 442 +134, 0) } spriteset (er1_v2u_h_traveling_sprites, "src/emu/er1-gr.png") { s12_template(32, 442 +268, 0) } spritegroup er1_v2u_h_normal_sprites { loading: er1_v2u_h_loading_sprites; loaded: er1_v2u_h_traveling_sprites; } spriteset (er1_v2u_h_notpowered_sprites_right, "src/emu/er1-gr.png") { s12_r_template(32 +32, 442 +67, 0) } spriteset (er1_v2u_h_r_loading_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +32, 442 +201, 0) } spriteset (er1_v2u_h_r_traveling_sprites, "src/emu/er1-gr.png") { s12_r_template(32 +32, 442 +335, 0) } spritegroup er1_v2u_h_r_normal_sprites { loading: er1_v2u_h_r_loading_sprites; loaded: er1_v2u_h_r_traveling_sprites; } switch (FEAT_TRAINS, SELF, er1_v2u_h_sprites_left, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2u_h_normal_sprites; er1_v2u_h_notpowered_sprites_left; } switch (FEAT_TRAINS, SELF, er1_v2u_h_sprites_right, vehicle_is_not_powered || vehicle_is_in_depot) { 0: er1_v2u_h_r_normal_sprites; er1_v2u_h_notpowered_sprites_right; } switch (FEAT_TRAINS, SELF, er1_h_sprites_l, ((LOAD_TEMP(2) >= date(1972,1,1)) * 200) + ((LOAD_TEMP(4) != er1_h) * 100) + cargo_subtype) { 0: er1_v1_h_sprites_left; 1: er1_v2_h_sprites_left; 100: er1_v1_h_notpowered_sprites_left; 101: er1_v2_h_notpowered_sprites_left; 200: er1_v1u_h_sprites_left; 201: er1_v2u_h_sprites_left; 300: er1_v1u_h_notpowered_sprites_left; 301: er1_v2u_h_notpowered_sprites_left; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_h_sprites_r, ((LOAD_TEMP(2) >= date(1972,1,1)) * 200) + ((LOAD_TEMP(4) != er1_h) * 100) + cargo_subtype) { 0: er1_v1_h_sprites_right; 1: er1_v2_h_sprites_right; 100: er1_v1_h_notpowered_sprites_right; 101: er1_v2_h_notpowered_sprites_right; 200: er1_v1u_h_sprites_right; 201: er1_v2u_h_sprites_right; 300: er1_v1u_h_notpowered_sprites_right; 301: er1_v2u_h_notpowered_sprites_right; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_h_sprites_2l, [ STORE_TEMP(2, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) || (position_in_consist == 0) ]) { 1: er1_h_sprites_l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_old, ((LOAD_TEMP(0) - count_veh_id(er1_h) - count_veh_id(er1_m) - count_veh_id(er1_c) + 1) % 2) ) { 1: er1_h_sprites_2l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_16, [ STORE_TEMP(-16, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_old; 2: er1_h_sprites_2l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_14, [ STORE_TEMP(-14, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_16; 2: er1_h_sprites_r; er1_h_sprites_2l;} switch (FEAT_TRAINS, SELF, er1_h_sprites_12, [ STORE_TEMP(-12, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_14; 2: er1_h_sprites_2l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_10, [ STORE_TEMP(-10, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_12; 2: er1_h_sprites_r; er1_h_sprites_2l;} switch (FEAT_TRAINS, SELF, er1_h_sprites_8, [ STORE_TEMP(-8, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_10; 2: er1_h_sprites_2l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_6, [ STORE_TEMP(-6, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_8; 2: er1_h_sprites_r; er1_h_sprites_2l;} switch (FEAT_TRAINS, SELF, er1_h_sprites_4, [ STORE_TEMP(-4, 0x10F), (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_6; 2: er1_h_sprites_2l; er1_h_sprites_r;} switch (FEAT_TRAINS, SELF, er1_h_sprites_2, [ STORE_TEMP(-2, 0x10F), ((var[0x61, 0, 0xFFFF, 0xC6] == er1_h) ) + (((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) * 2) ]) { 1: er1_h_sprites_4; 2: er1_h_sprites_r; er1_h_sprites_2l; } switch (FEAT_TRAINS, SELF, er1_h_sprites_ml, [ STORE_TEMP(2, 0x10F), ((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) ]) { 1: er1_h_sprites_l; er1_h_sprites_2; } switch (FEAT_TRAINS, SELF, er1_h_sprites_start , [ STORE_TEMP(-2, 0x10F), ((var[0x61, 0, 0xFFFF, 0xC6] == er1_m) || (var[0x61, 0, 0xFFFF, 0xC6] == er1_c)) ]) { 1: er1_h_sprites_r; er1_h_sprites_ml; } switch (FEAT_TRAINS, SELF, er1_h_sprites_selfpos, [ STORE_TEMP( (var[0x9F, 0, 0x07] == 3) ? var[0x9C, 0, 0x0F] & 3 : (var[0x9F, 0, 0x07] == 7) ? (3 - var[0x9C, 0, 0x0F] & 3) : (var[0x9F, 0, 0x07] > 3) ? var[0x9A, 0, 0x0F] & 3 : (3 - var[0x9A, 0, 0x0F] & 3), 3) ]) { er1_h_sprites_start; } switch (FEAT_TRAINS, PARENT, er1_h_sprites_parent, [ STORE_TEMP(count_veh_id(er1_h), 0), STORE_TEMP(current_speed, 1), STORE_TEMP(date_of_last_service, 2), STORE_TEMP(vehicle_type_id, 4) ]) { er1_h_sprites_selfpos; } switch (FEAT_TRAINS, SELF, er1_h_sprites, ((extra_callback_info1 & 0xFF) >= 0x20) || (((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) ) { 1: dummy_sprites; er1_h_sprites_parent; } switch (FEAT_TRAINS, SELF, er1_m_direction_left, cargo_subtype + ((LOAD_TEMP(4) != er1_h) * 100) ) { 0: er1_v1_m_sprites_left; 1: er1_v2_m_sprites_left; 100: er1_v1_m_notpowered_sprites_left; 101: er1_v2_m_notpowered_sprites_left; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_m_direction_right, cargo_subtype + ((LOAD_TEMP(4) != er1_h) * 100) ) { 0: er1_v1_m_sprites_right; 1: er1_v2_m_sprites_right; 100: er1_v1_m_notpowered_sprites_right; 101: er1_v2_m_notpowered_sprites_right; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_m_direction_max, LOAD_TEMP(5)) { 0x1003: er1_m_direction_left; 0x2003: er1_m_direction_right; 0x100B: er1_m_direction_left; 0x300B: er1_m_direction_left; 0x400B: er1_m_direction_right; 0x100D: er1_m_direction_left; 0x200D: er1_m_direction_right; 0x400D: er1_m_direction_right; 0x1013: er1_m_direction_left; 0x4013: er1_m_direction_left; 0x5013: er1_m_direction_right; 0x1019: er1_m_direction_left; 0x2019: er1_m_direction_right; 0x5019: er1_m_direction_right; 0x102D: er1_m_direction_left; 0x302D: er1_m_direction_left; 0x402D: er1_m_direction_right; 0x602D: er1_m_direction_right; 0x104D: er1_m_direction_left; 0x404D: er1_m_direction_left; 0x504D: er1_m_direction_right; 0x704D: er1_m_direction_right; 0x1059: er1_m_direction_left; 0x3059: er1_m_direction_left; 0x4059: er1_m_direction_right; 0x7059: er1_m_direction_right; 0x10AD: er1_m_direction_left; 0x30AD: er1_m_direction_left; 0x50AD: er1_m_direction_left; 0x60AD: er1_m_direction_right; 0x80AD: er1_m_direction_right; 0x10B5: er1_m_direction_left; 0x30B5: er1_m_direction_left; 0x40B5: er1_m_direction_right; 0x60B5: er1_m_direction_right; 0x80B5: er1_m_direction_right; 0x1135: er1_m_direction_left; 0x4135: er1_m_direction_left; 0x5135: er1_m_direction_right; 0x7135: er1_m_direction_right; 0x9135: er1_m_direction_right; 0x1159: er1_m_direction_left; 0x3159: er1_m_direction_left; 0x5159: er1_m_direction_left; 0x6159: er1_m_direction_right; 0x9159: er1_m_direction_right; 0x12B5: er1_m_direction_left; 0x32B5: er1_m_direction_left; 0x52B5: er1_m_direction_left; 0x62B5: er1_m_direction_right; 0x82B5: er1_m_direction_right; 0xA2B5: er1_m_direction_right; er1_m_direction_left; } switch (FEAT_TRAINS, SELF, er1_m_direction_template1, STORE_TEMP(LOAD_TEMP(5) + LOAD_TEMP(6), 5)) { er1_m_direction_max; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back12, [ STORE_TEMP(24, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { er1_m_direction_template1; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back11, [ STORE_TEMP(22, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back12; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back10, [ STORE_TEMP(20, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back11; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back9, [ STORE_TEMP(18, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back10; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back8, [ STORE_TEMP(16, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back9; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back7, [ STORE_TEMP(14, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back8; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back6, [ STORE_TEMP(12, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back7; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back5, [ STORE_TEMP(10, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back6; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back4, [ STORE_TEMP(8, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back5; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back3, [ STORE_TEMP(6, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back4; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back2, [ STORE_TEMP(4, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back3; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back1, [ STORE_TEMP(2, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back2; } switch (FEAT_TRAINS, SELF, er1_m_direction_template_back0, [ STORE_TEMP(0, 0x10F), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_direction_template1; er1_m_direction_template_back1; } switch (FEAT_TRAINS, SELF, er1_m_direction_template12, [ STORE_TEMP(-24, 0x10F), STORE_TEMP(2048 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(12 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) ]) { er1_m_direction_template_back0; } switch (FEAT_TRAINS, SELF, er1_m_direction_template11, [ STORE_TEMP(-22, 0x10F), STORE_TEMP(1024 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(11 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template12; } switch (FEAT_TRAINS, SELF, er1_m_direction_template10, [ STORE_TEMP(-20, 0x10F), STORE_TEMP(512 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(10 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template11; } switch (FEAT_TRAINS, SELF, er1_m_direction_template9, [ STORE_TEMP(-18, 0x10F), STORE_TEMP(256 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(9 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template10; } switch (FEAT_TRAINS, SELF, er1_m_direction_template8, [ STORE_TEMP(-16, 0x10F), STORE_TEMP(128 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(8 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template9; } switch (FEAT_TRAINS, SELF, er1_m_direction_template7, [ STORE_TEMP(-14, 0x10F), STORE_TEMP(64 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(7 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template8; } switch (FEAT_TRAINS, SELF, er1_m_direction_template6, [ STORE_TEMP(-12, 0x10F), STORE_TEMP(32 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(6 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template7; } switch (FEAT_TRAINS, SELF, er1_m_direction_template5, [ STORE_TEMP(-10, 0x10F), STORE_TEMP(16 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(5 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template6; } switch (FEAT_TRAINS, SELF, er1_m_direction_template4, [ STORE_TEMP(-8, 0x10F), STORE_TEMP(8 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(4 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template5; } switch (FEAT_TRAINS, SELF, er1_m_direction_template3, [ STORE_TEMP(-6, 0x10F), STORE_TEMP(4 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(3 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template4; } switch (FEAT_TRAINS, SELF, er1_m_direction_template2, [ STORE_TEMP(-4, 0x10F), STORE_TEMP(2 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(2 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template3; } switch (FEAT_TRAINS, SELF, er1_m_direction_template, [ STORE_TEMP(-2, 0x10F), STORE_TEMP(1 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m), 5), STORE_TEMP(1 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_direction_template_back0; er1_m_direction_template2; } switch (FEAT_TRAINS, SELF, er1_m_sprites_start, 0) { er1_m_direction_template; } switch (FEAT_TRAINS, SELF, er1_m_sprites_selfpos, [ STORE_TEMP( (var[0x9F, 0, 0x07] == 3) ? var[0x9C, 0, 0x0F] & 3 : (var[0x9F, 0, 0x07] == 7) ? (3 - var[0x9C, 0, 0x0F] & 3) : (var[0x9F, 0, 0x07] > 3) ? var[0x9A, 0, 0x0F] & 3 : (3 - var[0x9A, 0, 0x0F] & 3), 3) ]) { er1_m_sprites_start; } switch (FEAT_TRAINS, PARENT, er1_m_sprites_parent, [ STORE_TEMP(count_veh_id(er1_m), 0), STORE_TEMP(current_speed, 1), STORE_TEMP(date_of_last_service, 2), STORE_TEMP(vehicle_type_id, 4) ]) { er1_m_sprites_selfpos; } switch (FEAT_TRAINS, SELF, er1_m_sprites, ((extra_callback_info1 & 0xFF) >= 0x20) || (((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) ) { 1: dummy_sprites; er1_m_sprites_parent; } switch (FEAT_TRAINS, SELF, er1_c_direction_left, cargo_subtype + ((LOAD_TEMP(4) != er1_h) * 100) ) { 0: er1_v1_c_sprites_left; 1: er1_v2_c_sprites_left; 100: er1_v1_c_notpowered_sprites_left; 101: er1_v2_c_notpowered_sprites_left; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_c_direction_right, cargo_subtype + ((LOAD_TEMP(4) != er1_h) * 100) ) { 0: er1_v1_c_sprites_right; 1: er1_v2_c_sprites_right; 100: er1_v1_c_notpowered_sprites_right; 101: er1_v2_c_notpowered_sprites_right; align_12_sprites; } switch (FEAT_TRAINS, SELF, er1_c_direction_max, LOAD_TEMP(5)) { 0x200B: er1_c_direction_left; 0x300D: er1_c_direction_right; 0x2013: er1_c_direction_left; 0x3013: er1_c_direction_left; 0x3019: er1_c_direction_right; 0x4019: er1_c_direction_right; 0x202D: er1_c_direction_left; 0x502D: er1_c_direction_right; 0x204D: er1_c_direction_left; 0x304D: er1_c_direction_left; 0x604D: er1_c_direction_right; 0x2059: er1_c_direction_left; 0x5059: er1_c_direction_right; 0x6059: er1_c_direction_right; 0x20AD: er1_c_direction_left; 0x40AD: er1_c_direction_left; 0x70AD: er1_c_direction_right; 0x20B5: er1_c_direction_left; 0x50B5: er1_c_direction_right; 0x70B5: er1_c_direction_right; 0x2135: er1_c_direction_left; 0x3135: er1_c_direction_left; 0x6135: er1_c_direction_right; 0x8135: er1_c_direction_right; 0x2159: er1_c_direction_left; 0x4159: er1_c_direction_left; 0x7159: er1_c_direction_right; 0x8159: er1_c_direction_right; 0x22B5: er1_c_direction_left; 0x42B5: er1_c_direction_left; 0x72B5: er1_c_direction_right; 0x92B5: er1_c_direction_right; er1_c_direction_left; } switch (FEAT_TRAINS, SELF, er1_c_direction_template1, STORE_TEMP(LOAD_TEMP(5) + LOAD_TEMP(6), 5)) { er1_c_direction_max; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back12, [ STORE_TEMP(24, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { er1_c_direction_template1; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back11, [ STORE_TEMP(22, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back12; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back10, [ STORE_TEMP(20, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back11; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back9, [ STORE_TEMP(18, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back10; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back8, [ STORE_TEMP(16, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back9; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back7, [ STORE_TEMP(14, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back8; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back6, [ STORE_TEMP(12, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back7; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back5, [ STORE_TEMP(10, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back6; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back4, [ STORE_TEMP(8, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back5; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back3, [ STORE_TEMP(6, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back4; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back2, [ STORE_TEMP(4, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back3; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back1, [ STORE_TEMP(2, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back2; } switch (FEAT_TRAINS, SELF, er1_c_direction_template_back0, [ STORE_TEMP(0, 0x10F), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_c_direction_template1; er1_c_direction_template_back1; } switch (FEAT_TRAINS, SELF, er1_c_direction_template12, [ STORE_TEMP(-24, 0x10F), STORE_TEMP(2048 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(12 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) ]) { er1_c_direction_template_back0; } switch (FEAT_TRAINS, SELF, er1_c_direction_template11, [ STORE_TEMP(-22, 0x10F), STORE_TEMP(1024 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(11 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template12; } switch (FEAT_TRAINS, SELF, er1_c_direction_template10, [ STORE_TEMP(-20, 0x10F), STORE_TEMP(512 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(10 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template11; } switch (FEAT_TRAINS, SELF, er1_c_direction_template9, [ STORE_TEMP(-18, 0x10F), STORE_TEMP(256 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(9 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template10; } switch (FEAT_TRAINS, SELF, er1_c_direction_template8, [ STORE_TEMP(-16, 0x10F), STORE_TEMP(128 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(8 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template9; } switch (FEAT_TRAINS, SELF, er1_c_direction_template7, [ STORE_TEMP(-14, 0x10F), STORE_TEMP(64 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(7 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template8; } switch (FEAT_TRAINS, SELF, er1_c_direction_template6, [ STORE_TEMP(-12, 0x10F), STORE_TEMP(32 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(6 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template7; } switch (FEAT_TRAINS, SELF, er1_c_direction_template5, [ STORE_TEMP(-10, 0x10F), STORE_TEMP(16 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(5 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template6; } switch (FEAT_TRAINS, SELF, er1_c_direction_template4, [ STORE_TEMP(-8, 0x10F), STORE_TEMP(8 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(4 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template5; } switch (FEAT_TRAINS, SELF, er1_c_direction_template3, [ STORE_TEMP(-6, 0x10F), STORE_TEMP(4 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(3 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template4; } switch (FEAT_TRAINS, SELF, er1_c_direction_template2, [ STORE_TEMP(-4, 0x10F), STORE_TEMP(2 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(2 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template3; } switch (FEAT_TRAINS, SELF, er1_c_direction_template, [ STORE_TEMP(-2, 0x10F), STORE_TEMP(1 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m), 5), STORE_TEMP(1 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_c_direction_template_back0; er1_c_direction_template2; } switch (FEAT_TRAINS, SELF, er1_c_sprites_start, 0) { er1_c_direction_template; } switch (FEAT_TRAINS, SELF, er1_c_sprites_selfpos, [ STORE_TEMP( (var[0x9F, 0, 0x07] == 3) ? var[0x9C, 0, 0x0F] & 3 : (var[0x9F, 0, 0x07] == 7) ? (3 - var[0x9C, 0, 0x0F] & 3) : (var[0x9F, 0, 0x07] > 3) ? var[0x9A, 0, 0x0F] & 3 : (3 - var[0x9A, 0, 0x0F] & 3), 3) ]) { er1_c_sprites_start; } switch (FEAT_TRAINS, PARENT, er1_c_sprites_parent, [ STORE_TEMP(count_veh_id(er1_c), 0), STORE_TEMP(current_speed, 1), STORE_TEMP(date_of_last_service, 2), STORE_TEMP(vehicle_type_id, 4) ]) { er1_c_sprites_selfpos; } switch (FEAT_TRAINS, SELF, er1_c_sprites, ((extra_callback_info1 & 0xFF) >= 0x20) || (((extra_callback_info1 & 0xFF) == 0) && (var[0x62, 7, 1, 1] != 0)) ) { 1: dummy_sprites; er1_c_sprites_parent; } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon_head, vehicle_type_id) { er1_h: return CB_RESULT_ATTACH_ALLOW; return string(STR_CAN_ATTACH_HEAD_ONLY); } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon_car, vehicle_type_id) { er1_c: return CB_RESULT_ATTACH_ALLOW; return string(STR_CAN_ATTACH_OTHERCAR_ONLY); } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon_motor, vehicle_type_id) { er1_m: return CB_RESULT_ATTACH_ALLOW; return string(STR_CAN_ATTACH_OTHERCAR_ONLY); } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon_not_head, vehicle_type_id) { er1_m: return CB_RESULT_ATTACH_ALLOW; er1_c: return CB_RESULT_ATTACH_ALLOW; return string(STR_CAN_ATTACH_CAR_ONLY); } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon_not_motor, vehicle_type_id) { er1_h: return CB_RESULT_ATTACH_ALLOW; er1_c: return CB_RESULT_ATTACH_ALLOW; return string(STR_CAN_ATTACH_OTHERCAR_ONLY); } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_max, LOAD_TEMP(5)) { 0x1000: er1_can_attach_wagon_motor; 0x2001: er1_can_attach_wagon_not_head; 0x3002: er1_can_attach_wagon_motor; 0x3003: er1_can_attach_wagon_not_motor; 0x4005: er1_can_attach_wagon_not_head; 0x4006: er1_can_attach_wagon_motor; 0x500A: er1_can_attach_wagon_motor; 0x500B: er1_can_attach_wagon_not_motor; 0x500D: er1_can_attach_wagon_head; 0x6015: er1_can_attach_wagon_motor; 0x6016: er1_can_attach_wagon_motor; 0x702B: er1_can_attach_wagon_car; 0x702D: er1_can_attach_wagon_not_motor; 0x8056: er1_can_attach_wagon_motor; 0x805A: er1_can_attach_wagon_motor; 0x90AD: er1_can_attach_wagon_head; 0x90B5: er1_can_attach_wagon_head; return string(STR_CAN_ATTACH_OTHERCAR_ONLY); } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template12, [ STORE_TEMP(num_vehs_in_consist-24, 0x10F), STORE_TEMP(2048 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(12 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) ]) { er1_can_attach_wagon_max; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template11, [ STORE_TEMP(num_vehs_in_consist-22, 0x10F), STORE_TEMP(1024 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(11 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template12; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template10, [ STORE_TEMP(num_vehs_in_consist-20, 0x10F), STORE_TEMP(512 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(10 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template11; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template9, [ STORE_TEMP(num_vehs_in_consist-18, 0x10F), STORE_TEMP(256 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(9 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template10; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template8, [ STORE_TEMP(num_vehs_in_consist-16, 0x10F), STORE_TEMP(128 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(8 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template9; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template7, [ STORE_TEMP(num_vehs_in_consist-14, 0x10F), STORE_TEMP(64 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(7 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template8; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template6, [ STORE_TEMP(num_vehs_in_consist-12, 0x10F), STORE_TEMP(32 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(6 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template7; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template5, [ STORE_TEMP(num_vehs_in_consist-10, 0x10F), STORE_TEMP(16 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(5 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template6; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template4, [ STORE_TEMP(num_vehs_in_consist-8, 0x10F), STORE_TEMP(8 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(4 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template5; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template3, [ STORE_TEMP(num_vehs_in_consist-6, 0x10F), STORE_TEMP(4 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(3 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template4; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template2, [ STORE_TEMP(num_vehs_in_consist-4, 0x10F), STORE_TEMP(2 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(2 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template3; } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon_template, [ STORE_TEMP(num_vehs_in_consist-2, 0x10F), STORE_TEMP(1 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m), 5), STORE_TEMP(1 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h) + LOAD_TEMP(5), 5) >= 4096 ]) { 1: er1_can_attach_wagon_max; er1_can_attach_wagon_template2; } switch (FEAT_TRAINS, SELF, er1_can_attach_wagon1, vehicle_type_id) { er1_h: er1_can_attach_wagon_template; er1_m: er1_can_attach_wagon_template; er1_c: er1_can_attach_wagon_template; return string(STR_CAN_ATTACH_SAME_MU_ONLY); } switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon, count_veh_id(er1_h)) { 0: return string(STR_CAN_ATTACH_HEAD_ONLY); 1: er1_can_attach_wagon1; return string(STR_CAN_ATTACH_NO_AFTER_REAR_HEAD); } switch (FEAT_TRAINS, PARENT, er1_h_start_stop, count_veh_id(er1_h)) { 2: return CB_RESULT_NO_TEXT; return string(STR_START_STOP_NUMBER_OF_HEAD_CAR_MUST_BE_EVEN); } // Моторный самостоятельно выпускать из депо нельзя switch (FEAT_TRAINS, SELF, er1_m_start_stop, 0) { return string(STR_START_STOP_MOTORIZED_CAR_CANNOT_LEAVE_DEPOT); } // Визуализируем эффекты тяги у er1_m, только если локомотив - er1_h switch (FEAT_TRAINS, SELF, er1_m_create_effect_left, STORE_TEMP(create_effect(EFFECT_SPRITE_ELECTRIC, -1, 0, 10), 0x100)) { return 1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_right, STORE_TEMP(create_effect(EFFECT_SPRITE_ELECTRIC, 5, 0, 10), 0x100)) { return 1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_x, STORE_TEMP(create_effect(EFFECT_SPRITE_ELECTRIC, 5, 0, 10), 0x100)) { return 1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_max, LOAD_TEMP(5)) { 0x1003: er1_m_create_effect_left; 0x2003: er1_m_create_effect_right; 0x100B: er1_m_create_effect_left; 0x300B: er1_m_create_effect_left; 0x400B: er1_m_create_effect_right; 0x100D: er1_m_create_effect_left; 0x200D: er1_m_create_effect_right; 0x400D: er1_m_create_effect_right; 0x1013: er1_m_create_effect_left; 0x4013: er1_m_create_effect_left; 0x5013: er1_m_create_effect_right; 0x1019: er1_m_create_effect_left; 0x2019: er1_m_create_effect_right; 0x5019: er1_m_create_effect_right; 0x102D: er1_m_create_effect_left; 0x302D: er1_m_create_effect_left; 0x402D: er1_m_create_effect_right; 0x602D: er1_m_create_effect_right; 0x104D: er1_m_create_effect_left; 0x404D: er1_m_create_effect_left; 0x504D: er1_m_create_effect_right; 0x704D: er1_m_create_effect_right; 0x1059: er1_m_create_effect_left; 0x3059: er1_m_create_effect_left; 0x4059: er1_m_create_effect_right; 0x7059: er1_m_create_effect_right; 0x10AD: er1_m_create_effect_left; 0x30AD: er1_m_create_effect_left; 0x50AD: er1_m_create_effect_left; 0x60AD: er1_m_create_effect_right; 0x80AD: er1_m_create_effect_right; 0x10B5: er1_m_create_effect_left; 0x30B5: er1_m_create_effect_left; 0x40B5: er1_m_create_effect_right; 0x60B5: er1_m_create_effect_right; 0x80B5: er1_m_create_effect_right; 0x1135: er1_m_create_effect_left; 0x4135: er1_m_create_effect_left; 0x5135: er1_m_create_effect_right; 0x7135: er1_m_create_effect_right; 0x9135: er1_m_create_effect_right; 0x1159: er1_m_create_effect_left; 0x3159: er1_m_create_effect_left; 0x5159: er1_m_create_effect_left; 0x6159: er1_m_create_effect_right; 0x9159: er1_m_create_effect_right; 0x12B5: er1_m_create_effect_left; 0x32B5: er1_m_create_effect_left; 0x52B5: er1_m_create_effect_left; 0x62B5: er1_m_create_effect_right; 0x82B5: er1_m_create_effect_right; 0xA2B5: er1_m_create_effect_right; er1_m_create_effect_x; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template1, STORE_TEMP(LOAD_TEMP(5) + LOAD_TEMP(6), 5)) { er1_m_create_effect_direction_max; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back12, [ STORE_TEMP(24, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { er1_m_create_effect_direction_template1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back11, [ STORE_TEMP(22, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back12; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back10, [ STORE_TEMP(20, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back11; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back9, [ STORE_TEMP(18, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back10; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back8, [ STORE_TEMP(16, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back9; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back7, [ STORE_TEMP(14, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back8; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back6, [ STORE_TEMP(12, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back7; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back5, [ STORE_TEMP(10, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back6; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back4, [ STORE_TEMP(8, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back5; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back3, [ STORE_TEMP(6, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back4; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back2, [ STORE_TEMP(4, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back3; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back1, [ STORE_TEMP(2, 0x10F), STORE_TEMP((LOAD_TEMP(7) == er1_m) + (2 * LOAD_TEMP(5)), 5), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back2; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template_back0, [ STORE_TEMP(0, 0x10F), STORE_TEMP(var[0x61, 0, 0xFFFF, 0xC6], 7) == er1_h ]) { 1: er1_m_create_effect_direction_template1; er1_m_create_effect_direction_template_back1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template12, [ STORE_TEMP(-24, 0x10F), STORE_TEMP(2048 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(12 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) ]) { er1_m_create_effect_direction_template_back0; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template11, [ STORE_TEMP(-22, 0x10F), STORE_TEMP(1024 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(11 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template12; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template10, [ STORE_TEMP(-20, 0x10F), STORE_TEMP(512 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(10 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template11; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template9, [ STORE_TEMP(-18, 0x10F), STORE_TEMP(256 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(9 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template10; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template8, [ STORE_TEMP(-16, 0x10F), STORE_TEMP(128 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(8 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template9; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template7, [ STORE_TEMP(-14, 0x10F), STORE_TEMP(64 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(7 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template8; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template6, [ STORE_TEMP(-12, 0x10F), STORE_TEMP(32 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(6 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template7; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template5, [ STORE_TEMP(-10, 0x10F), STORE_TEMP(16 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(5 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template6; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template4, [ STORE_TEMP(-8, 0x10F), STORE_TEMP(8 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(4 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template5; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template3, [ STORE_TEMP(-6, 0x10F), STORE_TEMP(4 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(3 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template4; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template2, [ STORE_TEMP(-4, 0x10F), STORE_TEMP(2 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m) + LOAD_TEMP(5), 5), STORE_TEMP(2 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template3; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_direction_template, [ STORE_TEMP(-2, 0x10F), STORE_TEMP(1 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_m), 5), STORE_TEMP(1 * 4096 * (var[0x61, 0, 0xFFFF, 0xC6] == er1_h), 6) >= 4096 ]) { 1: er1_m_create_effect_direction_template_back0; er1_m_create_effect_direction_template2; } switch (FEAT_TRAINS, PARENT, er1_m_create_effect, vehicle_type_id == er1_h) { 1: er1_m_create_effect_direction_template; return 0; } // Даём тягу, только если локомотив - er1_h switch (FEAT_TRAINS, PARENT, er1_m_power, vehicle_type_id == er1_h) { 1: return int (853 * 0.9865); return 0; } // Допускается эксплуатация с пассажирами только если голова - er1_h switch (FEAT_TRAINS, PARENT, er1_h_cargo_capacity, (vehicle_type_id == er1_h)) { 1: return 88; return 0; } switch (FEAT_TRAINS, PARENT, er1_m_cargo_capacity, (vehicle_type_id == er1_h) ) { 1: return 110; return 0; } switch (FEAT_TRAINS, PARENT, er1_c_cargo_capacity, (vehicle_type_id == er1_h) ) { 1: return 110; return 0; } switch (FEAT_TRAINS, SELF, er1_cargo_subtype_text, cargo_subtype) { 0: return string(STR_REFIT_FACTORY_6211, string(STR_REFIT_TTD_53)); 1: return string(STR_REFIT_FACTORY_6211, string(STR_REFIT_TTD_59)); return CB_RESULT_NO_TEXT; } item (FEAT_TRAINS, er1_h) { property { name: string(STR_ER1_H_NAME); climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND); introduction_date: date(1957 - delta_age, 1, 1); model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default); retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age; vehicle_life: 30; reliability_decay: 20; cargo_allow_refit: [PASS]; default_cargo_type: PASS; loading_speed: 12; cost_factor: 2; running_cost_factor: 4; sprite_id: SPRITE_ID_NEW_TRAIN; speed: 130 km/h; misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); refit_cost: 0; track_type: enable_our_own_tracks ? ERD1 : ELRL; ai_special_flag: AI_FLAG_PASSENGER; power: 1 hpM; running_cost_base: RUNNING_COST_ELECTRIC; cargo_capacity: 88; weight: 38.5 ton; engine_class: ENGINE_CLASS_ELECTRIC; length: 8; effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_NONE; } graphics { default: er1_h_sprites; purchase: er1_h_purchase_sprites; articulated_part: articulated_part_dummy4; can_attach_wagon: er1_can_attach_wagon; start_stop: er1_h_start_stop; speed: speed_after30_130to100; purchase_speed: return 130; additional_text: return string(STR_ER1_H_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10)); cargo_subtype_text: er1_cargo_subtype_text; power: return 0; cargo_capacity: er1_h_cargo_capacity; } } item (FEAT_TRAINS, er1_m) { property { name: string(STR_ER1_M_NAME); climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND); introduction_date: date(1957 - delta_age, 1, 1); model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default); retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age; vehicle_life: 30; reliability_decay: 20; cargo_allow_refit: [PASS]; default_cargo_type: PASS; loading_speed: 12; cost_factor: 2; running_cost_factor: 4; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); refit_cost: 0; track_type: enable_our_own_tracks ? ERD1 : ELRL; ai_special_flag: AI_FLAG_PASSENGER; power: 853 hpM; running_cost_base: RUNNING_COST_ELECTRIC; cargo_capacity: 110; weight: 52.5 ton; engine_class: ENGINE_CLASS_ELECTRIC; tractive_effort_coefficient: (35.0/(52.5)/9.8); length: 8; effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_STEAM; } graphics { default: er1_m_sprites; purchase: er1_m_purchase_sprites; articulated_part: articulated_part_dummy4; can_attach_wagon: er1_can_attach_wagon; start_stop: er1_m_start_stop; speed: speed_after30_130to100; purchase_speed: return 130; additional_text: return string(STR_ER1_M_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10)); cargo_subtype_text: er1_cargo_subtype_text; power: er1_m_power; cargo_capacity: er1_m_cargo_capacity; create_effect: er1_m_create_effect; } } item (FEAT_TRAINS, er1_c) { property { name: string(STR_ER1_C_NAME); climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND); introduction_date: date(1957 - delta_age, 1, 1); model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default); retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age; vehicle_life: 30; reliability_decay: 20; cargo_allow_refit: [PASS]; default_cargo_type: PASS; loading_speed: 12; cost_factor: 2; running_cost_factor: 4; sprite_id: SPRITE_ID_NEW_TRAIN; misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU); refit_cost: 0; track_type: enable_our_own_tracks ? ERD1 : ELRL; ai_special_flag: AI_FLAG_PASSENGER; power: 1 hpM; running_cost_base: RUNNING_COST_ELECTRIC; cargo_capacity: 110; weight: 36.9 ton; engine_class: ENGINE_CLASS_ELECTRIC; length: 8; effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_NONE; } graphics { default: er1_c_sprites; purchase: er1_c_purchase_sprites; articulated_part: articulated_part_dummy4; additional_text: return string(STR_ER1_C_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10)); cargo_subtype_text: er1_cargo_subtype_text; speed: speed_after30_130to100; purchase_speed: return 130; power: return 0; can_attach_wagon: er1_can_attach_wagon; start_stop: return string(STR_START_STOP_HEAD_REQUIRED); cargo_capacity: er1_c_cargo_capacity; } } if (enable_long_names) { item (FEAT_TRAINS, er1_h) { property { name: string(STR_ER1_H_NAME_LONG); } } item (FEAT_TRAINS, er1_m) { property { name: string(STR_ER1_M_NAME_LONG); } } item (FEAT_TRAINS, er1_c) { property { name: string(STR_ER1_C_NAME_LONG); } } } /* #include "src/emu/er2.pnml" #include "src/emu/epg.pnml" #include "src/emu/epr.pnml" #include "src/emu/ed2t.pnml" #include "src/emu/ed9t.pnml" #include "src/emu/er200.pnml" #include "src/emu/er9p.pnml" #include "src/emu/er9m.pnml" #include "src/emu/er9e.pnml" #include "src/emu/evs1.pnml" #include "src/emu/evs2.pnml" #include "src/emu/ed4m.pnml" #include "src/emu/sm6.pnml" #include "src/emu/es1.pnml" #include "src/emu/sr3.pnml" */