diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-06-10 09:54:03 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-01-08 16:58:57 +0100 |
commit | 0f0004ff3e286270c0425642a5669661ef6cb592 (patch) | |
tree | a692ef4ec410d80a93be88339ebade9036099760 | |
parent | 5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3 (diff) | |
download | manaserv-0f0004ff3e286270c0425642a5669661ef6cb592.tar.gz manaserv-0f0004ff3e286270c0425642a5669661ef6cb592.tar.bz2 manaserv-0f0004ff3e286270c0425642a5669661ef6cb592.tar.xz manaserv-0f0004ff3e286270c0425642a5669661ef6cb592.zip |
Rename AutoAttack to Attack
-rw-r--r-- | example/items.xml | 6 | ||||
-rw-r--r-- | gameserver.cbp | 4 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/common/defines.h | 2 | ||||
-rw-r--r-- | src/game-server/attack.cpp (renamed from src/game-server/autoattack.cpp) | 30 | ||||
-rw-r--r-- | src/game-server/attack.h (renamed from src/game-server/autoattack.h) | 26 | ||||
-rw-r--r-- | src/game-server/being.cpp | 2 | ||||
-rw-r--r-- | src/game-server/being.h | 4 | ||||
-rw-r--r-- | src/game-server/character.cpp | 18 | ||||
-rw-r--r-- | src/game-server/item.cpp | 6 | ||||
-rw-r--r-- | src/game-server/item.h | 6 | ||||
-rw-r--r-- | src/game-server/itemmanager.cpp | 2 |
12 files changed, 55 insertions, 55 deletions
diff --git a/example/items.xml b/example/items.xml index cdbc3e44..e58949e4 100644 --- a/example/items.xml +++ b/example/items.xml @@ -117,7 +117,7 @@ </equip> <effect trigger="equip"> <modifier attribute="acc1" value="1.0" /> - <autoattack skill="102" warmupspeed="10" cooldownspeed="166" + <attack skill="102" warmupspeed="10" cooldownspeed="166" basedamage="50" deltadamage="10" chancetohit="2" range="32" element="neutral" damagetype="physical" /> </effect> @@ -134,7 +134,7 @@ <slot type="hand" required="2" /> </equip> <effect trigger="equip"> - <autoattack skill="106" warmupspeed="10" cooldownspeed="166" + <attack skill="106" warmupspeed="10" cooldownspeed="166" basedamage="50" deltadamage="10" chancetohit="2" range="160" element="neutral" damagetype="physical" /> <modifier attribute="acc1" value="1.5" /> @@ -152,7 +152,7 @@ <slot type="hand" required="1" /> </equip> <effect trigger="equip"> - <autoattack skill="100" warmupspeed="10" cooldownspeed="166" + <attack skill="100" warmupspeed="10" cooldownspeed="166" basedamage="50" deltadamage="10" chancetohit="2" range="32" element="neutral" damagetype="physical" /> <modifier attribute="acc1" value="1.5" /> diff --git a/gameserver.cbp b/gameserver.cbp index 409b8715..ef0fc325 100644 --- a/gameserver.cbp +++ b/gameserver.cbp @@ -118,8 +118,8 @@ <Unit filename="src/game-server/attribute.h" /> <Unit filename="src/game-server/attributemanager.cpp" /> <Unit filename="src/game-server/attributemanager.h" /> - <Unit filename="src/game-server/autoattack.cpp" /> - <Unit filename="src/game-server/autoattack.h" /> + <Unit filename="src/game-server/attack.cpp" /> + <Unit filename="src/game-server/attack.h" /> <Unit filename="src/game-server/being.cpp" /> <Unit filename="src/game-server/being.h" /> <Unit filename="src/game-server/buysell.cpp" /> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c1a5bd05..5a4b38fc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -193,12 +193,12 @@ SET(SRCS_MANASERVGAME game-server/accountconnection.cpp game-server/actor.h game-server/actor.cpp + game-server/attack.h + game-server/attack.cpp game-server/attribute.h game-server/attribute.cpp game-server/attributemanager.h game-server/attributemanager.cpp - game-server/autoattack.h - game-server/autoattack.cpp game-server/being.h game-server/being.cpp game-server/buysell.h diff --git a/src/common/defines.h b/src/common/defines.h index 3c7d8463..dab5b038 100644 --- a/src/common/defines.h +++ b/src/common/defines.h @@ -178,7 +178,7 @@ enum /** * Temporary attributes. - * @todo Use AutoAttacks instead. + * @todo Use Attacks instead. */ MOB_ATTR_PHY_ATK_MIN = 20, MOB_ATTR_PHY_ATK_DELTA = 21, diff --git a/src/game-server/autoattack.cpp b/src/game-server/attack.cpp index d8425d50..4f04255f 100644 --- a/src/game-server/autoattack.cpp +++ b/src/game-server/attack.cpp @@ -18,34 +18,34 @@ * along with The Mana Server. If not, see <http://www.gnu.org/licenses/>. */ -#include "autoattack.h" +#include "attack.h" -void AutoAttacks::add(const AutoAttack &autoAttack) +void Attacks::add(const Attack &attack) { - mAutoAttacks.push_back(autoAttack); + mAttacks.push_back(attack); // Slow, but safe. - mAutoAttacks.sort(); + mAttacks.sort(); } -void AutoAttacks::clear() +void Attacks::clear() { - mAutoAttacks.clear(); + mAttacks.clear(); } -void AutoAttacks::stop() +void Attacks::stop() { - for (std::list<AutoAttack>::iterator it = mAutoAttacks.begin(); - it != mAutoAttacks.end(); ++it) + for (std::list<Attack>::iterator it = mAttacks.begin(); + it != mAttacks.end(); ++it) { it->halt(); } mActive = false; } -void AutoAttacks::start() +void Attacks::start() { - for (std::list<AutoAttack>::iterator it = mAutoAttacks.begin(); - it != mAutoAttacks.end(); ++it) + for (std::list<Attack>::iterator it = mAttacks.begin(); + it != mAttacks.end(); ++it) { // If the attack is inactive, we hard reset it. if (!it->getTimer()) @@ -56,10 +56,10 @@ void AutoAttacks::start() mActive = true; } -void AutoAttacks::tick(std::list<AutoAttack> *ret) +void Attacks::tick(std::list<Attack> *ret) { - for (std::list<AutoAttack>::iterator it = mAutoAttacks.begin(); - it != mAutoAttacks.end(); ++it) + for (std::list<Attack>::iterator it = mAttacks.begin(); + it != mAttacks.end(); ++it) { if (it->tick()) { diff --git a/src/game-server/autoattack.h b/src/game-server/attack.h index a1e22aee..f9ddf6ae 100644 --- a/src/game-server/autoattack.h +++ b/src/game-server/attack.h @@ -18,8 +18,8 @@ * along with The Mana Server. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef AUTOATTACK_H -#define AUTOATTACK_H +#ifndef ATTACK_H +#define ATTACK_H #include <cstddef> #include <list> @@ -57,10 +57,10 @@ struct Damage * Class that stores information about an auto-attack */ -class AutoAttack +class Attack { public: - AutoAttack(Damage &damage, unsigned int warmup, unsigned int cooldown): + Attack(Damage &damage, unsigned int warmup, unsigned int cooldown): mDamage(damage), mTimer(0), mAspd(cooldown), @@ -74,7 +74,7 @@ class AutoAttack void halt() { if (mTimer >= mWarmup) mTimer = 0; } bool isReady() const { return !(mTimer - mWarmup); } - bool operator<(const AutoAttack &rhs) const + bool operator<(const Attack &rhs) const { return mTimer < rhs.mTimer; } const Damage &getDamage() const { return mDamage; } @@ -117,26 +117,26 @@ class AutoAttack /** * Helper class for storing multiple auto-attacks. */ -class AutoAttacks +class Attacks { public: /** * Whether the being has at least one auto attack that is ready. */ - void add(const AutoAttack &); + void add(const Attack &); void clear(); // Wipe the list completely (used in place of remove for now; FIXME) void start(); void stop(); // If the character does some action other than attacking, reset all warmups (NOT cooldowns!) - void tick(std::list<AutoAttack> *ret = 0); + void tick(std::list<Attack> *ret = 0); /** * Tells the number of attacks available */ - unsigned getAutoAttacksNumber() - { return mAutoAttacks.size(); } + unsigned getNumber() + { return mAttacks.size(); } /** - * Tells whether the autoattacks are active. + * Tells whether the attacks are active. */ bool areActive() { return mActive; } @@ -147,7 +147,7 @@ class AutoAttacks * to be processed when false. */ bool mActive; - std::list<AutoAttack> mAutoAttacks; + std::list<Attack> mAttacks; }; -#endif // AUTOATTACK_H +#endif // ATTACK_H diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index 2f4e677b..7ae01a00 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -440,7 +440,7 @@ void Being::setAction(BeingAction action) { // Stops the auto-attacks when changing action if (mAction == ATTACK && action != ATTACK) - mAutoAttacks.stop(); + mAttacks.stop(); mAction = action; if (action != ATTACK && // The players are informed about these actions diff --git a/src/game-server/being.h b/src/game-server/being.h index 8e7d6199..be1e5704 100644 --- a/src/game-server/being.h +++ b/src/game-server/being.h @@ -29,7 +29,7 @@ #include "game-server/actor.h" #include "game-server/attribute.h" -#include "game-server/autoattack.h" +#include "game-server/attack.h" #include "game-server/timeout.h" class Being; @@ -290,7 +290,7 @@ class Being : public Actor BeingAction mAction; AttributeMap mAttributes; - AutoAttacks mAutoAttacks; + Attacks mAttacks; StatusEffects mStatus; Being *mTarget; Point mOld; /**< Old coordinates. */ diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index a4825878..d2b694c1 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -170,12 +170,12 @@ void Character::update() void Character::processAttacks() { // Ticks attacks even when not attacking to permit cooldowns and warmups. - std::list<AutoAttack> attacksReady; - mAutoAttacks.tick(&attacksReady); + std::list<Attack> attacksReady; + mAttacks.tick(&attacksReady); if (mAction != ATTACK || !mTarget) { - mAutoAttacks.stop(); + mAttacks.stop(); return; } @@ -183,7 +183,7 @@ void Character::processAttacks() // Install default bare knuckle attack if no attacks were added from config. // TODO: Get this from configuration. - if (!mAutoAttacks.getAutoAttacksNumber()) + if (!mAttacks.getNumber()) { int damageBase = getModifiedAttribute(ATTR_STR); int damageDelta = damageBase / 2; @@ -197,19 +197,19 @@ void Character::processAttacks() knuckleDamage.range = (getSize() < DEFAULT_TILE_LENGTH) ? DEFAULT_TILE_LENGTH : getSize(); - AutoAttack knuckleAttack(knuckleDamage, 7, 3); - mAutoAttacks.add(knuckleAttack); + Attack knuckleAttack(knuckleDamage, 7, 3); + mAttacks.add(knuckleAttack); } if (attacksReady.empty()) { - if (!mAutoAttacks.areActive()) - mAutoAttacks.start(); + if (!mAttacks.areActive()) + mAttacks.start(); } else { // Performs all ready attacks. - for (std::list<AutoAttack>::iterator it = attacksReady.begin(); + for (std::list<Attack>::iterator it = attacksReady.begin(); it != attacksReady.end(); ++it) { performAttack(mTarget, it->getDamage()); diff --git a/src/game-server/item.cpp b/src/game-server/item.cpp index d85a1615..15041ad2 100644 --- a/src/game-server/item.cpp +++ b/src/game-server/item.cpp @@ -25,7 +25,7 @@ #include "game-server/item.h" #include "common/configuration.h" -#include "game-server/autoattack.h" +#include "game-server/attack.h" #include "game-server/attributemanager.h" #include "game-server/being.h" #include "game-server/state.h" @@ -47,13 +47,13 @@ void ItemEffectAttrMod::dispell(Being *itemUser) mId, !mDuration); } -bool ItemEffectAutoAttack::apply(Being * /* itemUser */) +bool ItemEffectAttack::apply(Being * /* itemUser */) { // TODO - STUB return false; } -void ItemEffectAutoAttack::dispell(Being * /* itemUser */) +void ItemEffectAttack::dispell(Being * /* itemUser */) { // TODO } diff --git a/src/game-server/item.h b/src/game-server/item.h index bfc0c80b..872e52ce 100644 --- a/src/game-server/item.h +++ b/src/game-server/item.h @@ -67,7 +67,7 @@ enum SET_STATE_NOT_FLOATING }; -struct ItemAutoAttackInfo +struct ItemAttackInfo { unsigned int base; unsigned int range; @@ -93,7 +93,7 @@ enum ItemEffectType // Effects that are removed automatically when the trigger ends // (ie. item no longer exists in invy, unequipped) IET_ATTR_MOD = 0, // Modify a given attribute with a given value - IET_AUTOATTACK, // Give the associated being an autoattack + IET_ATTACK, // Give the associated being an attack // Effects that do not need any automatic removal IET_COOLDOWN, // Set a cooldown to this item, preventing activation for n ticks IET_G_COOLDOWN, // Set a cooldown to all items of this type for this being @@ -128,7 +128,7 @@ class ItemEffectAttrMod : public ItemEffectInfo unsigned int mId; }; -class ItemEffectAutoAttack : public ItemEffectInfo +class ItemEffectAttack : public ItemEffectInfo { public: bool apply(Being *itemUser); diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp index 8c74680e..2b6056b1 100644 --- a/src/game-server/itemmanager.cpp +++ b/src/game-server/itemmanager.cpp @@ -385,7 +385,7 @@ void ItemManager::readEffectNode(xmlNodePtr effectNode, ItemClass *item) duration), triggerTypes.first, triggerTypes.second); } - else if (xmlStrEqual(subNode->name, BAD_CAST "autoattack")) + else if (xmlStrEqual(subNode->name, BAD_CAST "attack")) { // TODO - URGENT } |