diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-21 17:53:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-21 17:53:41 +0300 |
commit | 8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1 (patch) | |
tree | 61f95032eb06210d145b3f1f704c2f60a396974a /src/being | |
parent | 623c0127e4ad5170e9ee003475ed566cec55cfeb (diff) | |
download | manaverse-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.gz manaverse-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.bz2 manaverse-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.xz manaverse-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.zip |
move "change attack type" option into gamemodifiers.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 41 | ||||
-rw-r--r-- | src/being/localplayer.h | 8 |
2 files changed, 6 insertions, 43 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index aed4a17e2..aaaf2e411 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -119,7 +119,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) : mPickUpType(config.getIntValue("pickUpType")), mMagicAttackType(config.getIntValue("magicAttackType")), mPvpAttackType(config.getIntValue("pvpAttackType")), - mAttackType(config.getIntValue("attackType")), mImitationMode(config.getIntValue("imitationMode")), mLastTargetX(0), mLastTargetY(0), @@ -558,7 +557,7 @@ void LocalPlayer::setDestination(const int x, const int y) { mActivityTime = cur_time; - if (getAttackType() == 0 || !mAttackMoving) + if (settings.attackType == 0 || !mAttackMoving) mKeepAttacking = false; // Only send a new message to the server when destination changes @@ -1261,34 +1260,6 @@ void LocalPlayer::changeMode(unsigned *restrict const var, debugMsg(str.substr(4)); } -const unsigned attackTypeSize = 4; - -void LocalPlayer::changeAttackType(const bool forward) -{ - changeMode(&mAttackType, attackTypeSize, "attackType", - &LocalPlayer::getAttackTypeString, 0, true, forward); -} - -static const char *const attackTypeStrings[] = -{ - // TRANSLATORS: attack type in status bar - N_("(D) default attack"), - // TRANSLATORS: attack type in status bar - N_("(G) go and attack"), - // TRANSLATORS: attack type in status bar - N_("(A) go, attack, pickup"), - // TRANSLATORS: attack type in status bar - N_("(d) without auto attack"), - // TRANSLATORS: attack type in status bar - N_("(?) attack") -}; - -std::string LocalPlayer::getAttackTypeString() -{ - return gettext(getVarItem(&attackTypeStrings[0], - mAttackType, attackTypeSize)); -} - const unsigned quickDropCounterSize = 31; void LocalPlayer::changeQuickDropCounter(const bool forward) @@ -3121,13 +3092,13 @@ void LocalPlayer::attack2(Being *const target, const bool keep, changeEquipmentBeforeAttack(target); // probably need cache getPathLength(target) - if ((!target || mAttackType == 0 || mAttackType == 3) + if ((!target || settings.attackType == 0 || settings.attackType == 3) || (withinAttackRange(target, serverVersion < 1, serverVersion < 1 ? 1 : 0) && getPathLength(target) <= getAttackRange2())) { attack(target, keep); - if (mAttackType == 2) + if (settings.attackType == 2) { if (!target) { @@ -3142,7 +3113,7 @@ void LocalPlayer::attack2(Being *const target, const bool keep, } else if (!mPickUpTarget) { - if (mAttackType == 2) + if (settings.attackType == 2) { if (pickUpItems()) return; @@ -3457,7 +3428,7 @@ void LocalPlayer::fixAttackTarget() if (!mMap || !mTarget) return; - if (settings.moveToTargetType == 7 || !mAttackType + if (settings.moveToTargetType == 7 || !settings.attackType || !config.getBoolValue("autofixPos")) { return; @@ -3557,7 +3528,7 @@ void LocalPlayer::resetYellowBar() settings.moveToTargetType = config.resetIntValue("moveToTargetType"); settings.followMode = config.resetIntValue("followMode"); settings.attackWeaponType = config.resetIntValue("attackWeaponType"); - mAttackType = config.resetIntValue("attackType"); + settings.attackType = config.resetIntValue("attackType"); mMagicAttackType = config.resetIntValue("magicAttackType"); mPvpAttackType = config.resetIntValue("pvpAttackType"); mQuickDropCounter = config.resetIntValue("quickDropCounter"); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 711582125..4225be4a0 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -186,14 +186,9 @@ class LocalPlayer final : public Being, bool isPathSetByMouse() const A_WARN_UNUSED { return mPathSetByMouse; } - int getAttackType() const A_WARN_UNUSED - { return mAttackType; } - int getImitationMode() const A_WARN_UNUSED { return mImitationMode; } - void changeAttackType(const bool forward); - void changeImitationMode(const bool forward); void changePickUpType(const bool forward); @@ -429,8 +424,6 @@ class LocalPlayer final : public Being, void setTestParticle(const std::string &fileName, const bool updateHash = true); - std::string getAttackTypeString(); - std::string getQuickDropCounterString(); std::string getPickUpTypeString(); @@ -517,7 +510,6 @@ class LocalPlayer final : public Being, unsigned int mMagicAttackType; // pvp attack type unsigned int mPvpAttackType; - unsigned int mAttackType; unsigned int mImitationMode; int mLastTargetX; |