Skip to content

Commit

Permalink
Added BR91 as a standalone unit, added BR91 pushpull with Mk4DVT
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Mar 31, 2024
1 parent 26e50e1 commit 678311c
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 513 deletions.
Binary file modified docs/SpriteIDs.xlsx
Binary file not shown.
Binary file modified gfx/BR91.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ str_BR90_eos :---
str_BR90_liveries :Intercity Swallow, Freightliner Grey, EWS, DB, Freightliner Green, Freightliner Powerhaul, ONE, Greater Anglie Blue, Greater Anglia White, Virgin, REX, First Scotrail, GNER

STR_NAME_BR91 :British Rail Class 91 'Intercity 225'
STR_NAME_BR91_Standalone :British Rail Class 91 (Standalone)
str_BR91_usage :Express Passenger
str_BR91_eos :---
str_BR91_liveries :Intercity Swallow, National Express, GNER, East Coast, Virgin East Coast
Expand Down
1 change: 1 addition & 0 deletions src/sortpurchase.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ sort(FEAT_TRAINS, [
item_BR89,
item_BR90,
item_BR91,
item_BR91Standalone,
item_BluePullman_6Car, // Don't really belong anywhere but after the IC225 and before the DMUs seems to fit
item_BluePullman_8Car, // Don't really belong anywhere but after the IC225 and before the DMUs seems to fit
item_BR121,
Expand Down
128 changes: 128 additions & 0 deletions src/trains/_spriteset/Electric_Sprites/91.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ spriteset(spriteset_BR91_Purchase, "gfx/BR91.png") {
template_purchase(0, 0)
}

spriteset(spriteset_BR91Standalone_Purchase, "gfx/BR91.png") {
template_purchase(262, 0)
}

spriteset(spriteset_BR91_IntercitySwallow, "gfx/BR91.png") {
template_train32px(0, 13)
}
Expand Down Expand Up @@ -42,4 +46,128 @@ spriteset(spriteset_BR91_LNER, "gfx/BR91.png") {
}
spriteset(spriteset_BR91_LNERr, "gfx/BR91.png") {
template_train32px(172, 638)
}


// This switch called when displaying as this locomotive
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
// WARNING: Also edit Reversed switch below
switch(FEAT_TRAINS,SELF, sw_BR91,cargo_subtype){
0: spriteset_BR91_IntercitySwallow;
1: spriteset_BR91_NatEx;
2: spriteset_BR91_GNER;
3: spriteset_BR91_EastCoast;
4: spriteset_BR91_VirginEC;
5: spriteset_BR91_LNER;
}

// This switch called when displaying as this locomotive
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
// WARNING: Also edit the non-reversed switch above
switch(FEAT_TRAINS,SELF, sw_BR91_reversed,cargo_subtype){
0: spriteset_BRMk4DVT_IntercitySwallowr;
1: spriteset_BRMk4DVT_NatExr;
2: spriteset_BRMk4DVT_GNERr;
3: spriteset_BRMk4DVT_EastCoastr;
4: spriteset_BRMk4DVT_VirginECr;
5: spriteset_BRMk4DVT_LNERr;
}

switch (FEAT_TRAINS, SELF, switch_articulated_BR91, extra_callback_info1) {
1: return item_91_BRMk4TSOE;
2..4: return item_91_BRMk4TSO;
5: return item_91_BRMk4TSOD;
6: return item_91_BRMk4RFM;
7..9: return item_91_BRMk4FO;
10: return item_91_BRMk4DVT;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; //stop adding vehicle parts
}

switch(FEAT_TRAINS,SELF,sw_BR91_cargo_subtype_text,cargo_subtype){
0: return string(str_IntercitySwallow);
1: return string(str_NatEx);
2: return string(str_GNER);
3: return string(str_EastCoast);
4: return string(str_VirginECLNER);
5: return string(str_LNER);
return CB_RESULT_NO_TEXT;
}

switch(FEAT_TRAINS,PARENT,sw_91_front,vehicle_is_reversed){
0: sw_BR91;
1: sw_BR91_reversed;
}

switch(FEAT_TRAINS,SELF,sw_BR91_speed,param_max_speed){
0: return 201;
1: return 225;
}


switch(FEAT_TRAINS,SELF, sw_91_BRMk4FO,cargo_subtype){
0: spriteset_BRMk4FO_IntercitySwallow;
1: spriteset_BRMk4FO_NatEx;
2: spriteset_BRMk4FO_GNER;
3: spriteset_BRMk4FO_EastCoast;
4: spriteset_BRMk4FO_VirginEC;
5: spriteset_BRMk4FO_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSOE,cargo_subtype){
0: spriteset_BRMk4TSOE_IntercitySwallow;
1: spriteset_BRMk4TSOE_NatEx;
2: spriteset_BRMk4TSOE_GNER;
3: spriteset_BRMk4TSOE_EastCoast;
4: spriteset_BRMk4TSOE_VirginEC;
5: spriteset_BRMk4TSOE_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSO,cargo_subtype){
0: spriteset_BRMk4TSO_IntercitySwallow;
1: spriteset_BRMk4TSO_NatEx;
2: spriteset_BRMk4TSO_GNER;
3: spriteset_BRMk4TSO_EastCoast;
4: spriteset_BRMk4TSO_VirginEC;
5: spriteset_BRMk4TSO_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4RFM,cargo_subtype){
0: spriteset_BRMk4RFM_IntercitySwallow;
1: spriteset_BRMk4RFM_NatEx;
2: spriteset_BRMk4RFM_GNER;
3: spriteset_BRMk4RFM_EastCoast;
4: spriteset_BRMk4RFM_VirginEC;
5: spriteset_BRMk4RFM_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSOD,cargo_subtype){
0: spriteset_BRMk4TSOD_IntercitySwallow;
1: spriteset_BRMk4TSOD_NatEx;
2: spriteset_BRMk4TSOD_GNER;
3: spriteset_BRMk4TSOD_EastCoast;
4: spriteset_BRMk4TSOD_VirginEC;
5: spriteset_BRMk4TSOD_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4DVT,cargo_subtype){
0: spriteset_BRMk4DVT_IntercitySwallow;
1: spriteset_BRMk4DVT_NatEx;
2: spriteset_BRMk4DVT_GNER;
3: spriteset_BRMk4DVT_EastCoast;
4: spriteset_BRMk4DVT_VirginEC;
5: spriteset_BRMk4DVT_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4DVT_reversed,cargo_subtype){
0: spriteset_BR91_IntercitySwallowr;
1: spriteset_BR91_NatExr;
2: spriteset_BR91_GNERr;
3: spriteset_BR91_EastCoastr;
4: spriteset_BR91_VirginECr;
5: spriteset_BR91_LNERr;
}

switch(FEAT_TRAINS,PARENT,sw_91_rear,vehicle_is_reversed){
0: sw_91_BRMk4DVT;
1: sw_91_BRMk4DVT_reversed;
}
10 changes: 10 additions & 0 deletions src/trains/_spriteset/PushPull.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,14 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR90, [STORE_TEMP(0 - position_in_a
11: spriteset_BR90_FirstScotrail;
12: spriteset_BR90_GNER;
return CB_RESULT_NO_TEXT;
}

// Mirror of BR91 (IC225.pnml)
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR91, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){
0: spriteset_BR91_IntercitySwallowr;
1: spriteset_BR91_NatExr;
2: spriteset_BR91_GNERr;
3: spriteset_BR91_EastCoastr;
4: spriteset_BR91_VirginECr;
5: spriteset_BR91_LNERr;
}
1 change: 1 addition & 0 deletions src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ switch(FEAT_TRAINS, PARENT, sw_BRMk4DVT_PushPUll, [STORE_TEMP(0 - position_in_ar
196: sw_PUSHPULL_DVTasBR68; // Class 68
418: sw_PUSHPULL_DVTasBR89; // Class 89
543: sw_PUSHPULL_DVTasBR90; // Class 90
588: sw_PUSHPULL_DVTasBR91; // Class 91
sw_BRMk4DVT; // No compatible locomotive found, show normal sprites
}

Expand Down
116 changes: 0 additions & 116 deletions src/trains/electric/BR91.pnml → src/trains/electric/BR91_IC225.pnml
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
switch(FEAT_TRAINS,SELF, sw_BR91,cargo_subtype){
0: spriteset_BR91_IntercitySwallow;
1: spriteset_BR91_NatEx;
2: spriteset_BR91_GNER;
3: spriteset_BR91_EastCoast;
4: spriteset_BR91_VirginEC;
5: spriteset_BR91_LNER;
}

switch(FEAT_TRAINS,SELF, sw_BR91_reversed,cargo_subtype){
0: spriteset_BRMk4DVT_IntercitySwallowr;
1: spriteset_BRMk4DVT_NatExr;
2: spriteset_BRMk4DVT_GNERr;
3: spriteset_BRMk4DVT_EastCoastr;
4: spriteset_BRMk4DVT_VirginECr;
5: spriteset_BRMk4DVT_LNERr;
}

switch (FEAT_TRAINS, SELF, switch_articulated_BR91, extra_callback_info1) {
1: return item_91_BRMk4TSOE;
2..4: return item_91_BRMk4TSO;
5: return item_91_BRMk4TSOD;
6: return item_91_BRMk4RFM;
7..9: return item_91_BRMk4FO;
10: return item_91_BRMk4DVT;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; //stop adding vehicle parts
}

switch(FEAT_TRAINS,SELF,sw_BR91_cargo_subtype_text,cargo_subtype){
0: return string(str_IntercitySwallow);
1: return string(str_NatEx);
2: return string(str_GNER);
3: return string(str_EastCoast);
4: return string(str_VirginECLNER);
5: return string(str_LNER);
return CB_RESULT_NO_TEXT;
}

switch(FEAT_TRAINS,PARENT,sw_91_front,vehicle_is_reversed){
0: sw_BR91;
1: sw_BR91_reversed;
}

switch(FEAT_TRAINS,SELF,sw_BR91_speed,param_max_speed){
0: return 201;
1: return 225;
}

item (FEAT_TRAINS, item_BR91, 108) {
property {
name: string(STR_NAME_BR91);
Expand Down Expand Up @@ -95,74 +47,6 @@ item (FEAT_TRAINS, item_BR91, 108) {
}
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4FO,cargo_subtype){
0: spriteset_BRMk4FO_IntercitySwallow;
1: spriteset_BRMk4FO_NatEx;
2: spriteset_BRMk4FO_GNER;
3: spriteset_BRMk4FO_EastCoast;
4: spriteset_BRMk4FO_VirginEC;
5: spriteset_BRMk4FO_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSOE,cargo_subtype){
0: spriteset_BRMk4TSOE_IntercitySwallow;
1: spriteset_BRMk4TSOE_NatEx;
2: spriteset_BRMk4TSOE_GNER;
3: spriteset_BRMk4TSOE_EastCoast;
4: spriteset_BRMk4TSOE_VirginEC;
5: spriteset_BRMk4TSOE_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSO,cargo_subtype){
0: spriteset_BRMk4TSO_IntercitySwallow;
1: spriteset_BRMk4TSO_NatEx;
2: spriteset_BRMk4TSO_GNER;
3: spriteset_BRMk4TSO_EastCoast;
4: spriteset_BRMk4TSO_VirginEC;
5: spriteset_BRMk4TSO_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4RFM,cargo_subtype){
0: spriteset_BRMk4RFM_IntercitySwallow;
1: spriteset_BRMk4RFM_NatEx;
2: spriteset_BRMk4RFM_GNER;
3: spriteset_BRMk4RFM_EastCoast;
4: spriteset_BRMk4RFM_VirginEC;
5: spriteset_BRMk4RFM_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4TSOD,cargo_subtype){
0: spriteset_BRMk4TSOD_IntercitySwallow;
1: spriteset_BRMk4TSOD_NatEx;
2: spriteset_BRMk4TSOD_GNER;
3: spriteset_BRMk4TSOD_EastCoast;
4: spriteset_BRMk4TSOD_VirginEC;
5: spriteset_BRMk4TSOD_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4DVT,cargo_subtype){
0: spriteset_BRMk4DVT_IntercitySwallow;
1: spriteset_BRMk4DVT_NatEx;
2: spriteset_BRMk4DVT_GNER;
3: spriteset_BRMk4DVT_EastCoast;
4: spriteset_BRMk4DVT_VirginEC;
5: spriteset_BRMk4DVT_LNER;
}

switch(FEAT_TRAINS,SELF, sw_91_BRMk4DVT_reversed,cargo_subtype){
0: spriteset_BR91_IntercitySwallowr;
1: spriteset_BR91_NatExr;
2: spriteset_BR91_GNERr;
3: spriteset_BR91_EastCoastr;
4: spriteset_BR91_VirginECr;
5: spriteset_BR91_LNERr;
}

switch(FEAT_TRAINS,PARENT,sw_91_rear,vehicle_is_reversed){
0: sw_91_BRMk4DVT;
1: sw_91_BRMk4DVT_reversed;
}

// The independent DVT is a separate item, item_BRMk4DVT
item (FEAT_TRAINS, item_91_BRMk4DVT, 113) {
property {
Expand Down
64 changes: 64 additions & 0 deletions src/trains/electric/BR91_Standalone.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR91_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
585: sw_PUSHPULL_LocomotiveAsMk4DVT; // Mk4 DVT
sw_BR91; // No compatible locomotive found, show normal sprites
}

switch(FEAT_TRAINS,PARENT,sw_BR91_CheckPosition, position_in_consist){
0: sw_BR91_PushPUll; // Attempt push pull
sw_BR91; // We aren't at the front of the consist, show normal sprites
}

switch(FEAT_TRAINS,PARENT,sw_BR91_Sprites ,vehicle_is_reversed){
0: sw_BR91; // We're heading foward, show normal sprites
1: sw_BR91_CheckPosition; // Attempt push pull
}


item (FEAT_TRAINS, item_BR91Standalone, 588) {
property {
name: string(STR_NAME_BR91_Standalone);
climates_available: ALL_CLIMATES;
introduction_date: date(1989,4,21);
model_life: 12;
retire_early: 1;
vehicle_life: 50;
reliability_decay: 7;
refittable_cargo_classes: CC_PASSENGERS;
cargo_allow_refit: [PASS, TOUR];
loading_speed: 3;
cost_factor: 131;
running_cost_factor: 114;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 125 mph;
misc_flags: TRAIN_FLAG_MU;
refit_cost: 0;
track_type: ELRL;
ai_special_flag: AI_FLAG_CARGO;
power: 6480 hp;
running_cost_base: RUNNING_COST_ELECTRIC;
dual_headed: 0;
default_cargo_type: PASS;
cargo_capacity: 1;
weight: 486 ton;
engine_class: ENGINE_CLASS_ELECTRIC;
tractive_effort_coefficient: 0.3;
air_drag_coefficient: 0.1;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_ELECTRIC;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
}
graphics {
additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_emu),string(str_route_7),string(str_BR91_usage),string(str_BR91_eos),string(str_BR91_liveries)));
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR91_cargo_subtype_text;
default: sw_BR91_Sprites;
purchase: spriteset_BR91Standalone_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
speed: sw_BR91_speed;
cost_factor: return(GetAdjustedCost(38));
running_cost_factor: return(GetAdjustedCost(37));
}
}
Loading

0 comments on commit 678311c

Please sign in to comment.