// buy menu spriteset template
template spriteset_template_purchase_vehicle_transporter_car_pony_gen_5C(y) {
//[left_x, upper_y, width, height, offset_x, offset_y]
[60, 10, 1, 1, 0, 0]
[60, 10, 1, 1, 0, 0]
[60, 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]
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_empty_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(10)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_0_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(40)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_0_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(70)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_1_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(100)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_1_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(130)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_2_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(160)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_2_unflipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_unflipped(190)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_empty_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(10)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_0_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(40)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_0_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(70)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_1_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(100)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_1_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(130)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loading_2_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(160)
}
spriteset(vehicle_transporter_car_pony_gen_5C_ss_loaded_2_flipped, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_symmetric_unreversed_8_8_flipped(190)
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_0_unflipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_unflipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_0_unflipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_0_unflipped;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_0_flipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_flipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_0_flipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_0_flipped;
}
// handle user flipped state
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_0, vehicle_is_flipped) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_0_flipped;
return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_0_unflipped;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_1_unflipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_unflipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_1_unflipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_1_unflipped;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_1_flipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_flipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_1_flipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_1_flipped;
}
// handle user flipped state
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_1, vehicle_is_flipped) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_1_flipped;
return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_1_unflipped;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_2_unflipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_unflipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_2_unflipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_2_unflipped;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_2_flipped, cargo_count*100/cargo_capacity) {
0: return vehicle_transporter_car_pony_gen_5C_ss_empty_flipped;
1..99: return vehicle_transporter_car_pony_gen_5C_ss_loading_2_flipped;
return vehicle_transporter_car_pony_gen_5C_ss_loaded_2_flipped;
}
// handle user flipped state
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_2, vehicle_is_flipped) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_2_flipped;
return vehicle_transporter_car_pony_gen_5C_switch_graphics_percent_loaded_2_unflipped;
}
random_switch (FEAT_TRAINS, SELF,vehicle_transporter_car_pony_gen_5C_switch_graphics_ENSP, bitmask(TRIGGER_VEHICLE_NEW_LOAD)) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_2;
}
random_switch (FEAT_TRAINS, SELF,vehicle_transporter_car_pony_gen_5C_switch_graphics_FMSP, bitmask(TRIGGER_VEHICLE_NEW_LOAD)) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_1;
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_2;
}
random_switch (FEAT_TRAINS, SELF,vehicle_transporter_car_pony_gen_5C_switch_graphics_VEHI, bitmask(TRIGGER_VEHICLE_NEW_LOAD)) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_2;
}
random_switch (FEAT_TRAINS, SELF,vehicle_transporter_car_pony_gen_5C_switch_graphics_generic_cargos, bitmask(TRIGGER_VEHICLE_NEW_LOAD)) {
1: return vehicle_transporter_car_pony_gen_5C_switch_graphics_flip_0;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_vehicle, cargo_type_in_veh) {
ENSP: return vehicle_transporter_car_pony_gen_5C_switch_graphics_ENSP;
FMSP: return vehicle_transporter_car_pony_gen_5C_switch_graphics_FMSP;
VEHI: return vehicle_transporter_car_pony_gen_5C_switch_graphics_VEHI;
return vehicle_transporter_car_pony_gen_5C_switch_graphics_generic_cargos;
}
// buy menu graphics chain
spriteset(vehicle_transporter_car_pony_gen_5C_ss_purchase, "generated/graphics/vehicle_transporter_car_pony_gen_5C.png") {
spriteset_template_purchase_vehicle_transporter_car_pony_gen_5C(10)
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_purchase, 0) {
return vehicle_transporter_car_pony_gen_5C_ss_purchase;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_set_layers_register_more_sprites, STORE_TEMP(CB_FLAG_MORE_SPRITES | PALETTE_USE_DEFAULT, 0x100)) {
return vehicle_transporter_car_pony_gen_5C_switch_graphics_vehicle;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_rear_light, position_in_consist_from_end) {
0: return ss_rear_light_32px;
return ss_rear_light_empty;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics_layer_rear_light, STORE_TEMP(PALETTE_USE_DEFAULT, 0x100)) {
return vehicle_transporter_car_pony_gen_5C_switch_graphics_rear_light;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_graphics, getbits(extra_callback_info1, 8, 8)) {
0: return vehicle_transporter_car_pony_gen_5C_switch_set_layers_register_more_sprites;
return vehicle_transporter_car_pony_gen_5C_switch_graphics_layer_rear_light;
}
random_switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_colour_mapping_flipped) {
1: return base_sprite_2cc + 16 * company_colour2 + company_colour1;
1: return base_sprite_2cc + 16 * company_colour1 + company_colour2;
}
random_switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_colour_mapping_unflipped) {
1: return base_sprite_2cc + 16 * company_colour1 + company_colour2;
1: return base_sprite_2cc + 16 * company_colour2 + company_colour1;
}
// handle user flipped state
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_colour_mapping, vehicle_is_flipped) {
1: return vehicle_transporter_car_pony_gen_5C_switch_colour_mapping_flipped;
return vehicle_transporter_car_pony_gen_5C_switch_colour_mapping_unflipped;
}
// -- capacity determined according to specific labels that might need to be handled, and otherwise cargo class -- //
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_0, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_MAIL): return 66;
bitmask(CC_ARMOURED): return 66;
return 33;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_1, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_MAIL): return 96;
bitmask(CC_ARMOURED): return 96;
return 48;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_2, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_MAIL): return 128;
bitmask(CC_ARMOURED): return 128;
return 64;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity, param[0]) {
0: vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_0;
1: vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_1;
2: vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity_by_cargo_2;
}
// -- loading speed also determined by capacity, which varies by cargo -- //
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_0, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_PASSENGERS): return 6;
bitmask(CC_MAIL): return 6;
bitmask(CC_ARMOURED): return 6;
return 6;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_1, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_PASSENGERS): return 8;
bitmask(CC_MAIL): return 8;
bitmask(CC_ARMOURED): return 8;
return 8;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_2, cargo_classes & bitmask(CC_PASSENGERS, CC_MAIL, CC_ARMOURED)) {
bitmask(CC_PASSENGERS): return 11;
bitmask(CC_MAIL): return 11;
bitmask(CC_ARMOURED): return 11;
return 11;
}
switch (FEAT_TRAINS, SELF, vehicle_transporter_car_pony_gen_5C_switch_loading_speed, param[0]) {
0: vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_0;
1: vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_1;
2: vehicle_transporter_car_pony_gen_5C_switch_loading_speed_by_cargo_2;
}
item(FEAT_TRAINS, vehicle_transporter_car_pony_gen_5C, 3570) {
property {
name: string(STR_NAME_CONSIST_PARENTHESES, string(STR_NAME_SUFFIX_VEHICLE_TRANSPORTER_CAR), string(STR_NAME_SUFFIX_LARGE));
climates_available: NO_CLIMATE; // nml constant
engine_class: ENGINE_CLASS_STEAM;
visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
introduction_date: date(1990, 11, 1);
cargo_capacity: 48;
sprite_id: SPRITE_ID_NEW_TRAIN; //enable new graphics - nml constant
power: 0hp;
speed: 87mph;
weight: 21ton;
tractive_effort_coefficient: 0.3;
cost_factor: 0; // use the CB to set this, the prop is capped to max 255, cb is 32k
running_cost_base: RUNNING_COST_DIESEL;
running_cost_factor: 0; // use the CB to set this, the prop is capped to max 255, cb is 32k
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: [VEHI,ENSP,FMSP];
cargo_disallow_refit: [];
cargo_age_period: 185;
default_cargo_type: VEHI;
misc_flags: bitmask(TRAIN_FLAG_2CC,TRAIN_FLAG_SPRITE_STACK,TRAIN_FLAG_FLIP,TRAIN_FLAG_AUTOREFIT); // nml constants
model_life: VEHICLE_NEVER_EXPIRES;
retire_early: -10;
reliability_decay: 20; // default value
vehicle_life: 40;
length: 8;
track_type: RAIL;
}
graphics {
default: vehicle_transporter_car_pony_gen_5C_switch_graphics;
purchase: vehicle_transporter_car_pony_gen_5C_switch_graphics_purchase;
cost_factor: 144; // CB used as it is capped to max 32k, prop is only 255
running_cost_factor: 374; // CB used as it is capped to max 32k, prop is only 255
colour_mapping: vehicle_transporter_car_pony_gen_5C_switch_colour_mapping;
cargo_capacity: vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity;
purchase_cargo_capacity: vehicle_transporter_car_pony_gen_5C_switch_cargo_capacity;
loading_speed: vehicle_transporter_car_pony_gen_5C_switch_loading_speed;
}
}
if (param[1]==0) {
item(FEAT_TRAINS, vehicle_transporter_car_pony_gen_5C, 3570) {
property {
climates_available: ALL_CLIMATES;
}
}
}
// -- end 3570 --