Advertisement
Guest User

Untitled

a guest
May 4th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2013 Jussi Virtanen
  3. * This file is part of Finnish Trainset
  4. * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  5. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  6. * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  7. */
  8.  
  9. //Sound effects
  10. switch (FEAT_TRAINS, SELF, switch_DMU_DM7_sound_checkdepot, vehicle_is_in_depot) {
  11. 0: return sound("sfx/dm7_idle.wav");
  12. }
  13. switch (FEAT_TRAINS, SELF, sound_DMU_DM7, extra_callback_info1) {
  14. 1: return sound("sfx/dm7_acc.wav");
  15. 7: return sound("sfx/dm7_run.wav");
  16. 8: return switch_DMU_DM7_sound_checkdepot;
  17. }
  18. //purchase menus
  19. spriteset (spriteset_DMU_DM7_purchase, "gfx/dmu/dmu_dm7.png") { template_purchase(0) }
  20.  
  21. spriteset (spriteset_DMU_DM7_default, "gfx/dmu/dmu_dm7.png") { template_7_8(0) }
  22.  
  23. switch (FEAT_TRAINS, SELF, switch_DMU_DM7_speed, cargo_subtype) {
  24. 1: return 115;
  25. return 95;
  26. }
  27. switch (FEAT_TRAINS, SELF, switch_DMU_DM7_subtypetext_pre1960, cargo_subtype) {
  28. return string(STR_SUBTYPE_DEFAULT, "");
  29. }
  30. switch (FEAT_TRAINS, SELF, switch_DMU_DM7_subtypetext_post1960, cargo_subtype) {
  31. 1: return string(STR_SUBTYPE_DEFAULT, string(STR_SUBTYPE_DM7_REGEAR));
  32. return string(STR_SUBTYPE_DEFAULT, "");
  33. }
  34. switch (FEAT_TRAINS, SELF, switch_DMU_DM7_subtypetext_yearcheck, current_year) {
  35. 0..1959: return switch_DMU_DM7_subtypetext_pre1960;
  36. return switch_DMU_DM7_subtypetext_post1960;
  37. }
  38. switch(FEAT_TRAINS, SELF, switch_DMU_DM7_can_attach_wagon, vehicle_type_id) {
  39. item_CO_EFIAB: return CB_RESULT_ATTACH_ALLOW;
  40. item_CO_FPOAB: return CB_RESULT_ATTACH_ALLOW;
  41. item_CO_GEOAB: return CB_RESULT_ATTACH_ALLOW;
  42. item_DMU_DM7: return CB_RESULT_ATTACH_ALLOW;
  43. item_DMU_DMG7: return CB_RESULT_ATTACH_ALLOW;
  44. return string(STR_DM7_CANNOT_ATTACH_OTHER);
  45. }
  46. switch(FEAT_TRAINS, SELF, switch_DMU_DM7_can_attach_engine, vehicle_type_id) {
  47. item_DMU_DM7: return CB_RESULT_ATTACH_ALLOW;
  48. item_DMU_DMG7: return CB_RESULT_ATTACH_ALLOW;
  49. return string(STR_DM7_MORE_ENGINES);
  50. }
  51. //engine needs to be always attachable
  52. switch(FEAT_TRAINS, PARENT, switch_DMU_DM7_check_engine_count, ((num_vehs_in_vehid_chain * 2 - 2) > num_vehs_in_consist)) {
  53. 1: return switch_DMU_DM7_can_attach_wagon;
  54. return switch_DMU_DM7_can_attach_engine;
  55. }
  56.  
  57. item (FEAT_TRAINS, item_DMU_DM7) {
  58. property {
  59. //common properties
  60. name: string(STR_NAME_DMU_DM7);
  61. climates_available: ALL_CLIMATES;
  62. introduction_date: date(1955,01,01);
  63. model_life: 35;
  64. vehicle_life: 35;
  65. reliability_decay: 20;
  66. //refittable_cargo_classes: 0;
  67. //non_refittable_cargo_classes: 0;
  68. cargo_allow_refit: [PASS];
  69. loading_speed: 10;
  70. cost_factor: 30;
  71. running_cost_factor: 40;
  72. cargo_age_period: 185;
  73.  
  74. //train properties
  75. sprite_id: SPRITE_ID_NEW_TRAIN;
  76. speed: 95 km/h;
  77. misc_flags: 0;
  78. refit_cost: 0;
  79. track_type: RAIL;
  80. ai_special_flag: 0;
  81. power: 180 hpM;
  82. running_cost_base: RUNNING_COST_DIESEL;
  83. dual_headed: 0;
  84. default_cargo_type: PASS;
  85. cargo_capacity: 64;
  86. weight: 18 ton;
  87. engine_class: ENGINE_CLASS_DIESEL;
  88. extra_power_per_wagon: 0;
  89. tractive_effort_coefficient: 0.396;
  90. air_drag_coefficient: 0;
  91. length: 7;
  92. visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_DIESEL, 0, DISABLE_WAGON_POWER);
  93. bitmask_vehicle_info: 0;
  94. }
  95. graphics {
  96. // additional_text: return string(STR_PURCHASE_SERVICE, string(STR_PURCHASE_SERVICE_HF));
  97. cargo_capacity: 64;
  98. cargo_subtype_text: switch_DMU_DM7_subtypetext_yearcheck;
  99. can_attach_wagon: switch_DMU_DM7_check_engine_count;
  100. speed: switch_DMU_DM7_speed;
  101. sound_effect: sound_DMU_DM7;
  102. purchase: spriteset_DMU_DM7_purchase;
  103. default: spriteset_DMU_DM7_default;
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement