diff options
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/being.hpp | 2 | ||||
-rw-r--r-- | src/game-server/character.cpp | 7 | ||||
-rw-r--r-- | src/game-server/character.hpp | 15 |
3 files changed, 23 insertions, 1 deletions
diff --git a/src/game-server/being.hpp b/src/game-server/being.hpp index d78ca78a..cb811b12 100644 --- a/src/game-server/being.hpp +++ b/src/game-server/being.hpp @@ -334,6 +334,7 @@ class Being : public Actor static const int TICKS_PER_HP_REGENERATION = 100; Action mAction; std::vector< Attribute > mAttributes; + StatusEffects mStatus; Being *mTarget; Point mOld; /**< Old coordinates. */ Point mDst; /**< Target coordinates. */ @@ -349,7 +350,6 @@ class Being : public Actor std::string mName; Hits mHitsTaken; /**< List of punches taken since last update. */ AttributeModifiers mModifiers; /**< Currently modified attributes. */ - StatusEffects mStatus; int mHpRegenTimer; /**< Timer for hp regeneration. */ }; diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 2d022a1c..f7366dc3 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -124,6 +124,13 @@ void Character::update() mSpecialUpdateNeeded = false; } + mStatusEffects.clear(); + StatusEffects::iterator it = mStatus.begin(); + while(it != mStatus.end()) + { + mStatusEffects[it->first] = it->second.time; + it++; + } Being::update(); } diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp index 603a4a16..2ffb9eeb 100644 --- a/src/game-server/character.hpp +++ b/src/game-server/character.hpp @@ -277,6 +277,18 @@ class Character : public Being { return mExperience.end(); } /** + * used to serialized status effects + */ + int getStatusEffectSize() const + { return mStatusEffects.size(); } + + const std::map<int, int>::const_iterator getStatusEffectBegin() const + { return mStatusEffects.begin(); } + + const std::map<int, int>::const_iterator getStatusEffectEnd() const + { return mStatusEffects.end(); } + + /** * Gets total accumulated exp for skill */ int getExperience(int skill) const @@ -391,6 +403,9 @@ class Character : public Being std::map<int, int> mExperience; /**< experience collected for each skill.*/ std::map<int, Special*> mSpecials; + std::map<int, int> mStatusEffects; /**< only used by select functions + to make it easier to make the accountserver + do not modify or use anywhere else*/ int mRechargePerSpecial; bool mSpecialUpdateNeeded; |