tribute enhancement

When reading a novel, select a random passage which hasn't been shown
already.  Once you've run through all the passages, it resets to get
them all again (with new random order that might happen to the be same
order if there aren't many passages).  Switching to a different novel--
even another copy of the same one--will cause the previous passage
selection to be discarded and restarted from scratch if the prior book
is read again.  Passage tracking for the most recently read novel is
kept across save and restore.  (That means I needed to bump EDITLEVEL,
so it will need to be reset to 0 again before release.)
This commit is contained in:
PatR
2015-11-15 21:57:15 -08:00
parent 334cfd8a97
commit c40982eb23
5 changed files with 72 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 context.h $NHDT-Date: 1445215010 2015/10/19 00:36:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */
/* NetHack 3.6 context.h $NHDT-Date: 1447653421 2015/11/16 05:57:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -90,6 +90,12 @@ struct tribute_info {
/* 30 free bits */
};
struct novel_tracking { /* for choosing random passage when reading novel */
unsigned id; /* novel oid from previous passage selection */
int count; /* number of passage indices available in pasg[] */
xchar pasg[30]; /* pasg[0..count] are passage indices */
};
struct context_info {
unsigned ident; /* social security number for each monster */
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
@@ -124,6 +130,7 @@ struct context_info {
struct polearm_info polearm;
struct obj_split objsplit; /* track most recently split object stack */
struct tribute_info tribute;
struct novel_tracking novel;
};
extern NEARDATA struct context_info context;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1447475941 2015/11/14 04:39:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.516 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1447653422 2015/11/16 05:57:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.517 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -766,7 +766,8 @@ E void NDECL(really_close);
#ifdef DEBUG
E boolean FDECL(debugcore, (const char *, BOOLEAN_P));
#endif
E boolean FDECL(read_tribute, (const char *, const char *, int, char *, int));
E boolean FDECL(read_tribute, (const char *, const char *, int,
char *, int, unsigned));
E boolean FDECL(Death_quote, (char *, int));
/* ### fountain.c ### */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447311411 2015/11/12 06:56:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.110 $ */
/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447653420 2015/11/16 05:57:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.111 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -13,7 +13,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 0
#define EDITLEVEL 2
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2015"
#define COPYRIGHT_BANNER_B \