summaryrefslogtreecommitdiff
path: root/src/game-server/monster.hpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:01 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:01 +0000
commitefe4ef65bedbaa66e35f3a4354f7422c313ce624 (patch)
treec1259e6a60e80ee5b8ba97c44f9223071aba4df7 /src/game-server/monster.hpp
parent344fe375ff6e7db425da6ca266e02ea93dd7cc4d (diff)
downloadmanaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.gz
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.bz2
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.xz
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.zip
Implemented dynamic and selective pathblocking. Monsters are blocked by player characters and other monsters, player characters only by monsters.
Diffstat (limited to 'src/game-server/monster.hpp')
-rw-r--r--src/game-server/monster.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp
index a1d3c5a5..0a614081 100644
--- a/src/game-server/monster.hpp
+++ b/src/game-server/monster.hpp
@@ -224,6 +224,12 @@ class Monster : public Being
*/
void forgetTarget(Thing *being);
+ /**
+ * Gets the way the object is blocked by other things on the map
+ */
+ virtual unsigned char getWalkMask() const
+ { return 0x83; } // blocked walls, other monsters and players ( bin 1000 0011)
+
private:
int calculatePositionPriority(Point position, int targetPriority);
@@ -242,6 +248,12 @@ class Monster : public Being
std::list<AttackPosition> mAttackPositions; /**< set positions relative to target from which the monster can attack */
friend struct MonsterTargetEventDispatch;
+ protected:
+ /**
+ * Gets the way the object blocks pathfinding for other objects
+ */
+ virtual Map::BlockType getBlockType() const
+ { return Map::BLOCKTYPE_MONSTER; }
};
#endif // _TMWSERV_MONSTER_H_