Skip to content

Commit

Permalink
Added Standard 9F
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Mar 31, 2024
1 parent dd1450b commit e46c8a8
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 6 deletions.
Binary file modified docs/SpriteIDs.xlsx
Binary file not shown.
Binary file modified gfx/Steam/Standard9F.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ str_GWRCastle_usage :Express Passenger
str_GWRCastle_eos :1923
str_GWRCastle_liveries :GWR Green

STR_NAME_GWRHall :GWR 4-6-0 "Hall" Class
str_GWRHall_usage :Express Passenger
str_GWRHall_eos :1946
str_GWRHall_liveries :GWR Green, Hogwarts Express
STR_NAME_GWRHall :GWR 4-6-0 "Hall" Class
str_GWRHall_usage :Express Passenger
str_GWRHall_eos :1946
str_GWRHall_liveries :GWR Green, Hogwarts Express

STR_NAME_GNRA1 :GNR Gresley A1
str_GNRA1_usage :Express Passenger
Expand All @@ -231,6 +231,11 @@ str_LNERA3_usage :Express Passenger
str_LNERA3_eos :1959-1966
str_LNERA3_liveries :LNER Green, BR Wartime Black, BR Apple Green, BR Brunswick Green

STR_NAME_Standard9F :BR Standard Class 9F
str_Standard9F_usage :Freight/Mixed Traffic
str_Standard9F_eos :1935
str_Standard9F_liveries :BR Black, BR Green

STR_NAME_BluePullman_6Car :British Rail 'Blue Pullman' (6 car)
STR_NAME_BluePullman_8Car :British Rail 'Blue Pullman' (8 car)
str_BluePullman_usage :Express Passenger
Expand Down
1 change: 1 addition & 0 deletions src/sortpurchase.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sort(FEAT_TRAINS, [
item_GWRHall,
item_GNRA1,
item_LNERA3,
item_Standard9F,
item_BR08,
item_BR13,
item_BR31,
Expand Down
16 changes: 14 additions & 2 deletions src/templates.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ template template_train12px(x,y){
[ x+83, y, 12, 12, -5, -7]
}

template template_train16px(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
[ x, y, 8, 17, -3, -11]
[ x+9, y, 14, 13, -6, -9]
[ x+24, y, 16, 12, 0, -7]
[ x+41, y, 14, 13, 1, -5]
[ x+56, y, 8, 17, -3, -5]
[ x+65, y, 14, 13, -14, -5]
[ x+80, y, 16, 12, -15, -8]
[ x+97, y, 14, 13, -7, -10]
}

template template_train20px(x,y){ // Clone to 4view when changed
//left_x, upper_y, width, height, offset_x, offset_y
[ x, y, 8, 18, -3, -11]
Expand Down Expand Up @@ -122,11 +134,11 @@ template template_train32px(x,y){

template template_train32px_anim(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
[ x, y, 8, 24, -4, -10, ANIM|NOWHITE]
[ x, y, 8, 24, -3, -12, ANIM|NOWHITE]
[ x+9, y, 21, 18, -13, -10, ANIM|NOWHITE]
[ x+31, y, 32, 12, -16, -8, ANIM|NOWHITE]
[ x+64, y, 21, 18, -7, -11, ANIM|NOWHITE]
[ x+86, y, 8, 24, -4, -10, ANIM|NOWHITE]
[ x+86, y, 8, 24, -3, -12, ANIM|NOWHITE]
[ x+95, y, 21, 18, -13, -10, ANIM|NOWHITE]
[ x+117, y, 32, 12, -15, -8, ANIM|NOWHITE]
[ x+150, y, 21, 18, -7, -11, ANIM|NOWHITE]
Expand Down
99 changes: 99 additions & 0 deletions src/trains/steam/Standard9F.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
spriteset(spriteset_Standard9F_Purchase, "gfx/Steam/Standard9F.png") {
template_purchase_anim(0, 0)
}

spriteset(spriteset_Standard9F_BRBlack, "gfx/Steam/Standard9F.png") {
template_train32px_anim(0, 13)
}
spriteset(spriteset_Standard9FTender_BRBlack, "gfx/Steam/Standard9F.png") {
template_train16px(0, 38)
}

spriteset(spriteset_Standard9F_BRGreen, "gfx/Steam/Standard9F.png") {
template_train32px_anim(0, 56)
}
spriteset(spriteset_Standard9FTender_BRGreen, "gfx/Steam/Standard9F.png") {
template_train16px(0, 81)
}

switch(FEAT_TRAINS,SELF, sw_Standard9FLoco,cargo_subtype){
0: spriteset_Standard9F_BRBlack;
1: spriteset_Standard9F_BRGreen;
}

switch(FEAT_TRAINS,SELF, sw_Standard9FTender,cargo_subtype){
0: spriteset_Standard9FTender_BRBlack;
1: spriteset_Standard9FTender_BRGreen;
}

switch(FEAT_TRAINS,SELF,sw_Standard9F_cargo_subtype_text,cargo_subtype){
0: return string(str_BRBlack);
1: return string(str_BRGreen);
return CB_RESULT_NO_TEXT;
}

switch(FEAT_TRAINS, SELF, sw_Standard9F, position_in_articulated_veh){
0: sw_Standard9FLoco;
1: sw_Standard9FTender;
}

switch(FEAT_TRAINS, SELF, sw_Standard9F_length, position_in_articulated_veh) {
0: return 8;
1: return 4;
}

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

item (FEAT_TRAINS, item_Standard9F, 587) {
property {
name: string(STR_NAME_Standard9F);
climates_available: ALL_CLIMATES;
introduction_date: date(1954,2,4);
model_life: 2;
retire_early: 1;
vehicle_life: 10;
reliability_decay: 7;
refittable_cargo_classes: 0;
cargo_allow_refit: [GOOD];
loading_speed: 3;
cost_factor: 26;
running_cost_factor: 30;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 90 mph;
misc_flags: TRAIN_FLAG_NO_BREAKDOWN_SMOKE;
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_CARGO;
power: 2400 hp;
running_cost_base: RUNNING_COST_STEAM;
dual_headed: 0;
default_cargo_type: GOOD;
cargo_capacity: 1;
weight: 139 ton;
engine_class: ENGINE_CLASS_STEAM;
tractive_effort_coefficient: 0.3;
air_drag_coefficient: 0.1;
length: 8;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_STEAM;
extra_weight_per_wagon: 0;
bitmask_vehicle_info: 0;
}
graphics {
additional_text: return(string(str_purchase_loco_with_liveries,string(str_purchase_type_steam),string(str_route_9),string(str_Standard9F_usage),string(str_Standard9F_eos),string(str_Standard9F_liveries)));
can_attach_wagon: CB_RESULT_ATTACH_ALLOW;
cargo_capacity: return 0;
cargo_subtype_text: sw_Standard9F_cargo_subtype_text;
articulated_part: sw_articulated_Standard9F;
default: sw_Standard9F;
purchase: spriteset_Standard9F_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
create_effect: steam_create_visual_effect;
sound_effect: sw_steam_sound;
cost_factor: return(GetAdjustedCost(26));
running_cost_factor: return(GetAdjustedCost(30));
length: sw_Standard9F_length;
}
}

0 comments on commit e46c8a8

Please sign in to comment.