-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Class 810, re-added Class 805 (now running on National Rail net…
…work)
- Loading branch information
Showing
6 changed files
with
281 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |