Skip to content

Commit

Permalink
Added Class 810, re-added Class 805 (now running on National Rail net…
Browse files Browse the repository at this point in the history
…work)
  • Loading branch information
audigex committed Mar 24, 2024
1 parent 192ed56 commit 309bacb
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 3 deletions.
Binary file modified gfx/BR80X.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ STR_BR801_9CAR :British Rail Class 801/2 (9-Car)
STR_BR802_5CAR :British Rail Class 802/0/2/3 (5-Car)
STR_BR802_9CAR :British Rail Class 802/1 (9-Car)
STR_BR803_5CAR :British Rail Class 803 (5-car)
STR_BR805 :British Rail Class 805 (5-car)
STR_BR805_5CAR :British Rail Class 805 (5-car)
STR_BR807 :British Rail Class 807 (7-car)
STR_BR810_5CAR :British Rail Class 810 (5-car)


# Livery Names
STR_LIVERY_BR800_LNER : LNER 'Azuma'
STR_LIVERY_BR800_TPE : Transpennine Express 'Nova 1'
STR_LIVERY_BR800_HullTrains : Hull Trains 'Paragon'
STR_LIVERY_BR800_AVANTI : Avanti West Coast 'AT300'
STR_LIVERY_BR800_VTEC : Virgin Trains East Coast
STR_LIVERY_BR800_Lumo : Lumo

Expand Down Expand Up @@ -161,8 +161,9 @@ STR_DSC_BR801 :Type: {BLUE}Electric Multiple Unit{}{BLAC
STR_DSC_BR802_5CAR :Type: {RED}Diesel{BLACK}-{BLUE}Electric {PURPLE}Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Great Western Railway, Transpennine Express, Hull Trains
STR_DSC_BR802_9CAR :Type: {RED}Diesel{BLACK}-{BLUE}Electric {PURPLE}Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Great Western Railway
STR_DSC_BR803 :Type: {BLUE}Electric Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Lumo
STR_DSC_BR805 :Type: {RED}Diesel{BLACK}-{BLUE}Electric {PURPLE}Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Avanti West Coast
STR_DSC_BR805_5CAR :Type: {RED}Diesel{BLACK}-{BLUE}Electric {PURPLE}Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Avanti West Coast
STR_DSC_BR807 :Type: {BLUE}Electric Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}Avanti West Coast
STR_DSC_BR810_5CAR :Type: {RED}Diesel{BLACK}-{BLUE}Electric {PURPLE}Multiple Unit{}{BLACK}Usage: {GOLD}Express Passenger{}{BLACK}Withdrawal: {GOLD}--{}{BLACK}Liveries: {GOLD}East Midland Railway

str_purchase_loco_with_liveries :{BLACK}Type: {STRING}{}{BLACK}Route Availability: {GOLD}{STRING}{}{BLACK}Usage: {GOLD}{STRING}{}{BLACK}Withdrawal: {GOLD}{STRING}{}{BLACK}Liveries: {GOLD}{STRING}{BLACK}
str_purchase_loco :{BLACK}Type: {STRING}{}{BLACK}Route Availability: {GOLD}{STRING}{}{BLACK}Usage: {GOLD}{STRING}{}{BLACK}Withdrawal: {GOLD}{STRING}{}{BLACK}
Expand Down
2 changes: 2 additions & 0 deletions src/sortpurchase.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ sort(FEAT_TRAINS, [
item_BR802_5car,
item_BR802_9car,
item_BR803_5car,
item_BR805_5car,
item_BR810_5car,
item_DR98_9,
item_LU1938,
item_LUAStock,
Expand Down
34 changes: 34 additions & 0 deletions src/trains/_spriteset/EMU_Sprites/800.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ spriteset(spriteset_BR802_purchase, "gfx/BR80X.png") {
spriteset(spriteset_BR803_purchase, "gfx/BR80X.png") {
template_purchase(200, 26)
}
spriteset(spriteset_BR805_807_purchase, "gfx/BR80X.png") {
template_purchase(200, 52)
}
spriteset(spriteset_BR810_purchase, "gfx/BR80X.png") {
template_purchase(200, 65)
}



Expand Down Expand Up @@ -96,6 +102,34 @@ spriteset(spriteset_BR80X_rear_GWRPride, "gfx/BR80X.png") {
template_train32px(0, 575)
}

spriteset(spriteset_BR80X_front_Hitachi, "gfx/BR80X.png") {
template_train32px(0, 600)
}
spriteset(spriteset_BR80X_middle_Hitachi, "gfx/BR80X.png") {
template_train32px(0, 625)
}
spriteset(spriteset_BR80X_rear_Hitachi, "gfx/BR80X.png") {
template_train32px(0, 650)
}

spriteset(spriteset_BR80X_front_Avanti, "gfx/BR80X.png") {
template_train32px(0, 675)
}
spriteset(spriteset_BR80X_middle_Avanti, "gfx/BR80X.png") {
template_train32px(0, 700)
}
spriteset(spriteset_BR80X_rear_Avanti, "gfx/BR80X.png") {
template_train32px(0, 725)
}
spriteset(spriteset_BR80X_middle2_Avanti, "gfx/BR80X.png") {
template_train32px(0, 750)
}
spriteset(spriteset_BR80X_middle3_Avanti, "gfx/BR80X.png") {
template_train32px(0, 775)
}



// Speed switch
switch(FEAT_TRAINS, SELF, switch_BR800_speed, param_max_speed) {
0: 201;
Expand Down
121 changes: 121 additions & 0 deletions src/trains/bmu/805_5car.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Livery callbacks
switch(FEAT_TRAINS, SELF, switch_BR805_5car_spriteset_Avanti, position_in_articulated_veh % 5) {
0: spriteset_BR80X_front_Avanti;
1: spriteset_BR80X_middle_Avanti;
2: spriteset_BR80X_middle_Avanti;
3: spriteset_BR80X_middle_Avanti;
4: spriteset_BR80X_rear_Avanti;
}

// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_BR805_5car_spriteset, cargo_subtype) {
0: switch_BR805_5car_spriteset_Avanti;
}

switch(FEAT_TRAINS, SELF, switch_BR805_5car_subtype_text, cargo_subtype) {
0: return string(str_AvantiWestCoast);
return CB_RESULT_NO_TEXT;
}

// Define articulations
switch(FEAT_TRAINS, SELF, switch_BR805_5car_articulated, extra_callback_info1) {
// extra_callback_info1 returns the car number, so 1 is the second car, 2 the third, .. so on
// The callback runs this switch until it returns NO_MORE_ARTICULATED_PARTS, which ends the growth
1..4: return item_BR805_5car;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_BR805_5car_particles_diesel, position_in_articulated_veh % 5) {
// 0 is first car, 1 is second car, 2 is third car, so on...
0: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
4: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_BR805_5car_particles_electric, position_in_articulated_veh % 5) {
// 0 is first car, 1 is second car, 2 is third car, so on...
0: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
4: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

// Only give particle effects to front/rear cars
switch(FEAT_TRAINS, SELF, switch_BR805_5car_particles, current_railtype) {
ELRL: switch_BR805_5car_particles_electric;
switch_BR805_5car_particles_diesel;
}

// Start/stop switch, used to limit maximum length
switch(FEAT_TRAINS, SELF, switch_BR805_5car_start_stop, num_vehs_in_consist) {
return CB_RESULT_NO_TEXT; // Allow any length
}

// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_BR805_5car_can_attach_wagon, vehicle_type_id) {
item_BR805_5car: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

switch(FEAT_TRAINS, SELF, switch_BR805_5car_power, current_railtype) {
ELRL: return 3200;
return 2820;
}

// Class 805/0/2/3 (5car)
item(FEAT_TRAINS, item_BR805_5car, 579) {
property {
name: string(STR_BR805_5CAR);
climates_available: ALL_CLIMATES; // available in all climates
introduction_date: date(2024, 04, 1);
model_life: VEHICLE_NEVER_EXPIRES; // keep available forever
vehicle_life: 27.5; // years after vehicle is deemed "old" and should be replaced
reliability_decay: 0; // dont reduce reliabilty, (will grow from 75% upwards over the years)
refittable_cargo_classes: bitmask(CC_PASSENGERS);
non_refittable_cargo_classes: bitmask();
cost_factor: 92;
loading_speed: 12;
running_cost_factor: 60;
cargo_allow_refit: [];
cargo_disallow_refit: [];

speed: 125 mph;
power: 3200 hp;
cargo_capacity: (301/5);
weight: 261 ton;

sprite_id: SPRITE_ID_NEW_TRAIN; // required
misc_flags: bitmask(TRAIN_FLAG_MU); // acts as multiple-unit
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_PASSENGER; // tell ai that this is a passenger train
running_cost_base: RUNNING_COST_ELECTRIC;
dual_headed: 0; // set to 0 otherwise limited to 2 cars only
engine_class: ENGINE_CLASS_DIESEL; // even if its 3rd rail, ELECTRIC would give overhead wire effects
extra_power_per_wagon: 0 kW;
tractive_effort_coefficient: 0.3;
air_drag_coefficient: 0.06;
length: 8; // full tile length vehicle
visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER); // visual fx
extra_weight_per_wagon: 0 ton;
bitmask_vehicle_info: 0;
}

graphics {
default: switch_BR805_5car_spriteset;
purchase: spriteset_BR805_807_purchase;
cargo_subtype_text: switch_BR805_5car_subtype_text;

power: switch_BR805_5car_power;
speed: switch_BR800_speed;

articulated_part: switch_BR805_5car_articulated;
start_stop: switch_BR805_5car_start_stop;
can_attach_wagon: switch_BR805_5car_can_attach_wagon;
visual_effect_and_powered: switch_BR805_5car_particles;

cargo_capacity: return (301/5 * param_pax);
additional_text: string(STR_DSC_BR805_5CAR);
cost_factor: return(GetAdjustedCost(92));
running_cost_factor: return(GetAdjustedCost(60));
}
}
120 changes: 120 additions & 0 deletions src/trains/bmu/810_5car.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// Livery callbacks
switch(FEAT_TRAINS, SELF, switch_BR810_5car_spriteset_EMR, position_in_articulated_veh % 5) {
0: spriteset_BR80X_front_EMR;
4: spriteset_BR80X_rear_EMR;
spriteset_BR80X_middle_EMR;
}


// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_BR810_5car_spriteset, cargo_subtype) {
0: switch_BR810_5car_spriteset_EMR;
}

switch(FEAT_TRAINS, SELF, switch_BR810_5car_subtype_text, cargo_subtype) {
0: return string(str_EMRMaroon);
return CB_RESULT_NO_TEXT;
}

// Define articulations
switch(FEAT_TRAINS, SELF, switch_BR810_5car_articulated, extra_callback_info1) {
// extra_callback_info1 returns the car number, so 1 is the second car, 2 the third, .. so on
// The callback runs this switch until it returns NO_MORE_ARTICULATED_PARTS, which ends the growth
1..4: return item_BR810_5car;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_BR810_5car_particles_diesel, position_in_articulated_veh % 5) {
// 0 is first car, 1 is second car, 2 is third car, so on...
0: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
4: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_BR810_5car_particles_electric, position_in_articulated_veh % 5) {
// 0 is first car, 1 is second car, 2 is third car, so on...
0: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
4: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

// Only give particle effects to front/rear cars
switch(FEAT_TRAINS, SELF, switch_BR810_5car_particles, current_railtype) {
ELRL: switch_BR810_5car_particles_electric;
switch_BR810_5car_particles_diesel;
}

// Start/stop switch, used to limit maximum length
switch(FEAT_TRAINS, SELF, switch_BR810_5car_start_stop, num_vehs_in_consist) {
return CB_RESULT_NO_TEXT; // Allow any length
}

// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_BR810_5car_can_attach_wagon, vehicle_type_id) {
item_BR810_5car: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

switch(FEAT_TRAINS, SELF, switch_BR810_5car_power, current_railtype) {
ELRL: return 3200;
return 2820;
}

// Class 810/0/2/3 (5car)
item(FEAT_TRAINS, item_BR810_5car, 461) {
property {
name: string(STR_BR810_5CAR);
climates_available: ALL_CLIMATES; // available in all climates
introduction_date: date(2024, 08, 18);
model_life: VEHICLE_NEVER_EXPIRES; // keep available forever
vehicle_life: 27.5; // years after vehicle is deemed "old" and should be replaced
reliability_decay: 0; // dont reduce reliabilty, (will grow from 75% upwards over the years)
refittable_cargo_classes: bitmask(CC_PASSENGERS);
non_refittable_cargo_classes: bitmask();
cost_factor: 92;
loading_speed: 12;
running_cost_factor: 60;
cargo_allow_refit: [];
cargo_disallow_refit: [];

speed: 125 mph;
power: 3200 hp;
cargo_capacity: (301/5);
weight: 261 ton;

sprite_id: SPRITE_ID_NEW_TRAIN; // required
misc_flags: bitmask(TRAIN_FLAG_MU); // acts as multiple-unit
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_PASSENGER; // tell ai that this is a passenger train
running_cost_base: RUNNING_COST_ELECTRIC;
dual_headed: 0; // set to 0 otherwise limited to 2 cars only
engine_class: ENGINE_CLASS_DIESEL; // even if its 3rd rail, ELECTRIC would give overhead wire effects
extra_power_per_wagon: 0 kW;
tractive_effort_coefficient: 0.3;
air_drag_coefficient: 0.06;
length: 8; // full tile length vehicle
visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER); // visual fx
extra_weight_per_wagon: 0 ton;
bitmask_vehicle_info: 0;
}

graphics {
default: switch_BR810_5car_spriteset;
purchase: spriteset_BR810_purchase;
cargo_subtype_text: switch_BR810_5car_subtype_text;

power: switch_BR810_5car_power;
speed: switch_BR800_speed;

articulated_part: switch_BR810_5car_articulated;
start_stop: switch_BR810_5car_start_stop;
can_attach_wagon: switch_BR810_5car_can_attach_wagon;
visual_effect_and_powered: switch_BR810_5car_particles;

cargo_capacity: return (301/5 * param_pax);
additional_text: string(STR_DSC_BR810_5CAR);
cost_factor: return(GetAdjustedCost(92));
running_cost_factor: return(GetAdjustedCost(60));
}
}

0 comments on commit 309bacb

Please sign in to comment.