]> granicus.if.org Git - nethack/commitdiff
restoring in Gehennom
authorPatR <rankin@nethack.org>
Tue, 17 May 2022 23:52:06 +0000 (16:52 -0700)
committerPatR <rankin@nethack.org>
Tue, 17 May 2022 23:52:06 +0000 (16:52 -0700)
When a game is restored while hero is Gehennom, give the "It is hot
here.  You smell smoke..." message after the welcome back message.

For both entering Gehennom and restoring there, switch from "smell" to
"sense" in the second part of that message if poly'd into a form that
doesn't have sense of smell.

Some unrelated stuff that got caught up in this diff:
1) move welcome()'s call to l_nhcore_call() to the start of the routine
   instead of placing that after a potential early return;
2) remove a redundant glyphmap flags reset line; the routine being
   called starts by setting its flags field to 0 for level change so
   caller doesn't need to do that;
3) look_here() is just a formatting bit.

include/extern.h
src/allmain.c
src/do.c
src/invent.c

index 2481e762aba78617a2d0b0d6f8e604c91bc0f251..c164eca53c52338620a7a61d83cb8011b134ffae 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 extern.h        $NHDT-Date: 1652391728 2022/05/12 21:42:08 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1115 $ */
+/* NetHack 3.7 extern.h        $NHDT-Date: 1652831518 2022/05/17 23:51:58 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1117 $ */
 /* Copyright (c) Steve Creps, 1988.                              */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -464,6 +464,7 @@ extern void save_currentstate(void);
 #endif
 extern void u_collide_m(struct monst *);
 extern void goto_level(d_level *, boolean, boolean, boolean);
+extern void hellish_smoke_mesg(void);
 extern void maybe_lvltport_feedback(void);
 extern void schedule_goto(d_level *, int, const char *, const char *);
 extern void deferred_goto(void);
index e59c372b87af0542c3d1674ae05367af72d513ff..71a892f23f78b7f40c2b1e5b49dc5597fc207038 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 allmain.c       $NHDT-Date: 1646136934 2022/03/01 12:15:34 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.178 $ */
+/* NetHack 3.7 allmain.c       $NHDT-Date: 1652831519 2022/05/17 23:51:59 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.185 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -727,6 +727,8 @@ welcome(boolean new_game) /* false => restoring an old game */
     char buf[BUFSZ];
     boolean currentgend = Upolyd ? u.mfemale : flags.female;
 
+    l_nhcore_call(new_game ? NHCORE_START_NEW_GAME : NHCORE_RESTORE_OLD_GAME);
+
     /* skip "welcome back" if restoring a doomed character */
     if (!new_game && Upolyd && ugenocided()) {
         /* death via self-genocide is pending */
@@ -760,10 +762,15 @@ welcome(boolean new_game) /* false => restoring an old game */
                    : "%s %s, the%s, welcome back to NetHack!",
           Hello((struct monst *) 0), g.plname, buf);
 
-    l_nhcore_call(new_game ? NHCORE_START_NEW_GAME : NHCORE_RESTORE_OLD_GAME);
-    if (new_game) /* guarantee that 'major' event category is never empty */
+    if (new_game) {
+        /* guarantee that 'major' event category is never empty */
         livelog_printf(LL_ACHIEVE, "%s the%s entered the dungeon",
                        g.plname, buf);
+    } else {
+        /* if restroing in Gehennom, give same hot/smoky message as when
+           first entering it */
+        hellish_smoke_mesg();
+    }
 }
 
 #ifdef POSITIONBAR
index 104e1a75e7d85759e562ba5fdc88c5830b77eb86..0ee6db20d840685cf4bdb1510777a7f690922787 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 do.c    $NHDT-Date: 1646171623 2022/03/01 21:53:43 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.296 $ */
+/* NetHack 3.7 do.c    $NHDT-Date: 1652831519 2022/05/17 23:51:59 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.304 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1626,7 +1626,6 @@ goto_level(
 
     /* Reset the screen. */
     vision_reset(); /* reset the blockages */
-    g.glyphmap_perlevel_flags = 0L; /* force per-level map_glyphinfo() changes */
     reset_glyphmap(gm_levelchange);
     docrt(); /* does a full vision recalc */
     flush_screen(-1);
@@ -1658,7 +1657,7 @@ goto_level(
 #endif
             You_hear("groans and moans everywhere.");
         } else
-            pline("It is hot here.  You smell smoke...");
+            hellish_smoke_mesg(); /* "It is hot here.  You smell smoke..." */
 
         record_achievement(ACH_HELL); /* reached Gehennom */
     }
@@ -1799,6 +1798,16 @@ goto_level(
 
 RESTORE_WARNING_FORMAT_NONLITERAL
 
+/* give a message when entering a Gehennom level other than the Valley;
+   also given if restoring a game in that situation */
+void
+hellish_smoke_mesg()
+{
+    if (Inhell && !Is_valley(&u.uz))
+        pline("It is hot here.  You %s smoke...",
+              olfaction(g.youmonst.data) ? "smell" : "sense");
+}
+
 /* usually called from goto_level(); might be called from Sting_effects() */
 void
 maybe_lvltport_feedback(void)
index e2a5b90f2ec2a1adc23b7f19188946d08e69d2d2..1101be42dc5d4a86d2071170e7e65d909f6de3be 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 invent.c        $NHDT-Date: 1651868822 2022/05/06 20:27:02 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.386 $ */
+/* NetHack 3.7 invent.c        $NHDT-Date: 1652831520 2022/05/17 23:52:00 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.388 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -4018,8 +4018,9 @@ dfeature_at(int x, int y, char *buf)
 /* look at what is here; if there are many objects (pile_limit or more),
    don't show them unless obj_cnt is 0 */
 int
-look_here(int obj_cnt, /* obj_cnt > 0 implies that autopickup is in progress */
-          unsigned lookhere_flags)
+look_here(
+    int obj_cnt, /* obj_cnt > 0 implies that autopickup is in progress */
+    unsigned lookhere_flags)
 {
     struct obj *otmp;
     struct trap *trap;