diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-10 01:36:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-10 01:36:09 +0300 |
commit | 994ce665a9a32899a0f7efadf1253faa9a3cdbed (patch) | |
tree | b46d2bbf36d85143c95f35c987817ca3f1d25fab /src/being.cpp | |
parent | 2d449d99cc4b42faf246bd24a87ec76da1363e41 (diff) | |
download | plus-994ce665a9a32899a0f7efadf1253faa9a3cdbed.tar.gz plus-994ce665a9a32899a0f7efadf1253faa9a3cdbed.tar.bz2 plus-994ce665a9a32899a0f7efadf1253faa9a3cdbed.tar.xz plus-994ce665a9a32899a0f7efadf1253faa9a3cdbed.zip |
Add support for reading monsters attack range.
Tmw server not supported.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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)); |