Skip to content

Commit

Permalink
Merge pull request #102 from CR400-BF-5033/main
Browse files Browse the repository at this point in the history
ADD CRH380AL_2541
  • Loading branch information
JohnFranklin523 authored Feb 19, 2025
2 parents 6f6b7c6 + 31b1390 commit 981492b
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 1 deletion.
1 change: 1 addition & 0 deletions chinasettrains.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
#include "src/25-emu/crh5gjt.pnml"
#include "src/25-emu/crh380a.pnml"
#include "src/25-emu/crh380al.pnml"
#include "src/25-emu/crh380al_2541.pnml"
#include "src/25-emu/crh380aj.pnml"
#include "src/25-emu/crh380b.pnml"
#include "src/25-emu/crh380bl.pnml"
Expand Down
3 changes: 2 additions & 1 deletion docs/contributor.csv
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CRH5GJT,,,Qipaoxian,
CRH5E,,Babel,Qipaoxian,
CR200JSG,,"5033,Babel","5033,EMB,Babel",
CRH380AJ,,"5033,Babel","Qipaoxian,Haiyan",
CRH380AL_2541,,5033,"Qipaoxian,Babel",
DJF1,,Babel,Qipaoxian,
CRH2A4020,,Babel,Babel,
JF1,jf1,JF,EMB,
Expand Down Expand Up @@ -255,4 +256,4 @@ RZ225C,,Babel,Haiyan,
CA25C,,Babel,Haiyan,
SYZ25,,Babel,Haiyan,
SRZ25,,Babel,Haiyan,
25SM Series,,Babel,Haiyan,
25SM Series,,Babel,Haiyan,
2 changes: 2 additions & 0 deletions docs/str.CSV
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ STR_NAME_CRH5G,CRH5G (EMU),CRH5G (电力动车)
STR_NAME_CRH5GJT,CRH5G (Technology-Enhanced) (EMU),CRH5G (技术提升型) (电力动车)
STR_NAME_CRH380A,CRH380A (EMU),CRH380A (电力动车)
STR_NAME_CRH380AL,CRH380AL (Long Version) (EMU),CRH380AL (长编组) (电力动车)
STR_NAME_CRH380AL_2541,CRH380AL-2541 (Long Version) (EMU) (Speed of impact test),CRH380AL-2541 (长编组) (电力动车) (冲高试验速度)
STR_NAME_CRH380AJ,CRH380AL (EMU) (Diagnostic Train),CRH380AJ (电力动车) (综合检测列车)
STR_NAME_CRH380B,CRH380B (EMU),CRH380B (电力动车)
STR_NAME_CRH380BL,CRH380BL (Long Version) (EMU),CRH380BL (长编组) (电力动车)
Expand Down Expand Up @@ -733,6 +734,7 @@ STR_DJJ2_321_KMH, - {GOLD}321.5 km/h{BLACK}. Broke the Highest Speed Record of C
STR_350_AVAILABLE,Refittable to Max Speed 350 km/h (Increasing running costs),可改装为最高速度 350 km/h,运营费用增加
STR_350_380_AVAILABLE,Refittable to Max Speed 350 or 380 km/h (Increasing running costs),可改装为最高速度 350 或 380 km/h,运营费用增加
STR_DJJ2_321_AVAILABLE,This train has broke the Highest Speed Record of China's Railway by {GOLD}321.5 km/h{BLACK} on 27th Oct. 2002. Refittable to this speed (Increasing running costs),这列车曾经在2002年10月27日创下了当时中国铁路的最高速321.5 km/h。可改装到这一速度,运营费用增加
STR_CRH380AL_2541_486_AVAILABLE,"On the 13 of December, 2010, the train achieved the then-world's highest operational testing speed of 486.1 km/h.",这列车曾经在2010年12月13日创下了当时世界铁路运营试验最高速486.1 km/h
STR_CRH380AJ_AVAILABLE,Refittable to Max Speed 452 km/h ,可改装为最高速度 452 km/h
# Livery,,
STR_LV_PRE_GRAY,{GRAY} - Gray,{GRAY} - 灰色
Expand Down
104 changes: 104 additions & 0 deletions src/25-emu/crh380al_2541.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
switch (FEAT_TRAINS, SELF, switch_crh380al_2541_name_purchase, getbits(extra_callback_info1, 0, 8) == 0x20? getbits(extra_callback_info1, 8, 8) : 0xFFFF) {
0: return string(STR_CRH380A_SERIES);
1: return string(STR_NAME_CRH380AL_2541);
return CB_RESULT_NO_TEXT;
}

switch (FEAT_TRAINS, SELF, switch_crh380al_2541_name, getbits(extra_callback_info1, 0, 8)) {
0x20: switch_crh380al_2541_name_purchase;
return CB_RESULT_NO_TEXT;
}

switch (FEAT_TRAINS, SELF, switch_crh380al_2541_articulated_part, extra_callback_info1) {
1..47: return crh380al_2541;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}

switch (FEAT_TRAINS, SELF, switch_crh380al_2541_graphics, position_in_articulated_veh % 48) {
1: spriteset_crh380al_front;
4: spriteset_crh380al_middle_m;
7: spriteset_crh380al_middle_m;
10: spriteset_crh380al_middle_m;
13: spriteset_crh380al_middle_p;
16: spriteset_crh380al_middle_m;
19: spriteset_crh380al_middle_m;
22: spriteset_crh380al_middle_m;
25: spriteset_crh380al_middle_m;
28: spriteset_crh380al_middle_m;
31: spriteset_crh380al_middle_m;
34: spriteset_crh380al_middle_m;
37: spriteset_crh380al_middle_p;
40: spriteset_crh380al_middle_m;
43: spriteset_crh380al_middle_m;
46: spriteset_crh380al_cab;
empty_sprites;
}

switch (FEAT_TRAINS, SELF, onlycrh380al_2541, vehicle_type_id) {
crh380al_2541: onlyallowcst;
return CB_RESULT_ATTACH_DISALLOW;
}

item (FEAT_TRAINS, crh380al_2541) {
property {
// Menu
name: string(STR_NAME_CRH380AL_2541);
sprite_id: SPRITE_ID_NEW_TRAIN;
misc_flags: bitmask(TRAIN_FLAG_AUTOREFIT, TRAIN_FLAG_MU);
engine_class: ENGINE_CLASS_ELECTRIC;
variant_group: 9238;

// Availability
climates_available: ALL_CLIMATES;
introduction_date: date(2010,10,01);
model_life: VEHICLE_NEVER_EXPIRES;
vehicle_life: 25;
track_type: SAAA;

// Cargo
refittable_cargo_classes: bitmask(CC_PASSENGERS);
non_refittable_cargo_classes: 0;
cargo_allow_refit: [PASS, TOUR, YETI, YETY];
cargo_disallow_refit: [];
refit_cost: 0;
default_cargo_type: PASS;
ai_special_flag: AI_FLAG_PASSENGER;
cargo_capacity: 1;
loading_speed: 8 << param_loading_speed;
cargo_age_period: 400 << param_cargo_decay;

// Stats
speed: 486 km/h;
power: 11200 kW;
weight: 409 ton;
tractive_effort_coefficient: 0.6225;
cost_factor: 68;
running_cost_base: RUNNING_COST_ELECTRIC;
running_cost_factor: 0;
reliability_decay: 12;
bitmask_vehicle_info: bitmask(2);

}
graphics {
// Menu
additional_text: string(STR_DESC_2, string(STR_CRH380AL_2541_486_AVAILABLE), string(STR_RELDEC_LOW, 12));
can_attach_wagon: onlycrh380al_2541;
start_stop: mu4to24car;

// Graphics
default: switch_crh380al_2541_graphics;
purchase: spriteset_crh380al_purchase_original;
articulated_part: switch_crh380al_2541_articulated_part;

// Stats
length: switch_length_2_8_2;
purchase_tractive_effort_coefficient: return int(0.083*255);
cargo_capacity: 0;
cargo_age_period: 0;
cost_factor: 850;
running_cost_factor: 0;
purchase_running_cost_factor: 0;
purchase_cargo_capacity: 0;
name: switch_crh380al_2541_name;
}
}
1 change: 1 addition & 0 deletions src/vehiclesort.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ sort (FEAT_TRAINS, [
crh6f,
crh380a,
crh380al,
crh380al_2541,
crh380aj,
crh380b,
crh380bl,
Expand Down

0 comments on commit 981492b

Please sign in to comment.