summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/iteminfo.h')
-rw-r--r--src/resources/iteminfo.h48
1 files changed, 17 insertions, 31 deletions
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index a7c0ddca..ac747e33 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -22,7 +22,7 @@
#ifndef ITEMINFO_H
#define ITEMINFO_H
-#include "player.h"
+#include "being.h"
#include "resources/spritedef.h"
@@ -90,24 +90,6 @@ enum ItemType
};
/**
- * Enumeration of available weapon's types.
- */
-enum WeaponType
-{
- WPNTYPE_NONE = 0,
- WPNTYPE_KNIFE,
- WPNTYPE_SWORD,
- WPNTYPE_POLEARM,
- WPNTYPE_STAFF,
- WPNTYPE_WHIP,
- WPNTYPE_BOW,
- WPNTYPE_SHOOTING,
- WPNTYPE_MACE,
- WPNTYPE_AXE,
- WPNTYPE_THROWN
-};
-
-/**
* Defines a class for storing item infos. This includes information used when
* the item is equipped.
*/
@@ -122,7 +104,7 @@ class ItemInfo
mWeight(0),
mView(0),
mId(0),
- mAttackType(ACTION_DEFAULT)
+ mAttackAction(SpriteAction::INVALID)
{
}
@@ -143,11 +125,11 @@ class ItemInfo
std::string getParticleEffect() const { return mParticle; }
- void setImageName(const std::string &imageName)
- { mImageName = imageName; }
+ void setDisplay(SpriteDisplay display)
+ { mDisplay = display; }
- const std::string &getImageName() const
- { return mImageName; }
+ const SpriteDisplay &getDisplay() const
+ { return mDisplay; }
void setDescription(const std::string &description)
{ mDescription = description; }
@@ -180,15 +162,15 @@ class ItemInfo
const std::string &getSprite(Gender gender) const;
- void setWeaponType(int);
+ void setAttackAction(std::string attackAction);
// Handlers for seting and getting the string used for particles when attacking
void setMissileParticle(std::string s) { mMissileParticle = s; }
std::string getMissileParticle() const { return mMissileParticle; }
- SpriteAction getAttackType() const
- { return mAttackType; }
+ std::string getAttackAction() const
+ { return mAttackAction; }
int getAttackRange() const
{ return mAttackRange; }
@@ -201,7 +183,7 @@ class ItemInfo
const std::string &getSound(EquipmentSoundEvent event) const;
protected:
- std::string mImageName; /**< The filename of the icon image. */
+ SpriteDisplay mDisplay; /**< Display info (like icon) */
std::string mName;
std::string mDescription; /**< Short description. */
std::string mEffect; /**< Description of effects. */
@@ -211,9 +193,13 @@ class ItemInfo
int mView; /**< Item ID of how this item looks. */
int mId; /**< Item ID */
- // Equipment related members
- SpriteAction mAttackType; /**< Attack type, in case of weapon. */
- int mAttackRange; /**< Attack range, will be zero if non weapon. */
+ // Equipment related members.
+ /** Attack type, in case of weapon.
+ * See SpriteAction in spritedef.h for more info.
+ * Attack action sub-types (bow, sword, ...) are defined in items.xml.
+ */
+ std::string mAttackAction;
+ int mAttackRange; /**< Attack range, will be zero if non weapon. */
// Particle to be shown when weapon attacks
std::string mMissileParticle;