Loading

Paste #po9bbf81h

  1.  // xussr
  2.  /// header
  3. grf
  4. {
  5.   grfid: "AKA\08";
  6.   name: string(STR_GRF_NAME);
  7.   desc: string(STR_GRF_DESC);
  8.   url: string(STR_GRF_URL);
  9.   version: 1281;
  10.   min_compatible_version: 496;
  11.   param 0
  12.   {
  13.     enable_our_own_tracks
  14.     {
  15.       name: string(STR_PARAM_NAME_ENABLE_OUR_OWN_TRACKS);
  16.       desc: string(STR_PARAM_DESC_ENABLE_OUR_OWN_TRACKS);
  17.       type: bool;
  18.       bit: 4;
  19.       def_value: 1;
  20.     }
  21.     enable_icons
  22.     {
  23.       name: string(STR_PARAM_NAME_ENABLE_ICONS);
  24.       desc: string(STR_PARAM_DESC_ENABLE_ICONS);
  25.       type: bool;
  26.       bit: 6;
  27.       def_value: 1;
  28.     }
  29.     enable_long_names
  30.     {
  31.       name: string(STR_PARAM_NAME_ENABLE_LONG_NAMES);
  32.       desc: string(STR_PARAM_DESC_ENABLE_LONG_NAMES);
  33.       type: bool;
  34.       bit: 7;
  35.       def_value: 1;
  36.     }
  37.     enable_override_cargo
  38.     {
  39.       name: string(STR_PARAM_NAME_ENABLE_OVERRIDE_CARGO);
  40.       desc: string(STR_PARAM_DESC_ENABLE_OVERRIDE_CARGO);
  41.       type: bool;
  42.       bit: 3;
  43.       def_value: 1;
  44.     }
  45.     enable_standard_engine
  46.     {
  47.       name: string(STR_PARAM_NAME_ENABLE_STANDARD_ENGINE);
  48.       desc: string(STR_PARAM_DESC_ENABLE_STANDARD_ENGINE);
  49.       type: bool;
  50.       bit: 0;
  51.       def_value: 0;
  52.     }
  53.     enable_standard_car
  54.     {
  55.       name: string(STR_PARAM_NAME_ENABLE_STANDARD_CAR);
  56.       desc: string(STR_PARAM_DESC_ENABLE_STANDARD_CAR);
  57.       type: bool;
  58.       bit: 1;
  59.       def_value: 0;
  60.     }
  61.     enable_debug_car
  62.     {
  63.       name: string(STR_PARAM_NAME_ENABLE_DEBUG_CAR);
  64.       desc: string(STR_PARAM_DESC_ENABLE_DEBUG_CAR);
  65.       type: bool;
  66.       bit: 2;
  67.       def_value: 0;
  68.     }
  69.     enable_debug_cost
  70.     {
  71.       name: string(STR_PARAM_NAME_ENABLE_DEBUG_COST);
  72.       desc: string(STR_PARAM_DESC_ENABLE_DEBUG_COST);
  73.       type: bool;
  74.       bit: 5;
  75.       def_value: 0;
  76.     }
  77.   }
  78.   param 1
  79.   {
  80.     speed_penalty_percent
  81.     {
  82.       type: int;
  83.       name: string(STR_PARAM_NAME_SPEED_PENALTY_PERCENT);
  84.       desc: string(STR_PARAM_DESC_SPEED_PENALTY_PERCENT);
  85.       min_value: 10;
  86.       max_value: 50;
  87.       def_value: 15;
  88.     }
  89.   }
  90. /*
  91.  
  92.   param 2
  93.  
  94.   {
  95.  
  96.     start_year_for_cost
  97.  
  98.     {
  99.  
  100.       type: int;
  101.  
  102.       name: string(STR_PARAM_NAME_START_YEAR);
  103.  
  104.       desc: string(STR_PARAM_DESC_START_YEAR);
  105.  
  106.       min_value: 0;
  107.  
  108.       max_value: 2050;
  109.  
  110.       def_value: 0;
  111.  
  112.     }
  113.  
  114.   }
  115.  
  116.   param 3
  117.  
  118.   {
  119.  
  120.     inflation_for_cost
  121.  
  122.     {
  123.  
  124.       type: int;
  125.  
  126.       name: string(STR_PARAM_NAME_INFLATION);
  127.  
  128.       desc: string(STR_PARAM_DESC_INFLATION);
  129.  
  130.       min_value: 0;
  131.  
  132.       max_value: 4;
  133.  
  134.       def_value: 2;
  135.  
  136.     }
  137.  
  138.   }
  139.  
  140. */
  141. }
  142.  /// check
  143. // version check
  144. // only for OpenTTD >= r23744
  145. // (возможно совместное использование транспорта GRF7 и GRF8 без исключения)
  146. if (ttd_platform != PLATFORM_OPENTTD ||
  147.   openttd_version < version_openttd(1, 2, 0, 23744))
  148. {
  149.   error(ERROR, REQUIRES_OPENTTD, string(STR_MIN_OPENTTD_VERSION));
  150. }
  151. // Check for engine pool
  152. if (!dynamic_engines)
  153. {
  154.   error(ERROR, USED_WITH, string(STR_USE_ENGINE_POOL));
  155. }
  156.  // cargotable
  157. // Список меток грузов, включая стандартные, тойлэнд, ECS, FIRS
  158. // по алфавиту
  159. cargotable
  160. {
  161.   AORE,
  162.   BATT, BDMT, BEER, BRCK, BUBL,
  163.   CERA, CERE, CLAY, CMNT, COAL, COLA, COPR, CORE, CTCD,
  164.   DIAM, DYES,
  165.   ENSP,
  166.   FERT, FICR, FISH, FMSP, FOOD, FRUT, FRVG, FZDR,
  167.   GEAR, GLAS, GOLD, GOOD, GRAI, GRVL,
  168.   IORE,
  169.   LIME, LVST,
  170.   MAIL, MAIZ, MILK, MNSP,
  171.   OIL_, OLSD,
  172.   PAPR, PASS, PETR, PLST, PLAS, POTA,
  173.   RCYC, RFPR, RUBR,
  174.   SAND, SCMT, SGBT, SGCN, STEL, SUGR, SULP, SWET,
  175.   TOFF, TOUR, TOYS,
  176.   VALU, VEHI,
  177.   WATR, WDPR, WHEA, WOOD, WOOL
  178. }
  179.  /// railtypetable
  180. // Список меток типов рельсов
  181. /*
  182.  
  183. railtypetable {
  184.  
  185.  
  186.  
  187. // автономная
  188.  
  189.   RLA1: [BAEN, SAEN, RAIL],
  190.  
  191.   RLA2: [BBEN, SBEN, RAIL],
  192.  
  193.   RLA3: [BCEN, SCEN, RAIL],
  194.  
  195.  
  196.  
  197. // переменного тока
  198.  
  199.   ERA1: [BAEA, SAEA, ELRL],
  200.  
  201.   ERA2: [BBEA, SBEA, ELRL],
  202.  
  203.   ERA3: [BCEA, SCEA, ELRL],
  204.  
  205.  
  206.  
  207. // постоянного тока
  208.  
  209.   ERD1: [BAED, SAED, ELRL],
  210.  
  211.   ERD2: [BBED, SBED, ELRL],
  212.  
  213.   ERD3: [BCED, SCED, ELRL],
  214.  
  215.  
  216.  
  217. // двусистемная
  218.  
  219.   ER2S: [BBEE, SBEE, ELRL],
  220.  
  221.  
  222.  
  223. RAIL, ELRL,
  224.  
  225.  
  226.  
  227. BAEN, SAEN,
  228.  
  229. BBEN, SBEN,
  230.  
  231. BCEN, SCEN,
  232.  
  233.            
  234.  
  235. BAEA, SAEA,
  236.  
  237. BBEA, SBEA,
  238.  
  239. BCEA, SCEA,
  240.  
  241.            
  242.  
  243. BAED, SAED,
  244.  
  245. BBED, SBED,
  246.  
  247. BCED, SCED,
  248.  
  249.            
  250.  
  251. BBEE, SBEE
  252.  
  253.  
  254.  
  255. }
  256.  
  257. */
  258. /*
  259.  
  260. railtypetable {
  261.  
  262.  
  263.  
  264. // автономная
  265.  
  266.   RLA1: [BAEN, SAEN, RAIL],
  267.  
  268.  
  269.  
  270. // переменного тока
  271.  
  272.   ERA1: [BAEA, BAEE, SAEA, SAEE, ELRL],
  273.  
  274.  
  275.  
  276. // постоянного тока
  277.  
  278.   ERD1: [BAED, BAEE, SAED, DAEE, ELRL],
  279.  
  280.  
  281.  
  282. // двусистемная
  283.  
  284.   ER2S: [BAEE, SAEE, ELRL]
  285.  
  286. }
  287.  
  288. */
  289. railtypetable {
  290.   RAIL, ELRL,
  291. // автономная
  292.   RLA1,
  293.   RLA2,
  294.   RLA3,
  295. // переменного тока
  296.   ERA1,
  297.   ERA2,
  298.   ERA3,
  299. // постоянного тока
  300.   ERD1,
  301.   ERD2,
  302.   ERD3,
  303. // двусистемная
  304.   ER2S
  305. }
  306.  /// definition
  307. // Используем полноразмерные поезда в депо
  308. train_width_32_px = 1;
  309. // Вертикаль поезда в депо
  310. traininfo_y_offset = 3;
  311. // Период, в который поезд считается новым (гарантийным) и не допускает депошного творчества
  312. new_train_age = 5;
  313. // Истечение срока
  314. retire_early_default = -8;
  315. delta_age = 1;
  316. // RE
  317. // модель
  318. // вычитаем 2 года из года ввода ТС, для прицепных и немоторных вагонов
  319. // вычитаем 2 года из года ввода ТС, для головных вагонов и локомотивов
  320. // максимальная скорость
  321. // рисуем [не] на карте?
  322. // рисуем в депо
  323. // Не построен
  324. // Построен
  325. // ТС по [-]смещению в цепочке [не] скрыто?
  326. // Для получения характеристик предыдущего ПС в цепочке
  327. // для записи смещения в регистр (работа с переменной 0x61)
  328. // Для краткой записи списка климатов ПС
  329. // Для выбора правильного набора спрайтов в случае флага TRAIN_FLAG_FLIP
  330. // или CB_RESULT_REVERSED_VEHICLE
  331. // Порог скорости электровозов
  332. // x км/ч * 0.2778 == value
  333. // 50 км/ч --> 13 (13.89)
  334. // 62 км/ч --> 17 (17.2236)
  335. //threshold of speed
  336. // обобщение свойств для категорий ПС
  337. // сокращение для отключения визуальных эффектов тяги и тяги вагонов
  338. // визуальные эффекты для электротяги
  339. // визуальные эффекты для дизельной тяги
  340. // визуальные эффекты для паровой тяги
  341. // поправка для функции мощности (power cb)
  342. // задаваемое в свойстве отличается от возвращаемого функцией
  343. // Получаем оштрафованную величину скорости, 15%
  344. // Флаг штрафа поезда по скорости
  345. // обычные рельсы в зависимости от настроек
  346. // рельсы для постоянного и переменного тока в зависимости от настроек
  347. // для двусистемных
  348. // Штрафуем ли по скорости
  349. // Вычисляем ТУ по формуле (табличное_значение/масса/9.8)
  350. // ТУ для cb tractive_effort_coefficient
  351.  /// graphics definition
  352. // Определение спрайта меню покупки
  353. // 1-осекционный электровоз с 2 пантографами
  354. // 2-хсекционный электровоз с 2 пантографами
  355. // 2-хсекционный электровоз с 1 пантографом
  356. // 2-хсекционный электровоз без пантографа
  357. // Для всех ЭМВПС если голова неверная, то тяги нет по определению - проверка неверной головы не предполагается
  358. // МВПС 2 головных без отдельного реверса (промежуточные головные)
  359. // МВПС 2 головных с отдельным реверсом (промежуточные головные)
  360. // МВПС 3 головных без отдельного реверса
  361. // МВПС 4 головных без отдельного реверса (Промежуточные головы)
  362. // МВПС 2 мотоных без отдельного реверса (двусистемные МВПС) (погрузка не производится)
  363. // МВПС 2 мотоных с отдельным реверсом (двусистемные МВПС) (погрузка не производится)
  364. // МВПС 3 мотоных без отдельного реверса
  365. // МВПС 3 мотоных с отдельным реверсом
  366. // МВПС 4 мотоных без отдельного реверса (двусистемные МВПС)
  367. // МВПС 4 мотоных с отдельным реверсом (двусистемные МВПС)
  368. // МВПС 1 немоторных без отдельного реверса (погрузка не производится)
  369. // МВПС 2 немоторных с отдельным реверсом
  370. // Вагоны пассажирские. 2 вида (погрузка/в пути) и отдельный вид последнего вагона                  
  371. // Полувагоны, платформы.
  372. // шаблон пустого вагона
  373. // шаблон груза, 2 ливреи, 3 вида загруженности
  374. // 25-49%, 50-74%, полный
  375. // шаблон груза, 2 ливреи, 3 вида загруженности
  376. // 25-49%, 50-74%, полный
  377. // шаблон груза, 3 вида загруженности
  378. // шаблон груза, 3 вида загруженности. Модифицированный
  379. // шаблон груза, 2 вида загруженности                                                                
  380. // шаблон груза, 2 вида загруженности 2                                                        
  381. // шаблон груза, 1 вид загруженности                                                        
  382. // шаблон пустого крытого вагона                                              
  383. // шаблон: движение/100%, 30%, 60%, 90%                                              
  384. // шаблон вагона рефсекции. Рефсекция обращается только целиком, bitmask(TRIGGER_VEHICLE_SERVICE) не является частью шаблона
  385. // шаблон цистерны
  386.  /// code definition
  387. // Выбор ориентации кабины секции для СМЕ (схема без альтернатив в СМЕ)
  388. // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой)
  389. // Выбор ориентации кабины секции для СМЕ (схема без альтернатив и средней секцией)
  390. // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой и средней секцией)
  391. // Выбор ориентации кабины секции для СМЕ (схема без альтернатив и 2-я средними секциями)
  392. // Выбор ориентации кабины секции для СМЕ (схема с 1 альтернативой и 2-я средними секциями)
  393. // Определение пенальти на скорость (схема без СМЕ)
  394. // Определение пенальти на скорость (схема без альтернатив в СМЕ)
  395. // Определение пенальти на скорость (схема c 1 альтернативой в СМЕ)
  396. // Определение пенальти на скорость (схема c 2 альтернативами в СМЕ)
  397. // Определение пенальти на скорость (схема c 3 альтернативами в СМЕ)
  398. // Определение пенальти на скорость (схема c 4 альтернативами в СМЕ)
  399. // Определение пенальти на скорость (схема c 5 альтернативами в СМЕ)
  400. // Определение пенальти на скорость (схема c 6 альтернативами в СМЕ)
  401. // Определение скорости без вариантов
  402. // Определение скорости с изменением в заданный год
  403. // Определение скорости с изменением по году постройки
  404. // Определение скорости с изменением по году постройки и в заданном году
  405. // Определение скорости с изменением в 2 заданных года
  406. // Определение скорости со снижением для старых
  407. // Определение скорости со снижением для старых и изменением скорости по году постройки
  408. // Определение скорости со снижением для старых и с предсерийной моделью
  409. // определение расхода топлива
  410. // расход определяется граничным на разгоне, торможении, подъёме, спуске.
  411. // в оставшемся случае расходуется часть, пропорциональная доли массы от общей доли в массе
  412. // (общая масса на долю мощности в общей мощности)
  413. //      return (rc_max * (((LOAD_TEMP(6) + 500) * power / LOAD_TEMP(5)) / weight)); }                            
  414. // передеать так, что если в гору скорость свыше 90%, то значит мощи хватает и считать обычным образом.
  415. // не выпускать новые тройники без средней секции
  416. // не выпускать новые двойки с средней секцией
  417. // Если рисуем на карте и следующий в цепочке вагон скрыт, то отдаём пустышку
  418. // пляски с 0x9C и 0x9A для паровозов, чтобы клёса крутились в зависимости от положения, а не от времени.
  419. // Регистр 5 и 6 занимаем под ЭМВПС
  420. // long vehicle template
  421. // short vehicle template
  422. // special vehicle template
  423. //
  424.  /// code definition - mu
  425. // Шаблон расчёта конфигурации ЭМВПС
  426. // Шаблон расчёта ориентации ЭМВПС
  427. // шаблон ориентации
  428. //                                                                  
  429.  /// template
  430. // покупка
  431. template new_purchase_template(x, y)
  432. {
  433.   [x, y, 100, 18, -40, -11]
  434. }
  435. template new_purchase_template_noico(x, y)
  436. {
  437.   [x+18, y, 82, 18, -40, -11]
  438. }
  439. // невидимка
  440. template dummy_template(x, y)
  441. {
  442.   [x, y, 1, 1, 0, 0]
  443. }
  444. // Шаблон 3 (size 3) **
  445. // обычный
  446. template s3_template(x, y, shift)
  447. {
  448.   [x, y, 7, 30, -2, -30-2*shift]
  449.   [x+16, y, 11, 27, -4+2*shift, -22-shift]
  450.   [x+32, y, 12, 20, 4+4*shift, -16] //dy-1
  451.   [x+64, y, 11, 27, 5+2*shift, -18+shift]
  452.   [x+80, y, 7, 30, -2, -22+2*shift]
  453.   [x+96, y, 11, 27, -14-2*shift, -17+shift]
  454.   [x+112, y, 12, 20, -16-4*shift, -16] //dy-1
  455.   [x+144, y, 11, 27, -5-2*shift, -23-shift]
  456. }
  457. template s3_r_template(x, y, shift)
  458. {
  459.   [x+80, y, 7, 30, -2, -30-2*shift]
  460.   [x+96, y, 11, 27, -4+2*shift, -22-shift]
  461.   [x+112, y, 12, 20, 4+4*shift, -16] //dy-1
  462.   [x+144, y, 11, 27, 5+2*shift, -18+shift]
  463.   [x, y, 7, 30, -2, -22+2*shift]
  464.   [x+16, y, 11, 27, -14-2*shift, -17+shift]
  465.   [x+32, y, 12, 20, -16-4*shift, -16] //dy-1
  466.   [x+64, y, 11, 27, -5-2*shift, -23-shift]
  467. }
  468. // покупка (вид 7)
  469. template s3_purchase_template(x, y, shift)
  470. {
  471.   [x+112, y, 12, 20, -16+shift, -16]
  472. }
  473. // Шаблон 4 (size 4) **
  474. // обычный
  475. template s4_template(x, y, shift)
  476. {
  477.   [x, y, 7, 32, -2, -30-2*shift]
  478.   [x+16, y, 13, 28, -6+2*shift, -22-shift]
  479.   [x+48, y, 16, 20, 0+4*shift, -16] //dy-1
  480.   [x+80, y, 13, 28, 3+2*shift, -19+shift]
  481.   [x+112, y, 7, 32, -2, -24+2*shift]
  482.   [x+128, y, 13, 28, -14-2*shift, -18+shift]
  483.   [x+160, y, 16, 20, -16-4*shift, -16] //dy-1
  484.   [x+192, y, 13, 28, -5-2*shift, -23-shift]
  485. }
  486. template s4_r_template(x, y, shift)
  487. {
  488.   [x+112, y, 7, 32, -2, -30-2*shift]
  489.   [x+128, y, 13, 28, -6+2*shift, -22-shift]
  490.   [x+160, y, 16, 20, 0+4*shift, -16] //dy-1
  491.   [x+192, y, 13, 28, 3+2*shift, -19+shift]
  492.   [x, y, 7, 32, -2, -24+2*shift]
  493.   [x+16, y, 13, 28, -14-2*shift, -18+shift]
  494.   [x+48, y, 16, 20, -16-4*shift, -16] //dy-1
  495.   [x+80, y, 13, 28, -5-2*shift, -23-shift]
  496. }
  497. // покупка (вид 7)
  498. template s4_purchase_template(x, y, shift)
  499. {
  500.   [x+160, y, 16, 20, -16+shift, -16]
  501. }
  502. // Шаблон 5 (size 5) **
  503. // обычный
  504. template s5_template(x, y, shift)
  505. {
  506.   [x, y, 7, 34, -2, -30-2*shift]
  507.   [x+16, y, 15, 29, -8+2*shift, -22-shift]
  508.   [x+48, y, 20, 20, -4+4*shift, -16] //dy-1 14-->15
  509.   [x+80, y, 15, 29, 1+2*shift, -20+shift]
  510.   [x+112, y, 7, 34, -2, -24+2*shift]
  511.   [x+128, y, 15, 29, -14-2*shift, -19+shift]
  512.   [x+160, y, 20, 20, -16-4*shift, -16] //dy-1 14-->15
  513.   [x+192, y, 15, 29, -5-2*shift, -23-shift]
  514. }
  515. template s5_r_template(x, y, shift)
  516. {
  517.   [x+112, y, 7, 34, -2, -30-2*shift]
  518.   [x+128, y, 15, 29, -8+2*shift, -22-shift]
  519.   [x+160, y, 20, 20, -4+4*shift, -16] //dy-1 14-->15
  520.   [x+192, y, 15, 29, 1+2*shift, -20+shift]
  521.   [x, y, 7, 34, -2, -24+2*shift]
  522.   [x+16, y, 15, 29, -14-2*shift, -19+shift]
  523.   [x+48, y, 20, 20, -16-4*shift, -16] //dy-1 14-->15
  524.   [x+80, y, 15, 29, -5-2*shift, -23-shift]
  525. }
  526. // покупка (вид 7)
  527. template s5_purchase_template(x, y, shift)
  528. {
  529.   [x+160, y, 20, 20, -16+shift, -16]
  530. }
  531. // Шаблон 6 (size 6) **
  532. // обычный
  533. template s6_template(x, y, shift)
  534. {
  535.   [x, y, 7, 38, -2, -32-2*shift]
  536.   [x+16, y, 17, 30, -10+2*shift, -22-shift]
  537.   [x+48, y, 24, 20, -8+4*shift, -16] //dy-1 14-->15
  538.   [x+80, y, 17, 30, -1+2*shift, -21+shift]
  539.   [x+112, y, 7, 38, -2, -28+2*shift]
  540.   [x+128, y, 17, 30, -14-2*shift, -20+shift]
  541.   [x+160, y, 24, 20, -16-4*shift, -16] //dy-1 14-->15
  542.   [x+192, y, 17, 30, -5-2*shift, -23-shift]
  543. }
  544. template s6_r_template(x, y, shift)
  545. {
  546.   [x+112, y, 7, 38, -2, -32-2*shift]
  547.   [x+128, y, 17, 30, -10+2*shift, -22-shift]
  548.   [x+160, y, 24, 20, -8+4*shift, -16] //dy-1 14-->15
  549.   [x+192, y, 17, 30, -1+2*shift, -21+shift]
  550.   [x, y, 7, 38, -2, -28+2*shift]
  551.   [x+16, y, 17, 30, -14-2*shift, -20+shift]
  552.   [x+48, y, 24, 20, -16-4*shift, -16] //dy-1 14-->15
  553.   [x+80, y, 17, 30, -5-2*shift, -23-shift]
  554. }
  555. // покупка (вид 7)
  556. template s6_purchase_template(x, y, shift)
  557. {
  558.   [x+160, y, 24, 20, -16+shift, -16]
  559. }
  560. // Шаблон 7 (size 7) **
  561. // обычный
  562. template s7_template(x, y, shift)
  563. {
  564.   [x, y, 7, 39, -2, -31-2*shift]
  565.   [x+16, y, 19, 31, -12+2*shift, -22-shift]
  566.   [x+48, y, 28, 20, -12+4*shift, -16] //dy-1 14-->15
  567.   [x+96, y, 19, 31, -3+2*shift, -22+shift]
  568.   [x+128, y, 7, 39, -2, -29+2*shift]
  569.   [x+144, y, 19, 31, -14-2*shift, -21+shift]
  570.   [x+176, y, 28, 20, -16-4*shift, -16] //dy-1 14-->15
  571.   [x+224, y, 19, 31, -5-2*shift, -23-shift]
  572. }
  573. template s7_r_template(x, y, shift)
  574. {
  575.   [x+128, y, 7, 39, -2, -31-2*shift]
  576.   [x+144, y, 19, 31, -12+2*shift, -22-shift]
  577.   [x+176, y, 28, 20, -12+4*shift, -16] //dy-1 14-->15
  578.   [x+224, y, 19, 31, -3+2*shift, -22+shift]
  579.   [x, y, 7, 39, -2, -29+2*shift]
  580.   [x+16, y, 19, 31, -14-2*shift, -21+shift]
  581.   [x+48, y, 28, 20, -16-4*shift, -16] //dy-1 14-->15
  582.   [x+96, y, 19, 31, -5-2*shift, -23-shift]
  583. }
  584. // покупка (вид 7)
  585. template s7_purchase_template(x, y, shift)
  586. {
  587.   [x+176, y, 28, 20, -16+shift, -16]
  588. }
  589. // Шаблон 8 (size 8) **
  590. // обычный
  591. template s8_template(x, y, shift)
  592. {
  593.   [x, y, 12, 31, -5, -18]
  594.   [x+32, y, 22, 23, -14, -13]
  595.   [x+64, y, 32, 17, -16, -13]
  596.   [x+112, y, 22, 23, -6, -14]
  597.   [x+144, y, 12, 31, -5, -18]
  598.   [x+176, y, 22, 23, -14, -13]
  599.   [x+208, y, 32, 17, -16, -13]
  600.   [x+256, y, 22, 23, -6, -14]
  601. }
  602. template s8_r_template(x, y, shift)
  603. {
  604.   [x+144, y, 12, 31, -5, -18]
  605.   [x+176, y, 22, 23, -14, -13]
  606.   [x+208, y, 32, 17, -16, -13]
  607.   [x+256, y, 22, 23, -6, -14]
  608.   [x, y, 12, 31, -5, -18]
  609.   [x+32, y, 22, 23, -14, -13]
  610.   [x+64, y, 32, 17, -16, -13]
  611.   [x+112, y, 22, 23, -6, -14]
  612. }
  613. // покупка (вид 7)
  614. template s8_purchase_template(x, y, shift)
  615. {
  616.   [x+208, y, 32, 17, -16+shift, -13]
  617. }
  618. // Шаблон 9 (size 9) **
  619. // обычный
  620. template s9_template(x, y, shift)
  621. {
  622.   [x, y, 12, 62, -5, -18]
  623.   [x+32, y, 42, 42, -34, -13]
  624.   [x+80, y, 64, 17, -48, -13]
  625.   [x+160, y, 42, 43, -26, -34]
  626.   [x+208, y, 12, 62, -5, -49]
  627.   [x+240, y, 42, 43, -14, -33]
  628.   [x+288, y, 64, 17, -16, -13]
  629.   [x+368, y, 42, 42, -6, -14]
  630. }
  631. // специальный
  632. template s9vl11_template(x, y, shift)
  633. {
  634.   [x, y, 12, 62, -5, -18]
  635.   [x+32, y, 42, 42, -34, -13]
  636.   [x+80, y, 64, 17, -48, -13]
  637.   [x+160, y, 43, 43, -26, -34]
  638.   [x+208, y, 12, 62, -5, -49]
  639.   [x+239, y, 43, 43, -14, -33]
  640.   [x+288, y, 64, 17, -16, -13]
  641.   [x+368, y, 42, 42, -6, -14]
  642. }
  643. // покупка (вид 7)
  644. template s9_purchase_template(x, y, shift)
  645. {
  646.   [x+288, y, 64, 17, -16+shift, -13]
  647. }
  648. template s9_r_template(x, y, shift)
  649. {
  650.   [x+208, y, 12, 62, -5 , -49+2]
  651.   [x+240, y, 42, 43, -14-2, -33+1]
  652.   [x+288, y, 64, 17, -16-4, -13 ]
  653.   [x+368, y, 42, 42, -6-2, -14-1]
  654.   [x, y, 12, 62, -5 , -18-2]
  655.   [x+32, y, 42, 42, -34+2, -13-1]
  656.   [x+80, y, 64, 17, -48+4, -13 ]
  657.   [x+160, y, 42, 43, -26+2, -34+1]
  658. }
  659. // Шаблон 10 (size 10) **
  660. // обычный
  661. template s10_template(x, y, shift)
  662. {
  663.   [x, y, 12, 62, -5, -18]
  664.   [x+32, y, 42, 42, -34, -13]
  665.   [x+80, y, 64, 17, -48, -13]
  666.   [x+160, y, 42, 43, -26, -34]
  667.   [x+208, y, 12, 62, -5, -49]
  668.   [x+240, y, 42, 43, -14, -33]
  669.   [x+288, y, 64, 17, -16, -13]
  670.   [x+368, y, 42, 42, -6, -14]
  671. }
  672. template s10_r_template(x, y, shift)
  673. {
  674.   [x+208, y, 12, 62, -5 , -49+4]
  675.   [x+240, y, 42, 43, -14-4, -33+2]
  676.   [x+288, y, 64, 17, -16-8, -13 ]
  677.   [x+368, y, 42, 42, -6-4, -14-2]
  678.   [x, y, 12, 62, -5 , -18-4]
  679.   [x+32, y, 42, 42, -34+4, -13-2]
  680.   [x+80, y, 64, 17, -48+8, -13 ]
  681.   [x+160, y, 42, 43, -26+4, -34+2]
  682. }
  683. // покупка (вид 7)
  684. template s10_purchase_template(x, y, shift)
  685. {
  686.   [x+288, y, 64, 17, -16+shift, -13]
  687. }
  688. // Шаблон 11 (size 11) **
  689. // обычный
  690. template s11_template(x, y, shift)
  691. {
  692.   [x, y, 12, 62, -5, -18]
  693.   [x+32, y, 42, 42, -34, -13]
  694.   [x+80, y, 64, 17, -48, -13]
  695.   [x+160, y, 42, 43, -26, -34]
  696.   [x+208, y, 12, 62, -5, -49]
  697.   [x+240, y, 42, 43, -14, -33]
  698.   [x+288, y, 64, 17, -16, -13]
  699.   [x+368, y, 42, 42, -6, -14]
  700. }
  701. template s11_r_template(x, y, shift)
  702. {
  703.   [x+208, y, 12, 62, -5 , -49+6]
  704.   [x+240, y, 42, 43, -14 -6, -33+3]
  705.   [x+288, y, 64, 17, -16-12, -13 ]
  706.   [x+368, y, 42, 42, -6 -6, -14-3]
  707.   [x, y, 12, 62, -5 , -18-6]
  708.   [x+32, y, 42, 42, -34 +6, -13-3]
  709.   [x+80, y, 64, 17, -48+12, -13 ]
  710.   [x+160, y, 42, 43, -26 +6, -34+3]
  711. }
  712. // покупка (вид 7)
  713. template s11_purchase_template(x, y, shift)
  714. {
  715.   [x+288, y, 64, 17, -16+shift, -13]
  716. }
  717. // для ЧС2т
  718. template s11ch_template(x, y, shift)
  719. {
  720.   [x, y, 12, 62, -5, -18]
  721.   [x+32, y, 42, 42, -34, -13]
  722.   [x+80, y, 64, 17, -48, -13]
  723.   [x+160, y, 43, 43, -26, -34]
  724.   [x+208, y, 12, 62, -5, -49]
  725.   [x+239, y, 43, 43, -16, -33]
  726.   [x+288, y, 64, 17, -16, -13]
  727.   [x+368, y, 42, 42, -6, -14]
  728. }
  729. // Шаблон 12 (size 12) **
  730. // обычный
  731. template s12_template(x, y, shift)
  732. {
  733.   [x, y, 12, 62, -5, -18]
  734.   [x+32, y, 42, 42, -34, -13]
  735.   [x+80, y, 64, 17, -48, -13]
  736.   [x+160, y, 42, 43, -26, -34]
  737.   [x+208, y, 12, 62, -5, -49]
  738.   [x+240, y, 42, 43, -14, -33]
  739.   [x+288, y, 64, 17, -16, -13]
  740.   [x+368, y, 42, 42, -6, -14]
  741. }
  742. template s12_r_template(x, y, shift)
  743. {
  744.   [x+208, y, 12, 62, -5 , -49+8]
  745.   [x+240, y, 42, 43, -14 -8, -33+4]
  746.   [x+288, y, 64, 17, -16-16, -13 ]
  747.   [x+368, y, 42, 42, -6 -8, -14-4]
  748.   [x, y, 12, 62, -5 , -18-8]
  749.   [x+32, y, 42, 42, -34 +8, -13-4]
  750.   [x+80, y, 64, 17, -48+16, -13 ]
  751.   [x+160, y, 42, 43, -26 +8, -34+4]
  752. }
  753. // версия для UI в депо (только вид 7)
  754. template s12ui1_template(x, y, shift)
  755. {
  756.   [x, y, 64, 17, -16-4*shift, -13]
  757. }
  758. // покупка (вид 7)
  759. template s12_purchase_template(x, y, shift)
  760. {
  761.   [x+288, y, 64, 17, -16+shift, -13]
  762. }
  763. // для ЧС4т
  764. template s12ch_template(x, y, shift)
  765. {
  766.   [x, y, 12, 62, -5, -18]
  767.   [x+32, y, 42, 42, -34, -13]
  768.   [x+80, y, 64, 17, -48, -13]
  769.   [x+160, y, 43, 43, -26, -34]
  770.   [x+208, y, 12, 62, -5, -49]
  771.   [x+239, y, 43, 43, -16, -33]
  772.   [x+288, y, 64, 17, -16, -13]
  773.   [x+368, y, 42, 42, -6, -14]
  774. }
  775. // Шаблон 13 (size 13) **
  776. // обычный
  777. template s13_template(x, y, shift)
  778. {
  779.   [x, y, 12, 62, -5, -18]
  780.   [x+32, y, 42, 42, -34, -13]
  781.   [x+80, y, 64, 17, -48, -13]
  782.   [x+160, y, 42, 43, -26, -34]
  783.   [x+208, y, 12, 62, -5, -49]
  784.   [x+240, y, 42, 43, -14, -33]
  785.   [x+288, y, 64, 17, -16, -13]
  786.   [x+368, y, 42, 42, -6, -14]
  787. }
  788. template s13_r_template(x, y, shift)
  789. {
  790.   [x+208, y, 12, 62, -5 , -49+10]
  791.   [x+240, y, 42, 43, -14-10, -33 +5]
  792.   [x+288, y, 64, 17, -16-20, -13 ]
  793.   [x+368, y, 42, 42, -6-10, -14 -5]
  794.   [x, y, 12, 62, -5 , -18-10]
  795.   [x+32, y, 42, 42, -34+10, -13 -5]
  796.   [x+80, y, 64, 17, -48+20, -13 ]
  797.   [x+160, y, 42, 43, -26+10, -34 +5]
  798. }
  799. // покупка (вид 7)
  800. template s13_purchase_template(x, y, shift)
  801. {
  802.   [x+288, y, 64, 17, -16+shift, -13]
  803. }
  804. // версия для UI в депо (только вид 7)
  805. template s13ui1_template(x, y, shift)
  806. {
  807.   [x, y, 64, 17, -16-4*shift, -13]
  808. }
  809. // Шаблон 14 (size 14) **
  810. // обычный
  811. template s14_template(x, y, shift)
  812. {
  813.   [x, y, 12, 62, -5, -18]
  814.   [x+32, y, 42, 42, -34, -13]
  815.   [x+80, y, 64, 17, -48, -13]
  816.   [x+160, y, 42, 43, -26, -34]
  817.   [x+208, y, 12, 62, -5, -49]
  818.   [x+240, y, 42, 43, -14, -33]
  819.   [x+288, y, 64, 17, -16, -13]
  820.   [x+368, y, 42, 42, -6, -14]
  821. }
  822. template s14_r_template(x, y, shift)
  823. {
  824.   [x+208, y, 12, 62, -5 , -49+12]
  825.   [x+240, y, 42, 43, -14-12, -33 +6]
  826.   [x+288, y, 64, 17, -16-24, -13 ]
  827.   [x+368, y, 42, 42, -6-12, -14 -6]
  828.   [x, y, 12, 62, -5 , -18-12]
  829.   [x+32, y, 42, 42, -34+12, -13 -6]
  830.   [x+80, y, 64, 17, -48+24, -13 ]
  831.   [x+160, y, 42, 43, -26+12, -34 +6]
  832. }
  833. // покупка (вид 7)
  834. template s14_purchase_template(x, y, shift)
  835. {
  836.   [x+288, y, 64, 17, -16+shift, -13]
  837. }
  838. // Шаблон 15 (size 15) **
  839. // обычный
  840. template s15_template(x, y, shift)
  841. {
  842.   [x, y, 12, 62, -5, -18]
  843.   [x+32, y, 42, 42, -34, -13]
  844.   [x+80, y, 64, 17, -48, -13]
  845.   [x+160, y, 42, 43, -26, -34]
  846.   [x+208, y, 12, 62, -5, -49]
  847.   [x+240, y, 42, 43, -14, -33]
  848.   [x+288, y, 64, 17, -16, -13]
  849.   [x+368, y, 42, 42, -6, -14]
  850. }
  851. template s15_r_template(x, y, shift)
  852. {
  853.   [x+208, y, 12, 62, -5 , -49+14]
  854.   [x+240, y, 42, 43, -14-14, -33 +7]
  855.   [x+288, y, 64, 17, -16-28, -13 ]
  856.   [x+368, y, 42, 42, -6-14, -14 -7]
  857.   [x, y, 12, 62, -5 , -18-14]
  858.   [x+32, y, 42, 42, -34+14, -13 -7]
  859.   [x+80, y, 64, 17, -48+28, -13 ]
  860.   [x+160, y, 42, 43, -26+14, -34 +7]
  861. }
  862. // покупка (вид 7)
  863. template s15_purchase_template(x, y, shift)
  864. {
  865.   [x+288, y, 64, 17, -16+shift, -13]
  866. }
  867. // версия для UI в депо (только вид 7)
  868. template s15ui1_template(x, y, shift)
  869. {
  870.   [x, y, 64, 17, -16-4*shift, -13]
  871. }
  872. // Шаблон 16 (size 16) **
  873. // обычный
  874. template s16_template(x, y, shift)
  875. {
  876.   [x, y, 12, 62, -5, -18]
  877.   [x+32, y, 42, 42, -34, -13]
  878.   [x+80, y, 64, 17, -48, -13]
  879.   [x+160, y, 42, 43, -26, -34]
  880.   [x+208, y, 12, 62, -5, -49]
  881.   [x+240, y, 42, 43, -14, -33]
  882.   [x+288, y, 64, 17, -16, -13]
  883.   [x+368, y, 42, 42, -6, -14]
  884. }
  885. template s16_r_template(x, y, shift)
  886. {
  887.   [x+208, y, 12, 62, -5 , -49+16]
  888.   [x+240, y, 42, 43, -14-16, -33 +8]
  889.   [x+288, y, 64, 17, -16-32, -13 ]
  890.   [x+368, y, 42, 42, -6-16, -14 -8]
  891.   [x, y, 12, 62, -5 , -18-16]
  892.   [x+32, y, 42, 42, -34+16, -13 -8]
  893.   [x+80, y, 64, 17, -48+32, -13 ]
  894.   [x+160, y, 42, 43, -26+16, -34 +8]
  895. }
  896. // покупка (вид 7)
  897. template s16_purchase_template(x, y, shift)
  898. {
  899.   [x+288, y, 64, 17, -16+shift, -13]
  900. }
  901. // Шаблон 17 (size 17) **
  902. // обычный
  903. template s17_template(x, y, shift)
  904. {
  905.   [x, y, 12, 62, -5, -18]
  906.   [x+32, y, 42, 42, -34, -13]
  907.   [x+80, y, 68, 17, -52, -13]
  908.   [x+160, y, 42, 43, -26, -34]
  909.   [x+208, y, 12, 62, -5, -49]
  910.   [x+240, y, 42, 43, -14, -33]
  911.   [x+288, y, 68, 17, -16, -13]
  912.   [x+368, y, 42, 42, -6, -14]
  913. }
  914. template s17_r_template(x, y, shift)
  915. {
  916.   [x+208, y, 12, 62, -5 , -49+18]
  917.   [x+240, y, 42, 43, -14-18, -33 +9]
  918.   [x+288, y, 68, 17, -16-36, -13 ]
  919.   [x+368, y, 42, 42, -6-18, -14 -9]
  920.   [x, y, 12, 62, -5 , -18-18]
  921.   [x+32, y, 42, 42, -34+18, -13 -9]
  922.   [x+80, y, 68, 17, -52+36, -13 ]
  923.   [x+160, y, 42, 43, -26+18, -34 +9]
  924. }
  925. // покупка (вид 7)
  926. template s17_purchase_template(x, y, shift)
  927. {
  928.   [x+288, y, 68, 17, -16+shift, -13]
  929. }
  930.  /// action
  931. // --- ограничение скорости по окончанию установленного срока службы ---
  932. // ограничиваем скорость через 20 лет работы 120 --> 110
  933. switch (FEAT_TRAINS, SELF, speed_after20_120to110,
  934.   age_in_days >= (20*365+5))
  935. {
  936.   1: return 110;
  937.   return 120;
  938. }
  939. // ограничиваем скорость через 20 лет работы 120 --> 100
  940. switch (FEAT_TRAINS, SELF, speed_after20_120to100,
  941.   age_in_days >= (20*365+5))
  942. {
  943.   1: return 100;
  944.   return 120;
  945. }
  946. // ограничиваем скорость через 25 лет работы 120 --> 110
  947. switch (FEAT_TRAINS, SELF, speed_after25_120to110,
  948.   age_in_days >= (25*365+5))
  949. {
  950.   1: return 110;
  951.   return 120;
  952. }
  953. // ограничиваем скорость через 25 лет работы 120 --> 100
  954. switch (FEAT_TRAINS, SELF, speed_after25_120to100,
  955.   age_in_days >= (25*365+5))
  956. {
  957.   1: return 100;
  958.   return 120;
  959. }
  960. // ограничиваем скорость через 30 лет работы 130 --> 110
  961. switch (FEAT_TRAINS, SELF, speed_after30_130to110,
  962.   age_in_days >= (30*365+8))
  963. {
  964.   1: return 110;
  965.   return 130;
  966. }
  967. // ограничиваем скорость через 30 лет работы 130 --> 100
  968. switch (FEAT_TRAINS, SELF, speed_after30_130to100,
  969.   age_in_days >= (30*365+8))
  970. {
  971.   1: return 100;
  972.   return 130;
  973. }
  974. // невидимый вагон размером 1
  975. switch (FEAT_TRAINS, SELF, articulated_part_dummy1,
  976.   extra_callback_info1)
  977. {
  978.   1: return dummy1;
  979.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  980. }
  981. // невидимый вагон размером 2
  982. switch (FEAT_TRAINS, SELF, articulated_part_dummy2,
  983.   extra_callback_info1)
  984. {
  985.   1: return dummy2;
  986.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  987. }
  988. // невидимый вагон размером 3
  989. switch (FEAT_TRAINS, SELF, articulated_part_dummy3,
  990.   extra_callback_info1)
  991. {
  992.   1: return dummy3;
  993.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  994. }
  995. // невидимый вагон размером 4
  996. switch (FEAT_TRAINS, SELF, articulated_part_dummy4,
  997.   extra_callback_info1)
  998. {
  999.   1: return dummy4;
  1000.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1001. }
  1002. // невидимый вагон размером 5
  1003. switch (FEAT_TRAINS, SELF, articulated_part_dummy5,
  1004.   extra_callback_info1)
  1005. {
  1006.   1: return dummy5;
  1007.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1008. }
  1009. // невидимый вагон размером 6
  1010. switch (FEAT_TRAINS, SELF, articulated_part_dummy6,
  1011.   extra_callback_info1)
  1012. {
  1013.   1: return dummy6;
  1014.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1015. }
  1016. // невидимый вагон размером 7
  1017. switch (FEAT_TRAINS, SELF, articulated_part_dummy7,
  1018.   extra_callback_info1)
  1019. {
  1020.   1: return dummy7;
  1021.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1022. }
  1023. // невидимый вагон размером 8
  1024. switch (FEAT_TRAINS, SELF, articulated_part_dummy8,
  1025.   extra_callback_info1)
  1026. {
  1027.   1: return dummy8;
  1028.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1029. }
  1030. // тендер
  1031. switch (FEAT_TRAINS, SELF, articulated_part_tender,
  1032.   extra_callback_info1)
  1033. {
  1034.   1: return unitb;
  1035.   return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  1036. }
  1037. // модельки
  1038.  /// dummy
  1039. // Спрайт из одного прозрачного пикселя
  1040. spriteset (dummy_sprites, "src/dummy/empty.png")
  1041. {
  1042.   dummy_template(0, 0)
  1043. }
  1044. // Шаблон для dummy, задаём разный length
  1045. // Определение dummy
  1046. 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; } }
  1047. 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; } }
  1048. 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; } }
  1049. 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; } }
  1050. 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; } }
  1051. 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; } }
  1052. 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; } }
  1053. 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; } }
  1054.  /// unit
  1055. // Шаблон для индивидуализации элементов многоэлементных локомотивов:
  1056. // тендеров паровозов, вагонов в составе секций emu/dmu,
  1057. // там, где можно использовать livery_override.
  1058. // Буква в имени определяет положение элемента по порядку от локомотива (a).
  1059. /// Определение элементов
  1060. // Первая позиция: паровозы, emu, dmu
  1061. 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; } }
  1062. // Вторая позиция: emu, dmu
  1063. 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; } }
  1064. // Третья позиция: emu, dmu
  1065. 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; } }
  1066.  /// align
  1067. spriteset (align_3_purchase_sprites, "src/align/s3.png")
  1068. {
  1069.   s3_purchase_template(0, 0, 10)
  1070. }
  1071. spriteset (align_3_sprites, "src/align/s3.png")
  1072. {
  1073.   s3_template(0, 0, 0)
  1074. }
  1075. spriteset (align_3_flipped_sprites, "src/align/s3.png")
  1076. {
  1077.   s3_template(0, 0, -5)
  1078. }
  1079. spriteset (align_4_purchase_sprites, "src/align/s4.png")
  1080. {
  1081.   s4_purchase_template(0, 0, 8)
  1082. }
  1083. spriteset (align_4_sprites, "src/align/s4.png")
  1084. {
  1085.   s4_template(0, 0, 0)
  1086. }
  1087. spriteset (align_4_flipped_sprites, "src/align/s4.png")
  1088. {
  1089.   s4_template(0, 0, -4)
  1090. }
  1091. spriteset (align_5_purchase_sprites, "src/align/s5.png")
  1092. {
  1093.   s5_purchase_template(0, 0, 6)
  1094. }
  1095. spriteset (align_5_sprites, "src/align/s5.png")
  1096. {
  1097.   s5_template(0, 0, 0)
  1098. }
  1099. spriteset (align_5_flipped_sprites, "src/align/s5.png")
  1100. {
  1101.   s5_template(0, 0, -3)
  1102. }
  1103. spriteset (align_6_purchase_sprites, "src/align/s6.png")
  1104. {
  1105.   s6_purchase_template(0, 0, 4)
  1106. }
  1107. spriteset (align_6_sprites, "src/align/s6.png")
  1108. {
  1109.   s6_template(0, 0, 0)
  1110. }
  1111. spriteset (align_6_flipped_sprites, "src/align/s6.png")
  1112. {
  1113.   s6_template(0, 0, -2)
  1114. }
  1115. spriteset (align_7_purchase_sprites, "src/align/s7.png")
  1116. {
  1117.   s7_purchase_template(0, 0, 2)
  1118. }
  1119. spriteset (align_7_sprites, "src/align/s7.png")
  1120. {
  1121.   s7_template(0, 0, 0)
  1122. }
  1123. spriteset (align_7_flipped_sprites, "src/align/s7.png")
  1124. {
  1125.   s7_template(0, 0, -1)
  1126. }
  1127. spriteset (align_8_purchase_sprites, "src/align/s8.png")
  1128. {
  1129.   s8_purchase_template(0, 0, 0)
  1130. }
  1131. spriteset (align_8_sprites, "src/align/s8.png")
  1132. {
  1133.   s8_template(0, 0, 0)
  1134. }
  1135. // no flip spriteset, use the same
  1136. spriteset (align_8_flipped_sprites, "src/align/s8.png")
  1137. {
  1138.   s8_template(0, 0, 0)
  1139. }
  1140. spriteset (align_9_purchase_sprites, "src/align/s9.png")
  1141. {
  1142.   s9_purchase_template(0, 0, -2)
  1143. }
  1144. spriteset (align_9_sprites, "src/align/s9.png")
  1145. {
  1146.   s9_template(0, 0, 0)
  1147. }
  1148. spriteset (align_9_flipped_sprites, "src/align/s9.png")
  1149. {
  1150.   s9_template(0, 0, 1)
  1151. }
  1152. spriteset (align_10_purchase_sprites, "src/align/s10.png")
  1153. {
  1154.   s10_purchase_template(0, 0, -4)
  1155. }
  1156. spriteset (align_10_sprites, "src/align/s10.png")
  1157. {
  1158.   s10_template(0, 0, 0)
  1159. }
  1160. spriteset (align_10_flipped_sprites, "src/align/s10.png")
  1161. {
  1162.   s10_template(0, 0, 2)
  1163. }
  1164. spriteset (align_11_purchase_sprites, "src/align/s11.png")
  1165. {
  1166.   s11_purchase_template(0, 0, -6)
  1167. }
  1168. spriteset (align_11_sprites, "src/align/s11.png")
  1169. {
  1170.   s11_template(0, 0, 0)
  1171. }
  1172. spriteset (align_11_flipped_sprites, "src/align/s11.png")
  1173. {
  1174.   s11_template(0, 0, 3)
  1175. }
  1176. spriteset (align_12_purchase_sprites, "src/align/s12.png")
  1177. {
  1178.   s12_purchase_template(0, 0, -8)
  1179. }
  1180. spriteset (align_12_sprites, "src/align/s12.png")
  1181. {
  1182.   s12_template(0, 0, 0)
  1183. }
  1184. spriteset (align_12_flipped_sprites, "src/align/s12.png")
  1185. {
  1186.   s12_template(0, 0, 4)
  1187. }
  1188. spriteset (align_13_purchase_sprites, "src/align/s13.png")
  1189. {
  1190.   s13_purchase_template(0, 0, -10)
  1191. }
  1192. spriteset (align_13_sprites, "src/align/s13.png")
  1193. {
  1194.   s13_template(0, 0, 0)
  1195. }
  1196. spriteset (align_13_flipped_sprites, "src/align/s13.png")
  1197. {
  1198.   s13_template(0, 0, 5)
  1199. }
  1200. spriteset (align_14_purchase_sprites, "src/align/s14.png")
  1201. {
  1202.   s14_purchase_template(0, 0, -12)
  1203. }
  1204. spriteset (align_14_sprites, "src/align/s14.png")
  1205. {
  1206.   s14_template(0, 0, 0)
  1207. }
  1208. spriteset (align_14_flipped_sprites, "src/align/s14.png")
  1209. {
  1210.   s14_template(0, 0, 6)
  1211. }
  1212. spriteset (align_15_purchase_sprites, "src/align/s15.png")
  1213. {
  1214.   s15_purchase_template(0, 0, -14)
  1215. }
  1216. spriteset (align_15_sprites, "src/align/s15.png")
  1217. {
  1218.   s15_template(0, 0, 0)
  1219. }
  1220. spriteset (align_15_flipped_sprites, "src/align/s15.png")
  1221. {
  1222.   s15_template(0, 0, 7)
  1223. }
  1224. spriteset (align_16_purchase_sprites, "src/align/s16.png")
  1225. {
  1226.   s16_purchase_template(0, 0, -16)
  1227. }
  1228. spriteset (align_16_sprites, "src/align/s16.png")
  1229. {
  1230.   s16_template(0, 0, 0)
  1231. }
  1232. spriteset (align_16_flipped_sprites, "src/align/s16.png")
  1233. {
  1234.   s16_template(0, 0, 8)
  1235. }
  1236. spriteset (align_17_purchase_sprites, "src/align/s17.png")
  1237. {
  1238.   s17_purchase_template(0, 0, -18)
  1239. }
  1240. spriteset (align_17_sprites, "src/align/s17.png")
  1241. {
  1242.   s17_template(0, 0, 0)
  1243. }
  1244. spriteset (align_17_flipped_sprites, "src/align/s17.png")
  1245. {
  1246.   s17_template(0, 0, 9)
  1247. }
  1248. // Одинаковые свойства для всех размеров
  1249. // Для размера 3-8
  1250. 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); } }
  1251. 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); } }
  1252. 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); } }
  1253. 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); } }
  1254. 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); } }
  1255. 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); } }
  1256. // Для размера 9-16
  1257. 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; } }
  1258. 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; } }
  1259. 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; } }
  1260. 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; } }
  1261. 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; } }
  1262. 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; } }
  1263. 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; } }
  1264. 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; } }
  1265. // ПС
  1266. // #include "src/emu/sn.pnml"
  1267.  // er1
  1268. // Спрайты
  1269. // 2 окраски, только головной с 1972 имеет замену на
  1270. // др. 2 окраски
  1271. 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;}
  1272. 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;}
  1273. 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;}
  1274. 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; }
  1275. 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; }
  1276. 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; }
  1277. 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; }
  1278. 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; }
  1279. 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; }
  1280. 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; }
  1281. 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; }
  1282. switch (FEAT_TRAINS, SELF, er1_h_sprites_l,
  1283.   ((LOAD_TEMP(2) >= date(1972,1,1)) * 200) +
  1284.   ((LOAD_TEMP(4) != er1_h) * 100) +
  1285.   cargo_subtype)
  1286. {
  1287.     0: er1_v1_h_sprites_left;
  1288.     1: er1_v2_h_sprites_left;
  1289.   100: er1_v1_h_notpowered_sprites_left;
  1290.   101: er1_v2_h_notpowered_sprites_left;
  1291.   200: er1_v1u_h_sprites_left;
  1292.   201: er1_v2u_h_sprites_left;
  1293.   300: er1_v1u_h_notpowered_sprites_left;
  1294.   301: er1_v2u_h_notpowered_sprites_left;
  1295.        align_12_sprites;
  1296. }
  1297. switch (FEAT_TRAINS, SELF, er1_h_sprites_r,
  1298.   ((LOAD_TEMP(2) >= date(1972,1,1)) * 200) +
  1299.   ((LOAD_TEMP(4) != er1_h) * 100) +
  1300.   cargo_subtype)
  1301. {
  1302.     0: er1_v1_h_sprites_right;
  1303.     1: er1_v2_h_sprites_right;
  1304.   100: er1_v1_h_notpowered_sprites_right;
  1305.   101: er1_v2_h_notpowered_sprites_right;
  1306.   200: er1_v1u_h_sprites_right;
  1307.   201: er1_v2u_h_sprites_right;
  1308.   300: er1_v1u_h_notpowered_sprites_right;
  1309.   301: er1_v2u_h_notpowered_sprites_right;
  1310.        align_12_sprites;
  1311. }
  1312. 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; }
  1313. 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; }
  1314. switch (FEAT_TRAINS, SELF, er1_m_direction_left,
  1315.   cargo_subtype +
  1316.   ((LOAD_TEMP(4) != er1_h) * 100) )
  1317. {
  1318.     0: er1_v1_m_sprites_left;
  1319.     1: er1_v2_m_sprites_left;
  1320.   100: er1_v1_m_notpowered_sprites_left;
  1321.   101: er1_v2_m_notpowered_sprites_left;
  1322.        align_12_sprites;
  1323. }
  1324. switch (FEAT_TRAINS, SELF, er1_m_direction_right,
  1325.   cargo_subtype +
  1326.   ((LOAD_TEMP(4) != er1_h) * 100) )
  1327. {
  1328.     0: er1_v1_m_sprites_right;
  1329.     1: er1_v2_m_sprites_right;
  1330.   100: er1_v1_m_notpowered_sprites_right;
  1331.   101: er1_v2_m_notpowered_sprites_right;
  1332.        align_12_sprites;
  1333. }
  1334. 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; }
  1335. 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; }
  1336. switch (FEAT_TRAINS, SELF, er1_m_sprites_start, 0)
  1337. {
  1338.   er1_m_direction_template;
  1339. }
  1340. 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; }
  1341. switch (FEAT_TRAINS, SELF, er1_c_direction_left,
  1342.   cargo_subtype +
  1343.   ((LOAD_TEMP(4) != er1_h) * 100) )
  1344. {
  1345.     0: er1_v1_c_sprites_left;
  1346.     1: er1_v2_c_sprites_left;
  1347.   100: er1_v1_c_notpowered_sprites_left;
  1348.   101: er1_v2_c_notpowered_sprites_left;
  1349.        align_12_sprites;
  1350. }
  1351. switch (FEAT_TRAINS, SELF, er1_c_direction_right,
  1352.   cargo_subtype +
  1353.   ((LOAD_TEMP(4) != er1_h) * 100) )
  1354. {
  1355.     0: er1_v1_c_sprites_right;
  1356.     1: er1_v2_c_sprites_right;
  1357.   100: er1_v1_c_notpowered_sprites_right;
  1358.   101: er1_v2_c_notpowered_sprites_right;
  1359.        align_12_sprites;
  1360. }
  1361. 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; }
  1362. 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; }
  1363. switch (FEAT_TRAINS, SELF, er1_c_sprites_start, 0)
  1364. {
  1365.   er1_c_direction_template;
  1366. }
  1367. 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; }
  1368. 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); }
  1369. 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; }
  1370. switch (FEAT_TRAINS, SELF, er1_can_attach_wagon1, vehicle_type_id)
  1371. {
  1372.   er1_h: er1_can_attach_wagon_template;
  1373.   er1_m: er1_can_attach_wagon_template;
  1374.   er1_c: er1_can_attach_wagon_template;
  1375.          return string(STR_CAN_ATTACH_SAME_MU_ONLY);
  1376. }
  1377. switch (FEAT_TRAINS, PARENT, er1_can_attach_wagon, count_veh_id(er1_h))
  1378. {
  1379.   0: return string(STR_CAN_ATTACH_HEAD_ONLY);
  1380.   1: er1_can_attach_wagon1;
  1381.      return string(STR_CAN_ATTACH_NO_AFTER_REAR_HEAD);
  1382. }
  1383. switch (FEAT_TRAINS, PARENT, er1_h_start_stop,
  1384.   count_veh_id(er1_h))
  1385. {
  1386.   2: return CB_RESULT_NO_TEXT;
  1387.      return string(STR_START_STOP_NUMBER_OF_HEAD_CAR_MUST_BE_EVEN);
  1388. }
  1389. // Моторный самостоятельно выпускать из депо нельзя
  1390. switch (FEAT_TRAINS, SELF, er1_m_start_stop,
  1391.   0)
  1392. {
  1393.      return string(STR_START_STOP_MOTORIZED_CAR_CANNOT_LEAVE_DEPOT);
  1394. }
  1395. // Визуализируем эффекты тяги у er1_m, только если локомотив - er1_h
  1396. switch (FEAT_TRAINS, SELF, er1_m_create_effect_left, STORE_TEMP(create_effect(EFFECT_SPRITE_ELECTRIC, -1, 0, 0), 0x100)) { return 1; } switch (FEAT_TRAINS, SELF, er1_m_create_effect_right, STORE_TEMP(create_effect(EFFECT_SPRITE_ELECTRIC, 5, 0, 0), 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; return visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, -1 +5, DISABLE_WAGON_POWER); }
  1397. 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; }
  1398. switch (FEAT_TRAINS, PARENT, er1_m_create_effect,
  1399.   vehicle_type_id == er1_h)
  1400. {
  1401.   1: er1_m_create_effect_direction_template;
  1402.      return 0;
  1403. }
  1404. // Даём тягу, только если локомотив - er1_h
  1405. switch (FEAT_TRAINS, PARENT, er1_m_power,
  1406.   vehicle_type_id == er1_h)
  1407. {
  1408.   1: return int (853 * 0.9865);
  1409.      return 0;
  1410. }
  1411. // Допускается эксплуатация с пассажирами только если голова - er1_h
  1412. switch (FEAT_TRAINS, PARENT, er1_h_cargo_capacity,
  1413.   (vehicle_type_id == er1_h))
  1414. {
  1415.   1: return 88;
  1416.      return 0;
  1417. }
  1418. switch (FEAT_TRAINS, PARENT, er1_m_cargo_capacity,
  1419.   (vehicle_type_id == er1_h)
  1420. )
  1421. {
  1422.   1: return 110;
  1423.      return 0;
  1424. }
  1425. switch (FEAT_TRAINS, PARENT, er1_c_cargo_capacity,
  1426.   (vehicle_type_id == er1_h)
  1427. )
  1428. {
  1429.   1: return 110;
  1430.      return 0;
  1431. }
  1432. switch (FEAT_TRAINS, SELF, er1_cargo_subtype_text,
  1433.   cargo_subtype)
  1434. {
  1435.   0: return string(STR_REFIT_FACTORY_6211, string(STR_REFIT_TTD_53));
  1436.   1: return string(STR_REFIT_FACTORY_6211, string(STR_REFIT_TTD_59));
  1437.      return CB_RESULT_NO_TEXT;
  1438. }
  1439. item (FEAT_TRAINS, er1_h)
  1440. {
  1441.   property
  1442.   {
  1443.     name: string(STR_ER1_H_NAME);
  1444.     climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND);
  1445.     introduction_date: date(1957 - delta_age, 1, 1);
  1446.     model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default);
  1447.     retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age;
  1448.     vehicle_life: 30;
  1449.     reliability_decay: 20;
  1450.     cargo_allow_refit: [PASS];
  1451.     default_cargo_type: PASS;
  1452.     loading_speed: 12;
  1453.     cost_factor: 2;
  1454.     running_cost_factor: 4;
  1455.     sprite_id: SPRITE_ID_NEW_TRAIN;
  1456.     speed: 130 km/h;
  1457.     misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU);
  1458.     refit_cost: 0;
  1459.     track_type: enable_our_own_tracks ? ERD1 : ELRL;
  1460.     ai_special_flag: AI_FLAG_PASSENGER;
  1461.     power: 1 hpM;
  1462.     running_cost_base: RUNNING_COST_ELECTRIC;
  1463.     cargo_capacity: 88;
  1464.     weight: 38.5 ton;
  1465.     engine_class: ENGINE_CLASS_ELECTRIC;
  1466.     length: 8;
  1467.     effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_NONE;
  1468.   }
  1469.   graphics {
  1470.     default: er1_h_sprites;
  1471.     purchase: er1_h_purchase_sprites;
  1472.     articulated_part: articulated_part_dummy4;
  1473.     can_attach_wagon: er1_can_attach_wagon;
  1474.     start_stop: er1_h_start_stop;
  1475.     speed: speed_after30_130to100;
  1476.     purchase_speed: return 130;
  1477.     additional_text: return string(STR_ER1_H_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10));
  1478.     cargo_subtype_text: er1_cargo_subtype_text;
  1479.     power: return 0;
  1480.     cargo_capacity: er1_h_cargo_capacity;
  1481.   }
  1482. }
  1483. item (FEAT_TRAINS, er1_m)
  1484. {
  1485.   property
  1486.   {
  1487.     name: string(STR_ER1_M_NAME);
  1488.     climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND);
  1489.     introduction_date: date(1957 - delta_age, 1, 1);
  1490.     model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default);
  1491.     retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age;
  1492.     vehicle_life: 30;
  1493.     reliability_decay: 20;
  1494.     cargo_allow_refit: [PASS];
  1495.     default_cargo_type: PASS;
  1496.     loading_speed: 12;
  1497.     cost_factor: 2;
  1498.     running_cost_factor: 4;
  1499.     sprite_id: SPRITE_ID_NEW_TRAIN;
  1500.     misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU);
  1501.     refit_cost: 0;
  1502.     track_type: enable_our_own_tracks ? ERD1 : ELRL;
  1503.     ai_special_flag: AI_FLAG_PASSENGER;
  1504.     power: 853 hpM;
  1505.     running_cost_base: RUNNING_COST_ELECTRIC;
  1506.     cargo_capacity: 110;
  1507.     weight: 52.5 ton;
  1508.     engine_class: ENGINE_CLASS_ELECTRIC;
  1509.     tractive_effort_coefficient: (35.0/(52.5)/9.8);
  1510.     length: 8;
  1511.     effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_ELECTRIC;
  1512.   }
  1513.   graphics {
  1514.     default: er1_m_sprites;
  1515.     purchase: er1_m_purchase_sprites;
  1516.     articulated_part: articulated_part_dummy4;
  1517.     can_attach_wagon: er1_can_attach_wagon;
  1518.     start_stop: er1_m_start_stop;
  1519.     speed: speed_after30_130to100;
  1520.     purchase_speed: return 130;
  1521.     additional_text: return string(STR_ER1_M_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10));
  1522.     cargo_subtype_text: er1_cargo_subtype_text;
  1523.     power: er1_m_power;
  1524.     cargo_capacity: er1_m_cargo_capacity;
  1525. //    visual_effect_and_powered: electric_visual_effect_and_powered(0);
  1526.     create_effect: er1_m_create_effect;
  1527.   }
  1528. }
  1529. item (FEAT_TRAINS, er1_c)
  1530. {
  1531.   property
  1532.   {
  1533.     name: string(STR_ER1_C_NAME);
  1534.     climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL, CLIMATE_TOYLAND);
  1535.     introduction_date: date(1957 - delta_age, 1, 1);
  1536.     model_life: 1962 >= 2050 ? VEHICLE_NEVER_EXPIRES : (1957 -1962 -delta_age < retire_early_default ? 1962 -1957 +delta_age : -retire_early_default);
  1537.     retire_early: 1957 -1962 -delta_age < retire_early_default ? retire_early_default+delta_age : 1957 -1962 -delta_age;
  1538.     vehicle_life: 30;
  1539.     reliability_decay: 20;
  1540.     cargo_allow_refit: [PASS];
  1541.     default_cargo_type: PASS;
  1542.     loading_speed: 12;
  1543.     cost_factor: 2;
  1544.     running_cost_factor: 4;
  1545.     sprite_id: SPRITE_ID_NEW_TRAIN;
  1546.     misc_flags: bitmask(TRAIN_FLAG_TILT, TRAIN_FLAG_MU);
  1547.     refit_cost: 0;
  1548.     track_type: enable_our_own_tracks ? ERD1 : ELRL;
  1549.     ai_special_flag: AI_FLAG_PASSENGER;
  1550.     power: 1 hpM;
  1551.     running_cost_base: RUNNING_COST_ELECTRIC;
  1552.     cargo_capacity: 110;
  1553.     weight: 36.9 ton;
  1554.     engine_class: ENGINE_CLASS_ELECTRIC;
  1555.     length: 8;
  1556.     effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_NONE;
  1557.   }
  1558.   graphics {
  1559.     default: er1_c_sprites;
  1560.     purchase: er1_c_purchase_sprites;
  1561.     articulated_part: articulated_part_dummy4;
  1562.     additional_text: return string(STR_ER1_C_PURCHASE_HINT, string(STR_SECTIONS_EMU_4_6_8_10));
  1563.     cargo_subtype_text: er1_cargo_subtype_text;
  1564.     speed: speed_after30_130to100;
  1565.     purchase_speed: return 130;
  1566.     power: return 0;
  1567.     can_attach_wagon: er1_can_attach_wagon;
  1568.     start_stop: return string(STR_START_STOP_HEAD_REQUIRED);
  1569.     cargo_capacity: er1_c_cargo_capacity;
  1570.   }
  1571. }
  1572. if (enable_long_names)
  1573. {
  1574.   item (FEAT_TRAINS, er1_h)
  1575.   {
  1576.     property
  1577.     { name: string(STR_ER1_H_NAME_LONG); }
  1578.   }
  1579.   item (FEAT_TRAINS, er1_m)
  1580.   {
  1581.     property
  1582.     { name: string(STR_ER1_M_NAME_LONG); }
  1583.   }
  1584.   item (FEAT_TRAINS, er1_c)
  1585.   {
  1586.     property
  1587.     { name: string(STR_ER1_C_NAME_LONG); }
  1588.   }
  1589. }
  1590. /*
  1591.  
  1592. #include "src/emu/er2.pnml"
  1593.  
  1594. #include "src/emu/epg.pnml"
  1595.  
  1596. #include "src/emu/epr.pnml"
  1597.  
  1598. #include "src/emu/ed2t.pnml"
  1599.  
  1600. #include "src/emu/ed9t.pnml"
  1601.  
  1602. #include "src/emu/er200.pnml"
  1603.  
  1604. #include "src/emu/er9p.pnml"
  1605.  
  1606. #include "src/emu/er9m.pnml"
  1607.  
  1608. #include "src/emu/er9e.pnml"
  1609.  
  1610. #include "src/emu/evs1.pnml"
  1611.  
  1612. #include "src/emu/evs2.pnml"
  1613.  
  1614. #include "src/emu/ed4m.pnml"
  1615.  
  1616. #include "src/emu/sm6.pnml"
  1617.  
  1618. #include "src/emu/es1.pnml"
  1619.  
  1620. #include "src/emu/sr3.pnml"
  1621.  
  1622. */

Comments