#include "PlayerHand.h" #include "Block.h" PlayerHandItemType::PlayerHandItemType() : ItemType(ItemTypeEnum::PLAYER_HAND, "PlayerHand", new PlayerHandLevelUpRule(), 0, ModelInfo("", "", 0)) {} void PlayerHandItemType::loadSuperItemSkill(ItemSkill* zSkill, Framework::StreamReader* zReader) const { // TODO: load skill data } void PlayerHandItemType::saveSuperItemSkill(const ItemSkill* zSkill, Framework::StreamWriter* zWriter) const { // TODO: store skill data } Item* PlayerHandItemType::createItem() const { return 0; // there is no player hand item } ItemSkill* PlayerHandItemType::createDefaultItemSkill() const { return new PlayerHandSkill(); } PlayerHandLevelUpRule::PlayerHandLevelUpRule() : ItemSkillLevelUpRule() {} void PlayerHandLevelUpRule::applyOn(ItemSkill* zSkill) { // TODO: level up the skill } PlayerHandSkill::PlayerHandSkill() : ItemSkill(ItemTypeEnum::PLAYER_HAND) {} void PlayerHandSkill::use(Entity* zActor, Item* zUsedItem, Block* zTarget) { if (zTarget && zTarget->getHardness() <= 1) { zTarget->setHP(zTarget->getHP() - 1 / (zTarget->getHardness() + 1)); } } void PlayerHandSkill::use(Entity* zActor, Item* zUsedItem, Entity* zTarget) { // TODO: make damage on the entity }