summaryrefslogtreecommitdiff
path: root/src/resources/monsterdb.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-03-23 01:27:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-03-23 01:27:13 +0000
commit9dd811b55587aeb76344b835006cb4a01601bb5d (patch)
treebd297391e264a09ce8467bcf780927a4cef09991 /src/resources/monsterdb.cpp
parentbd8a35eca8c2fa6eb33e7d9219e3fa4d287a2059 (diff)
downloadmana-9dd811b55587aeb76344b835006cb4a01601bb5d.tar.gz
mana-9dd811b55587aeb76344b835006cb4a01601bb5d.tar.bz2
mana-9dd811b55587aeb76344b835006cb4a01601bb5d.tar.xz
mana-9dd811b55587aeb76344b835006cb4a01601bb5d.zip
Merged revisions 3823,3825-3826,3829,3831-3839,3841-3842 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r3823 | crush_tmw | 2007-12-28 19:36:58 +0100 (Fri, 28 Dec 2007) | 1 line Added the possibility to assign particle effects to monsters in the monster database. Added flame particle effect to fire goblin as a proof of concept. ........ r3826 | crush_tmw | 2007-12-30 01:02:14 +0100 (Sun, 30 Dec 2007) | 1 line Added a key for targeting the nearest player character based on patches by Trinexx. Some mapping fixes at snake dungeon map. ........ r3839 | the_enemy | 2008-01-13 17:28:50 +0100 (Sun, 13 Jan 2008) | 1 line Fixed non-default location music loading ........ r3842 | crush_tmw | 2008-01-14 11:48:13 +0100 (Mon, 14 Jan 2008) | 1 line ixed an error in Davids last commit (couldn't compile that way). ........
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r--src/resources/monsterdb.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index fd200e4e..e7e855fa 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -78,13 +78,11 @@ MonsterDB::load()
for_each_xml_child_node(monsterNode, rootNode)
{
if (!xmlStrEqual(monsterNode->name, BAD_CAST "monster"))
- {
continue;
- }
MonsterInfo *currentInfo = new MonsterInfo();
- currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed"));
+ currentInfo->setName(XML::getProperty(monsterNode, "name", "unnamed"));
std::string targetCursor;
targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium");
@@ -102,7 +100,8 @@ 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);
}
@@ -138,17 +137,26 @@ MonsterDB::load()
}
else
{
- logger->log("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s",
- filename, event.c_str(), currentInfo->getName().c_str());
+ logger->log("MonsterDB: Warning, sound effect %s for "
+ "unknown event %s of monster %s",
+ 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"));
+ const int id = XML::getProperty(spriteNode, "id", 0);
+ const std::string particleEffect = XML::getProperty(
+ spriteNode, "particle-effect", "");
+ SpriteAction spriteAction = SpriteDef::makeSpriteAction(
+ XML::getProperty(spriteNode, "action", "attack"));
currentInfo->addMonsterAttack(id, particleEffect, spriteAction);
}
+ else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ {
+ currentInfo->addParticleEffect(
+ (const char*) spriteNode->xmlChildrenNode->content);
+ }
}
mMonsterInfos[XML::getProperty(monsterNode, "id", 0)] = currentInfo;
}