OSDN Git Service

use .jnethackrc
[jnethack/source.git] / include / flag.h
1 /* NetHack 3.6  flag.h  $NHDT-Date: 1574900824 2019/11/28 00:27:04 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.160 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Michael Allison, 2006. */
4 /* NetHack may be freely redistributed.  See license for details. */
5
6 /* If you change the flag structure make sure you increment EDITLEVEL in   */
7 /* patchlevel.h if needed.  Changing the instance_flags structure does     */
8 /* not require incrementing EDITLEVEL.                                     */
9
10 #ifndef FLAG_H
11 #define FLAG_H
12
13 /*
14  * Persistent flags that are saved and restored with the game.
15  *
16  */
17
18 struct flag {
19     boolean acoustics;  /* allow dungeon sound messages */
20     boolean autodig;    /* MRKR: Automatically dig */
21     boolean autoquiver; /* Automatically fill quiver */
22     boolean autoopen;   /* open doors by walking into them */
23     boolean beginner;
24     boolean biff;      /* enable checking for mail */
25     boolean bones;     /* allow saving/loading bones */
26     boolean confirm;   /* confirm before hitting tame monsters */
27     boolean dark_room; /* show shadows in lit rooms */
28     boolean debug;     /* in debugging mode */
29 #define wizard flags.debug
30     boolean end_own; /* list all own scores */
31     boolean explore; /* in exploration mode */
32 #define discover flags.explore
33     boolean female;
34     boolean friday13;        /* it's Friday the 13th */
35     boolean help;            /* look in data file for info about stuff */
36     boolean ignintr;         /* ignore interrupts */
37     boolean ins_chkpt;       /* checkpoint as appropriate; INSURANCE */
38     boolean invlet_constant; /* let objects keep their inventory symbol */
39     boolean legacy;          /* print game entry "story" */
40     boolean lit_corridor;    /* show a dark corr as lit if it is in sight */
41     boolean nap;             /* `timed_delay' option for display effects */
42     boolean null;            /* OK to send nulls to the terminal */
43     boolean p__obsolete;     /* [3.6.2: perm_invent moved to iflags] */
44     boolean pickup;          /* whether you pickup or move and look */
45     boolean pickup_thrown;   /* auto-pickup items you threw */
46     boolean pushweapon; /* When wielding, push old weapon into second slot */
47     boolean rest_on_space;   /* space means rest */
48     boolean safe_dog;        /* give complete protection to the dog */
49     boolean showexp;         /* show experience points */
50     boolean showscore;       /* show score */
51     boolean silent;          /* whether the bell rings or not */
52     /* The story so far:
53      * 'sortloot' originally took a True/False value but was changed
54      * to use a letter instead.  3.6.0 was released without changing its
55      * type from 'boolean' to 'char'.  A compiler was smart enough to
56      * complain that assigning any of the relevant letters was not 0 or 1
57      * so not appropriate for boolean (by a configuration which used
58      * SKIP_BOOLEAN to bypass nethack's 'boolean' and use a C++-compatible
59      * one).  So the type was changed to 'xchar', which is guaranteed to
60      * match the size of 'boolean' (this guarantee only applies for the
61      * !SKIP_BOOLEAN config, unfortunately).  Since xchar does not match
62      * actual use, the type was later changed to 'char'.  But that would
63      * break 3.6.0 savefile compatibility for configurations which typedef
64      * 'schar' to 'short int' instead of to 'char'.  (Needed by pre-ANSI
65      * systems that use unsigned characters without a way to force them
66      * to be signed.)  So, the type has been changed back to 'xchar' for
67      * 3.6.x.
68      *
69      * TODO:  change to 'char' (and move out of this block of booleans,
70      * and get rid of these comments...) once 3.6.0 savefile compatibility
71      * eventually ends.
72      */
73 #ifndef SKIP_BOOLEAN
74     /* this is the normal configuration; assigning a character constant
75        for a normal letter to an 'xchar' variable should always work even
76        if 'char' is unsigned since character constants are actually 'int'
77        and letters are within the range where signedness shouldn't matter */
78     xchar   sortloot; /* 'n'=none, 'l'=loot (pickup), 'f'=full ('l'+invent) */
79 #else
80     /* with SKIP_BOOLEAN, we have no idea what underlying type is being
81        used, other than it isn't 'xchar' (although its size might match
82        that) or a bitfield (because it must be directly addressable);
83        it's probably either 'char' for compactness or 'int' for access,
84        but we don't know which and it might be something else anyway;
85        flip a coin here and guess 'char' for compactness */
86     char    sortloot; /* 'n'=none, 'l'=loot (pickup), 'f'=full ('l'+invent) */
87 #endif
88     boolean sortpack;        /* sorted inventory */
89     boolean sparkle;         /* show "resisting" special FX (Scott Bigham) */
90     boolean standout;        /* use standout for --More-- */
91     boolean time;            /* display elapsed 'time' */
92     boolean tombstone;       /* print tombstone */
93     boolean verbose;         /* max battle info */
94     int end_top, end_around; /* describe desired score list */
95     unsigned moonphase;
96     unsigned long suppress_alert;
97 #define NEW_MOON 0
98 #define FULL_MOON 4
99     unsigned paranoia_bits; /* alternate confirmation prompting */
100 #define PARANOID_CONFIRM    0x0001
101 #define PARANOID_QUIT       0x0002
102 #define PARANOID_DIE        0x0004
103 #define PARANOID_BONES      0x0008
104 #define PARANOID_HIT        0x0010
105 #define PARANOID_PRAY       0x0020
106 #define PARANOID_REMOVE     0x0040
107 #define PARANOID_BREAKWAND  0x0080
108 #define PARANOID_WERECHANGE 0x0100
109 #define PARANOID_EATING     0x0200
110     int pickup_burden; /* maximum burden before prompt */
111     int pile_limit;    /* controls feedback when walking over objects */
112     char inv_order[MAXOCLASSES];
113     char pickup_types[MAXOCLASSES];
114 #define NUM_DISCLOSURE_OPTIONS 6 /* i,a,v,g,c,o (decl.c) */
115 #define DISCLOSE_PROMPT_DEFAULT_YES 'y'
116 #define DISCLOSE_PROMPT_DEFAULT_NO 'n'
117 #define DISCLOSE_PROMPT_DEFAULT_SPECIAL '?' /* v, default a */
118 #define DISCLOSE_YES_WITHOUT_PROMPT '+'
119 #define DISCLOSE_NO_WITHOUT_PROMPT '-'
120 #define DISCLOSE_SPECIAL_WITHOUT_PROMPT '#' /* v, use a */
121     char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various
122                                                       info upon exit */
123     char menu_style;    /* User interface style setting */
124     boolean made_fruit; /* don't easily let the user overflow the number of
125                            fruits */
126
127     /* KMH, role patch -- Variables used during startup.
128      *
129      * If the user wishes to select a role, race, gender, and/or alignment
130      * during startup, the choices should be recorded here.  This
131      * might be specified through command-line options, environmental
132      * variables, a popup dialog box, menus, etc.
133      *
134      * These values are each an index into an array.  They are not
135      * characters or letters, because that limits us to 26 roles.
136      * They are not booleans, because someday someone may need a neuter
137      * gender.  Negative values are used to indicate that the user
138      * hasn't yet specified that particular value.  If you determine
139      * that the user wants a random choice, then you should set an
140      * appropriate random value; if you just left the negative value,
141      * the user would be asked again!
142      *
143      * These variables are stored here because the u structure is
144      * cleared during character initialization, and because the
145      * flags structure is restored for saved games.  Thus, we can
146      * use the same parameters to build the role entry for both
147      * new and restored games.
148      *
149      * These variables should not be referred to after the character
150      * is initialized or restored (specifically, after role_init()
151      * is called).
152      */
153     int initrole;  /* starting role      (index into roles[])   */
154     int initrace;  /* starting race      (index into races[])   */
155     int initgend;  /* starting gender    (index into genders[]) */
156     int initalign; /* starting alignment (index into aligns[])  */
157     int randomall; /* randomly assign everything not specified */
158     int pantheon;  /* deity selection for priest character */
159     /* Items which were in iflags in 3.4.x to preserve savefile compatibility
160      */
161     boolean lootabc;   /* use "a/b/c" rather than "o/i/b" when looting */
162     boolean showrace;  /* show hero glyph by race rather than by role */
163     boolean travelcmd; /* allow travel command */
164     int runmode;       /* update screen display during run moves */
165 };
166
167 /*
168  * System-specific flags that are saved with the game if SYSFLAGS is defined.
169  */
170
171 #if defined(AMIFLUSH) || defined(AMII_GRAPHICS) || defined(OPT_DISPMAP)
172 #define SYSFLAGS
173 #else
174 #if defined(MFLOPPY) || defined(MAC)
175 #define SYSFLAGS
176 #endif
177 #endif
178
179 #ifdef SYSFLAGS
180 struct sysflag {
181     char sysflagsid[10];
182 #ifdef AMIFLUSH
183     boolean altmeta;  /* use ALT keys as META */
184     boolean amiflush; /* kill typeahead */
185 #endif
186 #ifdef AMII_GRAPHICS
187     int numcols;
188     unsigned short
189         amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */
190     AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */
191 #endif
192 #ifdef OPT_DISPMAP
193     boolean fast_map; /* use optimized, less flexible map display */
194 #endif
195 #ifdef MFLOPPY
196     boolean asksavedisk;
197 #endif
198 #ifdef MAC
199     boolean page_wait; /* put up a --More-- after a page of messages */
200 #endif
201 };
202 #endif
203
204 /*
205  * Flags that are set each time the game is started.
206  * These are not saved with the game.
207  *
208  */
209
210 /* values for iflags.getpos_coords */
211 #define GPCOORDS_NONE    'n'
212 #define GPCOORDS_MAP     'm'
213 #define GPCOORDS_COMPASS 'c'
214 #define GPCOORDS_COMFULL 'f'
215 #define GPCOORDS_SCREEN  's'
216
217 enum getloc_filters {
218     GFILTER_NONE = 0,
219     GFILTER_VIEW,
220     GFILTER_AREA,
221
222     NUM_GFILTER
223 };
224
225 struct debug_flags {
226     boolean test;
227 #ifdef TTY_GRAPHICS
228     boolean ttystatus;
229 #endif
230 #ifdef WIN32
231     boolean immediateflips;
232 #endif
233 };
234
235 struct instance_flags {
236     /* stuff that really isn't option or platform related. They are
237      * set and cleared during the game to control the internal
238      * behaviour of various NetHack functions and probably warrant
239      * a structure of their own elsewhere some day.
240      */
241     boolean debug_fuzzer;  /* fuzz testing */
242     boolean defer_plname;  /* X11 hack: askname() might not set plname */
243     boolean herecmd_menu;  /* use menu when mouseclick on yourself */
244     boolean invis_goldsym; /* gold symbol is ' '? */
245     int at_midnight;       /* only valid during end of game disclosure */
246     int at_night;          /* also only valid during end of game disclosure */
247     int failing_untrap;    /* move_into_trap() -> spoteffects() -> dotrap() */
248     int in_lava_effects;   /* hack for Boots_off() */
249     int last_msg;          /* indicator of last message player saw */
250     int override_ID;       /* true to force full identification of objects */
251     int parse_config_file_src;  /* hack for parse_config_line() */
252     int purge_monsters;    /* # of dead monsters still on fmon list */
253     int suppress_price;    /* controls doname() for unpaid objects */
254     int terrainmode; /* for getpos()'s autodescribe when #terrain is active */
255 #define TER_MAP    0x01
256 #define TER_TRP    0x02
257 #define TER_OBJ    0x04
258 #define TER_MON    0x08
259 #define TER_DETECT 0x10    /* detect_foo magic rather than #terrain */
260     boolean getloc_travelmode;
261     int getloc_filter;     /* GFILTER_foo */
262     boolean getloc_usemenu;
263     boolean getloc_moveskip;
264     coord travelcc;        /* coordinates for travel_cache */
265     boolean trav_debug;    /* display travel path (#if DEBUG only) */
266     boolean window_inited; /* true if init_nhwindows() completed */
267     boolean vision_inited; /* true if vision is ready */
268     boolean sanity_check;  /* run sanity checks */
269     boolean mon_polycontrol; /* debug: control monster polymorphs */
270     boolean in_dumplog;    /* doing the dumplog right now? */
271     boolean in_parse;      /* is a command being parsed? */
272      /* suppress terminate during options parsing, for --showpaths */
273     boolean initoptions_noterminate;
274
275     /* stuff that is related to options and/or user or platform preferences
276      */
277     unsigned msg_history; /* hint: # of top lines to save */
278     int getpos_coords;    /* show coordinates when getting cursor position */
279     int menu_headings;    /* ATR for menu headings */
280     int *opt_booldup;     /* for duplication of boolean opts in config file */
281     int *opt_compdup;     /* for duplication of compound opts in conf file */
282 #ifdef ALTMETA
283     boolean altmeta;      /* Alt-c sends ESC c rather than M-c */
284 #endif
285     boolean autodescribe;     /* autodescribe mode in getpos() */
286     boolean cbreak;           /* in cbreak mode, rogue format */
287     boolean deferred_X;       /* deferred entry into explore mode */
288     boolean echo;             /* 1 to echo characters */
289     boolean force_invmenu;    /* always menu when handling inventory */
290     /* FIXME: goldX belongs in flags, but putting it in iflags avoids
291        breaking 3.6.[01] save files */
292     boolean goldX;            /* for BUCX filtering, whether gold is X or U */
293     boolean hilite_pile;      /* mark piles of objects with a hilite */
294     boolean implicit_uncursed; /* maybe omit "uncursed" status in inventory */
295     boolean mention_walls;    /* give feedback when bumping walls */
296     boolean menu_head_objsym; /* Show obj symbol in menu headings */
297     boolean menu_overlay;     /* Draw menus over the map */
298     boolean menu_requested;   /* Flag for overloaded use of 'm' prefix
299                                * on some non-move commands */
300     boolean menu_tab_sep;     /* Use tabs to separate option menu fields */
301     boolean news;             /* print news */
302     boolean num_pad;          /* use numbers for movement commands */
303     boolean perm_invent;      /* keep full inventories up until dismissed */
304     boolean renameallowed;    /* can change hero name during role selection */
305     boolean renameinprogress; /* we are changing hero name */
306     boolean status_updates;   /* allow updates to bottom status lines;
307                                * disable to avoid excessive noise when using
308                                * a screen reader (use ^X to review status) */
309     boolean toptenwin;        /* ending list in window instead of stdout */
310     boolean use_background_glyph; /* use background glyph when appropriate */
311     boolean use_menu_color;   /* use color in menus; only if wc_color */
312 #ifdef STATUS_HILITES
313     long hilite_delta;     /* number of moves to leave a temp hilite lit */
314     long unhilite_deadline; /* time when oldest temp hilite should be unlit */
315 #endif
316     boolean zerocomp;         /* write zero-compressed save files */
317     boolean rlecomp;          /* alternative to zerocomp; run-length encoding
318                                * compression of levels when writing savefile */
319     uchar num_pad_mode;
320     boolean cursesgraphics;     /* Use portable curses extended characters */
321 #if 0   /* XXXgraphics superseded by symbol sets */
322     boolean  DECgraphics;       /* use DEC VT-xxx extended character set */
323     boolean  IBMgraphics;       /* use IBM extended character set */
324 #ifdef MAC_GRAPHICS_ENV
325     boolean  MACgraphics;       /* use Macintosh extended character set, as
326                                    as defined in the special font HackFont */
327 #endif
328 #endif
329     uchar bouldersym; /* symbol for boulder display */
330     char prevmsg_window; /* type of old message window to use */
331     boolean extmenu;     /* extended commands use menu interface */
332 #ifdef MFLOPPY
333     boolean checkspace; /* check disk space before writing files */
334                         /* (in iflags to allow restore after moving
335                          * to >2GB partition) */
336 #endif
337 #ifdef MICRO
338     boolean BIOS; /* use IBM or ST BIOS calls when appropriate */
339 #endif
340 #if defined(MICRO) || defined(WIN32)
341     boolean rawio; /* whether can use rawio (IOCTL call) */
342 #endif
343 #ifdef MAC_GRAPHICS_ENV
344     boolean MACgraphics; /* use Macintosh extended character set, as
345                             as defined in the special font HackFont */
346     unsigned use_stone;  /* use the stone ppats */
347 #endif
348 #if defined(MSDOS) || defined(WIN32)
349     boolean hassound;     /* has a sound card */
350     boolean usesound;     /* use the sound card */
351     boolean usepcspeaker; /* use the pc speaker */
352     boolean tile_view;
353     boolean over_view;
354     boolean traditional_view;
355 #endif
356 #ifdef MSDOS
357     boolean hasvga; /* has a vga adapter */
358     boolean usevga; /* use the vga adapter */
359     boolean hasvesa; /* has a VESA-capable VGA adapter */
360     boolean usevesa; /* use the VESA-capable VGA adapter */
361     boolean grmode; /* currently in graphics mode */
362 #endif
363 #ifdef LAN_FEATURES
364     boolean lan_mail;         /* mail is initialized */
365     boolean lan_mail_fetched; /* mail is awaiting display */
366 #endif
367 #ifdef TTY_TILES_ESCCODES
368     boolean vt_tiledata;     /* output console codes for tile support in TTY */
369 #endif
370     boolean clicklook;       /* allow right-clicking for look */
371     boolean cmdassist;       /* provide detailed assistance for some comnds */
372     boolean time_botl;       /* context.botl for 'time' (moves) only */
373     boolean wizweight;       /* display weight of everything in wizard mode */
374     /*
375      * Window capability support.
376      */
377     boolean wc_color;         /* use color graphics                  */
378     boolean wc_hilite_pet;    /* hilight pets                        */
379     boolean wc_ascii_map;     /* show map using traditional ascii    */
380     boolean wc_tiled_map;     /* show map using tiles                */
381     boolean wc_preload_tiles; /* preload tiles into memory           */
382     int wc_tile_width;        /* tile width                          */
383     int wc_tile_height;       /* tile height                         */
384     char *wc_tile_file;       /* name of tile file;overrides default */
385     boolean wc_inverse;       /* use inverse video for some things   */
386     int wc_align_status;      /*  status win at top|bot|right|left   */
387     int wc_align_message;     /* message win at top|bot|right|left   */
388     int wc_vary_msgcount;     /* show more old messages at a time    */
389     char *wc_foregrnd_menu; /* points to foregrnd color name for menu win   */
390     char *wc_backgrnd_menu; /* points to backgrnd color name for menu win   */
391     char *wc_foregrnd_message; /* points to foregrnd color name for msg win */
392     char *wc_backgrnd_message; /* points to backgrnd color name for msg win */
393     char *wc_foregrnd_status; /* points to foregrnd color name for status   */
394     char *wc_backgrnd_status; /* points to backgrnd color name for status   */
395     char *wc_foregrnd_text; /* points to foregrnd color name for text win   */
396     char *wc_backgrnd_text; /* points to backgrnd color name for text win   */
397     char *wc_font_map;      /* points to font name for the map win */
398     char *wc_font_message;  /* points to font name for message win */
399     char *wc_font_status;   /* points to font name for status win  */
400     char *wc_font_menu;     /* points to font name for menu win    */
401     char *wc_font_text;     /* points to font name for text win    */
402     int wc_fontsiz_map;     /* font size for the map win           */
403     int wc_fontsiz_message; /* font size for the message window    */
404     int wc_fontsiz_status;  /* font size for the status window     */
405     int wc_fontsiz_menu;    /* font size for the menu window       */
406     int wc_fontsiz_text;    /* font size for text windows          */
407     int wc_scroll_amount;   /* scroll this amount at scroll_margin */
408     int wc_scroll_margin;   /* scroll map when this far from the edge */
409     int wc_map_mode;        /* specify map viewing options, mostly
410                              * for backward compatibility */
411     int wc_player_selection;    /* method of choosing character */
412     boolean wc_splash_screen;   /* display an opening splash screen or not */
413     boolean wc_popup_dialog;    /* put queries in pop up dialogs instead of
414                                  * in the message window */
415     boolean wc_eight_bit_input; /* allow eight bit input               */
416     boolean wc2_fullscreen;     /* run fullscreen */
417     boolean wc2_softkeyboard;   /* use software keyboard */
418     boolean wc2_wraptext;       /* wrap text */
419     boolean wc2_selectsaved;    /* display a menu of user's saved games */
420     boolean wc2_darkgray;    /* try to use dark-gray color for black glyphs */
421     boolean wc2_hitpointbar;  /* show graphical bar representing hit points */
422     boolean wc2_guicolor;       /* allow colours in gui (outside map) */
423     int wc_mouse_support;       /* allow mouse support */
424     int wc2_term_cols;          /* terminal width, in characters */
425     int wc2_term_rows;          /* terminal height, in characters */
426     int wc2_statuslines;        /* default = 2, curses can handle 3 */
427     int wc2_windowborders;      /* display borders on NetHack windows */
428     int wc2_petattr;            /* text attributes for pet */
429 #ifdef WIN32
430 #define MAX_ALTKEYHANDLER 25
431     char altkeyhandler[MAX_ALTKEYHANDLER];
432 #endif
433     /* copies of values in struct u, used during detection when the
434        originals are temporarily cleared; kept here rather than
435        locally so that they can be restored during a hangup save */
436     Bitfield(save_uswallow, 1);
437     Bitfield(save_uinwater, 1);
438     Bitfield(save_uburied, 1);
439     /* item types used to acomplish "special achievements"; find the target
440        object and you'll be flagged as having achieved something... */
441     short mines_prize_type;     /* luckstone */
442     short soko_prize_type1;     /* bag of holding or    */
443     short soko_prize_type2;     /* amulet of reflection */
444     struct debug_flags debug;
445     boolean windowtype_locked;  /* windowtype can't change from configfile */
446     boolean windowtype_deferred; /* pick a windowport and store it in
447                                     chosen_windowport[], but do not switch to
448                                     it in the midst of options processing */
449     genericptr_t returning_missile; /* 'struct obj *'; Mjollnir or aklys */
450     boolean obsolete;  /* obsolete options can point at this, it isn't used */
451 };
452
453 /*
454  * Old deprecated names
455  */
456 #ifdef TTY_GRAPHICS
457 #define eight_bit_tty wc_eight_bit_input
458 #endif
459 #define use_color wc_color
460 #define hilite_pet wc_hilite_pet
461 #define use_inverse wc_inverse
462 #ifdef MAC_GRAPHICS_ENV
463 #define large_font obsolete
464 #endif
465 #ifdef MAC
466 #define popup_dialog wc_popup_dialog
467 #endif
468 #define preload_tiles wc_preload_tiles
469
470 extern NEARDATA struct flag flags;
471 #ifdef SYSFLAGS
472 extern NEARDATA struct sysflag sysflags;
473 #endif
474 extern NEARDATA struct instance_flags iflags;
475
476 /* last_msg values
477  * Usage:
478  *  pline("some message");
479  *    pline: vsprintf + putstr + iflags.last_msg = PLNMSG_UNKNOWN;
480  *  iflags.last_msg = PLNMSG_some_message;
481  * and subsequent code can adjust the next message if it is affected
482  * by some_message.  The next message will clear iflags.last_msg.
483  */
484 enum plnmsg_types {
485     PLNMSG_UNKNOWN = 0,         /* arbitrary */
486     PLNMSG_ONE_ITEM_HERE,       /* "you see <single item> here" */
487     PLNMSG_TOWER_OF_FLAME,      /* scroll of fire */
488     PLNMSG_CAUGHT_IN_EXPLOSION, /* explode() feedback */
489     PLNMSG_OBJ_GLOWS,           /* "the <obj> glows <color>" */
490     PLNMSG_OBJNAM_ONLY,         /* xname/doname only, for #tip */
491     PLNMSG_OK_DONT_DIE          /* overriding death in explore/wizard mode */
492 };
493
494 /* runmode options */
495 enum runmode_types {
496     RUN_TPORT = 0, /* don't update display until movement stops */
497     RUN_LEAP,      /* update display every 7 steps */
498     RUN_STEP,      /* update display every single step */
499     RUN_CRAWL      /* walk w/ extra delay after each update */
500 };
501
502 /* paranoid confirmation prompting */
503 /* any yes confirmations also require explicit no (or ESC) to reject */
504 #define ParanoidConfirm ((flags.paranoia_bits & PARANOID_CONFIRM) != 0)
505 /* quit: yes vs y for "Really quit?" and "Enter explore mode?" */
506 #define ParanoidQuit ((flags.paranoia_bits & PARANOID_QUIT) != 0)
507 /* die: yes vs y for "Die?" (dying in explore mode or wizard mode) */
508 #define ParanoidDie ((flags.paranoia_bits & PARANOID_DIE) != 0)
509 /* hit: yes vs y for "Save bones?" in wizard mode */
510 #define ParanoidBones ((flags.paranoia_bits & PARANOID_BONES) != 0)
511 /* hit: yes vs y for "Really attack <the peaceful monster>?" */
512 #define ParanoidHit ((flags.paranoia_bits & PARANOID_HIT) != 0)
513 /* pray: ask "Really pray?" (accepts y answer, doesn't require yes),
514    taking over for the old prayconfirm boolean option */
515 #define ParanoidPray ((flags.paranoia_bits & PARANOID_PRAY) != 0)
516 /* remove: remove ('R') and takeoff ('T') commands prompt for an inventory
517    item even when only one accessory or piece of armor is currently worn */
518 #define ParanoidRemove ((flags.paranoia_bits & PARANOID_REMOVE) != 0)
519 /* breakwand: Applying a wand */
520 #define ParanoidBreakwand ((flags.paranoia_bits & PARANOID_BREAKWAND) != 0)
521 /* werechange: accepting randomly timed werecreature change to transform
522    from human to creature or vice versa while having polymorph control */
523 #define ParanoidWerechange ((flags.paranoia_bits & PARANOID_WERECHANGE) != 0)
524 /* continue eating: prompt given _after_first_bite_ when eating something
525    while satiated */
526 #define ParanoidEating ((flags.paranoia_bits & PARANOID_EATING) != 0)
527
528 /* command parsing, mainly dealing with number_pad handling;
529    not saved and restored */
530
531 #ifdef NHSTDC
532 /* forward declaration sufficient to declare pointers */
533 struct ext_func_tab; /* from func_tab.h */
534 #endif
535
536 /* special key functions */
537 enum nh_keyfunc {
538     NHKF_ESC = 0,
539     NHKF_DOAGAIN,
540
541     NHKF_REQMENU,
542
543     /* run ... clicklook need to be in a continuous block */
544     NHKF_RUN,
545     NHKF_RUN2,
546     NHKF_RUSH,
547     NHKF_FIGHT,
548     NHKF_FIGHT2,
549     NHKF_NOPICKUP,
550     NHKF_RUN_NOPICKUP,
551     NHKF_DOINV,
552     NHKF_TRAVEL,
553     NHKF_CLICKLOOK,
554
555     NHKF_REDRAW,
556     NHKF_REDRAW2,
557     NHKF_GETDIR_SELF,
558     NHKF_GETDIR_SELF2,
559     NHKF_GETDIR_HELP,
560     NHKF_COUNT,
561     NHKF_GETPOS_SELF,
562     NHKF_GETPOS_PICK,
563     NHKF_GETPOS_PICK_Q,  /* quick */
564     NHKF_GETPOS_PICK_O,  /* once */
565     NHKF_GETPOS_PICK_V,  /* verbose */
566     NHKF_GETPOS_SHOWVALID,
567     NHKF_GETPOS_AUTODESC,
568     NHKF_GETPOS_MON_NEXT,
569     NHKF_GETPOS_MON_PREV,
570     NHKF_GETPOS_OBJ_NEXT,
571     NHKF_GETPOS_OBJ_PREV,
572     NHKF_GETPOS_DOOR_NEXT,
573     NHKF_GETPOS_DOOR_PREV,
574     NHKF_GETPOS_UNEX_NEXT,
575     NHKF_GETPOS_UNEX_PREV,
576     NHKF_GETPOS_INTERESTING_NEXT,
577     NHKF_GETPOS_INTERESTING_PREV,
578     NHKF_GETPOS_VALID_NEXT,
579     NHKF_GETPOS_VALID_PREV,
580     NHKF_GETPOS_HELP,
581     NHKF_GETPOS_MENU,
582     NHKF_GETPOS_LIMITVIEW,
583     NHKF_GETPOS_MOVESKIP,
584
585     NUM_NHKF
586 };
587
588 enum gloctypes {
589     GLOC_MONS = 0,
590     GLOC_OBJS,
591     GLOC_DOOR,
592     GLOC_EXPLORE,
593     GLOC_INTERESTING,
594     GLOC_VALID,
595
596     NUM_GLOCS
597 };
598
599 /* commands[] is used to directly access cmdlist[] instead of looping
600    through it to find the entry for a given input character;
601    move_X is the character used for moving one step in direction X;
602    alphadirchars corresponds to old sdir,
603    dirchars corresponds to ``iflags.num_pad ? ndir : sdir'';
604    pcHack_compat and phone_layout only matter when num_pad is on,
605    swap_yz only matters when it's off */
606 struct cmd {
607     unsigned serialno;     /* incremented after each update */
608     boolean num_pad;       /* same as iflags.num_pad except during updates */
609     boolean pcHack_compat; /* for numpad:  affects 5, M-5, and M-0 */
610     boolean phone_layout;  /* inverted keypad:  1,2,3 above, 7,8,9 below */
611     boolean swap_yz;       /* QWERTZ keyboards; use z to move NW, y to zap */
612     char move_W, move_NW, move_N, move_NE, move_E, move_SE, move_S, move_SW;
613     const char *dirchars;      /* current movement/direction characters */
614     const char *alphadirchars; /* same as dirchars if !numpad */
615     const struct ext_func_tab *commands[256]; /* indexed by input character */
616     char spkeys[NUM_NHKF];
617 };
618
619 extern NEARDATA struct cmd Cmd;
620
621 #endif /* FLAG_H */