- // default spriteset templates
- template spriteset_template_asymmetric_unreversed_wizzo_unflipped(y) {
- //[left_x, upper_y, width, height, offset_x, offset_y]
- [60, y, 8, 29, -3, -20 ]
- [73, y, 26, 24, -10, -17 ]
- [104, y, 33, 16, -16, -12 ]
- [143, y, 26, 24, -4, -15 ]
- [180, y, 8, 29, -3, -13 ]
- [193, y, 26, 24, -17, -14 ]
- [224, y, 33, 16, -16, -12 ]
- [263, y, 26, 24, -10, -18 ]
- }
- template spriteset_template_asymmetric_reversed_wizzo_unflipped(y) {
- //[left_x, upper_y, width, height, offset_x, offset_y]
- [180, y, 8, 29, -3, -20 ]
- [193, y, 26, 24, -10, -17 ]
- [224, y, 33, 16, -16, -12 ]
- [263, y, 26, 24, -4, -15 ]
- [60, y, 8, 29, -3, -13 ]
- [73, y, 26, 24, -17, -14 ]
- [104, y, 33, 16, -16, -12 ]
- [143, y, 26, 24, -10, -18 ]
- }
- template spriteset_template_asymmetric_unreversed_wizzo_flipped(y) {
- //[left_x, upper_y, width, height, offset_x, offset_y]
- [60, y, 8, 29, -3, -13 ]
- [73, y, 26, 24, -17, -14 ]
- [104, y, 33, 16, -16, -12 ]
- [143, y, 26, 24, -10, -18 ]
- [180, y, 8, 29, -3, -20 ]
- [193, y, 26, 24, -10, -17 ]
- [224, y, 33, 16, -16, -12 ]
- [263, y, 26, 24, -4, -15 ]
- }
- template spriteset_template_asymmetric_reversed_wizzo_flipped(y) {
- //[left_x, upper_y, width, height, offset_x, offset_y]
- [180, y, 8, 29, -3, -13 ]
- [193, y, 26, 24, -17, -14 ]
- [224, y, 33, 16, -16, -12 ]
- [263, y, 26, 24, -10, -18 ]
- [60, y, 8, 29, -3, -20 ]
- [73, y, 26, 24, -10, -17 ]
- [104, y, 33, 16, -16, -12 ]
- [143, y, 26, 24, -4, -15 ]
- }
- // buy menu spriteset template
- template spriteset_template_purchase_wizzo(y) {
- //[left_x, upper_y, width, height, offset_x, offset_y]
- [60, 10, 1, 1, 0, 0]
- [60, 10, 1, 1, 0, 0]
- [107, 10, 1, 1, 0, 0]
- [60, 10, 1, 1, 0, 0]
- [60, 10, 1, 1, 0, 0]
- [60, 10, 1, 1, 0, 0]
- // allow for buffers/couplings being 1px additional to the unit (they overlap in consists, but show in buy menu)
- [224, y, 33, 16, -16, -11 ]
- [60, 10, 1, 1, 0, 0]
- }
- // default graphics chain
- spriteset(wizzo_ss_unreversed_unflipped, "generated/graphics/wizzo.png") {
- spriteset_template_asymmetric_unreversed_wizzo_unflipped(10 + 0)
- }
- spritegroup wizzo_sg_unreversed_unflipped {
- loaded: [
- wizzo_ss_unreversed_unflipped,
- ];
- loading: [
- wizzo_ss_unreversed_unflipped,
- ];
- }
- spriteset(wizzo_ss_unreversed_flipped, "generated/graphics/wizzo.png") {
- spriteset_template_asymmetric_unreversed_wizzo_flipped(10 + 0)
- }
- spritegroup wizzo_sg_unreversed_flipped {
- loaded: [
- wizzo_ss_unreversed_flipped,
- ];
- loading: [
- wizzo_ss_unreversed_flipped,
- ];
- }
- // handle user flipped state
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_unreversed, vehicle_is_flipped) {
- 1: return wizzo_sg_unreversed_flipped;
- return wizzo_sg_unreversed_unflipped;
- }
- random_switch (FEAT_TRAINS, FORWARD_SELF(0), wizzo_switch_graphics_vehicle) {
- 1: return wizzo_switch_graphics_unreversed;
- }
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layer_vehicle, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
- return wizzo_switch_graphics_vehicle;
- }
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layer_rear_light, STORE_TEMP(PALETTE_USE_DEFAULT, 0x100)) {
- return ss_rear_light_32px;
- }
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_layers, getbits(extra_callback_info1, 8, 8)) {
- 0: return wizzo_switch_graphics_layer_vehicle;
- return wizzo_switch_graphics_layer_rear_light;
- }
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics, 0) {
- 0: return wizzo_switch_graphics_layers;
- return wizzo_switch_graphics_layers;
- }
- // buy menu graphics chain
- spriteset(wizzo_ss_purchase, "generated/graphics/wizzo.png") {
- spriteset_template_purchase_wizzo(10)
- }
- spritegroup wizzo_sg_purchase {
- loaded: [
- wizzo_ss_purchase,
- ];
- loading: [
- wizzo_ss_purchase,
- ];
- }
- switch (FEAT_TRAINS, SELF, wizzo_switch_graphics_purchase, 0) {
- return wizzo_sg_purchase;
- }
- // -- smoke etc -- //
- switch (FEAT_TRAINS, SELF, wizzo_switch_visual_effect_and_powered_by_variant_unreversed, current_railtype) {
- return visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 0, DISABLE_WAGON_POWER);
- }
- item(FEAT_TRAINS, wizzo, 420) {
- property {
- name: string(STR_NAME_CONSIST, string(STR_NAME_wizzo), string(STR_NAME_SUFFIX_DIESEL));
- climates_available: NO_CLIMATE; // nml constant
- engine_class: ENGINE_CLASS_DIESEL;
- visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
- introduction_date: date(1960,01,01); // consist just supplies intro year - openttd randomises intro dates a bit anyway
- cargo_capacity: 0;
- sprite_id: SPRITE_ID_NEW_TRAIN; //enable new graphics - nml constant
- power: 2200hp;
- speed: 110mph;
- weight: 80ton;
- tractive_effort_coefficient: 0.3;
- cost_factor: 134.5;
- running_cost_base: RUNNING_COST_DIESEL;
- running_cost_factor: 134.5;
- refit_cost: 0; // btw this needs to be 0 if we want autorefit without using cb
- refittable_cargo_classes: bitmask();
- non_refittable_cargo_classes: bitmask(); // don't set non-refittable classes, increases likelihood of breaking cargo support
- cargo_allow_refit: [];
- cargo_disallow_refit: [];
- cargo_age_period: 185;
- misc_flags: bitmask(TRAIN_FLAG_2CC,TRAIN_FLAG_SPRITE_STACK,TRAIN_FLAG_AUTOREFIT); // nml constants
- dual_headed: 0;
- model_life: 30;
- retire_early: -10;
- reliability_decay: 20; // default value
- vehicle_life: 40;
- length: 8;
- track_type: RAIL;
- }
- graphics {
- default: wizzo_switch_graphics;
- purchase: wizzo_switch_graphics_purchase;
- visual_effect_and_powered: wizzo_switch_visual_effect_and_powered_by_variant_unreversed;
- }
- }
- if (param[1]==0) {
- item(FEAT_TRAINS, wizzo, 420) {
- property {
- climates_available: ALL_CLIMATES;
- }
- }
- }
- // -- end 420 --