StoneTool.h 949 B

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