Skip to content

Commit

Permalink
More push pull combinations (47+Mk3, 68+Mk3, 68+Mk4, 86+Mk3, 87+Mk3),…
Browse files Browse the repository at this point in the history
… Updated changelog
  • Loading branch information
audigex committed Mar 30, 2024
1 parent 5fd0cd8 commit 86ad0d3
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/Push Pull.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TPO PCV: 47, 57?

Mk2 DBSO: 47, 57?, 37

Mk3 DVT: 86, 87, *90, *67, 68, 47, 57?, 69?
Mk3 DVT: *86, *87, *90, *67, *68, 47*, 57?, 69?

Mk4 DVT: *67, *89, *90, 91

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# v2.7
- Added Mk3 DVT
- Added Mk4 DVT as standalone (non-IC225) unit
- Added push-pull for Class 47 / Mk3 DVT
- Added push-pull for Class 67 / Mk3 DVT
- Added push-pull for Class 67 / Mk4 DVT
- Added push-pull for Class 68 / Mk4 DVT
- Added push-pull for Class 68 / Mk3 DVT
- Added push-pull for Class 86 / Mk3 DVT
- Added push-pull for Class 87 / Mk3 DVT
- Added push-pull for Class 90 / Mk3 DVT
- Added push-pull for Class 90 / Mk4 DVT
- Added push-pull for Class 89 / Mk4 DVT
Expand Down
29 changes: 28 additions & 1 deletion src/trains/_spriteset/PushPull.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsRMTPO, [STORE_TEMP(num_vehs_
}

// Mirror of BR47
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DMSOasBR47,cargo_subtype){
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR47,cargo_subtype){
0: spriteset_BR47_BRGreen;
1: spriteset_BR47_BRBlue;
2: spriteset_BR47_Porterbrook;
Expand All @@ -54,6 +54,14 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DMSOasBR47,cargo_subtype){
return CB_RESULT_NO_TEXT;
}

// Mirror of BR68
switch(FEAT_TRAINS, SELF, sw_PUSHPULL_DVTasBR68,cargo_subtype){
0: spriteset_BR68_DRS;
1: spriteset_BR68_ScotRail;
2: spriteset_BR68_Chiltern;
3: spriteset_BR68_TPE;
}

// Mirror of BR67
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR67,cargo_subtype){
0: spriteset_BR67_EWS;
Expand All @@ -67,6 +75,25 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR67,cargo_subtype){
8: spriteset_BR67_DBCompany;
}

// Mirror of 86
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR86, cargo_subtype){
0: spriteset_BR86_BRBlue;
1: spriteset_BR86_IntercityExecutive;
2: spriteset_BR86_IntercitySwallow;
3: spriteset_BR86_RailfreightDistribution;
4: spriteset_BR86_RailExpress;
5: spriteset_BR86_EWS;
return CB_RESULT_NO_TEXT;
}

// Mirror of 87
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR87, cargo_subtype){
0: spriteset_BR87_BRBlue;
1: spriteset_BR87_IntercitySwallow;
2: spriteset_BR87_Virgin;
return CB_RESULT_NO_TEXT;
}

// Mirror of BR89
switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR89, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){
0: spriteset_BR89_IntercitySwallow;
Expand Down
8 changes: 6 additions & 2 deletions src/trains/_spriteset/Rolling Stock_Sprites/Mk3DVT.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ switch(FEAT_TRAINS,SELF, sw_BRMk3DVT,cargo_subtype){

// 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]]) {
151: sw_PUSHPULL_DVTasBR67; // Class 67
440: sw_PUSHPULL_DVTasBR47; // Class 47
151: sw_PUSHPULL_DVTasBR67; // Class 67
196: sw_PUSHPULL_DVTasBR68; // Class 68
566: sw_PUSHPULL_DVTasBR86; // Class 86
567: sw_PUSHPULL_DVTasBR87; // Class 87
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){
switch(FEAT_TRAINS, SELF,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
}
Expand Down
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 @@ -58,6 +58,7 @@ switch(FEAT_TRAINS,SELF, sw_BRMk4DVT,cargo_subtype){
// If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BRMk4DVT_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
151: sw_PUSHPULL_DVTasBR67; // Class 67
196: sw_PUSHPULL_DVTasBR68; // Class 68
418: sw_PUSHPULL_DVTasBR89; // Class 89
543: sw_PUSHPULL_DVTasBR90; // Class 90
sw_BRMk4DVT; // No compatible locomotive found, show normal sprites
Expand Down
1 change: 1 addition & 0 deletions src/trains/diesel/BR047.pnml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR47_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
//483: sw_PUSHPULL_LocomotiveAsRMTPO; // Royal Mail TPO, uncommen this line when RMTPO has been changed to length 8
586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT
sw_BR47; // No compatible locomotive found, show normal sprites
}

Expand Down
21 changes: 20 additions & 1 deletion src/trains/diesel/BR068.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ spriteset(spriteset_BR68_TPE, "gfx/BR68_v2.png") {
template_train32px(0, 38)
}

// This switch called when displaying as this locomotive
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
switch(FEAT_TRAINS,SELF, sw_BR68,cargo_subtype){
0: spriteset_BR68_DRS;
1: spriteset_BR68_ScotRail;
Expand All @@ -33,6 +35,23 @@ switch(FEAT_TRAINS,SELF,sw_BR68_cargo_subtype_text,cargo_subtype){
return CB_RESULT_NO_TEXT;
}

// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR68_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_BR68; // No compatible locomotive found, show normal sprites
}

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

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

item (FEAT_TRAINS, item_BR68, 196) {
property {
name: string(STR_NAME_BR68);
Expand Down Expand Up @@ -72,7 +91,7 @@ item (FEAT_TRAINS, item_BR68, 196) {
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR68_cargo_subtype_text;
default: sw_BR68;
default: sw_BR68_Sprites;
purchase: spriteset_BR68_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
create_effect: diesel_create_visual_effect;
Expand Down
20 changes: 19 additions & 1 deletion src/trains/electric/BR86.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ spriteset(spriteset_BR86_EWS, "gfx/electric/BR8X.png") {
template_train32px(0, 163)
}

// This switch called when displaying as this locomotive
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
switch(FEAT_TRAINS,SELF, sw_BR86, cargo_subtype){
0: spriteset_BR86_BRBlue;
1: spriteset_BR86_IntercityExecutive;
Expand All @@ -46,6 +48,22 @@ switch(FEAT_TRAINS,SELF,sw_BR86_cargo_subtype_text,cargo_subtype){
return CB_RESULT_NO_TEXT;
}

// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR86_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT
sw_BR86; // No compatible locomotive found, show normal sprites
}

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

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

item (FEAT_TRAINS, item_BR86, 566) {
property {
name: string(STR_NAME_BR86);
Expand Down Expand Up @@ -85,7 +103,7 @@ item (FEAT_TRAINS, item_BR86, 566) {
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR86_cargo_subtype_text;
default: sw_BR86;
default: sw_BR86_Sprites;
purchase: spriteset_BR86_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
cost_factor: return(GetAdjustedCost(40));
Expand Down
20 changes: 19 additions & 1 deletion src/trains/electric/BR87.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spriteset(spriteset_BR87_BRBlue, "gfx/electric/BR8X.png") {
template_train32px(0, 263)
}

// This switch called when displaying as this locomotive
// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder
switch(FEAT_TRAINS,SELF, sw_BR87, cargo_subtype){
0: spriteset_BR87_BRBlue;
1: spriteset_BR87_IntercitySwallow;
Expand All @@ -28,6 +30,22 @@ switch(FEAT_TRAINS,SELF,sw_BR87_cargo_subtype_text,cargo_subtype){
return CB_RESULT_NO_TEXT;
}

// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_BR87_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
586: sw_PUSHPULL_LocomotiveAsMk3DVT; // Mk3 DVT
sw_BR87; // No compatible locomotive found, show normal sprites
}

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

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

item (FEAT_TRAINS, item_BR87, 567) {
property {
name: string(STR_NAME_BR87);
Expand Down Expand Up @@ -67,7 +85,7 @@ item (FEAT_TRAINS, item_BR87, 567) {
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR87_cargo_subtype_text;
default: sw_BR87;
default: sw_BR87_Sprites;
purchase: spriteset_BR87_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
cost_factor: return(GetAdjustedCost(40));
Expand Down
2 changes: 1 addition & 1 deletion src/trains/rollingstock/RM_TPO.pnml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch
switch(FEAT_TRAINS, PARENT, sw_RMTPO_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) {
440: sw_PUSHPULL_DMSOasBR47; // Class 47
440: sw_PUSHPULL_DVTasBR47; // Class 47
sw_RMTPO; // No compatible locomotive found, show normal sprites
}

Expand Down

0 comments on commit 86ad0d3

Please sign in to comment.