OCONFIG.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. //Filename : OCONFIG.H
  21. //Description : Header file for Game Config class
  22. #ifndef __OCONFIG_H
  23. #define __OCONFIG_H
  24. #ifndef __OFILE_H
  25. #include <OFILE.h>
  26. #endif
  27. //------------- Define constant -------------//
  28. enum { OPTION_NONE=0, OPTION_LOW, OPTION_MODERATE, OPTION_HIGH, OPTION_VERY_HIGH };
  29. enum { OPTION_MONSTER_NONE=0, OPTION_MONSTER_DEFENSIVE, OPTION_MONSTER_OFFENSIVE };
  30. enum { OPTION_VERY_EASY, OPTION_EASY, OPTION_MEDIUM, OPTION_HARD, OPTION_VERY_HARD, OPTION_CUSTOM };
  31. enum { OPTION_DISPLAY_MAJOR_NEWS, OPTION_DISPLAY_ALL_NEWS };
  32. //------------- Define constant -------------//
  33. enum { SMALL_STARTUP_RESOURCE = 4000,
  34. MEDIUM_STARTUP_RESOURCE = 7000,
  35. LARGE_STARTUP_RESOURCE = 12000,
  36. VERY_LARGE_STARTUP_RESOURCE = 20000 };
  37. //---------- Define class Config -----------//
  38. #pragma pack(1)
  39. class Config
  40. {
  41. public:
  42. void init();
  43. void deinit();
  44. void default_game_setting();
  45. void default_cheat_setting();
  46. void default_local_game_setting();
  47. void default_preference();
  48. void change_game_setting( Config & );
  49. void change_preference( Config & );
  50. void change_difficulty(int);
  51. int single_player_difficulty();
  52. int multi_player_difficulty(int remotePlayers);
  53. int write_file(File* filePtr);
  54. int read_file(File* filePtr, int keepSysSettings=0);
  55. int save(char *); // save to file
  56. int load(char *); // load from file
  57. void reset_cheat_setting();
  58. void enable_weather_visual();
  59. void disable_weather_visual();
  60. void enable_weather_audio();
  61. void disable_weather_audio();
  62. public:
  63. enum { PLAYER_NAME_LEN=20 }; // should be te same as NationBase::KING_NAME_LEN
  64. //--------- GLOBAL GAME SETTING --------//
  65. //
  66. // parameters under GLOBAL GAME SETTING should remain unchange
  67. // after the game starts, and are the same across other players
  68. // in a multiplayer game
  69. // (i.e. change_game_setting() should updates all these setting )
  70. //
  71. //--------------------------------------//
  72. //------- parameter settings --------//
  73. short difficulty_rating;
  74. char ai_nation_count; // no. of AI nations in the game
  75. short start_up_cash;
  76. // short start_up_food;
  77. short ai_start_up_cash;
  78. // short ai_start_up_food;
  79. char ai_aggressiveness;
  80. short start_up_independent_town;
  81. short start_up_raw_site;
  82. char difficulty_level;
  83. //-------- option settings ---------//
  84. char explore_whole_map; // whether the map is explored at first place
  85. char fog_of_war; // fog of war option
  86. short terrain_set;
  87. short latitude;
  88. char weather_effect;
  89. char land_mass;
  90. char new_independent_town_emerge;
  91. char independent_town_resistance; // whether independent towns' defenders have higher combat levels
  92. char random_event_frequency;
  93. char new_nation_emerge;
  94. char monster_type;
  95. char start_up_has_mine_nearby;
  96. char random_start_up;
  97. //--------- goal ----------//
  98. char goal_destroy_monster;
  99. char goal_population_flag;
  100. char goal_economic_score_flag;
  101. char goal_total_score_flag;
  102. char goal_year_limit_flag;
  103. int goal_population;
  104. int goal_economic_score;
  105. int goal_total_score;
  106. int goal_year_limit;
  107. //------- game setting on fire ---------//
  108. char fire_spread_rate; // 0 to disable, 10 for normal
  109. char wind_spread_fire_rate; // 0 to disable, 5 for normal
  110. char fire_fade_rate; // 1 for slow, 2 for fast
  111. char fire_restore_prob; // 0 to 100, 5 for normal
  112. char rain_reduce_fire_rate; // 0 to 20, 5 for normal
  113. char fire_damage; // 0 to disable 2 for normal
  114. //--------- CHEAT GAME SETTING --------//
  115. //
  116. // parameters under CHEAT GAME SETTING can be changed
  117. // after the game starts, and must be reset in in a multiplayer game
  118. // (i.e. reset_cheat_setting() can reset all these setting )
  119. //
  120. //--------------------------------------//
  121. char show_ai_info;
  122. char fast_build; // fast building everything
  123. char disable_ai_flag;
  124. char king_undie_flag; // for testing game only
  125. //--------- LOCAL GAME SETTING --------//
  126. //
  127. // parameters under LOCAL GAME SETTING should remain unchange
  128. // after the game starts, may not be the same across other players
  129. //
  130. //-------------------------------------//
  131. char race_id;
  132. char player_name[PLAYER_NAME_LEN+1];
  133. char player_nation_color;
  134. char expired_flag;
  135. //--------- PREFERENCE --------//
  136. //
  137. // parameters under PREFERENCE are changeable during the game
  138. // the game will not be affect at any setting
  139. //
  140. //-------------------------------------//
  141. char opaque_report;
  142. char disp_news_flag;
  143. short scroll_speed; // map scrolling speed. 1-slowest, 10-fastest
  144. short frame_speed; // game speed, the desired frames per second
  145. char help_mode;
  146. char disp_town_name;
  147. char disp_spy_sign;
  148. char show_all_unit_icon; // 0:show icon when pointed, 1:always
  149. char show_unit_path; // bit 0 show unit path on ZoomMatrix, bit 1 for MapMatrix
  150. //------- sound effect --------//
  151. char music_flag;
  152. short cd_music_volume; // a value from 0 to 100
  153. short wav_music_volume; // a value from 0 to 100
  154. char sound_effect_flag;
  155. short sound_effect_volume; // a value from 0 to 100
  156. char pan_control; // mono speaker should disable pan_control
  157. //------- weather visual effect flags -------//
  158. char lightning_visual;
  159. char earthquake_visual;
  160. char rain_visual;
  161. char snow_visual;
  162. char snow_ground; // 0=disable, 1=i_snow, 2=snow_res
  163. //-------- weather audio effect flags -------//
  164. char lightning_audio;
  165. char earthquake_audio;
  166. char rain_audio;
  167. char snow_audio; // not used
  168. char wind_audio;
  169. //--------- weather visual effect parameters --------//
  170. int lightning_brightness; // 0, 20, 40 or 60
  171. int cloud_darkness; // 0 to 5, 0 to disable cloud darkness
  172. //-------- weather audio effect parameters ----------//
  173. long lightning_volume; // default 100
  174. long earthquake_volume; // default 100
  175. long rain_volume; // default 90
  176. long snow_volume; // default 100
  177. long wind_volume; // default 70
  178. //------------ map prefernce -------------//
  179. char blacken_map; // whether the map is blackened at the first place
  180. char explore_mask_method; // 0 for none, 1 for masking, 2 for remapping
  181. char fog_mask_method; // 1 for fast masking, 2 for slow remapping
  182. };
  183. #pragma pack()
  184. //------------------------------------------//
  185. extern Config config;
  186. #endif