summaryrefslogtreecommitdiff
path: root/src/monster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/monster.cpp')
-rw-r--r--src/monster.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/monster.cpp b/src/monster.cpp
index 0d0757dd..45af468e 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -35,7 +35,8 @@
#include "resources/monsterinfo.h"
Monster::Monster(int id, int job, Map *map):
- Being(id, job, map)
+ Being(id, job, map),
+ mAttackType(1)
{
const MonsterInfo& info = getInfo();
@@ -100,6 +101,7 @@ void Monster::setAction(Action action, int attackType)
sound.playSfx(getInfo().getSound(MONSTER_EVENT_DIE));
break;
case ATTACK:
+ mAttackType = attackType;
currentAction = getInfo().getAttackAction(attackType);
for (SpriteIterator it = mSprites.begin(); it != mSprites.end(); it++)
(*it)->reset();
@@ -148,6 +150,8 @@ void Monster::handleAttack(Being *victim, int damage, AttackType type)
const MonsterInfo &mi = getInfo();
sound.playSfx(mi.getSound((damage > 0) ?
MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
+
+ fireMissile(victim, mi.getAttackMissileParticle(mAttackType));
}
void Monster::takeDamage(Being *attacker, int amount, AttackType type)