From df2d513ba368f24cbec3ece3ff0084093a568e86 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Fri, 28 Dec 2007 18:36:58 +0000 Subject: 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. --- src/monster.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/monster.cpp') 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 &particleEffects = info.getParticleEffects(); + for ( std::list::const_iterator i = particleEffects.begin(); + i != particleEffects.end(); + i++ + ) + { + controlParticle(particleEngine->addEffect((*i), 0, 0)); + } } void -- cgit v1.2.3-70-g09d2