OSDN Git Service

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