CHeroHandler.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef CHEROHANDLER_H
  2. #define CHEROHANDLER_H
  3. #include <string>
  4. #include <vector>
  5. #include "CCreatureHandler.h"
  6. #include "SDL.h"
  7. #include "int3.h"
  8. class CHeroClass;
  9. class CHero
  10. {
  11. public:
  12. std::string name;
  13. int ID;
  14. int low1stack, high1stack, low2stack, high2stack, low3stack, high3stack; //amount of units; described below
  15. std::string refType1stack, refType2stack, refType3stack; //reference names of units appearing in hero's army if he is recruited in tavern
  16. std::string bonusName, shortBonus, longBonus; //for special abilities
  17. std::string biography; //biography, of course
  18. bool isAllowed; //true if we can play with this hero (depends on map)
  19. CHeroClass * heroClass;
  20. EHeroClasses heroType; //hero class
  21. //bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
  22. SDL_Surface * portraitSmall; //48x32 p
  23. };
  24. class CHeroClass
  25. {
  26. public:
  27. std::string name;
  28. float aggression;
  29. int initialAttack, initialDefence, initialPower, initialKnowledge;
  30. int proAttack[2]; //probability of gaining attack point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  31. int proDefence[2]; //probability of gaining defence point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  32. int proPower[2]; //probability of gaining power point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  33. int proKnowledge[2]; //probability of gaining knowledge point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
  34. std::vector<int> proSec; //probabilities of gaining secondary skills (out of 112), in id order
  35. int selectionProbability[9]; //probability of selection in towns
  36. };
  37. class CHeroInstance
  38. {
  39. public:
  40. int owner;
  41. int exp; //experience point
  42. int level; //current level of hero
  43. std::string name; //may be custom
  44. std::string biography; //may be custom
  45. int portrait; //may be custom
  46. CHero type;
  47. int3 pos; //position on adventure map
  48. CCreatureSet army; //army
  49. int mana; // remaining spell points
  50. int movement; //remaining movement points
  51. //TODO: artifacts, primary and secondary skills, known spells, commander, blessings, curses, morale/luck modifiers
  52. };
  53. class CHeroHandler
  54. {
  55. public:
  56. std::vector<CHero*> heroes; //by³o nodrze
  57. std::vector<CHeroClass *> heroClasses;
  58. void loadHeroes();
  59. void loadSpecialAbilities();
  60. void loadBiographies();
  61. void loadHeroClasses();
  62. void loadPortraits();
  63. void initHeroClasses();
  64. ~CHeroHandler();
  65. };
  66. #endif //CHEROHANDLER_H