OSDN Git Service

This commit was manufactured by cvs2svn to create tag
[hengband/hengband.git] / src / variable.c
1 /* File: variable.c */
2
3 /*
4  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
5  *
6  * This software may be copied and distributed for educational, research,
7  * and not for profit purposes provided that this copyright and statement
8  * are included in all such copies.  Other copyrights may also apply.
9  */
10
11 /* Purpose: Angband variables */
12
13 #include "angband.h"
14
15
16 /*
17  * Hack -- Link a copyright message into the executable
18  */
19 cptr copyright[5] =
20 {
21         "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke",
22         "",
23         "This software may be copied and distributed for educational, research,",
24         "and not for profit purposes provided that this copyright and statement",
25         "are included in all such copies."
26 };
27
28
29 int max_macrotrigger = 0;
30 cptr macro_template = NULL;
31 cptr macro_modifier_chr;
32 cptr macro_modifier_name[MAX_MACRO_MOD];
33 cptr macro_trigger_name[MAX_MACRO_TRIG];
34 cptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
35
36 /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ë¾å¾ºÎ̤òɽ¼¨¤¹¤ë¤Î¤Ë»È¤¦ */
37 int level_up = 0;
38
39 /* 
40  *  List for auto-picker/destroyer entries
41  */
42 int max_autopick = 0;
43 autopick_type autopick_list[MAX_AUTOPICK];
44
45 /*
46  * Savefile version
47  */
48 byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
49 byte h_ver_minor;
50 byte h_ver_patch;
51 byte h_ver_extra;
52
53 byte sf_extra;          /* Savefile's encoding key */
54
55 byte z_major;           /* Savefile version for Hengband */
56 byte z_minor;
57 byte z_patch;
58
59 /*
60  * Savefile information
61  */
62 u32b sf_system;                 /* Operating system info */
63 u32b sf_when;                   /* Time when savefile created */
64 u16b sf_lives;                  /* Number of past "lives" with this file */
65 u16b sf_saves;                  /* Number of "saves" during this life */
66
67 /*
68  * Run-time arguments
69  */
70 bool arg_fiddle;                        /* Command arg -- Request fiddle mode */
71 bool arg_wizard;                        /* Command arg -- Request wizard mode */
72 bool arg_sound;                         /* Command arg -- Request special sounds */
73 byte arg_graphics;                      /* Command arg -- Request graphics mode */
74 bool arg_monochrome;            /* Command arg -- Request monochrome mode */
75 bool arg_force_original;        /* Command arg -- Request original keyset */
76 bool arg_force_roguelike;       /* Command arg -- Request roguelike keyset */
77 bool arg_bigtile = FALSE;       /* Command arg -- Request big tile mode */
78
79 /*
80  * Various things
81  */
82 bool character_generated;       /* The character exists */
83 bool character_dungeon;         /* The character has a dungeon */
84 bool character_loaded;          /* The character was loaded from a savefile */
85 bool character_saved;           /* The character was just saved to a savefile */
86
87 bool character_icky;            /* The game is in an icky full screen mode */
88 bool character_xtra;            /* The game is in an icky startup mode */
89
90 u32b seed_flavor;               /* Hack -- consistent object colors */
91 u32b seed_town;                 /* Hack -- consistent town layout */
92
93 s16b command_cmd;               /* Current "Angband Command" */
94
95 s16b command_arg;               /* Gives argument of current command */
96 s16b command_rep;               /* Gives repetition of current command */
97 s16b command_dir;               /* Gives direction of current command */
98
99 s16b command_see;               /* See "object1.c" */
100 s16b command_wrk;               /* See "object1.c" */
101
102 s16b command_gap = 999;         /* See "object1.c" */
103
104 s16b command_new;               /* Command chaining from inven/equip view */
105
106 s16b energy_use;                /* Energy use this turn */
107
108 bool msg_flag;                  /* Used in msg_print() for "buffering" */
109
110 s16b running;                   /* Current counter for running, if any */
111 s16b resting;                   /* Current counter for resting, if any */
112
113 s16b cur_hgt;                   /* Current dungeon height */
114 s16b cur_wid;                   /* Current dungeon width */
115 s16b dun_level;                 /* Current dungeon level */
116 s16b num_repro;                 /* Current reproducer count */
117 s16b object_level;              /* Current object creation level */
118 s16b monster_level;             /* Current monster creation level */
119 s16b base_level;        /* Base dungeon level */
120
121 s32b turn;                              /* Current game turn */
122 s32b turn_limit;                /* Limit of game turn */
123 s32b dungeon_turn;                      /* Game turn in dungeon */
124 s32b dungeon_turn_limit;        /* Limit of game turn in dungeon */
125 s32b old_turn;                  /* Turn when level began (feelings) */
126 s32b old_battle;
127
128 bool use_sound;                 /* The "sound" mode is enabled */
129 bool use_graphics;              /* The "graphics" mode is enabled */
130 bool use_bigtile = FALSE;
131
132 s16b signal_count;              /* Hack -- Count interupts */
133
134 bool inkey_base;                /* See the "inkey()" function */
135 bool inkey_xtra;                /* See the "inkey()" function */
136 bool inkey_scan;                /* See the "inkey()" function */
137 bool inkey_flag;                /* See the "inkey()" function */
138 bool inkey_special;             /* See the "inkey()" function */
139
140 s16b coin_type;                 /* Hack -- force coin type */
141
142 bool opening_chest;             /* Hack -- prevent chest generation */
143
144 bool shimmer_monsters;  /* Hack -- optimize multi-hued monsters */
145 bool shimmer_objects;   /* Hack -- optimize multi-hued objects */
146
147 bool repair_monsters;   /* Hack -- optimize detect monsters */
148 bool repair_objects;    /* Hack -- optimize detect objects */
149
150 s16b inven_nxt;                 /* Hack -- unused */
151 bool hack_mind;
152 bool hack_mutation;
153
154 s16b inven_cnt;                 /* Number of items in inventory */
155 s16b equip_cnt;                 /* Number of items in equipment */
156
157 s16b o_max = 1;                 /* Number of allocated objects */
158 s16b o_cnt = 0;                 /* Number of live objects */
159
160 s16b m_max = 1;                 /* Number of allocated monsters */
161 s16b m_cnt = 0;                 /* Number of live monsters */
162
163 s16b hack_m_idx = 0;    /* Hack -- see "process_monsters()" */
164 s16b hack_m_idx_ii = 0;
165 bool multi_rew = FALSE;
166 char summon_kin_type;   /* Hack, by Julian Lighton: summon 'relatives' */
167
168 int total_friends = 0;
169 s32b total_friend_levels = 0;
170 s32b friend_align = 0;
171
172 int leaving_quest = 0;
173 bool reinit_wilderness = FALSE;
174
175
176 /*
177  * Software options (set via the '=' command).  See "tables.c"
178  */
179
180
181 /* Option Set 1 -- User Interface */
182
183 bool rogue_like_commands;       /* Rogue-like commands */
184 bool quick_messages;            /* Activate quick messages */
185 bool auto_more;
186 bool command_menu;
187 bool other_query_flag;          /* Prompt for various information */
188 bool carry_query_flag;          /* Prompt before picking things up */
189 bool use_old_target;            /* Use old target by default */
190 bool always_pickup;                     /* Pick things up by default */
191 bool always_repeat;                     /* Repeat obvious commands */
192 bool depth_in_feet;                     /* Show dungeon level in feet */
193
194 bool stack_force_notes;         /* Merge inscriptions when stacking */
195 bool stack_force_costs;         /* Merge discounts when stacking */
196
197 bool show_labels;                       /* Show labels in object listings */
198 bool show_weights;                      /* Show weights in object listings */
199 bool show_choices;                      /* Show choices in certain sub-windows */
200
201 bool ring_bell;                         /* Ring the bell (on errors, etc) */
202
203 bool show_item_graph;
204
205
206 /* Option Set 2 -- Disturbance */
207
208 bool find_ignore_stairs;        /* Run past stairs */
209 bool find_ignore_doors;         /* Run through open doors */
210 bool find_cut;                          /* Run past known corners */
211 bool find_examine;                      /* Run into potential corners */
212
213 bool disturb_move;                      /* Disturb whenever any monster moves */
214 bool disturb_near;                      /* Disturb whenever viewable monster moves */
215 bool disturb_high;                      /* Disturb whenever high-level monster moves */
216 bool disturb_panel;                     /* Disturb whenever map panel changes */
217 bool disturb_state;                     /* Disturn whenever player state changes */
218 bool disturb_minor;                     /* Disturb whenever boring things happen */
219
220 bool alert_hitpoint;            /* Alert user to critical hitpoints */
221 bool disturb_trap_detect;       /* Disturb when leaving trap detected area */
222 bool alert_trap_detect;         /* Alert when leaving trap detected area */
223 bool last_words;                /* Get last words upon dying */
224 bool over_exert;
225 bool small_levels;              /* Allow unusually small dungeon levels */
226 bool always_small_levels;               /* Use always unusually small dungeon levels */
227 bool empty_levels;              /* Allow empty 'arena' levels */
228 bool bound_walls_perm;          /* Boundary walls are created by permanent wall */
229 bool player_symbols;            /* Use varying symbols for the player char */
230 bool equippy_chars;             /* Back by popular demand... */
231 bool display_mutations;         /* Skip mutations screen even if we have it */
232 bool plain_descriptions;        /* Plain object descriptions */
233 bool confirm_destroy;           /* Known worthless items are destroyed without confirmation */
234 bool confirm_quest;             /* Prompt before staircases... */
235 bool confirm_wear;              /* Confirm before putting on known cursed items */
236 bool disturb_pets;              /* Pets moving nearby disturb us */
237
238
239
240 /* Option Set 3 -- Game-Play */
241
242 bool manual_haggle;                     /* Auto-haggle in stores */
243
244 bool auto_scum;                         /* Auto-scum for good levels */
245
246 bool stack_allow_items;         /* Allow weapons and armor to stack */
247
248 bool expand_look;                       /* Expand the power of the look command */
249 bool expand_list;                       /* Expand the power of the list commands */
250
251 bool view_perma_grids;          /* Map remembers all perma-lit grids */
252 bool view_torch_grids;          /* Map remembers all torch-lit grids */
253 bool view_unsafe_grids;         /* Map marked by detect traps */
254
255 bool dungeon_align;                     /* Generate dungeons with aligned rooms */
256
257 bool track_follow;                      /* Monsters follow the player */
258 bool track_target;                      /* Monsters target the player */
259
260 bool smart_learn;                       /* Monsters learn from their mistakes */
261 bool smart_cheat;                       /* Monsters exploit player weaknesses */
262
263
264 /* Option Set 4 -- Efficiency */
265
266 bool view_reduce_lite;          /* Reduce lite-radius when running */
267 bool view_reduce_view;          /* Reduce view-radius in town */
268
269 bool check_abort;                       /* Avoid checking for user abort */
270
271 bool flush_failure;                     /* Flush input on any failure */
272 bool flush_disturb;                     /* Flush input on disturbance */
273
274 bool fresh_before;                      /* Flush output before normal commands */
275 bool fresh_after;                       /* Flush output after normal commands */
276 bool fresh_message;                     /* Flush output after all messages */
277
278 bool compress_savefile;         /* Compress messages in savefiles */
279
280 bool hilite_player;                     /* Hilite the player with the cursor */
281
282 bool view_yellow_lite;          /* Use special colors for torch-lit grids */
283 bool view_bright_lite;          /* Use special colors for 'viewable' grids */
284
285 bool view_granite_lite;         /* Use special colors for wall grids (slow) */
286 bool view_special_lite;         /* Use special colors for floor grids (slow) */
287 bool new_ascii_graphics;
288 bool display_path;
289 bool target_pet;
290 bool plain_pickup;
291
292 bool always_show_list;
293 bool powerup_home;
294 bool change_numeral;
295 bool send_score;
296 bool allow_debug_opts;   /* Allow use of debug/cheat options */
297
298 /* Cheating options */
299
300 bool cheat_peek;                /* Peek into object creation */
301 bool cheat_hear;                /* Peek into monster creation */
302 bool cheat_room;                /* Peek into dungeon creation */
303 bool cheat_xtra;                /* Peek into something else */
304 bool cheat_know;                /* Know complete monster info */
305 bool cheat_live;                /* Allow player to avoid death */
306 bool cheat_save;                /* Ask for saving death */
307
308
309 /* Special options */
310
311 byte hitpoint_warn;             /* Hitpoint warning (0 to 9) */
312
313 byte delay_factor;              /* Delay factor (0 to 9) */
314
315 bool autosave_l;        /* Autosave before entering new levels */
316 bool autosave_t;        /* Timed autosave */
317 s16b autosave_freq;     /* Autosave frequency */
318
319
320 /*
321  * Dungeon variables
322  */
323
324 byte feeling;                   /* Most recent feeling */
325 s16b rating;                    /* Level's current rating */
326
327 bool good_item_flag;            /* True if "Artifact" on this level */
328
329 bool closing_flag;              /* Dungeon is closing */
330
331
332 /*
333  * Dungeon size info
334  */
335
336 s16b panel_row_min, panel_row_max;
337 s16b panel_col_min, panel_col_max;
338 s16b panel_col_prt, panel_row_prt;
339
340 /*
341  * Player location in dungeon
342  */
343 int py;
344 int px;
345
346 /*
347  * Targetting variables
348  */
349 s16b target_who;
350 s16b target_col;
351 s16b target_row;
352
353
354 /*
355  * User info
356  */
357 int player_uid;
358 int player_euid;
359 int player_egid;
360
361 /*
362  * Current player's character name
363  */
364 char player_name[32];
365
366 /*
367  * Stripped version of "player_name"
368  */
369 char player_base[32];
370
371
372 /*
373  * Buffer to hold the current savefile name
374  * 'savefile' holds full path name. 'savefile_base' holds only base name.
375  */
376 char savefile[1024];
377 char savefile_base[40];
378
379 /*
380  * Array of grids lit by player lite (see "cave.c")
381  */
382 s16b lite_n;
383 s16b lite_y[LITE_MAX];
384 s16b lite_x[LITE_MAX];
385
386 /*
387  * Array of grids lit by player lite (see "cave.c")
388  */
389 s16b mon_lite_n;
390 s16b mon_lite_y[MON_LITE_MAX];
391 s16b mon_lite_x[MON_LITE_MAX];
392
393 /*
394  * Array of grids viewable to the player (see "cave.c")
395  */
396 s16b view_n;
397 byte view_y[VIEW_MAX];
398 byte view_x[VIEW_MAX];
399
400 /*
401  * Array of grids for use by various functions (see "cave.c")
402  */
403 s16b temp_n;
404 byte temp_y[TEMP_MAX];
405 byte temp_x[TEMP_MAX];
406
407 /*
408  * Array of grids for delayed visual updating (see "cave.c")
409  */
410 s16b redraw_n = 0;
411 byte redraw_y[REDRAW_MAX];
412 byte redraw_x[REDRAW_MAX];
413
414
415 /*
416  * Number of active macros.
417  */
418 s16b macro__num;
419
420 /*
421  * Array of macro patterns [MACRO_MAX]
422  */
423 cptr *macro__pat;
424
425 /*
426  * Array of macro actions [MACRO_MAX]
427  */
428 cptr *macro__act;
429
430 /*
431  * Array of macro types [MACRO_MAX]
432  */
433 bool *macro__cmd;
434
435 /*
436  * Current macro action [1024]
437  */
438 char *macro__buf;
439
440
441 /*
442  * The number of quarks
443  */
444 s16b quark__num;
445
446 /*
447  * The pointers to the quarks [QUARK_MAX]
448  */
449 cptr *quark__str;
450
451
452 /*
453  * The next "free" index to use
454  */
455 u16b message__next;
456
457 /*
458  * The index of the oldest message (none yet)
459  */
460 u16b message__last;
461
462 /*
463  * The next "free" offset
464  */
465 u16b message__head;
466
467 /*
468  * The offset to the oldest used char (none yet)
469  */
470 u16b message__tail;
471
472 /*
473  * The array of offsets, by index [MESSAGE_MAX]
474  */
475 u16b *message__ptr;
476
477 /*
478  * The array of chars, by offset [MESSAGE_BUF]
479  */
480 char *message__buf;
481
482
483 /*
484  * The array of normal options
485  */
486 u32b option_flag[8];
487 u32b option_mask[8];
488
489
490 /*
491  * The array of window options
492  */
493 u32b window_flag[8];
494 u32b window_mask[8];
495
496
497 /*
498  * The array of window pointers
499  */
500 term *angband_term[8];
501
502
503 /*
504  * Standard window names
505  */
506 char angband_term_name[8][16] =
507 {
508         "Hengband",
509         "Term-1",
510         "Term-2",
511         "Term-3",
512         "Term-4",
513         "Term-5",
514         "Term-6",
515         "Term-7"
516 };
517
518
519 /*
520  * Global table of color definitions
521  */
522 byte angband_color_table[256][4] =
523 {
524         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
525         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
526         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
527         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
528         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
529         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
530         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
531         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
532         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
533         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
534         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
535         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
536         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
537         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
538         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
539         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
540 };
541
542
543 /*
544  * Standard sound names
545  */
546 char angband_sound_name[SOUND_MAX][16] =
547 {
548         "",
549         "hit",
550         "miss",
551         "flee",
552         "drop",
553         "kill",
554         "level",
555         "death",
556         "study",
557         "teleport",
558         "shoot",
559         "quaff",
560         "zap",
561         "walk",
562         "tpother",
563         "hitwall",
564         "eat",
565         "store1",
566         "store2",
567         "store3",
568         "store4",
569         "dig",
570         "opendoor",
571         "shutdoor",
572         "tplevel",
573         "scroll",
574         "buy",
575         "sell",
576         "warn",
577         "rocket",
578         "n_kill",
579         "u_kill",
580         "quest",
581         "heal",
582         "x_heal",
583         "bite",
584         "claw",
585         "m_spell",
586         "summon",
587         "breath",
588         "ball",
589         "m_heal",
590         "atkspell",
591         "evil",
592         "touch",
593         "sting",
594         "crush",
595         "slime",
596         "wail",
597         "winner",
598         "fire",
599         "acid",
600         "elec",
601         "cold",
602         "illegal",
603         "fail",
604         "wakeup",
605         "invuln",
606         "fall",
607         "pain",
608         "destitem",
609         "moan",
610         "show",
611         "unused",
612         "explode",
613 };
614
615
616 /*
617  * The array of "cave grids" [MAX_WID][MAX_HGT].
618  * Not completely allocated, that would be inefficient
619  * Not completely hardcoded, that would overflow memory
620  */
621 cave_type *cave[MAX_HGT];
622
623
624 /*
625  * The array of saved floors
626  */
627 saved_floor_type saved_floors[MAX_SAVED_FLOORS];
628
629
630 /*
631  * Number of floor_id used from birth
632  */
633 s16b max_floor_id;
634
635
636 /*
637  * Sign for current process used in temporal files.
638  * Actually it is the start time of current process.
639  */
640 u32b saved_floor_file_sign;
641
642
643 /*
644  * The array of dungeon items [max_o_idx]
645  */
646 object_type *o_list;
647
648 /*
649  * The array of dungeon monsters [max_m_idx]
650  */
651 monster_type *m_list;
652
653
654 /*
655  * Maximum number of towns
656  */
657 u16b max_towns;
658
659 /*
660  * The towns [max_towns]
661  */
662 town_type *town;
663
664
665 /*
666  * The player's inventory [INVEN_TOTAL]
667  */
668 object_type *inventory;
669
670
671 /*
672  * The size of "alloc_kind_table" (at most max_k_idx * 4)
673  */
674 s16b alloc_kind_size;
675
676 /*
677  * The entries in the "kind allocator table"
678  */
679 alloc_entry *alloc_kind_table;
680
681
682 /*
683  * The size of "alloc_race_table" (at most max_r_idx)
684  */
685 s16b alloc_race_size;
686
687 /*
688  * The entries in the "race allocator table"
689  */
690 alloc_entry *alloc_race_table;
691
692
693 /*
694  * Specify attr/char pairs for visual special effects
695  * Be sure to use "index & 0x7F" to avoid illegal access
696  */
697 byte misc_to_attr[256];
698 char misc_to_char[256];
699
700
701 /*
702  * Specify attr/char pairs for inventory items (by tval)
703  * Be sure to use "index & 0x7F" to avoid illegal access
704  */
705 byte tval_to_attr[128];
706 char tval_to_char[128];
707
708
709 /*
710  * Keymaps for each "mode" associated with each keypress.
711  */
712 cptr keymap_act[KEYMAP_MODES][256];
713
714
715
716 /*** Player information ***/
717
718 /*
719  * Static player info record
720  */
721 player_type p_body;
722
723 /*
724  * Pointer to the player info
725  */
726 player_type *p_ptr = &p_body;
727
728 /*
729  * Pointer to the player tables
730  * (sex, race, class, magic)
731  */
732 player_sex *sp_ptr;
733 player_race *rp_ptr;
734 player_class *cp_ptr;
735 player_seikaku *ap_ptr;
736 player_magic *mp_ptr;
737
738
739 /*
740  * The last character rolled,
741  * holded for quick start
742  */
743 birther previous_char;
744
745
746 /*
747  * The vault generation arrays
748  */
749 vault_type *v_info;
750 char *v_name;
751 char *v_text;
752
753 /*
754  * The skill table
755  */
756 skill_table *s_info;
757
758 /*
759  * The magic info
760  */
761 player_magic *m_info;
762
763 /*
764  * The terrain feature arrays
765  */
766 feature_type *f_info;
767 char *f_name;
768
769 /*
770  * The object kind arrays
771  */
772 object_kind *k_info;
773 char *k_name;
774 char *k_text;
775
776 /*
777  * The artifact arrays
778  */
779 artifact_type *a_info;
780 char *a_name;
781 char *a_text;
782
783 /*
784  * The ego-item arrays
785  */
786 ego_item_type *e_info;
787 char *e_name;
788 char *e_text;
789
790
791 /*
792  * The monster race arrays
793  */
794 monster_race *r_info;
795 char *r_name;
796 char *r_text;
797
798
799 /*
800  * The dungeon arrays
801  */
802 dungeon_info_type *d_info;
803 char *d_name;
804 char *d_text;
805
806
807 /*
808  * Hack -- The special Angband "System Suffix"
809  * This variable is used to choose an appropriate "pref-xxx" file
810  */
811 cptr ANGBAND_SYS = "xxx";
812
813 /*
814  * Hack -- The special Angband "Keyboard Suffix"
815  * This variable is used to choose an appropriate macro-trigger definition
816  */
817 #ifdef JP
818 cptr ANGBAND_KEYBOARD = "JAPAN";
819 #else
820 cptr ANGBAND_KEYBOARD = "0";
821 #endif
822
823 /*
824  * Hack -- The special Angband "Graphics Suffix"
825  * This variable is used to choose an appropriate "graf-xxx" file
826  */
827 cptr ANGBAND_GRAF = "ascii";
828
829 /*
830  * Path name: The main "lib" directory
831  * This variable is not actually used anywhere in the code
832  */
833 cptr ANGBAND_DIR;
834
835 /*
836  * High score files (binary)
837  * These files may be portable between platforms
838  */
839 cptr ANGBAND_DIR_APEX;
840
841 /*
842  * Bone files for player ghosts (ascii)
843  * These files are portable between platforms
844  */
845 cptr ANGBAND_DIR_BONE;
846
847 /*
848  * Binary image files for the "*_info" arrays (binary)
849  * These files are not portable between platforms
850  */
851 cptr ANGBAND_DIR_DATA;
852
853 /*
854  * Textual template files for the "*_info" arrays (ascii)
855  * These files are portable between platforms
856  */
857 cptr ANGBAND_DIR_EDIT;
858
859 /*
860  * Script files
861  * These files are portable between platforms.
862  */
863 cptr ANGBAND_DIR_SCRIPT;
864
865 /*
866  * Various extra files (ascii)
867  * These files may be portable between platforms
868  */
869 cptr ANGBAND_DIR_FILE;
870
871 /*
872  * Help files (normal) for the online help (ascii)
873  * These files are portable between platforms
874  */
875 cptr ANGBAND_DIR_HELP;
876
877 /*
878  * Help files (spoilers) for the online help (ascii)
879  * These files are portable between platforms
880  */
881 cptr ANGBAND_DIR_INFO;
882
883 /*
884  * Default user "preference" files (ascii)
885  * These files are rarely portable between platforms
886  */
887 cptr ANGBAND_DIR_PREF;
888
889 /*
890  * Savefiles for current characters (binary)
891  * These files are portable between platforms
892  */
893 cptr ANGBAND_DIR_SAVE;
894
895 /*
896  * User "preference" files (ascii)
897  * These files are rarely portable between platforms
898  */
899 cptr ANGBAND_DIR_USER;
900
901 /*
902  * Various extra files (binary)
903  * These files are rarely portable between platforms
904  */
905 cptr ANGBAND_DIR_XTRA;
906
907
908 /*
909  * Total Hack -- allow all items to be listed (even empty ones)
910  * This is only used by "do_cmd_inven_e()" and is cleared there.
911  */
912 bool item_tester_full;
913
914 bool item_tester_no_ryoute = FALSE;
915
916 /*
917  * Here is a "pseudo-hook" used during calls to "get_item()" and
918  * "show_inven()" and "show_equip()", and the choice window routines.
919  */
920 byte item_tester_tval;
921
922
923 /*
924  * Here is a "hook" used during calls to "get_item()" and
925  * "show_inven()" and "show_equip()", and the choice window routines.
926  */
927 bool (*item_tester_hook)(object_type*);
928
929
930
931 /*
932  * Current "comp" function for ang_sort()
933  */
934 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
935
936
937 /*
938  * Current "swap" function for ang_sort()
939  */
940 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
941
942
943
944 /*
945  * Hack -- function hooks to restrict "get_mon_num_prep()" function
946  */
947 monster_hook_type get_mon_num_hook;
948 monster_hook_type get_mon_num2_hook;
949
950
951 /*
952  * Hack -- function hook to restrict "get_obj_num_prep()" function
953  */
954 bool (*get_obj_num_hook)(int k_idx);
955
956
957 /* Hack, monk armour */
958 bool monk_armour_aux;
959 bool monk_notify_aux;
960
961 #ifdef ALLOW_EASY_OPEN /* TNB */
962 bool easy_open;
963 #endif /* ALLOW_EASY_OPEN -- TNB */
964
965 #ifdef ALLOW_EASY_DISARM /* TNB */
966 bool easy_disarm;
967 #endif /* ALLOW_EASY_DISARM -- TNB */
968
969 #ifdef ALLOW_EASY_FLOOR /* TNB */
970 bool easy_floor;
971 #endif /* ALLOW_EASY_FLOOR -- TNB */
972
973 bool use_command;
974 bool center_player;
975 bool center_running;
976
977 /* Auto-destruction options */
978 bool destroy_items;
979 bool destroy_feeling;
980 bool destroy_identify;
981 bool leave_worth;
982 bool leave_equip;
983 bool leave_wanted;
984 bool leave_corpse;
985 bool leave_junk;
986 bool leave_chest;
987 bool leave_special;
988
989 /* Nikki */
990 bool record_fix_art;
991 bool record_rand_art;
992 bool record_destroy_uniq;
993 bool record_fix_quest;
994 bool record_rand_quest;
995 bool record_maxdepth;
996 bool record_stair;
997 bool record_buy;
998 bool record_sell;
999 bool record_danger;
1000 bool record_arena;
1001 bool record_ident;
1002 bool record_named_pet;
1003 char record_o_name[MAX_NLEN];
1004 s32b record_turn;
1005
1006 /*
1007  * Wilderness
1008  */
1009 wilderness_type **wilderness;
1010
1011
1012 /*
1013  * Buildings
1014  */
1015 building_type building[MAX_BLDG];
1016
1017
1018 /*
1019  * Maximum number of quests
1020  */
1021 u16b max_quests;
1022
1023 /*
1024  * Maximum number of monsters in r_info.txt
1025  */
1026 u16b max_r_idx;
1027
1028 /*
1029  * Maximum number of items in k_info.txt
1030  */
1031 u16b max_k_idx;
1032
1033 /*
1034  * Maximum number of vaults in v_info.txt
1035  */
1036 u16b max_v_idx;
1037
1038 /*
1039  * Maximum number of terrain features in f_info.txt
1040  */
1041 u16b max_f_idx;
1042
1043 /*
1044  * Maximum number of artifacts in a_info.txt
1045  */
1046 u16b max_a_idx;
1047
1048 /*
1049  * Maximum number of ego-items in e_info.txt
1050  */
1051 u16b max_e_idx;
1052
1053 /*
1054  * Maximum number of dungeon in e_info.txt
1055  */
1056 u16b max_d_idx;
1057
1058 /*
1059  * Maximum number of objects in the level
1060  */
1061 u16b max_o_idx;
1062
1063 /*
1064  * Maximum number of monsters in the level
1065  */
1066 u16b max_m_idx;
1067
1068 /*
1069  * Maximum size of the wilderness
1070  */
1071 s32b max_wild_x;
1072 s32b max_wild_y;
1073
1074 /*
1075  * Quest info
1076  */
1077 quest_type *quest;
1078
1079 /*
1080  * Quest text
1081  */
1082 char quest_text[10][80];
1083
1084 /*
1085  * Current line of the quest text
1086  */
1087 int quest_text_line;
1088
1089 /*
1090  * Default spell color table (quark index)
1091  */
1092 s16b gf_color[MAX_GF];
1093
1094 /*
1095  * Flags for initialization
1096  */
1097 int init_flags;
1098
1099
1100 /*
1101  * The "highscore" file descriptor, if available.
1102  */
1103 int highscore_fd = -1;
1104
1105 int mutant_regenerate_mod = 100;
1106
1107 /*
1108  * Startup options
1109  */
1110 bool easy_band;
1111 bool vanilla_town;            /* Use "vanilla" town without set quests */
1112 bool ironman_shops;           /* Stores are permanently closed */
1113 bool ironman_small_levels;    /* Always create unusually small dungeon levels */
1114 bool ironman_downward;        /* Don't allow climbing upwards/recalling */
1115 bool ironman_autoscum;        /* Permanently enable the autoscummer */
1116 bool lite_town;               /* Use "lite" town without wilderness */
1117 bool ironman_empty_levels;    /* Always create empty 'arena' levels */
1118 bool ironman_rooms;           /* Always generate very unusual rooms */
1119 bool ironman_nightmare;                 /* Play the game in Nightmare mode */
1120 bool left_hander;
1121 bool preserve_mode;
1122 bool autoroller;
1123 bool autochara;
1124
1125
1126 bool can_save = FALSE;        /* Game can be saved */
1127
1128 s16b world_monster;
1129 bool world_player;
1130
1131 int cap_mon;
1132 int cap_mspeed;
1133 int cap_hp;
1134 int cap_maxhp;
1135 u16b cap_nickname;
1136
1137 s16b battle_mon[4];
1138 int sel_monster;
1139 int battle_odds;
1140 int kakekin;
1141 u32b mon_odds[4];
1142
1143 int pet_t_m_idx;
1144 int riding_t_m_idx;
1145
1146 s16b kubi_r_idx[MAX_KUBI];
1147 s16b today_mon;
1148
1149 monster_type party_mon[MAX_PARTY_MON];
1150
1151 bool write_level;
1152
1153 u32b playtime;
1154 u32b start_time;
1155
1156 int tsuri_dir;
1157
1158 bool sukekaku;
1159 bool new_mane;
1160
1161 bool mon_fight;
1162
1163 bool ambush_flag;
1164 bool generate_encounter;
1165
1166 cptr screen_dump = NULL;
1167
1168 /*
1169  * Which dungeon ?
1170  */
1171 byte dungeon_type;
1172 s16b *max_dlv;
1173
1174 byte feat_wall_outer;
1175 byte feat_wall_inner;
1176 byte feat_wall_solid;
1177 byte floor_type[100], fill_type[100];
1178
1179 bool now_damaged;
1180 s16b now_message;
1181 bool use_menu;
1182
1183 #ifdef CHUUKEI
1184 bool chuukei_server;
1185 bool chuukei_client;
1186 char *server_name;
1187 int server_port;
1188 #endif