OSDN Git Service

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