Loading

Paste #pdos9yayf

  1. // default spriteset templates
  2.         template spriteset_template_asymmetric_unreversed_wizzo_unflipped(y) {
  3.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  4.                 [60, y, 8, 29, -3, -20 ]
  5.                 [73, y, 26, 24, -10, -17 ]
  6.                 [104, y, 33, 16, -16, -12 ]
  7.                 [143, y, 26, 24, -4, -15 ]
  8.                 [180, y, 8, 29, -3, -13 ]
  9.                 [193, y, 26, 24, -17, -14 ]
  10.                 [224, y, 33, 16, -16, -12 ]
  11.                 [263, y, 26, 24, -10, -18 ]
  12.         }
  13.         template spriteset_template_asymmetric_reversed_wizzo_unflipped(y) {
  14.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  15.                 [180, y, 8, 29, -3, -20 ]
  16.                 [193, y, 26, 24, -10, -17 ]
  17.                 [224, y, 33, 16, -16, -12 ]
  18.                 [263, y, 26, 24, -4, -15 ]
  19.                 [60, y, 8, 29, -3, -13 ]
  20.                 [73, y, 26, 24, -17, -14 ]
  21.                 [104, y, 33, 16, -16, -12 ]
  22.                 [143, y, 26, 24, -10, -18 ]
  23.         }
  24.         template spriteset_template_asymmetric_unreversed_wizzo_flipped(y) {
  25.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  26.                 [60, y, 8, 29, -3, -13 ]
  27.                 [73, y, 26, 24, -17, -14 ]
  28.                 [104, y, 33, 16, -16, -12 ]
  29.                 [143, y, 26, 24, -10, -18 ]
  30.                 [180, y, 8, 29, -3, -20 ]
  31.                 [193, y, 26, 24, -10, -17 ]
  32.                 [224, y, 33, 16, -16, -12 ]
  33.                 [263, y, 26, 24, -4, -15 ]
  34.         }
  35.         template spriteset_template_asymmetric_reversed_wizzo_flipped(y) {
  36.                 //[left_x, upper_y, width, height, offset_x, offset_y]
  37.                 [180, y, 8, 29, -3, -13 ]
  38.                 [193, y, 26, 24, -17, -14 ]
  39.                 [224, y, 33, 16, -16, -12 ]
  40.                 [263, y, 26, 24, -10, -18 ]
  41.                 [60, y, 8, 29, -3, -20 ]
  42.                 [73, y, 26, 24, -10, -17 ]
  43.                 [104, y, 33, 16, -16, -12 ]
  44.                 [143, y, 26, 24, -4, -15 ]
  45.         }
  46. // buy menu spriteset template
  47. template spriteset_template_purchase_wizzo(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.     [224, y, 33, 16, -16, -11 ]
  57.     [60,    10, 1, 1, 0, 0]
  58. }
  59. // default graphics chain
  60.         spriteset(wizzo_ss_unreversed_unflipped, "generated/graphics/wizzo.png") {
  61.           spriteset_template_asymmetric_unreversed_wizzo_unflipped(10 + 0)
  62.         }
  63.         spritegroup wizzo_sg_unreversed_unflipped {
  64.             loaded:  [
  65.                 wizzo_ss_unreversed_unflipped,
  66.             ];
  67.             loading: [
  68.                 wizzo_ss_unreversed_unflipped,
  69.             ];
  70.         }
  71.         spriteset(wizzo_ss_unreversed_flipped, "generated/graphics/wizzo.png") {
  72.           spriteset_template_asymmetric_unreversed_wizzo_flipped(10 + 0)
  73.         }
  74.         spritegroup wizzo_sg_unreversed_flipped {
  75.             loaded:  [
  76.                 wizzo_ss_unreversed_flipped,
  77.             ];
  78.             loading: [
  79.                 wizzo_ss_unreversed_flipped,
  80.             ];
  81.         }
  82.     // handle user flipped state
  83.     switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_unreversed, vehicle_is_flipped) {
  84.         1: return wizzo_sg_unreversed_flipped;
  85.         return wizzo_sg_unreversed_unflipped;
  86.     }
  87. random_switch (FEAT_TRAINS, FORWARD_SELF(0), wizzo_switch_graphics_vehicle) {
  88.         1: return wizzo_switch_graphics_unreversed;
  89. }
  90. switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layer_vehicle, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
  91.     return wizzo_switch_graphics_vehicle;
  92. }
  93. switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layer_rear_light, STORE_TEMP(PALETTE_USE_DEFAULT, 0x100)) {
  94.     return ss_rear_light_32px;
  95. }
  96. switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layers, getbits(extra_callback_info1, 8, 8)) {
  97.     0: return wizzo_switch_graphics_layer_vehicle;
  98.     return wizzo_switch_graphics_layer_rear_light;
  99. }
  100. switch (FEAT_TRAINS, SELF, wizzo_switch_graphics, 0) {
  101.     0: return wizzo_switch_graphics_layers;
  102.     return wizzo_switch_graphics_layers;
  103. }
  104. // buy menu graphics chain
  105. spriteset(wizzo_ss_purchase, "generated/graphics/wizzo.png") {
  106.   spriteset_template_purchase_wizzo(10)
  107. }
  108. spritegroup wizzo_sg_purchase {
  109.     loaded:  [
  110.         wizzo_ss_purchase,
  111.     ];
  112.     loading: [
  113.         wizzo_ss_purchase,
  114.     ];
  115. }
  116. switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_purchase, 0) {
  117.     return wizzo_sg_purchase;
  118. }
  119.     // -- smoke etc -- //
  120.     switch (FEAT_TRAINS, SELF, wizzo_switch_visual_effect_and_powered_by_variant_unreversed, current_railtype) {
  121.         return visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 0, DISABLE_WAGON_POWER);
  122.     }
  123. item(FEAT_TRAINS, wizzo, 420) {
  124.     property {
  125.         name:                           string(STR_NAME_CONSIST, string(STR_NAME_wizzo), string(STR_NAME_SUFFIX_DIESEL));
  126.         climates_available:             NO_CLIMATE; // nml constant
  127.         engine_class:                   ENGINE_CLASS_DIESEL;
  128.         visual_effect_and_powered:      visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
  129.         introduction_date:              date(1960,01,01); // consist just supplies intro year - openttd randomises intro dates a bit anyway
  130.         cargo_capacity:                 0;
  131.         sprite_id:                      SPRITE_ID_NEW_TRAIN; //enable new graphics - nml constant
  132.         power:                          2200hp;
  133.             speed:                          110mph;
  134.         weight:                         80ton;
  135.         tractive_effort_coefficient:    0.3;
  136.         cost_factor:                    134.5;
  137.         running_cost_base:              RUNNING_COST_DIESEL;
  138.         running_cost_factor:            134.5;
  139.         refit_cost:                     0; // btw this needs to be 0 if we want autorefit without using cb
  140.         refittable_cargo_classes:       bitmask();
  141.         non_refittable_cargo_classes:   bitmask(); // don't set non-refittable classes, increases likelihood of breaking cargo support
  142.         cargo_allow_refit:              [];
  143.         cargo_disallow_refit:           [];
  144.         cargo_age_period:               185;
  145.         misc_flags:                     bitmask(TRAIN_FLAG_2CC,TRAIN_FLAG_SPRITE_STACK,TRAIN_FLAG_AUTOREFIT); // nml constants
  146.         dual_headed:                    0;
  147.         model_life:                     30;
  148.         retire_early:                   -10;
  149.         reliability_decay:              20; // default value
  150.         vehicle_life:                   40;
  151.         length:                         8;
  152.         track_type:                     RAIL;
  153.     }
  154.     graphics {
  155.         default:                        wizzo_switch_graphics;
  156.         purchase:                       wizzo_switch_graphics_purchase;
  157.             visual_effect_and_powered:      wizzo_switch_visual_effect_and_powered_by_variant_unreversed;
  158.     }
  159. }
  160.     if (param[1]==0) {
  161.         item(FEAT_TRAINS, wizzo, 420) {
  162.             property {
  163.                 climates_available:             ALL_CLIMATES;
  164.             }
  165.         }
  166.     }
  167. // -- end 420 --

Comments