Chronicle of major events, and livelog

Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
This commit is contained in:
Pasi Kallinen
2022-02-09 22:36:19 +02:00
parent cfcfc3429f
commit 1e90f89203
43 changed files with 624 additions and 53 deletions

View File

@@ -569,7 +569,17 @@ still_chewing(xchar x, xchar y)
}
/* Okay, you've chewed through something */
u.uconduct.food++;
if (!u.uconduct.food++)
livelog_printf(LL_CONDUCT, "ate for the first time, by chewing through %s",
boulder
? "a boulder"
: IS_TREE(lev->typ)
? "a tree"
: IS_ROCK(lev->typ)
? "rock"
: (lev->typ == IRONBARS)
? "iron bars"
: "a door");
u.uhunger += rnd(20);
if (boulder) {
@@ -2071,7 +2081,8 @@ domove_core(void)
killed() so we duplicate some of the latter here */
int tmp, mndx;
u.uconduct.killer++;
if (!u.uconduct.killer++)
livelog_printf(LL_CONDUCT, "killed for the first time");
mndx = monsndx(mtmp->data);
tmp = experience(mtmp, (int) g.mvitals[mndx].died);
more_experienced(tmp, 0);