diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-12-28 18:36:58 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-12-28 18:36:58 +0000 |
commit | df2d513ba368f24cbec3ece3ff0084093a568e86 (patch) | |
tree | 2488c1733a083a873fd6aaaf3acbeb434ee52c1d /src/monster.cpp | |
parent | 805f3a89953eada8eb6186715ac3169e5ed5e845 (diff) | |
download | mana-df2d513ba368f24cbec3ece3ff0084093a568e86.tar.gz mana-df2d513ba368f24cbec3ece3ff0084093a568e86.tar.bz2 mana-df2d513ba368f24cbec3ece3ff0084093a568e86.tar.xz mana-df2d513ba368f24cbec3ece3ff0084093a568e86.zip |
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.
Diffstat (limited to 'src/monster.cpp')
-rw-r--r-- | src/monster.cpp | 14 |
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 |