trunk only: preserving context (src files)

Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
This commit is contained in:
nethack.allison
2003-09-21 11:52:54 +00:00
parent 74b834c774
commit 22ce5ed6f2
58 changed files with 571 additions and 567 deletions

View File

@@ -72,8 +72,8 @@ struct obj *obj;
potion_descr = OBJ_DESCR(objects[obj->otyp]);
if (potion_descr && !strcmp(potion_descr, "milky")) {
if ( flags.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.ghost_count))) {
if ( context.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.ghost_count))) {
if (!enexto(&cc, mon->mx, mon->my, &mons[PM_GHOST])) return 0;
mquaffmsg(mon, obj);
m_useup(mon, obj);
@@ -95,8 +95,8 @@ struct obj *obj;
}
}
if (potion_descr && !strcmp(potion_descr, "smoky") &&
flags.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.djinni_count))) {
context.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.djinni_count))) {
if (!enexto(&cc, mon->mx, mon->my, &mons[PM_DJINNI])) return 0;
mquaffmsg(mon, obj);
m_useup(mon, obj);