CHeroHandler.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef CHEROHANDLER_H
  2. #define CHEROHANDLER_H
  3. #include <string>
  4. #include <vector>
  5. #include "CCreatureHandler.h"
  6. #include "SDL.h"
  7. class CHeroClass;
  8. enum EHeroClasses {HERO_KNIGHT, HERO_CLERIC, HERO_RANGER, HERO_DRUID, HREO_ALCHEMIST, HERO_WIZARD, HERO_DEMONIAC, HERO_HERETIC, HERO_DEATHKNIGHT, HERO_NECROMANCER, HERO_WARLOCK, HERO_OVERLORD, HERO_BARBARIAN, HERO_BATTLEMAGE, HERO_BEASTMASTER, HERO_WITCH, HERO_PLANESWALKER, HERO_ELEMENTALIST};
  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. CHero type;
  41. int x, y, z; //position
  42. CCreatureSet army; //army
  43. //TODO: armia, artefakty, itd.
  44. };
  45. class CHeroHandler
  46. {
  47. public:
  48. std::vector<CHero*> heroes; //by³o nodrze
  49. std::vector<CHeroClass *> heroClasses;
  50. void loadHeroes();
  51. void loadSpecialAbilities();
  52. void loadBiographies();
  53. void loadHeroClasses();
  54. void loadPortraits();
  55. void initHeroClasses();
  56. ~CHeroHandler();
  57. };
  58. #endif //CHEROHANDLER_H