Skip to content

Commit

Permalink
#238 WIP, splited ACH2 into 2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
George-VB committed Apr 24, 2024
1 parent 8c700c3 commit 561d171
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/IDs_usage
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
499 -> er2t_m (src/emu/rvz/er1_2/er2t_m_use.pnml)
500 -> er2t_c (src/emu/rvz/er1_2/er2t_c_use.pnml)
501 -> ach2 (src/dmu/ach2.pnml)
502 -> apch2 (src/dmu/ach2.pnml)
502 -> apch2 (src/dmu/apch2.pnml)
503 -> chn (src/steam/chn.pnml)
504 -> izhitsa_type1914 (src/steam/kolomna/izhitsa-type1914_use.pnml)
505 -> steam_nd_53 (src/steam/nd-53.pnml)
Expand Down
2 changes: 1 addition & 1 deletion src/PNGs_usage
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ src/diesel/tgm23b.png -> (src/diesel/tgm23b_use.pnml)
src/diesel/vme1-type1958.png -> (src/diesel/vme1-type1958.pnml)
src/diesel/vme1-type1959.png -> (src/diesel/vme1-type1959.pnml)
src/dmu/ach2.png -> (src/dmu/ach2.pnml)
src/dmu/apch2.png -> (src/dmu/ach2.pnml)
src/dmu/apch2.png -> (src/dmu/apch2.pnml)
src/dmu/as1a.png -> (src/dmu/as1a.pnml)
src/dmu/d-type1960_c.png -> (src/dmu/d-type1960_c.pnml)
src/dmu/d-type1960_h.png -> (src/dmu/d-type1960_h.pnml)
Expand Down
1 change: 1 addition & 0 deletions src/PNMLs_usage
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ src/diesel/vme1-type1961_use.pnml -> (src/diesel/diesel-list.pnml)
src/disable-origin.pnml -> (src/cars/cars-xussr.pnml), (src/diesel/diesel-xussr.pnml), (src/dmu/dmu-xussr.pnml), (src/electric/electric-xussr.pnml), (src/emu/emu-xussr.pnml), (src/steam/steam-xussr.pnml), (src/subway/subway-xussr.pnml), (src/xussr.pnml)
src/dmu/ach2-group.pnml -> (src/dmu/dmu-list.pnml)
src/dmu/ach2.pnml -> (src/dmu/dmu-list.pnml)
src/dmu/apch2.pnml -> (src/dmu/dmu-xussr.pnml), (src/xussr.pnml)
src/dmu/as1a.pnml -> (src/dmu/dmu-list.pnml)
src/dmu/d-group.pnml -> (src/dmu/dmu-list.pnml)
src/dmu/d-type1960_c.pnml -> (src/dmu/dmu-list.pnml)
Expand Down
57 changes: 0 additions & 57 deletions src/dmu/ach2.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@
purchase_sprites_with_icon(ach2, 18, 0, diesel)
MU_head_single_middle_sprites(15ach2, ach2, 32, 40)
#undef IMAGEFILE
#define IMAGEFILE "src/dmu/apch2.png"
purchase_sprites_with_icon(apch2, 18, 0, diesel)
pass_wagon_sprites(15, apch2, 32, 40)
#undef IMAGEFILE

railcar_RND_mideq_direction_template(ach2, ach2, 1, 7)
long_vehicle(ach2)
long_vehicle(apch2)

switch (FEAT_TRAINS, PARENT, apch2_can_attach_wagon4,
count_veh_id(ach2) == 3)
Expand Down Expand Up @@ -152,7 +147,6 @@ switch (FEAT_TRAINS, SELF, ach2_colour_mapping,

engine_power_MU(ach2, PROP_ach2_h_PR, ach2)
engine_capacity_MU(ach2, PROP_ach2_h_CC, ach2)
engine_capacity_MU(apch2, PROP_ach2_c_CC, ach2)
livery_template_alt0(ach2, STR_REFIT_TTD_5B, STR_REFIT_TTD_96)
engine_diesel_1r_effect(ach2_create_effect_sprites, -2, 9, 11)
railcar_RND_mideq_effect_direction_template(ach2, ach2, 1, 7)
Expand All @@ -171,24 +165,8 @@ switch (FEAT_TRAINS, SELF, ach2_running_cost_factor,
STORE_TEMP(round(PROP_ach2_h_WT + PROP_ach2_h_CC / 16), 8)]) // Максимальная масса
{ ach2_check_running_cost_factor; } // 230

RC_head_check(apch2, ach2)
switch (FEAT_TRAINS, SELF, apch2_running_cost_factor,
[ STORE_TEMP(0, 0), // Моторы
STORE_TEMP(11, 1), // Бригада
STORE_TEMP(29, 2), // Износ
STORE_TEMP(3, 3), // Сопровождение
STORE_TEMP(8, 4), // ТО
STORE_TEMP(1, 5), // Сертификация

STORE_TEMP(PROP_ach2_c_SD, 6), // Скорость
STORE_TEMP(round(PROP_ach2_c_WT), 7), // Тара
STORE_TEMP(round(PROP_ach2_c_WT + PROP_ach2_c_CC / 16), 8)]) // Максимальная масса
{ apch2_check_running_cost_factor; } // 51

name_in_group(ach2, string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_NAME_ACH2)),
string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_LONGNAME_ACH2)))
name_in_group(apch2, string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_NAME_APCH2)),
string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_LONGNAME_APCH2)))

hint_MU(ach2,
calc_loading(67 / DOUBLE_DOOR),
Expand All @@ -197,13 +175,6 @@ hint_MU(ach2,
STR_SECTIONS_ACH2,
1984, 1992,
fact_skoda())
hint_MU(apch2,
calc_loading(123 / (2 * DOUBLE_DOOR)),
STR_PURCHASE_HINT_CAP_00033_VERY_FAST,
STR_PURCHASE_HINT_ENGINE_TYPE_DMU_C,
STR_SECTIONS_ACH2,
1984, 1989,
fact_skoda())

item (FEAT_TRAINS, ach2, 501) {
property {
Expand Down Expand Up @@ -232,33 +203,5 @@ item (FEAT_TRAINS, ach2, 501) {
}
}

item (FEAT_TRAINS, apch2, 502) {
property {
name: string(STR_NAME_APCH2);
vehicle_dates(1984, 1989, 25, 10, 8, PROP_ach2_c_CF)
vehicle_dmu_wagon(PROP_ach2_c_WT, PROP_ach2_c_CC, 2 * DOUBLE_DOOR, )
vehicle_group_mu(group_ach2)
}
graphics {
purchase_menu_wagon(PROP_ach2_c_CF, PROP_ach2_c_RC, PROP_ach2_c_SD, PROP_ach2_c_WT, PROP_ach2_c_TE, PROP_ach2_c_PR, PROP_ach2_c_CC)
additional_text: apch2_additional_text;
articulated_part: articulated_part_dummy7;
can_attach_wagon: ach2_can_attach_wagon;
cargo_age_period: return CAP_00033_VERY_FAST;
cargo_capacity: apch2_cargo_capacity;
cargo_subtype_text: ach2_cargo_subtype_text;
colour_mapping: ach2_colour_mapping;
default: apch2_sprites;
name: apch2_name;
power: return 0;
purchase: apch2_purchase_sprites;
running_cost_factor: apch2_running_cost_factor;
speed: speed_after25_120to100;
start_stop: return string(STR_START_STOP_HEAD_REQUIRED);
}
}

long_name_template(ach2, STR_LONGNAME_ACH2)
long_name_template(apch2, STR_LONGNAME_APCH2)
allow_dmu(ach2)
allow_dmu(apch2)
72 changes: 72 additions & 0 deletions src/dmu/apch2.pnml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// ach2

#define PROP_apch2_c_CF PROP_ach2_c_CF
#define PROP_apch2_c_RC PROP_ach2_c_RC
#define PROP_apch2_c_SD PROP_ach2_c_SD
#define PROP_apch2_c_WT PROP_ach2_c_WT
#define PROP_apch2_c_TE PROP_ach2_c_TE
#define PROP_apch2_c_PR PROP_ach2_c_PR
#define PROP_apch2_c_CC PROP_ach2_c_CC

#define IMAGEFILE "src/dmu/apch2.png"
purchase_sprites_with_icon(apch2, 18, 0, diesel)
pass_wagon_sprites(15, apch2, 32, 40)
#undef IMAGEFILE

long_vehicle(apch2)

engine_capacity_MU(apch2, PROP_apch2_c_CC, ach2)

RC_head_check(apch2, ach2)
switch (FEAT_TRAINS, SELF, apch2_running_cost_factor,
[ STORE_TEMP(0, 0), // Моторы
STORE_TEMP(11, 1), // Бригада
STORE_TEMP(29, 2), // Износ
STORE_TEMP(3, 3), // Сопровождение
STORE_TEMP(8, 4), // ТО
STORE_TEMP(1, 5), // Сертификация

STORE_TEMP(PROP_apch2_c_SD, 6), // Скорость
STORE_TEMP(round(PROP_apch2_c_WT), 7), // Тара
STORE_TEMP(round(PROP_apch2_c_WT + PROP_apch2_c_CC / 16), 8)]) // Максимальная масса
{ apch2_check_running_cost_factor; } // 51

name_in_group(apch2, string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_NAME_APCH2)),
string(STR_NAME_IN_GROUP, string(STR_NAME_ACH2_SERIES), string(STR_LONGNAME_APCH2)))

hint_MU(apch2,
calc_loading(123 / (2 * DOUBLE_DOOR)),
STR_PURCHASE_HINT_CAP_00033_VERY_FAST,
STR_PURCHASE_HINT_ENGINE_TYPE_DMU_C,
STR_SECTIONS_ACH2,
1984, 1989,
fact_skoda())

item (FEAT_TRAINS, apch2, 502) {
property {
name: string(STR_NAME_APCH2);
vehicle_dates(1984, 1989, 25, 10, 8, PROP_apch2_c_CF)
vehicle_dmu_wagon(PROP_apch2_c_WT, PROP_apch2_c_CC, 2 * DOUBLE_DOOR, )
vehicle_group_mu(group_ach2)
}
graphics {
purchase_menu_wagon(PROP_apch2_c_CF, PROP_apch2_c_RC, PROP_apch2_c_SD, PROP_apch2_c_WT, PROP_apch2_c_TE, PROP_apch2_c_PR, PROP_apch2_c_CC)
additional_text: apch2_additional_text;
articulated_part: articulated_part_dummy7;
can_attach_wagon: ach2_can_attach_wagon;
cargo_age_period: return CAP_00033_VERY_FAST;
cargo_capacity: apch2_cargo_capacity;
cargo_subtype_text: ach2_cargo_subtype_text;
colour_mapping: ach2_colour_mapping;
default: apch2_sprites;
name: apch2_name;
power: return 0;
purchase: apch2_purchase_sprites;
running_cost_factor: apch2_running_cost_factor;
speed: speed_after25_120to100;
start_stop: return string(STR_START_STOP_HEAD_REQUIRED);
}
}

long_name_template(apch2, STR_LONGNAME_APCH2)
allow_dmu(apch2)
1 change: 1 addition & 0 deletions src/dmu/dmu-xussr.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "../graph-templates-mu-icons.pnml"
// МВПС дизельный
#include "dmu-list.pnml"
#include "apch2.pnml" // wagon
// сортировка
sort (FEAT_TRAINS,
[
Expand Down
36 changes: 22 additions & 14 deletions src/xussr.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,11 @@
#include "code-templates-lv.pnml"
#include "code-templates-lv-new.pnml"
#include "wagons/cargoes-all.pnml"
#include "wagons/wagons-code-templates-lv-pred.pnml"
#include "wagons/cargoes-open-templates.pnml"
#include "wagons/cargoes-capacity.pnml"
#include "wagons/cargoes-refit.pnml"
#include "wagons/cargoes-loadspeed.pnml"
#include "wagons/cargoes-weight.pnml"
#include "steam/steam-code-templates-lv-pred.pnml"
#include "diesel/diesel-code-templates-lv-pred.pnml"
#include "electric/electric-code-templates-lv-pred.pnml"
#include "dmu/dmu-code-templates.pnml"
#include "emu/emu-code-templates-calc.pnml"
#include "emu/emu-code-templates.pnml"
#include "emu/emu-graph-templates.pnml"
// модельки
#include "dummy/dummy.pnml"
#include "dummy/types.pnml"
Expand All @@ -44,21 +36,38 @@
#include "graph-templates.pnml"
#include "graph-templates-locos.pnml"
#include "car-attach.pnml"

#include "steam/steam-code-templates-lv-pred.pnml"
#include "steam/steam-middle-units.pnml"
#include "steam/steam-list.pnml"

#include "diesel/diesel-code-templates-lv-pred.pnml"
#include "diesel/diesel-middle-units.pnml"
#include "diesel/diesel-list.pnml"

#include "electric/electric-code-templates-lv-pred.pnml"
#include "electric/electric-attach.pnml"
#include "electric/electric-start.pnml"
#include "graph-templates-wagons.pnml"
#include "electric/electric-list.pnml"

#include "graph-templates-mu.pnml"
#include "graph-templates-mu-icons.pnml"
#include "graph-templates-containers.pnml"

#include "steam/steam-list.pnml"
#include "diesel/diesel-list.pnml"
#include "electric/electric-list.pnml"
#include "dmu/dmu-code-templates.pnml"
#include "dmu/dmu-list.pnml"

#include "emu/emu-code-templates-calc.pnml"
#include "emu/emu-code-templates.pnml"
#include "emu/emu-graph-templates.pnml"
#include "emu/emu-list.pnml"

#include "subway/subway-list.pnml"

#include "graph-templates-wagons.pnml"
#include "dmu/apch2.pnml"
#include "cars/cars-list.pnml"
#include "graph-templates-containers.pnml"
#include "wagons/wagons-code-templates-lv-pred.pnml"
#include "wagons/cargoes9/cargoes7_9/cargoes-gondola.pnml"
#include "electric/industrial/pwd-dumpcar.pnml"

Expand Down Expand Up @@ -87,7 +96,6 @@

// ПС
#include "wagons/wagons-list.pnml"
#include "cars/cars-list.pnml"
sort (FEAT_TRAINS,
[
// модельки
Expand Down

0 comments on commit 561d171

Please sign in to comment.