summaryrefslogtreecommitdiff
path: root/src/monster.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-09-25 00:15:44 +0000
committerIra Rice <irarice@gmail.com>2008-09-25 00:15:44 +0000
commit489a429bea6739dfa25503b9329bd9e33bffb856 (patch)
tree8112f6fd988fdc0610329b6bc14ee3f9d5801092 /src/monster.cpp
parent2dc8eadff1e67bb70b1772ecc19c9e1e2e40a5b4 (diff)
downloadmana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.gz
mana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.bz2
mana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.xz
mana-489a429bea6739dfa25503b9329bd9e33bffb856.zip
Merged the Tametomo branch into trunk.
Diffstat (limited to 'src/monster.cpp')
-rw-r--r--src/monster.cpp37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/monster.cpp b/src/monster.cpp
index d3e52520..2b6fadce 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -74,15 +74,13 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map):
}
}
-Monster::~Monster() {
-
+Monster::~Monster()
+{
if (mText)
delete mText;
-
}
-void
-Monster::logic()
+void Monster::logic()
{
if (mAction != STAND)
{
@@ -97,14 +95,12 @@ Monster::logic()
Being::logic();
}
-Being::Type
-Monster::getType() const
+Being::Type Monster::getType() const
{
return MONSTER;
}
-void
-Monster::setAction(Uint8 action)
+void Monster::setAction(Action action)
{
SpriteAction currentAction = ACTION_INVALID;
@@ -122,11 +118,14 @@ Monster::setAction(Uint8 action)
mSprites[BASE_SPRITE]->reset();
break;
case STAND:
- currentAction = ACTION_STAND;
- break;
+ currentAction = ACTION_STAND;
+ break;
case HURT:
- // Not implemented yet
- break;
+ // Not implemented yet
+ break;
+ case SIT:
+ // Also not implemented yet
+ break;
}
if (currentAction != ACTION_INVALID)
@@ -142,8 +141,7 @@ Monster::setAction(Uint8 action)
}
}
-void
-Monster::handleAttack(Being *victim, int damage)
+void Monster::handleAttack(Being *victim, int damage)
{
Being::handleAttack(victim, damage);
@@ -151,21 +149,18 @@ Monster::handleAttack(Being *victim, int damage)
sound.playSfx(mi.getSound((damage > 0) ? MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
}
-void
-Monster::takeDamage(int amount)
+void Monster::takeDamage(int amount)
{
if (amount > 0) sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT));
Being::takeDamage(amount);
}
-Being::TargetCursorSize
-Monster::getTargetCursorSize() const
+Being::TargetCursorSize Monster::getTargetCursorSize() const
{
return getInfo().getTargetCursorSize();
}
-const MonsterInfo&
-Monster::getInfo() const
+const MonsterInfo& Monster::getInfo() const
{
return MonsterDB::get(mJob - 1002);
}