From 994ce665a9a32899a0f7efadf1253faa9a3cdbed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Oct 2011 01:36:09 +0300 Subject: Add support for reading monsters attack range. Tmw server not supported. --- src/being.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 84528622d..5eac242fd 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -229,6 +229,7 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): mGender(GENDER_UNSPECIFIED), mParty(0), mIsGM(false), + mAttackRange(1), mType(type), mX(0), mY(0), mDamageTaken(0), @@ -1994,7 +1995,11 @@ bool Being::drawSpriteAt(Graphics *graphics, int x, int y) const if (mHighlightMonsterAttackRange && mType == ActorSprite::MONSTER && isAlive()) { - const int attackRange = 32; + int attackRange; + if (mAttackRange) + attackRange = 32 * mAttackRange; + else + attackRange = 32; graphics->setColor(userPalette->getColorWithAlpha( UserPalette::MONSTER_ATTACK_RANGE)); -- cgit v1.2.3-60-g2f50