diff options
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r-- | src/resources/monsterdb.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 5d452db2..c7926260 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -20,12 +20,12 @@ */ #include "monsterdb.h" - #include "resourcemanager.h" #include "../log.h" #include "../utils/dtor.h" +#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -35,23 +35,22 @@ namespace bool mLoaded = false; } -void -MonsterDB::load() +void MonsterDB::load() { if (mLoaded) return; mUnknown.addSprite("error.xml"); - mUnknown.setName("unnamed"); + mUnknown.setName(_("unnamed")); - logger->log("Initializing monster database..."); + logger->log(_("Initializing monster database...")); - XML::Document doc("monsters.xml"); + XML::Document doc(_("monsters.xml")); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { - logger->error("Monster Database: Error while loading monster.xml!"); + logger->error(_("Monster Database: Error while loading monster.xml!")); } //iterate <monster>s @@ -82,7 +81,7 @@ MonsterDB::load() } else { - logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one", + 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); } @@ -119,11 +118,17 @@ MonsterDB::load() } else { - logger->log("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s", + logger->log(_("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s"), filename, event.c_str(), currentInfo->getName().c_str()); } } + if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) + { + std::string event = XML::getProperty(spriteNode, "particle-effect", ""); + currentInfo->addAttackParticleEffect(event); + } + if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { currentInfo->addParticleEffect( @@ -151,7 +156,7 @@ const MonsterInfo &MonsterDB::get(int id) if (i == mMonsterInfos.end()) { - logger->log("MonsterDB: Warning, unknown monster ID %d requested", id); + logger->log(_("MonsterDB: Warning, unknown monster ID %d requested"), id); return mUnknown; } else |