diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2010-07-09 15:21:50 +0200 |
---|---|---|
committer | Philipp Sehmisch <mana@crushnet.org> | 2010-07-09 15:22:11 +0200 |
commit | 26d8eba0ad906cd9b4a95bbd94fc1556719fd5d2 (patch) | |
tree | 6d7ea0ebe8be228a61315f72122eed3f2f995a0b /src/game-server/character.hpp | |
parent | 2627acefebc688d9d9733abe23ba5aae79f66ea0 (diff) | |
download | manaserv-26d8eba0ad906cd9b4a95bbd94fc1556719fd5d2.tar.gz manaserv-26d8eba0ad906cd9b4a95bbd94fc1556719fd5d2.tar.bz2 manaserv-26d8eba0ad906cd9b4a95bbd94fc1556719fd5d2.tar.xz manaserv-26d8eba0ad906cd9b4a95bbd94fc1556719fd5d2.zip |
Added LUA script bindings for manipulating the specials available to a character.
Added script call for getting the cost of a special (recharge only for now)
Deleting specials works server-sided but the client isn't informed about it properly. Specials without recharge cost don't appear for the player. Both of these features require an additional netcode message.
Reviewed-by: Freeyorp
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 |