]> granicus.if.org Git - nethack/commitdiff
Clean up lava messages a little.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 Feb 2015 04:24:41 +0000 (23:24 -0500)
committerPasi Kallinen <paxed@alt.org>
Tue, 17 Mar 2015 16:44:57 +0000 (18:44 +0200)
This change has two parts.

First, the Book of the Dead now has a special message in lava. This was
originally added by Steve Melenchuk (aka Grunt) as a precaution against the Book
burning up. While I'm pretty sure that the Book can't burn up in the current
codepath, the message is a nice touch and it doesn't help to add a safety check.

Second, always print the inventory destruction messages. The reason for this is
fairly subtle, but relates to the timing. By not printing the messages when
dying, the visible effect to the player is that if they have lifesaving, the
items burn up before they die, but if they do not, they burn up after they
die---the fact that they do burn up is visible in the dump or bonesfile.

src/trap.c

index 184f043043e7608040a40b26a6c8530f66e3490b..e33b57730baf5687f04ac9b7c592266a35b00e53 100644 (file)
@@ -4730,11 +4730,6 @@ lava_effects()
         } else
            You("fall into the lava!");
 
-       usurvive = Lifesaved || discover;
-#ifdef WIZARD
-       if (wizard) usurvive = TRUE;
-#endif
-
        /* prevent remove_worn_item() -> Boots_off(WATER_WALKING_BOOTS) ->
           spoteffects() -> lava_effects() recursion which would
           successfully delete (via useupall) the no-longer-worn boots;
@@ -4745,15 +4740,17 @@ lava_effects()
        for(obj = invent; obj; obj = obj2) {
            obj2 = obj->nobj;
            /* above, we set in_use for objects which are to be destroyed */
-           if (obj->in_use) {
+            if (obj->otyp == SPE_BOOK_OF_THE_DEAD && !Blind) {
+                pline("%s glows a strange %s, but remains intact.",
+                      The(xname(obj)), hcolor("dark red"));
+            } else if (obj->in_use) {
                if (obj->owornmask) {
-                   if (usurvive)
-                       pline("%s into flame!", Yobjnam2(obj, "burst"));
+                   pline("%s into flame!", Yobjnam2(obj, "burst"));
                    remove_worn_item(obj, TRUE);
                }
                useupall(obj);
            }
-       }
+        }
 
        iflags.in_lava_effects--;