12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include "ItemSkill.h"
- #include "Block.h"
- #include "Entity.h"
- #include "ItemType.h"
- #include "StaticRegistry.h"
- ItemSkill::ItemSkill(int itemTypeId)
- : Framework::ReferenceCounter(),
- itemTypeId(itemTypeId)
- {}
- const ItemType* ItemSkill::zSkillType()
- {
- return StaticRegistry<ItemType>::INSTANCE.zElement(itemTypeId);
- }
- int ItemSkill::getTypeId()
- {
- return itemTypeId;
- }
- bool ItemSkill::interact(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {
- return zTarget->interact(zUsedItem, zActor);
- }
- bool ItemSkill::interact(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {
- return zTarget->interact(zUsedItem, zActor);
- }
- BasicItemSkill::BasicItemSkill(int itemTypeId,
- float maxXP,
- float durabilityModifier,
- float speedModifier,
- float luckModifier,
- float staminaModifier,
- float hungerModifier,
- float xpIncrease)
- : ItemSkill(itemTypeId),
- level(1),
- xp(0),
- maxXP(maxXP),
- durabilityModifier(durabilityModifier),
- speedModifier(speedModifier),
- luckModifier(luckModifier),
- staminaModifier(staminaModifier),
- hungerModifier(hungerModifier)
- {}
- bool BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {
- return false;
- }
- bool BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {
- return false;
- }
- bool BasicItemSkill::interact(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {
- return false;
- }
- bool BasicItemSkill::interact(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {
- return false;
- }
|