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:
@@ -363,8 +363,7 @@ m_cure_self(struct monst *mtmp, int dmg)
|
||||
if (canseemon(mtmp))
|
||||
pline_mon(mtmp, "%s looks better.", Monnam(mtmp));
|
||||
/* note: player healing does 6d4; this used to do 1d8 */
|
||||
if ((mtmp->mhp += d(3, 6)) > mtmp->mhpmax)
|
||||
mtmp->mhp = mtmp->mhpmax;
|
||||
healmon(mtmp, d(3, 6), 0);
|
||||
dmg = 0;
|
||||
}
|
||||
return dmg;
|
||||
|
||||
Reference in New Issue
Block a user