From 489a429bea6739dfa25503b9329bd9e33bffb856 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 25 Sep 2008 00:15:44 +0000 Subject: Merged the Tametomo branch into trunk. --- src/monster.cpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'src/monster.cpp') 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); } -- cgit v1.2.3-60-g2f50