From 8e5861c3cfd41574351547a1a518efcf9007666a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Nov 2011 04:40:34 +0300 Subject: Add ability to play different animation depend on monster hp. Disabled for legacy servers because monster hp unknown and compilated hp can be wrong (version <= 0). For usage need add to action tag attribute hp="xx" Example: ... Here 50 mean 50% of health or less. Default action tag mean hp=100 --- src/compoundsprite.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/compoundsprite.cpp') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 3ee988cec..912c51404 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -544,6 +544,21 @@ void CompoundSprite::initCurrentCacheItem() const } } +bool CompoundSprite::updateNumber(unsigned num) +{ + SpriteConstIterator it, it_end; + bool res(false); + for (it = begin(), it_end = end(); it != it_end; ++ it) + { + if (*it) + { + if ((*it)->updateNumber(num)) + res = true; + } + } + return res; +} + CompoundItem::CompoundItem() : // alpha(1.0f), image(nullptr), -- cgit v1.2.3-60-g2f50