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:
@@ -1740,7 +1740,7 @@ potionhit(struct monst *mon, struct obj *obj, int how)
|
||||
do_healing:
|
||||
angermon = FALSE;
|
||||
if (mon->mhp < mon->mhpmax) {
|
||||
mon->mhp = mon->mhpmax;
|
||||
healmon(mon, mon->mhpmax, 0);
|
||||
if (canseemon(mon))
|
||||
pline("%s looks sound and hale again.", Monnam(mon));
|
||||
}
|
||||
@@ -1827,9 +1827,7 @@ potionhit(struct monst *mon, struct obj *obj, int how)
|
||||
angermon = FALSE;
|
||||
if (canseemon(mon))
|
||||
pline("%s looks healthier.", Monnam(mon));
|
||||
mon->mhp += d(2, 6);
|
||||
if (mon->mhp > mon->mhpmax)
|
||||
mon->mhp = mon->mhpmax;
|
||||
healmon(mon, d(2, 6), 0);
|
||||
if (is_were(mon->data) && is_human(mon->data)
|
||||
&& !Protection_from_shape_changers)
|
||||
new_were(mon); /* transform into beast */
|
||||
|
||||
Reference in New Issue
Block a user