-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.806 $ $NHDT-Date: 1645298657 2022/02/19 19:24:17 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.835 $ $NHDT-Date: 1646136928 2022/03/01 12:15:28 $
General Fixes and Modified Features
-----------------------------------
an uninitialized varaible
changes to stair internals resulted in summoned Kops blockcading the stairs up
rather than intended stairs down
+dumplog's list of "major events" showed all logged events, not just major ones
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
-/* NetHack 3.7 extern.h $NHDT-Date: 1644524039 2022/02/10 20:13:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1046 $ */
+/* NetHack 3.7 extern.h $NHDT-Date: 1646136928 2022/03/01 12:15:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1062 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
extern int doextlist(void);
extern int extcmd_via_menu(void);
extern int enter_explore_mode(void);
-extern int do_gamelog(void);
extern boolean bind_key(uchar, const char *);
extern void dokeylist(void);
extern int xytod(schar, schar);
extern int count_achievements(void);
extern schar achieve_rank(int);
extern boolean sokoban_in_play(void);
+extern int do_gamelog(void);
+extern void show_gamelog(int);
extern int dovanquished(void);
extern int doborn(void);
extern void list_vanquished(char, boolean);
-/* NetHack 3.7 global.h $NHDT-Date: 1642630918 2022/01/19 22:21:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.131 $ */
+/* NetHack 3.7 global.h $NHDT-Date: 1646136933 2022/03/01 12:15:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
#define unmeta(c) (0x7f & (c))
/* Game log message type flags */
-#define LL_NONE 0x0000 /* No message is livelogged */
-#define LL_WISH 0x0001 /* Report stuff people type at the wish prompt */
-#define LL_ACHIEVE 0x0002 /* Achievements bitfield + invocation, planes */
-#define LL_UMONST 0x0004 /* Kill, Bribe or otherwise dispatch unique monsters */
-#define LL_DIVINEGIFT 0x0008 /* Sacrifice gifts, crowning */
-#define LL_LIFESAVE 0x0010 /* Use up amulet of lifesaving */
-#define LL_CONDUCT 0x0020 /* Break conduct - not reported early-game */
-#define LL_ARTIFACT 0x0040 /* Excalibur, Sting, Orcrist, plus sac gifts and artwishes */
-#define LL_GENOCIDE 0x0080 /* Logging of genocides */
-#define LL_KILLEDPET 0x0100 /* Killed a tame monster */
-#define LL_ALIGNMENT 0x0200 /* changed alignment temporarily or permanently */
-#define LL_DUMP_ASC 0x0400 /* Log URL for dumplog if ascended */
-#define LL_DUMP_ALL 0x0800 /* Log dumplog url for all games */
-#define LL_MINORAC 0x1000 /* Log 'minor' achievements - can be spammy */
-#define LL_DEBUG 0x8000 /* For debugging messages and other spam */
+#define LL_NONE 0x0000L /* No message is livelogged */
+#define LL_WISH 0x0001L /* Report stuff people type at the wish prompt */
+#define LL_ACHIEVE 0x0002L /* Achievements bitfield + invocation, planes */
+#define LL_UMONST 0x0004L /* defeated unique monster */
+#define LL_DIVINEGIFT 0x0008L /* Sacrifice gifts, crowning */
+#define LL_LIFESAVE 0x0010L /* Use up amulet of lifesaving */
+#define LL_CONDUCT 0x0020L /* Break conduct - not reported early-game */
+#define LL_ARTIFACT 0x0040L /* bestowed, found, or manifactured */
+#define LL_GENOCIDE 0x0080L /* Logging of genocides */
+#define LL_KILLEDPET 0x0100L /* Killed a tame monster */
+#define LL_ALIGNMENT 0x0200L /* changed alignment, temporary or permanent */
+#define LL_DUMP_ASC 0x0400L /* Log URL for dumplog if ascended */
+#define LL_DUMP_ALL 0x0800L /* Log dumplog url for all games */
+#define LL_MINORAC 0x1000L /* Log 'minor' achievements - can be spammy */
+#define LL_SPOILER 0x4000L /* reveals information so don't show in-game
+ * via #chronicle unless in wizard mode */
+#define LL_DEBUG 0x8000L /* For debugging messages and other spam */
#endif /* GLOBAL_H */
-/* NetHack 3.7 allmain.c $NHDT-Date: 1645223894 2022/02/18 22:38:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.177 $ */
+/* NetHack 3.7 allmain.c $NHDT-Date: 1646136934 2022/03/01 12:15:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.178 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
Hello((struct monst *) 0), g.plname, buf);
l_nhcore_call(new_game ? NHCORE_START_NEW_GAME : NHCORE_RESTORE_OLD_GAME);
- if (new_game)
- livelog_printf(LL_MINORAC, "%s the%s entered the dungeon",
+ if (new_game) /* guarantee that 'major' event category is never empty */
+ livelog_printf(LL_ACHIEVE, "%s the%s entered the dungeon",
g.plname, buf);
}
-/* NetHack 3.7 cmd.c $NHDT-Date: 1644610344 2022/02/11 20:12:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.519 $ */
+/* NetHack 3.7 cmd.c $NHDT-Date: 1646136938 2022/03/01 12:15:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.528 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
return ECMD_OK;
}
-int
-do_gamelog(void)
-{
-#ifdef CHRONICLE
- struct gamelog_line *tmp = g.gamelog;
- winid win;
- char buf[BUFSZ];
-
- if (!tmp) {
- pline("No chronicled events.");
- return ECMD_OK;
- }
-
- win = create_nhwindow(NHW_TEXT);
- putstr(win, 0, "Major events:");
- putstr(win, 0, "");
- putstr(win, 0, " Turn");
- while (tmp) {
- Sprintf(buf, "%5li: %s", tmp->turn, tmp->text);
- putstr(win, 0, buf);
- tmp = tmp->next;
- }
- display_nhwindow(win, TRUE);
- destroy_nhwindow(win);
-#else
- pline("Chronicle was turned off during compile-time.");
-#endif /* !CHRONICLE */
- return ECMD_OK;
-}
-
/* #wizwish command - wish for something */
static int
wiz_wish(void) /* Unlimited wishes for debug mode by Paul Polderman */
-/* NetHack 3.7 do.c $NHDT-Date: 1646084773 2022/02/28 21:46:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.294 $ */
+/* NetHack 3.7 do.c $NHDT-Date: 1646136939 2022/03/01 12:15:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.295 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest")
&& !(u.uevent.qcompleted || u.uevent.qexpelled
|| g.quest_status.leader_is_dead)) {
- /* [TODO: copy of same TODO below; if an anchievement for
+ /* [TODO: copy of same TODO below; if an achievement for
receiving quest call from leader gets added, that should
come after logging new level entry] */
if (!u.uevent.qcalled) {
/* this was originally done earlier; moved here to be logged after
any achievement related to entering a dungeon branch
- [TODO: if an anchievement for receiving quest call from leader
+ [TODO: if an achievement for receiving quest call from leader
gets added, that should come after this rather than take place
where the message is delivered above] */
if (new)
-/* NetHack 3.7 end.c $NHDT-Date: 1646084789 2022/02/28 21:46:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.238 $ */
+/* NetHack 3.7 end.c $NHDT-Date: 1646136940 2022/03/01 12:15:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.239 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
dump_plines();
putstr(0, 0, "");
- (void) do_gamelog();
+ show_gamelog((how >= PANICKED) ? ENL_GAMEOVERALIVE : ENL_GAMEOVERDEAD);
putstr(0, 0, "");
putstr(0, 0, "Inventory:");
(void) display_inventory((char *) 0, TRUE);
/* it would be better to do this after killer.name fixups but
that comes too late; end-of-game is classified as a "major
- achievement" even if it happens to be ending in failure */
+ achievement" even if game happens to be ending in failure */
formatkiller(pbuf, (unsigned) sizeof pbuf, how, TRUE);
if (!*pbuf)
Strcpy(pbuf, deaths[how]);
-/* NetHack 3.7 insight.c $NHDT-Date: 1646084789 2022/02/28 21:46:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.52 $ */
+/* NetHack 3.7 insight.c $NHDT-Date: 1646136941 2022/03/01 12:15:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.53 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{ LL_ACHIEVE, "entered the Planes" },
{ LL_ACHIEVE, "entered the Astral Plane" },
{ LL_ACHIEVE, "ascended" },
- { LL_ACHIEVE, "acquired the Mines' End luckstone" },
- { LL_ACHIEVE, "completed Sokoban" },
+ { LL_ACHIEVE | LL_SPOILER, "acquired the Mines' End luckstone" },
+ { LL_ACHIEVE, "completed Sokoban" }, /* actually, acquired the prize item
+ * which doesn't necessarily mean all
+ * four levels have been solved */
{ LL_ACHIEVE | LL_UMONST, "killed Medusa" },
/* these two are not logged */
{ 0, "hero was always blond, no, blind" },
{ LL_ACHIEVE, "" }, /* Xp 22 */
{ LL_ACHIEVE, "" }, /* Xp 26 */
{ LL_ACHIEVE, "" }, /* Xp 30 */
- { LL_MINORAC, "learned castle drawbridge's tune" },
+ { LL_MINORAC, "learned castle drawbridge's tune" }, /* achievement #31 */
{ 0, "" } /* keep this one at the end */
};
-
+/* macros to simplify output of enlightenment messages; also used by
+ conduct and achievements */
#define enl_msg(prefix, present, past, suffix, ps) \
enlght_line(prefix, final ? past : present, suffix, ps)
#define you_are(attr, ps) enl_msg(You_, are, were, attr, ps)
return FALSE;
}
+#define majorevent(llmsg) (((llmsg)->flags & LL_ACHIEVE) != 0)
+#define spoilerevent(llmsg) (((llmsg)->flags & LL_SPOILER) != 0)
+
+/* #chronicle command */
+int
+do_gamelog(void)
+{
+#ifdef CHRONICLE
+ if (g.gamelog) {
+ show_gamelog(0);
+ } else {
+ pline("No chronicled events.");
+ }
+#else
+ pline("Chronicle was turned off during compile-time.");
+#endif /* !CHRONICLE */
+ return ECMD_OK;
+}
+
+/* #chronicle details */
+void
+show_gamelog(int final)
+{
+#ifdef CHRONICLE
+ struct gamelog_line *llmsg;
+ winid win;
+ char buf[BUFSZ];
+ int eventcnt = 0;
+
+ win = create_nhwindow(NHW_TEXT);
+ Sprintf(buf, "%s events:", final ? "Major" : "Logged");
+ putstr(win, 0, buf);
+ for (llmsg = g.gamelog; llmsg; llmsg = llmsg->next) {
+ if (final && !majorevent(llmsg))
+ continue;
+ if (!final && !wizard && spoilerevent(llmsg))
+ continue;
+ if (!eventcnt++)
+ putstr(win, 0, " Turn");
+ Sprintf(buf, "%5ld: %s", llmsg->turn, llmsg->text);
+ putstr(win, 0, buf);
+ }
+ /* since start of game is logged as a major event, 'eventcnt' should
+ never end up as 0; for 'final', end of game is a major event too */
+ if (!eventcnt)
+ putstr(win, 0, " none");
+
+ display_nhwindow(win, TRUE);
+ destroy_nhwindow(win);
+#else
+ nhUse(final);
+#endif /* !CHRONICLE */
+ return;
+}
+
/*
* Vanquished monsters.
*/