trunk only: preserving context (include 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:46:53 +00:00
parent c3960b1d49
commit 74b834c774
5 changed files with 7 additions and 32 deletions

View File

@@ -198,14 +198,6 @@ E NEARDATA schar tbx, tby; /* set in mthrowu.c */
E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
E NEARDATA struct dig_info { /* apply.c, hack.c */
int effort;
d_level level;
coord pos;
long lastdigtime;
boolean down, chew, warned, quiet;
} digging;
E NEARDATA long moves, monstermoves;
E NEARDATA long wailmsg;

View File

@@ -42,7 +42,7 @@
#define mon_warning(mon) (Warning && !(mon)->mpeaceful && \
(distu((mon)->mx, (mon)->my) < 100) && \
(((int) ((mon)->m_lev / 4)) >= flags.warnlevel))
(((int) ((mon)->m_lev / 4)) >= context.warnlevel))
/*
* mon_visible()

View File

@@ -28,8 +28,6 @@ struct flag {
#ifdef MAIL
boolean biff; /* enable checking for mail */
#endif
boolean botl; /* partially redo status line */
boolean botlx; /* print an entirely new bottom line */
boolean confirm; /* confirm before hitting tame monsters */
boolean debug; /* in debugging mode */
#define wizard flags.debug
@@ -40,8 +38,7 @@ struct flag {
#endif
#define discover flags.explore
boolean female;
boolean forcefight;
boolean friday13; /* it's Friday the 13th */
boolean friday13; /* it's Friday the 13th */
boolean help; /* look in data file for info about stuff */
boolean ignintr; /* ignore interrupts */
#ifdef INSURANCE
@@ -50,13 +47,7 @@ struct flag {
boolean invlet_constant; /* let objects keep their inventory symbol */
boolean legacy; /* print game entry "story" */
boolean lit_corridor; /* show a dark corr as lit if it is in sight */
boolean made_amulet;
boolean mon_moving; /* monsters' turn to move */
boolean move;
boolean mv;
boolean bypasses; /* bypass flag is set on at least one fobj */
boolean nap; /* `timed_delay' option for display effects */
boolean nopick; /* do not pickup objects (as when running) */
boolean null; /* OK to send nulls to the terminal */
#ifdef MAC
boolean page_wait; /* put up a --More-- after a page of messages */
@@ -84,19 +75,10 @@ struct flag {
boolean verbose; /* max battle info */
boolean prayconfirm; /* confirm before praying */
int end_top, end_around; /* describe desired score list */
unsigned ident; /* social security number for each monster */
unsigned moonphase;
unsigned long suppress_alert;
#define NEW_MOON 0
#define FULL_MOON 4
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
boolean travel; /* find way automatically to u.tx,u.ty */
unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */
/* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
/* 8: travel */
unsigned long warntype; /* warn_of_mon monster type M2 */
int warnlevel;
int djinni_count, ghost_count; /* potion effect tuning */
int pickup_burden; /* maximum burden before prompt */
char inv_order[MAXOCLASSES];
char pickup_types[MAXOCLASSES];

View File

@@ -88,6 +88,7 @@
#include "objclass.h"
#include "youprop.h"
#include "wintype.h"
#include "context.h"
#include "decl.h"
#include "timeout.h"
@@ -100,8 +101,8 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define FLASHED_LIGHT 3
#define INVIS_BEAM 4
#define MATCH_WARN_OF_MON(mon) (Warn_of_mon && flags.warntype && \
(flags.warntype & (mon)->data->mflags2))
#define MATCH_WARN_OF_MON(mon) (Warn_of_mon && context.warntype && \
(context.warntype & (mon)->data->mflags2))
#include "trap.h"
#include "flag.h"

View File

@@ -13,7 +13,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 1
#define EDITLEVEL 2
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2003"
@@ -34,7 +34,7 @@
* PP = patch level, ee = edit level, L = literal suffix "L",
* with all four numbers specified as two hexadecimal digits.
*/
#define VERSION_COMPATIBILITY 0x03040100L
#define VERSION_COMPATIBILITY 0x03040200L
#endif
/*****************************************************************************/