From: PatR Date: Mon, 24 Jan 2022 01:18:05 +0000 (-0800) Subject: throttle excessive HP and En gains X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d67f56eabf0e249d0e2aefd8e66d76a7813a9f4;p=nethack throttle excessive HP and En gains The priest/cleric quest provides unlimited wraiths and a player (not a robot with limitless patience) posting on reddit gave up building up his character by killing them and eating the corpses after accumulating 40K HP and 20K En. (Or something close to that; I can't get back to the post right now.) His character might have been capable of surviving decapitation or bisection. Make it very much harder to get to 5 digits of HP or En via level gains after reaching level 30. If maxhp < 300, new gains will be capped at 5 extra HP; 300..599, cap is 4; 600..899, cap is 3; 900..1199, cap is 2; and once 1200 is reached, further level gains will only add 1 HP. For maxen < 200, extra En is capped at 4; 200..399, cap is 3; 400..599, cap is 2; and once 600 is reached, further gains only add 1 En. Note: this only kicks in when gaining levels while already at level 30. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 5b5656fd1..b3c97c6d9 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -757,6 +757,8 @@ for hero with slippery fingers, enlightenment reports "slippery fingers" or when hitting with wet towel causes it to lose some wetness, defer "your towel dries" until after the hit message do some extra damage when hitting an iron golem with a wet towel +when already at level 30 and gaining another level--which doesn't increase + level further but does add more HP and Pw--throttle the increases Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/attrib.c b/src/attrib.c index 7d74cc21a..bb326ac52 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1023,8 +1023,18 @@ newhp(void) } if (hp <= 0) hp = 1; - if (u.ulevel < MAXULEV) + if (u.ulevel < MAXULEV) { + /* remember increment; future level drain could take it away again */ u.uhpinc[u.ulevel] = (xchar) hp; + } else { + /* after level 30, throttle hit point gains from extra experience; + once max reaches 1200, further increments will be just 1 more */ + char lim = 5 - u.uhpmax / 300; + + lim = max(lim, 1); + if (hp > lim) + hp = lim; + } return hp; } diff --git a/src/exper.c b/src/exper.c index 6936369fd..5108ecaa8 100644 --- a/src/exper.c +++ b/src/exper.c @@ -65,8 +65,18 @@ newpw(void) } if (en <= 0) en = 1; - if (u.ulevel < MAXULEV) + if (u.ulevel < MAXULEV) { + /* remember increment; future level drain could take it away again */ u.ueninc[u.ulevel] = (xchar) en; + } else { + /* after level 30, throttle energy gains from extra experience; + once max reaches 600, further increments will be just 1 more */ + char lim = 4 - u.uenmax / 200; + + lim = max(lim, 1); + if (en > lim) + en = lim; + } return en; }