CHeroHandler.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef CHEROHANDLER_H
  2. #define CHEROHANDLER_H
  3. #include <string>
  4. #include <vector>
  5. #include "CCreatureHandler.h"
  6. #include "nodrze.h"
  7. class CHero
  8. {
  9. public:
  10. std::string name;
  11. int ID;
  12. int low1stack, high1stack, low2stack, high2stack, low3stack, high3stack; //amount of units; described below
  13. std::string refType1stack, refType2stack, refType3stack; //reference names of units appearing in hero's army if he is recruited in tavern
  14. std::string bonusName, shortBonus, longBonus; //for special abilities
  15. std::string biography; //biography, of course
  16. bool isAllowed; //true if we can play with this hero (depends on map)
  17. bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
  18. };
  19. class CHeroClass
  20. {
  21. public:
  22. std::string name;
  23. float aggression;
  24. int initialAttack, initialDefence, initialPower, initialKnowledge;
  25. int proAttack[2]; //probability of gaining attack point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  26. int proDefence[2]; //probability of gaining defence point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  27. int proPower[2]; //probability of gaining power point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  28. int proKnowledge[2]; //probability of gaining knowledge point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  29. std::vector<int> proSec; //probabilities of gaining secondary skills (out of 112), in id order
  30. int selectionProbability[9]; //probability of selection in towns
  31. };
  32. class CHeroInstance
  33. {
  34. public:
  35. CHero type;
  36. int x, y, z; //position
  37. CCreatureSet army; //army
  38. //TODO: armia, artefakty, itd.
  39. };
  40. class CHeroHandler
  41. {
  42. public:
  43. nodrze<CHero> heroes;
  44. std::vector<CHeroClass> heroClasses;
  45. void loadHeroes();
  46. void loadSpecialAbilities();
  47. void loadBiographies();
  48. void loadHeroClasses();
  49. };
  50. #endif //CHEROHANDLER_H