12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include "PlayerHand.h"
- #include "Block.h"
- PlayerHandItemType::PlayerHandItemType()
- : ItemType(ID, "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(PlayerHandItemType::INSTANCE)
- {}
- 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
- }
|