diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-09 22:52:34 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-09 22:52:34 +0000 |
commit | 16e99dc852affbc8b149d35037694dcdd25948e6 (patch) | |
tree | 2fed35187b803d595559b11b89118f7ef335d359 /src/resources/monsterdb.cpp | |
parent | 4e2ced304a2013808b2481cceb7622848b073e5b (diff) | |
download | mana-16e99dc852affbc8b149d35037694dcdd25948e6.tar.gz mana-16e99dc852affbc8b149d35037694dcdd25948e6.tar.bz2 mana-16e99dc852affbc8b149d35037694dcdd25948e6.tar.xz mana-16e99dc852affbc8b149d35037694dcdd25948e6.zip |
Actions and particle effect for monster attacks are now obtained from the monster database. Added new tail attack animation to scorpion monster sprite.
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; } |