diff options
author | Tametomo <irarice@gmail.com> | 2009-04-15 19:55:29 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 19:57:02 +0200 |
commit | 5f00b25ba2895704123eb3d01b3ab5d012d2f333 (patch) | |
tree | 5f94b0a8b54c8a2200c1fe568917f06551208b07 /src/monster.cpp | |
parent | ef13037435c671b76c75c3ecefbad83dbdc578f2 (diff) | |
download | mana-5f00b25ba2895704123eb3d01b3ab5d012d2f333.tar.gz mana-5f00b25ba2895704123eb3d01b3ab5d012d2f333.tar.bz2 mana-5f00b25ba2895704123eb3d01b3ab5d012d2f333.tar.xz mana-5f00b25ba2895704123eb3d01b3ab5d012d2f333.zip |
Some PopupMenu cleanups/fixes and additions.
Signed-off-by: Tametomo <irarice@gmail.com>
Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/monster.cpp')
-rw-r--r-- | src/monster.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/monster.cpp b/src/monster.cpp index 08a614ea..92e1f84a 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -43,8 +43,7 @@ Monster::Monster(int id, int job, Map *map): const std::list<std::string> &sprites = info.getSprites(); for (std::list<std::string>::const_iterator i = sprites.begin(); - i != sprites.end(); - i++) + i != sprites.end(); i++) { if (c == VECTOREND_SPRITE) break; @@ -62,15 +61,16 @@ Monster::Monster(int id, int job, Map *map): if (mParticleEffects) { const std::list<std::string> &particleEffects = info.getParticleEffects(); - for ( std::list<std::string>::const_iterator i = particleEffects.begin(); - i != particleEffects.end(); i++ - ) + for (std::list<std::string>::const_iterator i = particleEffects.begin(); + i != particleEffects.end(); i++) { controlParticle(particleEngine->addEffect((*i), 0, 0)); } } mNameColor = &guiPalette->getColor(Palette::MONSTER); + + Being::setName(getInfo().getName()); } Monster::~Monster() @@ -86,9 +86,7 @@ void Monster::logic() mFrame = (get_elapsed_time(mWalkTime) * 4) / getWalkSpeed(); if (mFrame >= 4 && mAction != DEAD) - { nextStep(); - } } Being::logic(); @@ -132,8 +130,7 @@ void Monster::setAction(Action action, int attackType) default: break; } Particle *p; - p = particleEngine->addEffect( - particleEffect, 0, 0, rotation); + p = particleEngine->addEffect(particleEffect, 0, 0, rotation); controlParticle(p); } break; @@ -153,9 +150,7 @@ void Monster::setAction(Action action, int attackType) for (int i = 0; i < VECTOREND_SPRITE; i++) { if (mSprites[i]) - { mSprites[i]->play(currentAction); - } } mAction = action; } @@ -190,7 +185,9 @@ void Monster::handleAttack(Being *victim, int damage, AttackType type) void Monster::takeDamage(Being *attacker, int amount, AttackType type) { - if (amount > 0) sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT)); + if (amount > 0) + sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT)); + Being::takeDamage(attacker, amount, type); } |