diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-26 21:56:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-26 21:56:11 +0300 |
commit | 8f10444e4ce4a4e25455f0a3857edc7ca74631e8 (patch) | |
tree | 7917730822f7bc090adc6af482eab843c79a389c /src/localplayer.h | |
parent | 110134603554e06adab93a132ef8f82e55db68ad (diff) | |
download | mv-8f10444e4ce4a4e25455f0a3857edc7ca74631e8.tar.gz mv-8f10444e4ce4a4e25455f0a3857edc7ca74631e8.tar.bz2 mv-8f10444e4ce4a4e25455f0a3857edc7ca74631e8.tar.xz mv-8f10444e4ce4a4e25455f0a3857edc7ca74631e8.zip |
Impliment 3 attack lists. (priority, attack, ignore)
Diffstat (limited to 'src/localplayer.h')
-rw-r--r-- | src/localplayer.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/localplayer.h b/src/localplayer.h index f42258a82..b20a89786 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -64,7 +64,6 @@ enum PICKUP_DROP_STEAL }; - /** * The local player character. */ @@ -453,26 +452,43 @@ class LocalPlayer : public Being, public ActorSpriteListener, bool isInAttackList(const std::string &name) { return mAttackMobsSet.find(name) != mAttackMobsSet.end(); } + bool isInPriorityAttackList(const std::string &name) + { return mPriorityAttackMobsSet.find(name) + != mPriorityAttackMobsSet.end(); } + bool isInIgnoreAttackList(const std::string &name) { return mIgnoreAttackMobsSet.find(name) != mIgnoreAttackMobsSet.end(); } +/* bool isInAttackOrIgnoreList(const std::string &name) { return mAttackMobsSet.find(name) != mAttackMobsSet.end() || mIgnoreAttackMobsSet.find(name) != mIgnoreAttackMobsSet.end(); } +*/ void removeAttackMob(const std::string &name); + void addPriorityAttackMob(std::string name); + void addAttackMob(std::string name); void addIgnoreAttackMob(std::string name); + std::list<std::string> getPriorityAttackMobs() + { return mPriorityAttackMobs; } + std::list<std::string> getAttackMobs() { return mAttackMobs; } + void setPriorityAttackMobs(std::list<std::string> mobs) + { mPriorityAttackMobs = mobs; } + void setAttackMobs(std::list<std::string> mobs) { mAttackMobs = mobs; } + int getPriorityAttackMobsSize() + { return mPriorityAttackMobs.size(); } + int getAttackMobsSize() { return mAttackMobs.size(); } @@ -482,16 +498,26 @@ class LocalPlayer : public Being, public ActorSpriteListener, std::set<std::string> getAttackMobsSet() { return mAttackMobsSet; } + std::set<std::string> getPriorityAttackMobsSet() + { return mPriorityAttackMobsSet; } + std::set<std::string> getIgnoreAttackMobsSet() { return mIgnoreAttackMobsSet; } + void rebuildPriorityAttackMobs(); + void rebuildAttackMobs(); std::map<std::string, int> getAttackMobsMap() { return mAttackMobsMap; } + std::map<std::string, int> getPriorityAttackMobsMap() + { return mPriorityAttackMobsMap; } + int getAttackMobIndex(std::string name); + int getPriorityAttackMobIndex(std::string name); + void resetYellowBar(); protected: @@ -620,10 +646,13 @@ class LocalPlayer : public Being, public ActorSpriteListener, bool mServerAttack; std::string mLastHitFrom; std::string mWaitFor; + std::list<std::string> mPriorityAttackMobs; std::list<std::string> mAttackMobs; std::list<std::string> mIgnoreAttackMobs; + std::set<std::string> mPriorityAttackMobsSet; std::set<std::string> mAttackMobsSet; std::set<std::string> mIgnoreAttackMobsSet; + std::map<std::string, int> mPriorityAttackMobsMap; std::map<std::string, int> mAttackMobsMap; }; |