Loading

Paste #pd3akpu8o

  1. // default spriteset templates
  2.         template spriteset_template_asymmetric_unreversed_moor_gallop_unflipped(y) {
  3.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  4.                 [60, y, 8, 29, -3, -16 ]
  5.                 [73, y, 26, 24, -14, -15 ]
  6.                 [104, y, 33, 16, -16, -12 ]
  7.                 [143, y, 26, 24, -7, -16 ]
  8.                 [180, y, 8, 29, -3, -16 ]
  9.                 [193, y, 26, 24, -13, -16 ]
  10.                 [224, y, 33, 16, -16, -12 ]
  11.                 [263, y, 26, 24, -7, -16 ]
  12.         }
  13.         template spriteset_template_asymmetric_reversed_moor_gallop_unflipped(y) {
  14.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  15.                 [180, y, 8, 29, -3, -16 ]
  16.                 [193, y, 26, 24, -14, -15 ]
  17.                 [224, y, 33, 16, -16, -12 ]
  18.                 [263, y, 26, 24, -7, -16 ]
  19.                 [60, y, 8, 29, -3, -16 ]
  20.                 [73, y, 26, 24, -13, -16 ]
  21.                 [104, y, 33, 16, -16, -12 ]
  22.                 [143, y, 26, 24, -7, -16 ]
  23.         }
  24.         template spriteset_template_asymmetric_unreversed_moor_gallop_flipped(y) {
  25.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  26.                 [60, y, 8, 29, -3, -16 ]
  27.                 [73, y, 26, 24, -13, -16 ]
  28.                 [104, y, 33, 16, -16, -12 ]
  29.                 [143, y, 26, 24, -7, -16 ]
  30.                 [180, y, 8, 29, -3, -16 ]
  31.                 [193, y, 26, 24, -14, -15 ]
  32.                 [224, y, 33, 16, -16, -12 ]
  33.                 [263, y, 26, 24, -7, -16 ]
  34.         }
  35.         template spriteset_template_asymmetric_reversed_moor_gallop_flipped(y) {
  36.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  37.                 [180, y, 8, 29, -3, -16 ]
  38.                 [193, y, 26, 24, -13, -16 ]
  39.                 [224, y, 33, 16, -16, -12 ]
  40.                 [263, y, 26, 24, -7, -16 ]
  41.                 [60, y, 8, 29, -3, -16 ]
  42.                 [73, y, 26, 24, -14, -15 ]
  43.                 [104, y, 33, 16, -16, -12 ]
  44.                 [143, y, 26, 24, -7, -16 ]
  45.         }
  46. // buy menu spriteset template
  47. template spriteset_template_purchase_moor_gallop(y) {
  48.     //[left_x,  upper_y,    width,      height,     offset_x,      offset_y]
  49.     [60,    10, 1, 1, 0, 0]
  50.     [60,    10, 1, 1, 0, 0]
  51.     [107,   10, 1, 1, 0, 0]
  52.     [60,    10, 1, 1, 0, 0]
  53.     [60,    10, 1, 1, 0, 0]
  54.     [60,    10, 1, 1, 0, 0]
  55.     // allow for buffers/couplings being 1px additional to the unit (they overlap in consists, but show in buy menu)
  56.     [360, y, 33, 16, -16, -11 ]
  57.     [60,    10, 1, 1, 0, 0]
  58. }
  59. // default graphics chain
  60.         spriteset(moor_gallop_ss_unreversed_unflipped, "generated/graphics/moor_gallop.png") {
  61.           spriteset_template_asymmetric_unreversed_moor_gallop_unflipped(10 + 0)
  62.         }
  63.             spriteset(moor_gallop_ss_pantographs_down_unreversed_unflipped, "generated/graphics/moor_gallop_pantographs.png") {
  64.               spriteset_template_asymmetric_unreversed_moor_gallop_unflipped(10 + 0)
  65.             }
  66.             spriteset(moor_gallop_ss_pantographs_up_unreversed_unflipped, "generated/graphics/moor_gallop_pantographs.png") {
  67.               spriteset_template_asymmetric_unreversed_moor_gallop_unflipped(40 + 0)
  68.             }
  69.             switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_pantographs_unreversed_unflipped, current_railtype) {
  70.                 ELRL: return moor_gallop_ss_pantographs_up_unreversed_unflipped;
  71.                 return moor_gallop_ss_pantographs_down_unreversed_unflipped;
  72.             }
  73.         switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_vehicle_layers_unreversed_unflipped, getbits(extra_callback_info1, 8, 8)) {
  74.             0: return moor_gallop_ss_unreversed_unflipped;
  75.                 1: return moor_gallop_switch_graphics_pantographs_unreversed_unflipped;
  76.         }
  77.         spriteset(moor_gallop_ss_unreversed_flipped, "generated/graphics/moor_gallop.png") {
  78.           spriteset_template_asymmetric_unreversed_moor_gallop_flipped(10 + 0)
  79.         }
  80.             spriteset(moor_gallop_ss_pantographs_down_unreversed_flipped, "generated/graphics/moor_gallop_pantographs.png") {
  81.               spriteset_template_asymmetric_unreversed_moor_gallop_flipped(10 + 0)
  82.             }
  83.             spriteset(moor_gallop_ss_pantographs_up_unreversed_flipped, "generated/graphics/moor_gallop_pantographs.png") {
  84.               spriteset_template_asymmetric_unreversed_moor_gallop_flipped(40 + 0)
  85.             }
  86.             switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_pantographs_unreversed_flipped, current_railtype) {
  87.                 ELRL: return moor_gallop_ss_pantographs_up_unreversed_flipped;
  88.                 return moor_gallop_ss_pantographs_down_unreversed_flipped;
  89.             }
  90.         switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_vehicle_layers_unreversed_flipped, getbits(extra_callback_info1, 8, 8)) {
  91.             0: return moor_gallop_ss_unreversed_flipped;
  92.                 1: return moor_gallop_switch_graphics_pantographs_unreversed_flipped;
  93.         }
  94.     // handle user flipped state
  95.     switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_unreversed, vehicle_is_flipped) {
  96.         1: return moor_gallop_switch_graphics_vehicle_layers_unreversed_flipped;
  97.         return moor_gallop_switch_graphics_vehicle_layers_unreversed_unflipped;
  98.     }
  99. random_switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_vehicle) {
  100.         1: return moor_gallop_switch_graphics_unreversed;
  101. }
  102. // buy menu graphics chain
  103. spriteset(moor_gallop_ss_purchase, "generated/graphics/moor_gallop.png") {
  104.   spriteset_template_purchase_moor_gallop(10)
  105. }
  106. switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_purchase, 0) {
  107.     return moor_gallop_ss_purchase;
  108. }
  109. switch (FEAT_TRAINS, SELF, moor_gallop_switch_set_layers_register_more_sprites, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
  110.     return moor_gallop_switch_graphics_vehicle;
  111. }
  112. switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_rear_light, position_in_consist_from_end) {
  113.     0: return ss_rear_light_32px;
  114.     return ss_rear_light_empty;
  115. }
  116. switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics_layer_rear_light, STORE_TEMP(PALETTE_USE_DEFAULT, 0x100)) {
  117.     return moor_gallop_switch_graphics_rear_light;
  118. }
  119. switch (FEAT_TRAINS, SELF, moor_gallop_switch_graphics, getbits(extra_callback_info1, 8, 8)) {
  120.     0: return moor_gallop_switch_set_layers_register_more_sprites;
  121.         1: return moor_gallop_switch_set_layers_register_more_sprites;
  122.     return moor_gallop_switch_graphics_layer_rear_light;
  123. }
  124.     // -- smoke etc -- //
  125.     switch (FEAT_TRAINS, SELF, moor_gallop_switch_visual_effect_and_powered_by_variant_unreversed, current_railtype) {
  126.         return visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 0, DISABLE_WAGON_POWER);
  127.     }
  128. item(FEAT_TRAINS, moor_gallop, 170) {
  129.     property {
  130.         name:                           string(STR_NAME_CONSIST_PARENTHESES, string(STR_NAME_moor_gallop), string(STR_NAME_SUFFIX_ELECTRIC));
  131.         climates_available:             NO_CLIMATE; // nml constant
  132.         engine_class:                   ENGINE_CLASS_ELECTRIC;
  133.         visual_effect_and_powered:      visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
  134.         introduction_date:              date(1935,01,01); // consist just supplies intro year - openttd randomises intro dates a bit anyway
  135.         cargo_capacity:                 0;
  136.         sprite_id:                      SPRITE_ID_NEW_TRAIN; //enable new graphics - nml constant
  137.         power:                          2400hp;
  138.             speed:                          90mph;
  139.         weight:                         105ton;
  140.         tractive_effort_coefficient:    0.25;
  141.         cost_factor:                    0; // use the CB to set this, the prop is capped to max 255, cb is 32k
  142.         running_cost_base:              RUNNING_COST_ELECTRIC;
  143.         running_cost_factor:            0; // use the CB to set this, the prop is capped to max 255, cb is 32k
  144.         refit_cost:                     0; // btw this needs to be 0 if we want autorefit without using cb
  145.         refittable_cargo_classes:       bitmask();
  146.         non_refittable_cargo_classes:   bitmask(); // don't set non-refittable classes, increases likelihood of breaking cargo support
  147.         cargo_allow_refit:              [];
  148.         cargo_disallow_refit:           [];
  149.         cargo_age_period:               185;
  150.         misc_flags:                     bitmask(TRAIN_FLAG_2CC,TRAIN_FLAG_SPRITE_STACK,TRAIN_FLAG_AUTOREFIT); // nml constants
  151.         dual_headed:                    0;
  152.         model_life:                     30;
  153.         retire_early:                   -10;
  154.         reliability_decay:              20; // default value
  155.         vehicle_life:                   40;
  156.         length:                         8;
  157.         track_type:                     ELRL;
  158.     }
  159.     graphics {
  160.         default:                        moor_gallop_switch_graphics;
  161.         purchase:                       moor_gallop_switch_graphics_purchase;
  162.         cost_factor:                    97; // CB used as it is capped to max 32k, prop is only 255
  163.         running_cost_factor:            70; // CB used as it is capped to max 32k, prop is only 255
  164.             visual_effect_and_powered:      moor_gallop_switch_visual_effect_and_powered_by_variant_unreversed;
  165.     }
  166. }
  167.     if (param[1]==0) {
  168.         item(FEAT_TRAINS, moor_gallop, 170) {
  169.             property {
  170.                 climates_available:             ALL_CLIMATES;
  171.             }
  172.         }
  173.     }
  174. // -- end 170 --

Comments