]> granicus.if.org Git - nethack/commitdiff
throttle excessive HP and En gains
authorPatR <rankin@nethack.org>
Mon, 24 Jan 2022 01:18:05 +0000 (17:18 -0800)
committerPatR <rankin@nethack.org>
Mon, 24 Jan 2022 01:18:05 +0000 (17:18 -0800)
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.

doc/fixes37.0
src/attrib.c
src/exper.c

index 5b5656fd17c4dc013145e300c924721b5fcfa6ea..b3c97c6d92b4c631a53a475ef04258043e398fb7 100644 (file)
@@ -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
index 7d74cc21a67725349c8d519522c2a6a0a42c39b6..bb326ac52918c55e15a32b1cf4fc5c5dd79deb1e 100644 (file)
@@ -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;
 }
 
index 6936369fd509bac6055d94c87618901249ad8fb7..5108ecaa8de62701d5cdf99c6f1e6331d4971e63 100644 (file)
@@ -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;
 }