OSDN Git Service

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