From 8f10444e4ce4a4e25455f0a3857edc7ca74631e8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Apr 2011 21:56:11 +0300 Subject: Impliment 3 attack lists. (priority, attack, ignore) --- src/localplayer.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/localplayer.h') 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 getPriorityAttackMobs() + { return mPriorityAttackMobs; } + std::list getAttackMobs() { return mAttackMobs; } + void setPriorityAttackMobs(std::list mobs) + { mPriorityAttackMobs = mobs; } + void setAttackMobs(std::list 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 getAttackMobsSet() { return mAttackMobsSet; } + std::set getPriorityAttackMobsSet() + { return mPriorityAttackMobsSet; } + std::set getIgnoreAttackMobsSet() { return mIgnoreAttackMobsSet; } + void rebuildPriorityAttackMobs(); + void rebuildAttackMobs(); std::map getAttackMobsMap() { return mAttackMobsMap; } + std::map 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 mPriorityAttackMobs; std::list mAttackMobs; std::list mIgnoreAttackMobs; + std::set mPriorityAttackMobsSet; std::set mAttackMobsSet; std::set mIgnoreAttackMobsSet; + std::map mPriorityAttackMobsMap; std::map mAttackMobsMap; }; -- cgit v1.2.3-60-g2f50