Skip to content

Commit

Permalink
Added Mk3 DVT, added push-pull between BR90 and Mk3DVT
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Mar 29, 2024
1 parent deb84bb commit 1ff3f6e
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 10 deletions.
Binary file modified gfx/BRMk3DVT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,9 @@ str_BRMK3DMB_liveries :BR Blue, Intercity Executive, Intercity Swallow, Midlan
STR_NAME_BRMk3Sleeper :BR Mark 3 Sleeper Coach
str_BRMk3Sleeper_liveries :BR Blue, Intercity, First Scotrail, Scotrail, Caledonian Sleaper, Great Western, GWR

STR_NAME_BRMk3DVT :BR Mark 3 Driving Van Trailer
str_BRMk3DVT_liveries :Intercity Swallow, Virgin, ONE, Chiltern, Greater Anglia, Transport for Wales, Virgin "Pretendolino", Arriva Wales, Network Rail

STR_NAME_BRMK4FO :BR Mark 4 Coach (First Open)
str_BRMK4FO_liveries :Intercity Swallow, National Express, GNER, East Coast, Virgin East Coast

Expand Down
13 changes: 13 additions & 0 deletions src/trains/_spriteset/PushPull.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ It is recommended to always include a default...

*/

// Mirror of Mk3DVT
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsMk3DVT, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){
0: spriteset_BRMk3DVT_IntercitySwallow;
1: spriteset_BRMk3DVT_Virgin;
2: spriteset_BRMk3DVT_ONE;
3: spriteset_BRMk3DVT_Chiltern;
4: spriteset_BRMk3DVT_GA;
5: spriteset_BRMk3DVT_TfW;
6: spriteset_BRMk3DVT_VirginPretendolino;
7: spriteset_BRMk3DVT_ArrivaWales;
8: spriteset_BRMk3DVT_NetworkRail;
}

// Mirror of Mk4DVT
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsMk4DVT, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){
0: spriteset_BR91_IntercitySwallow;
Expand Down
111 changes: 111 additions & 0 deletions src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
spriteset(spriteset_BRMk3DVT_purchase, "gfx/BRMk3DVT.png") {
template_purchase(0, 0)
}

spriteset(spriteset_BRMk3DVT_IntercitySwallow, "gfx/BRMk3DVT.png") {
template_train32px(0, 13)
}
spriteset(spriteset_BRMk3DVT_IntercitySwallow_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 38)
}

spriteset(spriteset_BRMk3DVT_Virgin, "gfx/BRMk3DVT.png") {
template_train32px(0, 63)
}
spriteset(spriteset_BRMk3DVT_Virgin_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 88)
}

spriteset(spriteset_BRMk3DVT_ONE, "gfx/BRMk3DVT.png") {
template_train32px(0, 113)
}
spriteset(spriteset_BRMk3DVT_ONE_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 138)
}

spriteset(spriteset_BRMk3DVT_Chiltern, "gfx/BRMk3DVT.png") {
template_train32px(0, 163)
}
spriteset(spriteset_BRMk3DVT_Chiltern_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 188)
}

spriteset(spriteset_BRMk3DVT_GA, "gfx/BRMk3DVT.png") {
template_train32px(0, 213)
}
spriteset(spriteset_BRMk3DVT_GA_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 238)
}

spriteset(spriteset_BRMk3DVT_TfW, "gfx/BRMk3DVT.png") {
template_train32px(0, 263)
}
spriteset(spriteset_BRMk3DVT_TfW_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 288)
}

spriteset(spriteset_BRMk3DVT_VirginPretendolino, "gfx/BRMk3DVT.png") {
template_train32px(0, 313)
}
spriteset(spriteset_BRMk3DVT_VirginPretendolino_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 338)
}

spriteset(spriteset_BRMk3DVT_ArrivaWales, "gfx/BRMk3DVT.png") {
template_train32px(0, 363)
}
spriteset(spriteset_BRMk3DVT_ArrivaWales_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 388)
}

spriteset(spriteset_BRMk3DVT_NetworkRail, "gfx/BRMk3DVT.png") {
template_train32px(0, 413)
}
spriteset(spriteset_BRMk3DVT_NetworkRail_reversed, "gfx/BRMk3DVT.png") {
template_train32px(0, 438)
}


switch(FEAT_TRAINS,SELF,sw_BRMk3DVT_cargo_subtype_text,cargo_subtype){
0: return string(str_IntercitySwallow);
1: return string(str_Virgin);
2: return string(str_One);
3: return string(str_Chiltern);
4: return string(str_GreaterAnglia);
5: return string(str_TfW);
6: return string(str_VirginPretendolino);
7: return string(str_ArrivaWales);
8: return string(str_NetworkRail);
return CB_RESULT_NO_TEXT;
}


// Show own graphics when facing forward
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
switch(FEAT_TRAINS,SELF, sw_BRMk3DVT,cargo_subtype){
0: spriteset_BRMk3DVT_IntercitySwallow_reversed;
1: spriteset_BRMk3DVT_Virgin_reversed;
2: spriteset_BRMk3DVT_ONE_reversed;
3: spriteset_BRMk3DVT_Chiltern_reversed;
4: spriteset_BRMk3DVT_GA_reversed;
5: spriteset_BRMk3DVT_TfW_reversed;
6: spriteset_BRMk3DVT_VirginPretendolino_reversed;
7: spriteset_BRMk3DVT_ArrivaWales_reversed;
8: spriteset_BRMk3DVT_NetworkRail_reversed;
}

// If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BRMk3DVT_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
543: sw_PUSHPULL_DVTasBR90; // Class 90
sw_BRMk3DVT; // No compatible locomotive found, show normal sprites
}

switch(FEAT_TRAINS,PARENT,sw_Mk3DVT_CheckPosition, position_in_articulated_veh_from_end){
0: sw_BRMk3DVT_PushPUll; // Attempt push pull
sw_BRMk3DVT; // We aren't at the back of theconsist, show normal sprites
}

switch(FEAT_TRAINS,PARENT,sw_BRMk3DVT_Sprites ,vehicle_is_reversed){
0: sw_BRMk3DVT; // We're heading foward, show normal sprites
1: sw_Mk3DVT_CheckPosition; // Attempt push pull (skipping check position for now for testing)
}
10 changes: 0 additions & 10 deletions src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ spriteset(spriteset_BRMk4DVT_LNERr, "gfx/BR91.png") {
template_train32px(172, 738)
}

switch(FEAT_TRAINS,SELF,sw_BRMk4DVT_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;
}

// Show own graphics when facing forward
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
switch(FEAT_TRAINS,SELF, sw_BRMk4DVT,cargo_subtype){
Expand Down
1 change: 1 addition & 0 deletions src/trains/electric/BR90.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ switch(FEAT_TRAINS,SELF,sw_BR90_cargo_subtype_text,cargo_subtype){

// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR90_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT
585: sw_PUSHPULL_LocomotiveAsMk4DVT; // Mk4 DVT
sw_BR90; // No compatible locomotive found, show normal sprites
}
Expand Down
40 changes: 40 additions & 0 deletions src/trains/rollingstock/Mk3DVT.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
item (FEAT_TRAINS, item_BRMk3DVT, 586) {
property {
name: string(STR_NAME_BRMk3DVT);
climates_available: ALL_CLIMATES;
refittable_cargo_classes: CC_PASSENGERS;
introduction_date: date(1989,1,1);
cargo_allow_refit: [MAIL];
loading_speed: 14;
cost_factor: 30;
running_cost_factor: 12;
sprite_id: SPRITE_ID_NEW_TRAIN;
refit_cost: 0;
track_type: RAIL;
speed: 140 mph;
power: 0;
running_cost_base: RUNNING_COST_STEAM;
dual_headed: 0;
default_cargo_type: MAIL;
cargo_capacity: 1;
weight: 43 ton;
tractive_effort_coefficient: 0;
air_drag_coefficient: 0;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_NONE;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
cargo_age_period: 185;
}
graphics {
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
default: sw_BRMk3DVT_Sprites;
colour_mapping: return PALETTE_CC_FIRST;
cargo_subtype_text: sw_BRMk3DVT_cargo_subtype_text;
purchase: spriteset_BRMk3DVT_purchase;
speed: 160;
cargo_capacity: return(0);
cost_factor: return(GetAdjustedCost(52));
running_cost_factor: return(GetAdjustedCost(17));
}
}

0 comments on commit 1ff3f6e

Please sign in to comment.