ItemSkill.cpp 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "ItemSkill.h"
  2. #include "ItemType.h"
  3. #include "StaticRegistry.h"
  4. ItemSkill::ItemSkill(int itemTypeId)
  5. : Framework::ReferenceCounter(),
  6. itemTypeId(itemTypeId)
  7. {}
  8. const ItemType* ItemSkill::zSkillType()
  9. {
  10. return StaticRegistry<ItemType>::INSTANCE.zElement(itemTypeId);
  11. }
  12. int ItemSkill::getTypeId()
  13. {
  14. return itemTypeId;
  15. }
  16. BasicItemSkill::BasicItemSkill(int itemTypeId,
  17. float maxXP,
  18. float durabilityModifier,
  19. float speedModifier,
  20. float luckModifier,
  21. float staminaModifier,
  22. float hungerModifier,
  23. float xpIncrease)
  24. : ItemSkill(itemTypeId),
  25. level(1),
  26. xp(0),
  27. maxXP(maxXP),
  28. durabilityModifier(durabilityModifier),
  29. speedModifier(speedModifier),
  30. luckModifier(luckModifier),
  31. staminaModifier(staminaModifier),
  32. hungerModifier(hungerModifier)
  33. {}
  34. void BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Block* zTarget) {}
  35. void BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Entity* zTarget) {}