OSDN Git Service

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