diff options
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r-- | src/resources/monsterdb.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 84e3a219..fd200e4e 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -26,6 +26,7 @@ #include "monsterdb.h" #include "resourcemanager.h" +#include "spritedef.h" #include "../log.h" @@ -113,8 +114,7 @@ MonsterDB::load() { currentInfo->setSprite((const char*) spriteNode->xmlChildrenNode->content); } - - if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) + else if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) { std::string event = XML::getProperty(spriteNode, "event", ""); const char *filename; @@ -142,6 +142,13 @@ MonsterDB::load() filename, event.c_str(), currentInfo->getName().c_str()); } } + else if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) + { + int id = XML::getProperty(spriteNode, "id", 0); + std::string particleEffect = XML::getProperty(spriteNode, "particle-effect", ""); + SpriteAction spriteAction = SpriteDef::makeSpriteAction(XML::getProperty(spriteNode, "action", "attack")); + currentInfo->addMonsterAttack(id, particleEffect, spriteAction); + } } mMonsterInfos[XML::getProperty(monsterNode, "id", 0)] = currentInfo; } |