Loading

layers recolour

  1.  
  2. switch (FEAT_TRAINS,SELF, switch_mglv_hopper_layers, [
  3.   STORE_TEMP((getbits(extra_callback_info1, 8, 8) < 4 ? CB_FLAG_MORE_SPRITES  : 0) + PALETTE_USE_DEFAULT, 0x100),
  4.   getbits(extra_callback_info1, 8, 8)
  5.   ]){
  6.   0: spritegroup_maglevhopper_wagon_layer;
  7.   1: spritegroup_maglevhopper_cargo_layer;
  8.   //return spritegroup_maglevhopper_cargo_layer;
  9. }
  10. switch (FEAT_TRAINS,SELF, switch_mglv_hopper_layers_colouring, getbits(extra_callback_info1, 8, 8)){
  11.   0: base_sprite_2cc + 3 + 16 * company_colour2;//CC yellow
  12.     1: base_sprite_2cc + 4 + 16 * company_colour2;//CC red
  13.     3: base_sprite_2cc + 11 + 16 * company_colour2;//CC purple
  14.     4: base_sprite_2cc + 6 + 16 * company_colour2;//CC green
  15. }
  16.  
  17. //ARTICULATION
  18. switch (FEAT_TRAINS, SELF, switch_maglevhopper_articulated, extra_callback_info1){
  19. 1: return item_maglevhopper;
  20. return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
  21. }
  22.  
  23. item(FEAT_TRAINS, item_maglevhopper, 621) { //ID621
  24.     property {
  25.         name:                         string(STR_NAME_MGLVHOPPER);
  26.         climates_available:           ALL_CLIMATES;
  27.         introduction_date:            date(1997, 1, 1);
  28.         model_life:                   VEHICLE_NEVER_EXPIRES;
  29.         vehicle_life:                 255;
  30.         reliability_decay:            5;
  31.         refittable_cargo_classes:     bitmask(CC_BULK, CC_COVERED);
  32.         non_refittable_cargo_classes: bitmask(CC_REFRIGERATED);
  33.  
  34.                 cargo_allow_refit:            [RUBR, FMSP];
  35.                 cargo_disallow_refit:         [WDPR, FRUT, BDMT, PLST, LUMB];
  36.                 default_cargo_type:           COAL;
  37.                 loading_speed:                5;
  38.         cost_factor:                  10;
  39.         running_cost_factor:          0;
  40.         sprite_id:                    SPRITE_ID_NEW_TRAIN;
  41.         speed:                        0;
  42.         misc_flags:                   bitmask(TRAIN_FLAG_SPRITE_STACK, TRAIN_FLAG_TILT, TRAIN_FLAG_FLIP, TRAIN_FLAG_2CC);
  43.         refit_cost:                   0;
  44.         track_type:                   MGLV;
  45.         ai_special_flag:              AI_FLAG_CARGO;
  46.         power:                        0;
  47.         running_cost_base:            RUNNING_COST_NONE;
  48.         dual_headed:                  0;
  49.         cargo_capacity:               10;
  50.         weight:                       40 ton;
  51.         ai_engine_rank:               0;
  52.         extra_power_per_wagon:        0 kW;
  53.         tractive_effort_coefficient:  0;
  54.         air_drag_coefficient:         0;
  55.         length: 4;
  56.         visual_effect_and_powered:    visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
  57.         extra_weight_per_wagon:       0 ton;
  58.         bitmask_vehicle_info:         0;
  59.     }
  60.     graphics {
  61.         default: switch_mglv_hopper_layers;//switch_mglv_freight_short_graphics_decider;
  62.         additional_text: string(STR_MAGLEVWAGON);
  63.         purchase: spriteset_purchaseMenu_maghopper;
  64.         articulated_part: switch_maglevhopper_articulated;
  65.         cargo_capacity:   switch_capacity_maglevuniversal;
  66.         purchase_cargo_capacity:   11;
  67.         loading_speed:      4;
  68.         cost_factor:        40;
  69.         //weight:               switch_weight_global;
  70.         weight:             40;
  71.         colour_mapping: switch_mglv_hopper_layers_colouring;//RAINBOWWAGONS_enginecheck;
  72.         purchase_colour_mapping: CB_FAILED;
  73.     }
  74. }
  75. if (param_wagons == 0) {
  76.     item(FEAT_TRAINS, item_maglevhopper, 621) {
  77.         property {
  78.         climates_available: NO_CLIMATE;
  79.         }
  80.     }
  81. } else  {
  82.     item(FEAT_TRAINS, item_maglevhopper, 621) {
  83.         property {
  84.         climates_available: ALL_CLIMATES;
  85.         }
  86.     }
  87. }

Comments