From: PatR Date: Tue, 17 May 2022 23:52:06 +0000 (-0700) Subject: restoring in Gehennom X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cab613a3a9786400f6d4a0d015bb86e9e88cc3c0;p=nethack restoring in Gehennom 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. --- diff --git a/include/extern.h b/include/extern.h index 2481e762a..c164eca53 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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); diff --git a/src/allmain.c b/src/allmain.c index e59c372b8..71a892f23 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -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 diff --git a/src/do.c b/src/do.c index 104e1a75e..0ee6db20d 100644 --- 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) diff --git a/src/invent.c b/src/invent.c index e2a5b90f2..1101be42d 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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;