Axe.h 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BasicTool.h"
  3. #include "ItemSkill.h"
  4. #include "ItemType.h"
  5. class AxeToolItemType : public BasicToolItemType
  6. {
  7. protected:
  8. void loadSuperItemSkill(
  9. ItemSkill* zSkill, Framework::StreamReader* zReader) const override;
  10. void saveSuperItemSkill(const ItemSkill* zSkill,
  11. Framework::StreamWriter* zWriter) const override;
  12. public:
  13. AxeToolItemType();
  14. Item* createItem() const override;
  15. ItemSkill* createDefaultItemSkill() const override;
  16. };
  17. class AxeToolLevelUpRule : public ItemSkillLevelUpRule
  18. {
  19. public:
  20. AxeToolLevelUpRule();
  21. void applyOn(ItemSkill* zSkill) override;
  22. };
  23. class AxeToolSkill : public ItemSkill
  24. {
  25. private:
  26. int level;
  27. float xp;
  28. float maxXP;
  29. public:
  30. AxeToolSkill();
  31. bool use(Entity* zActor, Item* zUsedItem, Block* zTarget) override;
  32. bool use(Entity* zActor, Item* zUsedItem, Entity* zTarget) override;
  33. friend AxeToolItemType;
  34. friend AxeToolLevelUpRule;
  35. };