Skip to content

Commit

Permalink
Added BR504
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Mar 20, 2024
1 parent 600f63e commit ff56220
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 0 deletions.
Binary file modified docs/SpriteIDs.xlsx
Binary file not shown.
Binary file modified gfx/BR504.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,11 @@ str_BR73GatEx_eos :1999
str_BR73GatEx_liveries :Gatwick Express
BR488 :Class 488 Coach

STR_NAME_BR504 :British Rail Class 504
str_BR504_usage :Urban Passenger
str_BR504_eos :---
str_BR504_liveries :BR Blue, BR Green, GMPTE, BR Blue (Wlternate), BR Blue (Wraparound)

STR_NAME_BR507 :British Rail Class 507
str_BR507_usage :Urban Passenger
str_BR507_eos :---
Expand Down Expand Up @@ -1203,6 +1208,8 @@ str_BangerBlue_Stripe : (Banger Blue with White Stripe)
str_BP : (BP)
str_BRBlack : (BR Black)
str_BRBlue : (BR Blue)
str_BRBlueAlt : (BR Blue - Alternate)
str_BRBlueWrap : (BR Blue - Wraparound)
str_BRBlueHeadlight : (BR Blue with Headlight)
str_BRBlueGrey : (BR Blue Grey)
str_BRBlueCentre : (BR Blue - Centre Headcode)
Expand Down
1 change: 1 addition & 0 deletions src/sortpurchase.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ sort(FEAT_TRAINS, [
item_BR480,
item_BR483,
item_BR484,
item_BR504,
item_BR507,
item_BR508_1,
item_BR508_2,
Expand Down
77 changes: 77 additions & 0 deletions src/trains/_spriteset/EMU_Sprites/504.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
spriteset(spriteset_BR504_Purchase, "gfx/BR504.png") {
template_purchase(0, 0)
}

spriteset(spriteset_BR504a_BRBlue, "gfx/BR504.png") {
template_train32px(0, 13)
}
spriteset(spriteset_BR504b_BRBlue, "gfx/BR504.png") {
template_train32px(0, 38)
}
spriteset(spriteset_BR504c_BRBlue, "gfx/BR504.png") {
template_train32px(0, 63)
}

spriteset(spriteset_BR504a_GMPTE, "gfx/BR504.png") {
template_train32px(0, 88)
}
spriteset(spriteset_BR504b_GMPTE, "gfx/BR504.png") {
template_train32px(0, 113)
}
spriteset(spriteset_BR504c_GMPTE, "gfx/BR504.png") {
template_train32px(0, 138)
}

spriteset(spriteset_BR504a_BRGreen, "gfx/BR504.png") {
template_train32px(0, 163)
}
spriteset(spriteset_BR504b_BRGreen, "gfx/BR504.png") {
template_train32px(0, 188)
}
spriteset(spriteset_BR504c_BRGreen, "gfx/BR504.png") {
template_train32px(0, 213)
}

spriteset(spriteset_BR504a_BRBlueAlt, "gfx/BR504.png") {
template_train32px(0, 238)
}
spriteset(spriteset_BR504b_BRBlueAlt, "gfx/BR504.png") {
template_train32px(0, 263)
}
spriteset(spriteset_BR504c_BRBlueAlt, "gfx/BR504.png") {
template_train32px(0, 288)
}

spriteset(spriteset_BR504a_BRBlueWrap, "gfx/BR504.png") {
template_train32px(0, 313)
}
spriteset(spriteset_BR504b_BRBlueWrap, "gfx/BR504.png") {
template_train32px(0, 338)
}
spriteset(spriteset_BR504c_BRBlueWrap, "gfx/BR504.png") {
template_train32px(0, 363)
}

switch(FEAT_TRAINS,SELF, sw_BR504a,cargo_subtype){
0: spriteset_BR504a_BRBlue;
1: spriteset_BR504a_GMPTE;
2: spriteset_BR504a_BRGreen;
3: spriteset_BR504a_BRBlueAlt;
4: spriteset_BR504a_BRBlueWrap;
}

switch(FEAT_TRAINS,SELF, sw_BR504b,cargo_subtype){
0: spriteset_BR504b_BRBlue;
1: spriteset_BR504b_GMPTE;
2: spriteset_BR504b_BRGreen;
3: spriteset_BR504b_BRBlueAlt;
4: spriteset_BR504b_BRBlueWrap;
}

switch(FEAT_TRAINS,SELF, sw_BR504c,cargo_subtype){
0: spriteset_BR504c_BRBlue;
1: spriteset_BR504c_GMPTE;
2: spriteset_BR504c_BRGreen;
3: spriteset_BR504c_BRBlueAlt;
4: spriteset_BR504c_BRBlueWrap;
}
67 changes: 67 additions & 0 deletions src/trains/emu/BR504.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
switch(FEAT_TRAINS, SELF, switch_br504_spriteset, position_in_articulated_veh % 2) {
0: sw_BR504a;
sw_BR504b;
}

switch (FEAT_TRAINS, SELF, switch_articulated_BR504, extra_callback_info1) {
1: return item_BR504;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS; //stop adding vehicle parts
}

switch(FEAT_TRAINS,SELF,sw_BR504_cargo_subtype_text,cargo_subtype){
0: return string(str_BRBlue);
1: return string(str_GMPTE);
2: return string(str_BRGreen);
3: return string(str_BRBlueAlt);
4: return string(str_BRBlueWrap);
return CB_RESULT_NO_TEXT;
}

item (FEAT_TRAINS, item_BR504, 577) {
property {
name: string(STR_NAME_BR504);
climates_available: ALL_CLIMATES;
introduction_date: date(1959,4,21);
model_life: 15;
retire_early: 1;
vehicle_life: 50;
reliability_decay: 7;
refittable_cargo_classes: CC_PASSENGERS;
cargo_allow_refit: [PASS, TOUR];
loading_speed: 25;
cost_factor: 65;
running_cost_factor: 38;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 65 mph;
misc_flags: TRAIN_FLAG_MU;
refit_cost: 0;
track_type: BR_3RDR;
ai_special_flag: AI_FLAG_CARGO;
power: 561 hp;
running_cost_base: RUNNING_COST_ELECTRIC;
dual_headed: 0;
default_cargo_type: PASS;
cargo_capacity: 90;
weight: 41 ton;
engine_class: ENGINE_CLASS_ELECTRIC;
tractive_effort_coefficient: 0.07;
air_drag_coefficient: 0.07;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_ELECTRIC;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
cargo_age_period: 185;
}
graphics {
additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_emu),string(str_route_2),string(str_BR504_usage),string(str_BR504_eos),string(str_BR504_liveries)));
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_subtype_text: sw_BR504_cargo_subtype_text;
articulated_part: switch_articulated_BR504;
default: switch_br504_spriteset;
purchase: spriteset_BR504_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
create_effect: electric_create_visual_effect;
sound_effect: sw_classic_emu_sound;
cargo_capacity: return(90 * param_pax);
}
}

0 comments on commit ff56220

Please sign in to comment.