Use a common funcion for all monster healing
Previously, the code for monster healing was repeated every time it was needed; this commit sends it all through a common function, which will make it easier to make changes to how monster healing works in the future. This is just a code reorganisation and won't have any gameplay effect unless I made a mistake.
This commit is contained in:
@@ -1636,9 +1636,7 @@ artifact_hit(
|
||||
healup(drain, 0, FALSE, FALSE);
|
||||
} else {
|
||||
assert(magr != 0);
|
||||
magr->mhp += drain;
|
||||
if (magr->mhp > magr->mhpmax)
|
||||
magr->mhp = magr->mhpmax;
|
||||
healmon(magr, drain, 0);
|
||||
}
|
||||
}
|
||||
return vis;
|
||||
@@ -1664,9 +1662,7 @@ artifact_hit(
|
||||
}
|
||||
losexp("life drainage");
|
||||
if (magr && magr->mhp < magr->mhpmax) {
|
||||
magr->mhp += (abs(oldhpmax - u.uhpmax) + 1) / 2;
|
||||
if (magr->mhp > magr->mhpmax)
|
||||
magr->mhp = magr->mhpmax;
|
||||
healmon(magr, (abs(oldhpmax - u.uhpmax) + 1) / 2, 0);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user