summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderic Morris <roderic@ccs.neu.edu>2008-07-27 20:43:39 +0000
committerRoderic Morris <roderic@ccs.neu.edu>2008-07-27 20:43:39 +0000
commit30f5a677644fc34fc7e8b3493f7af42056c3285f (patch)
tree5d56b31b584f1358fc4b856f9489888403efac5b
parent2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c (diff)
downloadmanaserv-30f5a677644fc34fc7e8b3493f7af42056c3285f.tar.gz
manaserv-30f5a677644fc34fc7e8b3493f7af42056c3285f.tar.bz2
manaserv-30f5a677644fc34fc7e8b3493f7af42056c3285f.tar.xz
manaserv-30f5a677644fc34fc7e8b3493f7af42056c3285f.zip
account for weapon skills in damage calculation.
-rw-r--r--ChangeLog5
-rw-r--r--src/game-server/character.cpp7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c183ea1..2177c3ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-27 Roderic Morris <roderic@ccs.neu.edu>
+
+ * src/game-server/character.cpp: take into account weapon skills
+ in damage calculation.
+
2008-07-24 David Athay <ko2fan@gmail.com>
* src/defines.h, src/game-server/movingobject.cpp,
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index 3fb938c8..b2420c31 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -95,11 +95,12 @@ void Character::perform()
int type = ic ? ic->getModifiers().getValue(MOD_WEAPON_TYPE) : WPNTYPE_NONE;
Damage damage;
- damage.base = getModifiedAttribute(BASE_ATTR_PHY_ATK_MIN);
+ damage.base = getModifiedAttribute(BASE_ATTR_PHY_ATK_MIN) +
+ (rand() % getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type));
damage.delta = getModifiedAttribute(BASE_ATTR_PHY_ATK_DELTA);
damage.type = DAMAGE_PHYSICAL;
- damage.cth = getModifiedAttribute(BASE_ATTR_HIT)
- + getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type);
+ damage.cth = getModifiedAttribute(BASE_ATTR_HIT) +
+ getModifiedAttribute(CHAR_SKILL_WEAPON_BEGIN + type);
damage.usedSkill = CHAR_SKILL_WEAPON_BEGIN + type;
if (type)
{