summaryrefslogtreecommitdiff
path: root/src/npc.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-05-19 16:18:38 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-05-19 16:18:38 +0000
commite2a27e6fbc71a4f5001d6d314c383ba001b02148 (patch)
tree320730be601afb3216f149f80a2a47bc3a8afd8d /src/npc.cpp
parent25ae0888d39ff370bfe8fa3f4f5eb572dbbe59ec (diff)
downloadmana-e2a27e6fbc71a4f5001d6d314c383ba001b02148.tar.gz
mana-e2a27e6fbc71a4f5001d6d314c383ba001b02148.tar.bz2
mana-e2a27e6fbc71a4f5001d6d314c383ba001b02148.tar.xz
mana-e2a27e6fbc71a4f5001d6d314c383ba001b02148.zip
Added the possibility to add particle effects to NPCs in npcs.xml.
Diffstat (limited to 'src/npc.cpp')
-rw-r--r--src/npc.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/npc.cpp b/src/npc.cpp
index 9336986d..c2b266ff 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -25,6 +25,7 @@
#include "animatedsprite.h"
#include "graphics.h"
+#include "particle.h"
#include "gui/gui.h"
#include "net/messageout.h"
@@ -37,10 +38,11 @@ NPC::NPC(Uint16 id, int sprite, Map *map):
Being(id, sprite, map)
{
NPCInfo info = NPCDB::get(sprite);
- int c = BASE_SPRITE;
- for (NPCInfo::const_iterator i = info.begin();
- i != info.end();
+ //setup NPC sprites
+ int c = BASE_SPRITE;
+ for (std::list<NPCsprite*>::const_iterator i = info.sprites.begin();
+ i != info.sprites.end();
i++)
{
if (c == VECTOREND_SPRITE) break;
@@ -51,7 +53,14 @@ NPC::NPC(Uint16 id, int sprite, Map *map):
c++;
}
- mName = "NPC";
+ //setup particle effects
+ for (std::list<std::string>::const_iterator i = info.particles.begin();
+ i != info.particles.end();
+ i++)
+ {
+ Particle *p = particleEngine->addEffect(*i, 0, 0, 0);
+ this->controlParticle(p);
+ }
}
Being::Type