123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #pragma once
- #include <JSON.h>
- #include <ReferenceCounter.h>
- #include "Reader.h"
- class ItemType;
- class ItemSkill;
- class Block;
- class Entity;
- class Dimension;
- class Item;
- class ItemSkillLevelUpRule : public virtual Framework::ReferenceCounter
- {
- public:
- virtual void applyOn(ItemSkill* zSkill) = 0;
- };
- class ItemSkill : public virtual Framework::ReferenceCounter
- {
- private:
- const int itemTypeId;
- public:
- ItemSkill(int itemTypeId);
- virtual void use(Entity* zActor, Item* zUsedItem, Block* zTarget) = 0;
- virtual void use(Entity* zActor, Item* zUsedItem, Entity* zTarget) = 0;
- virtual void interact(Entity* zActor, Item* zUsedItem, Block* zTarget);
- virtual void interact(Entity* zActor, Item* zUsedItem, Entity* zTarget);
- const ItemType* zSkillType();
- int getTypeId();
- };
- class BasicItemSkill : public ItemSkill
- {
- protected:
- int level;
- float xp;
- float maxXP;
- float durabilityModifier;
- float speedModifier;
- float luckModifier;
- float staminaModifier;
- float hungerModifier;
- BasicItemSkill(int itemTypeId,
- float maxXp = 100.f,
- float durabilityModifier = 1.f,
- float speedModifier = 1.f,
- float luckModifier = 1.f,
- float staminaModifier = 1.f,
- float hungerModifier = 1.f,
- float xpIncrease = 1.1f);
- public:
- virtual void use(Entity* zActor, Item* zUsedItem, Block* zTarget) override;
- virtual void use(Entity* zActor, Item* zUsedItem, Entity* zTarget) override;
- virtual void interact(
- Entity* zActor, Item* zUsedItem, Block* zTarget) override;
- virtual void interact(
- Entity* zActor, Item* zUsedItem, Entity* zTarget) override;
- friend ItemType;
- };
|