OSDN Git Service

se_info(技能熟練度)とwe_info(武器熟練度)をs_infoに統合。
[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 skill table
765  */
766 header *s_head;
767 skill_table *s_info;
768 char *s_name;
769 char *s_text;
770
771 /*
772  * The magic info
773  */
774 header *m_head;
775 player_magic *m_info;
776 char *m_name;
777 char *m_text;
778
779 /*
780  * The terrain feature arrays
781  */
782 header *f_head;
783 feature_type *f_info;
784 char *f_name;
785 #ifdef JP
786 char *E_f_name;         /* ±Ñ¸ìÃÏ·Á̾ */
787 #endif
788 char *f_text;
789
790 /*
791  * The object kind arrays
792  */
793 header *k_head;
794 object_kind *k_info;
795 char *k_name;
796 #ifdef JP
797 char *E_k_name;         /* ±Ñ¸ì¥¢¥¤¥Æ¥à̾ */
798 #endif
799 char *k_text;
800
801 /*
802  * The artifact arrays
803  */
804 header *a_head;
805 artifact_type *a_info;
806 char *a_name;
807 #ifdef JP
808 char *E_a_name;         /* ±Ñ¸ì¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È̾ */
809 #endif
810 char *a_text;
811
812 /*
813  * The ego-item arrays
814  */
815 header *e_head;
816 ego_item_type *e_info;
817 char *e_name;
818 #ifdef JP
819 char *E_e_name;         /* ±Ñ¸ì¡Ö̾¤Î¤¢¤ë¡×¥¢¥¤¥Æ¥à̾ */
820 #endif
821 char *e_text;
822
823
824 /*
825  * The monster race arrays
826  */
827 header *r_head;
828 monster_race *r_info;
829 char *r_name;
830 #ifdef JP
831 char *E_r_name;         /* ±Ñ¸ì¥â¥ó¥¹¥¿¡¼Ì¾ */
832 #endif
833 char *r_text;
834
835
836 /*
837  * The dungeon arrays
838  */
839 header *d_head;
840 dungeon_info_type *d_info;
841 char *d_name;
842 char *d_text;
843
844
845 /*
846  * Hack -- The special Angband "System Suffix"
847  * This variable is used to choose an appropriate "pref-xxx" file
848  */
849 cptr ANGBAND_SYS = "xxx";
850
851 /*
852  * Hack -- The special Angband "Keyboard Suffix"
853  * This variable is used to choose an appropriate macro-trigger definition
854  */
855 #ifdef JP
856 cptr ANGBAND_KEYBOARD = "JAPAN";
857 #else
858 cptr ANGBAND_KEYBOARD = "0";
859 #endif
860
861 /*
862  * Hack -- The special Angband "Graphics Suffix"
863  * This variable is used to choose an appropriate "graf-xxx" file
864  */
865 cptr ANGBAND_GRAF = "ascii";
866
867 /*
868  * Path name: The main "lib" directory
869  * This variable is not actually used anywhere in the code
870  */
871 cptr ANGBAND_DIR;
872
873 /*
874  * High score files (binary)
875  * These files may be portable between platforms
876  */
877 cptr ANGBAND_DIR_APEX;
878
879 /*
880  * Bone files for player ghosts (ascii)
881  * These files are portable between platforms
882  */
883 cptr ANGBAND_DIR_BONE;
884
885 /*
886  * Binary image files for the "*_info" arrays (binary)
887  * These files are not portable between platforms
888  */
889 cptr ANGBAND_DIR_DATA;
890
891 /*
892  * Textual template files for the "*_info" arrays (ascii)
893  * These files are portable between platforms
894  */
895 cptr ANGBAND_DIR_EDIT;
896
897 /*
898  * Script files
899  * These files are portable between platforms.
900  */
901 cptr ANGBAND_DIR_SCRIPT;
902
903 /*
904  * Various extra files (ascii)
905  * These files may be portable between platforms
906  */
907 cptr ANGBAND_DIR_FILE;
908
909 /*
910  * Help files (normal) for the online help (ascii)
911  * These files are portable between platforms
912  */
913 cptr ANGBAND_DIR_HELP;
914
915 /*
916  * Help files (spoilers) for the online help (ascii)
917  * These files are portable between platforms
918  */
919 cptr ANGBAND_DIR_INFO;
920
921 /*
922  * Default user "preference" files (ascii)
923  * These files are rarely portable between platforms
924  */
925 cptr ANGBAND_DIR_PREF;
926
927 /*
928  * Savefiles for current characters (binary)
929  * These files are portable between platforms
930  */
931 cptr ANGBAND_DIR_SAVE;
932
933 /*
934  * User "preference" files (ascii)
935  * These files are rarely portable between platforms
936  */
937 cptr ANGBAND_DIR_USER;
938
939 /*
940  * Various extra files (binary)
941  * These files are rarely portable between platforms
942  */
943 cptr ANGBAND_DIR_XTRA;
944
945
946 /*
947  * Total Hack -- allow all items to be listed (even empty ones)
948  * This is only used by "do_cmd_inven_e()" and is cleared there.
949  */
950 bool item_tester_full;
951
952 bool item_tester_no_ryoute = FALSE;
953
954 /*
955  * Here is a "pseudo-hook" used during calls to "get_item()" and
956  * "show_inven()" and "show_equip()", and the choice window routines.
957  */
958 byte item_tester_tval;
959
960
961 /*
962  * Here is a "hook" used during calls to "get_item()" and
963  * "show_inven()" and "show_equip()", and the choice window routines.
964  */
965 bool (*item_tester_hook)(object_type*);
966
967
968
969 /*
970  * Current "comp" function for ang_sort()
971  */
972 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
973
974
975 /*
976  * Current "swap" function for ang_sort()
977  */
978 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
979
980
981
982 /*
983  * Hack -- function hooks to restrict "get_mon_num_prep()" function
984  */
985 monster_hook_type get_mon_num_hook;
986 monster_hook_type get_mon_num2_hook;
987
988
989 /*
990  * Hack -- function hook to restrict "get_obj_num_prep()" function
991  */
992 bool (*get_obj_num_hook)(int k_idx);
993
994
995 /* Hack, monk armour */
996 bool monk_armour_aux;
997 bool monk_notify_aux;
998
999 #ifdef ALLOW_EASY_OPEN /* TNB */
1000 bool easy_open;
1001 #endif /* ALLOW_EASY_OPEN -- TNB */
1002
1003 #ifdef ALLOW_EASY_DISARM /* TNB */
1004 bool easy_disarm;
1005 #endif /* ALLOW_EASY_DISARM -- TNB */
1006
1007 #ifdef ALLOW_EASY_FLOOR /* TNB */
1008 bool easy_floor;
1009 #endif /* ALLOW_EASY_FLOOR -- TNB */
1010
1011 bool use_command;
1012 bool center_player;
1013 bool center_running;
1014
1015 /* Auto-destruction options */
1016 bool destroy_items;
1017 bool leave_worth;
1018 bool leave_equip;
1019 bool leave_wanted;
1020 bool leave_corpse;
1021 bool leave_junk;
1022 bool leave_chest;
1023
1024 /* Nikki */
1025 bool record_fix_art;
1026 bool record_rand_art;
1027 bool record_destroy_uniq;
1028 bool record_fix_quest;
1029 bool record_rand_quest;
1030 bool record_maxdeapth;
1031 bool record_stair;
1032 bool record_buy;
1033 bool record_sell;
1034 bool record_danger;
1035 bool record_arena;
1036 bool record_ident;
1037 bool record_named_pet;
1038 char record_o_name[MAX_NLEN];
1039 s32b record_turn;
1040
1041 /*
1042  * Wilderness
1043  */
1044 wilderness_type **wilderness;
1045
1046
1047 /*
1048  * Buildings
1049  */
1050 building_type building[MAX_BLDG];
1051
1052
1053 /*
1054  * Maximum number of quests
1055  */
1056 u16b max_quests;
1057
1058 /*
1059  * Maximum number of monsters in r_info.txt
1060  */
1061 u16b max_r_idx;
1062
1063 /*
1064  * Maximum number of items in k_info.txt
1065  */
1066 u16b max_k_idx;
1067
1068 /*
1069  * Maximum number of vaults in v_info.txt
1070  */
1071 u16b max_v_idx;
1072
1073 /*
1074  * Maximum number of terrain features in f_info.txt
1075  */
1076 u16b max_f_idx;
1077
1078 /*
1079  * Maximum number of artifacts in a_info.txt
1080  */
1081 u16b max_a_idx;
1082
1083 /*
1084  * Maximum number of ego-items in e_info.txt
1085  */
1086 u16b max_e_idx;
1087
1088 /*
1089  * Maximum number of dungeon in e_info.txt
1090  */
1091 u16b max_d_idx;
1092
1093 /*
1094  * Maximum number of objects in the level
1095  */
1096 u16b max_o_idx;
1097
1098 /*
1099  * Maximum number of monsters in the level
1100  */
1101 u16b max_m_idx;
1102
1103 /*
1104  * Maximum size of the wilderness
1105  */
1106 s32b max_wild_x;
1107 s32b max_wild_y;
1108
1109 /*
1110  * Quest info
1111  */
1112 quest_type *quest;
1113
1114 /*
1115  * Quest text
1116  */
1117 char quest_text[10][80];
1118
1119 /*
1120  * Current line of the quest text
1121  */
1122 int quest_text_line;
1123
1124 /*
1125  * Default spell color table (quark index)
1126  */
1127 s16b gf_color[MAX_GF];
1128
1129 /*
1130  * Flags for initialization
1131  */
1132 int init_flags;
1133
1134
1135 /*
1136  * The "highscore" file descriptor, if available.
1137  */
1138 int highscore_fd = -1;
1139
1140 /*
1141  * Should the monster allocation fail with inappropriate terrain?
1142  */
1143 bool monster_terrain_sensitive = TRUE;
1144
1145 int mutant_regenerate_mod = 100;
1146
1147 /*
1148  * Startup options
1149  */
1150 bool easy_band;
1151 bool vanilla_town;            /* Use "vanilla" town without set quests */
1152 bool ironman_shops;           /* Stores are permanently closed */
1153 bool ironman_small_levels;    /* Always create unusually small dungeon levels */
1154 bool ironman_downward;        /* Don't allow climbing upwards/recalling */
1155 bool ironman_autoscum;        /* Permanently enable the autoscummer */
1156 bool lite_town;               /* Use "lite" town without wilderness */
1157 bool ironman_empty_levels;    /* Always create empty 'arena' levels */
1158 bool terrain_streams;         /* Create terrain 'streamers' in the dungeon */
1159 bool munchkin_death;          /* Ask for saving death */
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 use_transparency = FALSE; /* Use transparent tiles */
1169
1170 bool can_save = FALSE;         /* Game can be saved */
1171
1172 s16b spell_exp[64];           /* mahou keikenchi */
1173
1174 s16b weapon_exp[5][64];       /* weapon keikenchi */
1175
1176 s16b skill_exp[10];           /* ginou keikenchi */
1177
1178 bool world_monster;
1179 bool world_player;
1180
1181 s16b mane_spell[MAX_MANE];
1182 s16b mane_dam[MAX_MANE];
1183 s16b mane_num;
1184
1185 int cap_mon;
1186 int cap_mspeed;
1187 int cap_hp;
1188 int cap_maxhp;
1189 u16b cap_nickname;
1190
1191 s16b battle_mon[4];
1192 int sel_monster;
1193 int battle_odds;
1194 int kakekin;
1195 u32b mon_odds[4];
1196
1197 int pet_t_m_idx;
1198 int riding_t_m_idx;
1199
1200 s16b kubi_r_idx[MAX_KUBI];
1201 s16b today_mon;
1202
1203 monster_type riding_mon;
1204 monster_type party_mon[20];
1205
1206 bool write_level;
1207
1208 u32b playtime;
1209 u32b start_time;
1210
1211 int tsuri_dir;
1212
1213 bool sukekaku;
1214 bool new_mane;
1215
1216 bool mon_fight;
1217
1218 bool ambush_flag;
1219 bool generate_encounter;
1220
1221 /*
1222  * Which dungeon ?
1223  */
1224 byte dungeon_type;
1225 s16b *max_dlv;
1226
1227 byte feat_wall_outer;
1228 byte feat_wall_inner;
1229 byte feat_wall_solid;
1230 byte floor_type[100], fill_type[100];
1231
1232 bool now_damaged;
1233 s16b now_message;
1234 bool use_menu;
1235
1236 #ifdef CHUUKEI
1237 bool chuukei_server;
1238 bool chuukei_client;
1239 char *server_name;
1240 int server_port;
1241 #endif