diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-19 20:10:27 +0100 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-19 20:10:27 +0100 |
commit | 3dec609dc5f343547fad87dbbd3d7c7e2c59dde5 (patch) | |
tree | e272c0d3ae0c56b9b455d81718b9a51e7439b101 /src/game-server/map.hpp | |
parent | 53cde41db10d69120cdc46f278178fc5667744a1 (diff) | |
download | manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.gz manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.bz2 manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.xz manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.zip |
Implemented the possibility to have maps with or without PvP combat.
PvP is governed by the map property "pvp". Currently it can be either "none" for no PvP combat or "free" for unrestricted PvP combat. "none" is the default value which is used when pvp is undefined. Later addition of more sophisticated PvP modes is possible.
Diffstat (limited to 'src/game-server/map.hpp')
-rw-r--r-- | src/game-server/map.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/game-server/map.hpp b/src/game-server/map.hpp index 3a9badf9..bbc33fea 100644 --- a/src/game-server/map.hpp +++ b/src/game-server/map.hpp @@ -155,6 +155,17 @@ class Map { return tileHeight; } /** + * Returns a general map property defined in the map file + */ + const std::string &getProperty(const std::string &key) const; + + /** + * Sets a map property + */ + void setProperty(const std::string& key, const std::string& val) + { mProperties[key] = val; } + + /** * Find a path from one location to the next. */ std::list<PATH_NODE> findPath(int startX, int startY, @@ -170,11 +181,14 @@ class Map static const unsigned char BLOCKMASK_CHARACTER = 0x01;// = bin 0000 0001 static const unsigned char BLOCKMASK_MONSTER = 0x02; // = bin 0000 0010 int *mOccupation[NB_BLOCKTYPES]; + + // map properties int mWidth, mHeight; int tileWidth, tileHeight; - MetaTile *mMetaTiles; + std::map<std::string, std::string> mProperties; // Pathfinding members + MetaTile *mMetaTiles; int onClosedList, onOpenList; }; |