diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-06-06 17:57:19 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-08-07 18:19:50 +0200 |
commit | acc3a85174d22b8f90d92cb2aace260cddba39e6 (patch) | |
tree | ef8aba40055653ce8d5b896cfac2f8099e1da057 /src | |
parent | 60f0f47c81eefb91863549d3dc37aa58422e3675 (diff) | |
download | manaserv-acc3a85174d22b8f90d92cb2aace260cddba39e6.tar.gz manaserv-acc3a85174d22b8f90d92cb2aace260cddba39e6.tar.xz manaserv-acc3a85174d22b8f90d92cb2aace260cddba39e6.zip |
Renamed modifiedAttribute to updateDerivedAttributes
This describes the purpose of the method better.
Diffstat (limited to 'src')
-rw-r--r-- | src/game-server/being.cpp | 12 | ||||
-rw-r--r-- | src/game-server/being.hpp | 2 | ||||
-rw-r--r-- | src/game-server/character.cpp | 12 | ||||
-rw-r--r-- | src/game-server/character.hpp | 2 | ||||
-rw-r--r-- | src/game-server/gamehandler.cpp | 4 | ||||
-rw-r--r-- | src/game-server/inventory.cpp | 2 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index 0e885de..fc56dc5 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -92,7 +92,7 @@ int Being::damage(Actor *, const Damage &damage) Attribute &HP = mAttributes[BASE_ATTR_HP]; LOG_DEBUG("Being " << getPublicID() << " suffered "<<HPloss<<" damage. HP: "<<HP.base + HP.mod<<"/"<<HP.base); HP.mod -= HPloss; - modifiedAttribute(BASE_ATTR_HP); + updateDerivedAttributes(BASE_ATTR_HP); setTimerSoft(T_B_HP_REGEN, Configuration::getValue("hpRegenBreakAfterHit", 0)); // no HP regen after being hit } else { HPloss = 0; @@ -105,7 +105,7 @@ void Being::heal() { Attribute &HP = mAttributes[BASE_ATTR_HP]; HP.mod = HP.base; - modifiedAttribute(BASE_ATTR_HP); + updateDerivedAttributes(BASE_ATTR_HP); } void Being::heal(int hp) @@ -113,7 +113,7 @@ void Being::heal(int hp) Attribute &HP = mAttributes[BASE_ATTR_HP]; HP.mod += hp; if (HP.mod > HP.base) HP.mod = HP.base; - modifiedAttribute(BASE_ATTR_HP); + updateDerivedAttributes(BASE_ATTR_HP); } void Being::died() @@ -308,7 +308,7 @@ void Being::applyModifier(int attr, int amount, int duration, int lvl) mModifiers.push_back(mod); } mAttributes[attr].mod += amount; - modifiedAttribute(attr); + updateDerivedAttributes(attr); } void Being::dispellModifiers(int level) @@ -319,7 +319,7 @@ void Being::dispellModifiers(int level) if (i->level && i->level <= level) { mAttributes[i->attr].mod -= i->value; - modifiedAttribute(i->attr); + updateDerivedAttributes(i->attr); i = mModifiers.erase(i); continue; } @@ -419,7 +419,7 @@ void Being::update() if (!i->duration) { mAttributes[i->attr].mod -= i->value; - modifiedAttribute(i->attr); + updateDerivedAttributes(i->attr); i = mModifiers.erase(i); continue; } diff --git a/src/game-server/being.hpp b/src/game-server/being.hpp index 423e372..e12a5de 100644 --- a/src/game-server/being.hpp +++ b/src/game-server/being.hpp @@ -313,7 +313,7 @@ class Being : public Actor /** * Called when an attribute modifier is changed. */ - virtual void modifiedAttribute(int) {} + virtual void updateDerivedAttributes(int) {} /** * Sets a statuseffect on this being diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 46ffa05..9230458 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -75,7 +75,7 @@ Character::Character(MessageIn &msg): deserializeCharacterData(*this, msg); for (int i = CHAR_ATTR_BEGIN; i < CHAR_ATTR_END; ++i) { - modifiedAttribute(i); + updateDerivedAttributes(i); } setSize(16); Inventory(this).initialize(); @@ -202,7 +202,7 @@ void Character::respawn() // script-controlled respawning didn't work - fall back to // hardcoded logic mAttributes[BASE_ATTR_HP].mod = -mAttributes[BASE_ATTR_HP].base + 1; - modifiedAttribute(BASE_ATTR_HP); //warp back to spawn point + updateDerivedAttributes(BASE_ATTR_HP); //warp back to spawn point int spawnMap = Configuration::getValue("respawnMap", 1); int spawnX = Configuration::getValue("respawnX", 1024); int spawnY = Configuration::getValue("respawnY", 1024); @@ -386,7 +386,7 @@ int Character::getModifiedAttribute(int attr) const } } -void Character::modifiedAttribute(int attr) +void Character::updateDerivedAttributes(int attr) { if (attr >= CHAR_ATTR_BEGIN && attr < CHAR_ATTR_END) { @@ -503,7 +503,7 @@ void Character::receiveExperience(int skill, int experience, int optimalLevel) // check for skill levelup if (Character::levelForExp(newExp) >= Character::levelForExp(oldExp)) { - modifiedAttribute(skill); + updateDerivedAttributes(skill); } mRecalculateLevel = true; @@ -612,7 +612,7 @@ AttribmodResponseCode Character::useCharacterPoint(size_t attribute) mCharacterPoints--; setAttribute(attribute, getAttribute(attribute) + 1); - modifiedAttribute(attribute); + updateDerivedAttributes(attribute); return ATTRIBMOD_OK; } @@ -626,7 +626,7 @@ AttribmodResponseCode Character::useCorrectionPoint(size_t attribute) mCorrectionPoints--; mCharacterPoints++; setAttribute(attribute, getAttribute(attribute) - 1); - modifiedAttribute(attribute); + updateDerivedAttributes(attribute); return ATTRIBMOD_OK; } diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp index fdee364..ddfae34 100644 --- a/src/game-server/character.hpp +++ b/src/game-server/character.hpp @@ -269,7 +269,7 @@ class Character : public Being /** * Updates base Being attributes. */ - void modifiedAttribute(int); + void updateDerivedAttributes(int); /** * Calls all the "disconnected" listener. diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp index 3081658..4dbffd5 100644 --- a/src/game-server/gamehandler.cpp +++ b/src/game-server/gamehandler.cpp @@ -668,12 +668,12 @@ void GameHandler::tokenMatched(GameClient *computer, Character *character) Inventory(character).sendFull(); for (int i = 0; i < CHAR_ATTR_NB; ++i) { - character->modifiedAttribute(i); + character->updateDerivedAttributes(i); } std::map<int, int>::const_iterator skill_it; for (skill_it = character->getSkillBegin(); skill_it != character->getSkillEnd(); skill_it++) { - character->modifiedAttribute(skill_it->first); + character->updateDerivedAttributes(skill_it->first); } } diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp index b90354b..33f0926 100644 --- a/src/game-server/inventory.cpp +++ b/src/game-server/inventory.cpp @@ -680,7 +680,7 @@ void Inventory::changeEquipment(int slot, int itemId) mChangedLook = true; //mark evade as modified because it depends on equipment weight - mClient->modifiedAttribute(BASE_ATTR_EVADE); + mClient->updateDerivedAttributes(BASE_ATTR_EVADE); } void Inventory::equip(int slot) |