Shovel.h 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "BasicTool.h"
  3. #include "ItemSkill.h"
  4. #include "ItemType.h"
  5. class ShovelToolItemType : 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. ShovelToolItemType();
  14. Item* createItem() const override;
  15. ItemSkill* createDefaultItemSkill() const override;
  16. };
  17. class ShovelToolLevelUpRule : public ItemSkillLevelUpRule
  18. {
  19. public:
  20. ShovelToolLevelUpRule();
  21. void applyOn(ItemSkill* zSkill) override;
  22. };
  23. class ShovelToolSkill : public ItemSkill
  24. {
  25. private:
  26. int level;
  27. float xp;
  28. float maxXP;
  29. public:
  30. ShovelToolSkill();
  31. void use(Entity* zActor, Item* zUsedItem, Block* zTarget) override;
  32. void use(Entity* zActor, Item* zUsedItem, Entity* zTarget) override;
  33. friend ShovelToolItemType;
  34. friend ShovelToolLevelUpRule;
  35. };