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

@@ -283,7 +283,7 @@ register struct monst *mtmp;
/* if polymorph or undead turning has killed this monster,
prevent the same attack beam from hitting its corpse */
if (flags.bypasses) bypass_obj(obj);
if (context.bypasses) bypass_obj(obj);
if (mtmp->mnamelth)
obj = oname(obj, NAME(mtmp));
@@ -484,7 +484,7 @@ struct monst *mon;
#ifdef STEED
if (mon == u.usteed) {
if (u.ugallop && flags.mv) {
if (u.ugallop && context.mv) {
/* average movement is 1.50 times normal */
mmove = ((rn2(2) ? 4 : 5) * mmove) / 3;
}
@@ -2075,7 +2075,7 @@ register struct monst *mtmp;
}
/* attacking your own quest leader will anger his or her guardians */
if (!flags.mon_moving && /* should always be the case here */
if (!context.mon_moving && /* should always be the case here */
mtmp->data == &mons[quest_info(MS_LEADER)]) {
struct monst *mon;
struct permonst *q_guardian = &mons[quest_info(MS_GUARDIAN)];
@@ -2103,7 +2103,7 @@ register struct monst *mtmp;
mtmp->meating = 0; /* assume there's no salvagable food left */
setmangry(mtmp);
if(mtmp->m_ap_type) seemimic(mtmp);
else if (flags.forcefight && !flags.mon_moving && mtmp->mundetected) {
else if (context.forcefight && !context.mon_moving && mtmp->mundetected) {
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
}
@@ -2498,7 +2498,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
mon_break_armor(mtmp, polyspot);
if (!(mtmp->misc_worn_check & W_ARMG))
mselftouch(mtmp, "No longer petrify-resistant, ",
!flags.mon_moving);
!context.mon_moving);
m_dowear(mtmp, FALSE);
/* This ought to re-test can_carry() on each item in the inventory