1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include "PlayerHand.h"
- #include "Block.h"
- PlayerHandItemType::PlayerHandItemType()
- : ItemType( ID, new PlayerHandLevelUpRule(), 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) );
- }
- // TODO: make damage on the block
- }
- void PlayerHandSkill::use( Entity* zActor, Item* zUsedItem, Entity* zTarget )
- {
- // TODO: make damage on the entity
- }
|