Loading

Paste #p4onmpucs

  1. // buy menu spriteset template
  2. template spriteset_template_purchase_athena(y) {
  3.             //[left_x,  upper_y,    width,      height,     offset_x,      offset_y]
  4.             [60,    10, 1, 1, 0, 0]
  5.             [60,    10, 1, 1, 0, 0]
  6.             [60,    10, 1, 1, 0, 0]
  7.             [60,    10, 1, 1, 0, 0]
  8.             [60,    10, 1, 1, 0, 0]
  9.             [60,    10, 1, 1, 0, 0]
  10.             // allow for buffers/couplings being 1px additional to the unit (they overlap in consists, but show in buy menu)
  11.             [224, y, 33, 16, -16, -11 ]
  12.             [60,    10, 1, 1, 0, 0]
  13. }
  14. // default graphics chain
  15.         spriteset(athena_ss_doors_closed_livery_1_0_unflipped, "generated/graphics/athena.png") {
  16.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0)
  17.         }
  18.         spriteset(athena_ss_doors_open_livery_1_0_unflipped, "generated/graphics/athena.png") {
  19.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0 + 30)
  20.         }
  21.         spriteset(athena_ss_doors_closed_livery_2_0_unflipped, "generated/graphics/athena.png") {
  22.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0 + 60)
  23.         }
  24.         spriteset(athena_ss_doors_open_livery_2_0_unflipped, "generated/graphics/athena.png") {
  25.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0 + 90)
  26.         }
  27.             spritegroup athena_sg_part_load_or_empty_livery_1_0_unflipped {
  28.                 loaded:  [
  29.                     athena_ss_doors_closed_livery_1_0_unflipped,
  30.                 ];
  31.                 loading: [
  32.                     athena_ss_doors_open_livery_1_0_unflipped,
  33.                 ];
  34.             }
  35.             spritegroup athena_sg_full_load_livery_1_0_unflipped {
  36.                 loaded:  [
  37.                     athena_ss_doors_closed_livery_1_0_unflipped,
  38.                 ];
  39.                 loading: [
  40.                     athena_ss_doors_closed_livery_1_0_unflipped,
  41.                 ];
  42.             }
  43.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_0_unflipped, cargo_count*100/cargo_capacity) {
  44.                     0..99: return athena_sg_part_load_or_empty_livery_1_0_unflipped;
  45.                 return athena_sg_full_load_livery_1_0_unflipped;
  46.             }
  47.             spritegroup athena_sg_part_load_or_empty_livery_2_0_unflipped {
  48.                 loaded:  [
  49.                     athena_ss_doors_closed_livery_2_0_unflipped,
  50.                 ];
  51.                 loading: [
  52.                     athena_ss_doors_open_livery_2_0_unflipped,
  53.                 ];
  54.             }
  55.             spritegroup athena_sg_full_load_livery_2_0_unflipped {
  56.                 loaded:  [
  57.                     athena_ss_doors_closed_livery_2_0_unflipped,
  58.                 ];
  59.                 loading: [
  60.                     athena_ss_doors_closed_livery_2_0_unflipped,
  61.                 ];
  62.             }
  63.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_0_unflipped, cargo_count*100/cargo_capacity) {
  64.                     0..99: return athena_sg_part_load_or_empty_livery_2_0_unflipped;
  65.                 return athena_sg_full_load_livery_2_0_unflipped;
  66.             }
  67.                 spriteset(athena_ss_pantographs_down_0_unflipped, "generated/graphics/athena_pantographs_down.png") {
  68.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0)
  69.                 }
  70.                 spriteset(athena_ss_pantographs_up_0_unflipped, "generated/graphics/athena_pantographs_up.png") {
  71.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 0)
  72.                 }
  73.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_0_unflipped, current_railtype) {
  74.                 ELRL: return athena_ss_pantographs_up_0_unflipped;
  75.                 return athena_ss_pantographs_down_0_unflipped;
  76.             }
  77.         spriteset(athena_ss_doors_closed_livery_1_0_flipped, "generated/graphics/athena.png") {
  78.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0)
  79.         }
  80.         spriteset(athena_ss_doors_open_livery_1_0_flipped, "generated/graphics/athena.png") {
  81.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0 + 30)
  82.         }
  83.         spriteset(athena_ss_doors_closed_livery_2_0_flipped, "generated/graphics/athena.png") {
  84.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0 + 60)
  85.         }
  86.         spriteset(athena_ss_doors_open_livery_2_0_flipped, "generated/graphics/athena.png") {
  87.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0 + 90)
  88.         }
  89.             spritegroup athena_sg_part_load_or_empty_livery_1_0_flipped {
  90.                 loaded:  [
  91.                     athena_ss_doors_closed_livery_1_0_flipped,
  92.                 ];
  93.                 loading: [
  94.                     athena_ss_doors_open_livery_1_0_flipped,
  95.                 ];
  96.             }
  97.             spritegroup athena_sg_full_load_livery_1_0_flipped {
  98.                 loaded:  [
  99.                     athena_ss_doors_closed_livery_1_0_flipped,
  100.                 ];
  101.                 loading: [
  102.                     athena_ss_doors_closed_livery_1_0_flipped,
  103.                 ];
  104.             }
  105.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_0_flipped, cargo_count*100/cargo_capacity) {
  106.                     0..99: return athena_sg_part_load_or_empty_livery_1_0_flipped;
  107.                 return athena_sg_full_load_livery_1_0_flipped;
  108.             }
  109.             spritegroup athena_sg_part_load_or_empty_livery_2_0_flipped {
  110.                 loaded:  [
  111.                     athena_ss_doors_closed_livery_2_0_flipped,
  112.                 ];
  113.                 loading: [
  114.                     athena_ss_doors_open_livery_2_0_flipped,
  115.                 ];
  116.             }
  117.             spritegroup athena_sg_full_load_livery_2_0_flipped {
  118.                 loaded:  [
  119.                     athena_ss_doors_closed_livery_2_0_flipped,
  120.                 ];
  121.                 loading: [
  122.                     athena_ss_doors_closed_livery_2_0_flipped,
  123.                 ];
  124.             }
  125.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_0_flipped, cargo_count*100/cargo_capacity) {
  126.                     0..99: return athena_sg_part_load_or_empty_livery_2_0_flipped;
  127.                 return athena_sg_full_load_livery_2_0_flipped;
  128.             }
  129.                 spriteset(athena_ss_pantographs_down_0_flipped, "generated/graphics/athena_pantographs_down.png") {
  130.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0)
  131.                 }
  132.                 spriteset(athena_ss_pantographs_up_0_flipped, "generated/graphics/athena_pantographs_up.png") {
  133.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 0)
  134.                 }
  135.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_0_flipped, current_railtype) {
  136.                 ELRL: return athena_ss_pantographs_up_0_flipped;
  137.                 return athena_ss_pantographs_down_0_flipped;
  138.             }
  139.     // handle user flipped state
  140.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_1_0, vehicle_is_flipped) {
  141.         1: return athena_switch_graphics_percent_loaded_livery_2_0_flipped;
  142.         return athena_switch_graphics_percent_loaded_livery_1_0_unflipped;
  143.     }
  144.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_2_0, vehicle_is_flipped) {
  145.         1: return athena_switch_graphics_percent_loaded_livery_1_0_flipped;
  146.         return athena_switch_graphics_percent_loaded_livery_2_0_unflipped;
  147.     }
  148.     switch (FEAT_TRAINS, PARENT, athena_switch_graphics_engine_id_0, vehicle_type_id) {
  149.             lark: return athena_switch_graphics_livery_2_0;
  150.             merrylegs: return athena_switch_graphics_livery_2_0;
  151.             proper_job: return athena_switch_graphics_livery_2_0;
  152.             shoebox: return athena_switch_graphics_livery_2_0;
  153.             super_shoebox: return athena_switch_graphics_livery_2_0;
  154.             ultra_shoebox: return athena_switch_graphics_livery_2_0;
  155.             hurly_burly: return athena_switch_graphics_livery_2_0;
  156.             moor_gallop: return athena_switch_graphics_livery_2_0;
  157.             roarer: return athena_switch_graphics_livery_2_0;
  158.             screamer: return athena_switch_graphics_livery_2_0;
  159.             sizzler: return athena_switch_graphics_livery_2_0;
  160.             athena: return athena_switch_graphics_livery_2_0;
  161.             geronimo: return athena_switch_graphics_livery_2_0;
  162.             breeze: return athena_switch_graphics_livery_2_0;
  163.             zeus: return athena_switch_graphics_livery_2_0;
  164.             ares: return athena_switch_graphics_livery_2_0;
  165.             dover: return athena_switch_graphics_livery_2_0;
  166.             jupiter: return athena_switch_graphics_livery_2_0;
  167.             pylon: return athena_switch_graphics_livery_2_0;
  168.         return athena_switch_graphics_livery_1_0;
  169.     }
  170.         switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_0, vehicle_is_flipped) {
  171.             1: return athena_switch_graphics_pantographs_0_flipped;
  172.             return athena_switch_graphics_pantographs_0_unflipped;
  173.         }
  174.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_vehicle_layers_0, getbits(extra_callback_info1, 8, 8)) {
  175.         0: return athena_switch_graphics_engine_id_0;
  176.             1: return athena_switch_graphics_pantographs_0;
  177.     }
  178.         spriteset(athena_ss_doors_closed_livery_1_1_unflipped, "generated/graphics/athena.png") {
  179.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120)
  180.         }
  181.         spriteset(athena_ss_doors_open_livery_1_1_unflipped, "generated/graphics/athena.png") {
  182.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120 + 30)
  183.         }
  184.         spriteset(athena_ss_doors_closed_livery_2_1_unflipped, "generated/graphics/athena.png") {
  185.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120 + 60)
  186.         }
  187.         spriteset(athena_ss_doors_open_livery_2_1_unflipped, "generated/graphics/athena.png") {
  188.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120 + 90)
  189.         }
  190.             spritegroup athena_sg_part_load_or_empty_livery_1_1_unflipped {
  191.                 loaded:  [
  192.                     athena_ss_doors_closed_livery_1_1_unflipped,
  193.                 ];
  194.                 loading: [
  195.                     athena_ss_doors_open_livery_1_1_unflipped,
  196.                 ];
  197.             }
  198.             spritegroup athena_sg_full_load_livery_1_1_unflipped {
  199.                 loaded:  [
  200.                     athena_ss_doors_closed_livery_1_1_unflipped,
  201.                 ];
  202.                 loading: [
  203.                     athena_ss_doors_closed_livery_1_1_unflipped,
  204.                 ];
  205.             }
  206.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_1_unflipped, cargo_count*100/cargo_capacity) {
  207.                     0..99: return athena_sg_part_load_or_empty_livery_1_1_unflipped;
  208.                 return athena_sg_full_load_livery_1_1_unflipped;
  209.             }
  210.             spritegroup athena_sg_part_load_or_empty_livery_2_1_unflipped {
  211.                 loaded:  [
  212.                     athena_ss_doors_closed_livery_2_1_unflipped,
  213.                 ];
  214.                 loading: [
  215.                     athena_ss_doors_open_livery_2_1_unflipped,
  216.                 ];
  217.             }
  218.             spritegroup athena_sg_full_load_livery_2_1_unflipped {
  219.                 loaded:  [
  220.                     athena_ss_doors_closed_livery_2_1_unflipped,
  221.                 ];
  222.                 loading: [
  223.                     athena_ss_doors_closed_livery_2_1_unflipped,
  224.                 ];
  225.             }
  226.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_1_unflipped, cargo_count*100/cargo_capacity) {
  227.                     0..99: return athena_sg_part_load_or_empty_livery_2_1_unflipped;
  228.                 return athena_sg_full_load_livery_2_1_unflipped;
  229.             }
  230.                 spriteset(athena_ss_pantographs_down_1_unflipped, "generated/graphics/athena_pantographs_down.png") {
  231.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 60)
  232.                 }
  233.                 spriteset(athena_ss_pantographs_up_1_unflipped, "generated/graphics/athena_pantographs_up.png") {
  234.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 60)
  235.                 }
  236.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_1_unflipped, current_railtype) {
  237.                 ELRL: return athena_ss_pantographs_up_1_unflipped;
  238.                 return athena_ss_pantographs_down_1_unflipped;
  239.             }
  240.         spriteset(athena_ss_doors_closed_livery_1_1_flipped, "generated/graphics/athena.png") {
  241.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120)
  242.         }
  243.         spriteset(athena_ss_doors_open_livery_1_1_flipped, "generated/graphics/athena.png") {
  244.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120 + 30)
  245.         }
  246.         spriteset(athena_ss_doors_closed_livery_2_1_flipped, "generated/graphics/athena.png") {
  247.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120 + 60)
  248.         }
  249.         spriteset(athena_ss_doors_open_livery_2_1_flipped, "generated/graphics/athena.png") {
  250.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120 + 90)
  251.         }
  252.             spritegroup athena_sg_part_load_or_empty_livery_1_1_flipped {
  253.                 loaded:  [
  254.                     athena_ss_doors_closed_livery_1_1_flipped,
  255.                 ];
  256.                 loading: [
  257.                     athena_ss_doors_open_livery_1_1_flipped,
  258.                 ];
  259.             }
  260.             spritegroup athena_sg_full_load_livery_1_1_flipped {
  261.                 loaded:  [
  262.                     athena_ss_doors_closed_livery_1_1_flipped,
  263.                 ];
  264.                 loading: [
  265.                     athena_ss_doors_closed_livery_1_1_flipped,
  266.                 ];
  267.             }
  268.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_1_flipped, cargo_count*100/cargo_capacity) {
  269.                     0..99: return athena_sg_part_load_or_empty_livery_1_1_flipped;
  270.                 return athena_sg_full_load_livery_1_1_flipped;
  271.             }
  272.             spritegroup athena_sg_part_load_or_empty_livery_2_1_flipped {
  273.                 loaded:  [
  274.                     athena_ss_doors_closed_livery_2_1_flipped,
  275.                 ];
  276.                 loading: [
  277.                     athena_ss_doors_open_livery_2_1_flipped,
  278.                 ];
  279.             }
  280.             spritegroup athena_sg_full_load_livery_2_1_flipped {
  281.                 loaded:  [
  282.                     athena_ss_doors_closed_livery_2_1_flipped,
  283.                 ];
  284.                 loading: [
  285.                     athena_ss_doors_closed_livery_2_1_flipped,
  286.                 ];
  287.             }
  288.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_1_flipped, cargo_count*100/cargo_capacity) {
  289.                     0..99: return athena_sg_part_load_or_empty_livery_2_1_flipped;
  290.                 return athena_sg_full_load_livery_2_1_flipped;
  291.             }
  292.                 spriteset(athena_ss_pantographs_down_1_flipped, "generated/graphics/athena_pantographs_down.png") {
  293.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 60)
  294.                 }
  295.                 spriteset(athena_ss_pantographs_up_1_flipped, "generated/graphics/athena_pantographs_up.png") {
  296.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 60)
  297.                 }
  298.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_1_flipped, current_railtype) {
  299.                 ELRL: return athena_ss_pantographs_up_1_flipped;
  300.                 return athena_ss_pantographs_down_1_flipped;
  301.             }
  302.     // handle user flipped state
  303.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_1_1, vehicle_is_flipped) {
  304.         1: return athena_switch_graphics_percent_loaded_livery_2_1_flipped;
  305.         return athena_switch_graphics_percent_loaded_livery_1_1_unflipped;
  306.     }
  307.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_2_1, vehicle_is_flipped) {
  308.         1: return athena_switch_graphics_percent_loaded_livery_1_1_flipped;
  309.         return athena_switch_graphics_percent_loaded_livery_2_1_unflipped;
  310.     }
  311.     switch (FEAT_TRAINS, PARENT, athena_switch_graphics_engine_id_1, vehicle_type_id) {
  312.             lark: return athena_switch_graphics_livery_2_1;
  313.             merrylegs: return athena_switch_graphics_livery_2_1;
  314.             proper_job: return athena_switch_graphics_livery_2_1;
  315.             shoebox: return athena_switch_graphics_livery_2_1;
  316.             super_shoebox: return athena_switch_graphics_livery_2_1;
  317.             ultra_shoebox: return athena_switch_graphics_livery_2_1;
  318.             hurly_burly: return athena_switch_graphics_livery_2_1;
  319.             moor_gallop: return athena_switch_graphics_livery_2_1;
  320.             roarer: return athena_switch_graphics_livery_2_1;
  321.             screamer: return athena_switch_graphics_livery_2_1;
  322.             sizzler: return athena_switch_graphics_livery_2_1;
  323.             athena: return athena_switch_graphics_livery_2_1;
  324.             geronimo: return athena_switch_graphics_livery_2_1;
  325.             breeze: return athena_switch_graphics_livery_2_1;
  326.             zeus: return athena_switch_graphics_livery_2_1;
  327.             ares: return athena_switch_graphics_livery_2_1;
  328.             dover: return athena_switch_graphics_livery_2_1;
  329.             jupiter: return athena_switch_graphics_livery_2_1;
  330.             pylon: return athena_switch_graphics_livery_2_1;
  331.         return athena_switch_graphics_livery_1_1;
  332.     }
  333.         switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_1, vehicle_is_flipped) {
  334.             1: return athena_switch_graphics_pantographs_1_flipped;
  335.             return athena_switch_graphics_pantographs_1_unflipped;
  336.         }
  337.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_vehicle_layers_1, getbits(extra_callback_info1, 8, 8)) {
  338.         0: return athena_switch_graphics_engine_id_1;
  339.             1: return athena_switch_graphics_pantographs_1;
  340.     }
  341.         spriteset(athena_ss_doors_closed_livery_1_2_unflipped, "generated/graphics/athena.png") {
  342.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 240)
  343.         }
  344.         spriteset(athena_ss_doors_open_livery_1_2_unflipped, "generated/graphics/athena.png") {
  345.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 240 + 30)
  346.         }
  347.         spriteset(athena_ss_doors_closed_livery_2_2_unflipped, "generated/graphics/athena.png") {
  348.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 240 + 60)
  349.         }
  350.         spriteset(athena_ss_doors_open_livery_2_2_unflipped, "generated/graphics/athena.png") {
  351.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 240 + 90)
  352.         }
  353.             spritegroup athena_sg_part_load_or_empty_livery_1_2_unflipped {
  354.                 loaded:  [
  355.                     athena_ss_doors_closed_livery_1_2_unflipped,
  356.                 ];
  357.                 loading: [
  358.                     athena_ss_doors_open_livery_1_2_unflipped,
  359.                 ];
  360.             }
  361.             spritegroup athena_sg_full_load_livery_1_2_unflipped {
  362.                 loaded:  [
  363.                     athena_ss_doors_closed_livery_1_2_unflipped,
  364.                 ];
  365.                 loading: [
  366.                     athena_ss_doors_closed_livery_1_2_unflipped,
  367.                 ];
  368.             }
  369.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_2_unflipped, cargo_count*100/cargo_capacity) {
  370.                     0..99: return athena_sg_part_load_or_empty_livery_1_2_unflipped;
  371.                 return athena_sg_full_load_livery_1_2_unflipped;
  372.             }
  373.             spritegroup athena_sg_part_load_or_empty_livery_2_2_unflipped {
  374.                 loaded:  [
  375.                     athena_ss_doors_closed_livery_2_2_unflipped,
  376.                 ];
  377.                 loading: [
  378.                     athena_ss_doors_open_livery_2_2_unflipped,
  379.                 ];
  380.             }
  381.             spritegroup athena_sg_full_load_livery_2_2_unflipped {
  382.                 loaded:  [
  383.                     athena_ss_doors_closed_livery_2_2_unflipped,
  384.                 ];
  385.                 loading: [
  386.                     athena_ss_doors_closed_livery_2_2_unflipped,
  387.                 ];
  388.             }
  389.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_2_unflipped, cargo_count*100/cargo_capacity) {
  390.                     0..99: return athena_sg_part_load_or_empty_livery_2_2_unflipped;
  391.                 return athena_sg_full_load_livery_2_2_unflipped;
  392.             }
  393.                 spriteset(athena_ss_pantographs_down_2_unflipped, "generated/graphics/athena_pantographs_down.png") {
  394.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120)
  395.                 }
  396.                 spriteset(athena_ss_pantographs_up_2_unflipped, "generated/graphics/athena_pantographs_up.png") {
  397.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 120)
  398.                 }
  399.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_2_unflipped, current_railtype) {
  400.                 ELRL: return athena_ss_pantographs_up_2_unflipped;
  401.                 return athena_ss_pantographs_down_2_unflipped;
  402.             }
  403.         spriteset(athena_ss_doors_closed_livery_1_2_flipped, "generated/graphics/athena.png") {
  404.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 240)
  405.         }
  406.         spriteset(athena_ss_doors_open_livery_1_2_flipped, "generated/graphics/athena.png") {
  407.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 240 + 30)
  408.         }
  409.         spriteset(athena_ss_doors_closed_livery_2_2_flipped, "generated/graphics/athena.png") {
  410.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 240 + 60)
  411.         }
  412.         spriteset(athena_ss_doors_open_livery_2_2_flipped, "generated/graphics/athena.png") {
  413.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 240 + 90)
  414.         }
  415.             spritegroup athena_sg_part_load_or_empty_livery_1_2_flipped {
  416.                 loaded:  [
  417.                     athena_ss_doors_closed_livery_1_2_flipped,
  418.                 ];
  419.                 loading: [
  420.                     athena_ss_doors_open_livery_1_2_flipped,
  421.                 ];
  422.             }
  423.             spritegroup athena_sg_full_load_livery_1_2_flipped {
  424.                 loaded:  [
  425.                     athena_ss_doors_closed_livery_1_2_flipped,
  426.                 ];
  427.                 loading: [
  428.                     athena_ss_doors_closed_livery_1_2_flipped,
  429.                 ];
  430.             }
  431.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_2_flipped, cargo_count*100/cargo_capacity) {
  432.                     0..99: return athena_sg_part_load_or_empty_livery_1_2_flipped;
  433.                 return athena_sg_full_load_livery_1_2_flipped;
  434.             }
  435.             spritegroup athena_sg_part_load_or_empty_livery_2_2_flipped {
  436.                 loaded:  [
  437.                     athena_ss_doors_closed_livery_2_2_flipped,
  438.                 ];
  439.                 loading: [
  440.                     athena_ss_doors_open_livery_2_2_flipped,
  441.                 ];
  442.             }
  443.             spritegroup athena_sg_full_load_livery_2_2_flipped {
  444.                 loaded:  [
  445.                     athena_ss_doors_closed_livery_2_2_flipped,
  446.                 ];
  447.                 loading: [
  448.                     athena_ss_doors_closed_livery_2_2_flipped,
  449.                 ];
  450.             }
  451.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_2_flipped, cargo_count*100/cargo_capacity) {
  452.                     0..99: return athena_sg_part_load_or_empty_livery_2_2_flipped;
  453.                 return athena_sg_full_load_livery_2_2_flipped;
  454.             }
  455.                 spriteset(athena_ss_pantographs_down_2_flipped, "generated/graphics/athena_pantographs_down.png") {
  456.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120)
  457.                 }
  458.                 spriteset(athena_ss_pantographs_up_2_flipped, "generated/graphics/athena_pantographs_up.png") {
  459.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 120)
  460.                 }
  461.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_2_flipped, current_railtype) {
  462.                 ELRL: return athena_ss_pantographs_up_2_flipped;
  463.                 return athena_ss_pantographs_down_2_flipped;
  464.             }
  465.     // handle user flipped state
  466.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_1_2, vehicle_is_flipped) {
  467.         1: return athena_switch_graphics_percent_loaded_livery_2_2_flipped;
  468.         return athena_switch_graphics_percent_loaded_livery_1_2_unflipped;
  469.     }
  470.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_2_2, vehicle_is_flipped) {
  471.         1: return athena_switch_graphics_percent_loaded_livery_1_2_flipped;
  472.         return athena_switch_graphics_percent_loaded_livery_2_2_unflipped;
  473.     }
  474.     switch (FEAT_TRAINS, PARENT, athena_switch_graphics_engine_id_2, vehicle_type_id) {
  475.             lark: return athena_switch_graphics_livery_2_2;
  476.             merrylegs: return athena_switch_graphics_livery_2_2;
  477.             proper_job: return athena_switch_graphics_livery_2_2;
  478.             shoebox: return athena_switch_graphics_livery_2_2;
  479.             super_shoebox: return athena_switch_graphics_livery_2_2;
  480.             ultra_shoebox: return athena_switch_graphics_livery_2_2;
  481.             hurly_burly: return athena_switch_graphics_livery_2_2;
  482.             moor_gallop: return athena_switch_graphics_livery_2_2;
  483.             roarer: return athena_switch_graphics_livery_2_2;
  484.             screamer: return athena_switch_graphics_livery_2_2;
  485.             sizzler: return athena_switch_graphics_livery_2_2;
  486.             athena: return athena_switch_graphics_livery_2_2;
  487.             geronimo: return athena_switch_graphics_livery_2_2;
  488.             breeze: return athena_switch_graphics_livery_2_2;
  489.             zeus: return athena_switch_graphics_livery_2_2;
  490.             ares: return athena_switch_graphics_livery_2_2;
  491.             dover: return athena_switch_graphics_livery_2_2;
  492.             jupiter: return athena_switch_graphics_livery_2_2;
  493.             pylon: return athena_switch_graphics_livery_2_2;
  494.         return athena_switch_graphics_livery_1_2;
  495.     }
  496.         switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_2, vehicle_is_flipped) {
  497.             1: return athena_switch_graphics_pantographs_2_flipped;
  498.             return athena_switch_graphics_pantographs_2_unflipped;
  499.         }
  500.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_vehicle_layers_2, getbits(extra_callback_info1, 8, 8)) {
  501.         0: return athena_switch_graphics_engine_id_2;
  502.             1: return athena_switch_graphics_pantographs_2;
  503.     }
  504.         spriteset(athena_ss_doors_closed_livery_1_3_unflipped, "generated/graphics/athena.png") {
  505.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 360)
  506.         }
  507.         spriteset(athena_ss_doors_open_livery_1_3_unflipped, "generated/graphics/athena.png") {
  508.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 360 + 30)
  509.         }
  510.         spriteset(athena_ss_doors_closed_livery_2_3_unflipped, "generated/graphics/athena.png") {
  511.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 360 + 60)
  512.         }
  513.         spriteset(athena_ss_doors_open_livery_2_3_unflipped, "generated/graphics/athena.png") {
  514.           spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 360 + 90)
  515.         }
  516.             spritegroup athena_sg_part_load_or_empty_livery_1_3_unflipped {
  517.                 loaded:  [
  518.                     athena_ss_doors_closed_livery_1_3_unflipped,
  519.                 ];
  520.                 loading: [
  521.                     athena_ss_doors_open_livery_1_3_unflipped,
  522.                 ];
  523.             }
  524.             spritegroup athena_sg_full_load_livery_1_3_unflipped {
  525.                 loaded:  [
  526.                     athena_ss_doors_closed_livery_1_3_unflipped,
  527.                 ];
  528.                 loading: [
  529.                     athena_ss_doors_closed_livery_1_3_unflipped,
  530.                 ];
  531.             }
  532.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_3_unflipped, cargo_count*100/cargo_capacity) {
  533.                     0..99: return athena_sg_part_load_or_empty_livery_1_3_unflipped;
  534.                 return athena_sg_full_load_livery_1_3_unflipped;
  535.             }
  536.             spritegroup athena_sg_part_load_or_empty_livery_2_3_unflipped {
  537.                 loaded:  [
  538.                     athena_ss_doors_closed_livery_2_3_unflipped,
  539.                 ];
  540.                 loading: [
  541.                     athena_ss_doors_open_livery_2_3_unflipped,
  542.                 ];
  543.             }
  544.             spritegroup athena_sg_full_load_livery_2_3_unflipped {
  545.                 loaded:  [
  546.                     athena_ss_doors_closed_livery_2_3_unflipped,
  547.                 ];
  548.                 loading: [
  549.                     athena_ss_doors_closed_livery_2_3_unflipped,
  550.                 ];
  551.             }
  552.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_3_unflipped, cargo_count*100/cargo_capacity) {
  553.                     0..99: return athena_sg_part_load_or_empty_livery_2_3_unflipped;
  554.                 return athena_sg_full_load_livery_2_3_unflipped;
  555.             }
  556.                 spriteset(athena_ss_pantographs_down_3_unflipped, "generated/graphics/athena_pantographs_down.png") {
  557.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 180)
  558.                 }
  559.                 spriteset(athena_ss_pantographs_up_3_unflipped, "generated/graphics/athena_pantographs_up.png") {
  560.                   spriteset_template_asymmetric_unreversed_8_8_unflipped(10 + 180)
  561.                 }
  562.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_3_unflipped, current_railtype) {
  563.                 ELRL: return athena_ss_pantographs_up_3_unflipped;
  564.                 return athena_ss_pantographs_down_3_unflipped;
  565.             }
  566.         spriteset(athena_ss_doors_closed_livery_1_3_flipped, "generated/graphics/athena.png") {
  567.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 360)
  568.         }
  569.         spriteset(athena_ss_doors_open_livery_1_3_flipped, "generated/graphics/athena.png") {
  570.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 360 + 30)
  571.         }
  572.         spriteset(athena_ss_doors_closed_livery_2_3_flipped, "generated/graphics/athena.png") {
  573.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 360 + 60)
  574.         }
  575.         spriteset(athena_ss_doors_open_livery_2_3_flipped, "generated/graphics/athena.png") {
  576.           spriteset_template_asymmetric_reversed_8_8_flipped(10 + 360 + 90)
  577.         }
  578.             spritegroup athena_sg_part_load_or_empty_livery_1_3_flipped {
  579.                 loaded:  [
  580.                     athena_ss_doors_closed_livery_1_3_flipped,
  581.                 ];
  582.                 loading: [
  583.                     athena_ss_doors_open_livery_1_3_flipped,
  584.                 ];
  585.             }
  586.             spritegroup athena_sg_full_load_livery_1_3_flipped {
  587.                 loaded:  [
  588.                     athena_ss_doors_closed_livery_1_3_flipped,
  589.                 ];
  590.                 loading: [
  591.                     athena_ss_doors_closed_livery_1_3_flipped,
  592.                 ];
  593.             }
  594.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_1_3_flipped, cargo_count*100/cargo_capacity) {
  595.                     0..99: return athena_sg_part_load_or_empty_livery_1_3_flipped;
  596.                 return athena_sg_full_load_livery_1_3_flipped;
  597.             }
  598.             spritegroup athena_sg_part_load_or_empty_livery_2_3_flipped {
  599.                 loaded:  [
  600.                     athena_ss_doors_closed_livery_2_3_flipped,
  601.                 ];
  602.                 loading: [
  603.                     athena_ss_doors_open_livery_2_3_flipped,
  604.                 ];
  605.             }
  606.             spritegroup athena_sg_full_load_livery_2_3_flipped {
  607.                 loaded:  [
  608.                     athena_ss_doors_closed_livery_2_3_flipped,
  609.                 ];
  610.                 loading: [
  611.                     athena_ss_doors_closed_livery_2_3_flipped,
  612.                 ];
  613.             }
  614.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_percent_loaded_livery_2_3_flipped, cargo_count*100/cargo_capacity) {
  615.                     0..99: return athena_sg_part_load_or_empty_livery_2_3_flipped;
  616.                 return athena_sg_full_load_livery_2_3_flipped;
  617.             }
  618.                 spriteset(athena_ss_pantographs_down_3_flipped, "generated/graphics/athena_pantographs_down.png") {
  619.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 180)
  620.                 }
  621.                 spriteset(athena_ss_pantographs_up_3_flipped, "generated/graphics/athena_pantographs_up.png") {
  622.                   spriteset_template_asymmetric_reversed_8_8_flipped(10 + 180)
  623.                 }
  624.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_3_flipped, current_railtype) {
  625.                 ELRL: return athena_ss_pantographs_up_3_flipped;
  626.                 return athena_ss_pantographs_down_3_flipped;
  627.             }
  628.     // handle user flipped state
  629.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_1_3, vehicle_is_flipped) {
  630.         1: return athena_switch_graphics_percent_loaded_livery_2_3_flipped;
  631.         return athena_switch_graphics_percent_loaded_livery_1_3_unflipped;
  632.     }
  633.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_livery_2_3, vehicle_is_flipped) {
  634.         1: return athena_switch_graphics_percent_loaded_livery_1_3_flipped;
  635.         return athena_switch_graphics_percent_loaded_livery_2_3_unflipped;
  636.     }
  637.     switch (FEAT_TRAINS, PARENT, athena_switch_graphics_engine_id_3, vehicle_type_id) {
  638.             lark: return athena_switch_graphics_livery_2_3;
  639.             merrylegs: return athena_switch_graphics_livery_2_3;
  640.             proper_job: return athena_switch_graphics_livery_2_3;
  641.             shoebox: return athena_switch_graphics_livery_2_3;
  642.             super_shoebox: return athena_switch_graphics_livery_2_3;
  643.             ultra_shoebox: return athena_switch_graphics_livery_2_3;
  644.             hurly_burly: return athena_switch_graphics_livery_2_3;
  645.             moor_gallop: return athena_switch_graphics_livery_2_3;
  646.             roarer: return athena_switch_graphics_livery_2_3;
  647.             screamer: return athena_switch_graphics_livery_2_3;
  648.             sizzler: return athena_switch_graphics_livery_2_3;
  649.             athena: return athena_switch_graphics_livery_2_3;
  650.             geronimo: return athena_switch_graphics_livery_2_3;
  651.             breeze: return athena_switch_graphics_livery_2_3;
  652.             zeus: return athena_switch_graphics_livery_2_3;
  653.             ares: return athena_switch_graphics_livery_2_3;
  654.             dover: return athena_switch_graphics_livery_2_3;
  655.             jupiter: return athena_switch_graphics_livery_2_3;
  656.             pylon: return athena_switch_graphics_livery_2_3;
  657.         return athena_switch_graphics_livery_1_3;
  658.     }
  659.         switch (FEAT_TRAINS, SELF, athena_switch_graphics_pantographs_3, vehicle_is_flipped) {
  660.             1: return athena_switch_graphics_pantographs_3_flipped;
  661.             return athena_switch_graphics_pantographs_3_unflipped;
  662.         }
  663.     switch (FEAT_TRAINS, SELF, athena_switch_graphics_vehicle_layers_3, getbits(extra_callback_info1, 8, 8)) {
  664.         0: return athena_switch_graphics_engine_id_3;
  665.             1: return athena_switch_graphics_pantographs_3;
  666.     }
  667.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_1_DFLT, position_in_vehid_chain % 6) {
  668.                 0: return athena_switch_graphics_vehicle_layers_0;
  669.             }
  670.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_2_DFLT, position_in_vehid_chain % 6) {
  671.                 0: return athena_switch_graphics_vehicle_layers_1;
  672.                 return athena_switch_graphics_vehicle_layers_2;
  673.             }
  674.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_3_DFLT, position_in_vehid_chain % 6) {
  675.                 0: return athena_switch_graphics_vehicle_layers_1;
  676.                 1: return athena_switch_graphics_vehicle_layers_3;
  677.                 return athena_switch_graphics_vehicle_layers_2;
  678.             }
  679.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_4_DFLT, position_in_vehid_chain % 6) {
  680.                 0: return athena_switch_graphics_vehicle_layers_1;
  681.                 1: return athena_switch_graphics_vehicle_layers_2;
  682.                 2: return athena_switch_graphics_vehicle_layers_1;
  683.                 return athena_switch_graphics_vehicle_layers_2;
  684.             }
  685.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_5_DFLT, position_in_vehid_chain % 6) {
  686.                 0: return athena_switch_graphics_vehicle_layers_1;
  687.                 1: return athena_switch_graphics_vehicle_layers_3;
  688.                 2: return athena_switch_graphics_vehicle_layers_2;
  689.                 3: return athena_switch_graphics_vehicle_layers_1;
  690.                 return athena_switch_graphics_vehicle_layers_2;
  691.             }
  692.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_6_DFLT, position_in_vehid_chain % 6) {
  693.                 0: return athena_switch_graphics_vehicle_layers_1;
  694.                 1: return athena_switch_graphics_vehicle_layers_3;
  695.                 2: return athena_switch_graphics_vehicle_layers_2;
  696.                 3: return athena_switch_graphics_vehicle_layers_1;
  697.                 4: return athena_switch_graphics_vehicle_layers_3;
  698.                 return athena_switch_graphics_vehicle_layers_2;
  699.             }
  700.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_less_than_6_remaining_DFLT, num_vehs_in_vehid_chain % 6) {
  701.                 1: return athena_switch_graphics_modulo_num_units_in_consist_1_DFLT;
  702.                 2: return athena_switch_graphics_modulo_num_units_in_consist_2_DFLT;
  703.                 3: return athena_switch_graphics_modulo_num_units_in_consist_3_DFLT;
  704.                 4: return athena_switch_graphics_modulo_num_units_in_consist_4_DFLT;
  705.                 5: return athena_switch_graphics_modulo_num_units_in_consist_5_DFLT;
  706.                 return athena_switch_graphics_modulo_num_units_in_consist_6_DFLT;
  707.             }
  708.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_position_in_consist_entry_point_DFLT, position_in_vehid_chain >= (num_vehs_in_vehid_chain - (num_vehs_in_vehid_chain  % 6))) {
  709.                 1: return athena_switch_graphics_less_than_6_remaining_DFLT;
  710.                 return athena_switch_graphics_modulo_num_units_in_consist_6_DFLT;
  711.             }
  712.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_1_PASS, position_in_vehid_chain % 6) {
  713.                 0: return athena_switch_graphics_vehicle_layers_0;
  714.             }
  715.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_2_PASS, position_in_vehid_chain % 6) {
  716.                 0: return athena_switch_graphics_vehicle_layers_1;
  717.                 return athena_switch_graphics_vehicle_layers_2;
  718.             }
  719.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_3_PASS, position_in_vehid_chain % 6) {
  720.                 0: return athena_switch_graphics_vehicle_layers_1;
  721.                 1: return athena_switch_graphics_vehicle_layers_3;
  722.                 return athena_switch_graphics_vehicle_layers_2;
  723.             }
  724.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_4_PASS, position_in_vehid_chain % 6) {
  725.                 0: return athena_switch_graphics_vehicle_layers_1;
  726.                 1: return athena_switch_graphics_vehicle_layers_2;
  727.                 2: return athena_switch_graphics_vehicle_layers_1;
  728.                 return athena_switch_graphics_vehicle_layers_2;
  729.             }
  730.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_5_PASS, position_in_vehid_chain % 6) {
  731.                 0: return athena_switch_graphics_vehicle_layers_1;
  732.                 1: return athena_switch_graphics_vehicle_layers_3;
  733.                 2: return athena_switch_graphics_vehicle_layers_2;
  734.                 3: return athena_switch_graphics_vehicle_layers_1;
  735.                 return athena_switch_graphics_vehicle_layers_2;
  736.             }
  737.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_modulo_num_units_in_consist_6_PASS, position_in_vehid_chain % 6) {
  738.                 0: return athena_switch_graphics_vehicle_layers_1;
  739.                 1: return athena_switch_graphics_vehicle_layers_3;
  740.                 2: return athena_switch_graphics_vehicle_layers_2;
  741.                 3: return athena_switch_graphics_vehicle_layers_1;
  742.                 4: return athena_switch_graphics_vehicle_layers_3;
  743.                 return athena_switch_graphics_vehicle_layers_2;
  744.             }
  745.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_less_than_6_remaining_PASS, num_vehs_in_vehid_chain % 6) {
  746.                 1: return athena_switch_graphics_modulo_num_units_in_consist_1_PASS;
  747.                 2: return athena_switch_graphics_modulo_num_units_in_consist_2_PASS;
  748.                 3: return athena_switch_graphics_modulo_num_units_in_consist_3_PASS;
  749.                 4: return athena_switch_graphics_modulo_num_units_in_consist_4_PASS;
  750.                 5: return athena_switch_graphics_modulo_num_units_in_consist_5_PASS;
  751.                 return athena_switch_graphics_modulo_num_units_in_consist_6_PASS;
  752.             }
  753.             switch (FEAT_TRAINS, SELF, athena_switch_graphics_position_in_consist_entry_point_PASS, position_in_vehid_chain >= (num_vehs_in_vehid_chain - (num_vehs_in_vehid_chain  % 6))) {
  754.                 1: return athena_switch_graphics_less_than_6_remaining_PASS;
  755.                 return athena_switch_graphics_modulo_num_units_in_consist_6_PASS;
  756.             }
  757. switch (FEAT_TRAINS, PARENT, athena_switch_graphics_vehicle, most_common_cargo_type) {
  758.             PASS: return athena_switch_graphics_position_in_consist_entry_point_PASS;
  759.     return athena_switch_graphics_position_in_consist_entry_point_DFLT;
  760. }
  761. // buy menu graphics chain
  762. spriteset(athena_ss_vehicle_purchase, "generated/graphics/athena.png") {
  763.   spriteset_template_purchase_athena(10 + 60)
  764. }
  765.         spriteset(athena_ss_pantograph_purchase, "generated/graphics/athena_pantographs_down.png") {
  766.           spriteset_template_purchase_athena(10)
  767.         }
  768.         switch (FEAT_TRAINS, SELF, athena_switch_set_layers_register_more_sprites_purchase, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
  769.             return athena_ss_vehicle_purchase;
  770.         }
  771.         switch (FEAT_TRAINS, SELF, athena_switch_graphics_purchase, getbits(extra_callback_info1, 8, 8)) {
  772.             0: return athena_switch_set_layers_register_more_sprites_purchase;
  773.             1: return athena_ss_pantograph_purchase;
  774.         }
  775. switch (FEAT_TRAINS, SELF, athena_switch_set_layers_register_more_sprites, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
  776.     return athena_switch_graphics_vehicle;
  777. }
  778. switch (FEAT_TRAINS, SELF, athena_switch_graphics_rear_light, position_in_consist_from_end) {
  779.     0: return ss_rear_light_32px;
  780.     return ss_rear_light_empty;
  781. }
  782. switch (FEAT_TRAINS, SELF, athena_switch_graphics_layer_rear_light, STORE_TEMP(PALETTE_USE_DEFAULT, 0x100)) {
  783.     return athena_switch_graphics_rear_light;
  784. }
  785. switch (FEAT_TRAINS, SELF, athena_switch_graphics, getbits(extra_callback_info1, 8, 8)) {
  786.     0: return athena_switch_set_layers_register_more_sprites;
  787.         1: return athena_switch_set_layers_register_more_sprites;
  788.     return athena_switch_graphics_layer_rear_light;
  789. }
  790.     // -- capacity determined according to specific labels that might need to be handled, and otherwise cargo class -- //
  791.     switch (FEAT_TRAINS, SELF, athena_switch_cargo_capacity_by_cargo_0, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  792.         bitmask(CC_MAIL): return 54;
  793.         bitmask(CC_ARMOURED): return 54;
  794.         return 27;
  795.     }
  796.     switch (FEAT_TRAINS, SELF, athena_switch_cargo_capacity_by_cargo_1, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  797.         bitmask(CC_MAIL): return 80;
  798.         bitmask(CC_ARMOURED): return 80;
  799.         return 40;
  800.     }
  801.     switch (FEAT_TRAINS, SELF, athena_switch_cargo_capacity_by_cargo_2, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  802.         bitmask(CC_MAIL): return 108;
  803.         bitmask(CC_ARMOURED): return 108;
  804.         return 54;
  805.     }
  806. switch (FEAT_TRAINS, SELF, athena_switch_cargo_capacity, param[0]) {
  807.     0: athena_switch_cargo_capacity_by_cargo_0;
  808.     1: athena_switch_cargo_capacity_by_cargo_1;
  809.     2: athena_switch_cargo_capacity_by_cargo_2;
  810. }
  811. // -- loading speed also determined by capacity, which varies by cargo -- //
  812.     switch (FEAT_TRAINS, SELF, athena_switch_loading_speed_by_cargo_0, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  813.         bitmask(CC_PASSENGERS): return 5;
  814.         bitmask(CC_MAIL): return 5;
  815.         bitmask(CC_ARMOURED): return 5;
  816.         return 5;
  817.     }
  818.     switch (FEAT_TRAINS, SELF, athena_switch_loading_speed_by_cargo_1, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  819.         bitmask(CC_PASSENGERS): return 7;
  820.         bitmask(CC_MAIL): return 7;
  821.         bitmask(CC_ARMOURED): return 7;
  822.         return 7;
  823.     }
  824.     switch (FEAT_TRAINS, SELF, athena_switch_loading_speed_by_cargo_2, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
  825.         bitmask(CC_PASSENGERS): return 9;
  826.         bitmask(CC_MAIL): return 9;
  827.         bitmask(CC_ARMOURED): return 9;
  828.         return 9;
  829.     }
  830. switch (FEAT_TRAINS, SELF, athena_switch_loading_speed, param[0]) {
  831.     0: athena_switch_loading_speed_by_cargo_0;
  832.     1: athena_switch_loading_speed_by_cargo_1;
  833.     2: athena_switch_loading_speed_by_cargo_2;
  834. }
  835.     // -- smoke etc -- //
  836.     switch (FEAT_TRAINS, SELF, athena_switch_visual_effect_and_powered_by_variant_unreversed, current_railtype) {
  837.         return visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 0, DISABLE_WAGON_POWER);
  838.     }
  839.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_21, [count_veh_id(sizzler) > 0]) {
  840.                     1: return 144;
  841.                     return 96;
  842.             }
  843.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_20, [count_veh_id(screamer) > 0]) {
  844.                     1: return 144;
  845.                     return athena_switch_speed_21;
  846.             }
  847.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_19, [count_veh_id(roarer) > 0]) {
  848.                     1: return 144;
  849.                     return athena_switch_speed_20;
  850.             }
  851.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_18, [count_veh_id(moor_gallop) > 0]) {
  852.                     1: return 144;
  853.                     return athena_switch_speed_19;
  854.             }
  855.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_17, [count_veh_id(hurly_burly) > 0]) {
  856.                     1: return 144;
  857.                     return athena_switch_speed_18;
  858.             }
  859.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_16, [count_veh_id(turtle) > 0]) {
  860.                     1: return 144;
  861.                     return athena_switch_speed_17;
  862.             }
  863.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_15, [count_veh_id(thunderbird) > 0]) {
  864.                     1: return 144;
  865.                     return athena_switch_speed_16;
  866.             }
  867.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_14, [count_veh_id(dragon) > 0]) {
  868.                     1: return 144;
  869.                     return athena_switch_speed_15;
  870.             }
  871.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_13, [count_veh_id(pegasus) > 0]) {
  872.                     1: return 144;
  873.                     return athena_switch_speed_14;
  874.             }
  875.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_12, [count_veh_id(upcountry) > 0]) {
  876.                     1: return 144;
  877.                     return athena_switch_speed_13;
  878.             }
  879.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_11, [count_veh_id(shredder) > 0]) {
  880.                     1: return 144;
  881.                     return athena_switch_speed_12;
  882.             }
  883.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_10, [count_veh_id(griffon) > 0]) {
  884.                     1: return 144;
  885.                     return athena_switch_speed_11;
  886.             }
  887.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_9, [count_veh_id(kelpie) > 0]) {
  888.                     1: return 144;
  889.                     return athena_switch_speed_10;
  890.             }
  891.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_8, [count_veh_id(tencendur) > 0]) {
  892.                     1: return 144;
  893.                     return athena_switch_speed_9;
  894.             }
  895.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_7, [count_veh_id(carrack) > 0]) {
  896.                     1: return 144;
  897.                     return athena_switch_speed_8;
  898.             }
  899.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_6, [count_veh_id(spinner) > 0]) {
  900.                     1: return 144;
  901.                     return athena_switch_speed_7;
  902.             }
  903.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_5, [count_veh_id(ultra_shoebox) > 0]) {
  904.                     1: return 144;
  905.                     return athena_switch_speed_6;
  906.             }
  907.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_4, [count_veh_id(super_shoebox) > 0]) {
  908.                     1: return 144;
  909.                     return athena_switch_speed_5;
  910.             }
  911.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_3, [count_veh_id(shoebox) > 0]) {
  912.                     1: return 144;
  913.                     return athena_switch_speed_4;
  914.             }
  915.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_2, [count_veh_id(proper_job) > 0]) {
  916.                     1: return 144;
  917.                     return athena_switch_speed_3;
  918.             }
  919.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_1, [count_veh_id(merrylegs) > 0]) {
  920.                     1: return 144;
  921.                     return athena_switch_speed_2;
  922.             }
  923.             switch (FEAT_TRAINS, PARENT, athena_switch_speed_0, [count_veh_id(lark) > 0]) {
  924.                     1: return 144;
  925.                     return athena_switch_speed_1;
  926.             }
  927. item(FEAT_TRAINS, athena, 2150) {
  928.     property {
  929.         name:                           string(STR_NAME_CONSIST_PARENTHESES, string(STR_NAME_athena), string(STR_NAME_SUFFIX_ELECTRIC));
  930.         climates_available:             NO_CLIMATE; // nml constant
  931.         engine_class:                   ENGINE_CLASS_ELECTRIC;
  932.         visual_effect_and_powered:      visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
  933.         introduction_date:              date(1927,01,01); // consist just supplies intro year - openttd randomises intro dates a bit anyway
  934.         cargo_capacity:                 40;
  935.         sprite_id:                      SPRITE_ID_NEW_TRAIN; //enable new graphics - nml constant
  936.         power:                          350hp;
  937.             speed:                          60mph;
  938.         weight:                         32ton;
  939.         tractive_effort_coefficient:    0.3;
  940.         cost_factor:                    0; // use the CB to set this, the prop is capped to max 255, cb is 32k
  941.         running_cost_base:              RUNNING_COST_STEAM;
  942.         running_cost_factor:            0; // use the CB to set this, the prop is capped to max 255, cb is 32k
  943.         refit_cost:                     0; // btw this needs to be 0 if we want autorefit without using cb
  944.         refittable_cargo_classes:       bitmask(CC_PASSENGERS);
  945.         non_refittable_cargo_classes:   bitmask(); // don't set non-refittable classes, increases likelihood of breaking cargo support
  946.        cargo_allow_refit:              [];
  947.        cargo_disallow_refit:           [];
  948.        cargo_age_period:               56;
  949.            default_cargo_type:             PASS;
  950.        misc_flags:                     bitmask(TRAIN_FLAG_2CC,TRAIN_FLAG_SPRITE_STACK,TRAIN_FLAG_FLIP,TRAIN_FLAG_AUTOREFIT,TRAIN_FLAG_MU); // nml constants
  951.        model_life:                     30;
  952.        retire_early:                   -10;
  953.        reliability_decay:              20; // default value
  954.        vehicle_life:                   40;
  955.        length:                         8;
  956.        track_type:                     ELRL;
  957.    }
  958.    graphics {
  959.        default:                        athena_switch_graphics;
  960.        purchase:                       athena_switch_graphics_purchase;
  961.        cost_factor:                    25; // CB used as it is capped to max 32k, prop is only 255
  962.        running_cost_factor:            803; // CB used as it is capped to max 32k, prop is only 255
  963.            cargo_capacity:                 athena_switch_cargo_capacity;
  964.            purchase_cargo_capacity:        athena_switch_cargo_capacity;
  965.            loading_speed:                  athena_switch_loading_speed;
  966.            speed:                          athena_switch_speed_0;
  967.            purchase_speed:                 96;
  968.            visual_effect_and_powered:      athena_switch_visual_effect_and_powered_by_variant_unreversed;
  969.        additional_text:                string(STR_SPRITES_COMPLETE);
  970.    }
  971. }
  972.    if (param[1]==0) {
  973.        item(FEAT_TRAINS, athena, 2150) {
  974.            property {
  975.                climates_available:             ALL_CLIMATES;
  976.            }
  977.        }
  978.    }
  979. // -- end 2150 --

Comments