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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
15
src/zap.c
15
src/zap.c
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user