diff options
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/being.hpp | 6 | ||||
-rw-r--r-- | src/game-server/monster.hpp | 6 | ||||
-rw-r--r-- | src/game-server/state.cpp | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/game-server/being.hpp b/src/game-server/being.hpp index 27da220a..b725bfee 100644 --- a/src/game-server/being.hpp +++ b/src/game-server/being.hpp @@ -172,6 +172,12 @@ class Being : public MovingObject { return mAction; } /** + * Gets the type of the attack the being is currently performing. + */ + virtual int getAttackType() const + { return 0; } + + /** * Moves the being toward its destination. */ void move(); diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index 3f6db5c1..05fedd6b 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -204,6 +204,12 @@ class Monster : public Being void perform(); /** + * + */ + virtual int getAttackType() + { return mCurrentAttack->id; } + + /** * Kills the being. */ void died(); diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index 2c7a3633..21305c01 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -194,6 +194,7 @@ static void informPlayer(MapComposite *map, Character *p) MessageOut AttackMsg(GPMSG_BEING_ATTACK); AttackMsg.writeShort(oid); AttackMsg.writeByte(o->getDirection()); + AttackMsg.writeByte(static_cast< Being * >(o)->getAttackType()); gameHandler->sendTo(p, AttackMsg); } |