diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-07 17:49:56 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-07 17:49:56 +0000 |
commit | 504b008e264a3213d9802e52b984196ff348f814 (patch) | |
tree | 44c1d0d2e3c0b839c71ca96fccb54444280f500e /src/game-server/monster.hpp | |
parent | e9e633a5b78799311ee765944a7aa52201bcef9d (diff) | |
download | manaserv-504b008e264a3213d9802e52b984196ff348f814.tar.gz manaserv-504b008e264a3213d9802e52b984196ff348f814.tar.bz2 manaserv-504b008e264a3213d9802e52b984196ff348f814.tar.xz manaserv-504b008e264a3213d9802e52b984196ff348f814.zip |
arts of monster behavior are now read from monsters.xml.
Diffstat (limited to 'src/game-server/monster.hpp')
-rw-r--r-- | src/game-server/monster.hpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index f5c7c18f..3b96c619 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -49,7 +49,14 @@ typedef std::vector< MonsterDrop > MonsterDrops; class MonsterClass { public: - MonsterClass(int id): mID(id), mAttributes(BASE_ATTR_NB, 0), mExp(-1) {} + MonsterClass(int id): + mID(id), + mAttributes(BASE_ATTR_NB, 0), + mExp(-1), + mAggressive(false), + mTrackRange(1), + mStrollRange(0) + {} /** * Gets monster type. @@ -87,9 +94,26 @@ class MonsterClass int getExp() const { return mExp; } + void setAggressive(bool aggressive) + { mAggressive = aggressive; } + + bool isAggressive() const + { return mAggressive; } + + void setTrackRange(int range) + { mTrackRange = range; } + + unsigned getTrackRange() const + { return mTrackRange; } + + void setStrollRange(int range) + { mStrollRange = range; } + + unsigned getStrollRange() const + { return mStrollRange; } + /** * Randomly selects a monster drop (may return NULL). - * TODO: pass some luck modifier as an argument. */ ItemClass *getRandomDrop() const; @@ -98,6 +122,9 @@ class MonsterClass MonsterDrops mDrops; /**< Items the monster drops when dying. */ std::vector<int> mAttributes; /**< Base attributes 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 */ + unsigned mStrollRange; /**< Distance the monster strolls around in when not fighting */ }; /** @@ -187,8 +214,6 @@ class Monster : public Being int mAttackAftDelay; /**< time it takes to perform an attack */ int mAttackRange; /**< range of the monsters attacks in pixel */ int mAttackAngle; /**< angle of the monsters attacks in degree */ - bool mAgressive; /**< Does the monster attack without being provoked? */ - unsigned mAgressionRange; /**< Distance the monster tracks enemies in */ std::list<AttackPosition> mAttackPositions; /**< set positions relative to target from which the monster can attack */ friend struct MonsterTargetEventDispatch; |