attribute check timer (trunk only)
Move the counter for the next attribute check to the context structure. This increments patchlevel so previous save and bones files are unuseable after applying.
This commit is contained in:
@@ -489,6 +489,7 @@ newgame()
|
||||
context.ident = 1;
|
||||
context.stethoscope_move = -1L;
|
||||
context.warnlevel = 1;
|
||||
context.next_attrib_check = 600L; /* arbitrary first setting */
|
||||
|
||||
for (i = 0; i < NUMMONS; i++)
|
||||
mvitals[i].mvflags = mons[i].geno & G_NOCORPSE;
|
||||
|
||||
17
src/attrib.c
17
src/attrib.c
@@ -95,7 +95,6 @@ const struct innate {
|
||||
orc_abil[] = { { 1, &(HPoison_resistance), "", "" },
|
||||
{ 0, 0, 0, 0 } };
|
||||
|
||||
static long next_check = 600L; /* arbitrary first setting */
|
||||
STATIC_DCL void NDECL(exerper);
|
||||
STATIC_DCL void FDECL(postadjabil, (long *));
|
||||
|
||||
@@ -449,11 +448,11 @@ exerchk()
|
||||
exerper();
|
||||
|
||||
#ifdef DEBUG
|
||||
if(moves >= next_check)
|
||||
if(moves >= context.next_attrib_check)
|
||||
pline("exerchk: ready to test. multi = %d.", multi);
|
||||
#endif
|
||||
/* Are we ready for a test? */
|
||||
if(moves >= next_check && !multi) {
|
||||
if(moves >= context.next_attrib_check && !multi) {
|
||||
#ifdef DEBUG
|
||||
pline("exerchk: testing.");
|
||||
#endif
|
||||
@@ -515,21 +514,13 @@ exerchk()
|
||||
}
|
||||
}
|
||||
}
|
||||
next_check += rn1(200,800);
|
||||
context.next_attrib_check += rn1(200,800);
|
||||
#ifdef DEBUG
|
||||
pline("exerchk: next check at %ld.", next_check);
|
||||
pline("exerchk: next check at %ld.", context.next_attrib_check);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* next_check will otherwise have its initial 600L after a game restore */
|
||||
void
|
||||
reset_attribute_clock()
|
||||
{
|
||||
if (moves > 600L) next_check = moves + rn1(50,800);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
init_attr(np)
|
||||
register int np;
|
||||
|
||||
@@ -678,7 +678,6 @@ register int fd;
|
||||
inven_inuse(FALSE);
|
||||
|
||||
load_qtlist(); /* re-load the quest text info */
|
||||
reset_attribute_clock();
|
||||
/* Set up the vision internals, after levl[] data is loaded */
|
||||
/* but before docrt(). */
|
||||
vision_reset();
|
||||
|
||||
Reference in New Issue
Block a user