OSDN Git Service

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