flag.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)flag.h     3.4     2002/08/22      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 /* If you change the flag structure make sure you increment EDITLEVEL in   */
00006 /* patchlevel.h if needed.  Changing the instance_flags structure does     */
00007 /* not require incrementing EDITLEVEL.                                     */
00008 
00009 #ifndef FLAG_H
00010 #define FLAG_H
00011 
00012 /*
00013  * Persistent flags that are saved and restored with the game.
00014  *
00015  */
00016 
00017 struct flag {
00018 #ifdef AMIFLUSH
00019         boolean  altmeta;       /* use ALT keys as META */
00020         boolean  amiflush;      /* kill typeahead */
00021 #endif
00022 #ifdef  MFLOPPY
00023         boolean  asksavedisk;
00024 #endif
00025         boolean  autodig;       /* MRKR: Automatically dig */
00026         boolean  autoquiver;    /* Automatically fill quiver */
00027         boolean  beginner;
00028 #ifdef MAIL
00029         boolean  biff;          /* enable checking for mail */
00030 #endif
00031         boolean  botl;          /* partially redo status line */
00032         boolean  botlx;         /* print an entirely new bottom line */
00033         boolean  confirm;       /* confirm before hitting tame monsters */
00034         boolean  debug;         /* in debugging mode */
00035 #define wizard   flags.debug
00036         boolean  end_own;       /* list all own scores */
00037         boolean  explore;       /* in exploration mode */
00038         boolean  tutorial;      /* in tutorial mode */
00039 #ifdef OPT_DISPMAP
00040         boolean  fast_map;      /* use optimized, less flexible map display */
00041 #endif
00042 #define discover flags.explore
00043         boolean  female;
00044         boolean  forcefight;
00045         boolean  friday13;      /* it's Friday the 13th */
00046         boolean  help;          /* look in data file for info about stuff */
00047         boolean  hitpointbar;   /* colourful hit point status bar */
00048         boolean  ignintr;       /* ignore interrupts */
00049 #ifdef INSURANCE
00050         boolean  ins_chkpt;     /* checkpoint as appropriate */
00051 #endif
00052         boolean  invlet_constant; /* let objects keep their inventory symbol */
00053         boolean  legacy;        /* print game entry "story" */
00054         boolean  lit_corridor;  /* show a dark corr as lit if it is in sight */
00055         boolean  made_amulet;
00056         boolean  mon_moving;    /* monsters' turn to move */
00057         boolean  move;
00058         boolean  mv;
00059         boolean  bypasses;      /* bypass flag is set on at least one fobj */
00060         boolean  nap;           /* `timed_delay' option for display effects */
00061         boolean  nopick;        /* do not pickup objects (as when running) */
00062         boolean  null;          /* OK to send nulls to the terminal */
00063 #ifdef MAC
00064         boolean  page_wait;     /* put up a --More-- after a page of messages */
00065 #endif
00066         boolean  perm_invent;   /* keep full inventories up until dismissed */
00067         boolean  pickup;        /* whether you pickup or move and look */
00068         boolean  pickup_dropped;        /* don't auto-pickup items you dropped */
00069         boolean  pickup_thrown;         /* auto-pickup items you threw */
00070 
00071         boolean  pushweapon;    /* When wielding, push old weapon into second slot */
00072         boolean  rest_on_space; /* space means rest */
00073         boolean  safe_dog;      /* give complete protection to the dog */
00074 #ifdef EXP_ON_BOTL
00075         boolean  showexp;       /* show experience points */
00076 #endif
00077 #ifdef SCORE_ON_BOTL
00078         boolean  showscore;     /* show score */
00079 #endif
00080         boolean  silent;        /* whether the bell rings or not */
00081         boolean  sortpack;      /* sorted inventory */
00082         boolean  soundok;       /* ok to tell about sounds heard */
00083         boolean  sparkle;       /* show "resisting" special FX (Scott Bigham) */
00084         boolean  standout;      /* use standout for --More-- */
00085         boolean  time;          /* display elapsed 'time' */
00086         boolean  tombstone;     /* print tombstone */
00087         boolean  toptenwin;     /* ending list in window instead of stdout */
00088         boolean  verbose;       /* max battle info */
00089         boolean  prayconfirm;   /* confirm before praying */
00090         int      end_top, end_around;   /* describe desired score list */
00091         unsigned ident;         /* social security number for each monster */
00092         unsigned moonphase;
00093         unsigned long suppress_alert;
00094 #define NEW_MOON        0
00095 #define FULL_MOON       4
00096         unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
00097         boolean  travel;        /* find way automatically to u.tx,u.ty */
00098         unsigned run;           /* 0: h (etc), 1: H (etc), 2: fh (etc) */
00099                                 /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
00100                                 /* 8: travel */
00101         unsigned long warntype; /* warn_of_mon monster type M2 */
00102         int      warnlevel;
00103         int      djinni_count, ghost_count;     /* potion effect tuning */
00104         int      pickup_burden;         /* maximum burden before prompt */
00105         char     inv_order[MAXOCLASSES];
00106         char     pickup_types[MAXOCLASSES];
00107 #define NUM_DISCLOSURE_OPTIONS          5
00108 #define DISCLOSE_PROMPT_DEFAULT_YES     'y'
00109 #define DISCLOSE_PROMPT_DEFAULT_NO      'n'
00110 #define DISCLOSE_YES_WITHOUT_PROMPT     '+'
00111 #define DISCLOSE_NO_WITHOUT_PROMPT      '-'
00112         char     end_disclose[NUM_DISCLOSURE_OPTIONS + 1];  /* disclose various info
00113                                                                 upon exit */
00114         char     menu_style;    /* User interface style setting */
00115 #ifdef AMII_GRAPHICS
00116         int numcols;
00117         unsigned short amii_dripens[ 20 ]; /* DrawInfo Pens currently there are 13 in v39 */
00118         AMII_COLOR_TYPE amii_curmap[ AMII_MAXCOLORS ]; /* colormap */
00119 #endif
00120 
00121         /* KMH, role patch -- Variables used during startup.
00122          *
00123          * If the user wishes to select a role, race, gender, and/or alignment
00124          * during startup, the choices should be recorded here.  This
00125          * might be specified through command-line options, environmental
00126          * variables, a popup dialog box, menus, etc.
00127          *
00128          * These values are each an index into an array.  They are not
00129          * characters or letters, because that limits us to 26 roles.
00130          * They are not booleans, because someday someone may need a neuter
00131          * gender.  Negative values are used to indicate that the user
00132          * hasn't yet specified that particular value.  If you determine
00133          * that the user wants a random choice, then you should set an
00134          * appropriate random value; if you just left the negative value,
00135          * the user would be asked again!
00136          *
00137          * These variables are stored here because the u structure is
00138          * cleared during character initialization, and because the
00139          * flags structure is restored for saved games.  Thus, we can
00140          * use the same parameters to build the role entry for both
00141          * new and restored games.
00142          *
00143          * These variables should not be referred to after the character
00144          * is initialized or restored (specifically, after role_init()
00145          * is called).
00146          */
00147         int      initrole;      /* starting role      (index into roles[])   */
00148         int      initrace;      /* starting race      (index into races[])   */
00149         int      initgend;      /* starting gender    (index into genders[]) */
00150         int      initalign;     /* starting alignment (index into aligns[])  */
00151         int      randomall;     /* randomly assign everything not specified */
00152         int      pantheon;      /* deity selection for priest character */
00153 
00154         /* --- initial roleplay flags ---
00155          * These flags represent the player's conduct/roleplay
00156          * intention at character creation.
00157          *
00158          * First the player can sets some of these at character
00159          * creation. (via configuration-file, ..)
00160          * Then role_init() may set/prevent certain combinations,
00161          * e.g. Monks get the vegetarian flag, vegans should also be
00162          * vegetarians, ..
00163          * 
00164          * After that the initial flags shouldn't be modified.
00165          * In u_init() the flags can be used to put some
00166          * roleplay-intrinsics into the u structure. Only those
00167          * should be modified during gameplay.
00168          */
00169         boolean  ascet;
00170         boolean  atheist;
00171         boolean  blindfolded;
00172         boolean  illiterate;
00173         boolean  pacifist;
00174         boolean  nudist;
00175         boolean  vegan;
00176         boolean  vegetarian;
00177 };
00178 
00179 /*
00180  * Flags that are set each time the game is started.
00181  * These are not saved with the game.
00182  *
00183  */
00184 
00185 struct instance_flags {
00186         boolean  cbreak;        /* in cbreak mode, rogue format */
00187 #ifdef CURSES_GRAPHICS
00188         boolean  cursesgraphics; /* Use portable curses extended characters */
00189 #endif
00190         boolean  DECgraphics;   /* use DEC VT-xxx extended character set */
00191         boolean  echo;          /* 1 to echo characters */
00192         boolean  IBMgraphics;   /* use IBM extended character set */
00193         unsigned msg_history;   /* hint: # of top lines to save */
00194         boolean  num_pad;       /* use numbers for movement commands */
00195         boolean  news;          /* print news */
00196         boolean  window_inited; /* true if init_nhwindows() completed */
00197         boolean  vision_inited; /* true if vision is ready */
00198         boolean  menu_tab_sep;  /* Use tabs to separate option menu fields */
00199         boolean  menu_requested; /* Flag for overloaded use of 'm' prefix
00200                                   * on some non-move commands */
00201         uchar num_pad_mode;
00202         int     menu_headings;  /* ATR for menu headings */
00203         int      purge_monsters;        /* # of dead monsters still on fmon list */
00204         int *opt_booldup;       /* for duplication of boolean opts in config file */
00205         int *opt_compdup;       /* for duplication of compound opts in config file */
00206         uchar   bouldersym;     /* symbol for boulder display */
00207         boolean travel1;        /* first travel step */
00208         coord   travelcc;       /* coordinates for travel_cache */
00209 #ifdef QWERTZ
00210         boolean  qwertz_layout; /* swap y/z for this key layout */
00211 #endif
00212 #ifdef SIMPLE_MAIL
00213         boolean simplemail;     /* simple mail format $NAME:$MESSAGE */
00214 #endif
00215 #ifdef WIZARD
00216         boolean  sanity_check;  /* run sanity checks */
00217         boolean  mon_polycontrol;       /* debug: control monster polymorphs */
00218 #endif
00219 #ifdef TTY_GRAPHICS
00220         char prevmsg_window;    /* type of old message window to use */
00221 #endif
00222 #if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
00223         boolean  extmenu;       /* extended commands use menu interface */
00224 #endif
00225 #ifdef MENU_COLOR
00226         boolean use_menu_color; /* use color in menus; only if wc_color */
00227 #endif
00228 #ifdef WIN_EDGE
00229         boolean  win_edge;      /* are the menus aligned left&top */
00230 #endif
00231 #if defined(STATUS_COLORS) && defined(TEXTCOLOR)
00232         boolean use_status_colors; /* use color in status line; only if wc_color */
00233 #endif
00234 #ifdef MFLOPPY
00235         boolean  checkspace;    /* check disk space before writing files */
00236                                 /* (in iflags to allow restore after moving
00237                                  * to >2GB partition) */
00238 #endif
00239 #ifdef MICRO
00240         boolean  BIOS;          /* use IBM or ST BIOS calls when appropriate */
00241 #endif
00242 #if defined(MICRO) || defined(WIN32)
00243         boolean  rawio;         /* whether can use rawio (IOCTL call) */
00244 #endif
00245 #ifdef MAC_GRAPHICS_ENV
00246         boolean  MACgraphics;   /* use Macintosh extended character set, as
00247                                    as defined in the special font HackFont */
00248         unsigned  use_stone;            /* use the stone ppats */
00249 #endif
00250 #if defined(MSDOS) || defined(WIN32)
00251         boolean hassound;       /* has a sound card */
00252         boolean usesound;       /* use the sound card */
00253         boolean usepcspeaker;   /* use the pc speaker */
00254         boolean tile_view;
00255         boolean over_view;
00256         boolean traditional_view;
00257 #endif
00258 #ifdef MSDOS
00259         boolean hasvga;         /* has a vga adapter */
00260         boolean usevga;         /* use the vga adapter */
00261         boolean grmode;         /* currently in graphics mode */
00262 #endif
00263 #ifdef LAN_FEATURES
00264         boolean lan_mail;       /* mail is initialized */
00265         boolean lan_mail_fetched; /* mail is awaiting display */
00266 #endif
00267 #ifdef SHOW_BORN
00268         boolean show_born;      /* show numbers of created monsters */
00269 #endif
00270         boolean showdmg;        /* show damage */
00271         /* only set when PARANOID is defined */
00272         boolean paranoid_hit;   /* Ask for 'yes' when hitting peacefuls */
00273         boolean paranoid_quit;  /* Ask for 'yes' when quitting */
00274         boolean paranoid_remove; /* Always show menu for 'T' and 'R' */
00275         boolean paranoid_trap; /* Ask for 'yes' before walking into known traps */
00276 /*
00277  * Window capability support.
00278  */
00279         boolean wc_color;               /* use color graphics                  */
00280         boolean wc_hilite_pet;          /* hilight pets                        */
00281         boolean wc_ascii_map;           /* show map using traditional ascii    */
00282         boolean wc_tiled_map;           /* show map using tiles                */
00283         boolean wc_preload_tiles;       /* preload tiles into memory           */
00284         int     wc_tile_width;          /* tile width                          */
00285         int     wc_tile_height;         /* tile height                         */
00286         char    *wc_tile_file;          /* name of tile file;overrides default */
00287         boolean wc_inverse;             /* use inverse video for some things   */
00288         int     wc_align_status;        /*  status win at top|bot|right|left   */
00289         int     wc_align_message;       /* message win at top|bot|right|left   */
00290         int     wc_vary_msgcount;       /* show more old messages at a time    */
00291         char    *wc_foregrnd_menu;      /* points to foregrnd color name for menu win   */
00292         char    *wc_backgrnd_menu;      /* points to backgrnd color name for menu win   */
00293         char    *wc_foregrnd_message;   /* points to foregrnd color name for msg win    */
00294         char    *wc_backgrnd_message;   /* points to backgrnd color name for msg win    */
00295         char    *wc_foregrnd_status;    /* points to foregrnd color name for status win */
00296         char    *wc_backgrnd_status;    /* points to backgrnd color name for status win */
00297         char    *wc_foregrnd_text;      /* points to foregrnd color name for text win   */
00298         char    *wc_backgrnd_text;      /* points to backgrnd color name for text win   */
00299         char    *wc_font_map;           /* points to font name for the map win */
00300         char    *wc_font_message;       /* points to font name for message win */
00301         char    *wc_font_status;        /* points to font name for status win  */
00302         char    *wc_font_menu;          /* points to font name for menu win    */
00303         char    *wc_font_text;          /* points to font name for text win    */
00304         int     wc_fontsiz_map;         /* font size for the map win           */
00305         int     wc_fontsiz_message;     /* font size for the message window    */
00306         int     wc_fontsiz_status;      /* font size for the status window     */
00307         int     wc_fontsiz_menu;        /* font size for the menu window       */
00308         int     wc_fontsiz_text;        /* font size for text windows          */
00309         int     wc_scroll_amount;       /* scroll this amount at scroll_margin */
00310         int     wc_scroll_margin;       /* scroll map when this far from
00311                                                 the edge */
00312         int     wc_map_mode;            /* specify map viewing options, mostly
00313                                                 for backward compatibility */
00314         int     wc_player_selection;    /* method of choosing character */
00315         boolean wc_splash_screen;       /* display an opening splash screen or not */
00316         boolean wc_popup_dialog;        /* put queries in pop up dialogs instead of
00317                                                 in the message window */
00318         boolean wc_eight_bit_input;     /* allow eight bit input               */
00319         boolean wc_mouse_support;       /* allow mouse support */
00320         boolean wc2_fullscreen;         /* run fullscreen */
00321         boolean wc2_softkeyboard;       /* use software keyboard */
00322         boolean wc2_wraptext;           /* wrap text */
00323         int     wc2_term_cols;          /* terminal width, in characters */
00324         int     wc2_term_rows;          /* terminal height, in characters */
00325         int     wc2_windowborders;      /* display borders on NetHack windows */
00326         int     wc2_petattr;            /* points to text attributes for pet */
00327         boolean wc2_guicolor;           /* allow colors in GUI (outside map) */
00328         boolean wc2_newcolors;          /* try to use slashem like colors including
00329                                          * dark-gray to represent black object */
00330 
00331         boolean  show_buc;      /* always show BUC status */
00332         boolean  cmdassist;     /* provide detailed assistance for some commands */
00333         boolean  obsolete;      /* obsolete options can point at this, it isn't used */
00334         /* Items which belong in flags, but are here to allow save compatibility */
00335         boolean  lootabc;       /* use "a/b/c" rather than "o/i/b" when looting */
00336         boolean  showrace;      /* show hero glyph by race rather than by role */
00337         boolean  travelcmd;     /* allow travel command */
00338         boolean  show_dgn_name; /* show dungeon names instead of Dlvl: on bottom line */
00339         int      runmode;       /* update screen display during run moves */
00340         int      pilesize;      /* how many items to list automatically */
00341 #ifdef AUTOPICKUP_EXCEPTIONS
00342         struct autopickup_exception *autopickup_exceptions[2];
00343 #define AP_LEAVE 0
00344 #define AP_GRAB  1
00345 #endif
00346 #ifdef WIN32CON
00347 #define MAX_ALTKEYHANDLER 25
00348         char     altkeyhandler[MAX_ALTKEYHANDLER];
00349 #endif
00350 #ifdef REALTIME_ON_BOTL
00351         boolean  showrealtime; /* show actual elapsed time */
00352 #endif
00353 #ifdef AUTO_OPEN
00354         boolean  autoopen;      /* open doors by walking into them */
00355 #endif
00356         boolean  dark_room;     /* show shadows in lit rooms */
00357         boolean  vanilla_ui_behavior;   /* fall back to vanilla behavior */
00358 };
00359 
00360 /*
00361  * Old deprecated names
00362  */
00363 #ifdef TTY_GRAPHICS
00364 #define eight_bit_tty wc_eight_bit_input
00365 #endif
00366 #ifdef TEXTCOLOR
00367 #define use_color wc_color
00368 #endif
00369 #define hilite_pet wc_hilite_pet
00370 #define use_inverse wc_inverse
00371 #ifdef MAC_GRAPHICS_ENV
00372 #define large_font obsolete
00373 #endif
00374 #ifdef MAC
00375 #define popup_dialog wc_popup_dialog
00376 #endif
00377 #define preload_tiles wc_preload_tiles
00378 
00379 extern NEARDATA struct flag flags;
00380 extern NEARDATA struct instance_flags iflags;
00381 
00382 /* runmode options */
00383 #define RUN_TPORT       0       /* don't update display until movement stops */
00384 #define RUN_LEAP        1       /* update display every 7 steps */
00385 #define RUN_STEP        2       /* update display every single step */
00386 #define RUN_CRAWL       3       /* walk w/ extra delay after each update */
00387 
00388 #endif /* FLAG_H */