CHeroHandler.h 1.8 KB

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