-
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.
Re-added 720/1 to avoid compatibility breaking
- Loading branch information
Showing
4 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
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,106 @@ | ||
// Choose sprites depending on car position | ||
switch(FEAT_TRAINS, SELF, switch_br_720_1_spriteset_GA, position_in_articulated_veh % 10) { | ||
0: spriteset_br_720_front_GA; | ||
6: spriteset_br_720_middle_panto_GA; | ||
9: spriteset_br_720_rear_GA; | ||
spriteset_br_720_middle_GA; | ||
} | ||
|
||
switch(FEAT_TRAINS, SELF, switch_br_720_1_spriteset_C2C, position_in_articulated_veh % 10) { | ||
0: spriteset_br_720_front_C2C; | ||
6: spriteset_br_720_middle_panto_C2C; | ||
9: spriteset_br_720_rear_C2C; | ||
spriteset_br_720_middle_C2C; | ||
} | ||
|
||
switch(FEAT_TRAINS, SELF, switch_br_720_1_spriteset, cargo_subtype) { | ||
0: switch_br_720_1_spriteset_GA; | ||
1: switch_br_720_1_spriteset_C2C; | ||
} | ||
|
||
switch(FEAT_TRAINS, SELF, switch_br_720_1_subtype_text, cargo_subtype) { | ||
0: return string(str_GreaterAnglia); | ||
1: return string(str_C2C); | ||
return CB_RESULT_NO_TEXT; | ||
} | ||
|
||
// Define articulations | ||
switch(FEAT_TRAINS, SELF, switch_br_720_1_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..9: return item_br_720_1; | ||
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; // Stop adding more cars | ||
} | ||
|
||
// Only give particle effects to front/rear cars | ||
switch(FEAT_TRAINS, SELF, switch_br_720_1_particles, position_in_articulated_veh % 10) { | ||
6: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC , 2, DISABLE_WAGON_POWER); | ||
visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER); | ||
} | ||
|
||
// Start/stop switch, used to limit maximum length | ||
switch(FEAT_TRAINS, SELF, switch_br_720_1_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_br_720_1_can_attach_wagon, vehicle_type_id) { | ||
item_br_720_1: return CB_RESULT_ATTACH_ALLOW; | ||
item_br_720: return CB_RESULT_ATTACH_ALLOW; | ||
return string(STR_CANNOT_ATTACH); | ||
} | ||
|
||
|
||
item(FEAT_TRAINS, item_br_720_1, 447) { | ||
property { | ||
name: string(STR_BR_720_1); | ||
climates_available: NO_CLIMATE; // available in all climates | ||
introduction_date: date(2020, 03, 17); | ||
model_life: VEHICLE_NEVER_EXPIRES; // keep available forever | ||
vehicle_life: 30; // 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: 170; | ||
loading_speed: 25; | ||
running_cost_factor: 100; | ||
cargo_allow_refit: []; | ||
cargo_disallow_refit: []; | ||
|
||
speed: 100 mph; | ||
power: 4200 hp; | ||
cargo_capacity: (1390/10); | ||
weight: 330 ton; | ||
|
||
sprite_id: SPRITE_ID_NEW_TRAIN; // required | ||
misc_flags: bitmask(TRAIN_FLAG_MU); // acts as multiple-unit | ||
refit_cost: 0; | ||
track_type: railtype("ELRL"); | ||
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_ELECTRIC; // 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_br_720_1_spriteset; | ||
purchase: spriteset_br_720_purchase; | ||
cargo_subtype_text: switch_br_720_1_subtype_text; | ||
|
||
articulated_part: switch_br_720_1_articulated; | ||
start_stop: switch_br_720_1_start_stop; | ||
can_attach_wagon: switch_br_720_1_can_attach_wagon; | ||
visual_effect_and_powered: switch_br_720_1_particles; | ||
additional_text: string(STR_DSC_BR_720); | ||
cargo_capacity: return(1390/10 * param_pax); | ||
cost_factor: return(GetAdjustedCost(170)); | ||
running_cost_factor: return(GetAdjustedCost(100)); | ||
} | ||
} |