max HP manipulation

Life-saving has been setting u.uhpmax to max(2 * u.ulevel, 10)
and if it took place during level drain that could make u.uhpmax
increase instead of decrease, confusing healing which gets applied
to a monster who has drained the hero with Stormbringer or the
Staff of Aesculapius.  Change the setting to be max(u.ulevel, 10)
(removing the times two part) and also have level drain force it
to be set back to previous value if/when it gets increased.

Max HP loss due to strength trying to drop below 3 or to fire trap
or to being hit by Death now uses a mininum max HP of u.ulevel
rather than 1.  They don't have the alternate minimum of 10; I'm
uneasy that there are still two different minimum values.

I changed adjattrib() to set the flag to request a status update
before it gave its optional message rather than after so that the
new characteristic value would be visible during the message.  That
resulted in not updating status when eating royal jelly changed HP
or max HP after boosting strength.  But the same missing update
would have occurred--or rather, failed to occur--without the change
in sequencing if the strength boost causes a change in encumbrance.
This commit is contained in:
PatR
2022-03-21 12:32:07 -07:00
parent 8a9578e94c
commit d53c1a7a67
8 changed files with 86 additions and 26 deletions

View File

@@ -838,6 +838,10 @@ for #knownclass with menustyle=Tradtional, allow player to ask for `a even if
no artifacts have been discovered yet, same as `<any-object-class>;
likewise for `u to ask to see unique items
reduce eucalyptus leaf nutrition to 1
life-saving might increase max HP; if level drain triggers that, don't let max
HP go up because it confuses healing for monster wielding Stormbringer
HP recovery and/or max HP boost from eating royal jelly didn't perform a
status update to show the change
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository