OSKILL.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 : OSKILL.H
  21. //Description : Skill class
  22. #ifndef __OSKILL_H
  23. #define __OSKILL_H
  24. //--- Define the default skill of the citizens ---//
  25. enum { CITIZEN_COMBAT_LEVEL = 10,
  26. CITIZEN_SKILL_LEVEL = 10,
  27. CITIZEN_HIT_POINTS = 20 };
  28. //---------- Define constant ------------//
  29. enum { MAX_SKILL=7,
  30. MAX_TRAINABLE_SKILL=MAX_SKILL-1 }; // exclude praying
  31. //---------- Define skill types -----------//
  32. enum { SKILL_CONSTRUCTION=1,
  33. SKILL_LEADING,
  34. SKILL_MINING,
  35. SKILL_MFT,
  36. SKILL_RESEARCH,
  37. SKILL_SPYING,
  38. SKILL_PRAYING,
  39. };
  40. //-------- Define struct Skill ----------//
  41. #pragma pack(1)
  42. class Skill
  43. {
  44. public:
  45. char combat_level;
  46. char skill_id;
  47. char skill_level; // if the unit is a town defender, this var is temporary used for storing the loyalty that will be added back to the town if the defender returns to the town
  48. unsigned char combat_level_minor; // when combat_level_mirror >= 100, combat_level + 1
  49. unsigned char skill_level_minor;
  50. unsigned char skill_potential; // skill potential
  51. static char* skill_str_array[MAX_SKILL];
  52. static char* skill_code_array[MAX_SKILL];
  53. static char skilled_race_id_array[MAX_SKILL]; // the id. of the race that specialized in this skill.
  54. static char skill_train_cost_array[MAX_SKILL];
  55. public:
  56. Skill();
  57. char* skill_des(int shortWord=0);
  58. int get_skill(int skillId);
  59. void set_skill(int skillId) { skill_id = skillId; }
  60. };
  61. #pragma pack()
  62. //---------------------------------------//
  63. #endif