12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include "Reader.h"
- #include <JSON.h>
- #include <ReferenceCounter.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 ItemType* skillType;
- public:
- ItemSkill( const ItemType* zSkillType );
- virtual void use( Entity* zActor, Item* zUsedItem, Block* zTarget ) = 0;
- virtual void use( Entity* zActor, Item* zUsedItem, Entity* zTarget ) = 0;
- const ItemType* zSkillType();
- };
- class BasicItemSkill : public ItemSkill
- {
- protected:
- int level;
- float xp;
- float maxXP;
- float durabilityModifier;
- float speedModifier;
- float luckModifier;
- float staminaModifier;
- float hungerModifier;
- BasicItemSkill( const ItemType* zSkillType, 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;
- friend ItemType;
- };
|