diff options
Diffstat (limited to 'src/game-server/character.hpp')
-rw-r--r-- | src/game-server/character.hpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp index 7b74c08e..fdee3645 100644 --- a/src/game-server/character.hpp +++ b/src/game-server/character.hpp @@ -39,10 +39,9 @@ class Trade; struct Special { - Special(int needed) + Special() { currentMana = 0; - neededMana = needed; } int currentMana; int neededMana; @@ -95,6 +94,21 @@ class Character : public Being void giveSpecial(int id); /** + * Removes all specials from character + */ + void clearSpecials(); + + /** + * Checks if a character knows a special action + */ + bool hasSpecial(int id) { return mSpecials.find(id) != mSpecials.end(); } + + /** + * Removes an available special action + */ + void takeSpecial(int id); + + /** * Gets client computer. */ GameClient *getClient() const @@ -296,7 +310,7 @@ class Character : public Being { return mStatusEffects.end(); } /** - * used to serialized kill count + * used to serialize kill count */ int getKillCountSize() const { return mKillCount.size(); } @@ -311,6 +325,18 @@ class Character : public Being { mKillCount[monsterId] = kills; } /** + * used to serialize specials + */ + int getSpecialSize() const + { return mSpecials.size(); } + + const std::map<int, Special*>::const_iterator getSpecialBegin() const + { return mSpecials.begin(); } + + const std::map<int, Special*>::const_iterator getSpecialEnd() const + { return mSpecials.end(); } + + /** * Gets total accumulated exp for skill */ int getExperience(int skill) const |