Skip to content

Commit

Permalink
Added Class 59 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Aug 25, 2024
1 parent 95e710b commit 6610a7c
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 5 deletions.
Binary file modified docs/SpriteIDs.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- GWR 5700/6700/8750 Class (needs coding)
- Conflat A (needs coding)
- Conflat B (needs coding)
- Class 59 (code liveries and add to lang file)

# v2.13
- Added LNER J70
Expand Down
9 changes: 6 additions & 3 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,13 @@ str_BR58_usage :Heavy Freight
str_BR58_eos :---
str_BR58_liveries :Railfreight (2 Tone Grey, 3 Tone Grey, 3 Tone Grey Coal Sector, Mainline Grey, Mainline Blue)

STR_NAME_BR59 :BR Class 59 "Super Shed"
STR_NAME_BR59_01 :BR Class 59/0/1 "Super Shed"
STR_NAME_BR59_2 :BR Class 59/2 "Super Shed"
str_BR59_usage :Mixed Freight
str_BR59_eos :---
str_BR59_liveries :
str_BR59_01_eos :---
str_BR59_01_liveries :
str_BR59_2_eos :---
str_BR59_2_liveries :

STR_NAME_BR60 :BR Class 60 "Tug"
str_BR60_usage :Mixed Freight
Expand Down
4 changes: 3 additions & 1 deletion src/append/debugmode_switch.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

// Disable some trains that aren't finished
disable_item(FEAT_TRAINS, 671); // Class 20
disable_item(FEAT_TRAINS, 674); // Stephenson's Planet
disable_item(FEAT_TRAINS, 674); // Stephenson's Planet
disable_item(FEAT_TRAINS, 694); // Class 59/01
disable_item(FEAT_TRAINS, 695); // Class 59/2

// Disable some trains that only exist for template alignment or debugging
disable_item(FEAT_TRAINS, 9999); // Debug variant header
Expand Down
2 changes: 2 additions & 0 deletions src/sortpurchase.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ sort(FEAT_TRAINS, [
item_BR55,
item_BR57,
item_BR58,
item_BR59_01,
item_BR59_2,
item_BR60,
item_BR66,
item_BR67,
Expand Down
65 changes: 65 additions & 0 deletions src/trains/diesel_loco/59_01.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
spriteset(spriteset_BR59_01_Purchase, "gfx/Diesel/66.png") {
template_purchase(0, 0)
}

spriteset(spriteset_BR59_01_FL, "gfx/Diesel/66.png") {
template_train32px(0, 13)
}

switch(FEAT_TRAINS,SELF, sw_BR59_01,cargo_subtype){
0: spriteset_BR59_01_FL;
spriteset_BR59_01_FL; // Default because we removed some livery variants, avoids a breaking change
}

switch(FEAT_TRAINS,SELF,sw_BR59_01_cargo_subtype_text,cargo_subtype){
0: return string(str_Freightliner);
return CB_RESULT_NO_TEXT;
}

item (FEAT_TRAINS, item_BR59_01, 694) {
property {
name: string(STR_NAME_BR59_01);
climates_available: ALL_CLIMATES;
introduction_date: date(1994,2,17);
model_life: 10;
retire_early: 1;
vehicle_life: 40;
reliability_decay: 7;
refittable_cargo_classes: 0;
cargo_allow_refit: [GOOD, FOOD];
loading_speed: 3;
cost_factor: 1;
running_cost_factor: 1;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 60 mph;
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_CARGO;
power: 3300 hp;
running_cost_base: RUNNING_COST_DIESEL;
dual_headed: 0;
default_cargo_type: GOOD;
cargo_capacity: 1;
weight: 126 ton;
engine_class: ENGINE_CLASS_DIESEL;
tractive_effort_coefficient: 0.2357;
air_drag_coefficient: 0.07;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_DIESEL;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
}
graphics {
additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_diesel),string(str_BR59_usage),string(str_BR59_01_eos),string(str_BR59_01_liveries)));
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR59_01_cargo_subtype_text;
default: sw_BR59_01;
purchase: spriteset_BR59_01_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
create_effect: diesel_create_visual_effect;
sound_effect: sw_66_sound;
cost_factor: return(GetAdjustedCost(48));
running_cost_factor: return(GetAdjustedCost(42));
}
}
65 changes: 65 additions & 0 deletions src/trains/diesel_loco/59_2.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
spriteset(spriteset_BR59_2_Purchase, "gfx/Diesel/66.png") {
template_purchase(0, 0)
}

spriteset(spriteset_BR59_2_FL, "gfx/Diesel/66.png") {
template_train32px(0, 13)
}

switch(FEAT_TRAINS,SELF, sw_BR59_2,cargo_subtype){
0: spriteset_BR59_2_FL;
spriteset_BR59_2_FL; // Default because we removed some livery variants, avoids a breaking change
}

switch(FEAT_TRAINS,SELF,sw_BR59_2_cargo_subtype_text,cargo_subtype){
0: return string(str_Freightliner);
return CB_RESULT_NO_TEXT;
}

item (FEAT_TRAINS, item_BR59_2, 695) {
property {
name: string(STR_NAME_BR59_2);
climates_available: ALL_CLIMATES;
introduction_date: date(1986,2,17);
model_life: 10;
retire_early: 1;
vehicle_life: 40;
reliability_decay: 7;
refittable_cargo_classes: 0;
cargo_allow_refit: [GOOD, FOOD];
loading_speed: 3;
cost_factor: 1;
running_cost_factor: 1;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 75 mph;
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_CARGO;
power: 3300 hp;
running_cost_base: RUNNING_COST_DIESEL;
dual_headed: 0;
default_cargo_type: GOOD;
cargo_capacity: 1;
weight: 126 ton;
engine_class: ENGINE_CLASS_DIESEL;
tractive_effort_coefficient: 0.2357;
air_drag_coefficient: 0.07;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_DIESEL;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
}
graphics {
additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_diesel),string(str_BR59_usage),string(str_BR59_2_eos),string(str_BR59_2_liveries)));
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_BR59_2_cargo_subtype_text;
default: sw_BR59_2;
purchase: spriteset_BR59_2_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
create_effect: diesel_create_visual_effect;
sound_effect: sw_66_sound;
cost_factor: return(GetAdjustedCost(43));
running_cost_factor: return(GetAdjustedCost(37));
}
}
2 changes: 1 addition & 1 deletion src/trains/diesel_loco/66.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ item (FEAT_TRAINS, item_BR66, 266) {
introduction_date: date(1998,4,21);
model_life: VEHICLE_NEVER_EXPIRES;
retire_early: 1;
vehicle_life: 70;
vehicle_life: 40;
reliability_decay: 7;
refittable_cargo_classes: 0;
cargo_allow_refit: [GOOD, FOOD];
Expand Down

0 comments on commit 6610a7c

Please sign in to comment.