123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #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;
- }
- void ItemSkill::interact(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {
- zTarget->interact(zUsedItem, zActor);
- }
- void ItemSkill::interact(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {
- 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)
- {}
- void BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Block* zTarget) {}
- void BasicItemSkill::use(Entity* zActor, Item* zUsedItem, Entity* zTarget) {}
- void BasicItemSkill::interact(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {}
- void BasicItemSkill::interact(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {}
|