terrain.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #ifndef __TERRAIN_H
  2. #define __TERRAIN_H
  3. #include <string>
  4. struct Terrain {
  5. enum class placement_t : unsigned int {
  6. floor,
  7. water,
  8. corner,
  9. lowlands,
  10. shoreline
  11. };
  12. tag_t tag;
  13. std::string name;
  14. std::string descr;
  15. skins skin;
  16. unsigned int count;
  17. placement_t placement;
  18. int stairs;
  19. int tunnel_x;
  20. int tunnel_y;
  21. bool viewblock;
  22. bool walkblock;
  23. unsigned int decay;
  24. unsigned int attack_level;
  25. damage::attacks_t attacks;
  26. bool sticky;
  27. bool is_lit;
  28. bool is_lightsource;
  29. bool air;
  30. unsigned int charges;
  31. struct spell_t {
  32. tag_t stat;
  33. double stat_min;
  34. double stat_max;
  35. tag_t ca_tag;
  36. std::string name;
  37. double timeout;
  38. spell_t() : stat_min(0), stat_max(0), timeout(0) {}
  39. };
  40. spell_t grant_spell;
  41. tag_t victory_item;
  42. bool safebox;
  43. struct uncharge_t {
  44. bool attack;
  45. bool move;
  46. bool use;
  47. bool bump;
  48. bool sensor;
  49. uncharge_t() : attack(false), move(false), use(false), bump(false), sensor(false) {}
  50. };
  51. uncharge_t uncharge;
  52. bool player_attack;
  53. struct craft_t {
  54. tag_t from;
  55. tag_t to;
  56. std::string msg;
  57. };
  58. std::vector<craft_t> crafting;
  59. enum {
  60. NO_WISH = 0,
  61. SIMPLE_WISH = 1,
  62. SPECIAL_WISH = 2
  63. } wishing;
  64. bool important;
  65. int view_radius;
  66. struct banking_t {
  67. double buy_margin;
  68. double sell_margin;
  69. tag_t bonus_stat;
  70. double stat_bonus;
  71. double money_curse;
  72. double gives_change;
  73. banking_t() : buy_margin(0), sell_margin(0), stat_bonus(0), money_curse(0), gives_change(0) {}
  74. };
  75. banking_t banking;
  76. std::map<tag_t, tag_t> sensor_toggle;
  77. bool preserve;
  78. std::string message;
  79. struct inc_stat_t {
  80. tag_t stat;
  81. double val;
  82. std::string msg;
  83. inc_stat_t() : val(0) {}
  84. };
  85. std::vector<inc_stat_t> inc_stat;
  86. Terrain() : count(0), placement(placement_t::floor), stairs(0), tunnel_x(0), tunnel_y(0),
  87. viewblock(false), walkblock(false), decay(0), attack_level(0),
  88. sticky(false), is_lit(false), is_lightsource(false), air(false), charges(0), safebox(false),
  89. player_attack(false), wishing(NO_WISH), important(false), view_radius(-1), preserve(false) {}
  90. };
  91. #endif