Skip to content

Commit

Permalink
Add #15: EEC
Browse files Browse the repository at this point in the history
  • Loading branch information
telk5093 committed Mar 25, 2021
1 parent 06db1f2 commit ebc1eb7
Show file tree
Hide file tree
Showing 10 changed files with 344 additions and 12 deletions.
11 changes: 8 additions & 3 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ STR_NURIRO_NAME :[KTS] Nuriro
STR_CDC_NAME :[KTS] Commuter Diesel Car (CDC)
STR_NDC_NAME :[KTS] New Diesel Car (NDC)
STR_DEC_NAME :[KTS] Diesel Electric Car (DEC)
# STR_EEC_NAME :[KTS] Express Electric Car (EEC)
STR_EEC_NAME :[KTS] Express Electric Car (EEC)
STR_BIDULGI_CDC_NAME :[KTS] Bidulgi Commuter
STR_KTX1N_NAME :[KTS] KTX-1
STR_KTX2N_NAME :[KTS] KTX-Sancheon
Expand Down Expand Up @@ -127,11 +127,16 @@ STR_REFIT_LIVERY_BIDULGI_BLUE : (Livery: 1970s~1994)
STR_REFIT_LIVERY_BIDULGI_GREEN_YELLOW : (Livery: 1994~2000)
STR_REFIT_LIVERY_BIDULGI_BAGGAGE_CAR : (Bidulgi livery)

# Refit (DEC, EEC)
STR_REFIT_LIVERY_DEC_1 : (Livery: 1986~1994 : Saemaeul livery)
# Refit (DEC)
STR_REFIT_LIVERY_DEC_1 : (Livery: 1986~1994 : Saemaeul)
STR_REFIT_LIVERY_DEC_2 : (Livery: 1980~1986)
STR_REFIT_LIVERY_DEC_3 : (Livery: 1994~1999)

# Refit (EEC)
STR_REFIT_LIVERY_EEC_1 : (Livery: 1980~1994)
STR_REFIT_LIVERY_EEC_2 : (Livery: 1994~1998)
STR_REFIT_LIVERY_EEC_3 : (Livery: 1998~2001 : Tongil)

# Refit (etc)
STR_REFIT_COLOUR_BLACK : (Black)
STR_REFIT_COLOUR_BLUE : (Blue)
Expand Down
9 changes: 7 additions & 2 deletions lang/korean.lng
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ STR_NURIRO_NAME :[KTS] 누리로
STR_CDC_NAME :[KTS] 통근형 디젤 열차 (CDC)
STR_NDC_NAME :[KTS] 우등형 디젤 동차 (NDC)
STR_DEC_NAME :[KTS] 우등형 디젤 전기 동차 (DEC)
# STR_EEC_NAME :[KTS] 우등형 전기 동차 (EEC)
STR_EEC_NAME :[KTS] 우등형 전기 동차 (EEC)
STR_BIDULGI_CDC_NAME :[KTS] 비둘기 통근형 디젤 동차
STR_KTX1N_NAME :[KTS] KTX-1
STR_KTX2N_NAME :[KTS] KTX-산천
Expand Down Expand Up @@ -128,11 +128,16 @@ STR_REFIT_LIVERY_BIDULGI_BLUE : (1970년대~1994년 도색)
STR_REFIT_LIVERY_BIDULGI_GREEN_YELLOW : (1994~2000년 도색)
STR_REFIT_LIVERY_BIDULGI_BAGGAGE_CAR : (비둘기호 도색)

# Refit (DEC, EEC)
# Refit (DEC)
STR_REFIT_LIVERY_DEC_1 : (1986~1994년 도색 : 새마을호)
STR_REFIT_LIVERY_DEC_2 : (1980~1986년 도색)
STR_REFIT_LIVERY_DEC_3 : (1994~1999년 도색)

# Refit (EEC)
STR_REFIT_LIVERY_EEC_1 : (1980~1994년 도색)
STR_REFIT_LIVERY_EEC_2 : (1994~1998년 도색)
STR_REFIT_LIVERY_EEC_3 : (1998~2001년 도색 : 통일호)

# Refit (etc)
STR_REFIT_COLOUR_BLACK : (검은색)
STR_REFIT_COLOUR_BLUE : (파란색)
Expand Down
Binary file added src/locomotive/EEC/EEC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions src/locomotive/EEC/EEC.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*------------------------------------------------------------------------------
한국 열차 세트(Korean Train Set)
* Official download site : https://telk.kr/ottd/newgrf/ko_train_set
* Github repository : https://github.com/KoreanGRF/KoreanTrainSet
------------------------------------------------------------------------------*/
/**
* EEC
*/
SPEED_GENERAL(EEC)
COST(EEC)
RUNNING(EEC)
CAPACITY(EEC)
CAPACITY_PURCHASE(EEC)
LOADING(EEC)

// Graphics
#include "EEC_graphic.pnml"

// Switch
#include "EEC_switch.pnml"

// Item
item(FEAT_TRAINS, ko_train_EEC, 5513) {
property {
// Common properties
name: string(STR_EEC_NAME);
climates_available: ALL_CLIMATES;
introduction_date: var_EEC_INTRODUCTION;
track_type: RAIL;
engine_class: ENGINE_CLASS_DIESEL;
sprite_id: SPRITE_ID_NEW_TRAIN;
dual_headed: 1;

// Spec
speed: var_EEC_SPEED km/h;
power: POWER_IN_KW(var_EEC_POWER);
weight: var_EEC_WEIGHT;
tractive_effort_coefficient: 0.25;
air_drag_coefficient: 0.01;

// Model
model_life: VEHICLE_NEVER_EXPIRES;
vehicle_life: 30;
retire_early: 0;
reliability_decay: 0;

// Cargo
cargo_capacity: 1;
refittable_cargo_classes: NO_CARGO_CLASS;
non_refittable_cargo_classes: NO_CARGO_CLASS;
cargo_allow_refit: [PASS];
cargo_disallow_refit: [];

// Costs
refit_cost: 0;
running_cost_base: RUNNING_COST_DIESEL;

// Flags
ai_special_flag: AI_FLAG_PASSENGER;
misc_flags: bitmask(TRAIN_FLAG_AUTOREFIT, TRAIN_FLAG_FLIP);
bitmask_vehicle_info: 0;
visual_effect_and_powered: VISUAL_EFFECT_DIESEL;
}
graphics {
default: sw_EEC_engine;
purchase: sw_EEC_purchase;

speed: sw_EEC_speed;
cost_factor: sw_EEC_cost;
running_cost_factor: sw_EEC_runningcost;
cargo_capacity: sw_EEC_capacity;
purchase_cargo_capacity: sw_EEC_purchase_capacity;
loading_speed: sw_EEC_loadingspeed;

can_attach_wagon: sw_EEC_attach;
cargo_subtype_text: sw_EEC_cargo_subtype_text;
additional_text: string(STR_REFIT_ADDITIONAL_ABLE);
}
livery_override(ko_train_PASSWG) {
default: sw_EEC_wagon;
cargo_capacity: sw_EEC_capacity_in_custom;
loading_speed: sw_EEC_loadingspeed;
cargo_subtype_text: sw_EEC_cargo_subtype_text;
}
livery_override(ko_train_PASSWGP) {
default: sw_EEC_wagon;
cargo_capacity: sw_EEC_capacity_in_custom;
loading_speed: sw_EEC_loadingspeed;
cargo_subtype_text: sw_EEC_cargo_subtype_text;
power: POWER_IN_KW(var_EEC_POWER);
}
livery_override(ko_train_CAFE_CAR) {
default: sw_EEC_wagon_cafe_cargo_subtype;
cargo_capacity: sw_EEC_capacity_in_custom;
loading_speed: sw_EEC_loadingspeed;
cargo_subtype_text: sw_EEC_cargo_subtype_text;
power: POWER_IN_KW(var_EEC_POWER);
}
}
// End of "EEC"
123 changes: 123 additions & 0 deletions src/locomotive/EEC/EEC_graphic.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*------------------------------------------------------------------------------
한국 열차 세트(Korean Train Set)
* Official download site : https://telk.kr/ottd/newgrf/ko_train_set
* Github repository : https://github.com/KoreanGRF/KoreanTrainSet
------------------------------------------------------------------------------*/
/**
* EEC
*/

template tmpl_EEC_panto_wagon(x, y) { // Same width/height/x_offset/y_offset with tmpl_wagon_panto()
[x, y, 8, 22, -3, -11]
[x+15, y, 21, 17, -14, -8]
[x+45, y, 31, 15, -16, -11]
[x+95, y, 21, 19, -6, -10]
[x+125, y, 8, 22, -3, -11]
[x+140, y, 21, 19, -14, -10]
[x+170, y, 31, 15, -16, -11]
[x+220, y, 21, 17, -6, -8]
}
template tmpl_EEC_panto_wagon_r(x, y) {
[x+125, y, 8, 22, -3, -11]
[x+140, y, 21, 19, -14, -10]
[x+170, y, 31, 15, -16, -11]
[x+220, y, 21, 17, -6, -8]
[x, y, 8, 22, -3, -11]
[x+15, y, 21, 17, -13, -8]
[x+45, y, 31, 15, -16, -11]
[x+95, y, 21, 19, -6, -10]
}
template tmpl_EEC_cafe(x, y) {
[x, y, 8, 22, -3, -11]
[x+15, y, 21, 17, -14, -8]
[x+45, y, 31, 12, -16, -8]
[x+95, y, 21, 17, -6, -8]
[x+125, y, 8, 22, -3, -11]
[x+140, y, 21, 17, -14, -8]
[x+170, y, 31, 12, -16, -8]
[x+220, y, 21, 17, -6, -8]
}

// Graphics
spriteset(set_EEC_purchase, "./src/locomotive/EEC/EEC.png") {
tmpl_purchase_detail(0, 0, 50, 12, -12, -7)
}
spriteset(set_EEC_1_engineH, "./src/locomotive/EEC/EEC.png") { // Tc (front)
tmpl_NDC(60, 0)
}
spriteset(set_EEC_1_engineT, "./src/locomotive/EEC/EEC.png") { // Tc (rear)
tmpl_NDC_r(60, 30)
}
spriteset(set_EEC_1_panto_wagon, "./src/locomotive/EEC/EEC.png") { // M'<
tmpl_EEC_panto_wagon(60, 60)
}
spriteset(set_EEC_1_panto_wagon_r, "./src/locomotive/EEC/EEC.png") { // M'>
tmpl_EEC_panto_wagon_r(60, 60)
}
spriteset(set_EEC_1_wagon_A, "./src/locomotive/EEC/EEC.png") { // M (should be adjacent with M')
tmpl_wagon_by_coor(60, 90)
}
spriteset(set_EEC_1_wagon_cafe, "./src/locomotive/EEC/EEC.png") { // Tb (Cafe car)
tmpl_EEC_cafe(60, 120)
}
spriteset(set_EEC_1_wagon_executive, "./src/locomotive/EEC/EEC.png") { // Ts (Executive car)
tmpl_wagon_by_coor(60, 150)
}
spriteset(set_EEC_1_wagon_B, "./src/locomotive/EEC/EEC.png") { // M
tmpl_wagon_by_coor(60, 180)
}

spriteset(set_EEC_2_engineH, "./src/locomotive/EEC/EEC.png") {
tmpl_NDC(60, 210)
}
spriteset(set_EEC_2_engineT, "./src/locomotive/EEC/EEC.png") {
tmpl_NDC_r(60, 240)
}
spriteset(set_EEC_2_panto_wagon, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_panto_wagon(60, 270)
}
spriteset(set_EEC_2_panto_wagon_r, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_panto_wagon_r(60, 270)
}
spriteset(set_EEC_2_wagon_A, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 300)
}
spriteset(set_EEC_2_wagon_cafe, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_cafe(60, 330)
}
spriteset(set_EEC_2_wagon_executive, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 360)
}
spriteset(set_EEC_2_wagon_B, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 390)
}

spriteset(set_EEC_3_engineH, "./src/locomotive/EEC/EEC.png") {
tmpl_NDC(60, 420)
}
spriteset(set_EEC_3_engineT, "./src/locomotive/EEC/EEC.png") {
tmpl_NDC_r(60, 450)
}
spriteset(set_EEC_3_panto_wagon, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_panto_wagon(60, 480)
}
spriteset(set_EEC_3_panto_wagon_r, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_panto_wagon_r(60, 480)
}
spriteset(set_EEC_3_wagon_A, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 510)
}
spriteset(set_EEC_3_wagon_cafe, "./src/locomotive/EEC/EEC.png") {
tmpl_EEC_cafe(60, 540)
}
spriteset(set_EEC_3_wagon_executive, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 570)
}
spriteset(set_EEC_3_wagon_B, "./src/locomotive/EEC/EEC.png") {
tmpl_wagon_by_coor(60, 600)
}

// Alias of purchase image
switch(FEAT_TRAINS, SELF, sw_EEC_purchase, cargo_subtype) {
set_EEC_purchase;
}
99 changes: 99 additions & 0 deletions src/locomotive/EEC/EEC_switch.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*------------------------------------------------------------------------------
한국 열차 세트(Korean Train Set)
* Official download site : https://telk.kr/ottd/newgrf/ko_train_set
* Github repository : https://github.com/KoreanGRF/KoreanTrainSet
------------------------------------------------------------------------------*/
/**
* EEC
*/

// Cargo subtype
switch(FEAT_TRAINS, SELF, sw_EEC_cargo_subtype_text, cargo_subtype) {
1: return string(STR_REFIT_LIVERY_EEC_2); // Red+Yellow
2: return string(STR_REFIT_LIVERY_EEC_1); // Green+Yellow
return string(STR_REFIT_LIVERY_EEC_3);
}

// Engine
switch(FEAT_TRAINS, SELF, sw_EEC_engineH, cargo_subtype) {
1: set_EEC_2_engineH;
2: set_EEC_1_engineH;
set_EEC_3_engineH;
}
switch(FEAT_TRAINS, SELF, sw_EEC_engineT, cargo_subtype) {
1: set_EEC_2_engineT;
2: set_EEC_1_engineT;
set_EEC_3_engineT;
}
switch(FEAT_TRAINS, SELF, sw_EEC_engine, position_in_consist_from_end == 0 && num_vehs_in_consist > 1) {
1: sw_EEC_engineT;
sw_EEC_engineH;
}

// Wagon (panto)
switch(FEAT_TRAINS, SELF, sw_EEC_panto_wagon_cargo_subtype, cargo_subtype) {
1: set_EEC_2_panto_wagon;
2: set_EEC_1_panto_wagon;
set_EEC_3_panto_wagon;
}
switch(FEAT_TRAINS, SELF, sw_EEC_panto_wagon_cargo_subtype_r, cargo_subtype) {
1: set_EEC_2_panto_wagon_r;
2: set_EEC_1_panto_wagon_r;
set_EEC_3_panto_wagon_r;
}

// Wagon (A)
switch(FEAT_TRAINS, SELF, sw_EEC_wagon_A_cargo_subtype, cargo_subtype) {
1: set_EEC_2_wagon_A;
2: set_EEC_1_wagon_A;
set_EEC_3_wagon_A;
}

// Wagon (Cafe car)
switch(FEAT_TRAINS, SELF, sw_EEC_wagon_cafe_cargo_subtype, cargo_subtype) {
1: set_EEC_2_wagon_cafe;
2: set_EEC_1_wagon_cafe;
set_EEC_3_wagon_cafe;
}

// Wagon (Executive)
switch(FEAT_TRAINS, SELF, sw_EEC_wagon_executive_cargo_subtype, cargo_subtype) {
1: set_EEC_2_wagon_executive;
2: set_EEC_1_wagon_executive;
set_EEC_3_wagon_executive;
}

// Wagon (B)
switch(FEAT_TRAINS, SELF, sw_EEC_wagon_B_cargo_subtype, cargo_subtype) {
1: set_EEC_2_wagon_B;
2: set_EEC_1_wagon_B;
set_EEC_3_wagon_B;
}
switch(FEAT_TRAINS, SELF, sw_EEC_wagon, (position_in_consist-1) % 8) {
0: sw_EEC_wagon_A_cargo_subtype;
1: sw_EEC_panto_wagon_cargo_subtype;
2: sw_EEC_wagon_A_cargo_subtype;
3: sw_EEC_panto_wagon_cargo_subtype;
4: sw_EEC_wagon_cafe_cargo_subtype;
5: sw_EEC_wagon_executive_cargo_subtype;
6: sw_EEC_panto_wagon_cargo_subtype_r;
7: sw_EEC_wagon_A_cargo_subtype;
sw_EEC_wagon_B_cargo_subtype;
}

// Capacity
switch(FEAT_TRAINS, SELF, sw_EEC_capacity_in_custom, cargo_subtype) {
return 56 / 2 * sw_cargo_capacity_factor;
}

// Attachable vehicles
switch(FEAT_TRAINS, SELF, sw_EEC_attach, vehicle_type_id) {
ko_train_CDC: return CB_RESULT_ATTACH_ALLOW;
ko_train_NDC: return CB_RESULT_ATTACH_ALLOW;
ko_train_DEC: return CB_RESULT_ATTACH_ALLOW;
ko_train_EEC: return CB_RESULT_ATTACH_ALLOW;
ko_train_PASSWG: return CB_RESULT_ATTACH_ALLOW;
ko_train_PASSWGP: return CB_RESULT_ATTACH_ALLOW;
ko_train_CAFE_CAR: return CB_RESULT_ATTACH_ALLOW;
return string(STR_ERROR_NO_ATTACH);
}
2 changes: 1 addition & 1 deletion src/sort.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sort(FEAT_TRAINS, [
ko_train_CDC, // 5510
ko_train_NDC, // 5511
ko_train_DEC, // 5512
//ko_train_EEC, // 5513
ko_train_EEC, // 5513
ko_train_DHC, // 5520
ko_train_BIDULGI_CDC, // 5521

Expand Down
2 changes: 1 addition & 1 deletion src/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
trainList['NDC'] = 130, 10, 4, 44, 10, 455, 50, (1984, 1, 1)
trainList['NDC_wagon'] = 130, None, 2, 44, 10, 0, 20, (1984, 1, 1)
trainList['DEC'] = 110, 10, 4, 28, 10, 807, 50, (1980, 1, 1)
#trainList['EEC'] = 110, 10, 4, 64?, 10, ?, 50, (1984, 1, 1)
trainList['EEC'] = 110, 10, 4, 56 , 10, 2880, 50, (1980, 1, 1)
trainList['BIDULGI_CDC'] = 110, 10, 4, 150, 15, 261, 37, (1961, 1, 1)
trainList['KTX1N'] = 300, 20, 10, 0, 10, 13200, 68, (2004, 4, 1)
trainList['KTX2N'] = 300, 20, 10, 0, 10, 8800, 68, (2009, 1, 1)
Expand Down
Loading

0 comments on commit ebc1eb7

Please sign in to comment.