]> granicus.if.org Git - nethack/commitdiff
Interrupt a multi turn action if hp or pw is restored to maximum
authorPasi Kallinen <paxed@alt.org>
Thu, 19 May 2016 19:01:41 +0000 (22:01 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 19 May 2016 19:04:10 +0000 (22:04 +0300)
via UnNetHack by Patric Mueller

doc/fixes36.1
src/allmain.c

index 5759146aa83da757f8b00e5a078deba091d505fa..ed84570dbff9abaf174b66e77ffd75dbf251d327 100644 (file)
@@ -377,6 +377,7 @@ during end of game disclosure, the vanquished monsters list can be sorted in
        one of several ways by answering 'a' to "disclose vanquished monsters?"
 when #terrain is displaying a censored version of the map (no monsters, &c),
        moving the cursor will display farlook's brief autodescribe feedback
+interrupt a multi turn action if hp or pw is restored to maximum
 
 
 Platform- and/or Interface-Specific New Features
index 7d7ff03c6e1b9bc5846f8f7b3c208d41e3a6d37f..33afd9927b88e1023fe7b69bc26ba957cb122eb8 100644 (file)
@@ -13,6 +13,7 @@
 #ifdef POSITIONBAR
 STATIC_DCL void NDECL(do_positionbar);
 #endif
+STATIC_DCL void FDECL(interrupt_multi, (const char *));
 
 void
 moveloop(resuming)
@@ -216,6 +217,8 @@ boolean resuming;
                                  || (wtcap < MOD_ENCUMBER && !(moves % 20))) {
                             context.botl = 1;
                             u.mh++;
+                            if (u.mh >= u.mhmax)
+                                interrupt_multi("You are in full health.");
                         }
                     } else if (u.uhp < u.uhpmax
                                && (wtcap < MOD_ENCUMBER || !u.umoved
@@ -234,6 +237,8 @@ boolean resuming;
                             u.uhp += heal;
                             if (u.uhp > u.uhpmax)
                                 u.uhp = u.uhpmax;
+                            if (u.uhp >= u.uhpmax)
+                                interrupt_multi("You are in full health.");
                         } else if (Regeneration
                                    || (u.ulevel <= 9
                                        && !(moves
@@ -241,6 +246,8 @@ boolean resuming;
                                                + 1)))) {
                             context.botl = 1;
                             u.uhp++;
+                            if (u.uhp >= u.uhpmax)
+                                interrupt_multi("You are in full health.");
                         }
                     }
 
@@ -270,6 +277,8 @@ boolean resuming;
                         if (u.uen > u.uenmax)
                             u.uen = u.uenmax;
                         context.botl = 1;
+                        if (u.uen >= u.uenmax)
+                            interrupt_multi("You feel full of energy.");
                     }
 
                     if (!u.uinvulnerable) {
@@ -690,4 +699,16 @@ do_positionbar()
 }
 #endif
 
+STATIC_DCL void
+interrupt_multi(msg)
+const char *msg;
+{
+    if (multi > 0 && !context.travel) {
+        nomul(0);
+        if (flags.verbose && msg)
+            Norep("%s", msg);
+    }
+}
+
+
 /*allmain.c*/