Source:NetHack 3.4.3/include/flag.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/flag.h from NetHack 3.4.3. To link to a particular line, write [[flag.h#line123]], for example.

  1. /*	SCCS Id: @(#)flag.h	3.4	2002/08/22	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

  1. /* If you change the flag structure make sure you increment EDITLEVEL in   */
  2. /* patchlevel.h if needed.  Changing the instance_flags structure does	   */
  3. /* not require incrementing EDITLEVEL.					   */
  4.  
  5. #ifndef FLAG_H
  6. #define FLAG_H
  7.  
  8. /*
  9. * Persistent flags that are saved and restored with the game.
  10. *
  11. */
  12.  
  13. struct flag {
  14. #ifdef AMIFLUSH
  15. 	boolean  altmeta;	/* use ALT keys as META */
  16. 	boolean  amiflush;	/* kill typeahead */
  17. #endif
  18. #ifdef	MFLOPPY
  19. 	boolean  asksavedisk;
  20. #endif
  21. 	boolean  autodig;       /* MRKR: Automatically dig */
  22. 	boolean  autoquiver;	/* Automatically fill quiver */
  23. 	boolean  beginner;
  24. #ifdef MAIL
  25. 	boolean  biff;		/* enable checking for mail */
  26. #endif
  27. 	boolean  botl;		/* partially redo status line */
  28. 	boolean  botlx;		/* print an entirely new bottom line */
  29. 	boolean  confirm;	/* confirm before hitting tame monsters */
  30. 	boolean  debug;		/* in debugging mode */
  31. #define wizard	 flags.debug
  32. 	boolean  end_own;	/* list all own scores */
  33. 	boolean  explore;	/* in exploration mode */
  34. #ifdef OPT_DISPMAP
  35. 	boolean  fast_map;	/* use optimized, less flexible map display */
  36. #endif
  37. #define discover flags.explore
  38. 	boolean  female;
  39. 	boolean  forcefight;
  40. 	boolean  friday13;	/* it's Friday the 13th */
  41. 	boolean  help;		/* look in data file for info about stuff */
  42. 	boolean  ignintr;	/* ignore interrupts */
  43. #ifdef INSURANCE
  44. 	boolean  ins_chkpt;	/* checkpoint as appropriate */
  45. #endif
  46. 	boolean  invlet_constant; /* let objects keep their inventory symbol */
  47. 	boolean  legacy;	/* print game entry "story" */
  48. 	boolean  lit_corridor;	/* show a dark corr as lit if it is in sight */
  49. 	boolean  made_amulet;
  50. 	boolean  mon_moving;	/* monsters' turn to move */
  51. 	boolean  move;
  52. 	boolean  mv;
  53. 	boolean  bypasses;	/* bypass flag is set on at least one fobj */
  54. 	boolean  nap;		/* `timed_delay' option for display effects */
  55. 	boolean  nopick;	/* do not pickup objects (as when running) */
  56. 	boolean  null;		/* OK to send nulls to the terminal */
  57. #ifdef MAC
  58. 	boolean  page_wait;	/* put up a --More-- after a page of messages */
  59. #endif
  60. 	boolean  perm_invent;	/* keep full inventories up until dismissed */
  61. 	boolean  pickup;	/* whether you pickup or move and look */
  62.  
  63. 	boolean  pushweapon;	/* When wielding, push old weapon into second slot */
  64. 	boolean  rest_on_space; /* space means rest */
  65. 	boolean  safe_dog;	/* give complete protection to the dog */
  66. #ifdef EXP_ON_BOTL
  67. 	boolean  showexp;	/* show experience points */
  68. #endif
  69. #ifdef SCORE_ON_BOTL
  70. 	boolean  showscore;	/* show score */
  71. #endif
  72. 	boolean  silent;	/* whether the bell rings or not */
  73. 	boolean  sortpack;	/* sorted inventory */
  74. 	boolean  soundok;	/* ok to tell about sounds heard */
  75. 	boolean  sparkle;	/* show "resisting" special FX (Scott Bigham) */
  76. 	boolean  standout;	/* use standout for --More-- */
  77. 	boolean  time;		/* display elapsed 'time' */
  78. 	boolean  tombstone;	/* print tombstone */
  79. 	boolean  toptenwin;	/* ending list in window instead of stdout */
  80. 	boolean  verbose;	/* max battle info */
  81. 	boolean  prayconfirm;	/* confirm before praying */
  82. 	int	 end_top, end_around;	/* describe desired score list */
  83. 	unsigned ident;		/* social security number for each monster */
  84. 	unsigned moonphase;
  85. 	unsigned long suppress_alert;
  86. #define NEW_MOON	0
  87. #define FULL_MOON	4
  88. 	unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
  89. 	boolean  travel;	/* find way automatically to u.tx,u.ty */
  90. 	unsigned run;		/* 0: h (etc), 1: H (etc), 2: fh (etc) */
  91. 				/* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
  92. 				/* 8: travel */
  93. 	unsigned long warntype; /* warn_of_mon monster type M2 */
  94. 	int	 warnlevel;
  95. 	int	 djinni_count, ghost_count;	/* potion effect tuning */
  96. 	int	 pickup_burden;		/* maximum burden before prompt */
  97. 	char	 inv_order[MAXOCLASSES];
  98. 	char	 pickup_types[MAXOCLASSES];
  99. #define NUM_DISCLOSURE_OPTIONS		5
  100. #define DISCLOSE_PROMPT_DEFAULT_YES	'y'
  101. #define DISCLOSE_PROMPT_DEFAULT_NO	'n'
  102. #define DISCLOSE_YES_WITHOUT_PROMPT	'+'
  103. #define DISCLOSE_NO_WITHOUT_PROMPT	'-'
  104. 	char	 end_disclose[NUM_DISCLOSURE_OPTIONS + 1];  /* disclose various info
  105. 								upon exit */
  106. 	char	 menu_style;	/* User interface style setting */
  107. #ifdef AMII_GRAPHICS
  108. 	int numcols;
  109. 	unsigned short amii_dripens[ 20 ]; /* DrawInfo Pens currently there are 13 in v39 */
  110. 	AMII_COLOR_TYPE amii_curmap[ AMII_MAXCOLORS ]; /* colormap */
  111. #endif
  112.  
  113. 	/* KMH, role patch -- Variables used during startup.
  114. 	 *
  115. 	 * If the user wishes to select a role, race, gender, and/or alignment
  116. 	 * during startup, the choices should be recorded here.  This
  117. 	 * might be specified through command-line options, environmental
  118. 	 * variables, a popup dialog box, menus, etc.
  119. 	 *
  120. 	 * These values are each an index into an array.  They are not
  121. 	 * characters or letters, because that limits us to 26 roles.
  122. 	 * They are not booleans, because someday someone may need a neuter
  123. 	 * gender.  Negative values are used to indicate that the user
  124. 	 * hasn't yet specified that particular value.	If you determine
  125. 	 * that the user wants a random choice, then you should set an
  126. 	 * appropriate random value; if you just left the negative value,
  127. 	 * the user would be asked again!
  128. 	 *
  129. 	 * These variables are stored here because the u structure is
  130. 	 * cleared during character initialization, and because the
  131. 	 * flags structure is restored for saved games.  Thus, we can
  132. 	 * use the same parameters to build the role entry for both
  133. 	 * new and restored games.
  134. 	 *
  135. 	 * These variables should not be referred to after the character
  136. 	 * is initialized or restored (specifically, after role_init()
  137. 	 * is called).
  138. 	 */
  139. 	int	 initrole;	/* starting role      (index into roles[])   */
  140. 	int	 initrace;	/* starting race      (index into races[])   */
  141. 	int	 initgend;	/* starting gender    (index into genders[]) */
  142. 	int	 initalign;	/* starting alignment (index into aligns[])  */
  143. 	int	 randomall;	/* randomly assign everything not specified */
  144. 	int	 pantheon;	/* deity selection for priest character */
  145. };
  146.  
  147. /*
  148. * Flags that are set each time the game is started.
  149. * These are not saved with the game.
  150. *
  151. */
  152.  
  153. struct instance_flags {
  154. 	boolean  cbreak;	/* in cbreak mode, rogue format */
  155. 	boolean  DECgraphics;	/* use DEC VT-xxx extended character set */
  156. 	boolean  echo;		/* 1 to echo characters */
  157. 	boolean  IBMgraphics;	/* use IBM extended character set */
  158. 	unsigned msg_history;	/* hint: # of top lines to save */
  159. 	boolean  num_pad;	/* use numbers for movement commands */
  160. 	boolean  news;		/* print news */
  161. 	boolean  window_inited; /* true if init_nhwindows() completed */
  162. 	boolean  vision_inited; /* true if vision is ready */
  163. 	boolean  menu_tab_sep;	/* Use tabs to separate option menu fields */
  164. 	boolean  menu_requested; /* Flag for overloaded use of 'm' prefix
  165. 				  * on some non-move commands */
  166. 	uchar num_pad_mode;
  167. 	int	menu_headings;	/* ATR for menu headings */
  168. 	int      purge_monsters;	/* # of dead monsters still on fmon list */
  169. 	int *opt_booldup;	/* for duplication of boolean opts in config file */
  170. 	int *opt_compdup;	/* for duplication of compound opts in config file */
  171. 	uchar	bouldersym;	/* symbol for boulder display */
  172. 	boolean travel1;	/* first travel step */
  173. 	coord	travelcc;	/* coordinates for travel_cache */
  174. #ifdef WIZARD
  175. 	boolean  sanity_check;	/* run sanity checks */
  176. 	boolean  mon_polycontrol;	/* debug: control monster polymorphs */
  177. #endif
  178. #ifdef TTY_GRAPHICS
  179. 	char prevmsg_window;	/* type of old message window to use */
  180. 	boolean  extmenu;	/* extended commands use menu interface */
  181. #endif
  182. #ifdef MFLOPPY
  183. 	boolean  checkspace;	/* check disk space before writing files */
  184. 				/* (in iflags to allow restore after moving
  185. 				 * to >2GB partition) */
  186. #endif
  187. #ifdef MICRO
  188. 	boolean  BIOS;		/* use IBM or ST BIOS calls when appropriate */
  189. #endif
  190. #if defined(MICRO) || defined(WIN32)
  191. 	boolean  rawio;		/* whether can use rawio (IOCTL call) */
  192. #endif
  193. #ifdef MAC_GRAPHICS_ENV
  194. 	boolean  MACgraphics;	/* use Macintosh extended character set, as
  195. 				   as defined in the special font HackFont */
  196. 	unsigned  use_stone;		/* use the stone ppats */
  197. #endif
  198. #if defined(MSDOS) || defined(WIN32)
  199. 	boolean hassound;	/* has a sound card */
  200. 	boolean usesound;	/* use the sound card */
  201. 	boolean usepcspeaker;	/* use the pc speaker */
  202. 	boolean tile_view;
  203. 	boolean over_view;
  204. 	boolean traditional_view;
  205. #endif
  206. #ifdef MSDOS
  207. 	boolean hasvga;		/* has a vga adapter */
  208. 	boolean usevga;		/* use the vga adapter */
  209. 	boolean grmode;		/* currently in graphics mode */
  210. #endif
  211. #ifdef LAN_FEATURES
  212. 	boolean lan_mail;	/* mail is initialized */
  213. 	boolean lan_mail_fetched; /* mail is awaiting display */
  214. #endif
  215. /*
  216. * Window capability support.
  217. */
  218. 	boolean wc_color;		/* use color graphics                  */
  219. 	boolean wc_hilite_pet;		/* hilight pets                        */
  220. 	boolean wc_ascii_map;		/* show map using traditional ascii    */
  221. 	boolean wc_tiled_map;		/* show map using tiles                */
  222. 	boolean wc_preload_tiles;	/* preload tiles into memory           */
  223. 	int	wc_tile_width;		/* tile width                          */
  224. 	int	wc_tile_height;		/* tile height                         */
  225. 	char	*wc_tile_file;		/* name of tile file;overrides default */
  226. 	boolean wc_inverse;		/* use inverse video for some things   */
  227. 	int	wc_align_status;	/*  status win at top|bot|right|left   */
  228. 	int	wc_align_message;	/* message win at top|bot|right|left   */
  229. 	int     wc_vary_msgcount;	/* show more old messages at a time    */
  230. 	char    *wc_foregrnd_menu;	/* points to foregrnd color name for menu win   */
  231. 	char    *wc_backgrnd_menu;	/* points to backgrnd color name for menu win   */
  232. 	char    *wc_foregrnd_message;	/* points to foregrnd color name for msg win    */
  233. 	char    *wc_backgrnd_message;	/* points to backgrnd color name for msg win    */
  234. 	char    *wc_foregrnd_status;	/* points to foregrnd color name for status win */
  235. 	char    *wc_backgrnd_status;	/* points to backgrnd color name for status win */
  236. 	char    *wc_foregrnd_text;	/* points to foregrnd color name for text win   */
  237. 	char    *wc_backgrnd_text;	/* points to backgrnd color name for text win   */
  238. 	char    *wc_font_map;		/* points to font name for the map win */
  239. 	char    *wc_font_message;	/* points to font name for message win */
  240. 	char    *wc_font_status;	/* points to font name for status win  */
  241. 	char    *wc_font_menu;		/* points to font name for menu win    */
  242. 	char    *wc_font_text;		/* points to font name for text win    */
  243. 	int     wc_fontsiz_map;		/* font size for the map win           */
  244. 	int     wc_fontsiz_message;	/* font size for the message window    */
  245. 	int     wc_fontsiz_status;	/* font size for the status window     */
  246. 	int     wc_fontsiz_menu;	/* font size for the menu window       */
  247. 	int     wc_fontsiz_text;	/* font size for text windows          */
  248. 	int	wc_scroll_amount;	/* scroll this amount at scroll_margin */
  249. 	int	wc_scroll_margin;	/* scroll map when this far from
  250. 						the edge */
  251. 	int	wc_map_mode;		/* specify map viewing options, mostly
  252. 						for backward compatibility */
  253. 	int	wc_player_selection;	/* method of choosing character */
  254. 	boolean	wc_splash_screen;	/* display an opening splash screen or not */
  255. 	boolean	wc_popup_dialog;	/* put queries in pop up dialogs instead of
  256. 				   		in the message window */
  257. 	boolean wc_eight_bit_input;	/* allow eight bit input               */
  258. 	boolean wc_mouse_support;	/* allow mouse support */
  259. 	boolean wc2_fullscreen;		/* run fullscreen */
  260. 	boolean wc2_softkeyboard;	/* use software keyboard */
  261. 	boolean wc2_wraptext;		/* wrap text */
  262.  
  263. 	boolean  cmdassist;	/* provide detailed assistance for some commands */
  264. 	boolean	 obsolete;	/* obsolete options can point at this, it isn't used */
  265. 	/* Items which belong in flags, but are here to allow save compatibility */
  266. 	boolean  lootabc;	/* use "a/b/c" rather than "o/i/b" when looting */
  267. 	boolean  showrace;	/* show hero glyph by race rather than by role */
  268. 	boolean  travelcmd;	/* allow travel command */
  269. 	int	 runmode;	/* update screen display during run moves */
  270. #ifdef AUTOPICKUP_EXCEPTIONS
  271. 	struct autopickup_exception *autopickup_exceptions[2];
  272. #define AP_LEAVE 0
  273. #define AP_GRAB	 1
  274. #endif
  275. #ifdef WIN32CON
  276. #define MAX_ALTKEYHANDLER 25
  277. 	char	 altkeyhandler[MAX_ALTKEYHANDLER];
  278. #endif
  279. };
  280.  
  281. /*
  282. * Old deprecated names
  283. */
  284. #ifdef TTY_GRAPHICS
  285. #define eight_bit_tty wc_eight_bit_input
  286. #endif
  287. #ifdef TEXTCOLOR
  288. #define use_color wc_color
  289. #endif
  290. #define hilite_pet wc_hilite_pet
  291. #define use_inverse wc_inverse
  292. #ifdef MAC_GRAPHICS_ENV
  293. #define large_font obsolete
  294. #endif
  295. #ifdef MAC
  296. #define popup_dialog wc_popup_dialog
  297. #endif
  298. #define preload_tiles wc_preload_tiles
  299.  
  300. extern NEARDATA struct flag flags;
  301. extern NEARDATA struct instance_flags iflags;
  302.  
  303. /* runmode options */
  304. #define RUN_TPORT	0	/* don't update display until movement stops */
  305. #define RUN_LEAP	1	/* update display every 7 steps */
  306. #define RUN_STEP	2	/* update display every single step */
  307. #define RUN_CRAWL	3	/* walk w/ extra delay after each update */
  308.  
  309. #endif /* FLAG_H */