summaryrefslogtreecommitdiff
path: root/src/game-server/being.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:01 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-03-13 07:29:01 +0000
commitefe4ef65bedbaa66e35f3a4354f7422c313ce624 (patch)
treec1259e6a60e80ee5b8ba97c44f9223071aba4df7 /src/game-server/being.cpp
parent344fe375ff6e7db425da6ca266e02ea93dd7cc4d (diff)
downloadmanaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.gz
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.bz2
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.xz
manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.zip
Implemented dynamic and selective pathblocking. Monsters are blocked by player characters and other monsters, player characters only by monsters.
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r--src/game-server/being.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index 9164aa43..b18914fa 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -65,8 +65,7 @@ int Being::damage(Object *, Damage const &damage)
And at 200, it means vulnerable (double damage). */
int mod1 = getModifiedAttribute(BASE_ELEM_BEGIN + damage.element);
- /* Resistance to damage at 0 gives normal damage. At 100, it gives halved
- damage. At 200, it divides damage by 3. And so on. */
+ /* Defence is an absolute value which is subtracted from the damage total. */
int mod2 = 0;
switch (damage.type)
{
@@ -84,11 +83,10 @@ int Being::damage(Object *, Damage const &damage)
if (HPloss < 0) HPloss = 0;
mHitsTaken.push_back(HPloss);
-
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);
+ if (HPloss != 0) modifiedAttribute(BASE_ATTR_HP);
return HPloss;
}
@@ -242,7 +240,6 @@ void Being::update()
//only update HP when it actually changed to avoid network noise
if (newHP != oldHP)
{
- LOG_INFO("HP Update - newHP:"<<newHP<<", oldHP:"<<oldHP<<", maxHP:"<<maxHP);
applyModifier(BASE_ATTR_HP, newHP - oldHP);
}