]> granicus.if.org Git - nethack/commitdiff
vomiting while fainting
authorPatR <rankin@nethack.org>
Tue, 14 Nov 2017 23:31:26 +0000 (15:31 -0800)
committerPatR <rankin@nethack.org>
Tue, 14 Nov 2017 23:31:26 +0000 (15:31 -0800)
From a beta-tester running 3.6.0:
|You faint from lack of food.
|You suddenly vomit!

The latter has already been changed to "You vomit" (it's given at the
end of a multiple-message vomiting countdown so wasn't "sudden") but is
still odd if your stomach is so empty that you're subject to fainting.
Give an alternate message in that case:
|Your stomach heaves convulsively!

Vomiting while unconscious (when that's due to something other than
fainting from hunger) should pose a risk of choking to death, but I'm
going to pretend that this hasn't occurred to me....

doc/fixes36.1
src/eat.c
src/timeout.c

index d78178c4207a19ecb3487a5ef90da97b4cb6c05c..af1de2a6c516e655d3d7560abaa9222a04e29433 100644 (file)
@@ -437,6 +437,7 @@ fix buffer overflow in wizard mode for '#' command when 'extmenu' option is on
 "you suddenly vomit" was given two turns before actually vomiting, so you
        could get that message, move a bit, then get "you can move again"
        after the 2 turn freeze applied along with the actual vomit
+give an alternate message if you vomit when stomach is empty (ie, fainting)
 corpses and other flammable items not subject to direct burning or fire-based
        erosion which were thrown or dropped into lava remained intact
 if a potion on the floor survived a land mine explosion and got propelled at
@@ -557,6 +558,7 @@ tty: if "--More--" was written to leftmost column (beginning of second line)
 tty: long message lines which wrap when shown on the top line might be
        re-displayed incorrectly by ^P for msg_window={full,combo,reverse}
 tty: MSGTYPE=hide could interfere with display of prompts
+tty: treat carriage return as a newline for input text and --More-- prompts
 unix/X11: in top level Makefile, some commented out definitions of VARDATND
        misspelled pilemark.xbm (as pilemark.xpm)
 unix: options file with CR+LF line ends and an invalid option line resulted in
@@ -597,7 +599,6 @@ PANICTRACE: PANICTRACE_GDB used wrong value for ARGV0 when launching gdb if
 win32gui: gather raw_print error messages into a single dialog window
 win32tty: fix display errors when using a font with double wide or ambiguous
        width characters
-tty: treat carriage return as a newline for input text and more-prompts
 
 
 General New Features
index ae690a1b2e2f89bd6a890192c3859b818dbdf440..dc33cca8a12eb97ab9d95907b5bf712665708548 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -3154,12 +3154,18 @@ skipfloor:
 void
 vomit() /* A good idea from David Neves */
 {
-    if (cantvomit(youmonst.data))
+    if (cantvomit(youmonst.data)) {
         /* doesn't cure food poisoning; message assumes that we aren't
            dealing with some esoteric body_part() */
         Your("jaw gapes convulsively.");
-    else
+    } else {
         make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE);
+        /* if not enough in stomach to actually vomit then dry heave;
+           vomiting_dialog() gives a vomit message when its countdown
+           reaches 0, but only if u.uhs < FAINTING (and !cantvomit()) */
+        if (u.uhs >= FAINTING)
+            Your("%s heaves convulsively!", body_part(STOMACH));
+    }
 
     /* nomul()/You_can_move_again used to be unconditional, which was
        viable while eating but not for Vomiting countdown where hero might
index a85baf552db80a1101ce37a4b2e7dbaca5bde1ae..b8535bbd58c8cc604723a6ee3e22513e7e11c0bb 100644 (file)
@@ -204,8 +204,10 @@ vomiting_dialogue()
                that message and "You can move again." (from vomit()'s
                nomul(-2)) with no intervening message; give one here to
                have more specific point at which hero became unable to move
-               [vomit() issues its own message for the cantvomit() case] */
-            You("%s!", !Hallucination ? "vomit" : "hurl chunks");
+               [vomit() issues its own message for the cantvomit() case
+               and for the FAINTING-or-worse case where stomach is empty] */
+            if (u.uhs < FAINTING)
+                You("%s!", !Hallucination ? "vomit" : "hurl chunks");
         }
         vomit();
         break;