'moves' is actually turns and there hasn't been any straightforward
way to track actual hero moves.  Add hero_seq for that.  It isn't a
counter but is distinct each time the hero makes a move.  I wanted
it for curses ^P support but so far use it for checking stethoscope
usage and for shopkeeper behavior when items in a shop are broken by
the hero.

Increment EDITLEVEL due to change in save file contents.
This commit is contained in:
PatR
2021-12-26 00:16:55 -08:00
parent c4724fd271
commit 5fbe1de2a7
8 changed files with 41 additions and 33 deletions

View File

@@ -135,8 +135,8 @@ struct context_info {
int warnlevel; /* threshold (digit) to warn about unseen mons */
long next_attrib_check; /* next attribute check */
long seer_turn; /* when random clairvoyance will next kick in */
long stethoscope_move; /* when a stethoscope was last used */
short stethoscope_movement; /* to track multiple moves on same turn */
long stethoscope_seq; /* when a stethoscope was last used; first use
* during a move takes no time, second uses move */
boolean travel; /* find way automatically to u.tx,u.ty */
boolean travel1; /* first travel step */
boolean forcefight;

View File

@@ -822,6 +822,8 @@ struct instance_globals {
struct mkroom *subrooms;
dlevel_t level; /* level map */
long moves; /* turn counter */
long hero_seq; /* 'moves*8 + n' where n is updated each hero move during
* the current turn */
long wailmsg;
struct obj *migrating_objs; /* objects moving to another dungeon level */
struct obj *billobjs; /* objects not yet paid for */

View File

@@ -132,7 +132,9 @@ struct eshk {
d_level shoplevel; /* level (& dungeon) of his shop */
int billct; /* no. of entries of bill[] in use */
struct bill_x bill[BILLSZ];
struct bill_x *bill_p;
struct bill_x *bill_p; /* &(ESHK(shkp)->bill[0]) */
long break_seq; /* hero_seq value at time of object breakage */
boolean seq_peaceful; /* shkp->mpeaceful at start of break_seq */
int visitct; /* nr of visits by most recent customer */
char customer[PL_NSIZ]; /* most recent customer */
char shknam[PL_NSIZ];

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 46
#define EDITLEVEL 47
/*
* Development status possibilities.