diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-05-20 20:27:32 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-05-20 20:27:32 +0000 |
commit | e7c3c0ae918caf70f67b378743f0ede929285e42 (patch) | |
tree | 953cb01a89665e500e9a5ec0f711d31df0e27c7d /src/resources | |
parent | c2b7b192b50a4696888ee92a8aa9abfa21eb057e (diff) | |
download | mana-e7c3c0ae918caf70f67b378743f0ede929285e42.tar.gz mana-e7c3c0ae918caf70f67b378743f0ede929285e42.tar.bz2 mana-e7c3c0ae918caf70f67b378743f0ede929285e42.tar.xz mana-e7c3c0ae918caf70f67b378743f0ede929285e42.zip |
Added different target cursor sizes for monsters. Graphics for small and large cursor are provisional until better versions based on the original SVG of the medium sized one are available.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/monsterdb.cpp | 21 | ||||
-rw-r--r-- | src/resources/monsterinfo.h | 11 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index ac3ac3bc..89afc549 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -83,6 +83,27 @@ MonsterDB::load() currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed"));
+ std::string targetCursor;
+ targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium");
+ if (targetCursor == "small")
+ {
+ currentInfo->setTargetCursorSize(Being::TC_SMALL);
+ }
+ else if (targetCursor == "medium")
+ {
+ currentInfo->setTargetCursorSize(Being::TC_MEDIUM);
+ }
+ else if (targetCursor == "large")
+ {
+ currentInfo->setTargetCursorSize(Being::TC_LARGE);
+ }
+ else
+ {
+ logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one",
+ targetCursor.c_str(), currentInfo->getName().c_str());
+ currentInfo->setTargetCursorSize(Being::TC_MEDIUM);
+ }
+
//iterate <sprite>s and <sound>s
for_each_xml_child_node(spriteNode, monsterNode)
{
diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index b65237da..5a820659 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -28,6 +28,8 @@ #include <string> #include <vector> +#include "../being.h" + enum SoundEvent { @@ -63,6 +65,10 @@ class MonsterInfo setSprite(std::string filename) { mSprite = filename; } void + setTargetCursorSize(Being::TargetCursorSize targetCursorSize) + { mTargetCursorSize = targetCursorSize; } + + void addSound(SoundEvent event, std::string filename); const std::string& @@ -71,13 +77,16 @@ class MonsterInfo const std::string& getSprite() const { return mSprite; } + const Being::TargetCursorSize + getTargetCursorSize() const { return mTargetCursorSize; } + std::string getSound(SoundEvent event) const; private: std::string mName; std::string mSprite; - + Being::TargetCursorSize mTargetCursorSize; std::map<SoundEvent, std::vector<std::string>* > mSounds; }; |