summaryrefslogtreecommitdiff
path: root/src/monster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/monster.cpp')
-rw-r--r--src/monster.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/monster.cpp b/src/monster.cpp
index 779b4f56..e2a07e86 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -26,6 +26,7 @@
#include "animatedsprite.h"
#include "game.h"
#include "sound.h"
+#include "particle.h"
#include "resources/monsterdb.h"
@@ -35,7 +36,9 @@
Monster::Monster(Uint32 id, Uint16 job, Map *map):
Being(id, job, map)
{
- std::string filename = MonsterDB::get(job - 1002).getSprite();
+ const MonsterInfo& info = MonsterDB::get(job - 1002);
+
+ std::string filename = info.getSprite();
if (filename != "")
{
mSprites[BASE_SPRITE] = AnimatedSprite::load(
@@ -45,6 +48,15 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map):
{
mSprites[BASE_SPRITE] = AnimatedSprite::load("graphics/sprites/error.xml");
}
+
+ const std::list<std::string> &particleEffects = info.getParticleEffects();
+ for ( std::list<std::string>::const_iterator i = particleEffects.begin();
+ i != particleEffects.end();
+ i++
+ )
+ {
+ controlParticle(particleEngine->addEffect((*i), 0, 0));
+ }
}
void