diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-11 23:42:48 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-11 23:42:48 +0000 |
commit | f03e1cb4ce24e92fa3756d7b9aa9131853783810 (patch) | |
tree | 183c683de37783e42575f990d509b65cee0a44ab /src/game-server/monster.hpp | |
parent | 504b008e264a3213d9802e52b984196ff348f814 (diff) | |
download | manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.gz manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.bz2 manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.xz manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.zip |
Implemented getting size and speed from monster.xml
Diffstat (limited to 'src/game-server/monster.hpp')
-rw-r--r-- | src/game-server/monster.hpp | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index 3b96c619..e93051b4 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -52,6 +52,8 @@ class MonsterClass MonsterClass(int id): mID(id), mAttributes(BASE_ATTR_NB, 0), + mSpeed(1), + mSize(16), mExp(-1), mAggressive(false), mTrackRange(1), @@ -82,35 +84,23 @@ class MonsterClass int getAttribute(size_t attribute) const { return mAttributes.at(attribute); } - /** - * Sets exp reward for killing the monster - */ - void setExp(int exp) - { mExp = exp; } - - /** - * Gets exp reward for killing the monster - */ - int getExp() const - { return mExp; } - - void setAggressive(bool aggressive) - { mAggressive = aggressive; } + void setSpeed(int speed) { mSpeed = speed; } /**< sets inverted movement speed*/ + int getSpeed() const { return mSpeed; } /**< gets inverted movement speed*/ - bool isAggressive() const - { return mAggressive; } + void setSize(int size) { mSize = size; } /**< sets hit circle radius*/ + int getSize() const { return mSize; } /**< gets hit circle radius*/ - void setTrackRange(int range) - { mTrackRange = range; } + void setExp(int exp) { mExp = exp; } /**< sets experience reward*/ + int getExp() const { return mExp; } /**< gets experience reward*/ - unsigned getTrackRange() const - { return mTrackRange; } + void setAggressive(bool aggressive) { mAggressive = aggressive; } /**< sets if the monster attacks without being attacked first*/ + bool isAggressive() const { return mAggressive; } /**< gets if the monster attacks without being attacked first*/ - void setStrollRange(int range) - { mStrollRange = range; } + void setTrackRange(int range){ mTrackRange = range; } /**< sets range in tiles in which the monster searches for enemies*/ + unsigned getTrackRange() const { return mTrackRange; } /**< gets range in tiles in which the monster searches for enemies*/ - unsigned getStrollRange() const - { return mStrollRange; } + void setStrollRange(int range) { mStrollRange = range; } /**< sets range in tiles in which the monster moves around when idled*/ + unsigned getStrollRange() const { return mStrollRange; } /**< gets range in tiles in which the monster moves around when idled*/ /** * Randomly selects a monster drop (may return NULL). @@ -121,6 +111,8 @@ class MonsterClass unsigned short mID; /**< ID of the monster class. */ MonsterDrops mDrops; /**< Items the monster drops when dying. */ std::vector<int> mAttributes; /**< Base attributes of the monster*/ + int mSpeed; /** (inverted) Movement speed of the monster */ + int mSize; /** Collision circle radius of the monster */ int mExp; /**< Exp reward for killing the monster */ bool mAggressive; /**< Does the monster attack without being provoked? */ unsigned mTrackRange; /**< Distance the monster tracks enemies in */ |