bones tracking (trunk only)

[See cvs log for include/rm.h or doc/window.doc for more complete description.]

Attach hero info, death reason, and date+time to a level that's being saved
as bones.  Read such data back when loading a bones file, then treat it as
part of that level for the rest of the game.  Dying on a loaded bones file
will chain the new hero+death+date to previous one(s) if new bones get saved.

outrip() now takes an extra argument of type time_t, and interface-specific
implementations of this routine need to be updated to handle that.
This commit is contained in:
nethack.rankin
2012-01-23 10:45:31 +00:00
parent b88c51deae
commit 9721470635
15 changed files with 152 additions and 64 deletions

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 rip.c $Date$ $Revision$ */
/* SCCS Id: @(#)rip.c 3.5 2003/01/08 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -86,13 +85,15 @@ char *text;
void
genl_outrip(tmpwin, how)
genl_outrip(tmpwin, how, when)
winid tmpwin;
int how;
time_t when;
{
register char **dp;
register char *dpx;
char buf[BUFSZ];
long year;
register int x;
int line;
@@ -118,20 +119,7 @@ int how;
center(GOLD_LINE, buf);
/* Put together death description */
switch (killer.format) {
default: impossible("bad killer format?");
case KILLED_BY_AN:
Strcpy(buf, killed_by_prefix[how]);
Strcat(buf, an(killer.name));
break;
case KILLED_BY:
Strcpy(buf, killed_by_prefix[how]);
Strcat(buf, killer.name);
break;
case NO_KILLER_PREFIX:
Strcpy(buf, killer.name);
break;
}
formatkiller(buf, sizeof buf, how);
/* Put death type on stone */
for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++) {
@@ -154,7 +142,8 @@ int how;
}
/* Put year on stone */
Sprintf(buf, "%4d", getyear());
year = yyyymmdd(when) / 10000L;
Sprintf(buf, "%4ld", year);
center(YEAR_LINE, buf);
putstr(tmpwin, 0, "");