summaryrefslogtreecommitdiff
path: root/src/resources/monsterdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r--src/resources/monsterdb.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index b1965989..7bbf9288 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,14 +19,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "monsterdb.h"
-#include "monsterinfo.h"
+#include "resources/monsterdb.h"
-#include "../log.h"
+#include "resources/monsterinfo.h"
-#include "../utils/dtor.h"
-#include "../utils/gettext.h"
-#include "../utils/xml.h"
+#include "log.h"
+
+#include "utils/dtor.h"
+#include "utils/gettext.h"
+#include "utils/xml.h"
namespace
{
@@ -62,7 +62,7 @@ void MonsterDB::load()
continue;
}
- MonsterInfo *currentInfo = new MonsterInfo();
+ MonsterInfo *currentInfo = new MonsterInfo;
currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed")));
@@ -96,8 +96,7 @@ void MonsterDB::load()
currentInfo->addSprite(
(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;
@@ -127,15 +126,16 @@ void MonsterDB::load()
currentInfo->getName().c_str());
}
}
-
- if (xmlStrEqual(spriteNode->name, BAD_CAST "attack"))
+ else if (xmlStrEqual(spriteNode->name, BAD_CAST "attack"))
{
- std::string event = XML::getProperty(
+ const int id = XML::getProperty(spriteNode, "id", 0);
+ const std::string particleEffect = XML::getProperty(
spriteNode, "particle-effect", "");
- currentInfo->addAttackParticleEffect(event);
+ SpriteAction spriteAction = SpriteDef::makeSpriteAction(
+ XML::getProperty(spriteNode, "action", "attack"));
+ currentInfo->addMonsterAttack(id, particleEffect, spriteAction);
}
-
- if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
{
currentInfo->addParticleEffect(
(const char*) spriteNode->xmlChildrenNode->content);