Skip to content

Commit

Permalink
add caf-train (TungChung)
Browse files Browse the repository at this point in the history
  • Loading branch information
Babel-TTT committed Feb 11, 2025
1 parent 9e106e2 commit adcd56f
Show file tree
Hide file tree
Showing 15 changed files with 985 additions and 33 deletions.
492 changes: 479 additions & 13 deletions chinaset-mtraddon.nml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions chinaset-mtraddon.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@
#include "src/25kvmu/ikk-train.pnml"
#include "src/25kvmu/tml-ctrain.pnml"
#include "src/25kvmu/mtr380a.pnml"

//1500V EMUs
#include "src/1500vmu/caf-train-tungchung.pnml"
#include "src/1500vmu/caf-train-airport-express.pnml"


// Sort Vehicles
#include "src/vehiclesort.pnml"
8 changes: 4 additions & 4 deletions custom_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION :0.1.9
VERSION_STRING :0.1.9
TITLE :China Set: MTR Addon 0.1.9
VERSION :0.2.0
VERSION_STRING :0.2.0
TITLE :China Set: MTR Addon 0.2.0
FILENAME :chinaset-mtraddon.grf
REPO_HASH :
NEWGRF_VERSION :19
NEWGRF_VERSION :20
8 changes: 6 additions & 2 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
24/10/02 v8 by Babel
25/02/12 v0.2.2 by Babel
---------
Fix #2: Change offset of sprites template
Fix #3: param_cargo_decay can't effect on luggageroom of Yellowhead
Add: CAF Train(Airport Express and Tung Chung Line), MTR Luggage MU Wagon

24/10/02 v0.1.8 by Babel
---------
Fix #2: Change offset of sprites template

24/10/02 v0.1.7 by Babel
---------
Expand Down
12 changes: 11 additions & 1 deletion docs/str.CSV
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# STRING,ENGLISH,SIMPLIFIED CHINESE,TRADITIONAL CHINESE
STR_GRF_NAME,China Set: MTR Addon {VERSION_STRING},中国包:港铁追加包 {VERSION_STRING},中國包:港鐵追加包 {VERSION_STRING}
STR_GRF_DESC,This NewGRF add the vehicles of MTR to China Set.,为中国包追加了港铁的载具,為中國包增加了港鐵的載具。繁體中文缺少本地化人員,如有意向請加入我們discord群組https://discord.com/invte/hmWauemwse
STR_GRF_DESC,This NewGRF add the vehicles of MTR to China Set.,为中国包追加了港铁的载具,為中國包增加了港鐵的載具。{}繁體中文缺少本地化人員,如有意向請加入我們discord群組https://discord.com/invte/hmWauemwse
STR_GRF_URL,https://www.tt-forums.net/viewtopic.php?t=91092,,
STR_GRF_DESC_README,This NewGRF is in Early Access.Update in the future may broke the compatable.,仍在测试当中,可能存在不稳定情况。后续更新可能会破坏兼容,
STR_GRF_DESC_MTR,{RED}Caring for every journey,{RED}心系生活每一程,{RED}心系生活每一程
Expand Down Expand Up @@ -89,13 +89,15 @@ STR_ATTACH_MTR_EMU,{BLACK}Can be attached by EMUs used in {RED}MTR {BLACK}or {RE
STR_ATTACH_MTR_FIRST_EMU_WITH_MAILROOM,{BLACK}Can be only attached by EMUs used in {YELLOW}KCR Metro Commell Train (Exyrban Type),{BLACK}仅配属于{YELLOW}九广铁路都城嘉慕列车(远郊型),
STR_ATTACH_MTR_LUGGAGE_EMU,{BLACK}Can be only attached by EMUs used in {DKGREEN}CAF-Train (Airport Express Type){BLACK},{BLACK}仅配属于{DKGREEN}CAF-Train(机场快线型){BLACK},
STR_MTR_FIRST_CAN_ATTACH_WAGON,{BLACK}Can attach First-Class and Normal-Class EMU Coaches,{BLACK}可以挂载头等车厢和普通车厢,
STR_MTR_FIRST_LUGGAGE_CAN_ATTACH_WAGON,{BLACK}Can attach First-Class and Luggage EMU Coaches,{BLACK}可以挂载头等车厢和行李车厢,
STR_MTR_NORMAL_CAN_ATTACH_WAGON,{BLACK}Can attach Normal-Class EMU Coaches,{BLACK}可以挂载普通车厢,
# LENGTH OF VEHICLE,,,
STR_TOO_SHORT,TOO SHORT!,列车太短了,
STR_ONLY_TWO_SECTIONS,This locomotive must be in a consist of two sections to run.,该机车节数必须为2,否则无法运行,
STR_MUST_BE_4_8_12_16_CARS,"This MU must be in a consist of 4, 8, 12 or 16 cars to run.",该动车组节数必须为4,8,12或16,否则无法运行,
STR_MUST_BE_4_TO_24_CARS,This MU must be in a consist of 4 to 24 cars to run.,该动车组节数必须在4至24之间,否则无法运行,
STR_MUST_BE_4_TO_16_CARS,This MU must be in a consist of 4 to 16 cars to run.,该动车组节数必须在4至16之间,否则无法运行,
STR_MUST_BE_4_TO_12_CARS,This MU must be in a consist of 4 to 12 cars to run.,该动车组节数必须在4至16之间,否则无法运行,
STR_MUST_BE_3MULTI_CARS,"This MU must be in a consist of 3, 6, 9 ,12 ,15 or 18 cars to run.",该动车组节数必须为3,6,9,12,15或者18否则无法运行,
# HEADSEAT,,,
STR_FIRST_HEAD_SEAT,{BLACK}Head Seat: First-Class,{BLACK}车头坐席:头等,
Expand All @@ -107,6 +109,8 @@ STR_USEDLINE_XRL,{BLACK}Used Line: {RED}Guangzhou-Shenzhen-Hong Kong Express Rai
STR_USEDLINE_KCRC,{BLACK}Used Line: {LTBLUE}East Rail Line {BLACK}& {BROWN}Tuen Ma Line {BLACK}(Include {BROWN}Ma On Shan Line {BLACK}and {PURPLE}West Rail Line{BLACK}),{BLACK}使用的线路:{LTBLUE}东铁线{BLACK}和{BROWN}屯马线{BLACK}(包括{BROWN}马鞍山线{BLACK}和{PURPLE}西铁线{BLACK}),
STR_USEDLINE_ERL,{BLACK}Used Line: {LTBLUE}East Rail Line,{BLACK}使用的线路:{LTBLUE}东铁线,
STR_USEDLINE_TML,{BLACK}Used Line: {BROWN}Tuen Ma Line,{BLACK}使用的线路:{BROWN}屯马线,
STR_USEDLINE_AIRPORT_EXPRESS,{BLACK}Used Line: {DKGREEN}Airport Express,{BLACK}使用的线路:{DKGREEN}机场快线,
STR_USEDLINE_TCL,{BLACK}Used Line: {ORANGE}Tung Chung Line,{BLACK}使用的线路:{ORANGE}东涌线,
# VEHICLES,,,
# KTT,,,
STR_NAME_LOK2000,Lok 2000 (Electric),Lok 2000 (电力),
Expand Down Expand Up @@ -142,3 +146,9 @@ STR_NAME_MTR380A,MTR380A (EMU),MTR380A (电力动车),
STR_FULLNAME_MTR380A,{BLACK}Full Name: MTR {ORANGE}Vibrant Express,{BLACK}全名:港铁{ORANGE}动感号{BLACK}高速电力动车组,
STR_NICKNAME_MTR380A,{BLACK}Nickname: HongKong Mouse,{BLACK}昵称:港鼠,
STR_MTR380A_CONSIST,"{BLACK}Consist: {GOLD}4 to 24 cars; with head and cab trailers, all middle cars motorised. Will run as coupled when cars more than 12",{BLACK}构成:{GOLD}4-24节;头尾拖车,中间全为动力车。大于12节时以重联方式运行,
# CAF Train,,,
STR_SERIES_CAF_TRAIN,CAF Train (EMU),CAF Train(电力动车组),
STR_NAME_CAF_TRAIN_AIRPORT_EXPRESS,CAF Train(Airport Express Type) (EMU),CAF Train(机场快线型) (电力动车),
STR_NAME_CAF_TRAIN_TUNGCHUNG,CAF Train(Tung Chung Line Type) (EMU),CAF Train(东涌线型) (电力动车),
STR_FULLNAME_CAF_TRAIN,{BLACK}Full Name: Lantau Airport Railway Adtranz-CAF Train,{BLACK}全名:港铁机场铁路ADTranz-CAF列车,
STR_NICKNAME_CAF_TRAIN,{BLACK}Nickname: A-Train,{BLACK}昵称:A-Train,马世军快乐车,
248 changes: 248 additions & 0 deletions src/1500vmu/caf-train-airport-express.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
// Begin CAF-TRAIN-AIRPORT-EXPRESS



// Vehicle


spriteset (spriteset_caf_train_airport_express_c, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_standard ("1500vemu/caf-train", "caf-train-airport-c")
}
spriteset (spriteset_caf_train_airport_express_c_r, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_reversed_11 ("1500vemu/caf-train", "caf-train-airport-c")
}
spriteset (spriteset_caf_train_airport_express_lc, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_standard ("1500vemu/caf-train", "caf-train-airport-lc")
}
spriteset (spriteset_caf_train_airport_express_lc_r, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_reversed_11 ("1500vemu/caf-train", "caf-train-airport-lc")
}
spriteset (spriteset_caf_train_airport_express_m, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_standard ("1500vemu/caf-train", "caf-train-airport-m")
}
spriteset (spriteset_caf_train_airport_express_lm, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_standard ("1500vemu/caf-train", "caf-train-airport-lm")
}

// Purchase Menu

spriteset (spriteset_caf_train_airport_express_purchase_original, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_purchase ("1500vemu/caf-train", "caf-train-airport-c")
}




//Graphics
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_wagon_type, vehicle_type_id) {
first_emucoach: spriteset_caf_train_airport_express_m;
luggage_emucoach: spriteset_caf_train_airport_express_lm;
empty_sprites;
}

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_wagon_type_end, vehicle_type_id) {
first_emucoach: spriteset_caf_train_airport_express_c_r;
luggage_emucoach: spriteset_caf_train_airport_express_lc_r;
empty_sprites;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_graphics_if_end, position_in_consist_from_end == 1) {
1: switch_caf_train_airport_express_wagon_type_end;
switch_caf_train_airport_express_wagon_type;
}

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_middle_wagon_graphics, (position_in_consist % 3) == 1) {
1: switch_caf_train_airport_express_graphics_if_end;
empty_sprites;
}


switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_graphics_cargo_type, cargo_classes == bitmask(CC_PASSENGERS)) {
1: spriteset_caf_train_airport_express_c;
0: spriteset_caf_train_airport_express_lc;
empty_sprites;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_graphics, position_in_consist % 3) {
1: switch_caf_train_airport_express_graphics_cargo_type;
empty_sprites;
}


//Weight

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_weight, ((position_in_consist / 3) == 2) || ((position_in_consist_from_end / 3) == 2) ) {
1: return 35;
return 37;
}

//Capacity
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_luggage_capacity, position_in_consist % 3) {
1: return 52;
return 0;
}

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_capacity_end, ((position_in_consist / 3) == 0) || ((position_in_consist_from_end / 3) == 0) ) {
1: return 62;
return 64;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_capacity, position_in_consist % 3) {
1: switch_caf_train_airport_express_capacity_end;
return 0;
}

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_capacity_front_cargo_type, cargo_classes == bitmask(CC_PASSENGERS)) {
1: return 62;
return 52;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_capacity_front, position_in_consist % 3) {
1: switch_caf_train_airport_express_capacity_front_cargo_type;
return 0;
}
//Cost


switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_running_power, vehicle_type_id) {
first_emucoach: return 45;
luggage_emucoach: return 50;
return 0;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_running_unpower, vehicle_type_id) {
first_emucoach: return 12;
luggage_emucoach: return 15;
return 0;
}


switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_running, vehicle_is_potentially_powered) {
1: switch_caf_train_airport_express_running_power;
switch_caf_train_airport_express_running_unpower;
}

//Power

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_power, ((position_in_consist / 3) == 2) || ((position_in_consist_from_end / 3) == 2)) {
1: return 0;
return 1421;
}
switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_traction, vehicle_is_potentially_powered) {
1: return int(0.134*255);
return 0;
}
// cargo age period

switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_cargo_age_period, cargo_classes == bitmask(CC_PASSENGERS)) {
1: return 240;
return 200;
}

// Articulate


switch (FEAT_TRAINS, SELF, switch_caf_train_airport_express_articulated_part, extra_callback_info1) {
1..2: return caf_train_airport_express;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}



//Text



item (FEAT_TRAINS, caf_train_airport_express) {
property {
// Menu
name: string(STR_NAME_CAF_TRAIN_AIRPORT_EXPRESS);
sprite_id: SPRITE_ID_NEW_TRAIN;
misc_flags: bitmask(TRAIN_FLAG_AUTOREFIT, TRAIN_FLAG_MU);
engine_class: ENGINE_CLASS_ELECTRIC;
variant_group: caf_train_tungchung;

// Availability
climates_available: ALL_CLIMATES;
introduction_date: date(1997,10,16);
model_life: 60;
retire_early: 35;
vehicle_life: 35;
track_type: SACd;

// Cargo
refittable_cargo_classes: bitmask(CC_PASSENGERS, CC_MAIL, CC_EXPRESS, CC_ARMOURED);
non_refittable_cargo_classes: 0;
cargo_allow_refit: [PASS, TOUR, YETI, YETY, MAIL, VALU, GOLD, DIAM];
cargo_disallow_refit: [];
refit_cost: 0;
default_cargo_type: PASS;
ai_special_flag: AI_FLAG_PASSENGER;
cargo_capacity: 1;
loading_speed: 36 << param_loading_speed;
cargo_age_period: 128 << param_cargo_decay;

// Stats
speed: 135 km/h;
power: 1060 kW;
weight: 37 ton;
tractive_effort_coefficient: 0.134;
cost_factor: 40;
running_cost_base: RUNNING_COST_ELECTRIC;
running_cost_factor: 10;
reliability_decay: 8;
bitmask_vehicle_info: bitmask(2);
}
graphics {
// Menu
additional_text: string(STR_DESC_7, string(STR_ELECTRIC_1500VDC), string(STR_FULLNAME_CAF_TRAIN), string(STR_NICKNAME_CAF_TRAIN), string(STR_USEDLINE_ERL), string(STR_MTR_FIRST_CAN_ATTACH_WAGON),string(STR_RELDEC_LOW, 8), string(STR_NORMAL_HEAD_SEAT));
can_attach_wagon: muhead_airport_express;
start_stop: mu4to12car;

// Graphics
default: switch_caf_train_airport_express_graphics;
purchase: spriteset_caf_train_airport_express_purchase_original;
articulated_part: switch_caf_train_airport_express_articulated_part;

// Stats
length: switch_length_2_7_2;
/* speed: 135; */
/* power: return 1421; */
/* purchase_power: return 1421; */
/* tractive_effort_coefficient: return int(0.134*255); */
/* purchase_tractive_effort_coefficient: return int(0.134*255); */
cargo_capacity: switch_caf_train_airport_express_capacity_front;
cargo_age_period: switch_caf_train_airport_express_cargo_age_period() << param_cargo_decay;
cost_factor: 60;
running_cost_factor: 50 * runningcostfactor() + 20;
purchase_running_cost_factor: 220;
purchase_cargo_capacity: 62/3;
bitmask_vehicle_info: bitmask(2);
name: switch_caf_train_name;
}

// Multiple Unit Wagons
livery_override(first_emucoach) {
default: switch_caf_train_airport_express_middle_wagon_graphics;
cargo_capacity: switch_caf_train_airport_express_capacity;
power: switch_caf_train_airport_express_power;
tractive_effort_coefficient: switch_caf_train_airport_express_traction;
length: switch_length_2_7_2;
weight: switch_caf_train_airport_express_weight;
can_attach_wagon: mu_of_mtr;
cargo_age_period: 240 << param_cargo_decay;
bitmask_vehicle_info: 0;
articulated_part: switch_mtr_wagon_articulated_part;
running_cost_factor: switch_caf_train_airport_express_running() * runningcostfactor() + accostfactor();
}
livery_override(luggage_emucoach) {
default: switch_caf_train_airport_express_middle_wagon_graphics;
cargo_capacity: switch_caf_train_airport_express_luggage_capacity;
power: switch_caf_train_airport_express_power;
tractive_effort_coefficient: switch_caf_train_airport_express_traction;
length: switch_length_2_7_2;
weight: switch_caf_train_airport_express_weight;
can_attach_wagon: mu_of_mtr;
cargo_age_period: 200 << param_cargo_decay;
bitmask_vehicle_info: 0;
articulated_part: switch_mtr_wagon_articulated_part;
running_cost_factor: switch_caf_train_airport_express_running() * runningcostfactor() + accostfactor();
}
}

// End CAF-TRAIN-AIRPORT-EXPRESS
Loading

0 comments on commit adcd56f

Please sign in to comment.