diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/monsterdb.cpp | 6 | ||||
-rw-r--r-- | src/resources/monsterinfo.cpp | 5 | ||||
-rw-r--r-- | src/resources/monsterinfo.h | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 84e3a219..e007eda0 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -142,6 +142,12 @@ MonsterDB::load() filename, event.c_str(), currentInfo->getName().c_str()); } } + + if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) + { + currentInfo->addParticleEffect( + (const char*) spriteNode->xmlChildrenNode->content); + } } mMonsterInfos[XML::getProperty(monsterNode, "id", 0)] = currentInfo; } diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp index c4c9ce10..8238dc3e 100644 --- a/src/resources/monsterinfo.cpp +++ b/src/resources/monsterinfo.cpp @@ -70,3 +70,8 @@ MonsterInfo::getSound(MonsterSoundEvent event) const return i->second->at(rand()%i->second->size()); } } + +void MonsterInfo::addParticleEffect(std::string filename) +{ + mParticleEffects.push_back(filename); +} diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 7d49db1a..d9d17510 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -27,6 +27,7 @@ #include <map> #include <string> #include <vector> +#include <list> #include "../being.h" @@ -71,6 +72,9 @@ class MonsterInfo void addSound(MonsterSoundEvent event, std::string filename); + void + addParticleEffect(std::string filename); + const std::string& getName() const { return mName; } @@ -83,11 +87,15 @@ class MonsterInfo std::string getSound(MonsterSoundEvent event) const; + const std::list<std::string>& + getParticleEffects() const { return mParticleEffects; } + private: std::string mName; std::string mSprite; Being::TargetCursorSize mTargetCursorSize; std::map<MonsterSoundEvent, std::vector<std::string>* > mSounds; + std::list<std::string> mParticleEffects; }; #endif |