summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 4b1d82ea..32331e35 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -29,7 +29,7 @@ const std::string &ItemInfo::getSprite(Gender gender) const
if (mView)
{
// Forward the request to the item defining how to view this item
- return ItemDB::get(mView).getSprite(gender);
+ return itemDb->get(mView).getSprite(gender);
}
else
{
@@ -41,35 +41,17 @@ const std::string &ItemInfo::getSprite(Gender gender) const
}
}
-void ItemInfo::setWeaponType(int type)
+void ItemInfo::setAttackAction(std::string attackAction)
{
- // See server item.hpp file for type values.
- switch (type)
- {
- case WPNTYPE_NONE:
- mAttackType = ACTION_DEFAULT;
- break;
- case WPNTYPE_KNIFE:
- case WPNTYPE_SWORD:
- mAttackType = ACTION_ATTACK_STAB;
- break;
- case WPNTYPE_THROWN:
- mAttackType = ACTION_ATTACK_THROW;
- break;
- case WPNTYPE_BOW:
- mAttackType = ACTION_ATTACK_BOW;
- break;
- case WPNTYPE_POLEARM:
- mAttackType = ACTION_ATTACK_SWING;
- break;
- default:
- mAttackType = ACTION_ATTACK;
- }
+ if (attackAction.empty())
+ mAttackAction = SpriteAction::ATTACK; // (Equal to unarmed animation)
+ else
+ mAttackAction = attackAction;
}
void ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename)
{
- mSounds[event].push_back(paths.getValue("sfx", "sfx/") + filename);
+ mSounds[event].push_back(paths.getStringValue("sfx") + filename);
}
const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const