constants.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #ifndef __CONSTANTS_BANK_H
  2. #define __CONSTANTS_BANK_H
  3. #include <vector>
  4. #include <set>
  5. #include <map>
  6. struct ConstantsBank {
  7. size_t max_permafeats;
  8. size_t max_bones;
  9. tag_t player_species;
  10. double starvation_damage;
  11. tag_t grave;
  12. tag_t pit;
  13. tag_t bad_grave;
  14. tag_t ghost;
  15. std::set<tag_t> money;
  16. tag_t unique_item;
  17. struct slot_t {
  18. tag_t slot;
  19. std::string label;
  20. std::string name;
  21. char letter;
  22. slot_t() : letter(' ') {}
  23. };
  24. std::vector<slot_t> slots;
  25. tag_t money_slot;
  26. struct shortcut_t {
  27. std::vector< std::pair<tag_t, unsigned char> > slot_keypress;
  28. std::string fail_message;
  29. std::string help_message;
  30. };
  31. std::map<unsigned char, shortcut_t> shortcuts;
  32. unsigned int uniques_timeout;
  33. double min_money_value;
  34. std::vector<ui_symbols_t> ui_symbols;
  35. size_t max_celauto_cells;
  36. struct achievement_t {
  37. tag_t genus;
  38. unsigned int kills;
  39. unsigned int priority;
  40. std::string label;
  41. tag_t summon;
  42. achievement_t() : kills(0), priority(0) {}
  43. };
  44. std::map<tag_t, achievement_t> achievements;
  45. std::map<tag_t, std::string> genus_names;
  46. size_t achievement_trigger_rate;
  47. struct ailment_t {
  48. std::map<tag_t,double> inc_stat;
  49. damage::attacks_t attacks;
  50. unsigned int level;
  51. std::string name;
  52. unsigned int triggers;
  53. bool oneshot;
  54. ailment_t() : level(0), triggers(1), oneshot(false) {}
  55. };
  56. std::map<tag_t, ailment_t> ailments;
  57. unsigned int max_ailments;
  58. mean_deviation_t treasure_chance;
  59. double monetary_supply_base;
  60. mean_deviation_t bonus_a_items;
  61. mean_deviation_t bonus_b_items;
  62. struct flavor_moon_frequency_t {
  63. double height;
  64. mean_deviation_t curve;
  65. flavor_moon_frequency_t() : height(0), curve(0, 1) {}
  66. };
  67. std::map<tag_t,flavor_moon_frequency_t> flavor_moon_frequency;
  68. unsigned int player_level_cap;
  69. struct starsigns_t {
  70. time_t zero;
  71. unsigned int nday;
  72. unsigned int nsign;
  73. std::map<unsigned int, std::string> names;
  74. starsigns_t() : zero(0), nday(13), nsign(20) {}
  75. };
  76. starsigns_t starsigns;
  77. unsigned int ai_radius;
  78. std::vector<tag_t> hud_stats_order;
  79. std::vector<tag_t> hud_counts_order;
  80. struct luck_stat_t {
  81. tag_t stat;
  82. double factor;
  83. double threshold;
  84. luck_stat_t() : factor(1), threshold(0) {}
  85. };
  86. luck_stat_t luck;
  87. tag_t rest_count;
  88. tag_t digging_count;
  89. ConstantsBank() : max_permafeats(150), max_bones(1000),
  90. starvation_damage(0), uniques_timeout(0),
  91. min_money_value(0.01), max_celauto_cells(1000),
  92. achievement_trigger_rate(15),
  93. max_ailments(6u),
  94. monetary_supply_base(1e6),
  95. player_level_cap(12),
  96. ai_radius(30) {}
  97. };
  98. inline ConstantsBank& __constants__() {
  99. static ConstantsBank ret;
  100. return ret;
  101. }
  102. inline const ConstantsBank& constants() {
  103. return __constants__();
  104. }
  105. #endif