summaryrefslogtreecommitdiff
path: root/src/game-server/item.hpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-09-27 03:55:19 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-09-27 03:55:19 +0000
commit29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358 (patch)
tree41ca7bb0f8b557e096a2b783f6c94ea4d3e5006a /src/game-server/item.hpp
parentc27d73abc52bdc463a029a5f6a95e1db5df5abf6 (diff)
downloadmanaserv-29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358.tar.gz
manaserv-29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358.tar.bz2
manaserv-29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358.tar.xz
manaserv-29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358.zip
Implemented getting the attack zone of weapons from the item database and implemented single target attacks useful for projectile weapons like bows.
Diffstat (limited to 'src/game-server/item.hpp')
-rw-r--r--src/game-server/item.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game-server/item.hpp b/src/game-server/item.hpp
index 7b21ad87..e0d8943f 100644
--- a/src/game-server/item.hpp
+++ b/src/game-server/item.hpp
@@ -28,6 +28,7 @@
#include "game-server/object.hpp"
+class AttackZone;
class Being;
/**
@@ -175,9 +176,11 @@ class ItemClass
{
public:
ItemClass(int id, ItemType type)
- : mDatabaseID(id), mType(type)
+ : mDatabaseID(id), mType(type), mAttackZone(NULL)
{}
+ ~ItemClass();
+
/**
* Applies the modifiers of an item to a given user.
* @return true if the item was sucessfully used and should be removed.
@@ -256,6 +259,18 @@ class ItemClass
int getSpriteID()
{ return mSpriteID; }
+ /**
+ * Set attack zone (only needed when the item is a weapon)
+ */
+ void setAttackZone(AttackZone* attackZone) { mAttackZone = attackZone; }
+
+ /**
+ * Gets attack zone of weapon (returns NULL for non-weapon items)
+ */
+ AttackZone const *getAttackZone() const
+ { return mAttackZone ; }
+
+
private:
// Item reference information
@@ -266,6 +281,7 @@ class ItemClass
unsigned short mCost; /**< Unit cost the item. */
unsigned short mMaxPerSlot; /**< Max item amount per slot in inventory. */
ItemModifiers mModifiers; /**< Item modifiers. */
+ AttackZone *mAttackZone; /**< attack zone when used as a weapon */
};
class Item: public Object