| 1 |
/* |
| 2 |
* The Mana World |
| 3 |
* Copyright (C) 2004 The Mana World Development Team |
| 4 |
* |
| 5 |
* This file is part of The Mana World. |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
* any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef MONSTER_H |
| 23 |
#define MONSTER_H |
| 24 |
|
| 25 |
#include "being.h" |
| 26 |
|
| 27 |
class MonsterInfo; |
| 28 |
class Text; |
| 29 |
|
| 30 |
class Monster : public Being |
| 31 |
{ |
| 32 |
public: |
| 33 |
Monster(int id, int job, Map *map); |
| 34 |
|
| 35 |
#ifdef EATHENA_SUPPORT |
| 36 |
virtual void logic(); |
| 37 |
#endif |
| 38 |
|
| 39 |
virtual void setAction(Action action, int attackType = 0); |
| 40 |
|
| 41 |
virtual Type getType() const { return MONSTER; } |
| 42 |
|
| 43 |
virtual TargetCursorSize |
| 44 |
getTargetCursorSize() const; |
| 45 |
|
| 46 |
/** |
| 47 |
* Handles an attack of another being by this monster. Plays a hit or |
| 48 |
* miss sound when appropriate. |
| 49 |
* |
| 50 |
* @param victim the victim being |
| 51 |
* @param damage the amount of damage dealt (0 means miss) |
| 52 |
* @param type the attack type |
| 53 |
*/ |
| 54 |
virtual void handleAttack(Being *victim, int damage, AttackType type); |
| 55 |
|
| 56 |
/** |
| 57 |
* Puts a damage bubble above this monster and plays the hurt sound |
| 58 |
* |
| 59 |
* @param attacker the attacking being |
| 60 |
* @param damage the amount of damage recieved (0 means miss) |
| 61 |
* @param type the attack type |
| 62 |
*/ |
| 63 |
virtual void takeDamage(Being *attacker, int amount, AttackType type); |
| 64 |
|
| 65 |
/** |
| 66 |
* Returns the MonsterInfo, with static data about this monster. |
| 67 |
*/ |
| 68 |
const MonsterInfo& getInfo() const; |
| 69 |
|
| 70 |
/** |
| 71 |
* Gets the way the monster is blocked by other objects |
| 72 |
*/ |
| 73 |
virtual unsigned char getWalkMask() const |
| 74 |
{ |
| 75 |
return Map::BLOCKMASK_WALL |
| 76 |
| Map::BLOCKMASK_CHARACTER |
| 77 |
| Map::BLOCKMASK_MONSTER; |
| 78 |
} |
| 79 |
|
| 80 |
protected: |
| 81 |
/** |
| 82 |
* Gets the way the monster blocks pathfinding for other objects |
| 83 |
*/ |
| 84 |
virtual Map::BlockType getBlockType() const |
| 85 |
{ return Map::BLOCKTYPE_MONSTER; } |
| 86 |
|
| 87 |
/** |
| 88 |
* Update the text when the monster moves |
| 89 |
*/ |
| 90 |
void updateCoords(); |
| 91 |
|
| 92 |
void showName(); |
| 93 |
}; |
| 94 |
|
| 95 |
#endif |