fix pull request #365 - monster max HP

The recently added sanity check for monster maximum HP was giving
false complaints when Nd8 monster had N mhpmax.  Most noticeable
for level 1 monsters (level 0 monsters use 1d4 instead of 0d8 and
weren't affected) but possible for higher level ones if they were
unlucky--from their own perspective--with all their d8 rolls.

Give level N monsters a minimum of N+1 HP, so minimum of 2 for
level 1 monsters, making 1/8 of those stronger.  Same minimum for
level 0 monsters, 25% of which will become stronger now.  (The pull
request's patch gave every Nd8 monster 1 extra HP; this only does
so for Nd8 and 1d4 ones which have rolled lowest possible amount.)

Also relax the sanity check so that existing to-be-3.7 save files
don't continue to trigger sanity complaints for existing monsters
that have the old minimum.

Fixes 365
This commit is contained in:
PatR
2020-07-14 17:03:51 -07:00
parent ee7fbc4a61
commit abe4db6e60
3 changed files with 26 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.248 $ $NHDT-Date: 1594730609 2020/07/14 12:43:29 $
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.249 $ $NHDT-Date: 1594771373 2020/07/15 00:02:53 $
General Fixes and Modified Features
-----------------------------------
@@ -287,6 +287,8 @@ only generate shop items on solid floor squares
avoid gcc 10 warning by removing duplicate definition of 'head_engr'
if a monster removed a corpse from an ice box, the corpse would never rot away
monster creation on quest levels could make genocided creatures
enabling wizard mode 'sanity_check' option would complain about invalid mhpmax
value for level N monsters created with a d8 value of 1 for all N d8's
tty: redraw unexplored locations as S_unexplored rather than <space> after
map has been partially overwritten by popup menu or text display