Skip to content

Commit

Permalink
Added multiple working to several classes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGarrity committed Jun 20, 2020
1 parent 6d5c3f7 commit 4541267
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 86 deletions.
9 changes: 5 additions & 4 deletions src/trains/bmu/755-3.pnml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_br_755_3_spriteset, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_755_3_spriteset, position_in_articulated_veh % 4) {
0: spriteset_br_755_front;
1: spriteset_br_755_pp;
2: spriteset_br_755_middle_panto;
Expand All @@ -13,12 +13,12 @@ switch(FEAT_TRAINS, SELF, switch_br_755_3_articulated, extra_callback_info1) {
}


switch(FEAT_TRAINS, SELF, switch_br_755_3_particles_electric, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_755_3_particles_electric, position_in_articulated_veh % 4) {
2: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_755_3_particles_diesel, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_755_3_particles_diesel, position_in_articulated_veh % 4) {
1: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}
Expand All @@ -37,6 +37,7 @@ switch(FEAT_TRAINS, SELF, switch_br_755_3_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_755_3_can_attach_wagon, vehicle_type_id) {
item_br_755_3: return CB_RESULT_ATTACH_ALLOW;
item_br_755_4: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand All @@ -46,7 +47,7 @@ switch(FEAT_TRAINS, SELF, switch_br_755_3_power, current_railtype) {
return 1290;
}

switch(FEAT_TRAINS, SELF, switch_br_755_3_length, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_755_3_length, position_in_articulated_veh % 4) {
1: return 4;
return 8;
}
Expand Down
9 changes: 5 additions & 4 deletions src/trains/bmu/755-4.pnml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_br_755_4_spriteset, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_755_4_spriteset, position_in_articulated_veh % 5) {
0: spriteset_br_755_front;
1: spriteset_br_755_middle;
2: spriteset_br_755_pp;
Expand All @@ -14,12 +14,12 @@ switch(FEAT_TRAINS, SELF, switch_br_755_4_articulated, extra_callback_info1) {
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_755_4_particles_electric, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_755_4_particles_electric, position_in_articulated_veh % 5) {
3: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_755_4_particles_diesel, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_755_4_particles_diesel, position_in_articulated_veh % 5) {
2: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}
Expand All @@ -38,6 +38,7 @@ switch(FEAT_TRAINS, SELF, switch_br_755_4_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_755_4_can_attach_wagon, vehicle_type_id) {
item_br_755_4: return CB_RESULT_ATTACH_ALLOW;
item_br_755_3: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand All @@ -47,7 +48,7 @@ switch(FEAT_TRAINS, SELF, switch_br_755_4_power, current_railtype) {
return 2570;
}

switch(FEAT_TRAINS, SELF, switch_br_755_4_length, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_755_4_length, position_in_articulated_veh % 5) {
2: return 4;
return 8;
}
Expand Down
9 changes: 5 additions & 4 deletions src/trains/bmu/756-3.pnml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_br_756_3_spriteset, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_756_3_spriteset, position_in_articulated_veh % 4) {
0: spriteset_br_756_front;
1: spriteset_br_756_pp;
2: spriteset_br_756_middle_panto;
Expand All @@ -13,12 +13,12 @@ switch(FEAT_TRAINS, SELF, switch_br_756_3_articulated, extra_callback_info1) {
}


switch(FEAT_TRAINS, SELF, switch_br_756_3_particles_electric, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_756_3_particles_electric, position_in_articulated_veh % 4) {
2: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_756_3_particles_diesel, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_756_3_particles_diesel, position_in_articulated_veh % 4) {
1: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}
Expand All @@ -37,6 +37,7 @@ switch(FEAT_TRAINS, SELF, switch_br_756_3_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_756_3_can_attach_wagon, vehicle_type_id) {
item_br_756_3: return CB_RESULT_ATTACH_ALLOW;
item_br_756_4: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand All @@ -46,7 +47,7 @@ switch(FEAT_TRAINS, SELF, switch_br_756_3_power, current_railtype) {
return 1290;
}

switch(FEAT_TRAINS, SELF, switch_br_756_3_length, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_756_3_length, position_in_articulated_veh % 4) {
1: return 4;
return 8;
}
Expand Down
9 changes: 5 additions & 4 deletions src/trains/bmu/756-4.pnml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_br_756_4_spriteset, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_756_4_spriteset, position_in_articulated_veh % 5) {
0: spriteset_br_756_front;
1: spriteset_br_756_middle;
2: spriteset_br_756_pp;
Expand All @@ -14,12 +14,12 @@ switch(FEAT_TRAINS, SELF, switch_br_756_4_articulated, extra_callback_info1) {
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_756_4_particles_electric, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_756_4_particles_electric, position_in_articulated_veh % 5) {
3: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_756_4_particles_diesel, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_756_4_particles_diesel, position_in_articulated_veh % 5) {
2: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}
Expand All @@ -38,6 +38,7 @@ switch(FEAT_TRAINS, SELF, switch_br_756_4_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_756_4_can_attach_wagon, vehicle_type_id) {
item_br_756_4: return CB_RESULT_ATTACH_ALLOW;
item_br_756_3: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand All @@ -47,7 +48,7 @@ switch(FEAT_TRAINS, SELF, switch_br_756_4_power, current_railtype) {
return 2570;
}

switch(FEAT_TRAINS, SELF, switch_br_756_4_length, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_756_4_length, position_in_articulated_veh % 5) {
2: return 4;
return 8;
}
Expand Down
15 changes: 8 additions & 7 deletions src/trains/bmu/769-0-3-4.pnml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_rog, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_rog, position_in_articulated_veh % 4) {
0: spriteset_br_769_front_rog;
1: spriteset_br_769_middle_panto_rog;
3: spriteset_br_769_rear_rog;
spriteset_br_769_middle_rog;
}

switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_northern, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_northern, position_in_articulated_veh % 4) {
0: spriteset_br_769_front_northern;
1: spriteset_br_769_middle_panto_northern;
3: spriteset_br_769_rear_northern;
spriteset_br_769_middle_northern;
}

switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_tfw, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_spriteset_tfw, position_in_articulated_veh % 4) {
0: spriteset_br_769_front_tfw;
1: spriteset_br_769_middle_panto_tfw;
3: spriteset_br_769_rear_tfw;
Expand All @@ -31,17 +31,17 @@ switch(FEAT_TRAINS, SELF, switch_br_769_articulated, extra_callback_info1) {
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_769_particles_ohle, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_particles_ohle, position_in_articulated_veh % 4) {
1: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_769_particles_3rdr, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_particles_3rdr, position_in_articulated_veh % 4) {
// No effects on 3RDR (for now...)
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_769_particles_diesel, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_particles_diesel, position_in_articulated_veh % 4) {
0: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
3: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
Expand All @@ -52,7 +52,7 @@ switch(FEAT_TRAINS, SELF, switch_br_769_particles, current_railtype) {
// 0 is first car, 1 is second car, 2 is third car, so on...
ELRL: switch_br_769_particles_ohle;
railtype("3RDC"): switch_br_769_particles_ohle;
railtype("3RDR"): switch_br_769_particles_3rdr;
railtype("3RDR"): switch_br_769_particles_diesel;
switch_br_769_particles_diesel;
}

Expand All @@ -64,6 +64,7 @@ switch(FEAT_TRAINS, SELF, switch_br_769_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_769_can_attach_wagon, vehicle_type_id) {
item_br_769: return CB_RESULT_ATTACH_ALLOW;
item_br_769_9: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand Down
9 changes: 5 additions & 4 deletions src/trains/bmu/769-9.pnml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Choose sprites depending on car position
switch(FEAT_TRAINS, SELF, switch_br_769_9_spriteset, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_9_spriteset, position_in_articulated_veh % 4) {
0: spriteset_br_769_front_gwr;
1: spriteset_br_769_middle_panto_gwr;
3: spriteset_br_769_rear_gwr;
Expand All @@ -12,17 +12,17 @@ switch(FEAT_TRAINS, SELF, switch_br_769_9_articulated, extra_callback_info1) {
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_ohle, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_ohle, position_in_articulated_veh % 4) {
1: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_3rdr, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_3rdr, position_in_articulated_veh % 4) {
// No effects on 3RDR (for now...)
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_diesel, position_in_consist % 4) {
switch(FEAT_TRAINS, SELF, switch_br_769_9_particles_diesel, position_in_articulated_veh % 4) {
0: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
3: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 2, DISABLE_WAGON_POWER);
Expand All @@ -45,6 +45,7 @@ switch(FEAT_TRAINS, SELF, switch_br_769_9_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_769_9_can_attach_wagon, vehicle_type_id) {
item_br_769_9: return CB_RESULT_ATTACH_ALLOW;
item_br_769: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand Down
12 changes: 8 additions & 4 deletions src/trains/bmu/800-0-2.pnml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Livery callbacks
switch(FEAT_TRAINS, SELF, switch_br_800_5car_spriteset_lner, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_800_5car_spriteset_lner, position_in_articulated_veh % 5) {
0: spriteset_br_800_front_lner;
4: switch_br_800_spriteset_rear_lner;
spriteset_br_800_middle_lner;
}

switch(FEAT_TRAINS, SELF, switch_br_800_5car_spriteset_gwr, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_800_5car_spriteset_gwr, position_in_articulated_veh % 5) {
0: spriteset_br_800_front_gwr;
4: switch_br_800_spriteset_rear_gwr;
spriteset_br_800_middle_gwr;
Expand All @@ -28,14 +28,14 @@ switch(FEAT_TRAINS, SELF, switch_br_800_5car_articulated, extra_callback_info1)
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_800_5car_particles_diesel, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_800_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_br_800_5car_particles_electric, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_800_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);
Expand All @@ -56,6 +56,10 @@ switch(FEAT_TRAINS, SELF, switch_br_800_5car_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_800_5car_can_attach_wagon, vehicle_type_id) {
item_br_800_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_800_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_802_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_802_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_805: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand Down
12 changes: 8 additions & 4 deletions src/trains/bmu/800-1-3.pnml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Livery callbacks
switch(FEAT_TRAINS, SELF, switch_br_800_9car_spriteset_lner, position_in_consist % 9) {
switch(FEAT_TRAINS, SELF, switch_br_800_9car_spriteset_lner, position_in_articulated_veh % 9) {
0: spriteset_br_800_front_lner;
8: switch_br_800_spriteset_rear_lner;
spriteset_br_800_middle_lner;
}

switch(FEAT_TRAINS, SELF, switch_br_800_9car_spriteset_gwr, position_in_consist % 9) {
switch(FEAT_TRAINS, SELF, switch_br_800_9car_spriteset_gwr, position_in_articulated_veh % 9) {
0: spriteset_br_800_front_gwr;
8: switch_br_800_spriteset_rear_gwr;
spriteset_br_800_middle_gwr;
Expand All @@ -29,14 +29,14 @@ switch(FEAT_TRAINS, SELF, switch_br_800_9car_articulated, extra_callback_info1)
}

// Only give particle effects to front/rear cars
switch(FEAT_TRAINS, SELF, switch_br_800_9car_particles_electric, position_in_consist % 9) {
switch(FEAT_TRAINS, SELF, switch_br_800_9car_particles_electric, position_in_articulated_veh % 9) {
// 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);
8: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}

switch(FEAT_TRAINS, SELF, switch_br_800_9car_particles_diesel, position_in_consist % 9) {
switch(FEAT_TRAINS, SELF, switch_br_800_9car_particles_diesel, position_in_articulated_veh % 9) {
0: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
8: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 2, DISABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
Expand All @@ -55,6 +55,10 @@ switch(FEAT_TRAINS, SELF, switch_br_800_9car_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_800_9car_can_attach_wagon, vehicle_type_id) {
item_br_800_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_800_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_802_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_802_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_805: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand Down
14 changes: 9 additions & 5 deletions src/trains/bmu/802-0-2-3.pnml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Livery callbacks
switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_tpx, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_tpx, position_in_articulated_veh % 5) {
0: spriteset_br_800_front_tpx;
4: switch_br_800_spriteset_rear_tpx;
spriteset_br_800_middle_tpx;
}

switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_gwr, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_gwr, position_in_articulated_veh % 5) {
0: spriteset_br_800_front_gwr;
4: switch_br_800_spriteset_rear_gwr;
spriteset_br_800_middle_gwr;
}

switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_hull, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_802_5car_spriteset_hull, position_in_articulated_veh % 5) {
0: spriteset_br_800_front_hull;
4: switch_br_800_spriteset_rear_hull;
spriteset_br_800_middle_hull;
Expand All @@ -35,14 +35,14 @@ switch(FEAT_TRAINS, SELF, switch_br_802_5car_articulated, extra_callback_info1)
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars
}

switch(FEAT_TRAINS, SELF, switch_br_802_5car_particles_diesel, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_802_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_br_802_5car_particles_electric, position_in_consist % 5) {
switch(FEAT_TRAINS, SELF, switch_br_802_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);
Expand All @@ -63,6 +63,10 @@ switch(FEAT_TRAINS, SELF, switch_br_802_5car_start_stop, num_vehs_in_consist) {
// Only allow the same train type to be added to itself
switch(FEAT_TRAINS, SELF, switch_br_802_5car_can_attach_wagon, vehicle_type_id) {
item_br_802_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_802_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_800_5car: return CB_RESULT_ATTACH_ALLOW;
item_br_800_9car: return CB_RESULT_ATTACH_ALLOW;
item_br_805: return CB_RESULT_ATTACH_ALLOW;
return string(STR_CANNOT_ATTACH);
}

Expand Down
Loading

0 comments on commit 4541267

Please sign in to comment.