StoneTool.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "ItemType.h"
  3. #include "ItemSkill.h"
  4. class BrokenStoneToolItemType : public ItemType
  5. {
  6. REGISTRABLE(BrokenStoneToolItemType)
  7. protected:
  8. BrokenStoneToolItemType();
  9. public:
  10. Item* createItem() const override;
  11. };
  12. REGISTER(BrokenStoneToolItemType, ItemType)
  13. class StoneToolItemType : public ItemType
  14. {
  15. REGISTRABLE(StoneToolItemType)
  16. protected:
  17. StoneToolItemType();
  18. void loadSuperItemSkill(ItemSkill* zSkill, Framework::StreamReader* zReader) const override;
  19. void saveSuperItemSkill(const ItemSkill* zSkill, Framework::StreamWriter* zWriter) const override;
  20. public:
  21. Item* createItem() const override;
  22. ItemSkill* createDefaultItemSkill() const override;
  23. };
  24. REGISTER(StoneToolItemType, ItemType)
  25. class StoneToolLevelUpRule : public ItemSkillLevelUpRule
  26. {
  27. public:
  28. StoneToolLevelUpRule();
  29. void applyOn(ItemSkill* zSkill) override;
  30. };
  31. class StoneToolSkill : public ItemSkill
  32. {
  33. private:
  34. int level;
  35. float xp;
  36. float maxXP;
  37. public:
  38. StoneToolSkill();
  39. void use(Entity* zActor, Item* zUsedItem, Block* zTarget) override;
  40. void use(Entity* zActor, Item* zUsedItem, Entity* zTarget) override;
  41. friend StoneToolItemType;
  42. friend StoneToolLevelUpRule;
  43. };