github issue #688 - end of game livelog event

Requested by k21971 (hardfought admin):  classify the gameover event
as something other than achievement so that live-logging can exclude
it in order to use the xlogfile end-of-game entry instead.

It had been classified as an achievement because that was the only
category being treated as 'major' so written to final dumplog.  Give
is a new classification 'dump' which is distinct from achievement
and intended to explicitly request that an event go into dumplog.
The gameover event is the only one in that category, at least for now.

Add a bunch of other classifications besides achievement and dump to
be treated as 'major' for dumplog.  The new list is
  wish, achieve, umonst (death of unique monster), divinegift,
  lifesave (via amulet, not explore-/wizard-mode decline to die),
  artifact, genocide, dump
and may still need further tuning.  Currently excluded are
  conduct (first violation of any conduct), killedpet, alignment
  (changed, either via helmet or conversion), minorac (minor
  achievement such as level gain or entering the mines), and spoiler
  (currently only applies to finding Mines' End luckstone which is
  also 'achieve' so will be in dumplog).

This doesn't remove the reference to unimplemented LLC_TURNS that is
mentioned in the template sysconf.

Closes #688
This commit is contained in:
PatR
2022-03-03 07:47:56 -08:00
parent 0326b77a18
commit 93928640c6
5 changed files with 33 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 global.h $NHDT-Date: 1646136933 2022/03/01 12:15:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
/* NetHack 3.7 global.h $NHDT-Date: 1646322467 2022/03/03 15:47:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.135 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -478,8 +478,9 @@ extern struct nomakedefs_s nomakedefs;
#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
#define LL_SPOILER 0x2000L /* reveals information so don't show in-game
* via #chronicle unless in wizard mode */
#define LL_DUMP 0x4000L /* none of the above but should be in dumplog */
#define LL_DEBUG 0x8000L /* For debugging messages and other spam */
#endif /* GLOBAL_H */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 end.c $NHDT-Date: 1646136940 2022/03/01 12:15:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.239 $ */
/* NetHack 3.7 end.c $NHDT-Date: 1646322468 2022/03/03 15:47:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.240 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1392,12 +1392,12 @@ really_done(int how)
disclose(how, taken);
/* 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 game happens to be ending in failure */
that comes too late; included in final dumplog but might be
excluded by active livelog */
formatkiller(pbuf, (unsigned) sizeof pbuf, how, TRUE);
if (!*pbuf)
Strcpy(pbuf, deaths[how]);
livelog_printf(LL_ACHIEVE, "%s", pbuf);
livelog_printf(LL_DUMP, "%s", pbuf);
dump_everything(how, endtime);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 insight.c $NHDT-Date: 1646171624 2022/03/01 21:53:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.54 $ */
/* NetHack 3.7 insight.c $NHDT-Date: 1646322468 2022/03/03 15:47:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.55 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2363,9 +2363,6 @@ sokoban_in_play(void)
return FALSE;
}
#define majorevent(llmsg) (((llmsg)->flags & LL_ACHIEVE) != 0)
#define spoilerevent(llmsg) (((llmsg)->flags & LL_SPOILER) != 0)
/* #chronicle command */
int
do_gamelog(void)
@@ -2382,6 +2379,19 @@ do_gamelog(void)
return ECMD_OK;
}
/* 'major' events for dumplog; inclusion or exclusion here may need tuning */
#define LL_majors (0L \
| LL_WISH \
| LL_ACHIEVE \
| LL_UMONST \
| LL_DIVINEGIFT \
| LL_LIFESAVE \
| LL_ARTIFACT \
| LL_GENOCIDE \
| LL_DUMP) /* explicitly for dumplog */
#define majorevent(llmsg) (((llmsg)->flags & LL_majors) != 0)
#define spoilerevent(llmsg) (((llmsg)->flags & LL_SPOILER) != 0)
/* #chronicle details */
void
show_gamelog(int final)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 zap.c $NHDT-Date: 1629817679 2021/08/24 15:07:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.372 $ */
/* NetHack 3.7 zap.c $NHDT-Date: 1646322469 2022/03/03 15:47:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.400 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -5551,6 +5551,7 @@ makewish(void)
char promptbuf[BUFSZ];
char bufcpy[BUFSZ];
struct obj *otmp, nothing;
long maybe_LL_arti;
int tries = 0;
int prev_artwish = u.uconduct.wisharti;
@@ -5593,15 +5594,17 @@ makewish(void)
return;
}
maybe_LL_arti = ((prev_artwish < u.uconduct.wisharti) ? LL_ARTIFACT : 0L);
/* KMH, conduct */
if (!u.uconduct.wishes++)
livelog_printf(LL_CONDUCT | LL_WISH | (prev_artwish < u.uconduct.wisharti ? LL_ARTIFACT : 0),
livelog_printf((LL_CONDUCT | LL_WISH | maybe_LL_arti),
"made %s first wish - \"%s\"", uhis(), bufcpy);
else if (!prev_artwish && u.uconduct.wisharti) /* arti conduct handled in readobjnam() above */
livelog_printf(LL_CONDUCT | LL_WISH | LL_ARTIFACT, "made %s first artifact wish - \"%s\"",
uhis(), bufcpy);
else if (!prev_artwish && u.uconduct.wisharti) /* wisharti conduct handled
* in readobjnam() above */
livelog_printf((LL_CONDUCT | LL_WISH | LL_ARTIFACT),
"made %s first artifact wish - \"%s\"", uhis(), bufcpy);
else
livelog_printf(LL_WISH | (prev_artwish < u.uconduct.wisharti ? LL_ARTIFACT : 0),
livelog_printf((LL_WISH | maybe_LL_arti),
"wished for \"%s\"", bufcpy);
if (otmp != &cg.zeroobj) {

View File

@@ -1,4 +1,4 @@
# NetHack 3.7 sysconf $NHDT-Date: 1596498296 2020/08/03 23:44:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.39 $
# NetHack 3.7 sysconf $NHDT-Date: 1646322470 2022/03/03 15:47:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.41 $
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
#
@@ -106,6 +106,8 @@ MAXPLAYERS=10
# 0x0400 - Log URL for dumplog if ascended
# 0x0800 - Log dumplog url for all games
# 0x1000 - Log 'minor' achievements - can be spammy
# 0x2000 - Spoiler event; can include in livelog but hidden from #chronicle
# 0x4000 - Include as 'major' event in dumplog; can be hidden from livelog
# 0x8000 - Livelog debug msgs (currently only 'enter new level')
#LIVELOG=0x1FFF