OSDN Git Service

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