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. */ 4 5 /* If you change the flag structure make sure you increment EDITLEVEL in */ 6 /* patchlevel.h if needed. Changing the instance_flags structure does */ 7 /* not require incrementing EDITLEVEL. */ 8 9 #ifndef FLAG_H 10 #define FLAG_H 11 12 /* 13 * Persistent flags that are saved and restored with the game. 14 * 15 */ 16 17 struct flag { 18 #ifdef AMIFLUSH 19 boolean altmeta; /* use ALT keys as META */ 20 boolean amiflush; /* kill typeahead */ 21 #endif 22 #ifdef MFLOPPY 23 boolean asksavedisk; 24 #endif 25 boolean autodig; /* MRKR: Automatically dig */ 26 boolean autoquiver; /* Automatically fill quiver */ 27 boolean autounlock; /* Automatically apply unlocking tool */ 28 boolean beginner; 29 #ifdef MAIL 30 boolean biff; /* enable checking for mail */ 31 #endif 32 boolean hint; /* enable Unclippy the helpful hint daemon */ 33 boolean botl; /* partially redo status line */ 34 boolean botlx; /* print an entirely new bottom line */ 35 boolean confirm; /* confirm before hitting tame monsters */ 36 boolean deathdropless; /* disable monsters dropping random items */ 37 boolean debug; /* in debugging mode */ 38 #define wizard flags.debug 39 #ifdef ELBERETH 40 boolean elberethignore; /* Elbereth ignores requests for protection */ 41 #endif 42 boolean end_own; /* list all own scores */ 43 boolean explore; /* in exploration mode */ 44 boolean tutorial; /* in tutorial mode */ 45 #ifdef OPT_DISPMAP 46 boolean fast_map; /* use optimized, less flexible map display */ 47 #endif 48 #define discover flags.explore 49 boolean female; 50 boolean forcefight; 51 boolean friday13; /* it's Friday the 13th */ 52 boolean help; /* look in data file for info about stuff */ 53 boolean hitpointbar; /* colourful hit point status bar */ 54 boolean ignintr; /* ignore interrupts */ 55 #ifdef INSURANCE 56 boolean ins_chkpt; /* checkpoint as appropriate */ 57 #endif 58 boolean invlet_constant; /* let objects keep their inventory symbol */ 59 boolean legacy; /* print game entry "story" */ 60 boolean lit_corridor; /* show a dark corr as lit if it is in sight */ 61 boolean made_amulet; 62 boolean mon_moving; /* monsters' turn to move */ 63 boolean move; 64 boolean mv; 65 boolean bypasses; /* bypass flag is set on at least one fobj */ 66 boolean nap; /* `timed_delay' option for display effects */ 67 boolean nopick; /* do not pickup objects (as when running) */ 68 boolean null; /* OK to send nulls to the terminal */ 69 #ifdef MAC 70 boolean page_wait; /* put up a --More-- after a page of messages */ 71 #endif 72 boolean perm_invent; /* keep full inventories up until dismissed */ 73 boolean pickup; /* whether you pickup or move and look */ 74 boolean pickup_dropped; /* don't auto-pickup items you dropped */ 75 boolean pickup_thrown; /* auto-pickup items you threw */ 76 77 boolean pushweapon; /* When wielding, push old weapon into second slot */ 78 boolean safe_dog; /* give complete protection to the dog */ 79 #ifdef EXP_ON_BOTL 80 boolean showexp; /* show experience points */ 81 #endif 82 boolean invweight; 83 boolean showweight; 84 #ifdef SCORE_ON_BOTL 85 boolean showscore; /* show score */ 86 #endif 87 boolean silent; /* whether the bell rings or not */ 88 boolean sortpack; /* sorted inventory */ 89 boolean soundok; /* ok to tell about sounds heard */ 90 boolean sparkle; /* show "resisting" special FX (Scott Bigham) */ 91 boolean standout; /* use standout for --More-- */ 92 boolean time; /* display elapsed 'time' */ 93 boolean tombstone; /* print tombstone */ 94 boolean toptenwin; /* ending list in window instead of stdout */ 95 boolean verbose; /* max battle info */ 96 boolean wounds; /* healers can see how badly monsters are damaged */ 97 boolean prayconfirm; /* confirm before praying */ 98 int end_top, end_around; /* describe desired score list */ 99 unsigned ident; /* social security number for each monster */ 100 unsigned moonphase; 101 unsigned long suppress_alert; 102 #define NEW_MOON 0 103 #define FULL_MOON 4 104 unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */ 105 boolean travel; /* find way automatically to u.tx,u.ty */ 106 unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */ 107 /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */ 108 /* 8: travel */ 109 unsigned long warntype; /* warn_of_mon monster type M2 */ 110 int warnlevel; 111 int djinni_count, ghost_count; /* potion effect tuning */ 112 int pickup_burden; /* maximum burden before prompt */ 113 char inv_order[MAXOCLASSES]; 114 char pickup_types[MAXOCLASSES]; 115 #define NUM_DISCLOSURE_OPTIONS 5 116 #define DISCLOSE_PROMPT_DEFAULT_YES 'y' 117 #define DISCLOSE_PROMPT_DEFAULT_NO 'n' 118 #define DISCLOSE_YES_WITHOUT_PROMPT '+' 119 #define DISCLOSE_NO_WITHOUT_PROMPT '-' 120 char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various info 121 upon exit */ 122 char menu_style; /* User interface style setting */ 123 #ifdef AMII_GRAPHICS 124 int numcols; 125 unsigned short amii_dripens[ 20 ]; /* DrawInfo Pens currently there are 13 in v39 */ 126 AMII_COLOR_TYPE amii_curmap[ AMII_MAXCOLORS ]; /* colormap */ 127 #endif 128 boolean bones; /* allow loading bones */ 129 boolean perma_hallu; /* let the player permanently hallucinate */ 130 131 /* KMH, role patch -- Variables used during startup. 132 * 133 * If the user wishes to select a role, race, gender, and/or alignment 134 * during startup, the choices should be recorded here. This 135 * might be specified through command-line options, environmental 136 * variables, a popup dialog box, menus, etc. 137 * 138 * These values are each an index into an array. They are not 139 * characters or letters, because that limits us to 26 roles. 140 * They are not booleans, because someday someone may need a neuter 141 * gender. Negative values are used to indicate that the user 142 * hasn't yet specified that particular value. If you determine 143 * that the user wants a random choice, then you should set an 144 * appropriate random value; if you just left the negative value, 145 * the user would be asked again! 146 * 147 * These variables are stored here because the u structure is 148 * cleared during character initialization, and because the 149 * flags structure is restored for saved games. Thus, we can 150 * use the same parameters to build the role entry for both 151 * new and restored games. 152 * 153 * These variables should not be referred to after the character 154 * is initialized or restored (specifically, after role_init() 155 * is called). 156 */ 157 int initrole; /* starting role (index into roles[]) */ 158 int initrace; /* starting race (index into races[]) */ 159 int initgend; /* starting gender (index into genders[]) */ 160 int initalign; /* starting alignment (index into aligns[]) */ 161 int randomall; /* randomly assign everything not specified */ 162 int pantheon; /* deity selection for priest character */ 163 164 /* --- initial roleplay flags --- 165 * These flags represent the player's conduct/roleplay 166 * intention at character creation. 167 * 168 * First the player can sets some of these at character 169 * creation. (via configuration-file, ..) 170 * Then role_init() may set/prevent certain combinations, 171 * e.g. Monks get the vegetarian flag, vegans should also be 172 * vegetarians, .. 173 * 174 * After that the initial flags shouldn't be modified. 175 * In u_init() the flags can be used to put some 176 * roleplay-intrinsics into the u structure. Only those 177 * should be modified during gameplay. 178 */ 179 boolean ascet; 180 boolean atheist; 181 boolean blindfolded; 182 boolean illiterate; 183 boolean pacifist; 184 boolean nudist; 185 boolean vegan; 186 boolean vegetarian; 187 188 /* Heaven or hell modes */ 189 boolean heaven_or_hell; /* player and monsters have max 1 HP and player has 3 lives */ 190 boolean hell_and_hell; /* like heaven_or_hell but only player has max 1 HP */ 191 }; 192 193 /* 194 * Flags that are set each time the game is started. 195 * These are not saved with the game. 196 * 197 */ 198 199 struct instance_flags { 200 boolean cbreak; /* in cbreak mode, rogue format */ 201 #ifdef CURSES_GRAPHICS 202 boolean cursesgraphics; /* Use portable curses extended characters */ 203 #endif 204 boolean DECgraphics; /* use DEC VT-xxx extended character set */ 205 boolean echo; /* 1 to echo characters */ 206 boolean IBMgraphics; /* use IBM extended character set */ 207 boolean UTF8graphics; /* use UTF-8 characters */ 208 unsigned msg_history; /* hint: # of top lines to save */ 209 boolean num_pad; /* use numbers for movement commands */ 210 boolean news; /* print news */ 211 boolean window_inited; /* true if init_nhwindows() completed */ 212 boolean vision_inited; /* true if vision is ready */ 213 boolean menu_tab_sep; /* Use tabs to separate option menu fields */ 214 boolean menu_requested; /* Flag for overloaded use of 'm' prefix 215 * on some non-move commands */ 216 uchar num_pad_mode; 217 int menu_headings; /* ATR for menu headings */ 218 int purge_monsters; /* # of dead monsters still on fmon list */ 219 int *opt_booldup; /* for duplication of boolean opts in config file */ 220 int *opt_compdup; /* for duplication of compound opts in config file */ 221 uchar bouldersym; /* symbol for boulder display */ 222 boolean autoexplore; /* in autoexplore */ 223 boolean travel1; /* first travel step */ 224 coord travelcc; /* coordinates for travel_cache */ 225 #ifdef QWERTZ 226 boolean qwertz_layout; /* swap y/z for this key layout */ 227 #endif 228 #ifdef SIMPLE_MAIL 229 boolean simplemail; /* simple mail format $NAME:$MESSAGE */ 230 #endif 231 #ifdef WIZARD 232 boolean sanity_check; /* run sanity checks */ 233 boolean mon_polycontrol; /* debug: control monster polymorphs */ 234 #endif 235 #ifdef TTY_GRAPHICS 236 char prevmsg_window; /* type of old message window to use */ 237 #endif 238 #if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS) 239 boolean extmenu; /* extended commands use menu interface */ 240 #endif 241 #ifdef MENU_COLOR 242 boolean use_menu_color; /* use color in menus; only if wc_color */ 243 #endif 244 #ifdef WIN_EDGE 245 boolean win_edge; /* are the menus aligned left&top */ 246 #endif 247 #if defined(STATUS_COLORS) && defined(TEXTCOLOR) 248 boolean use_status_colors; /* use color in status line; only if wc_color */ 249 #endif 250 #ifdef MFLOPPY 251 boolean checkspace; /* check disk space before writing files */ 252 /* (in iflags to allow restore after moving 253 * to >2GB partition) */ 254 #endif 255 #ifdef MICRO 256 boolean BIOS; /* use IBM or ST BIOS calls when appropriate */ 257 #endif 258 #if defined(MICRO) || defined(WIN32) 259 boolean rawio; /* whether can use rawio (IOCTL call) */ 260 #endif 261 #ifdef MAC_GRAPHICS_ENV 262 boolean MACgraphics; /* use Macintosh extended character set, as 263 as defined in the special font HackFont */ 264 unsigned use_stone; /* use the stone ppats */ 265 #endif 266 #if defined(MSDOS) || defined(WIN32) 267 boolean hassound; /* has a sound card */ 268 boolean usesound; /* use the sound card */ 269 boolean usepcspeaker; /* use the pc speaker */ 270 boolean tile_view; 271 boolean over_view; 272 boolean traditional_view; 273 #endif 274 #ifdef MSDOS 275 boolean hasvga; /* has a vga adapter */ 276 boolean usevga; /* use the vga adapter */ 277 boolean grmode; /* currently in graphics mode */ 278 #endif 279 #ifdef LAN_FEATURES 280 boolean lan_mail; /* mail is initialized */ 281 boolean lan_mail_fetched; /* mail is awaiting display */ 282 #endif 283 #ifdef SORTLOOT 284 char sortloot; /* sort items to loot alphabetically */ 285 #endif 286 #ifdef SHOW_BORN 287 boolean show_born; /* show numbers of created monsters */ 288 #endif 289 boolean showdmg; /* show damage */ 290 /* only set when PARANOID is defined */ 291 boolean paranoid_hit; /* Ask for 'yes' when hitting peacefuls */ 292 boolean paranoid_quit; /* Ask for 'yes' when quitting */ 293 boolean paranoid_remove; /* Always show menu for 'T' and 'R' */ 294 boolean paranoid_trap; /* Ask for 'yes' before walking into known traps */ 295 boolean paranoid_lava; /* Ask for 'yes' before walking into lava */ 296 boolean paranoid_water; /* Ask for 'yes' before walking into water */ 297 #ifdef QUIVER_FIRED 298 boolean quiver_fired; /* quiver with f command */ 299 #endif 300 /* 301 * Window capability support. 302 */ 303 boolean wc_color; /* use color graphics */ 304 boolean wc_hilite_pet; /* hilight pets */ 305 boolean wc_ascii_map; /* show map using traditional ascii */ 306 boolean wc_tiled_map; /* show map using tiles */ 307 boolean wc_preload_tiles; /* preload tiles into memory */ 308 int wc_tile_width; /* tile width */ 309 int wc_tile_height; /* tile height */ 310 char *wc_tile_file; /* name of tile file;overrides default */ 311 boolean wc_inverse; /* use inverse video for some things */ 312 int wc_align_status; /* status win at top|bot|right|left */ 313 int wc_align_message; /* message win at top|bot|right|left */ 314 int wc_vary_msgcount; /* show more old messages at a time */ 315 char *wc_foregrnd_menu; /* points to foregrnd color name for menu win */ 316 char *wc_backgrnd_menu; /* points to backgrnd color name for menu win */ 317 char *wc_foregrnd_message; /* points to foregrnd color name for msg win */ 318 char *wc_backgrnd_message; /* points to backgrnd color name for msg win */ 319 char *wc_foregrnd_status; /* points to foregrnd color name for status win */ 320 char *wc_backgrnd_status; /* points to backgrnd color name for status win */ 321 char *wc_foregrnd_text; /* points to foregrnd color name for text win */ 322 char *wc_backgrnd_text; /* points to backgrnd color name for text win */ 323 char *wc_font_map; /* points to font name for the map win */ 324 char *wc_font_message; /* points to font name for message win */ 325 char *wc_font_status; /* points to font name for status win */ 326 char *wc_font_menu; /* points to font name for menu win */ 327 char *wc_font_text; /* points to font name for text win */ 328 int wc_fontsiz_map; /* font size for the map win */ 329 int wc_fontsiz_message; /* font size for the message window */ 330 int wc_fontsiz_status; /* font size for the status window */ 331 int wc_fontsiz_menu; /* font size for the menu window */ 332 int wc_fontsiz_text; /* font size for text windows */ 333 int wc_scroll_amount; /* scroll this amount at scroll_margin */ 334 int wc_scroll_margin; /* scroll map when this far from 335 the edge */ 336 int wc_map_mode; /* specify map viewing options, mostly 337 for backward compatibility */ 338 int wc_player_selection; /* method of choosing character */ 339 boolean wc_splash_screen; /* display an opening splash screen or not */ 340 boolean wc_popup_dialog; /* put queries in pop up dialogs instead of 341 in the message window */ 342 boolean wc_eight_bit_input; /* allow eight bit input */ 343 boolean wc_mouse_support; /* allow mouse support */ 344 boolean wc2_fullscreen; /* run fullscreen */ 345 boolean wc2_softkeyboard; /* use software keyboard */ 346 boolean wc2_wraptext; /* wrap text */ 347 int wc2_term_cols; /* terminal width, in characters */ 348 int wc2_term_rows; /* terminal height, in characters */ 349 int wc2_windowborders; /* display borders on NetHack windows */ 350 int wc2_petattr; /* points to text attributes for pet */ 351 boolean wc2_guicolor; /* allow colors in GUI (outside map) */ 352 boolean wc2_newcolors; /* try to use slashem like colors including 353 * dark-gray to represent black object */ 354 355 boolean hp_notify; 356 char *hp_notify_fmt; 357 char *nameempty; /* what to automatically name known empty wands */ 358 boolean show_buc; /* always show BUC status */ 359 boolean cmdassist; /* provide detailed assistance for some commands */ 360 boolean obsolete; /* obsolete options can point at this, it isn't used */ 361 boolean rest_on_space; /* space means rest */ 362 /* Items which belong in flags, but are here to allow save compatibility */ 363 boolean lootabc; /* use "a/b/c" rather than "o/i/b" when looting */ 364 boolean showrace; /* show hero glyph by race rather than by role */ 365 boolean travelcmd; /* allow travel command */ 366 boolean show_dgn_name; /* show dungeon names instead of Dlvl: on bottom line */ 367 int runmode; /* update screen display during run moves */ 368 int pilesize; /* how many items to list automatically */ 369 #ifdef AUTOPICKUP_EXCEPTIONS 370 struct autopickup_exception *autopickup_exceptions[2]; 371 #define AP_LEAVE 0 372 #define AP_GRAB 1 373 #endif 374 #ifdef WIN32CON 375 #define MAX_ALTKEYHANDLER 25 376 char altkeyhandler[MAX_ALTKEYHANDLER]; 377 #endif 378 #ifdef REALTIME_ON_BOTL 379 boolean showrealtime; /* show actual elapsed time */ 380 #endif 381 #ifdef AUTO_OPEN 382 boolean autoopen; /* open doors by walking into them */ 383 #endif 384 boolean dark_room; /* show shadows in lit rooms */ 385 boolean vanilla_ui_behavior; /* fall back to vanilla behavior */ 386 boolean show_annotation; /* level annotation when entering level */ 387 int statuslines; /* number of status lines */ 388 }; 389 390 /* 391 * Old deprecated names 392 */ 393 #ifdef TTY_GRAPHICS 394 #define eight_bit_tty wc_eight_bit_input 395 #endif 396 #ifdef TEXTCOLOR 397 #define use_color wc_color 398 #endif 399 #define hilite_pet wc_hilite_pet 400 #define use_inverse wc_inverse 401 #ifdef MAC_GRAPHICS_ENV 402 #define large_font obsolete 403 #endif 404 #ifdef MAC 405 #define popup_dialog wc_popup_dialog 406 #endif 407 #define preload_tiles wc_preload_tiles 408 409 extern NEARDATA struct flag flags; 410 extern NEARDATA struct instance_flags iflags; 411 412 /* runmode options */ 413 #define RUN_TPORT 0 /* don't update display until movement stops */ 414 #define RUN_LEAP 1 /* update display every 7 steps */ 415 #define RUN_STEP 2 /* update display every single step */ 416 #define RUN_CRAWL 3 /* walk w/ extra delay after each update */ 417 418 #endif /* FLAG_H */ 419