You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
  1. #ifndef SPELL_WARZ_CHARACTER_HPP
  2. #define SPELL_WARZ_CHARACTER_HPP 1
  3. #include <cstring>
  4. #include "Spell.hpp"
  5. class Character
  6. {
  7. protected:
  8. static const long MAX_LVL;
  9. static const long MAX_EXP;
  10. char name[32];
  11. long experience;
  12. long level;
  13. long maxHP;
  14. long maxMP;
  15. long curHP;
  16. long curMP;
  17. void restoreHP(int);
  18. void restoreMP(int);
  19. void reduceHP(int);
  20. void reduceMP(int);
  21. public:
  22. Character(const char *characterName,
  23. long characterLevel);
  24. Character(const char *characterName,
  25. long characterLevel,
  26. long characterHP,
  27. long characterMP);
  28. bool castSpell(Spell &src, Character &dst);
  29. bool canCastSpell(Spell &src);
  30. const char *getName();
  31. long getLevel();
  32. long getExperience();
  33. long getMaxHP();
  34. long getMaxMP();
  35. long getCurHP();
  36. long getCurMP();
  37. long toNextLevel();
  38. bool readytoLevelUp();
  39. bool isAlive();
  40. void levelUp();
  41. void kill();
  42. void rest();
  43. void revive();
  44. void increaseExperience(int n);
  45. };
  46. #endif